diff --git a/doc/img/AircraftFeature_atc_labels.png b/doc/img/AircraftFeature_atc_labels.png new file mode 100644 index 000000000..5fdcb269b Binary files /dev/null and b/doc/img/AircraftFeature_atc_labels.png differ diff --git a/plugins/channelrx/demodacars/acarsdemodgui.cpp b/plugins/channelrx/demodacars/acarsdemodgui.cpp index 7539705f7..de3c7ec71 100644 --- a/plugins/channelrx/demodacars/acarsdemodgui.cpp +++ b/plugins/channelrx/demodacars/acarsdemodgui.cpp @@ -870,10 +870,10 @@ AcarsDemodGUI::AcarsDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas ui(new Ui::AcarsDemodGUI), m_pluginAPI(pluginAPI), m_deviceUISet(deviceUISet), - m_deviceCenterFrequency(0), - m_basebandSampleRate(1), m_channelMarker(this), m_doApplySettings(true), + m_deviceCenterFrequency(0), + m_basebandSampleRate(1), m_tickCount(0), m_progressDialog(nullptr), m_tableTimer(nullptr), diff --git a/plugins/channelrx/demodacars/acarsdemodsink.cpp b/plugins/channelrx/demodacars/acarsdemodsink.cpp index cc307a12f..52106fa91 100644 --- a/plugins/channelrx/demodacars/acarsdemodsink.cpp +++ b/plugins/channelrx/demodacars/acarsdemodsink.cpp @@ -43,13 +43,13 @@ AcarsDemodSink::AcarsDemodSink(AcarsDemod *acarsDemod) : 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_demodPipeCheck(1), + m_scopeBufferIndex(0), + m_demodBufferFill(0) { m_demodBuffer.resize(1<<12); m_scopeBuffer.resize(m_scopeBufferSize); diff --git a/plugins/channelrx/demodacars/acarsdemodworker.cpp b/plugins/channelrx/demodacars/acarsdemodworker.cpp index 469f3c4dd..6f9bf5c0c 100644 --- a/plugins/channelrx/demodacars/acarsdemodworker.cpp +++ b/plugins/channelrx/demodacars/acarsdemodworker.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -485,7 +486,7 @@ static QDateTime oooiDateTime(const QDateTime& received, int day, const QTime& t } const QDate base = received.toUTC().date(); if ((day < 1) || (day > 31)) { - return QDateTime(base, time, Qt::UTC); + return QDateTime(base, time, QTimeZone::utc()); } for (int offset = 0; offset <= 2; offset++) { @@ -493,14 +494,14 @@ static QDateTime oooiDateTime(const QDateTime& received, int day, const QTime& t { const QDate d = base.addDays(sign * offset); if (d.day() == day) { - return QDateTime(d, time, Qt::UTC); + return QDateTime(d, time, QTimeZone::utc()); } if (offset == 0) { break; } } } - return QDateTime(base, time, Qt::UTC); + return QDateTime(base, time, QTimeZone::utc()); } // Recognise a weather report inside an ACARS message, and say which airport it is about. diff --git a/plugins/channelrx/demodacars/acarsmessagemodel.cpp b/plugins/channelrx/demodacars/acarsmessagemodel.cpp index d65fa739a..582158657 100644 --- a/plugins/channelrx/demodacars/acarsmessagemodel.cpp +++ b/plugins/channelrx/demodacars/acarsmessagemodel.cpp @@ -258,6 +258,22 @@ void AcarsMessageModel::setShowDate(bool showDate) +// beginFilterChange() was added in Qt 6.9 and endFilterChange() in Qt 6.10, and +// invalidateFilter() is deprecated in favour of the pair. Bracketing the change is +// what newer Qt wants - beginFilterChange() before the filter state is touched - so +// the call sites are written that way and these stand in on older Qt, where a single +// invalidateFilter() after the change is the whole operation. +#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0) +void AcarsMessageFilter::beginFilterChange() +{ +} + +void AcarsMessageFilter::endFilterChange() +{ + invalidateFilter(); +} +#endif + AcarsMessageFilter::AcarsMessageFilter(QObject *parent) : QSortFilterProxyModel(parent), m_hideNoInfo(true), @@ -271,19 +287,21 @@ void AcarsMessageFilter::setHideNoInfo(bool hide) if (hide == m_hideNoInfo) { return; } + beginFilterChange(); m_hideNoInfo = hide; - invalidateFilter(); + endFilterChange(); } void AcarsMessageFilter::setFilter(int column, const QString& pattern) { + beginFilterChange(); m_filterColumn = column; // Anchored, as the table's filter has always been - the pattern has to match the // whole cell rather than appear somewhere in it m_filterRe = QRegularExpression(QRegularExpression::anchoredPattern(pattern)); m_filterValid = !pattern.isEmpty() && m_filterRe.isValid() && (column >= 0) && (column < MESSAGE_COL_COUNT); - invalidateFilter(); + endFilterChange(); } // The base class would map a vertical section back to its source row, which with a diff --git a/plugins/channelrx/demodacars/acarsmessagemodel.h b/plugins/channelrx/demodacars/acarsmessagemodel.h index 47a9d524e..c6410c363 100644 --- a/plugins/channelrx/demodacars/acarsmessagemodel.h +++ b/plugins/channelrx/demodacars/acarsmessagemodel.h @@ -139,6 +139,13 @@ protected: bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override; bool lessThan(const QModelIndex& left, const QModelIndex& right) const override; + // Qt 6.10 brought these, deprecating invalidateFilter() in their favour. On + // anything older they stand in for it - see acarsmessagemodel.cpp +#if QT_VERSION < QT_VERSION_CHECK(6, 10, 0) + void beginFilterChange(); + void endFilterChange(); +#endif + private: bool m_hideNoInfo; int m_filterColumn; diff --git a/plugins/channelrx/demodacars/atn/asn1/OBJECT_IDENTIFIER.c b/plugins/channelrx/demodacars/atn/asn1/OBJECT_IDENTIFIER.c index fe0887f52..4af2e2b05 100644 --- a/plugins/channelrx/demodacars/atn/asn1/OBJECT_IDENTIFIER.c +++ b/plugins/channelrx/demodacars/atn/asn1/OBJECT_IDENTIFIER.c @@ -278,6 +278,8 @@ OBJECT_IDENTIFIER__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const int ret; (void)td; + /* Only read by the assert below, which NDEBUG compiles away */ + (void)chunk_end; arcs_count = OBJECT_IDENTIFIER_parse_arcs( (const char *)chunk_buf, chunk_size, arcs, diff --git a/plugins/channelrx/demodacars/atn/asn1/RELATIVE-OID.c b/plugins/channelrx/demodacars/atn/asn1/RELATIVE-OID.c index a61210111..480fdfb5f 100644 --- a/plugins/channelrx/demodacars/atn/asn1/RELATIVE-OID.c +++ b/plugins/channelrx/demodacars/atn/asn1/RELATIVE-OID.c @@ -101,6 +101,8 @@ RELATIVE_OID__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void int ret; (void)td; + /* Only read by the assert below, which NDEBUG compiles away */ + (void)chunk_end; arcs_count = OBJECT_IDENTIFIER_parse_arcs( (const char *)chunk_buf, chunk_size, diff --git a/plugins/channelrx/demodacars/atn/asn1/constr_SEQUENCE.c b/plugins/channelrx/demodacars/atn/asn1/constr_SEQUENCE.c index 9ded30508..c5c14913d 100644 --- a/plugins/channelrx/demodacars/atn/asn1/constr_SEQUENCE.c +++ b/plugins/channelrx/demodacars/atn/asn1/constr_SEQUENCE.c @@ -437,6 +437,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, phase3: ctx->phase = 3; + /* Fall through */ case 3: /* 00 and other tags expected */ case 4: /* only 00's expected */ diff --git a/plugins/channelrx/demodacars/atn/asn1/per_support.c b/plugins/channelrx/demodacars/atn/asn1/per_support.c index bf9b281b5..446de6a5c 100644 --- a/plugins/channelrx/demodacars/atn/asn1/per_support.c +++ b/plugins/channelrx/demodacars/atn/asn1/per_support.c @@ -302,6 +302,8 @@ int uper_put_constrained_whole_number_s(asn_per_outp_t *po, long v, int nbits) { long svalue = uvalue1; unsigned long uvalue2 = svalue; assert(uvalue1 == uvalue2); + /* Only read by the assert above, which NDEBUG compiles away */ + (void)uvalue2; return uper_put_constrained_whole_number_u(po, v, nbits); } diff --git a/plugins/channelrx/demodacars/atn/dumpvdl2shim.c b/plugins/channelrx/demodacars/atn/dumpvdl2shim.c index 255890a69..931849035 100644 --- a/plugins/channelrx/demodacars/atn/dumpvdl2shim.c +++ b/plugins/channelrx/demodacars/atn/dumpvdl2shim.c @@ -160,11 +160,14 @@ static void unknown_proto_format_text(la_vstring *vstr, void const *data, int in EOL(vstr); } +// Designated, as the descriptors in icao.c and xid.c are: la_type_descriptor ends +// in eight reserved function pointers, and positional initialisers leave those +// unmentioned, which -Wmissing-field-initializers reports static la_type_descriptor const proto_DEF_unknown = { - unknown_proto_format_text, // format_text - NULL, // destroy - NULL, // format_json - "unknown_proto" // json_key + .format_text = unknown_proto_format_text, + .destroy = NULL, + .format_json = NULL, + .json_key = "unknown_proto" }; la_proto_node *unknown_proto_pdu_new(void *buf, size_t len) diff --git a/plugins/channelrx/demodacars/readme.md b/plugins/channelrx/demodacars/readme.md index 0ef610b68..1c8cc99eb 100644 --- a/plugins/channelrx/demodacars/readme.md +++ b/plugins/channelrx/demodacars/readme.md @@ -59,6 +59,8 @@ the combo box next to the Mode selector: | 4 MHz | 128 | 4 MS/s | about half the band | | 8 MHz | 256 | 8 MS/s | all of it, tuned to 1623 MHz | +Received messages are forwarded to the [Aircraft feature](../../feature/aircraft/readme.md) for display on the [Map feature](../../feature/map/readme.md). +

Interface

![ACARS Demodulator plugin GUI](../../../doc/img/AcarsDemod_plugin.png) diff --git a/plugins/channelrx/demodadsb/adsbaircraft.h b/plugins/channelrx/demodadsb/adsbaircraft.h index dca5eb4c0..68c7c670f 100644 --- a/plugins/channelrx/demodadsb/adsbaircraft.h +++ b/plugins/channelrx/demodadsb/adsbaircraft.h @@ -296,7 +296,6 @@ struct ADSBAircraft { m_minCorrelation(INFINITY), m_maxCorrelation(-INFINITY), m_correlation(0.0f), - m_tcasAlert(false), m_aircraftInfo(nullptr), m_modelAltitudeOffset(0.0f), m_labelAltitudeOffset(5.0f), @@ -317,7 +316,8 @@ struct ADSBAircraft { m_isNew(true), m_positionChanged(false), m_trailCleared(false), - m_mapTrailResetPending(false) + m_mapTrailResetPending(false), + m_tcasAlert(false) { for (int i = 0; i < 2; i++) { m_cprValid[i] = false; diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index 1a8d99cfa..b176a973b 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -2445,10 +2445,11 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_basicSettingsShown(false), m_doApplySettings(true), m_tickCount(0), + m_trackAircraft(nullptr), m_aircraftInfo(nullptr), + m_loadingData(false), m_airportModel(this), m_airspaceModel(this), - m_trackAircraft(nullptr), m_highlightAircraft(nullptr), m_chart(nullptr), m_adsbFrameRateSeries(nullptr), @@ -2459,8 +2460,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_aircraftYAxis(nullptr), m_speech(nullptr), m_progressDialog(nullptr), - m_networkManager(nullptr), - m_loadingData(false) + m_networkManager(nullptr) { setAttribute(Qt::WA_DeleteOnClose, true); m_helpURL = "plugins/channelrx/demodadsb/readme.md"; diff --git a/plugins/channelrx/demodadsb/adsbdemodtracker.cpp b/plugins/channelrx/demodadsb/adsbdemodtracker.cpp index 9b7b292d3..c8ad1aee9 100644 --- a/plugins/channelrx/demodadsb/adsbdemodtracker.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodtracker.cpp @@ -40,11 +40,6 @@ ADSBDemodTracker::ADSBDemodTracker(ADSBDemod *adsbDemod) : 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), @@ -56,7 +51,12 @@ ADSBDemodTracker::ADSBDemodTracker(ADSBDemod *adsbDemod) : m_maxRangeStat(0.0f), m_maxAltitudeStat(0.0f), m_maxRateState(0.0f), - m_loadingData(false) + m_loadingData(false), + m_importNetworkManager(nullptr), + m_importTimer(nullptr), + m_importRequestGeneration(0), + m_importAuthenticationRetry(false), + m_flightInformation(nullptr) { qRegisterMetaType("ADSBAircraftUpdate"); qRegisterMetaType>("QList"); diff --git a/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp b/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp index de8f357cb..5e526739d 100644 --- a/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodtrackerdecode.cpp @@ -864,7 +864,6 @@ void ADSBDemodTracker::atcCallsign(ADSBAircraft *aircraft) if (!aircraft->m_aircraftInfo) { // Airline logo - QIcon *icon = nullptr; const QString airlinePath = AircraftInformation::getAirlineIconPath(airline->m_icao); if (!airlinePath.isEmpty()) { @@ -4914,7 +4913,10 @@ void ADSBDemodTracker::sendAircraftReport() aircraft->m_latitude, aircraft->m_longitude, aircraft->m_altitude, - aircraft->m_groundspeed + aircraft->m_groundspeed, + aircraft->m_positionValid, + aircraft->m_altitudeValid, + aircraft->m_groundspeedValid }; report.append(aircraftReport); diff --git a/plugins/feature/aircraft/readme.md b/plugins/feature/aircraft/readme.md index b173dc8f4..d4faea32a 100644 --- a/plugins/feature/aircraft/readme.md +++ b/plugins/feature/aircraft/readme.md @@ -5,7 +5,7 @@ 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), +Reports are received from the [ADS-B demodulator](../../channelrx/demodadsb/readme.md), the [ACARS demodulator](../../channelrx/demodacars/readme.md) (VHF ACARS, VDL Mode 2 HFDL, Aero and Iridium modes) and the [SELCAL demodulator](../../channelrx/demodselcal/readme.md), from any number of channels in any device set. @@ -69,7 +69,7 @@ without a report.

1: Find column

-Which field the Find box (2) looks in - All, ICAO, Reg, Type or Flight. +Which field the Find box (2) looks in - All, ICAO, Reg, Type, Callsign or SELCAL.

2: Find

@@ -93,10 +93,14 @@ a rule, the rule's speech text is read aloud and/or its command is executed, wit ${icao} ${reg} ${flight} ${type} ${protocol} substituted. Each rule fires at most once per aircraft. +![Notifications dialog](../../../doc/img/ADSBDemod_plugin_notifications.png) +

5: ATC

-When checked, aircraft labels on the Map show route, flight level, speed and type in -an ATC style; when unchecked just the flight number or registration is shown. +When checked, aircraft labels on the Map show callsign, flight level, speed and type in +an ATC style; when unchecked just the callsign or registration is shown. + +![ATC Labels](../../../doc/img/AircraftFeature_atc_labels.png)

6: Statistics

diff --git a/plugins/feature/map/Cesium/Cesium.js b/plugins/feature/map/Cesium/Cesium.js index 4ce75dc0d..5dff9276a 100644 --- a/plugins/feature/map/Cesium/Cesium.js +++ b/plugins/feature/map/Cesium/Cesium.js @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -"use strict";var Cesium=(()=>{var MYe=Object.create;var OA=Object.defineProperty;var wYe=Object.getOwnPropertyDescriptor;var kYe=Object.getOwnPropertyNames;var UYe=Object.getPrototypeOf,DYe=Object.prototype.hasOwnProperty;var OYe=(e,t,n)=>t in e?OA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $5=(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 bm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Cle=(e,t)=>{for(var n in t)OA(e,n,{get:t[n],enumerable:!0})},Vle=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of kYe(t))!DYe.call(e,o)&&o!==n&&OA(e,o,{get:()=>t[o],enumerable:!(i=wYe(t,o))||i.enumerable});return e};var x=(e,t,n)=>(n=e!=null?MYe(UYe(e)):{},Vle(t||!e||!e.__esModule?OA(n,"default",{value:e,enumerable:!0}):n,e)),BYe=e=>Vle(OA({},"__esModule",{value:!0}),e);var mt=(e,t,n)=>OYe(e,typeof t!="symbol"?t+"":t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MTJdPWUueCxpWzEzXT1lLnksaVsxNF09ZS56LGlbMTVdPXQueCxpWzE2XT1lLnksaVsxN109ZS56LGlbMThdPXQueCxpWzE5XT10LnksaVsyMF09ZS56LGlbMjFdPWUueCxpWzIyXT10LnksaVsyM109ZS56LGlbMjRdPXQueCxpWzI1XT1lLnksaVsyNl09ZS56LGlbMjddPXQueCxpWzI4XT10LnksaVsyOV09ZS56LGlbMzBdPXQueCxpWzMxXT10LnksaVszMl09dC56LGlbMzNdPXQueCxpWzM0XT1lLnksaVszNV09dC56LGlbMzZdPWUueCxpWzM3XT1lLnksaVszOF09ZS56LGlbMzldPWUueCxpWzQwXT10LnksaVs0MV09ZS56LGlbNDJdPWUueCxpWzQzXT10LnksaVs0NF09dC56LGlbNDVdPWUueCxpWzQ2XT1lLnksaVs0N109dC56LGlbNDhdPWUueCxpWzQ5XT10LnksaVs1MF09ZS56LGlbNTFdPXQueCxpWzUyXT10LnksaVs1M109ZS56LGlbNTRdPXQueCxpWzU1XT10LnksaVs1Nl09dC56LGlbNTddPWUueCxpWzU4XT10LnksaVs1OV09dC56LGlbNjBdPWUueCxpWzYxXT1lLnksaVs2Ml09ZS56LGlbNjNdPXQueCxpWzY0XT1lLnksaVs2NV09ZS56LGlbNjZdPXQueCxpWzY3XT1lLnksaVs2OF09dC56LGlbNjldPWUueCxpWzcwXT1lLnksaVs3MV09dC56LGEucG9zaXRpb249bmV3IGllKHtjb21wb25lbnREYXRhdHlwZTpuZS5ET1VCTEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczppfSkpLG8ubm9ybWFsKXtsZXQgYz1uZXcgRmxvYXQzMkFycmF5KDcyKTtjWzBdPTAsY1sxXT0wLGNbMl09MSxjWzNdPTAsY1s0XT0wLGNbNV09MSxjWzZdPTAsY1s3XT0wLGNbOF09MSxjWzldPTAsY1sxMF09MCxjWzExXT0xLGNbMTJdPTAsY1sxM109MCxjWzE0XT0tMSxjWzE1XT0wLGNbMTZdPTAsY1s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pLHJbMF09MCxyWzFdPTEsclsyXT0yLHJbM109MCxyWzRdPTIscls1XT0zLHJbNl09NixyWzddPTUscls4XT00LHJbOV09NyxyWzEwXT02LHJbMTFdPTQsclsxMl09OCxyWzEzXT05LHJbMTRdPTEwLHJbMTVdPTgsclsxNl09MTAsclsxN109MTEsclsxOF09MTQsclsxOV09MTMsclsyMF09MTIsclsyMV09MTUsclsyMl09MTQsclsyM109MTIsclsyNF09MTgsclsyNV09MTcsclsyNl09MTYsclsyN109MTksclsyOF09MTgsclsyOV09MTYsclszMF09MjAsclszMV09MjEsclszMl09MjIsclszM109MjAsclszNF09MjIsclszNV09MjN9ZWxzZSBpPW5ldyBGbG9hdDY0QXJyYXkoMjQpLGlbMF09ZS54LGlbMV09ZS55LGlbMl09ZS56LGlbM109dC54LGlbNF09ZS55LGlbNV09ZS56LGlbNl09dC54LGlbN109dC55LGlbOF09ZS56LGlbOV09ZS54LGlbMTBdPXQueSxpWzExXT1lLnosaVsxMl09ZS54LGlbMTNdPWUueSxpWzE0XT10LnosaVsxNV09dC54LGlbMTZdPWUueSxpWzE3XT10LnosaVsxOF09dC54LGlbMTldPXQueSxpWzIwXT10LnosaVsyMV09ZS54LGlbMjJdPXQueSxpWzIzXT10LnosYS5wb3NpdGlvbj1uZXcgaWUoe2NvbXBvbmVudERhdGF0eXBlOm5lLkRPVUJMRSxjb21wb25lbnRzUGVyQXR0cmlidXRlOjMsdmFsdWVzOml9KSxyPW5ldyBVaW50MTZBcnJheSgzNiksclswXT00LHJbMV09NSxyWzJdPTYsclszXT00LHJbNF09NixyWzVdPTcscls2XT0xLHJbN109MCxyWzhdPTMscls5XT0xLHJbMTBdPTMsclsxMV09MixyWzEyXT0xLHJbMTNdPTYsclsxNF09NSxyWzE1XT0xLHJbMTZdPTIsclsxN109NixyWzE4XT0yLHJbMTldPTMsclsyMF09NyxyWzIxXT0yLHJbMjJdPTcsclsyM109NixyWzI0XT0zLHJbMjVdPTAsclsyNl09NCxyWzI3XT0zL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CBhPWUueCxyPXQueCxpPW8ueCxmPWUueSxkPXQueSxjPW8ueSx1PU1hdGgubWluKGEscixpKSxsPU1hdGgubWluKGYsZCxjKSxtPU1hdGgubWF4KGEscixpKSxoPU1hdGgubWF4KGYsZCxjKSxiPW8ubmV4dDtmb3IoO2IhPT1lOyl7aWYoYi54Pj11JiZiLng8PW0mJmIueT49bCYmYi55PD1oJiZXZihhLGYscixkLGksYyxiLngsYi55KSYmRm4oYi5wcmV2LGIsYi5uZXh0KT49MClyZXR1cm4hMTtiPWIubmV4dH1yZXR1cm4hMH1mdW5jdGlvbiBmayhuLGUsdCxvKXtsZXQgYT1uLnByZXYscj1uLGk9bi5uZXh0O2lmKEZuKGEscixpKT49MClyZXR1cm4hMTtsZXQgZj1hLngsZD1yLngsYz1pLngsdT1hLnksbD1yLnksbT1pLnksaD1NYXRoLm1pbihmLGQsYyksYj1NYXRoLm1pbih1LGwsbSkscD1NYXRoLm1heChmLGQsYykseT1NYXRoLm1heCh1LGwsbSksdz1mMChoLGIsZSx0LG8pLF89ZjAocCx5LGUsdCxvKSxUPW4ucHJldlosRT1uLm5leHRaO2Zvcig7VCYmVC56Pj13JiZFJiZFLno8PV87KXtpZihULng+PWgmJlQueDw9cCYmVC55Pj1iJiZULnk8PXkmJlQhPT1hJiZUIT09aSYmV2YoZix1LGQsbCxjLG0sVC54LFQueSkmJkZuKFQucHJldixULFQubmV4dCk+PTB8fChUPVQucHJldlosRS54Pj1oJiZFLng8PXAmJkUueT49YiYmRS55PD15JiZFIT09YSYmRSE9PWkmJldmKGYsdSxkLGwsYyxtLEUueCxFLnkpJiZGbihFLnByZXYsRSxFLm5leHQpPj0wKSlyZXR1cm4hMTtFPUUubmV4dFp9Zm9yKDtUJiZULno+PXc7KXtpZihULng+PWgmJlQueDw9cCYmVC55Pj1iJiZULnk8PXkmJlQhPT1hJiZUIT09aSYmV2YoZix1LGQsbCxjLG0sVC54LFQueSkmJkZuKFQucHJldixULFQubmV4dCk+PTApcmV0dX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SSxMPXgqTWF0aC5jb3MoVSksRD14Kk1hdGguc2luKFUpO3AmJihBLng9TCxBLnk9RCxDJiYoTT1zLm5vcm1hbGl6ZShzLmNyb3NzKHMuVU5JVF9aLEEsTSksTSkpLGEubm9ybWFsJiYobFtJKytdPUEueCxsW0krK109QS55LGxbSSsrXT1BLnosbFtJKytdPUEueCxsW0krK109QS55LGxbSSsrXT1BLnopLGEudGFuZ2VudCYmKG1bTisrXT1NLngsbVtOKytdPU0ueSxtW04rK109TS56LG1bTisrXT1NLngsbVtOKytdPU0ueSxtW04rK109TS56KSxhLmJpdGFuZ2VudCYmKHY9cy5ub3JtYWxpemUocy5jcm9zcyhBLE0sdiksdiksaFtQKytdPXYueCxoW1ArK109di55LGhbUCsrXT12LnosaFtQKytdPXYueCxoW1ArK109di55LGhbUCsrXT12LnopKX1mb3IoYj0wO2I8cjtiKyspYS5ub3JtYWwmJihsW0krK109MCxsW0krK109MCxsW0krK109LTEpLGEudGFuZ2VudCYmKG1bTisrXT0xLG1bTisrXT0wLG1bTisrXT0wKSxhLmJpdGFuZ2VudCYmKGhbUCsrXT0wLGhbUCsrXT0tMSxoW1ArK109MCk7Zm9yKGI9MDtiPHI7YisrKWEubm9ybWFsJiYobFtJKytdPTAsbFtJKytdPTAsbFtJKytdPTEpLGEudGFuZ2VudCYmKG1bTisrXT0xLG1bTisrXT0wLG1bTisrXT0wKSxhLmJpdGFuZ2VudCYmKGhbUCsrXT0wLGhbUCsrXT0xLGhbUCsrXT0wKX1sZXQgeT0xMipyLTEyLHc9SWUuY3JlYXRlVHlwZWRBcnJheShkLHkpLF89MCxUPTA7Zm9yKGI9MDtiPHItMTtiKyspd1tfKytdPVQsd1tfKytdPVQrMix3W18rK109VCszLHdbXysrXT1ULHdbXysrXT1UKzMsd1tfKytdPVQrMSxUKz0yO2Zvcih3W18rK109aS0yLHdbXysrXT0wLHdbXysrXT0xLHdbXysrXT1pLTIsd1tfKytdPTEsd1tfKytdPWktMSxiPTE7YjxyLTE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9YT5uKTtsZXQgYz1pK2YrZCx1LGwsbSxoLGIscDtyZXR1cm4gYz09PTE/aT8odT0obi10KS8oby10KSxsPShuLXQpLyhhLXQpLHIucHVzaCgxKSxyLnB1c2goMiksbCE9PTEmJihyLnB1c2goLTEpLHIucHVzaCgwKSxyLnB1c2goMiksci5wdXNoKGwpKSx1IT09MSYmKHIucHVzaCgtMSksci5wdXNoKDApLHIucHVzaCgxKSxyLnB1c2godSkpKTpmPyhtPShuLW8pLyhhLW8pLGg9KG4tbykvKHQtbyksci5wdXNoKDIpLHIucHVzaCgwKSxoIT09MSYmKHIucHVzaCgtMSksci5wdXNoKDEpLHIucHVzaCgwKSxyLnB1c2goaCkpLG0hPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMSksci5wdXNoKDIpLHIucHVzaChtKSkpOmQmJihiPShuLWEpLyh0LWEpLHA9KG4tYSkvKG8tYSksci5wdXNoKDApLHIucHVzaCgxKSxwIT09MSYmKHIucHVzaCgtMSksci5wdXNoKDIpLHIucHVzaCgxKSxyLnB1c2gocCkpLGIhPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMiksci5wdXNoKDApLHIucHVzaChiKSkpOmM9PT0yPyFpJiZ0IT09bj8oaD0obi1vKS8odC1vKSxiPShuLWEpLyh0LWEpLHIucHVzaCgwKSxyLnB1c2goLTEpLHIucHVzaCgxKSxyLnB1c2goMCksci5wdXNoKGgpLHIucHVzaCgtMSksci5wdXNoKDIpLHIucHVzaCgwKSxyLnB1c2goYikpOiFmJiZvIT09bj8ocD0obi1hKS8oby1hKSx1PShuLXQpLyhvLXQpLHIucHVzaCgxKSxyLnB1c2goLTEpLHIucHVzaCgyKSxyLnB1c2goMSksci5wdXNoKHApLHIucHVzaCgtMSksci5wdXNoKDApLHIucHVzaCgxKSxyLnB1c2godSkpOiFkJiZhIT09biYmKGw9KG4tdCkvKGEtdCksbT0obi1vKS8oYS1vKSxyLnB1c2goMiksci5wdXNoKC0xKSxyLnB1c2goMCksci5wdX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xRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnkxKCkpfSxXRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PncxKCkpfSxYRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PkUxKCkpfTtyZXR1cm4gZkMoWUcpO30pKCk7Cg==")});var eD=bm((yzt,Xle)=>{var xzt=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)};Xle.exports=j0});var _de=bm((e1,t1)=>{var kHt=x(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof e1=="object"&&e1&&!e1.nodeType&&e1,n=typeof t1=="object"&&t1&&!t1.nodeType&&t1,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(M){throw new RangeError(S[M])}function L(M,O){for(var w=M.length,z=[];w--;)z[w]=O(M[w]);return z}function F(M,O){var w=M.split("@"),z="";w.length>1&&(z=w[0]+"@",M=w[1]),M=M.replace(_,".");var K=M.split("."),te=L(K,O).join(".");return z+te}function I(M){for(var O=[],w=0,z=M.length,K,te;w=55296&&K<=56319&&w65535&&(O-=65536,w+=C(O>>>10&1023|55296),O=56320|O&1023),w+=C(O),w}).join("")}function g(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function V(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function G(M,O,w){var z=0;for(M=w?R(M/u):M>>1,M+=R(M/O);M>Z*c>>1;z+=s)M=R(M/Z);return R(z+(Z+1)*M/(M+d))}function v(M){var O=[],w=M.length,z,K=0,te=p,H=m,$,ee,le,_e,he,Ze,ye,Ge,Ae;for($=M.lastIndexOf(b),$<0&&($=0),ee=0;ee<$;++ee)M.charCodeAt(ee)>=128&&A("not-basic"),O.push(M.charCodeAt(ee));for(le=$>0?$+1:0;le=w&&A("invalid-input"),ye=g(M.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(M){var O,w,z,K,te,H,$,ee,le,_e,he,Ze=[],ye,Ge,Ae,Fe;for(M=I(M),ye=M.length,O=p,w=0,te=m,H=0;H=O&&he<$&&($=he);for(Ge=z+1,$-O>R((r-w)/Ge)&&A("overflow"),w+=($-O)*Ge,O=$,H=0;Hr&&A("overflow"),he==O){for(ee=w,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(w,Ge,z==K),w=0,++z}++w,++O}return Ze.join("")}function Y(M){return F(M,function(O){return f.test(O)?v(O.slice(4).toLowerCase()):O})}function D(M){return F(M,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(t1.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(e1)});var Zde=bm((Sde,hD)=>{var UHt=x(T());/*! +"use strict";var Cesium=(()=>{var wYe=Object.create;var OA=Object.defineProperty;var kYe=Object.getOwnPropertyDescriptor;var UYe=Object.getOwnPropertyNames;var DYe=Object.getPrototypeOf,OYe=Object.prototype.hasOwnProperty;var BYe=(e,t,n)=>t in e?OA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $5=(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 bm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Cle=(e,t)=>{for(var n in t)OA(e,n,{get:t[n],enumerable:!0})},Vle=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of UYe(t))!OYe.call(e,o)&&o!==n&&OA(e,o,{get:()=>t[o],enumerable:!(i=kYe(t,o))||i.enumerable});return e};var x=(e,t,n)=>(n=e!=null?wYe(DYe(e)):{},Vle(t||!e||!e.__esModule?OA(n,"default",{value:e,enumerable:!0}):n,e)),zYe=e=>Vle(OA({},"__esModule",{value:!0}),e);var mt=(e,t,n)=>BYe(e,typeof t!="symbol"?t+"":t,n);var T=bm(()=>{"use strict";globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIG9DPU9iamVjdC5jcmVhdGU7dmFyIF9mPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgYUM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgckM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIGlDPU9iamVjdC5nZXRQcm90b3R5cGVPZixjQz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBzQz0obixlLHQpPT5lIGluIG4/X2YobixlLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTp0fSk6bltl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kqMyszXSxhW3kqMys0XSxhW3kqMys1XSksRS5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goXy54LF8ueSxfLnosXy54LF8ueSxfLnopLEUubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxFLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksRS5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goUC54LFAueSxQLnopLEUubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxzLm5lZ2F0ZShOLE4pLHMuYWRkKEksTixQKSxTLnBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxTLnBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxTLnBvc2l0aW9uLnZhbHVlcy5wdXNoKFQueCxULnksVC56LFQueCxULnksVC56KSxTLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksUy5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goUC54LFAueSxQLnopLFMucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxTLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksUy5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goVC54LFQueSxULnosVC54LFQueSxULnopLFMubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKHJbdyozXSxyW3cqMysxXSxyW3cqMysyXSksUy5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goclt3KjMrM10sclt3KjMrNF0sclt3KjMrNV0pO2xldCBGPVkuZnJvbUFycmF5KGkseSoyLHBUKSxBPU1hdGguYWJzKEYueSk7RS5leHBhbmRBbmRXaWR0aC52YWx1ZXMucHVzaCgtMSxBLDEsQSksRS5leHBhbmRBbmRXaWR0aC52YWx1ZXMucHVzaCgtMSwtQSwxLC1BKSxTLmV4cGFuZEFuZFdpZHRoLnZ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wLGNbMjRdPTAsY1syNV09MCxjWzI2XT0xLGNbMjddPTAsY1syOF09MCxjWzI5XT0xLGNbMzBdPTAsY1szMV09MCxjWzMyXT0xLGNbMzNdPTAsY1szNF09MCxjWzM1XT0xLGNbMzZdPTAsY1szN109MCxjWzM4XT0xLGNbMzldPTAsY1s0MF09MCxjWzQxXT0xLGNbNDJdPTAsY1s0M109MCxjWzQ0XT0xLGNbNDVdPTAsY1s0Nl09MCxjWzQ3XT0xLGNbNDhdPTAsY1s0OV09MCxjWzUwXT0xLGNbNTFdPTAsY1s1Ml09MCxjWzUzXT0xLGNbNTRdPTAsY1s1NV09MCxjWzU2XT0xLGNbNTddPTAsY1s1OF09MCxjWzU5XT0xLGNbNjBdPTAsY1s2MV09MCxjWzYyXT0xLGNbNjNdPTAsY1s2NF09MCxjWzY1XT0xLGNbNjZdPTAsY1s2N109MCxjWzY4XT0xLGNbNjldPTAsY1s3MF09MCxjWzcxXT0xLGEuYml0YW5nZW50PW5ldyBpZSh7Y29tcG9uZW50RGF0YXR5cGU6bmUuRkxPQVQsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczpjfSl9cj1uZXcgVWludDE2QXJyYXkoMzYpLHJbMF09MCxyWzFdPTEsclsyXT0yLHJbM109MCxyWzRdPTIscls1XT0zLHJbNl09NixyWzddPTUscls4XT00LHJbOV09NyxyWzEwXT02LHJbMTFdPTQsclsxMl09OCxyWzEzXT05LHJbMTRdPTEwLHJbMTVdPTgsclsxNl09MTAsclsxN109MTEsclsxOF09MTQsclsxOV09MTMsclsyMF09MTIsclsyMV09MTUsclsyMl09MTQsclsyM109MTIsclsyNF09MTgsclsyNV09MTcsclsyNl09MTYsclsyN109MTksclsyOF09MTgsclsyOV09MTYsclszMF09MjAsclszMV09MjEsclszMl09MjIsclszM109MjAsclszNF09MjIsclszNV09MjN9ZWxzZSBpPW5ldyBGbG9hdDY0QXJyYXkoMjQpLGlbMF09ZS54LGlbMV09ZS55LGlbMl09ZS56LGlbM109dC54LGlbNF09ZS55LGlbNV09ZS56LGlbNl09dC54LGlbN109dC55LGlbOF09ZS56LGlbOV09ZS54LGlbMTBdPXQueSxpWzExXT1lLnosaVsxMl09ZS54LGlbMTNdPWUueSxpWzE0XT10LnosaVsxNV09dC54LGlbMTZdPWUueSxpWzE3XT10LnosaVsxOF09dC54LGlbMTldPXQueSxpWzIwXT10LnosaVsyMV09ZS54LGlbMjJdPXQueSxpWzIzXT10LnosYS5wb3NpdGlvbj1uZXcgaWUoe2NvbXBvbmVudERhdGF0eXBlOm5lLkRPVUJMRSxjb21wb25lbnRzUGVyQXR0cmlidXRlOjMsdmFsdWVzOml9KSxyPW5ldyBVaW50MTZBcnJheSgzNiksclswXT00LHJbMV09NSxyWzJdPTYsclszXT00LHJbNF09NixyWzVdPTcscls2XT0xLHJbN109MCxyWzhdPTMscls5XT0xLHJbMTBdPTMsclsxMV09MixyWzEyXT0xLHJbMTNdPTYsclsxNF09NSxyWzE1XT0xLHJbMTZdPTIsclsxN109NixyWzE4XT0yLHJbMTldPTMsclsyMF09NyxyWzIxXT0yLHJbMjJdPTcsclsyM109NixyWzI0XT0zLHJbMjVdPTAsclsyNl09NCxyWzI3XT0zLHJbMjhdPTQsclsyOV09NyxyWzMwXT0wLHJbMzFdPTEsclszMl09NSxyWzMzXT0wLHJbMzRdPTUsclszNV09NDtsZXQgZj1zLnN1YnRyYWN0KHQsZSxMMyksZD1zLm1hZ25pdHVkZShmKSouNTtpZihnKG4uX29mZnNldEF0dHJpYnV0ZSkpe2xldCBjPWkubGVuZ3RoLHU9bi5fb2Zmc2V0QXR0cmlidXRlPT09b3QuTk9ORT8wOjEsbD1uZXcgVWludDhBcnJheShjLzMpLmZpbGwodSk7YS5hcHBseU9mZnNldD1uZXcgaWUoe2NvbXBvbmVudERhdGF0eXBlOm5lLlVOU0lHTkVEX0JZVEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZToxLHZhbHVlczpsfSl9cmV0dXJuIG5ldyBQZSh7YX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ZVBvc2l0aW9uKGUsbyx0LnN0LEEseCx5LHcpLG1bYisrXT15LngsbVtiKytdPXkueSxtW2IrK109eS56LHQuc3QmJihoW3ArK109dy54LGhbcCsrXT13LnksXz1NYXRoLm1pbihfLHcueCksVD1NYXRoLm1pbihULHcueSksRT1NYXRoLm1heChFLHcueCksUj1NYXRoLm1heChSLHcueSkpO2lmKGkmJih3by5jb21wdXRlUG9zaXRpb24oZSxvLHQuc3QsMCwwLHksdyksbVtiKytdPXkueCxtW2IrK109eS55LG1bYisrXT15LnosdC5zdCYmKGhbcCsrXT13LngsaFtwKytdPXcueSxfPXcueCxUPXcueSxFPXcueCxSPXcueSkpLGYmJih3by5jb21wdXRlUG9zaXRpb24oZSxvLHQuc3QsYS0xLDAseSx3KSxtW2IrK109eS54LG1bYisrXT15LnksbVtiXT15LnosdC5zdCYmKGhbcCsrXT13LngsaFtwXT13LnksXz1NYXRoLm1pbihfLHcueCksVD1NYXRoLm1pbihULHcueSksRT1NYXRoLm1heChFLHcueCksUj1NYXRoLm1heChSLHcueSkpKSx0LnN0JiYoXzwwfHxUPDB8fEU+MXx8Uj4xKSlmb3IobGV0IEE9MDtBPGgubGVuZ3RoO0ErPTIpaFtBXT0oaFtBXS1fKS8oRS1fKSxoW0ErMV09KGhbQSsxXS1UKS8oUi1UKTtsZXQgUz1fQihtLHQsbyxlLnRhbmdlbnRSb3RhdGlvbk1hdHJpeCksQz02KihyLTEpKih1LTEpO2kmJihDKz0zKihyLTEpKSxmJiYoQys9Myooci0xKSk7bGV0IEk9SWUuY3JlYXRlVHlwZWRBcnJheShsLEMpLE49MCxQPTAsRjtmb3IoRj0wO0Y8dS0xOysrRil7Zm9yKGxldCBBPTA7QTxyLTE7KytBKXtsZXQgeD1OLE09eCtyLHY9TSsxLFU9eCsxO0lbUCsrXT14LElbUCsrXT1NLElbUCsrXT1VLElbUCsrXT1VLElbUCsrXT1NLElbUCsrXT12LCsrTn0rK059aWYoaXx8Zil7bGV0IEE9bC0xLHg9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PnJ5KCkpfSxGRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnN5KCkpfSxERz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnV5KCkpfSxCRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnB5KCkpfSxVRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pnl5KCkpfSxqRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pnh5KCkpfSxMRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PiR5KCkpfSx6Rz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmExKCkpfSxHRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmYxKCkpfSxWRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnUxKCkpfSxIRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmgxKCkpfSxLRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pl8xKCkpfSxxRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnkxKCkpfSxXRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PncxKCkpfSxYRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PkUxKCkpfTtyZXR1cm4gZkMoWUcpO30pKCk7Cg==")});var nD=bm((azt,Ele)=>{var czt=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)};Ele.exports=j0});var Hle=bm((QR,qR)=>{var ZHt=x(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof QR=="object"&&QR&&!QR.nodeType&&QR,n=typeof qR=="object"&&qR&&!qR.nodeType&&qR,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(M){throw new RangeError(S[M])}function L(M,O){for(var w=M.length,z=[];w--;)z[w]=O(M[w]);return z}function F(M,O){var w=M.split("@"),z="";w.length>1&&(z=w[0]+"@",M=w[1]),M=M.replace(_,".");var K=M.split("."),te=L(K,O).join(".");return z+te}function I(M){for(var O=[],w=0,z=M.length,K,te;w=55296&&K<=56319&&w65535&&(O-=65536,w+=C(O>>>10&1023|55296),O=56320|O&1023),w+=C(O),w}).join("")}function g(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function V(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function G(M,O,w){var z=0;for(M=w?R(M/u):M>>1,M+=R(M/O);M>Z*c>>1;z+=s)M=R(M/Z);return R(z+(Z+1)*M/(M+d))}function v(M){var O=[],w=M.length,z,K=0,te=p,H=m,$,ee,le,_e,he,Ze,ye,Ge,Ae;for($=M.lastIndexOf(b),$<0&&($=0),ee=0;ee<$;++ee)M.charCodeAt(ee)>=128&&A("not-basic"),O.push(M.charCodeAt(ee));for(le=$>0?$+1:0;le=w&&A("invalid-input"),ye=g(M.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(M){var O,w,z,K,te,H,$,ee,le,_e,he,Ze=[],ye,Ge,Ae,Fe;for(M=I(M),ye=M.length,O=p,w=0,te=m,H=0;H=O&&he<$&&($=he);for(Ge=z+1,$-O>R((r-w)/Ge)&&A("overflow"),w+=($-O)*Ge,O=$,H=0;Hr&&A("overflow"),he==O){for(ee=w,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(w,Ge,z==K),w=0,++z}++w,++O}return Ze.join("")}function Y(M){return F(M,function(O){return f.test(O)?v(O.slice(4).toLowerCase()):O})}function D(M){return F(M,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(qR.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(QR)});var Jle=bm((Kle,mD)=>{var RHt=x(T());/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof hD=="object"&&hD.exports?hD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Sde,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 DHt=x(T());/*! + */(function(e,t){"use strict";typeof mD=="object"&&mD.exports?mD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Kle,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 CHt=x(T());/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof fD=="object"&&fD.exports?fD.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Rde,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 yu=bm((Vde,pD)=>{var OHt=x(T());/*! + */(function(e,t){"use strict";typeof hD=="object"&&hD.exports?hD.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(jle,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=bm((qle,fD)=>{var VHt=x(T());/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,1498 +58,1669 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof pD=="object"&&pD.exports?pD.exports=t(_de(),Zde(),Cde()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Vde,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(w){return r[G](r[v](w))}:Y=r[G];for(var D=(X+"").split(V),M=0,O=D.length;M-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(":"),M=V.indexOf("/"),O=V.indexOf(":",D+1);O!==-1&&(M===-1||O-1?Y:V.length-1),M;return D>-1&&(Y===-1||D-1?H=H.slice(0,$)+H.slice($).replace(D,""):H=H.replace(D,""),!(H.length<=w[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 M=X?V._parts:V;for(v in M)v!=="query"&&c.call(this._parts,v)&&(this._parts[v]=M[v]);M.query&&this.query(M.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,M=!1,O=!1,w=!this._parts.urn;switch(this._parts.hostname&&(w=!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),M=Y&&r.idn_expression.test(this._parts.hostname),O=Y&&r.punycode_expression.test(this._parts.hostname)),V.toLowerCase()){case"relative":return w;case"absolute":return!w;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 M;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),M=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(M,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 M=this.suffix(),O;if(M)V?O=new RegExp(d(M)+"$"):O=new RegExp(d("."+M)+"$");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)==="/",M=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&&M.shift(),V<0&&(V=Math.max(M.length+V,0)),G===void 0)return V===void 0?M:M[V];if(V===null||M[V]===void 0)if(m(G)){M=[];for(var O=0,w=G.length;O{"use strict";var tii=x(T());sTe.exports=iat;var qP=1e20;function iat(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 _ii=x(T());function hat(){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(w){return w==i})&&[i,b,S].indexOf(g)==-1)return C;var M=v.lastIndexOf(o);if(M>0&&v.slice(1,M).every(function(w){return w==o})&&[p,o].indexOf(X)==-1)return v.filter(function(w){return w==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(w){return w==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(w){return w==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{var OPi=x(T());/*! + */(function(e,t){"use strict";typeof fD=="object"&&fD.exports?fD.exports=t(Hle(),Jle(),Qle()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(qle,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(w){return r[G](r[v](w))}:Y=r[G];for(var D=(X+"").split(V),M=0,O=D.length;M-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(":"),M=V.indexOf("/"),O=V.indexOf(":",D+1);O!==-1&&(M===-1||O-1?Y:V.length-1),M;return D>-1&&(Y===-1||D-1?H=H.slice(0,$)+H.slice($).replace(D,""):H=H.replace(D,""),!(H.length<=w[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 M=X?V._parts:V;for(v in M)v!=="query"&&c.call(this._parts,v)&&(this._parts[v]=M[v]);M.query&&this.query(M.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,M=!1,O=!1,w=!this._parts.urn;switch(this._parts.hostname&&(w=!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),M=Y&&r.idn_expression.test(this._parts.hostname),O=Y&&r.punycode_expression.test(this._parts.hostname)),V.toLowerCase()){case"relative":return w;case"absolute":return!w;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 M;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),M=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(M,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 M=this.suffix(),O;if(M)V?O=new RegExp(d(M)+"$"):O=new RegExp(d("."+M)+"$");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)==="/",M=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&&M.shift(),V<0&&(V=Math.max(M.length+V,0)),G===void 0)return V===void 0?M:M[V];if(V===null||M[V]===void 0)if(m(G)){M=[];for(var O=0,w=G.length;O{"use strict";var Kli=x(T());_Te.exports=Dat;var TX=1e20;function Dat(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 fdi=x(T());function $at(){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(w){return w==i})&&[i,b,S].indexOf(g)==-1)return C;var M=v.lastIndexOf(o);if(M>0&&v.slice(1,M).every(function(w){return w==o})&&[p,o].indexOf(X)==-1)return v.filter(function(w){return w==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(w){return w==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(w){return w==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{c3i=x(T(),1),zee=new Date(2107,11,31,23,59,58),sE=new Date(1980,0,1),ke=void 0,bZ=1/0,qd="undefined",Yr="function",$Ce="object",gZ="string",eVe="number",tVe="boolean",yo=new Uint8Array});function cE(e){if(e&&typeof e!=Yr)throw new Error(IVe);return e}function j3(e){if(e&&(typeof e.addEventListener!=Yr||typeof e.aborted!=tVe))throw new Error(PVe);return e||ke}function Q3(e,t){if(e&&typeof e!=gZ||t&&!(t instanceof Uint8Array))throw new Error(Jee)}function jee(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function lE(e,t,n){e!==ke&&jee(e,t,n)}function yZ(e){return typeof e==gZ&&e.trim()?Number(e):e}var u3i,nVe,iVe,oVe,rVe,sVe,M3,w3,k3,U3,aVe,cVe,lVe,dVe,uVe,mVe,hVe,fVe,D3,O3,B3,z3,pVe,bVe,gVe,yVe,xVe,TVe,_Ve,SVe,ZVe,Hee,RVe,CVe,$Y,aE,VVe,EVe,AVe,GVe,LVe,WVe,Kee,vVe,FVe,H3,K3,tT,J3,Xg,IVe,PVe,Jee,eM=Xs(()=>{u3i=x(T(),1);bc();nVe="filenameEncoding",iVe="commentEncoding",oVe="decodeText",rVe="extractPrependedData",sVe="extractAppendedData",M3="password",w3="rawPassword",k3="passThrough",U3="signal",aVe="checkPasswordOnly",cVe="checkOverlappingEntryOnly",lVe="checkOverlappingEntry",dVe="checkAmbiguity",uVe="checkLocalDirectory",mVe="checkSignature",hVe="checkCrc32",fVe="checkAuthenticationCode",D3="useWebWorkers",O3="useCompressionStream",B3="transferStreams",z3="preventClose",pVe="encryptionStrength",bVe="extendedTimestamp",gVe="ntfsTimestamp",yVe="keepOrder",xVe="level",TVe="bufferedWrite",_Ve="createTempStream",SVe="dataDescriptorSignature",ZVe="useUnicodeFileNames",Hee="dataDescriptor",RVe="supportZip64SplitFile",CVe="encodeText",$Y="offset",aE="usdz",VVe="unixExtraFieldType",EVe="localExtraField",AVe="centralExtraField",GVe="strictness",LVe="filenameValidation",WVe="normalizeFilename",Kee="maxAppendedDataSize",vVe="decryptCentralDirectory",FVe="signCentralDirectory",H3="filename",K3="comment",tT="strict",J3="balanced",Xg="tolerant",IVe="Invalid option (must be a function)",PVe="Invalid signal (must be an AbortSignal instance)",Jee="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function Ng(){return Qee}function tM(e){return qee(e.chunkSize)}function qee(e){return e=yZ(e),Number.isInteger(e)&&e>=NVe?Math.max(e,Sxt):XVe}function nM(e){Object.assign(Qee,OVe(BVe(e)))}function OVe(e){let t={};for(let n of Cxt){let i=e[n];i!==ke&&(t[n]=Vxt(n,i))}return t}function Vxt(e,t){if(UVe.includes(e)){if(t=yZ(t),e==kVe&&(!Number.isInteger(t)||t{p3i=x(T(),1);bc();eM();XVe=64*1024,Sxt=64,NVe=1,YVe="Invalid maxWorkers (must be an integer greater than 0)",MVe=2;try{typeof navigator!=qd&&navigator.hardwareConcurrency&&(MVe=navigator.hardwareConcurrency)}catch{}wVe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:XVe,maxWorkers:MVe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=qd&&CompressionStream,DecompressionStream:typeof DecompressionStream!=qd&&DecompressionStream},kVe="maxWorkers",Zxt=["baseURI","wasmURI","workerURI"],Rxt=["useCompressionStream","useWebWorkers","transferStreams"],UVe=["chunkSize",kVe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],DVe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],Cxt=[...Zxt,...Rxt,...UVe,...DVe],Qee={...wVe}});function uh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function q3(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 g3i,xZ=Xs(()=>{g3i=x(T(),1)});var x3i,iM,zVe,Ext,Axt,Gxt,Lxt,Wxt,vxt,Fxt,wf,oM=Xs(()=>{x3i=x(T(),1),iM=[[],[],[],[],[],[],[],[]];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;iM[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=iM[t-1][e];iM[t][e]=n>>>8^iM[0][n&255]}[zVe,Ext,Axt,Gxt,Lxt,Wxt,vxt,Fxt]=iM,wf=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=Fxt[a&255]^vxt[a>>>8&255]^Wxt[a>>>16&255]^Lxt[a>>>24&255]^Gxt[c&255]^Axt[c>>>8&255]^Ext[c>>>16&255]^zVe[c>>>24&255]}}for(;o>>8^zVe[(n^t[o])&255];this.crc=n}get(){return~this.crc}}});var S3i,rM,HVe=Xs(()=>{S3i=x(T(),1);oM();rM=class extends TransformStream{constructor(){let t,n=new wf;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 uE(e){if(typeof TextEncoder==qd){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n{C3i=x(T(),1);bc()});var E3i,md,sM,KVe,ete,tte,nT,JVe=Xs(()=>{E3i=x(T(),1),md={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=md.getPartial(n);return i===32?e.concat(t):md._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+md.getPartial(n)},clamp(e,t){if(e.length*320&&t&&(e[n-1]=md.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=md.getPartial(o);return i.push(md.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},sM={bytes:{fromBits(e){let n=md.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=md.concat(t,[md.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}};ete={};ete.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}};tte={};tte.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=md.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=md;for(t=sM.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{I3i=x(T(),1);bc();Ixt=typeof crypto!=qd&&typeof crypto.getRandomValues==Yr,h0="Invalid password",iT="Invalid signature",oT=iT,Yg="zipjs-abort-check-password",mE="Crypto API not supported"});function eEe(e,t,n,i){Object.assign(e,{ready:new Promise(o=>e.resolveReady=o),password:Kxt(t,n),strength:i-1,pendingInput:yo})}function tEe(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=Jxt(n,i+(d-d%hE));let u;for(u=0;u<=d-hE;u+=hE){let m=dM(f0,mh(t,u,u+hE));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(lM(f0,p),u+i)}return e.pendingInput=mh(t,u),n}async function Oxt(e,t,n,i){let o=await nEe(e,t,n,mh(i,0,cM[t])),r=mh(i,cM[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(h0)}async function Bxt(e,t,n){let i=$3(new Uint8Array(cM[t])),o=await nEe(e,t,n,i);return uh(i,o)}async function nEe(e,t,n,i){e.password=null;let o=await zxt(Pxt,n,Yxt,!1,Mxt),r=await Hxt(Object.assign({salt:i},nte),o,8*(aM[t]*2+2)),s=new Uint8Array(r),a=dM(f0,mh(s,0,aM[t])),c=dM(f0,mh(s,aM[t],aM[t]*2)),d=mh(s,aM[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new Uxt(new kxt(a),Array.from(wxt)),hmac:new Dxt(c)}),d}async function zxt(e,t,n,i,o){if(jVe)try{return await uM.importKey(e,t,n,i,o)}catch{return jVe=!1,nT.importKey(t)}else return nT.importKey(t)}async function Hxt(e,t,n){if(QVe)try{return await uM.deriveBits(e,t,n)}catch{return QVe=!1,nT.pbkdf2(t,e.salt,nte.iterations,n)}else return nT.pbkdf2(t,e.salt,nte.iterations,n)}function Kxt(e,t){return t===ke?uE(e):t}function Jxt(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 lM(e,t){return e.fromBits(t)}function dM(e,t){return e.toBits(t)}var k3i,hE,Pxt,qVe,Xxt,Nxt,Yxt,nte,Mxt,cM,aM,Mg,wxt,iz,uM,$Ve,f0,kxt,Uxt,Dxt,jVe,QVe,tz,nz,iEe=Xs(()=>{k3i=x(T(),1);bc();$ee();xZ();JVe();ez();hE=16,Pxt="raw",qVe={name:"PBKDF2"},Xxt={name:"HMAC"},Nxt="SHA-1",Yxt=Object.assign({hash:Xxt},qVe),nte=Object.assign({iterations:1e3,hash:{name:Nxt}},qVe),Mxt=["deriveBits"],cM=[8,12,16],aM=[16,24,32],Mg=10,wxt=[0,0,0,0],iz=typeof crypto!=qd,uM=iz&&crypto.subtle,$Ve=iz&&typeof uM!=qd,f0=sM.bytes,kxt=ete.aes,Uxt=tte.ctrGladman,Dxt=nT.hmacSha1,jVe=iz&&$Ve&&typeof uM.importKey==Yr,QVe=iz&&$Ve&&typeof uM.deriveBits==Yr,tz=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:o,checkAuthenticationCode:r=!0}){super({start(){eEe(this,t,n,i)},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await Oxt(c,u,d,mh(s,0,cM[u]+2)),s=mh(s,cM[u]+2),o?a.error(new Error(Yg)):m()):await p;let b=new Uint8Array(s.length-Mg-(s.length-Mg)%hE);a.enqueue(tEe(c,s,b,0,Mg,!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-Mg),p=mh(d,d.length-Mg),b=yo;if(m.length){let _=dM(f0,m);c.update(_);let S=a.update(_);b=lM(f0,S)}let f=mh(lM(f0,c.digest()),0,Mg),y=d.length>>24]);let o=~e.crcKey2.get();e.keys=[i,n,o]}function cEe(e){let t=e.keys[2]|2;return lEe(Math.imul(t,t^1)>>>8)}function lEe(e){return e&255}function sEe(e){return e&4294967295}var B3i,fE,oz,rz,dEe=Xs(()=>{B3i=x(T(),1);oM();ez();fE=12,oz=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:o}){super({start(){aEe(this,t,n,i)},transform(r,s){let a=this;if(a.password||a.rawPassword){let c=oEe(a,r.subarray(0,fE));if(a.password=a.rawPassword=null,(c[fE-1]^a.passwordVerification)!=0)throw new Error(h0);r=r.subarray(fE)}o?s.error(new Error(Yg)):s.enqueue(oEe(a,r))}})}},rz=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){aEe(this,t,n,i)},transform(o,r){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let d=$3(new Uint8Array(fE));d[fE-1]=s.passwordVerification,a=new Uint8Array(o.length+d.length),a.set(rEe(s,d),0),c=fE}else a=new Uint8Array(o.length),c=0;a.set(rEe(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(Qxt())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 Qxt(){return typeof Blob.prototype.stream!=Yr||new Blob([]).stream()instanceof ReadableStream}function uEe(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 K3i,pE=Xs(()=>{K3i=x(T(),1);bc()});function az(e){return qxt.get(e)}function cz(e){return ite.get(e)}function $xt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Yr&&typeof i!=Yr)throw new Error(mEe);ite.set(e,{CompressionStream:n,DecompressionStream:i})}async function hEe(e,t){!ite.has(e)&&t&&$xt(e,await import(t))}var Q3i,mEe,qxt,ite,_Z=Xs(()=>{Q3i=x(T(),1);bc();mEe="Invalid codec module",qxt=new Map,ite=new Map});function iTt(e,t,n){let i=new wf,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(bEe);y.set(tTt),f.enqueue(y)},transform(f,y){y.enqueue(f)},async flush(f){r=!0,p();try{await d}finally{b()}let y=new Uint8Array(ote),_=fi(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=gE(e,t),Uf(e,m);function p(){b(),s=setTimeout(()=>c(new Error(rT)),nTt)}function b(){clearTimeout(s)}}function ste(e,t){if(!e)return!1;let n=fEe.get(e);n||(n=new Map,fEe.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 mz(e){return ste(e,rte)}function ate(e){return ste(e,hM)}function gEe(e,t,n){t=Uf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function yEe(e,t,n){if(!e)throw new Error(eTt);return new e(t,n)}function xEe(e,t,n,i,o){let r=t&&i?i:o||i,s=n.deflate64?pEe:rte,a;try{a=new r(s,n)}catch(c){if(t&&o&&r!=o)a=new o(s,n);else throw c}return gE(e,a)}function Uf(e,t){return kf(e).pipeThrough(t)}function gE(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 oTt(n,r),await rTt(i,r)}}}async function oTt(e,t){try{await e.abort(t)}catch{}}async function rTt(e,t){try{await e.cancel(t)}catch{}}function sTt(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(yE);throw a.cause=s,a}let{value:o,done:r}=i;r?n.close():n.enqueue(o)},cancel(n){return t.cancel(n)}})}var czi,rT,yE,xE,eTt,rte,pEe,hM,bEe,ote,tTt,nTt,lz,dz,uz,fEe,cte=Xs(()=>{czi=x(T(),1);oM();HVe();iEe();dEe();ez();bc();xZ();pE();_Z();rT="Invalid uncompressed size",yE="Invalid compressed data",xE=iT,eTt="Compression method not supported",rte="deflate-raw",pEe="deflate64-raw",hM="gzip",bEe=10,ote=8,tTt=[31,139,8],nTt=5e3,lz=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&&cz(p),E=d&&r&&!m&&!C&&(!s||c)&&!!(a&&o);if((!s||c)&&d&&!E&&(_=new rM,R=Uf(R,_)),r)if(C)R=gE(R,yEe(C.CompressionStream,p,{level:u,chunkSize:n,compressionMethod:b,uncompressedSize:f}));else if(E)Z=new dz,R=gE(R,new o(hM)),R=Uf(R,Z);else try{R=xEe(R,a,{level:u,chunkSize:n},o,i)}catch(A){let L;try{L=new o(hM)}catch{throw A}R=gE(R,L),R=Uf(R,new dz)}s&&(c?R=Uf(R,new rz(t)):(S=new nz(t),R=Uf(R,S))),gEe(y,R,()=>{(!s||c)&&d&&(y.crc32=E?Z.crc32:new DataView(_.value.buffer).getUint32(0))})}},dz=class extends TransformStream{constructor(){let t,n=bEe,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<=ote){i=uh(i,o);return}let a=s-ote,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=fi(i);t.crc32=o.getUint32(0,!0),t.uncompressedSize=o.getUint32(4,!0)}}),t=this}};uz=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 oz(t)):(S=new tz(t),Z=Uf(Z,S))),d){let R=p&&cz(p);if(R)Z=gE(Z,yEe(R.DecompressionStream,p,{chunkSize:n,compressionMethod:b,rawBitFlag:f,uncompressedSize:y}));else try{Z=xEe(Z,u,{chunkSize:n,deflate64:m},o,i)}catch(C){if(m||y===ke)throw C;let E;try{E=new o(hM)}catch{throw C}Z=iTt(Z,E,y)}Z=sTt(Z)}a&&(_=new rM,Z=Uf(Z,_)),gEe(this,Z,()=>{if(a){let R=new DataView(_.value.buffer);if(c!=R.getUint32(0,!1))throw new Error(xE)}})}},fEe=new Map});var mzi,aTt,TEe,_Ee,SEe,lte,ZEe,REe,TE,fz,hz,fM,pz=Xs(()=>{mzi=x(T(),1);bc();cte();aTt=64*1024,TEe="message",_Ee="start",SEe="pull",lte="data",ZEe="ack",REe="close",TE="deflate",fz="inflate",hz=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(TE)?r=lz:o.startsWith(fz)&&(r=uz),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(rT)},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)}})}},fM=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=aTt),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(;ayz(e,t)}}async function yz({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(e.compressed&&!e.format){let d=e.codecType.startsWith(TE),u=d?o.CompressionStreamFallback:o.DecompressionStreamFallback,m=d?o.CompressionStream:o.DecompressionStream;if(e.useCompressionStream){if(u&&u.requiresModule&&!mz(m))try{await gz(o)}catch{}}else try{await gz(o)}catch{(!u||u.requiresModule)&&(e.useCompressionStream=!0)}}r=new hz(e,o),await t.pipeThrough(r).pipeThrough(new fM(tM(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 gzi,ZZ,bz,CEe,ute,gz,SZ,mte,pM=Xs(()=>{gzi=x(T(),1);bc();m0();pz();ZZ="Worker startup timeout",gz=()=>{};SZ=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 CEe&&(u=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new fM(tM(r))).pipeThrough(new mte(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)}}}),bz===ke&&(bz=typeof Worker!=qd),(a&&ute&&(bz&&d||u)?ute:fte)(t,r)}},mte=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await dte(t,i)},async transform(s,a){r+=s.length,n&&await dte(n,r,i),a.enqueue(s)},async flush(){o&&await dte(o,r)}})}}});async function Sz(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=fTt(p,i.baseURI)),await hEe(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=RZ.find(E=>!E.busy);if(C)return XEe(C),new SZ(C,e,t,R);if(RZ.length{_E.push({resolve:E,stream:e,workerOptions:t}),Tz=i.workerStarvationTimeout,_z()})}function R(C){if(NEe(),_E.length){let[{resolve:E,stream:A,workerOptions:L}]=_E.splice(0,1);E(new SZ(C,A,L,R)),_z()}else C.worker?(XEe(C),gTt(C,t)):RZ=RZ.filter(E=>E!=C)}}function fTt(e,t){try{return new URL(e,t).toString()}catch{return e}}function _z(){!SE&&_E.length&&Number.isFinite(Tz)&&Tz>=0&&(SE=setTimeout(pTt,Tz))}function NEe(){SE&&(clearTimeout(SE),SE=null)}function pTt(){if(SE=null,_E.length){let[{resolve:e,stream:t,workerOptions:n}]=_E.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new SZ({},t,i,bTt)),_z()}}function bTt(){NEe(),_z()}function gTt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{RZ=RZ.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function XEe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Gzi,RZ,_E,SE,Tz,PEe,Zz=Xs(()=>{Gzi=x(T(),1);bc();pz();_Z();pM();RZ=[],_E=[],PEe=0});function MEe(e){if(yTt){let t="";for(let n=0;n{Wzi=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(""),yTt=YEe.length==256});function bM(e,t){return UEe(e,t,!0)}function kEe(e,t){return UEe(e,t,!1)}function UEe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?MEe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var Izi,Tte=Xs(()=>{Izi=x(T(),1);wEe()});function TTt(){zEe=(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();_te=n==1}catch{_te=!1}})()}function Ez(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 _Tt(e){return e=new wg(e),await Xc(e),(e.size===ke||!e.readUint8Array)&&(e=new $d(await p0(e.readable)),await Xc(e)),e}function Mr(e,t,n){return e.readUint8Array(t,n)}function Zte(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?RE.prototype.createReadable.call(e,t):e.readable}var Dzi,OEe,BEe,xTt,wzi,kzi,Ste,DEe,ZE,RE,Rz,gM,_te,zEe,$d,CE,yM,xM,Cz,Vz,wg,VE,Az=Xs(()=>{Dzi=x(T(),1);bc();m0();xZ();pE();Tte();OEe="Writer iterator completed too soon",BEe="Writer not initialized",xTt="text/plain",wzi=256*1024,kzi=16*1024*1024,Ste="writable",DEe=Symbol(),ZE=class{constructor(){this.size=0}init(){this.initialized=!0}},RE=class extends ZE{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=tM(Ng())}={}){let o=this,r=0;return i=qee(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-r),c=await Mr(o,t+r,a);c.length&&s.enqueue(c),r+i>=n||!c.length&&a?s.close():r+=i}})}},Rz=class extends ZE{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(BEe);return t.writeUint8Array(q3(i))}});Object.defineProperty(t,Ste,{get(){return n}})}writeUint8Array(){}},gM=class extends Rz{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)}};$d=class extends RE{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),zEe||TTt()}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()):_te?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)}},CE=class extends ZE{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,Ste,{get(){return i.writable}}),n.contentType=t,n.blobPromise=p0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},yM=class extends $d{constructor(t){super(new Blob([t],{type:xTt}))}},xM=class extends CE{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():kEe(new Uint8Array(await i.arrayBuffer()),t)}},Cz=class extends RE{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(_Tt));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 Mr(c,a,n);else{let u=d-a,m=await Mr(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}},Vz=class extends ZE{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===DEe){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(OEe);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,Ste,{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(DEe)}finally{t.releaseLock()}}},wg=class{constructor(t){return Array.isArray(t)&&(t=new Cz(t)),(t instanceof ReadableStream||typeof t.getReader==Yr)&&(t={readable:kf(t)}),t}},VE=class{constructor(t){return t.writable===ke&&typeof t.next==Yr&&(t=new Vz(t)),(t instanceof WritableStream||typeof t.getWriter==Yr)&&(t={writable:uEe(t)}),t.size===ke&&(t.size=0),t}}});var Bzi,Rte,Cte,TM,Vte,_M,Ete,Ate,Gte,EE,AE,SM,Lte,ZM,Wte,vte,Fte,Gz,Lz,Ite,Pte,Xte,Wz,Nte,Yte,Mte,wte,CZ,kte,STt,Ute,vz,ZTt,Fz,RTt,CTt,VTt,ETt,Dte,Ote,Bte,zte,ATt,GTt,LTt,WTt,vTt,FTt,ITt,PTt,XTt,NTt,YTt,MTt,wTt,kTt,UTt,DTt,sT,Hte=Xs(()=>{Bzi=x(T(),1),Rte="filename",Cte="rawFilename",TM="comment",Vte="rawComment",_M="uncompressedSize",Ete="compressedSize",Ate="offset",Gte="diskNumberStart",EE="lastModDate",AE="rawLastModDate",SM="lastAccessDate",Lte="rawLastAccessDate",ZM="creationDate",Wte="rawCreationDate",vte="internalFileAttributes",Fte="externalFileAttributes",Gz="internalFileAttribute",Lz="externalFileAttribute",Ite="msdosAttributesRaw",Pte="msdosAttributes",Xte="msDosCompatible",Wz="zip64",Nte="encrypted",Yte="version",Mte="versionMadeBy",wte="zipCrypto",CZ="directory",kte="executable",STt="symlink",Ute="compressionMethod",vz="signature",ZTt="crc32",Fz="extraField",RTt="extraFieldInfoZip",CTt="extraFieldUnix",VTt="extraFieldUnixType1",ETt="extraFieldPkwareUnix",Dte="unixMode",Ote="setuid",Bte="setgid",zte="sticky",ATt="bitFlag",GTt="rawBitFlag",LTt="filenameLength",WTt="extraFieldLength",vTt="unixExternalUpper",FTt="filenameUTF8",ITt="commentUTF8",PTt="rawExtraField",XTt="extraFieldZip64",NTt="extraFieldUnicodePath",YTt="extraFieldUnicodeComment",MTt="extraFieldAES",wTt="extraFieldNTFS",kTt="extraFieldExtendedTimestamp",UTt="extraFieldUSDZ",DTt=[Rte,Cte,_M,Ete,EE,AE,TM,Vte,SM,Lte,ZM,Wte,Ate,Gte,vte,Fte,Gz,Lz,Ite,Pte,Xte,Wz,Nte,Yte,Mte,wte,CZ,kte,STt,Ute,vz,ZTt,Fz,CTt,RTt,VTt,ETt,"uid","gid",Dte,vTt,Ote,Bte,zte,ATt,GTt,LTt,WTt,FTt,ITt,PTt,XTt,NTt,YTt,MTt,wTt,kTt,UTt],sT=class{constructor(t){DTt.forEach(n=>this[n]=t[n])}}});var TAe={};Cle(TAe,{ERR_AMBIGUOUS_ARCHIVE:()=>_ne,ERR_BAD_FORMAT:()=>GE,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>pne,ERR_ENCRYPTED:()=>yne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Sne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>Tne,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>fne,ERR_EOCDR_NOT_FOUND:()=>hne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>gne,ERR_INVALID_AUTHENTICATION_CODE:()=>oT,ERR_INVALID_COMPRESSED_DATA:()=>yE,ERR_INVALID_CRC32:()=>xE,ERR_INVALID_FILENAME_VALIDATION:()=>Cne,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Vne,ERR_INVALID_PASSWORD:()=>h0,ERR_INVALID_SIGNATURE:()=>iT,ERR_INVALID_STRICTNESS:()=>Rne,ERR_INVALID_UNCOMPRESSED_SIZE:()=>rT,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>bne,ERR_OVERLAPPING_ENTRY:()=>xne,ERR_SPLIT_ZIP_FILE:()=>Yz,ERR_UNSAFE_FILENAME:()=>Zne,ERR_UNSUPPORTED_COMPRESSION:()=>Nz,ERR_UNSUPPORTED_ENCRYPTION:()=>Xz,ERR_UNSUPPORTED_UINT64:()=>Ene,ERR_WORKER_STARTUP_TIMEOUT:()=>ZZ,WARNING_APPENDED_DATA:()=>wz,WARNING_COMPRESSED_PATCHED_DATA:()=>Lne,WARNING_DUPLICATE_FILENAME:()=>Ine,WARNING_MALFORMED_EXTRA_FIELD:()=>$z,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Pne,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Xne,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Nne,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>LE,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>vne,WARNING_PREPENDED_DATA:()=>kz,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Fne,WARNING_UNKNOWN_VERSION:()=>Gne,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Wne,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Ane,WARNING_WRAPPED_ENTRIES_COUNT:()=>Mz,ZipReader:()=>GZ,ZipReaderStream:()=>Dz,isZipFile:()=>uAe});async function uAe(e,t={}){if(e=new wg(e),await Xc(e),(e.size===ke||!e.readUint8Array)&&(e=new $d(await p0(e.readable)),await Xc(e)),e.size<22)return!1;let n=Mne(t,{}),i=n!=Xg,o=bAe(t[Kee],n),{endOfDirectoryInfo:r,endOfDirectoryReachingEndCount:s}=await gAe(e,i,o);if(!r||n==tT&&s>1)return!1;let a=xo(fi(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=fi(e);if(Fi(t,0)==84233040){let n=xo(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function i_t(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function o_t(e){let t={rawExtensibleData:e};if(e.length>=28){let n=fi(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 mAe(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:x_t(r),filenameLength:xo(t,n+22),extraFieldLength:xo(t,n+24)})}function hAe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=fi(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&&(r_t(m,t),t.extraFieldZip64=m);let p=s.get(28789);p&&(nAe(p,Rte,Cte,t,e),t.extraFieldUnicodePath=p);let b=s.get(25461);b&&(nAe(b,TM,Vte,t,e),t.extraFieldUnicodeComment=b);let f=s.get(39169);f&&f.data.length>=7?(s_t(f,t,u),t.extraFieldAES=f):t.compressionMethod=u;let y=s.get(13);y&&(iAe(y,t),t.extraFieldPkwareUnix=y);let _=s.get(22613);_&&(iAe(_,t),t.extraFieldUnixType1=_);let S=s.get(10);S&&(a_t(S,t),t.extraFieldNTFS=S);let Z=s.get(30805),R;if(Z&&(R=oAe(Z,t,!1),t.extraFieldUnix=Z),!R){let A=s.get(30837);A&&(oAe(A,t,!0),t.extraFieldInfoZip=A)}let C=s.get(21589);C&&(c_t(C,t,o),t.extraFieldExtendedTimestamp=C);let E=s.get(6534);return E&&(t.extraFieldUSDZ=E),d}function r_t(e,t){t.zip64=!0;let n=fi(e.data),i=$Tt.filter(([r,s])=>t[r]==s),o=i.reduce((r,[,s])=>r+$Ee[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 oAe(e,t,n){try{let i=fi(e.data),o,r;if(n){let s=0,a=cT(i,s++),c=cT(i,s++);o=rAe(e.data.subarray(s,s+c)),s+=c;let d=cT(i,s++);r=rAe(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 rAe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function c_t(e,t,n){if(!e.data.length)return;let i=fi(e.data),o=cT(i,0),r=[],s=[];n?((o&1)==1&&(r.push(EE),s.push(AE)),(o&2)==2&&(r.push(SM),s.push(Lte)),(o&4)==4&&(r.push(ZM),s.push(Wte))):e.data.length>=5&&(r.push(EE),s.push(AE));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 l_t({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 Mr(e,a+r,m+4),f=fi(b),y=b.length==m+4&&Fi(f,0)==134695760;if(y){let _=sAe(f,4,d);(t.encrypted&&!t.zipCrypto||_.crc32==o)&&_.compressedSize==r&&_.uncompressedSize==s?m+=4:y=!1}if(b.length>=m){let _=sAe(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("\\\\")||QTt.test(e)?!0:t==tT&&(n.includes(".")||n.includes(""))}function bAe(e,t){if(e!==ke){let n=yZ(e);if(typeof n!=eVe||Number.isNaN(n)||n<0)throw new Error(Vne);return n}return t==tT?0:t==Xg?1/0:65535}async function gAe(e,t,n){let{size:i}=e,o=Math.min(i,65557),r={count:t_t},s,a,c=0;for await(let[d,u,m,p,b]of yAe(e,o)){let f=xo(d,p+20);if(b+22+f==i){let y=await xAe(e,d,u,p,b,i,r);if(y==Uz){if(s||(s=qte(m,p,b)),c++,!t||c>1)break}else y==Yne&&!a&&(a=qte(m,p,b))}}return s||(s=a),s||(s=await g_t(e,n,r)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function g_t(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 yAe(e,o)){let p=qte(d,u,m);r||(r=p);let b=await xAe(e,a,c,u,m,i,n);if(b==Uz)return p;b==Yne&&!s&&(s=p)}return s||r}async function*yAe(e,t){let n=e.size-t,i=await Mr(e,n,t),o=fi(i);for(let r=i.length-22;r>=0;r--)Fi(o,r)==101010256&&(yield[o,n,i,r,n+r])}function qte(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function xAe(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 cAe(e,t,n,o-20,r,s)==117853008?Uz:eAe;if(!a&&!c)return Yne;let u=xo(t,i+6);for(let m of[o-c,WE(e,u)+d])if(await cAe(e,t,n,m,r,s)==33639248)return Uz;return eAe}async function cAe(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 Mr(e,i,4);return Fi(fi(s),0)}return ke}function y_t(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&qEe)!=(e.rawBitFlag&qEe)&&y0(s,o,Pne),t.compressionMethod!=e.compressionMethod&&y0(s,o,Xne),!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,Nne)}function y0(e,t,n){e?Iz(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 Iz(e){let t=new Error(_ne);throw t.reason=e,t}function Gs(e,t,n){return t[n]===ke?e.options[n]:t[n]}function lAe(e,t,n){return cE(Gs(e,t,n))}function x_t(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 ie_t)throw new Error(Ene);return Number(n)}var iHi,GE,hne,fne,pne,bne,gne,yne,Xz,Nz,Yz,xne,Tne,_ne,Sne,Zne,Rne,Cne,Vne,Ene,Ane,Gne,Lne,$z,Wne,Mz,wz,kz,vne,Fne,Ine,LE,Pne,Xne,Nne,jTt,QTt,jEe,qTt,QEe,qEe,dAe,$Tt,$Ee,e_t,t_t,n_t,eAe,Yne,Uz,GZ,Dz,Qte,wne=Xs(()=>{iHi=x(T(),1);bc();m0();_Z();Zz();Az();Tte();xZ();pE();oM();Hte();eM();GE="File format is not recognized",hne="End of central directory not found",fne="End of Zip64 central directory locator not found",pne="Central directory header not found",bne="Local file header not found",gne="Zip64 extra field not found",yne="File contains encrypted entry",Xz="Encryption method not supported",Nz="Compression method not supported",Yz="Split zip file",xne="Overlapping entry found",Tne="Entry data out of bounds",_ne="Ambiguous archive",Sne="Encrypted central directory is not supported",Zne="Unsafe filename",Rne="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Cne="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Vne="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ene="64-bit value exceeds Number.MAX_SAFE_INTEGER",Ane="unsorted central directory",Gne="unknown version needed to extract",Lne="compressed patched data",$z="malformed extra field",Wne="unknown zip64 extensible data",Mz="wrapped entries count",wz="appended data",kz="prepended data",vne="prepended central directory",Fne="trailing central directory data",Ine="duplicate filename",LE="mismatched zip64 end of central directory record",Pne="mismatched local file header (general purpose bit flag)",Xne="mismatched local file header (compression method)",Nne="mismatched local file header (crc32 or sizes)",jTt=63,QTt=/^[a-zA-Z]:/,jEe="utf-8",qTt="UTF8",QEe="cp437",qEe=2057,dAe=1,$Tt=[[_M,4294967295],[Ete,4294967295],[Ate,4294967295],[Gte,65535]],$Ee={65535:{getValue:Fi,bytes:4},4294967295:{getValue:Qu,bytes:8}},e_t=BigInt(Number.MAX_SAFE_INTEGER),t_t=64,n_t=1032,eAe=0,Yne=1,Uz=2,GZ=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 $d(await p0(i.readable)),await Xc(i)),i.size<22)throw new Error(GE);let o=n.warnings=[],r=Mne(t,n.options),s=r==tT,a=r!=Xg,c=bAe(Gs(n,t,Kee),r),d=p_t(Gs(n,t,LVe),r),u=Gs(n,t,WVe),{endOfDirectoryInfo:m,endOfDirectoryReachingEndCount:p}=await gAe(i,a,c);if(!m)throw await d_t(i)?new Error(Yz):new Error(hne);a&&p>1&&Iz("multiple end of central directory records");let b=fi(m),f=Fi(b,12),y=Fi(b,16),_=m.offset,S=xo(b,20),Z=_+22+S,R=i.size-Z;R>c&&Iz(wz),R>0&&hh(o,wz);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+=WE(i,A)),X){let Be=m.offset>=20?await Mr(i,m.offset-20,20):yo,je=fi(Be);if(Be.length==20&&Fi(je,0)==117853008){y=WE(i,Fi(je,4))+Qu(je,8);let qe=await Mr(i,y,56),We=fi(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 Mr(i,y,56),We=fi(qe)}if(qe.length<56||Fi(We,0)!=101075792)throw new Error(fne);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 Mr(i,y+56,ct);v=o_t(Et)}}C==65535?C=Fi(We,16):C!=Fi(We,16)&&y0(s,o,LE),A==65535?A=Fi(We,20):A!=Fi(We,20)&&y0(s,o,LE),L==65535?L=Qu(We,32):L!=Qu(We,32)&&y0(s,o,LE),f==4294967295?f=Qu(We,40):f!=Qu(We,40)&&y0(s,o,LE),y=WE(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(Yz);if(y<0)throw new Error(GE);let M=0,O=await Mr(i,y,f),w=fi(O);if(f){if(O.length<4)throw new Error(GE);let Be=D-f;if(y!=Be&&A==C){let je=Fi(w,M)==33639248||!!(v&&v.compressedSize)||Kte(w),qe=!je;if(!qe&&Be>=0&&Be+4<=i.size){let We=await Mr(i,Be,4);qe=Fi(fi(We),0)==33639248}if(qe){let We=y;y=Be,y>We&&(F+=y-We,I=je),O=await Mr(i,y,f),w=fi(O)}}}let z=D-y;if(f!=z&&z>=0&&A==C&&(f=z,O=await Mr(i,y,f),w=fi(O)),y<0||y>=i.size)throw new Error(GE);n.directoryOffset=y,n.directoryLength=Y;let K=lAe(n,t,vVe),te,H;if(K&&L&&O.length>=4&&Fi(w,0)!=33639248&&(V||Kte(w))){let Be=i_t(v,Y,O.length);H=O.subarray(Be),O=await K(O.subarray(0,Be),v),w=fi(O),Y=O.length,te=!0}v&&!te&&(O.length<4||Fi(w,0)==33639248)&&hh(o,Wne),N=y;let $=Gs(n,t,nVe),ee=Gs(n,t,iVe),le=new Set,_e,he=-1,Ze=!s&&!g;!L&&Ze&&(L=tAe(w,O,M),L&&hh(o,Mz));for(let Be=0;BeO.length||Fi(w,M)!=33639248)throw Be==0&&!te&&(V||Kte(w))?new Error(Sne):new Error(pne);mAe(je,w,M+6);let qe=!!je.bitFlag.languageEncodingFlag,We=M+46,Ke=We+je.filenameLength,ct=Ke+je.extraFieldLength,Et=xo(w,M+4),zt=Et>>8==0,ut=Et>>8==3,bt=O.subarray(We,Ke),ht=xo(w,M+32),jt=ct+ht,st=O.subarray(ct,jt),pt=qe,Mi=qe,jn=Fi(w,M+38),Si=jn&255,Hi={readOnly:!!(Si&1),hidden:!!(Si&2),system:!!(Si&4),directory:!!(Si&16),archive:!!(Si&32)},Gi=Fi(w,M+42),pi=lAe(n,t,oVe)||bM,Zi=pt?jEe:$||QEe,On=Mi?jEe:ee||QEe,rn=pi(bt,Zi,H3);if(rn===ke&&(rn=bM(bt,Zi)),u){let wi=u(rn);wi!==ke&&(rn=wi)}if(b_t(rn,d)){let wi=new Error(Zne);throw wi.filename=rn,wi}let Hn=pi(st,On,K3);Hn===ke&&(Hn=bM(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(w,M+34),internalFileAttributes:xo(w,M+36),externalFileAttributes:jn,msdosAttributesRaw:Si,msdosAttributes:Hi,rawFilename:bt,filenameUTF8:pt,commentUTF8:Mi,rawExtraField:O.subarray(Ke,ct),rawComment:st,filename:rn,comment:Hn}),hAe(je,je,w,M+6)&&hh(o,$z,rn),je.offset+=F;let $i=WE(i,je.diskNumberStart)+je.offset;N=Math.min($i,N),$ijTt&&hh(o,Gne,rn),(je.rawBitFlag&32)==32&&hh(o,Lne,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),yi=((je.unixMode===ke?Po:je.unixMode)&61440)==40960,fr=!yi&&(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:yi,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 Mn=new sT(je);if(Mn.getData=(wi,Xo)=>je.getData(wi,Mn,n.readRanges,Xo),Mn.arrayBuffer=async wi=>{let Xo=new TransformStream,Dc=p0(Xo.readable).then(pm=>pm.arrayBuffer());return Dc.catch(()=>{}),await je.getData(Xo,Mn,n.readRanges,wi),Dc},M=jt,Be==L-1&&Ze){let wi=tAe(w,O,M);wi&&(L+=wi,hh(o,Mz))}let{onprogress:Ki}=t;if(Ki)try{await Ki(Be+1,L,new sT(je))}catch{}yield Mn}let ye=M,Ge=Jte(O.subarray(M))||(te?Jte(H):ke);if(!Ge&&!te){let Be=y+M,je=Math.min(D-Be,65541);je>=6&&(Ge=Jte(await Mr(i,Be,je)))}Ge&&(n.digitalSignature=Ge,ye=M+6+Ge.length),(M!=Y&&ye!=Y||!te&&M!=f&&ye!=f)&&y0(s,o,Fne),_e&&y0(s,o,Ine);let Ae=Gs(n,t,rVe),Fe=Gs(n,t,sVe),tt=(s||Ae)&&L&&N==4&&await u_t(i)?4:0;return s&&(F||L&&N>tt)&&Iz(kz),(F||L&&N>4)&&hh(o,kz),I&&hh(o,vne),Ae&&(n.prependedData=N>tt?await Mr(i,tt,N-tt):yo),n.comment=S?await Mr(i,_+22,S):yo,Fe&&(n.appendedData=Z3))throw new Error(Xz);if(!N&&!g)throw new Error(yne)}if(X+R>a.size)throw new Error(Tne);let _e=R,he=kf(a.createReadable({offset:X,size:_e})),Ze=j3(Gs(r,o,U3)),ye=Gs(r,o,aVe),Ge=Gs(r,o,lVe),Ae=Gs(r,o,cVe);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,O3);We&&(Ke=!1);let ct=Gs(r,o,hVe),Et=(ct===ke?Gs(r,o,mVe):ct)&&!V&&(!$||ee||m&&m.vendorVersion==dAe),zt={options:{codecType:fz,password:N,rawPassword:g,zipCrypto:ee,encryptionStrength:m&&m.strength,checkCrc32:Et,checkAuthenticationCode:Gs(r,o,fVe),passwordVerification:ee&&(C?S>>>8&255:_>>>24&255),outputSize:qe,crc32:_,compressed:je,encrypted:$,useWebWorkers:Gs(r,o,D3),useCompressionStream:Ke,transferStreams:Gs(r,o,B3),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 l_t({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 VE(t),await Xc(t,m_t(qe,R,je)),{writable:ut}=t;let{outputSize:ht}=await Sz({readable:he,writable:ut},zt);if(t.size+=ht,ht!=qe)throw new Error(rT)}}catch(ht){if(ht.outputSize!==ke&&(t.size+=ht.outputSize),!ye||ht.message!=Yg)throw bt=ht,ht}finally{if(!(!Ez(t)&&Gs(r,o,z3))&&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 Ooe=bm((Nso,Vw)=>{var Yso=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(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 qY=="object"&&qY&&qY.exports&&(qY.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 mCe=bm((JMi,z3)=>{var jMi=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,M=u.pixels.blocks[y],O,w,z;M.encoding<2?(M.encoding===0?O=M.rawData:(d(M.stuffedData,M.bitsPerPixel,M.numValidPixels,M.offset,C,I,u.pixels.maxValue),O=I),w=0):M.encoding===2?z=0:z=M.offset;var K;if(p)for(g=0;g>3],K<<=Y&7),N=0;N>3]),K&128?(F&&(F[Y]=1),A=M.encoding<2?O[w++]:z,E=E>A?A:E,L[Y++]=A):(F&&(F[Y]=0),L[Y++]=b),K<<=1;Y+=D}else if(M.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 M=(b.pixels.numBytes-1)/4;if(M!==Math.floor(M))throw"uncompressed block has invalid length";Y=new ArrayBuffer(M*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,M*4));var O=new Float32Array(Y);v.rawData=O,m+=M*4}else if(v.encoding===1){var w=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),z=Math.ceil(w/4);Y=new ArrayBuffer(z*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,w)),v.stuffedData=new Uint32Array(Y),m+=w}}}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=[],M,O,w,z,K,te;for(Z=f;Z0)if(M=[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=M[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,M,O,w=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),w=0),d.headerInfo.numValidPixel===f*b)for(M=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+=w:Y>0?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=g}else for(M=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[M-1]?g+=w:Y>0&&V[M-f]?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=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,M=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,M):G=o.unstuffLUT(v,E,X-1,m,L,M),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,M):m==null?o.originalUnstuff(F,u,D,A):o.unstuff(F,u,D,A,!1,m,L,M))}},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,M=0,O,w,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)),w={},M=0,N=O.getUint8(0),M++,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+=M,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=M;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=M,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{EUi=x(T(),1),Hte=new Date(2107,11,31,23,59,58),EV=new Date(1980,0,1),ke=void 0,sZ=1/0,tu="undefined",Yr="function",oVe="object",aZ="string",rVe="number",sVe="boolean",bo=new Uint8Array});function GV(e){if(e&&typeof e!=Yr)throw new Error(MVe);return e}function bz(e){if(e&&(typeof e.addEventListener!=Yr||typeof e.aborted!=sVe))throw new Error(wVe);return e||ke}function gz(e,t){if(e&&typeof e!=aZ||t&&!(t instanceof Uint8Array))throw new Error(jte)}function Qte(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function LV(e,t,n){e!==ke&&Qte(e,t,n)}function cZ(e){return typeof e==aZ&&e.trim()?Number(e):e}var LUi,aVe,cVe,lVe,dVe,uVe,rz,sz,az,cz,mVe,hVe,fVe,pVe,bVe,gVe,yVe,xVe,lz,dz,uz,mz,TVe,_Ve,SVe,ZVe,RVe,CVe,VVe,EVe,AVe,Kte,GVe,LVe,yM,AV,WVe,vVe,FVe,IVe,PVe,XVe,Jte,NVe,YVe,hz,fz,Ox,pz,Vg,MVe,wVe,jte,xM=Xs(()=>{LUi=x(T(),1);pc();aVe="filenameEncoding",cVe="commentEncoding",lVe="decodeText",dVe="extractPrependedData",uVe="extractAppendedData",rz="password",sz="rawPassword",az="passThrough",cz="signal",mVe="checkPasswordOnly",hVe="checkOverlappingEntryOnly",fVe="checkOverlappingEntry",pVe="checkAmbiguity",bVe="checkLocalDirectory",gVe="checkSignature",yVe="checkCrc32",xVe="checkAuthenticationCode",lz="useWebWorkers",dz="useCompressionStream",uz="transferStreams",mz="preventClose",TVe="encryptionStrength",_Ve="extendedTimestamp",SVe="ntfsTimestamp",ZVe="keepOrder",RVe="level",CVe="bufferedWrite",VVe="createTempStream",EVe="dataDescriptorSignature",AVe="useUnicodeFileNames",Kte="dataDescriptor",GVe="supportZip64SplitFile",LVe="encodeText",yM="offset",AV="usdz",WVe="unixExtraFieldType",vVe="localExtraField",FVe="centralExtraField",IVe="strictness",PVe="filenameValidation",XVe="normalizeFilename",Jte="maxAppendedDataSize",NVe="decryptCentralDirectory",YVe="signCentralDirectory",hz="filename",fz="comment",Ox="strict",pz="balanced",Vg="tolerant",MVe="Invalid option (must be a function)",wVe="Invalid signal (must be an AbortSignal instance)",jte="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function Eg(){return qte}function TM(e){return $te(e.chunkSize)}function $te(e){return e=cZ(e),Number.isInteger(e)&&e>=UVe?Math.max(e,AZt):kVe}function _M(e){Object.assign(qte,JVe(jVe(e)))}function JVe(e){let t={};for(let n of WZt){let i=e[n];i!==ke&&(t[n]=vZt(n,i))}return t}function vZt(e,t){if(HVe.includes(e)){if(t=cZ(t),e==zVe&&(!Number.isInteger(t)||t{IUi=x(T(),1);pc();xM();kVe=64*1024,AZt=64,UVe=1,DVe="Invalid maxWorkers (must be an integer greater than 0)",OVe=2;try{typeof navigator!=tu&&navigator.hardwareConcurrency&&(OVe=navigator.hardwareConcurrency)}catch{}BVe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:kVe,maxWorkers:OVe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=tu&&CompressionStream,DecompressionStream:typeof DecompressionStream!=tu&&DecompressionStream},zVe="maxWorkers",GZt=["baseURI","wasmURI","workerURI"],LZt=["useCompressionStream","useWebWorkers","transferStreams"],HVe=["chunkSize",zVe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],KVe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],WZt=[...GZt,...LZt,...HVe,...KVe],qte={...BVe}});function lh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function yz(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 XUi,lZ=Xs(()=>{XUi=x(T(),1)});var YUi,SM,QVe,FZt,IZt,PZt,XZt,NZt,YZt,MZt,vf,ZM=Xs(()=>{YUi=x(T(),1),SM=[[],[],[],[],[],[],[],[]];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;SM[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=SM[t-1][e];SM[t][e]=n>>>8^SM[0][n&255]}[QVe,FZt,IZt,PZt,XZt,NZt,YZt,MZt]=SM,vf=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=MZt[a&255]^YZt[a>>>8&255]^NZt[a>>>16&255]^XZt[a>>>24&255]^PZt[c&255]^IZt[c>>>8&255]^FZt[c>>>16&255]^QVe[c>>>24&255]}}for(;o>>8^QVe[(n^t[o])&255];this.crc=n}get(){return~this.crc}}});var kUi,RM,qVe=Xs(()=>{kUi=x(T(),1);ZM();RM=class extends TransformStream{constructor(){let t,n=new vf;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 vV(e){if(typeof TextEncoder==tu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n{OUi=x(T(),1);pc()});var zUi,od,CM,$Ve,tne,nne,Bx,eEe=Xs(()=>{zUi=x(T(),1),od={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=od.getPartial(n);return i===32?e.concat(t):od._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+od.getPartial(n)},clamp(e,t){if(e.length*320&&t&&(e[n-1]=od.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=od.getPartial(o);return i.push(od.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},CM={bytes:{fromBits(e){let n=od.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=od.concat(t,[od.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}};tne={};tne.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}};nne={};nne.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=od.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=od;for(t=CM.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{$Ui=x(T(),1);pc();wZt=typeof crypto!=tu&&typeof crypto.getRandomValues==Yr,Z0="Invalid password",zx="Invalid signature",Hx=zx,Ag="zipjs-abort-check-password",FV="Crypto API not supported"});function rEe(e,t,n,i){Object.assign(e,{ready:new Promise(o=>e.resolveReady=o),password:eRt(t,n),strength:i-1,pendingInput:bo})}function sEe(e,t,n,i,o,r){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=lh(c,t));let d=t.length-o;n=tRt(n,i+(d-d%IV));let u;for(u=0;u<=d-IV;u+=IV){let m=GM(R0,dh(t,u,u+IV));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(AM(R0,p),u+i)}return e.pendingInput=dh(t,u),n}async function jZt(e,t,n,i){let o=await aEe(e,t,n,dh(i,0,EM[t])),r=dh(i,EM[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Z0)}async function QZt(e,t,n){let i=xz(new Uint8Array(EM[t])),o=await aEe(e,t,n,i);return lh(i,o)}async function aEe(e,t,n,i){e.password=null;let o=await qZt(kZt,n,OZt,!1,BZt),r=await $Zt(Object.assign({salt:i},ine),o,8*(VM[t]*2+2)),s=new Uint8Array(r),a=GM(R0,dh(s,0,VM[t])),c=GM(R0,dh(s,VM[t],VM[t]*2)),d=dh(s,VM[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new KZt(new HZt(a),Array.from(zZt)),hmac:new JZt(c)}),d}async function qZt(e,t,n,i,o){if(tEe)try{return await LM.importKey(e,t,n,i,o)}catch{return tEe=!1,Bx.importKey(t)}else return Bx.importKey(t)}async function $Zt(e,t,n){if(nEe)try{return await LM.deriveBits(e,t,n)}catch{return nEe=!1,Bx.pbkdf2(t,e.salt,ine.iterations,n)}else return Bx.pbkdf2(t,e.salt,ine.iterations,n)}function eRt(e,t){return t===ke?vV(e):t}function tRt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function dh(e,t,n){return e.subarray(t,n)}function AM(e,t){return e.fromBits(t)}function GM(e,t){return e.toBits(t)}var s5i,IV,kZt,iEe,UZt,DZt,OZt,ine,BZt,EM,VM,Gg,zZt,Zz,LM,oEe,R0,HZt,KZt,JZt,tEe,nEe,_z,Sz,cEe=Xs(()=>{s5i=x(T(),1);pc();ene();lZ();eEe();Tz();IV=16,kZt="raw",iEe={name:"PBKDF2"},UZt={name:"HMAC"},DZt="SHA-1",OZt=Object.assign({hash:UZt},iEe),ine=Object.assign({iterations:1e3,hash:{name:DZt}},iEe),BZt=["deriveBits"],EM=[8,12,16],VM=[16,24,32],Gg=10,zZt=[0,0,0,0],Zz=typeof crypto!=tu,LM=Zz&&crypto.subtle,oEe=Zz&&typeof LM!=tu,R0=CM.bytes,HZt=tne.aes,KZt=nne.ctrGladman,JZt=Bx.hmacSha1,tEe=Zz&&oEe&&typeof LM.importKey==Yr,nEe=Zz&&oEe&&typeof LM.deriveBits==Yr,_z=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:o,checkAuthenticationCode:r=!0}){super({start(){rEe(this,t,n,i)},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await jZt(c,u,d,dh(s,0,EM[u]+2)),s=dh(s,EM[u]+2),o?a.error(new Error(Ag)):m()):await p;let b=new Uint8Array(s.length-Gg-(s.length-Gg)%IV);a.enqueue(sEe(c,s,b,0,Gg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:d,ready:u}=this;if(c&&a){await u;let m=dh(d,0,d.length-Gg),p=dh(d,d.length-Gg),b=bo;if(m.length){let _=GM(R0,m);c.update(_);let S=a.update(_);b=AM(R0,S)}let f=dh(AM(R0,c.digest()),0,Gg),y=d.length>>24]);let o=~e.crcKey2.get();e.keys=[i,n,o]}function hEe(e){let t=e.keys[2]|2;return fEe(Math.imul(t,t^1)>>>8)}function fEe(e){return e&255}function uEe(e){return e&4294967295}var d5i,PV,Rz,Cz,pEe=Xs(()=>{d5i=x(T(),1);ZM();Tz();PV=12,Rz=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:o}){super({start(){mEe(this,t,n,i)},transform(r,s){let a=this;if(a.password||a.rawPassword){let c=lEe(a,r.subarray(0,PV));if(a.password=a.rawPassword=null,(c[PV-1]^a.passwordVerification)!=0)throw new Error(Z0);r=r.subarray(PV)}o?s.error(new Error(Ag)):s.enqueue(lEe(a,r))}})}},Cz=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){mEe(this,t,n,i)},transform(o,r){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let d=xz(new Uint8Array(PV));d[PV-1]=s.passwordVerification,a=new Uint8Array(o.length+d.length),a.set(dEe(s,d),0),c=PV}else a=new Uint8Array(o.length),c=0;a.set(dEe(s,o),c),r.enqueue(a)}})}}});function Ff(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 C0(e,t){e=Ff(e);let n=t?{type:t}:{};if(iRt())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 iRt(){return typeof Blob.prototype.stream!=Yr||new Blob([]).stream()instanceof ReadableStream}function bEe(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 h5i,XV=Xs(()=>{h5i=x(T(),1);pc()});function Ez(e){return oRt.get(e)}function Az(e){return one.get(e)}function rRt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Yr&&typeof i!=Yr)throw new Error(gEe);one.set(e,{CompressionStream:n,DecompressionStream:i})}async function yEe(e,t){!one.has(e)&&t&&rRt(e,await import(t))}var b5i,gEe,oRt,one,uZ=Xs(()=>{b5i=x(T(),1);pc();gEe="Invalid codec module",oRt=new Map,one=new Map});function lRt(e,t,n){let i=new vf,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(_Ee);y.set(aRt),f.enqueue(y)},transform(f,y){y.enqueue(f)},async flush(f){r=!0,p();try{await d}finally{b()}let y=new Uint8Array(rne),_=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=If(e,u),e=YV(e,t),If(e,m);function p(){b(),s=setTimeout(()=>c(new Error(Kx)),cRt)}function b(){clearTimeout(s)}}function ane(e,t){if(!e)return!1;let n=xEe.get(e);n||(n=new Map,xEe.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 vz(e){return ane(e,sne)}function cne(e){return ane(e,vM)}function SEe(e,t,n){t=If(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function ZEe(e,t,n){if(!e)throw new Error(sRt);return new e(t,n)}function REe(e,t,n,i,o){let r=t&&i?i:o||i,s=n.deflate64?TEe:sne,a;try{a=new r(s,n)}catch(c){if(t&&o&&r!=o)a=new o(s,n);else throw c}return YV(e,a)}function If(e,t){return Ff(e).pipeThrough(t)}function YV(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 dRt(n,r),await uRt(i,r)}}}async function dRt(e,t){try{await e.abort(t)}catch{}}async function uRt(e,t){try{await e.cancel(t)}catch{}}function mRt(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(MV);throw a.cause=s,a}let{value:o,done:r}=i;r?n.close():n.enqueue(o)},cancel(n){return t.cancel(n)}})}var E5i,Kx,MV,wV,sRt,sne,TEe,vM,_Ee,rne,aRt,cRt,Gz,Lz,Wz,xEe,lne=Xs(()=>{E5i=x(T(),1);ZM();qVe();cEe();pEe();Tz();pc();lZ();XV();uZ();Kx="Invalid uncompressed size",MV="Invalid compressed data",wV=zx,sRt="Compression method not supported",sne="deflate-raw",TEe="deflate64-raw",vM="gzip",_Ee=10,rne=8,aRt=[31,139,8],cRt=5e3,Gz=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&&Az(p),E=d&&r&&!m&&!C&&(!s||c)&&!!(a&&o);if((!s||c)&&d&&!E&&(_=new RM,R=If(R,_)),r)if(C)R=YV(R,ZEe(C.CompressionStream,p,{level:u,chunkSize:n,compressionMethod:b,uncompressedSize:f}));else if(E)Z=new Lz,R=YV(R,new o(vM)),R=If(R,Z);else try{R=REe(R,a,{level:u,chunkSize:n},o,i)}catch(A){let L;try{L=new o(vM)}catch{throw A}R=YV(R,L),R=If(R,new Lz)}s&&(c?R=If(R,new Cz(t)):(S=new Sz(t),R=If(R,S))),SEe(y,R,()=>{(!s||c)&&d&&(y.crc32=E?Z.crc32:new DataView(_.value.buffer).getUint32(0))})}},Lz=class extends TransformStream{constructor(){let t,n=_Ee,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<=rne){i=lh(i,o);return}let a=s-rne,c=Math.min(a,i.length);r.enqueue(lh(i.subarray(0,c),o.subarray(0,a-c))),i=lh(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}};Wz=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=If(Z,new Rz(t)):(S=new _z(t),Z=If(Z,S))),d){let R=p&&Az(p);if(R)Z=YV(Z,ZEe(R.DecompressionStream,p,{chunkSize:n,compressionMethod:b,rawBitFlag:f,uncompressedSize:y}));else try{Z=REe(Z,u,{chunkSize:n,deflate64:m},o,i)}catch(C){if(m||y===ke)throw C;let E;try{E=new o(vM)}catch{throw C}Z=lRt(Z,E,y)}Z=mRt(Z)}a&&(_=new RM,Z=If(Z,_)),SEe(this,Z,()=>{if(a){let R=new DataView(_.value.buffer);if(c!=R.getUint32(0,!1))throw new Error(wV)}})}},xEe=new Map});var W5i,hRt,CEe,VEe,EEe,dne,AEe,GEe,kV,Iz,Fz,FM,Pz=Xs(()=>{W5i=x(T(),1);pc();lne();hRt=64*1024,CEe="message",VEe="start",EEe="pull",dne="data",AEe="ack",GEe="close",kV="deflate",Iz="inflate",Fz=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(kV)?r=Gz:o.startsWith(Iz)&&(r=Wz),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(Kx)},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)}})}},FM=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=hRt),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(;aYz(e,t)}}async function Yz({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(e.compressed&&!e.format){let d=e.codecType.startsWith(kV),u=d?o.CompressionStreamFallback:o.DecompressionStreamFallback,m=d?o.CompressionStream:o.DecompressionStream;if(e.useCompressionStream){if(u&&u.requiresModule&&!vz(m))try{await Nz(o)}catch{}}else try{await Nz(o)}catch{(!u||u.requiresModule)&&(e.useCompressionStream=!0)}}r=new Fz(e,o),await t.pipeThrough(r).pipeThrough(new FM(TM(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 X5i,hZ,Xz,LEe,mne,Nz,mZ,hne,IM=Xs(()=>{X5i=x(T(),1);pc();S0();Pz();hZ="Worker startup timeout",Nz=()=>{};mZ=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 LEe&&(u=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new FM(TM(r))).pipeThrough(new hne(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)}}}),Xz===ke&&(Xz=typeof Worker!=tu),(a&&mne&&(Xz&&d||u)?mne:pne)(t,r)}},hne=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await une(t,i)},async transform(s,a){r+=s.length,n&&await une(n,r,i),a.enqueue(s)},async flush(){o&&await une(o,r)}})}}});async function Uz(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=TRt(p,i.baseURI)),await yEe(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=fZ.find(E=>!E.busy);if(C)return kEe(C),new mZ(C,e,t,R);if(fZ.length{UV.push({resolve:E,stream:e,workerOptions:t}),wz=i.workerStarvationTimeout,kz()})}function R(C){if(UEe(),UV.length){let[{resolve:E,stream:A,workerOptions:L}]=UV.splice(0,1);E(new mZ(C,A,L,R)),kz()}else C.worker?(kEe(C),ZRt(C,t)):fZ=fZ.filter(E=>E!=C)}}function TRt(e,t){try{return new URL(e,t).toString()}catch{return e}}function kz(){!DV&&UV.length&&Number.isFinite(wz)&&wz>=0&&(DV=setTimeout(_Rt,wz))}function UEe(){DV&&(clearTimeout(DV),DV=null)}function _Rt(){if(DV=null,UV.length){let[{resolve:e,stream:t,workerOptions:n}]=UV.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new mZ({},t,i,SRt)),kz()}}function SRt(){UEe(),kz()}function ZRt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{fZ=fZ.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function kEe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var K5i,fZ,UV,DV,wz,wEe,Dz=Xs(()=>{K5i=x(T(),1);pc();Pz();uZ();IM();fZ=[],UV=[],wEe=0});function OEe(e){if(RRt){let t="";for(let n=0;n{j5i=x(T(),1),DEe="\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(""),RRt=DEe.length==256});function PM(e,t){return HEe(e,t,!0)}function zEe(e,t){return HEe(e,t,!1)}function HEe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?OEe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var $5i,_ne=Xs(()=>{$5i=x(T(),1);BEe()});function VRt(){QEe=(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();Sne=n==1}catch{Sne=!1}})()}function Hz(e){return!!(e&&e.getData)}async function Mc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function ERt(e){return e=new Lg(e),await Mc(e),(e.size===ke||!e.readUint8Array)&&(e=new nu(await C0(e.readable)),await Mc(e)),e}function Mr(e,t,n){return e.readUint8Array(t,n)}function Rne(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?BV.prototype.createReadable.call(e,t):e.readable}var cDi,JEe,jEe,CRt,rDi,sDi,Zne,KEe,OV,BV,Oz,XM,Sne,QEe,nu,zV,NM,YM,Bz,zz,Lg,HV,Kz=Xs(()=>{cDi=x(T(),1);pc();S0();lZ();XV();_ne();JEe="Writer iterator completed too soon",jEe="Writer not initialized",CRt="text/plain",rDi=256*1024,sDi=16*1024*1024,Zne="writable",KEe=Symbol(),OV=class{constructor(){this.size=0}init(){this.initialized=!0}},BV=class extends OV{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=TM(Eg())}={}){let o=this,r=0;return i=$te(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-r),c=await Mr(o,t+r,a);c.length&&s.enqueue(c),r+i>=n||!c.length&&a?s.close():r+=i}})}},Oz=class extends OV{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(jEe);return t.writeUint8Array(yz(i))}});Object.defineProperty(t,Zne,{get(){return n}})}writeUint8Array(){}},XM=class extends Oz{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)}};nu=class extends BV{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),QEe||VRt()}createReadable(t){let n=this,{sourceBlob:i,size:o}=n,{offset:r=0,size:s=o-r}=t||{};return!r&&s>=o?Ff(i.stream()):Sne?Ff(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)}},zV=class extends OV{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,Zne,{get(){return i.writable}}),n.contentType=t,n.blobPromise=C0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},NM=class extends nu{constructor(t){super(new Blob([t],{type:CRt}))}},YM=class extends zV{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():zEe(new Uint8Array(await i.arrayBuffer()),t)}},Bz=class extends BV{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(ERt));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 Mr(c,a,n);else{let u=d-a,m=await Mr(c,a,u),p=await i.readUint8Array(t+u,n-u);r=lh(m,p)}}else r=bo;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),r}},zz=class extends OV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(m){if(m===KEe){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(JEe);o=b,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Mc(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,Zne,{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(KEe)}finally{t.releaseLock()}}},Lg=class{constructor(t){return Array.isArray(t)&&(t=new Bz(t)),(t instanceof ReadableStream||typeof t.getReader==Yr)&&(t={readable:Ff(t)}),t}},HV=class{constructor(t){return t.writable===ke&&typeof t.next==Yr&&(t=new zz(t)),(t instanceof WritableStream||typeof t.getWriter==Yr)&&(t={writable:bEe(t)}),t.size===ke&&(t.size=0),t}}});var dDi,Cne,Vne,MM,Ene,wM,Ane,Gne,Lne,KV,JV,kM,Wne,UM,vne,Fne,Ine,Jz,jz,Pne,Xne,Nne,Qz,Yne,Mne,wne,kne,pZ,Une,ARt,Dne,qz,GRt,$z,LRt,WRt,vRt,FRt,One,Bne,zne,Hne,IRt,PRt,XRt,NRt,YRt,MRt,wRt,kRt,URt,DRt,ORt,BRt,zRt,HRt,KRt,JRt,Jx,Kne=Xs(()=>{dDi=x(T(),1),Cne="filename",Vne="rawFilename",MM="comment",Ene="rawComment",wM="uncompressedSize",Ane="compressedSize",Gne="offset",Lne="diskNumberStart",KV="lastModDate",JV="rawLastModDate",kM="lastAccessDate",Wne="rawLastAccessDate",UM="creationDate",vne="rawCreationDate",Fne="internalFileAttributes",Ine="externalFileAttributes",Jz="internalFileAttribute",jz="externalFileAttribute",Pne="msdosAttributesRaw",Xne="msdosAttributes",Nne="msDosCompatible",Qz="zip64",Yne="encrypted",Mne="version",wne="versionMadeBy",kne="zipCrypto",pZ="directory",Une="executable",ARt="symlink",Dne="compressionMethod",qz="signature",GRt="crc32",$z="extraField",LRt="extraFieldInfoZip",WRt="extraFieldUnix",vRt="extraFieldUnixType1",FRt="extraFieldPkwareUnix",One="unixMode",Bne="setuid",zne="setgid",Hne="sticky",IRt="bitFlag",PRt="rawBitFlag",XRt="filenameLength",NRt="extraFieldLength",YRt="unixExternalUpper",MRt="filenameUTF8",wRt="commentUTF8",kRt="rawExtraField",URt="extraFieldZip64",DRt="extraFieldUnicodePath",ORt="extraFieldUnicodeComment",BRt="extraFieldAES",zRt="extraFieldNTFS",HRt="extraFieldExtendedTimestamp",KRt="extraFieldUSDZ",JRt=[Cne,Vne,wM,Ane,KV,JV,MM,Ene,kM,Wne,UM,vne,Gne,Lne,Fne,Ine,Jz,jz,Pne,Xne,Nne,Qz,Yne,Mne,wne,kne,pZ,Une,ARt,Dne,qz,GRt,$z,WRt,LRt,vRt,FRt,"uid","gid",One,YRt,Bne,zne,Hne,IRt,PRt,XRt,NRt,MRt,wRt,kRt,URt,DRt,ORt,BRt,zRt,HRt,KRt],Jx=class{constructor(t){JRt.forEach(n=>this[n]=t[n])}}});var CAe={};Cle(CAe,{ERR_AMBIGUOUS_ARCHIVE:()=>Sie,ERR_BAD_FORMAT:()=>jV,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>bie,ERR_ENCRYPTED:()=>xie,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Zie,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>_ie,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>pie,ERR_EOCDR_NOT_FOUND:()=>fie,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>yie,ERR_INVALID_AUTHENTICATION_CODE:()=>Hx,ERR_INVALID_COMPRESSED_DATA:()=>MV,ERR_INVALID_CRC32:()=>wV,ERR_INVALID_FILENAME_VALIDATION:()=>Vie,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Eie,ERR_INVALID_PASSWORD:()=>Z0,ERR_INVALID_SIGNATURE:()=>zx,ERR_INVALID_STRICTNESS:()=>Cie,ERR_INVALID_UNCOMPRESSED_SIZE:()=>Kx,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>gie,ERR_OVERLAPPING_ENTRY:()=>Tie,ERR_SPLIT_ZIP_FILE:()=>oH,ERR_UNSAFE_FILENAME:()=>Rie,ERR_UNSUPPORTED_COMPRESSION:()=>iH,ERR_UNSUPPORTED_ENCRYPTION:()=>nH,ERR_UNSUPPORTED_UINT64:()=>Aie,ERR_WORKER_STARTUP_TIMEOUT:()=>hZ,WARNING_APPENDED_DATA:()=>sH,WARNING_COMPRESSED_PATCHED_DATA:()=>Wie,WARNING_DUPLICATE_FILENAME:()=>Pie,WARNING_MALFORMED_EXTRA_FIELD:()=>xH,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Xie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Nie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Yie,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>QV,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Fie,WARNING_PREPENDED_DATA:()=>aH,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Iie,WARNING_UNKNOWN_VERSION:()=>Lie,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>vie,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Gie,WARNING_WRAPPED_ENTRIES_COUNT:()=>rH,ZipReader:()=>xZ,ZipReaderStream:()=>lH,isZipFile:()=>bAe});async function bAe(e,t={}){if(e=new Lg(e),await Mc(e),(e.size===ke||!e.readUint8Array)&&(e=new nu(await C0(e.readable)),await Mc(e)),e.size<22)return!1;let n=wie(t,{}),i=n!=Vg,o=_Ae(t[Jte],n),{endOfDirectoryInfo:r,endOfDirectoryReachingEndCount:s}=await SAe(e,i,o);if(!r||n==Ox&&s>1)return!1;let a=go(hi(r),20),c=r.offset+22+a;return e.size-c<=o}function Jne(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n=6){let t=hi(e);if(Wi(t,0)==84233040){let n=go(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function l1t(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function d1t(e){let t={rawExtensibleData:e};if(e.length>=28){let n=hi(e),i=go(n,26);Object.assign(t,{compressionMethod:go(n,0),compressedSize:Ju(n,2),uncompressedSize:Ju(n,10),encryptionAlgorithm:go(n,18),bitLength:go(n,20),flags:go(n,22),hashAlgorithm:go(n,24),hashData:e.subarray(28,28+i)})}return t}function gAe(e,t,n){let i=e.rawBitFlag=go(t,n+2),o=(i&1)==1,r=Wi(t,n+6);Object.assign(e,{encrypted:o,version:go(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:C1t(r),filenameLength:go(t,n+22),extraFieldLength:go(t,n+24)})}function yAe(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=go(n,i+4);Object.assign(t,{signature:Wi(n,i+10),crc32:Wi(n,i+10),compressedSize:Wi(n,i+14),uncompressedSize:Wi(n,i+18)});let m=s.get(1);m&&(u1t(m,t),t.extraFieldZip64=m);let p=s.get(28789);p&&(aAe(p,Cne,Vne,t,e),t.extraFieldUnicodePath=p);let b=s.get(25461);b&&(aAe(b,MM,Ene,t,e),t.extraFieldUnicodeComment=b);let f=s.get(39169);f&&f.data.length>=7?(m1t(f,t,u),t.extraFieldAES=f):t.compressionMethod=u;let y=s.get(13);y&&(cAe(y,t),t.extraFieldPkwareUnix=y);let _=s.get(22613);_&&(cAe(_,t),t.extraFieldUnixType1=_);let S=s.get(10);S&&(h1t(S,t),t.extraFieldNTFS=S);let Z=s.get(30805),R;if(Z&&(R=lAe(Z,t,!1),t.extraFieldUnix=Z),!R){let A=s.get(30837);A&&(lAe(A,t,!0),t.extraFieldInfoZip=A)}let C=s.get(21589);C&&(f1t(C,t,o),t.extraFieldExtendedTimestamp=C);let E=s.get(6534);return E&&(t.extraFieldUSDZ=E),d}function u1t(e,t){t.zip64=!0;let n=hi(e.data),i=r1t.filter(([r,s])=>t[r]==s),o=i.reduce((r,[,s])=>r+oAe[s].bytes,0);if(e.data.length=12&&(r.uid=go(n,8),r.gid=go(n,10)),Object.assign(e,r),Object.assign(t,r)}function lAe(e,t,n){try{let i=hi(e.data),o,r;if(n){let s=0,a=Qx(i,s++),c=Qx(i,s++);o=dAe(e.data.subarray(s,s+c)),s+=c;let d=Qx(i,s++);r=dAe(e.data.subarray(s,s+d)),Object.assign(e,{version:a,uid:o,gid:r})}else e.data.length>=4&&(o=go(i,0),r=go(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 dAe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function f1t(e,t,n){if(!e.data.length)return;let i=hi(e.data),o=Qx(i,0),r=[],s=[];n?((o&1)==1&&(r.push(KV),s.push(JV)),(o&2)==2&&(r.push(kM),s.push(Wne)),(o&4)==4&&(r.push(UM),s.push(vne))):e.data.length>=5&&(r.push(KV),s.push(JV));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=Wi(i,a);t[c]=e[c]=new Date((u|0)*1e3);let m=s[d];e[m]=u}a+=4})}async function p1t({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 Mr(e,a+r,m+4),f=hi(b),y=b.length==m+4&&Wi(f,0)==134695760;if(y){let _=uAe(f,4,d);(t.encrypted&&!t.zipCrypto||_.crc32==o)&&_.compressedSize==r&&_.uncompressedSize==s?m+=4:y=!1}if(b.length>=m){let _=uAe(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("\\\\")||i1t.test(e)?!0:t==Ox&&(n.includes(".")||n.includes(""))}function _Ae(e,t){if(e!==ke){let n=cZ(e);if(typeof n!=rVe||Number.isNaN(n)||n<0)throw new Error(Eie);return n}return t==Ox?0:t==Vg?1/0:65535}async function SAe(e,t,n){let{size:i}=e,o=Math.min(i,65557),r={count:a1t},s,a,c=0;for await(let[d,u,m,p,b]of ZAe(e,o)){let f=go(d,p+20);if(b+22+f==i){let y=await RAe(e,d,u,p,b,i,r);if(y==cH){if(s||(s=$ne(m,p,b)),c++,!t||c>1)break}else y==Mie&&!a&&(a=$ne(m,p,b))}}return s||(s=a),s||(s=await Z1t(e,n,r)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function Z1t(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 ZAe(e,o)){let p=$ne(d,u,m);r||(r=p);let b=await RAe(e,a,c,u,m,i,n);if(b==cH)return p;b==Mie&&!s&&(s=p)}return s||r}async function*ZAe(e,t){let n=e.size-t,i=await Mr(e,n,t),o=hi(i);for(let r=i.length-22;r>=0;r--)Wi(o,r)==101010256&&(yield[o,n,i,r,n+r])}function $ne(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function RAe(e,t,n,i,o,r,s){let a=go(t,i+10),c=Wi(t,i+12),d=Wi(t,i+16);if(a==65535||c==4294967295||d==4294967295)return await hAe(e,t,n,o-20,r,s)==117853008?cH:rAe;if(!a&&!c)return Mie;let u=go(t,i+6);for(let m of[o-c,qV(e,u)+d])if(await hAe(e,t,n,m,r,s)==33639248)return cH;return rAe}async function hAe(e,t,n,i,o,r){if(i<0||i+4>o)return ke;if(i>=n)return Wi(t,i-n);if(r.count>0){r.count--;let s=await Mr(e,i,4);return Wi(hi(s),0)}return ke}function R1t(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]))&&A0(s,o,"mismatched local file header (filename)"),(t.rawBitFlag&iAe)!=(e.rawBitFlag&iAe)&&A0(s,o,Xie),t.compressionMethod!=e.compressionMethod&&A0(s,o,Nie),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&A0(s,o,Yie)}function A0(e,t,n){e?eH(n):uh(t,n)}function uh(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function eH(e){let t=new Error(Sie);throw t.reason=e,t}function Ls(e,t,n){return t[n]===ke?e.options[n]:t[n]}function fAe(e,t,n){return GV(Ls(e,t,n))}function C1t(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 is1t)throw new Error(Aie);return Number(n)}var SDi,jV,fie,pie,bie,gie,yie,xie,nH,iH,oH,Tie,_ie,Sie,Zie,Rie,Cie,Vie,Eie,Aie,Gie,Lie,Wie,xH,vie,rH,sH,aH,Fie,Iie,Pie,QV,Xie,Nie,Yie,n1t,i1t,tAe,o1t,nAe,iAe,pAe,r1t,oAe,s1t,a1t,c1t,rAe,Mie,cH,xZ,lH,qne,kie=Xs(()=>{SDi=x(T(),1);pc();S0();uZ();Dz();Kz();_ne();lZ();XV();ZM();Kne();xM();jV="File format is not recognized",fie="End of central directory not found",pie="End of Zip64 central directory locator not found",bie="Central directory header not found",gie="Local file header not found",yie="Zip64 extra field not found",xie="File contains encrypted entry",nH="Encryption method not supported",iH="Compression method not supported",oH="Split zip file",Tie="Overlapping entry found",_ie="Entry data out of bounds",Sie="Ambiguous archive",Zie="Encrypted central directory is not supported",Rie="Unsafe filename",Cie="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Vie="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Eie="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Aie="64-bit value exceeds Number.MAX_SAFE_INTEGER",Gie="unsorted central directory",Lie="unknown version needed to extract",Wie="compressed patched data",xH="malformed extra field",vie="unknown zip64 extensible data",rH="wrapped entries count",sH="appended data",aH="prepended data",Fie="prepended central directory",Iie="trailing central directory data",Pie="duplicate filename",QV="mismatched zip64 end of central directory record",Xie="mismatched local file header (general purpose bit flag)",Nie="mismatched local file header (compression method)",Yie="mismatched local file header (crc32 or sizes)",n1t=63,i1t=/^[a-zA-Z]:/,tAe="utf-8",o1t="UTF8",nAe="cp437",iAe=2057,pAe=1,r1t=[[wM,4294967295],[Ane,4294967295],[Gne,4294967295],[Lne,65535]],oAe={65535:{getValue:Wi,bytes:4},4294967295:{getValue:Ju,bytes:8}},s1t=BigInt(Number.MAX_SAFE_INTEGER),a1t=64,c1t=1032,rAe=0,Mie=1,cH=2,xZ=class{constructor(t,n={}){Object.assign(this,{reader:new Lg(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Mc(i),(i.size===ke||!i.readUint8Array)&&(i=new nu(await C0(i.readable)),await Mc(i)),i.size<22)throw new Error(jV);let o=n.warnings=[],r=wie(t,n.options),s=r==Ox,a=r!=Vg,c=_Ae(Ls(n,t,Jte),r),d=_1t(Ls(n,t,PVe),r),u=Ls(n,t,XVe),{endOfDirectoryInfo:m,endOfDirectoryReachingEndCount:p}=await SAe(i,a,c);if(!m)throw await b1t(i)?new Error(oH):new Error(fie);a&&p>1&&eH("multiple end of central directory records");let b=hi(m),f=Wi(b,12),y=Wi(b,16),_=m.offset,S=go(b,20),Z=_+22+S,R=i.size-Z;R>c&&eH(sH),R>0&&uh(o,sH);let C=go(b,4),E=i.lastDiskNumber||0,A=go(b,6),L=go(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+=qV(i,A)),X){let Be=m.offset>=20?await Mr(i,m.offset-20,20):bo,je=hi(Be);if(Be.length==20&&Wi(je,0)==117853008){y=qV(i,Wi(je,4))+Ju(je,8);let qe=await Mr(i,y,56),We=hi(qe),Ke=m.offset-20-56;if((qe.length<56||Wi(We,0)!=101075792)&&y!=Ke&&Ke>=0){let ct=y;y=Ke,y>ct&&(F=y-ct),qe=await Mr(i,y,56),We=hi(qe)}if(qe.length<56||Wi(We,0)!=101075792)throw new Error(pie);if(g=!0,V=Ju(We,4)>44,V){let ct=Math.min(Ju(We,4)-44,i.size-y-56);if(ct>0){G+=ct;let Et=await Mr(i,y+56,ct);v=d1t(Et)}}C==65535?C=Wi(We,16):C!=Wi(We,16)&&A0(s,o,QV),A==65535?A=Wi(We,20):A!=Wi(We,20)&&A0(s,o,QV),L==65535?L=Ju(We,32):L!=Ju(We,32)&&A0(s,o,QV),f==4294967295?f=Ju(We,40):f!=Ju(We,40)&&A0(s,o,QV),y=qV(i,A)+Ju(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(oH);if(y<0)throw new Error(jV);let M=0,O=await Mr(i,y,f),w=hi(O);if(f){if(O.length<4)throw new Error(jV);let Be=D-f;if(y!=Be&&A==C){let je=Wi(w,M)==33639248||!!(v&&v.compressedSize)||Jne(w),qe=!je;if(!qe&&Be>=0&&Be+4<=i.size){let We=await Mr(i,Be,4);qe=Wi(hi(We),0)==33639248}if(qe){let We=y;y=Be,y>We&&(F+=y-We,I=je),O=await Mr(i,y,f),w=hi(O)}}}let z=D-y;if(f!=z&&z>=0&&A==C&&(f=z,O=await Mr(i,y,f),w=hi(O)),y<0||y>=i.size)throw new Error(jV);n.directoryOffset=y,n.directoryLength=Y;let K=fAe(n,t,NVe),te,H;if(K&&L&&O.length>=4&&Wi(w,0)!=33639248&&(V||Jne(w))){let Be=l1t(v,Y,O.length);H=O.subarray(Be),O=await K(O.subarray(0,Be),v),w=hi(O),Y=O.length,te=!0}v&&!te&&(O.length<4||Wi(w,0)==33639248)&&uh(o,vie),N=y;let $=Ls(n,t,aVe),ee=Ls(n,t,cVe),le=new Set,_e,he=-1,Ze=!s&&!g;!L&&Ze&&(L=sAe(w,O,M),L&&uh(o,rH));for(let Be=0;BeO.length||Wi(w,M)!=33639248)throw Be==0&&!te&&(V||Jne(w))?new Error(Zie):new Error(bie);gAe(je,w,M+6);let qe=!!je.bitFlag.languageEncodingFlag,We=M+46,Ke=We+je.filenameLength,ct=Ke+je.extraFieldLength,Et=go(w,M+4),zt=Et>>8==0,ut=Et>>8==3,bt=O.subarray(We,Ke),ht=go(w,M+32),jt=ct+ht,st=O.subarray(ct,jt),pt=qe,Mi=qe,jn=Wi(w,M+38),Si=jn&255,Hi={readOnly:!!(Si&1),hidden:!!(Si&2),system:!!(Si&4),directory:!!(Si&16),archive:!!(Si&32)},Gi=Wi(w,M+42),pi=fAe(n,t,lVe)||PM,Zi=pt?tAe:$||nAe,On=Mi?tAe:ee||nAe,rn=pi(bt,Zi,hz);if(rn===ke&&(rn=PM(bt,Zi)),u){let wi=u(rn);wi!==ke&&(rn=wi)}if(S1t(rn,d)){let wi=new Error(Rie);throw wi.filename=rn,wi}let Hn=pi(st,On,fz);Hn===ke&&(Hn=PM(st,On)),Object.assign(je,{index:Be,decryptedDirectory:te,versionMadeBy:Et,msDosCompatible:zt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ht,offset:Gi,diskNumberStart:go(w,M+34),internalFileAttributes:go(w,M+36),externalFileAttributes:jn,msdosAttributesRaw:Si,msdosAttributes:Hi,rawFilename:bt,filenameUTF8:pt,commentUTF8:Mi,rawExtraField:O.subarray(Ke,ct),rawComment:st,filename:rn,comment:Hn}),yAe(je,je,w,M+6)&&uh(o,xH,rn),je.offset+=F;let $i=qV(i,je.diskNumberStart)+je.offset;N=Math.min($i,N),$in1t&&uh(o,Lie,rn),(je.rawBitFlag&32)==32&&uh(o,Wie,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),yi=((je.unixMode===ke?Po:je.unixMode)&61440)==40960,fr=!yi&&(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:yi,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 Mn=new Jx(je);if(Mn.getData=(wi,Xo)=>je.getData(wi,Mn,n.readRanges,Xo),Mn.arrayBuffer=async wi=>{let Xo=new TransformStream,Dc=C0(Xo.readable).then(pm=>pm.arrayBuffer());return Dc.catch(()=>{}),await je.getData(Xo,Mn,n.readRanges,wi),Dc},M=jt,Be==L-1&&Ze){let wi=sAe(w,O,M);wi&&(L+=wi,uh(o,rH))}let{onprogress:Ki}=t;if(Ki)try{await Ki(Be+1,L,new Jx(je))}catch{}yield Mn}let ye=M,Ge=jne(O.subarray(M))||(te?jne(H):ke);if(!Ge&&!te){let Be=y+M,je=Math.min(D-Be,65541);je>=6&&(Ge=jne(await Mr(i,Be,je)))}Ge&&(n.digitalSignature=Ge,ye=M+6+Ge.length),(M!=Y&&ye!=Y||!te&&M!=f&&ye!=f)&&A0(s,o,Iie),_e&&A0(s,o,Pie);let Ae=Ls(n,t,dVe),Fe=Ls(n,t,uVe),tt=(s||Ae)&&L&&N==4&&await g1t(i)?4:0;return s&&(F||L&&N>tt)&&eH(aH),(F||L&&N>4)&&uh(o,aH),I&&uh(o,Fie),Ae&&(n.prependedData=N>tt?await Mr(i,tt,N-tt):bo),n.comment=S?await Mr(i,_+22,S):bo,Fe&&(n.appendedData=Z3))throw new Error(nH);if(!N&&!g)throw new Error(xie)}if(X+R>a.size)throw new Error(_ie);let _e=R,he=Ff(a.createReadable({offset:X,size:_e})),Ze=bz(Ls(r,o,cz)),ye=Ls(r,o,mVe),Ge=Ls(r,o,fVe),Ae=Ls(r,o,hVe);Ae&&(Ge=!0);let{onstart:Fe,onprogress:tt,onend:Be}=o,je=b!=0&&!V,qe=V?R:Z,We=b==9,Ke=Ls(r,o,dz);We&&(Ke=!1);let ct=Ls(r,o,yVe),Et=(ct===ke?Ls(r,o,gVe):ct)&&!V&&(!$||ee||m&&m.vendorVersion==pAe),zt={options:{codecType:Iz,password:N,rawPassword:g,zipCrypto:ee,encryptionStrength:m&&m.strength,checkCrc32:Et,checkAuthenticationCode:Ls(r,o,xVe),passwordVerification:ee&&(C?S>>>8&255:_>>>24&255),outputSize:qe,crc32:_,compressed:je,encrypted:$,useWebWorkers:Ls(r,o,lz),useCompressionStream:Ke,transferStreams:Ls(r,o,uz),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 p1t({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 HV(t),await Mc(t,y1t(qe,R,je)),{writable:ut}=t;let{outputSize:ht}=await Uz({readable:he,writable:ut},zt);if(t.size+=ht,ht!=qe)throw new Error(Kx)}}catch(ht){if(ht.outputSize!==ke&&(t.size+=ht.outputSize),!ye||ht.message!=Ag)throw bt=ht,ht}finally{if(!(!Hz(t)&&Ls(r,o,mz))&&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 AYe=bm((Vfr,EYe)=>{var Efr=x(T());EYe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3Jia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AAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var LYe=bm((Afr,GYe)=>{var Gfr=x(T()),{webm:e3t,mp4:t3t}=AYe(),hle=()=>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,fle=()=>"wakeLock"in navigator,ple=class{constructor(){if(this.enabled=!1,fle()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else hle()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",e3t),this._addSourceToVideo(this.noSleepVideo,"mp4",t3t),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 fle()?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}):hle()?(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 Vw=="object"&&Vw&&Vw.exports&&(Vw.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 LPe=bm((bAo,tJ)=>{var gAo=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,M=u.pixels.blocks[y],O,w,z;M.encoding<2?(M.encoding===0?O=M.rawData:(d(M.stuffedData,M.bitsPerPixel,M.numValidPixels,M.offset,C,I,u.pixels.maxValue),O=I),w=0):M.encoding===2?z=0:z=M.offset;var K;if(p)for(g=0;g>3],K<<=Y&7),N=0;N>3]),K&128?(F&&(F[Y]=1),A=M.encoding<2?O[w++]:z,E=E>A?A:E,L[Y++]=A):(F&&(F[Y]=0),L[Y++]=b),K<<=1;Y+=D}else if(M.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 M=(b.pixels.numBytes-1)/4;if(M!==Math.floor(M))throw"uncompressed block has invalid length";Y=new ArrayBuffer(M*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,M*4));var O=new Float32Array(Y);v.rawData=O,m+=M*4}else if(v.encoding===1){var w=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),z=Math.ceil(w/4);Y=new ArrayBuffer(z*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,w)),v.stuffedData=new Uint32Array(Y),m+=w}}}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=[],M,O,w,z,K,te;for(Z=f;Z0)if(M=[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=M[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,M,O,w=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),w=0),d.headerInfo.numValidPixel===f*b)for(M=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+=w:Y>0?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=g}else for(M=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[M-1]?g+=w:Y>0&&V[M-f]?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=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,M=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,M):G=o.unstuffLUT(v,E,X-1,m,L,M),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,M):m==null?o.originalUnstuff(F,u,D,A):o.unstuff(F,u,D,A,!1,m,L,M))}},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,M=0,O,w,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)),w={},M=0,N=O.getUint8(0),M++,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+=M,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=M;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=M,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 Afr=x(T());AYe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkx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QAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE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AAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var WYe=bm((Gfr,LYe)=>{var Lfr=x(T()),{webm:t3t,mp4:n3t}=GYe(),hle=()=>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,fle=()=>"wakeLock"in navigator,ple=class{constructor(){if(this.enabled=!1,fle()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else hle()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",t3t),this._addSourceToVideo(this.noSleepVideo,"mp4",n3t),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 fle()?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}):hle()?(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(){fle()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):hle()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};GYe.exports=ple});var C3t={};Cle(C3t,{AlphaMode:()=>_p,AlphaPipelineStage:()=>_I,AnchorPointDirect:()=>SF,AnchorPointIndirect:()=>ZF,Animation:()=>T5,AnimationViewModel:()=>_5,Appearance:()=>Eo,ApproximateTerrainHeights:()=>Xi,ArcGISTiledElevationTerrainProvider:()=>Uae,ArcGisBaseMapType:()=>vh,ArcGisMapServerImageryProvider:()=>ib,ArcGisMapService:()=>Tu,ArcType:()=>mn,ArticulationStageType:()=>ul,AssociativeArray:()=>kt,Atmosphere:()=>a_,AtmospherePipelineStage:()=>qF,AttributeCompression:()=>dn,AttributeType:()=>Dt,AutoExposure:()=>_G,AutomaticUniforms:()=>lb,Axis:()=>Di,AxisAlignedBoundingBox:()=>Gu,Azure2DImageryProvider:()=>RG,B3dmLoader:()=>NF,B3dmParser:()=>EG,BaseLayerPicker:()=>p5,BaseLayerPickerViewModel:()=>f5,BatchTable:()=>l_,BatchTableHierarchy:()=>m_,BatchTexture:()=>Yl,BatchTexturePipelineStage:()=>SI,Billboard:()=>No,BillboardCollection:()=>Cu,BillboardGraphics:()=>xl,BillboardLoadState:()=>Ns,BillboardTexture:()=>ub,BillboardVisualizer:()=>Ak,BingMapsGeocoderService:()=>Oae,BingMapsImageryProvider:()=>Zv,BingMapsStyle:()=>Z1,BlendEquation:()=>Cc,BlendFunction:()=>$o,BlendOption:()=>Ni,BlendingState:()=>on,BoundingRectangle:()=>nt,BoundingSphere:()=>me,BoundingSphereState:()=>Wt,BoundingVolumeSemantics:()=>wy,BoxEmitter:()=>WQ,BoxGeometry:()=>Fc,BoxGeometryUpdater:()=>Lk,BoxGraphics:()=>VZ,BoxOutlineGeometry:()=>yf,BrdfLutGenerator:()=>Vv,Buffer:()=>it,BufferLoader:()=>y_,BufferPoint:()=>Ac,BufferPointCollection:()=>Id,BufferPointMaterial:()=>Oh,BufferPolygon:()=>Fr,BufferPolygonCollection:()=>Ya,BufferPolygonMaterial:()=>Vu,BufferPolyline:()=>ya,BufferPolylineCollection:()=>tl,BufferPolylineMaterial:()=>Eu,BufferPrimitive:()=>es,BufferPrimitiveCollection:()=>$s,BufferPrimitiveMaterial:()=>wl,BufferUsage:()=>Pe,CPUStylingPipelineStage:()=>VI,CallbackPositionProperty:()=>Wk,CallbackProperty:()=>Bf,Camera:()=>Wo,CameraEventAggregator:()=>A2,CameraEventType:()=>io,CameraFlightPath:()=>R2,Cartesian2:()=>k,Cartesian3:()=>h,Cartesian4:()=>ce,CartesianRectangle:()=>XC,Cartographic:()=>pe,CartographicGeocoderService:()=>zae,CatmullRomSpline:()=>Hae,Cesium3DContentGroup:()=>E_,Cesium3DTile:()=>$m,Cesium3DTileBatchTable:()=>wh,Cesium3DTileColorBlendMode:()=>vd,Cesium3DTileContent:()=>F$,Cesium3DTileContentFactory:()=>gS,Cesium3DTileContentState:()=>Io,Cesium3DTileContentType:()=>Za,Cesium3DTileFeature:()=>na,Cesium3DTileFeatureTable:()=>af,Cesium3DTileOptimizationHint:()=>Jm,Cesium3DTileOptimizations:()=>uN,Cesium3DTilePass:()=>cr,Cesium3DTilePassState:()=>eh,Cesium3DTilePointFeature:()=>Ob,Cesium3DTileRefine:()=>yr,Cesium3DTileStyle:()=>Jb,Cesium3DTileStyleEngine:()=>yN,Cesium3DTileVectorFeature:()=>fS,Cesium3DTilesInspector:()=>E5,Cesium3DTilesInspectorViewModel:()=>V5,Cesium3DTilesTerrainData:()=>QU,Cesium3DTilesTerrainGeometryProcessor:()=>IA,Cesium3DTilesTerrainProvider:()=>$ae,Cesium3DTilesVoxelProvider:()=>Q$,Cesium3DTileset:()=>zr,Cesium3DTilesetBaseTraversal:()=>RN,Cesium3DTilesetCache:()=>pN,Cesium3DTilesetGraphics:()=>FZ,Cesium3DTilesetHeatmap:()=>bN,Cesium3DTilesetMetadata:()=>GS,Cesium3DTilesetMostDetailedTraversal:()=>_N,Cesium3DTilesetSkipTraversal:()=>EN,Cesium3DTilesetStatistics:()=>xf,Cesium3DTilesetTraversal:()=>za,Cesium3DTilesetVisualizer:()=>vk,CesiumInspector:()=>h5,CesiumInspectorViewModel:()=>m5,CesiumTerrainProvider:()=>cR,CesiumWidget:()=>i5,Check:()=>Ko,CheckerboardMaterialProperty:()=>XE,CircleEmitter:()=>IN,CircleGeometry:()=>ece,CircleOutlineGeometry:()=>tce,ClassificationModelDrawCommand:()=>NP,ClassificationPipelineStage:()=>ZI,ClassificationPrimitive:()=>oV,ClassificationType:()=>ni,ClearCommand:()=>ui,ClippingPlane:()=>ea,ClippingPlaneCollection:()=>xs,ClippingPolygon:()=>uC,ClippingPolygonCollection:()=>vc,Clock:()=>Xf,ClockRange:()=>Vs,ClockStep:()=>Oo,ClockViewModel:()=>d5,CloudCollection:()=>ree,CloudType:()=>rV,Color:()=>U,ColorBlendMode:()=>dl,ColorGeometryInstanceAttribute:()=>$t,ColorMaterialProperty:()=>Qt,Command:()=>$ce,ComponentDatatype:()=>J,Composite3DTileContent:()=>L2,CompositeEntityCollection:()=>Use,CompositeMaterialProperty:()=>YE,CompositePositionProperty:()=>bc,CompositeProperty:()=>Tl,CompressedTextureBuffer:()=>hG,ComputeCommand:()=>vu,ComputeEngine:()=>M9,ConditionsExpression:()=>wX,ConeEmitter:()=>dee,ConstantPositionProperty:()=>sd,ConstantProperty:()=>fi,ConstantSpline:()=>kF,ContentMetadata:()=>jX,Context:()=>$Z,ContextLimits:()=>wt,Controller:()=>Nce,ControllerHost:()=>O9,CoplanarPolygonGeometry:()=>aU,CoplanarPolygonGeometryLibrary:()=>ig,CoplanarPolygonOutlineGeometry:()=>qm,CornerType:()=>lo,CorrelationGroup:()=>RF,CorridorGeometry:()=>bR,CorridorGeometryLibrary:()=>yo,CorridorGeometryUpdater:()=>Yk,CorridorGraphics:()=>AZ,CorridorOutlineGeometry:()=>Nk,Credit:()=>Lt,CreditDisplay:()=>ON,CubeMap:()=>ns,CubeMapFace:()=>lF,CubeMapPanorama:()=>MS,CubicRealPolynomial:()=>R_,CullFace:()=>ki,CullingVolume:()=>qs,CumulusCloud:()=>Ou,CustomDataSource:()=>Mk,CustomHeightmapTerrainProvider:()=>nce,CustomShader:()=>Pp,CustomShaderMode:()=>yb,CustomShaderPipelineStage:()=>FI,CustomShaderTranslucencyMode:()=>Dy,CylinderGeometry:()=>wk,CylinderGeometryLibrary:()=>gR,CylinderGeometryUpdater:()=>Uk,CylinderGraphics:()=>GZ,CylinderOutlineGeometry:()=>kk,CzmlDataSource:()=>qk,DataSource:()=>vs,DataSourceClock:()=>Nf,DataSourceCollection:()=>$k,DataSourceDisplay:()=>UU,DebugAppearance:()=>yee,DebugCameraPrimitive:()=>a0,DebugInspector:()=>tY,DebugModelMatrixPrimitive:()=>oY,DefaultProxy:()=>ice,DepthFunction:()=>sc,DepthPlane:()=>uY,DequantizationPipelineStage:()=>PI,DerivedCommand:()=>Zf,DeveloperError:()=>ge,DeviceOrientationCameraController:()=>mY,DirectionalLight:()=>Vee,DiscardEmptyTileImagePolicy:()=>R1,DiscardMissingTileImagePolicy:()=>mG,DistanceDisplayCondition:()=>Bt,DistanceDisplayConditionGeometryInstanceAttribute:()=>oi,DoubleEndedPriorityQueue:()=>ug,DoublyLinkedList:()=>fN,DracoLoader:()=>Eb,DrawCommand:()=>lt,DynamicAtmosphereLightingType:()=>ob,DynamicEnvironmentMapManager:()=>Wb,DynamicGeometryBatch:()=>TR,DynamicGeometryUpdater:()=>vi,EarthOrientationParameters:()=>rG,EarthOrientationParametersSample:()=>Zy,EasingFunction:()=>Ts,EdgeDetectionPipelineStage:()=>NI,EdgeDisplayMode:()=>km,EdgeFramebuffer:()=>hY,EdgeVisibilityPipelineStage:()=>wI,EllipseGeometry:()=>gd,EllipseGeometryLibrary:()=>lu,EllipseGeometryUpdater:()=>eU,EllipseGraphics:()=>LZ,EllipseOutlineGeometry:()=>um,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>_b,EllipsoidGeometry:()=>Ha,EllipsoidGeometryUpdater:()=>nU,EllipsoidGraphics:()=>WZ,EllipsoidOutlineGeometry:()=>ku,EllipsoidPrimitive:()=>fY,EllipsoidRhumbLine:()=>Gc,EllipsoidSurfaceAppearance:()=>Aee,EllipsoidTangentPlane:()=>Ms,EllipsoidTerrainProvider:()=>u0,EllipsoidalOccluder:()=>Rf,Empty3DTileContent:()=>e0,EncodedCartesian3:()=>An,Entity:()=>nr,EntityCluster:()=>$u,EntityCollection:()=>Qa,EntityView:()=>OU,EquirectangularPanorama:()=>Lee,Event:()=>Se,EventHelper:()=>Jr,Expression:()=>vm,ExpressionNodeType:()=>Pt,ExtrapolationType:()=>cd,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>bx,Fog:()=>CY,ForEach:()=>we,FrameRateMonitor:()=>VY,FrameState:()=>Wx,Framebuffer:()=>hs,FramebufferManager:()=>li,Frozen:()=>B,FrustumCommands:()=>EY,FrustumGeometry:()=>kS,FrustumOutlineGeometry:()=>$N,Fullscreen:()=>qr,FullscreenButton:()=>Z5,FullscreenButtonViewModel:()=>S5,GaussianSplat3DTileContent:()=>Ex,GaussianSplatPrimitive:()=>JX,GaussianSplatRenderResources:()=>OX,GaussianSplatSorter:()=>pS,GaussianSplatTextureGenerator:()=>DX,GeoJsonDataSource:()=>cT,GeoJsonLoader:()=>YF,GeoJsonPrimitive:()=>Pee,GeocodeType:()=>YT,Geocoder:()=>G5,GeocoderService:()=>NA,GeocoderViewModel:()=>A5,GeographicProjection:()=>Ui,GeographicTilingScheme:()=>eo,Geometry:()=>At,Geometry3DTileContent:()=>v2,GeometryAttribute:()=>Xe,GeometryAttributes:()=>Cn,GeometryFactory:()=>oce,GeometryInstance:()=>Mt,GeometryInstanceAttribute:()=>fl,GeometryOffsetAttribute:()=>yn,GeometryPipeline:()=>zn,GeometryPipelineStage:()=>OI,GeometryType:()=>Vm,GeometryUpdater:()=>Fi,GeometryUpdaterSet:()=>WR,GeometryVisualizer:()=>AU,GetFeatureInfoFormat:()=>df,Globe:()=>HY,GlobeDepth:()=>KY,GlobeSurfaceShaderSet:()=>XY,GlobeSurfaceTile:()=>rh,GlobeSurfaceTileProvider:()=>YY,GlobeTranslucency:()=>MY,GlobeTranslucencyFramebuffer:()=>JY,GlobeTranslucencyState:()=>jY,GltfBufferViewLoader:()=>U1,GltfDracoLoader:()=>D1,GltfGpmLoader:()=>VF,GltfGpmLocal:()=>fC,GltfImageLoader:()=>O1,GltfIndexBufferLoader:()=>B1,GltfJsonLoader:()=>H1,GltfLoader:()=>Iu,GltfLoaderUtil:()=>Yd,GltfMeshPrimitiveGpmLoader:()=>LF,GltfSpzLoader:()=>j2,GltfStructuralMetadataLoader:()=>TF,GltfTextureLoader:()=>Q1,GltfVertexBufferLoader:()=>q1,Google2DImageryProvider:()=>QI,GoogleEarthEnterpriseImageryProvider:()=>hte,GoogleEarthEnterpriseMapsProvider:()=>BI,GoogleEarthEnterpriseMetadata:()=>yg,GoogleEarthEnterpriseTerrainData:()=>YA,GoogleEarthEnterpriseTerrainProvider:()=>ace,GoogleEarthEnterpriseTileInformation:()=>$Y,GoogleGeocoderService:()=>lce,GoogleMaps:()=>_a,GoogleStreetViewCubeMapPanoramaProvider:()=>fte,GpxDataSource:()=>KU,GregorianDate:()=>Ih,GridImageryProvider:()=>pte,GridMaterialProperty:()=>HE,GroundGeometryUpdater:()=>ri,GroundPolylineGeometry:()=>tZ,GroundPolylinePrimitive:()=>Ef,GroundPrimitive:()=>id,GroupMetadata:()=>eV,HeadingPitchRange:()=>Lm,HeadingPitchRoll:()=>Vc,Heap:()=>eG,HeightReference:()=>He,HeightmapEncoding:()=>ih,HeightmapTerrainData:()=>Nc,HeightmapTessellator:()=>hV,HermitePolynomialApproximation:()=>Dk,HermiteSpline:()=>hx,HilbertOrder:()=>Y1,HomeButton:()=>X5,HomeButtonViewModel:()=>P5,HorizontalOrigin:()=>Oi,HybridScreenSpacePanCameraController:()=>Uce,I3SBuildingSceneLayerExplorer:()=>cle,I3SBuildingSceneLayerExplorerViewModel:()=>L5,I3SDataProvider:()=>Gf,I3SDecoder:()=>sM,I3SFeature:()=>aM,I3SField:()=>cM,I3SGeometry:()=>_V,I3SLayer:()=>oZ,I3SNode:()=>SV,I3SStatistics:()=>uM,I3SSublayer:()=>hM,I3SSymbology:()=>dM,I3dmLoader:()=>wF,I3dmParser:()=>MF,ITwinData:()=>qoe,ITwinPlatform:()=>aa,Iau2000Orientation:()=>Uw,Iau2006XysData:()=>sG,Iau2006XysSample:()=>s_,IauOrientationAxes:()=>Dw,IauOrientationParameters:()=>kw,ImageBasedLighting:()=>Q_,ImageBasedLightingPipelineStage:()=>eI,ImageMaterialProperty:()=>eT,Imagery:()=>IC,ImageryConfiguration:()=>HP,ImageryCoverage:()=>NC,ImageryFlags:()=>eP,ImageryInput:()=>nP,ImageryLayer:()=>Cs,ImageryLayerCollection:()=>LS,ImageryLayerFeatureInfo:()=>Yh,ImageryPipelineStage:()=>iP,ImageryProvider:()=>_u,ImageryState:()=>Dn,Implicit3DTileContent:()=>iC,ImplicitAvailabilityBitstream:()=>w1,ImplicitMetadataView:()=>k1,ImplicitSubdivisionScheme:()=>ks,ImplicitSubtree:()=>Lb,ImplicitSubtreeCache:()=>LN,ImplicitSubtreeMetadata:()=>I2,ImplicitTileCoordinates:()=>r0,ImplicitTileset:()=>o0,IndexDatatype:()=>Oe,InfoBox:()=>I5,InfoBoxViewModel:()=>F5,InspectorShared:()=>fu,InstanceAttributeSemantic:()=>Xr,InstancingPipelineStage:()=>gI,InterpolationAlgorithm:()=>uce,InterpolationType:()=>of,Intersect:()=>qt,IntersectionTests:()=>Ti,Intersections2D:()=>Jf,Interval:()=>Ys,InvertClassification:()=>RV,Ion:()=>Ld,IonGeocodeProviderType:()=>yy,IonGeocoderService:()=>wR,IonImageryProvider:()=>Ql,IonImageryProviderFactory:()=>vC,IonResource:()=>kr,IonSnapGeometryType:()=>fce,IonSnapHeat:()=>pce,IonSnapMode:()=>$U,IonSnapParentGeometryType:()=>bce,IonSnapService:()=>gce,IonWorldImageryStyle:()=>kb,Iso8601:()=>ot,JobScheduler:()=>Xw,JobType:()=>Lc,JsonMetadataTable:()=>vb,JulianDate:()=>Q,KTX2Transcoder:()=>fG,KeyboardEventModifier:()=>tr,KeyframeNode:()=>zo,KmlCamera:()=>Aw,KmlDataSource:()=>MZ,KmlLookAt:()=>Gw,KmlTour:()=>Lw,KmlTourFlyTo:()=>Ww,KmlTourWait:()=>vw,Label:()=>_x,LabelCollection:()=>qp,LabelGraphics:()=>Mf,LabelStyle:()=>xr,LabelVisualizer:()=>GU,LagrangePolynomialApproximation:()=>Ok,LeapSecond:()=>To,Light:()=>ere,LightingModel:()=>Jp,LightingPipelineStage:()=>rP,LinearApproximation:()=>nT,LinearSpline:()=>mx,MVTDataProvider:()=>sre,ManagedArray:()=>td,MapMode2D:()=>Bl,MapProjection:()=>xce,MapboxImageryProvider:()=>zI,MapboxStyleImageryProvider:()=>tre,MappedPositions:()=>tP,Material:()=>ro,MaterialAppearance:()=>Vo,MaterialPipelineStage:()=>lP,MaterialProperty:()=>Cr,Math:()=>W,Matrix2:()=>Ji,Matrix3:()=>q,Matrix4:()=>P,Megatexture:()=>Mw,MeshPrimitiveGpmLocal:()=>GF,MetadataClass:()=>$h,MetadataClassProperty:()=>kp,MetadataComponentType:()=>Nt,MetadataEntity:()=>Jn,MetadataEnum:()=>$2,MetadataEnumValue:()=>q2,MetadataPicking:()=>ww,MetadataPickingPipelineStage:()=>Xu,MetadataPipelineStage:()=>Um,MetadataSchema:()=>zl,MetadataSchemaLoader:()=>ox,MetadataSemantic:()=>Xm,MetadataTable:()=>Fm,MetadataTableProperty:()=>N2,MetadataType:()=>St,MipmapHint:()=>_m,Model:()=>Nu,Model3DTileContent:()=>Yu,ModelAlphaOptions:()=>rS,ModelAnimation:()=>BF,ModelAnimationChannel:()=>OF,ModelAnimationCollection:()=>zF,ModelAnimationLoop:()=>Md,ModelAnimationState:()=>cf,ModelArticulation:()=>nI,ModelArticulationStage:()=>tI,ModelClippingPlanesPipelineStage:()=>rI,ModelClippingPolygonsPipelineStage:()=>cI,ModelColorPipelineStage:()=>fx,ModelComponents:()=>Rn,ModelDrawCommand:()=>YP,ModelDrawCommands:()=>kP,ModelFeature:()=>HF,ModelFeatureTable:()=>KF,ModelGraphics:()=>Ng,ModelImagery:()=>KP,ModelImageryMapping:()=>nS,ModelLightingOptions:()=>IP,ModelMatrixUpdateStage:()=>yI,ModelNode:()=>mI,ModelPrimitiveImagery:()=>iS,ModelReader:()=>Ta,ModelRenderResources:()=>EP,ModelRuntimeNode:()=>TI,ModelRuntimePrimitive:()=>CP,ModelSceneGraph:()=>UP,ModelSilhouettePipelineStage:()=>LP,ModelSkin:()=>VP,ModelSplitterPipelineStage:()=>vP,ModelStatistics:()=>DP,ModelType:()=>Or,ModelUtility:()=>Zt,ModelVectorLookupPipelineStage:()=>uI,ModelVisualizer:()=>WU,Moon:()=>zw,MorphTargetsPipelineStage:()=>uP,MorphWeightSpline:()=>Tce,MortonOrder:()=>vx,MouseButton:()=>qa,Multiple3DTileContent:()=>$X,MultisampleFramebuffer:()=>pG,NavigationHelpButton:()=>v5,NavigationHelpButtonViewModel:()=>W5,NearFarScalar:()=>Kt,NeverTileDiscardPolicy:()=>cre,NodeRenderResources:()=>FP,NodeStatisticsPipelineStage:()=>xI,NodeTransformationProperty:()=>vZ,OIT:()=>Jw,Occluder:()=>N9,OffsetGeometryInstanceAttribute:()=>Co,OpenCageGeocoderService:()=>Sce,OpenStreetMapImageryProvider:()=>zg,OrderedGroundPrimitiveCollection:()=>jw,OrientedBoundingBox:()=>nn,OrthographicFrustum:()=>bn,OrthographicOffCenterFrustum:()=>gs,Packable:()=>Zce,PackableForInterpolation:()=>Rce,Panorama:()=>mre,PanoramaProvider:()=>hre,Particle:()=>bE,ParticleBurst:()=>pre,ParticleEmitter:()=>bre,ParticleSystem:()=>gre,Pass:()=>Le,PassState:()=>Tc,PathGraphics:()=>Yg,PathMode:()=>Y0,PathVisualizer:()=>PU,PeliasGeocoderService:()=>qU,PerInstanceColorAppearance:()=>Tn,PerformanceDisplay:()=>Hg,PerformanceWatchdog:()=>Y5,PerformanceWatchdogViewModel:()=>N5,PerspectiveFrustum:()=>ji,PerspectiveOffCenterFrustum:()=>Ol,PickDepth:()=>qw,PickDepthFramebuffer:()=>e9,PickFramebuffer:()=>i9,PickId:()=>w9,PickedMetadataInfo:()=>t9,Picking:()=>m9,PickingPipelineStage:()=>mP,PinBuilder:()=>Zg,PixelDatatype:()=>Ue,PixelFormat:()=>Qe,PlanarFillIdFramebuffer:()=>o9,Plane:()=>cn,PlaneGeometry:()=>iU,PlaneGeometryUpdater:()=>rU,PlaneGraphics:()=>bw,PlaneOutlineGeometry:()=>oU,PntsLoader:()=>BP,PntsParser:()=>aS,PointCloud:()=>f9,PointCloudEyeDomeLighting:()=>Ib,PointCloudShading:()=>Hp,PointCloudStylingPipelineStage:()=>fP,PointGraphics:()=>IZ,PointPrimitive:()=>Aa,PointPrimitiveCollection:()=>dE,PointVisualizer:()=>NU,PolygonGeometry:()=>zp,PolygonGeometryLibrary:()=>ii,PolygonGeometryUpdater:()=>lU,PolygonGraphics:()=>wf,PolygonHierarchy:()=>Wc,PolygonOutlineGeometry:()=>cU,PolygonPipeline:()=>mi,Polyline:()=>Bm,PolylineArrowMaterialProperty:()=>JE,PolylineCollection:()=>pf,PolylineColorAppearance:()=>Bs,PolylineDashMaterialProperty:()=>QE,PolylineGeometry:()=>hg,PolylineGeometryUpdater:()=>MU,PolylineGlowMaterialProperty:()=>$E,PolylineGraphics:()=>_l,PolylineMaterialAppearance:()=>fc,PolylineOutlineMaterialProperty:()=>VT,PolylinePipeline:()=>so,PolylineVisualizer:()=>kU,PolylineVolumeGeometry:()=>mU,PolylineVolumeGeometryLibrary:()=>$f,PolylineVolumeGeometryUpdater:()=>bU,PolylineVolumeGraphics:()=>PZ,PolylineVolumeOutlineGeometry:()=>pU,PositionProperty:()=>Yf,PositionPropertyArray:()=>kg,PostProcessStage:()=>Uo,PostProcessStageCollection:()=>X9,PostProcessStageComposite:()=>ru,PostProcessStageLibrary:()=>rm,PostProcessStageSampleMode:()=>om,PostProcessStageTextureCache:()=>JZ,PpeMetadata:()=>AF,PpeSource:()=>Jce,PpeTexture:()=>EF,Primitive:()=>Pn,PrimitiveCollection:()=>Rl,PrimitiveLoadPlan:()=>J_,PrimitiveOutlineGenerator:()=>K_,PrimitiveOutlinePipelineStage:()=>gP,PrimitivePipeline:()=>SS,PrimitiveRenderResources:()=>PP,PrimitiveState:()=>os,PrimitiveStatisticsPipelineStage:()=>yP,PrimitiveType:()=>Ie,ProjectionPicker:()=>U5,ProjectionPickerViewModel:()=>k5,Property:()=>j,PropertyArray:()=>tA,PropertyAttribute:()=>z_,PropertyAttributeProperty:()=>bF,PropertyBag:()=>ad,PropertyTable:()=>Jl,PropertyTexture:()=>Fb,PropertyTextureProperty:()=>pF,ProviderViewModel:()=>mr,Proxy:()=>Vce,QuadraticRealPolynomial:()=>Dl,QuadtreeOccluders:()=>wY,QuadtreePrimitive:()=>zY,QuadtreeTile:()=>kY,QuadtreeTileLoadState:()=>Ja,QuadtreeTileProvider:()=>Yre,QuantizedMeshTerrainData:()=>sR,QuarticRealPolynomial:()=>S2,Quaternion:()=>Ne,QuaternionSpline:()=>DF,Queue:()=>ax,Ray:()=>gn,Rectangle:()=>re,RectangleCollisionChecker:()=>FR,RectangleGeometry:()=>CR,RectangleGeometryLibrary:()=>Ca,RectangleGeometryUpdater:()=>gU,RectangleGraphics:()=>kf,RectangleOutlineGeometry:()=>TS,ReferenceFrame:()=>zi,ReferenceProperty:()=>Ug,RenderState:()=>ze,Renderbuffer:()=>Su,RenderbufferFormat:()=>Nl,Request:()=>Ar,RequestErrorEvent:()=>Zp,RequestScheduler:()=>Hc,RequestState:()=>Ri,RequestType:()=>js,Resource:()=>ve,ResourceCache:()=>Yi,ResourceCacheKey:()=>Hl,ResourceCacheStatistics:()=>nF,ResourceLoader:()=>to,ResourceLoaderState:()=>Rt,Rotation:()=>Zh,RuntimeError:()=>ae,S2Cell:()=>Rb,SDFSettings:()=>Na,SampledPositionProperty:()=>gc,SampledProperty:()=>em,Sampler:()=>Ot,ScaledPositionProperty:()=>W0,Scene:()=>lk,SceneFramebuffer:()=>OZ,SceneMode:()=>se,SceneMode2DPipelineStage:()=>xP,SceneModePicker:()=>w5,SceneModePickerViewModel:()=>M5,SceneTransforms:()=>ho,SceneTransitioner:()=>z9,ScreenSpaceCameraController:()=>J9,ScreenSpaceElevatorCameraController:()=>o5,ScreenSpaceEventHandler:()=>ta,ScreenSpaceEventType:()=>un,ScreenSpaceInputBindings:()=>hp,ScreenSpaceMapCameraController:()=>r5,ScreenSpaceTiltOrbitCameraController:()=>Oce,ScreenSpaceZoomCameraController:()=>zce,SelectedFeatureIdPipelineStage:()=>gx,SelectionIndicator:()=>B5,SelectionIndicatorViewModel:()=>O5,SensorVolumePortionToDisplay:()=>_E,ShaderBuilder:()=>Tb,ShaderCache:()=>k9,ShaderDestination:()=>fe,ShaderFunction:()=>n2,ShaderProgram:()=>tn,ShaderSource:()=>Je,ShaderStruct:()=>t2,ShadowMap:()=>Jg,ShadowMapShader:()=>zf,ShadowMode:()=>Wn,ShadowVolumeAppearance:()=>Du,SharedContext:()=>j9,ShowGeometryInstanceAttribute:()=>vn,Simon1994PlanetaryPositions:()=>uT,SimplePolylineGeometry:()=>Ece,SingleTileImageryProvider:()=>HI,SkinningPipelineStage:()=>_P,SkyAtmosphere:()=>mk,SkyBox:()=>hk,SnapFramebuffer:()=>q9,SnapService:()=>Ace,Snapping:()=>ek,SpatialNode:()=>sk,Spdcf:()=>CF,SpecularEnvironmentCubeMap:()=>sf,SphereEmitter:()=>_se,SphereGeometry:()=>gY,SphereOutlineGeometry:()=>rg,Spherical:()=>Bk,Spline:()=>Fo,SplitDirection:()=>Ur,Splitter:()=>yE,StaticGeometryColorBatch:()=>Ch,StaticGeometryPerMaterialBatch:()=>Vh,StaticGroundGeometryColorBatch:()=>RA,StaticGroundGeometryPerMaterialBatch:()=>EU,StaticGroundPolylinePerMaterialBatch:()=>wU,StaticOutlineGeometryBatch:()=>EA,StencilConstants:()=>Jt,StencilFunction:()=>ei,StencilOperation:()=>Ft,SteppedSpline:()=>UF,Stereographic:()=>cl,StorageType:()=>dx,StripeMaterialProperty:()=>iA,StripeOrientation:()=>np,StructuralMetadata:()=>Ua,StyleCommandsNeeded:()=>lf,StyleExpression:()=>Sse,Sun:()=>Tk,SunLight:()=>$g,SunPostProcess:()=>ik,SupportedImageFormats:()=>_F,SvgPathBindingHandler:()=>c5,Sync:()=>n9,TaskProcessor:()=>Qn,Terrain:()=>Rk,TerrainData:()=>Qd,TerrainEncoding:()=>Zr,TerrainFillMesh:()=>yV,TerrainMesh:()=>mc,TerrainOffsetProperty:()=>hR,TerrainPicker:()=>vY,TerrainProvider:()=>Qo,TerrainQuantization:()=>Ka,TerrainState:()=>wo,Texture:()=>vt,Texture3D:()=>Yw,TextureAtlas:()=>p_,TextureCache:()=>U9,TextureMagnificationFilter:()=>qn,TextureManager:()=>Qv,TextureMinificationFilter:()=>Ht,TexturePacker:()=>S1,TextureUniform:()=>$v,TextureWrap:()=>pn,TileAvailability:()=>jf,TileBoundingRegion:()=>wu,TileBoundingS2Cell:()=>dN,TileBoundingSphere:()=>sg,TileBoundingVolume:()=>Gse,TileCoordinatesImageryProvider:()=>Vk,TileDiscardPolicy:()=>Wse,TileEdge:()=>Gn,TileImagery:()=>PC,TileMapServiceImageryProvider:()=>yx,TileMetadata:()=>QX,TileOrientedBoundingBox:()=>zd,TileProviderError:()=>er,TileReplacementQueue:()=>UY,TileSelectionResult:()=>gi,TileState:()=>vse,Tileset3DTileContent:()=>QP,TilesetMetadata:()=>mN,TilesetPipelineStage:()=>JF,TilingScheme:()=>Lce,TimeConstants:()=>wn,TimeDynamicImagery:()=>tS,TimeDynamicPointCloud:()=>WE,TimeInterval:()=>Vn,TimeIntervalCollection:()=>As,TimeIntervalCollectionPositionProperty:()=>dy,TimeIntervalCollectionProperty:()=>Dg,TimeStandard:()=>ci,Timeline:()=>K5,TimelineHighlightRange:()=>z5,TimelineTrack:()=>H5,Tipsify:()=>iF,ToggleButtonViewModel:()=>kT,Tonemapper:()=>qg,TrackingReferenceFrame:()=>Pg,Transforms:()=>_t,TranslationRotationScale:()=>px,TranslucentTileClassification:()=>s9,TridiagonalSystemSolver:()=>TC,TrustedServers:()=>o1,TweenCollection:()=>tR,UniformState:()=>D9,UniformType:()=>Ip,UrlTemplate3DTilesDataProvider:()=>Hw,UrlTemplateImageryProvider:()=>fs,VERSION:()=>R3t,VRButton:()=>j5,VRButtonViewModel:()=>J5,VRTheWorldTerrainProvider:()=>vce,VaryingType:()=>Hce,Vector3DTileBatch:()=>wp,Vector3DTileClampedPolylines:()=>NX,Vector3DTileContent:()=>MX,Vector3DTileGeometry:()=>Zb,Vector3DTilePoints:()=>AX,Vector3DTilePolygons:()=>GX,Vector3DTilePolylines:()=>hS,Vector3DTilePrimitive:()=>L_,VectorGltf3DTileContent:()=>Vx,VectorPipeline:()=>Zs,VectorProvider:()=>jb,VelocityOrientationProperty:()=>Hk,VelocityVectorProperty:()=>uy,VertexArray:()=>Un,VertexArrayFacade:()=>pb,VertexAttributeSemantic:()=>dt,VertexFormat:()=>Me,VerticalExaggeration:()=>_o,VerticalExaggerationPipelineStage:()=>ZP,VerticalOrigin:()=>Bn,VideoSynchronizer:()=>Wce,View:()=>zZ,Viewer:()=>gle,ViewportQuad:()=>Pse,Visibility:()=>Kr,Visualizer:()=>wae,VoxelBoundsCollection:()=>xb,VoxelBoxShape:()=>vS,VoxelCell:()=>ok,VoxelContent:()=>WS,VoxelCylinderShape:()=>FS,VoxelEllipsoidShape:()=>IS,VoxelInspector:()=>q5,VoxelInspectorViewModel:()=>Q5,VoxelMetadataOrder:()=>Xp,VoxelPrimitive:()=>gT,VoxelProvider:()=>Nse,VoxelRenderResources:()=>g2,VoxelShape:()=>Yse,VoxelShapeType:()=>uc,VoxelTraversal:()=>ak,VulkanConstants:()=>Fce,WallGeometry:()=>xU,WallGeometryLibrary:()=>VR,WallGeometryUpdater:()=>SU,WallGraphics:()=>Mg,WallOutlineGeometry:()=>_U,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>JI,WebMapTileServiceImageryProvider:()=>jI,WebMercatorProjection:()=>xi,WebMercatorTilingScheme:()=>Lr,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>YC,WireframePipelineStage:()=>RP,_shadersAcesTonemappingStage:()=>p9,_shadersAdditiveBlend:()=>tk,_shadersAdjustTranslucentFS:()=>pE,_shadersAllMaterialAppearanceFS:()=>yY,_shadersAllMaterialAppearanceVS:()=>xY,_shadersAmbientOcclusionGenerate:()=>b9,_shadersAmbientOcclusionModulate:()=>g9,_shadersAspectRampMaterial:()=>iX,_shadersAtmosphereCommon:()=>nf,_shadersAtmosphereStageFS:()=>jF,_shadersAtmosphereStageVS:()=>QF,_shadersBasicMaterialAppearanceFS:()=>TY,_shadersBasicMaterialAppearanceVS:()=>_Y,_shadersBillboardCollectionFS:()=>yv,_shadersBillboardCollectionVS:()=>xv,_shadersBlackAndWhite:()=>y9,_shadersBloomComposite:()=>x9,_shadersBrdfLutGeneratorFS:()=>Rv,_shadersBrightPass:()=>nk,_shadersBrightness:()=>T9,_shadersBufferPointMaterialFS:()=>Gv,_shadersBufferPointMaterialVS:()=>Av,_shadersBufferPolygonMaterialFS:()=>Pv,_shadersBufferPolygonMaterialVS:()=>Iv,_shadersBufferPolylineMaterialFS:()=>Mv,_shadersBufferPolylineMaterialVS:()=>Yv,_shadersBumpMapMaterial:()=>oX,_shadersCPUStylingStageFS:()=>CI,_shadersCPUStylingStageVS:()=>RI,_shadersCheckerboardMaterial:()=>rX,_shadersCloudCollectionFS:()=>XN,_shadersCloudCollectionVS:()=>NN,_shadersCloudNoiseFS:()=>YN,_shadersCloudNoiseVS:()=>MN,_shadersCompareAndPackTranslucentDepth:()=>r9,_shadersCompositeOITFS:()=>Kw,_shadersCompositeTranslucentClassification:()=>BZ,_shadersComputeIrradianceFS:()=>dF,_shadersComputeRadianceMapFS:()=>uF,_shadersConstantLodStageFS:()=>cP,_shadersConstantLodStageVS:()=>aP,_shadersContrastBias:()=>_9,_shadersConvolveSpecularMapFS:()=>mF,_shadersConvolveSpecularMapVS:()=>hF,_shadersCubeMapPanoramaVS:()=>KN,_shadersCustomShaderStageFS:()=>AI,_shadersCustomShaderStageVS:()=>EI,_shadersCzmBuiltins:()=>u_,_shadersDepthOfField:()=>S9,_shadersDepthPlaneFS:()=>aY,_shadersDepthPlaneVS:()=>cY,_shadersDepthView:()=>Z9,_shadersDepthViewPacked:()=>Kce,_shadersDotMaterial:()=>sX,_shadersEdgeDetection:()=>R9,_shadersEdgeDetectionStageFS:()=>XI,_shadersEdgeVisibilityStageFS:()=>YI,_shadersEdgeVisibilityStageVS:()=>MI,_shadersElevationBandMaterial:()=>aX,_shadersElevationContourMaterial:()=>cX,_shadersElevationRampMaterial:()=>lX,_shadersEllipsoidFS:()=>dV,_shadersEllipsoidSurfaceAppearanceFS:()=>pY,_shadersEllipsoidSurfaceAppearanceVS:()=>bY,_shadersEllipsoidVS:()=>uV,_shadersFXAA:()=>E9,_shadersFXAA3_11:()=>F9,_shadersFadeMaterial:()=>dX,_shadersFeatureIdStageFS:()=>GI,_shadersFeatureIdStageVS:()=>LI,_shadersFilmicTonemapping:()=>C9,_shadersGaussianBlur1D:()=>pT,_shadersGeometryStageFS:()=>kI,_shadersGeometryStageVS:()=>UI,_shadersGlobeFS:()=>IY,_shadersGlobeVS:()=>PY,_shadersGridMaterial:()=>uX,_shadersGroundAtmosphere:()=>pV,_shadersHSBToRGB:()=>dW,_shadersHSLToRGB:()=>uW,_shadersImageBasedLightingStageFS:()=>$F,_shadersInstancingStageCommon:()=>hI,_shadersInstancingStageVS:()=>fI,_shadersIntersectBox:()=>l2,_shadersIntersectCylinder:()=>d2,_shadersIntersectDepth:()=>a2,_shadersIntersectEllipsoid:()=>u2,_shadersIntersectLongitude:()=>v1,_shadersIntersectPlane:()=>c2,_shadersIntersection:()=>Z_,_shadersIntersectionUtils:()=>s2,_shadersLegacyInstancingStageVS:()=>pI,_shadersLensFlare:()=>A9,_shadersLightingStageFS:()=>oP,_shadersMaterialStageFS:()=>sP,_shadersMegatexture:()=>b2,_shadersMetadataStageFS:()=>WI,_shadersMetadataStageVS:()=>vI,_shadersModelClippingPlanesStageFS:()=>oI,_shadersModelClippingPolygonsStageFS:()=>sI,_shadersModelClippingPolygonsStageVS:()=>aI,_shadersModelColorStageFS:()=>iI,_shadersModelFS:()=>wP,_shadersModelSilhouetteStageFS:()=>AP,_shadersModelSilhouetteStageVS:()=>GP,_shadersModelSplitterStageFS:()=>WP,_shadersModelVS:()=>MP,_shadersModelVectorLookupStageFS:()=>dI,_shadersModelVectorLookupStageVS:()=>lI,_shadersModifiedReinhardTonemapping:()=>G9,_shadersMorphTargetsStageVS:()=>dP,_shadersNightVision:()=>L9,_shadersNormalMapMaterial:()=>mX,_shadersOctree:()=>p2,_shadersPassThrough:()=>qd,_shadersPassThroughDepth:()=>Mx,_shadersPbrNeutralTonemapping:()=>V9,_shadersPerInstanceColorAppearanceFS:()=>tN,_shadersPerInstanceColorAppearanceVS:()=>nN,_shadersPerInstanceFlatColorAppearanceFS:()=>_S,_shadersPerInstanceFlatColorAppearanceVS:()=>iN,_shadersPointCloudEyeDomeLighting:()=>IF,_shadersPointCloudStylingStageVS:()=>hP,_shadersPointPrimitiveCollectionFS:()=>tT,_shadersPointPrimitiveCollectionVS:()=>Zw,_shadersPolylineArrowMaterial:()=>hX,_shadersPolylineColorAppearanceVS:()=>iY,_shadersPolylineCommon:()=>kl,_shadersPolylineDashMaterial:()=>fX,_shadersPolylineFS:()=>mS,_shadersPolylineGlowMaterial:()=>pX,_shadersPolylineMaterialAppearanceVS:()=>rM,_shadersPolylineOutlineMaterial:()=>bX,_shadersPolylineShadowVolumeFS:()=>tM,_shadersPolylineShadowVolumeMorphFS:()=>nM,_shadersPolylineShadowVolumeMorphVS:()=>iM,_shadersPolylineShadowVolumeVS:()=>oM,_shadersPolylineVS:()=>nX,_shadersPrimitiveGaussianSplatFS:()=>zX,_shadersPrimitiveGaussianSplatVS:()=>BX,_shadersPrimitiveOutlineStageFS:()=>bP,_shadersPrimitiveOutlineStageVS:()=>pP,_shadersRGBToHSB:()=>NW,_shadersRGBToHSL:()=>YW,_shadersRGBToXYZ:()=>MW,_shadersReinhardTonemapping:()=>W9,_shadersReprojectWebMercatorFS:()=>qI,_shadersReprojectWebMercatorVS:()=>$I,_shadersRimLightingMaterial:()=>gX,_shadersSelectedFeatureIdStageCommon:()=>GC,_shadersShadowVolumeAppearanceFS:()=>nV,_shadersShadowVolumeAppearanceVS:()=>PN,_shadersShadowVolumeFS:()=>Hy,_shadersSilhouette:()=>v9,_shadersSkinningStageVS:()=>TP,_shadersSkyAtmosphereCommon:()=>SE,_shadersSkyAtmosphereFS:()=>dk,_shadersSkyAtmosphereVS:()=>uk,_shadersSkyBoxFS:()=>zN,_shadersSkyBoxVS:()=>HN,_shadersSlopeRampMaterial:()=>yX,_shadersStripeMaterial:()=>xX,_shadersSunFS:()=>pk,_shadersSunTextureFS:()=>bk,_shadersSunVS:()=>gk,_shadersTexturedMaterialAppearanceFS:()=>SY,_shadersTexturedMaterialAppearanceVS:()=>ZY,_shadersVector3DTileClampedPolylinesFS:()=>PX,_shadersVector3DTileClampedPolylinesVS:()=>IX,_shadersVector3DTilePolylinesVS:()=>LX,_shadersVectorCommon:()=>Mb,_shadersVectorTileVS:()=>N1,_shadersVerticalExaggerationStageVS:()=>SP,_shadersViewportQuadFS:()=>Ek,_shadersViewportQuadVS:()=>QZ,_shadersVoxelFS:()=>o2,_shadersVoxelUtils:()=>i2,_shadersVoxelVS:()=>r2,_shadersWater:()=>_X,_shadersWaterMaskMaterial:()=>TX,_shadersXYZToRGB:()=>lv,_shadersacesTonemapping:()=>VL,_shadersalphaWeight:()=>EL,_shadersantialias:()=>AL,_shadersapplyHSBShift:()=>GL,_shadersapproximateSphericalCoordinates:()=>LL,_shadersapproximateTanh:()=>WL,_shadersbackFacing:()=>vL,_shadersbranchFreeTernary:()=>FL,_shaderscascadeColor:()=>IL,_shaderscascadeDistance:()=>PL,_shaderscascadeMatrix:()=>XL,_shaderscascadeWeights:()=>NL,_shaderscolumbusViewMorph:()=>YL,_shaderscomputeAtmosphereColor:()=>ML,_shaderscomputeGroundAtmosphereScattering:()=>wL,_shaderscomputePosition:()=>kL,_shaderscomputeScattering:()=>UL,_shaderscomputeTextureTransform:()=>DL,_shadersconvertLocalToBoxUv:()=>m2,_shadersconvertLocalToCylinderUv:()=>h2,_shadersconvertLocalToEllipsoidUv:()=>f2,_shaderscosineAndSine:()=>OL,_shadersdecodeRGB8:()=>BL,_shadersdecompressTextureCoordinates:()=>zL,_shadersdegreesPerRadian:()=>LG,_shadersdepthClamp:()=>HL,_shadersdepthRange:()=>WG,_shadersdepthRangeStruct:()=>yL,_shaderseastNorthUpToEyeCoordinates:()=>KL,_shadersellipsoidContainsPoint:()=>JL,_shadersellipsoidTextureCoordinates:()=>jL,_shadersepsilon1:()=>vG,_shadersepsilon2:()=>FG,_shadersepsilon3:()=>IG,_shadersepsilon4:()=>PG,_shadersepsilon5:()=>XG,_shadersepsilon6:()=>NG,_shadersepsilon7:()=>YG,_shadersequalsEpsilon:()=>QL,_shaderseyeOffset:()=>qL,_shaderseyeToCartographicDelta:()=>$L,_shaderseyeToWindowCoordinates:()=>eW,_shadersfastApproximateAtan:()=>tW,_shadersfog:()=>nW,_shadersgammaCorrect:()=>iW,_shadersgeodeticSurfaceNormal:()=>oW,_shadersgetDefaultMaterial:()=>rW,_shadersgetDynamicAtmosphereLightDirection:()=>sW,_shadersgetLambertDiffuse:()=>aW,_shadersgetSpecular:()=>cW,_shadersgetWaterNoise:()=>lW,_shadershue:()=>mW,_shadersinfinity:()=>MG,_shadersinverseGamma:()=>hW,_shadersisEmpty:()=>fW,_shadersisFull:()=>pW,_shaderslatitudeToWebMercatorFraction:()=>bW,_shaderslineDistance:()=>yW,_shaderslinearToSrgb:()=>gW,_shadersluminance:()=>xW,_shadersmaterial:()=>xL,_shadersmaterialInput:()=>TL,_shadersmaximumComponent:()=>TW,_shadersmetersPerPixel:()=>_W,_shadersmodelMaterial:()=>_L,_shadersmodelToWindowCoordinates:()=>SW,_shadersmodelVertexOutput:()=>SL,_shadersmultiplyWithColorBalance:()=>ZW,_shadersnearFarScalar:()=>RW,_shadersoctDecode:()=>CW,_shadersoneOverPi:()=>wG,_shadersoneOverTwoPi:()=>kG,_shaderspackDepth:()=>VW,_shaderspassCesium3DTile:()=>UG,_shaderspassCesium3DTileClassification:()=>DG,_shaderspassCesium3DTileClassificationIgnoreShow:()=>OG,_shaderspassCesium3DTileEdges:()=>BG,_shaderspassCesium3DTileEdgesDirect:()=>zG,_shaderspassCesium3DTilePlanarFillId:()=>HG,_shaderspassClassification:()=>KG,_shaderspassCompute:()=>JG,_shaderspassEnvironment:()=>jG,_shaderspassGaussianSplats:()=>QG,_shaderspassGlobe:()=>qG,_shaderspassOpaque:()=>$G,_shaderspassOverlay:()=>eL,_shaderspassTerrainClassification:()=>tL,_shaderspassTranslucent:()=>nL,_shaderspassVoxels:()=>iL,_shaderspbrLighting:()=>EW,_shaderspbrNeutralTonemapping:()=>AW,_shadersphong:()=>GW,_shaderspi:()=>oL,_shaderspiOverFour:()=>rL,_shaderspiOverSix:()=>sL,_shaderspiOverThree:()=>aL,_shaderspiOverTwo:()=>cL,_shadersplaneDistance:()=>LW,_shaderspointAlongRay:()=>WW,_shadersradiansPerDegree:()=>lL,_shadersray:()=>ZL,_shadersrayEllipsoidIntersectionInterval:()=>vW,_shadersraySegment:()=>RL,_shadersraySphereIntersectionInterval:()=>FW,_shadersreadDepth:()=>IW,_shadersreadNonPerspective:()=>PW,_shadersreverseLogDepth:()=>XW,_shadersround:()=>wW,_shaderssaturation:()=>kW,_shaderssceneMode2D:()=>dL,_shaderssceneMode3D:()=>uL,_shaderssceneModeColumbusView:()=>mL,_shaderssceneModeMorphing:()=>hL,_shadersshadowDepthCompare:()=>UW,_shadersshadowParameters:()=>CL,_shadersshadowVisibility:()=>DW,_shaderssignNotZero:()=>OW,_shaderssolarRadius:()=>fL,_shaderssphericalHarmonics:()=>BW,_shaderssrgbToLinear:()=>zW,_shaderstangentToEyeSpaceMatrix:()=>HW,_shaderstextureCube:()=>KW,_shadersthreePiOver2:()=>pL,_shaderstransformPlane:()=>JW,_shaderstranslateRelativeToEye:()=>jW,_shaderstranslucentPhong:()=>QW,_shaderstranspose:()=>qW,_shaderstwoPi:()=>bL,_shadersunpackDepth:()=>$W,_shadersunpackFloat:()=>ev,_shadersunpackTexture:()=>tv,_shadersunpackUint:()=>nv,_shadersvalueTransform:()=>iv,_shadersvertexLogDepth:()=>ov,_shaderswebMercatorMaxLatitude:()=>gL,_shaderswindowToEyeCoordinates:()=>rv,_shaderswriteDepthClamp:()=>sv,_shaderswriteLogDepth:()=>av,_shaderswriteNonPerspective:()=>cv,addAllToArray:()=>ti,addBuffer:()=>z2,addDefaults:()=>M2,addExtensionsRequired:()=>D2,addExtensionsUsed:()=>Im,addPipelineExtras:()=>tx,addToArray:()=>xa,appendForwardSlash:()=>QA,arrayRemoveDuplicates:()=>Mo,assert:()=>xQ,barycentricCoordinates:()=>w_,binarySearch:()=>Go,buildModuleUrl:()=>en,buildVectorGltfFromMVT:()=>Kv,buildVoxelCustomShader:()=>L1,buildVoxelDrawCommands:()=>y2,clone:()=>$e,combine:()=>It,computeFlyToLocationForRectangle:()=>YS,createBillboardPointCallback:()=>cS,createColorRamp:()=>Jv,createCommand:()=>Fn,createDefaultImageryProviderViewModels:()=>b5,createDefaultTerrainProviderViewModels:()=>g5,createElevationBandMaterial:()=>fee,createGooglePhotorealistic3DTileset:()=>pee,createGuid:()=>$n,createMaterialPropertyDescriptor:()=>ur,createOsmBuildingsAsync:()=>bee,createPropertyDescriptor:()=>be,createRawPropertyDescriptor:()=>rd,createTangentSpaceDebugPrimitive:()=>gee,createTaskProcessorWorker:()=>jce,createUniform:()=>bv,createUniformArray:()=>gv,createVectorTileBuffersFromModelComponents:()=>kX,createWorldBathymetryAsync:()=>Zk,createWorldImageryAsync:()=>Ub,createWorldTerrainAsync:()=>lR,decodeGoogleEarthEnterpriseData:()=>QY,decodeMVT:()=>sY,decodeVectorPolylinePositions:()=>YX,defaultPickWorldPosition:()=>mp,defer:()=>Cd,defined:()=>l,demodernizeShader:()=>dv,deprecationWarning:()=>Jo,destroyObject:()=>ue,exportKml:()=>Pae,findAccessorMinMax:()=>Y_,findContentMetadata:()=>yS,findGroupMetadata:()=>xS,findMeshoptExtension:()=>$y,findTileMetadata:()=>qX,forEachTextureInMaterial:()=>z1,formatError:()=>Fp,freezeRenderState:()=>C4,getAbsoluteUri:()=>ym,getAccessorByteStride:()=>Nd,getBaseUri:()=>qA,getBinaryAccessor:()=>Zm,getClipAndStyleCode:()=>AY,getClippingFunction:()=>KS,getComponentReader:()=>Gb,getElement:()=>Nn,getExtensionFromUri:()=>q0,getFilenameFromUri:()=>Sg,getImageFromTypedArray:()=>jv,getImagePixels:()=>Ph,getJsonFromTypedArray:()=>Wr,getMagic:()=>jh,getMeshPrimitives:()=>WF,getMetadataClassProperty:()=>GY,getMetadataProperty:()=>LY,getStringFromTypedArray:()=>Wd,getTimestamp:()=>Zn,hasExtension:()=>oo,heightReferenceOnEntityPropertyChanged:()=>ry,isBitSet:()=>pl,isBlobUri:()=>$T,isCrossOriginUrl:()=>Vy,isDataUri:()=>Xh,isLeapYear:()=>Il,knockout:()=>Ee,knockout_3_5_1:()=>UR,knockout_es5:()=>a5,loadAndExecuteScript:()=>e_,loadCubeMap:()=>BN,loadImageFromTypedArray:()=>Ab,loadKTX2:()=>Ad,mergeSort:()=>s0,mostDetailedSurfaceHeight:()=>qf,moveTechniqueRenderStates:()=>U2,moveTechniquesToExtension:()=>O2,numberOfComponentsForType:()=>Wu,objectToQuery:()=>t_,oneTimeWarning:()=>xt,parseBatchTable:()=>Pb,parseFeatureMetadataLegacy:()=>xF,parseGlb:()=>N_,parseResponseHeaders:()=>$A,parseStructuralMetadata:()=>yF,pickModel:()=>wC,pointInsideTriangle:()=>Cce,positionForSurfaceHeight:()=>oy,preprocess3DTileContent:()=>eg,processVoxelProperties:()=>e2,queryToObject:()=>xu,readAccessorPacked:()=>H2,removeExtension:()=>M_,removeExtensionsRequired:()=>w2,removeExtensionsUsed:()=>X_,removePipelineExtras:()=>k2,removeUnusedElements:()=>B2,renderBufferPointCollection:()=>Fv,renderBufferPolygonCollection:()=>Nv,renderBufferPolylineCollection:()=>Dv,resizeImageToNextPowerOfTwo:()=>Uy,sampleTerrain:()=>wN,sampleTerrainMostDetailed:()=>NS,scaleToGeodeticSurface:()=>jT,srgbToLinear:()=>iZ,subdivideArray:()=>oN,subscribeAndEvaluate:()=>Sc,updateAccessorComponentTypes:()=>K2,updateVersion:()=>J2,usesExtension:()=>Dr,viewerCesium3DTilesInspectorMixin:()=>yle,viewerCesiumInspectorMixin:()=>xle,viewerDragDropMixin:()=>_le,viewerPerformanceWatchdogMixin:()=>Sle,viewerVoxelInspectorMixin:()=>Rle,webGLConstantToGlslType:()=>Ice,wrapFunction:()=>t5,writeTextToCanvas:()=>dS});var D0r=x(T(),1);var $Oo=x(T(),1);var L3t=x(T(),1),Ele={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(Ele);var _p=Ele;var czt=x(T(),1);var v3t=x(T(),1);function Ale(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=Ale(o,t)),n[i]=o}return n}var $e=Ale;var N3t=x(T(),1);var I3t=x(T(),1);function zYe(e){return e!=null}var l=zYe;function Gle(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]=Gle(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=Gle;var M3t=x(T(),1),dj={};dj.EMPTY_OBJECT=Object.freeze({});dj.EMPTY_ARRAY=Object.freeze([]);var B=dj;var Q3t=x(T(),1);var O3t=x(T(),1);var k3t=x(T(),1),Lle={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(Lle);var ie=Lle;var Wle={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX};Object.freeze(Wle);var Cc=Wle;var H3t=x(T(),1);var vle={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(vle);var $o=vle;var Fle={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Cc.ADD,equationAlpha:Cc.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:Cc.ADD,equationAlpha:Cc.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:Cc.ADD,equationAlpha:Cc.ADD,functionSourceRgb:$o.SOURCE_ALPHA,functionSourceAlpha:$o.ONE,functionDestinationRgb:$o.ONE,functionDestinationAlpha:$o.ONE})};Object.freeze(Fle);var on=Fle;var ezt=x(T(),1);var Ile={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK};Object.freeze(Ile);var ki=Ile;function KR(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(KR.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}}});KR.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(` -`)};KR.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};KR.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};KR.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:ki.BACK}),l(n)&&(i=It(n,i,!0)),i};var Eo=KR;var dzt=x(T(),1),Ple={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Ple);var vh=Ple;var KQt=x(T(),1);var Czt=x(T(),1);var gzt=x(T(),1);var hzt=x(T(),1);function JT(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(JT.prototype=Object.create(Error.prototype),JT.prototype.constructor=JT);JT.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};JT.throwInstantiationError=function(){throw new JT("This function defines an interface and should not be called directly.")};var ge=JT;var ma={};ma.typeOf={};function HYe(e){return`${e} is required, actual value was undefined`}function JR(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(HYe(e))};ma.typeOf.func=function(e,t){if(typeof t!="function")throw new ge(JR(typeof t,"function",e))};ma.typeOf.string=function(e,t){if(typeof t!="string")throw new ge(JR(typeof t,"string",e))};ma.typeOf.number=function(e,t){if(typeof t!="number")throw new ge(JR(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?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 tD=[1];Tt.factorial=function(e){let t=tD.length;if(e>=t){let n=tD[t-1];for(let i=t;i<=e;i++){let o=n*i;tD.push(o),n=o}}return tD[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 Nle=new uj.default;Tt.setRandomNumberSeed=function(e){Nle=new uj.default(e)};Tt.nextRandomNumber=function(){return Nle.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 jT=qYe;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=jT(t,o,r,s,eMe);if(!l(a))return;let c=h.multiplyComponents(a,r,$Ye);c=h.normalize(c,c);let d=h.subtract(t,a,tMe),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 BA=vl;BA.ZERO=Object.freeze(new BA(0,0,0));var $Ye=new h,eMe=new h,tMe=new h,pe=BA;var Hzt=x(T(),1);var Dzt=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 Ule(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:ha(BigInt.prototype.toString),Kle=typeof Symbol>"u"?null:ha(Symbol.prototype.toString),Rd=ha(Object.prototype.hasOwnProperty),KA=ha(Object.prototype.toString),Oc=ha(RegExp.prototype.test),QT=pMe(TypeError);function ha(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]:JA;if(Dle&&Dle(e,null),!qR(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(aMe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function bMe(e){for(let t=0;t/g),ZMe=ec(/\${[\w\W]*/g),RMe=ec(/^data-[\-\w.\u00B7-\uFFFF]+$/),CMe=ec(/^aria-[\-\w]+$/),$le=ec(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),VMe=ec(/^(?:\w+script|data):/i),EMe=ec(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),AMe=ec(/^html$/i),GMe=ec(/^[a-z][.\w]*(-[.\w]+)+$/i),ede=ec(/<[/\w!]/g),tde=ec(/<[/\w]/g),LMe=ec(/<\/no(script|embed|frames)/i),WMe=ec(/\/>/i),bu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rde=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],vMe=Fa(Ao({},rde)),FMe=(function(){let e={};return qT(rde,t=>{e[t]=ec(new RegExp("])","i"))}),Fa(e)})(),IMe=function(){return typeof window>"u"?null:window},PMe=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}},nde=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sy=function(t,n,i,o){return Rd(t,n)&&qR(t[n])?Ao(o.base?gu(o.base):{},t[n],o.transform):i},yj=function(t,n,i){let o=Rd(t,n)?t[n]:void 0;return o&&typeof o=="object"?gu(o):i()};function sde(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:IMe(),t=Vt=>sde(Vt);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==bu.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=Fh(p,"cloneNode"),f=Fh(p,"remove"),y=Fh(p,"nextSibling"),_=Fh(p,"childNodes"),S=Fh(p,"parentNode"),Z=Fh(p,"shadowRoot"),R=Fh(p,"attributes"),C=s&&s.prototype?Fh(s.prototype,"nodeType"):null,E=s&&s.prototype?Fh(s.prototype,"nodeName"):null,A=s&&s.prototype?Fh(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 QT('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=PMe(m,o),V=!0),g},M=n,O=M.implementation,w=M.createNodeIterator,z=M.createDocumentFragment,K=M.getElementsByTagName,te=i.importNode,H=nde();t.isSupported=typeof ide=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;let $=_Me,ee=SMe,le=ZMe,_e=RMe,he=CMe,Ze=VMe,ye=EMe,Ge=GMe,Ae=$le,Fe=null,tt=Ao({},[...Jle,...fj,...pj,...bj,...jle]),Be=null,je=Ao({},[...Qle,...gj,...qle,...rD]),qe=Object.seal(QR(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(QR(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,Mi=null,jn=null,Si=!1,Hi=!1,Gi=!1,pi=!1,Zi=!0,On=!1,rn="user-content-",Hn=!0,$i=!1,Po={},hr=null,Is=Ao({},["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=Ao({},["audio","video","img","source","image","track"]),yi=null,fr=Ao({},["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",Mn="http://www.w3.org/1999/xhtml",Ki=Mn,wi=!1,Xo=null,Dc=Ao({},[mo,Qr,Mn],hj),pm=Fa(["mi","mo","mn","ms","mtext"]),bp=Ao({},pm),Lh=Fa(["annotation-xml"]),ua=Ao({},Lh),gp=Ao({},["title","style","font","a","script"]),Ps=null,$a=["application/xhtml+xml","text/html"],BT="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=gu(Te),Ps=$a.indexOf(Te.PARSER_MEDIA_TYPE)===-1?BT:Te.PARSER_MEDIA_TYPE,si=Ps==="application/xhtml+xml"?hj:JA,Fe=Sy(Te,"ALLOWED_TAGS",tt,{transform:si}),Be=Sy(Te,"ALLOWED_ATTR",je,{transform:si}),Xo=Sy(Te,"ALLOWED_NAMESPACES",Dc,{transform:hj}),yi=Sy(Te,"ADD_URI_SAFE_ATTR",fr,{transform:si,base:fr}),Hs=Sy(Te,"ADD_DATA_URI_TAGS",or,{transform:si,base:or}),hr=Sy(Te,"FORBID_CONTENTS",Is,{transform:si}),We=Sy(Te,"FORBID_TAGS",gu({}),{transform:si}),Ke=Sy(Te,"FORBID_ATTR",gu({}),{transform:si}),Po=Rd(Te,"USE_PROFILES")?Te.USE_PROFILES&&typeof Te.USE_PROFILES=="object"?gu(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,pi=Te.RETURN_TRUSTED_TYPE||!1,Si=Te.FORCE_BODY||!1,Zi=Te.SANITIZE_DOM!==!1,On=Te.SANITIZE_NAMED_PROPS||!1,Hn=Te.KEEP_CONTENT!==!1,$i=Te.IN_PLACE||!1,Ae=yMe(Te.ALLOWED_URI_REGEXP)?Te.ALLOWED_URI_REGEXP:$le,Ki=typeof Te.NAMESPACE=="string"?Te.NAMESPACE:Mn,bp=yj(Te,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ao({},pm)),ua=yj(Te,"HTML_INTEGRATION_POINTS",()=>Ao({},Lh));let Ye=yj(Te,"CUSTOM_ELEMENT_HANDLING",()=>QR(null));if(qe=QR(null),Rd(Ye,"tagNameCheck")&&K0(Ye.tagNameCheck)&&(qe.tagNameCheck=Ye.tagNameCheck),Rd(Ye,"attributeNameCheck")&&K0(Ye.attributeNameCheck)&&(qe.attributeNameCheck=Ye.attributeNameCheck),Rd(Ye,"allowCustomizedBuiltInElements")&&typeof Ye.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=Ye.allowCustomizedBuiltInElements),ec(qe),ht&&(zt=!1),Gi&&(Hi=!0),Po&&(Fe=Ao({},jle),Be=QR(null),Po.html===!0&&(Ao(Fe,Jle),Ao(Be,Qle)),Po.svg===!0&&(Ao(Fe,fj),Ao(Be,gj),Ao(Be,rD)),Po.svgFilters===!0&&(Ao(Fe,pj),Ao(Be,gj),Ao(Be,rD)),Po.mathMl===!0&&(Ao(Fe,bj),Ao(Be,qle),Ao(Be,rD))),ct.tagCheck=null,ct.attributeCheck=null,Rd(Te,"ADD_TAGS")&&(typeof Te.ADD_TAGS=="function"?ct.tagCheck=Te.ADD_TAGS:qR(Te.ADD_TAGS)&&(Fe===tt&&(Fe=gu(Fe)),Ao(Fe,Te.ADD_TAGS,si))),Rd(Te,"ADD_ATTR")&&(typeof Te.ADD_ATTR=="function"?ct.attributeCheck=Te.ADD_ATTR:qR(Te.ADD_ATTR)&&(Be===je&&(Be=gu(Be)),Ao(Be,Te.ADD_ATTR,si))),Rd(Te,"ADD_FORBID_CONTENTS")&&qR(Te.ADD_FORBID_CONTENTS)&&(hr===Is&&(hr=gu(hr)),Ao(hr,Te.ADD_FORBID_CONTENTS,si)),Hn&&(Fe["#text"]=!0),st&&Ao(Fe,["html","head","body"]),Fe.table&&(Ao(Fe,["tbody"]),delete We.tbody),Te.TRUSTED_TYPES_POLICY){if(typeof Te.TRUSTED_TYPES_POLICY.createHTML!="function")throw QT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw QT('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("")));Fa&&Fa(Te),qo=Te},yp=Ao({},[...fj,...pj,...xMe]),Ty=Ao({},[...bj,...TMe]),oj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="svg":Ye.namespaceURI===mo?Te==="svg"&&(yt==="annotation-xml"||bp[yt]):!!yp[Te]},rj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="math":Ye.namespaceURI===Qr?Te==="math"&&ua[yt]:!!Ty[Te]},sj=function(Te,Ye,yt){return Ye.namespaceURI===Qr&&!ua[yt]||Ye.namespaceURI===mo&&!bp[yt]?!1:!Ty[Te]&&(gp[Te]||!yp[Te])},aj=function(Te){let Ye=S(Te);(!Ye||!Ye.tagName)&&(Ye={namespaceURI:Ki,tagName:"template"});let yt=JA(Te.tagName),an=JA(Ye.tagName);return Xo[Te.namespaceURI]?Te.namespaceURI===Qr?oj(yt,Ye,an):Te.namespaceURI===mo?rj(yt,Ye,an):Te.namespaceURI===Mn?sj(yt,Ye,an):!!(Ps==="application/xhtml+xml"&&Xo[Te.namespaceURI]):!1},xp=function(Te){zA(t.removed,{element:Te});try{S(Te).removeChild(Te)}catch{if(f(Te),!S(Te))throw QT("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},BR=function(Te,Ye,yt){try{Te.removeAttributeNode(Ye)}catch{try{Te.removeAttribute(yt)}catch{}}},zT=function(Te){HT(Te);let Ye=_(Te);if(Ye){let an=[];qT(Ye,Ln=>{zA(an,Ln)}),qT(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"&&BR(Te,Ln,ai)}},Wh=function(Te,Ye,yt){if(!yt)try{yt=Ye.getAttributeNode(Te)}catch{yt=null}zA(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{}},cj=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)]||BR(Te,an,Ln)}},HT=function(Te){let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop();L(yt)===bu.element&&cj(yt);let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},zR=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===bu.processingInstruction||an===bu.comment&&Oc(tde,yt.data)){try{f(yt)}catch{}continue}if(an===bu.element){let ai=yt,Er=si(F(yt));try{ai.hasAttribute&&ai.hasAttribute("patchsrc")&&ai.removeAttribute("patchsrc"),ai.hasAttribute&&ai.hasAttribute("for")&&zR("for",Er)&&ai.removeAttribute("for")}catch{}}let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},KT=function(Te){let Ye=null,yt=null;if(Si)Te=""+Te;else{let ai=Ble(Te,/^[\r\n\t ]+/);yt=ai&&ai[0]}Ps==="application/xhtml+xml"&&Ki===Mn&&(Te=''+Te+"");let an=I?X(Te):Te;if(Ki===Mn)try{Ye=new u().parseFromString(an,Ps)}catch{}if(!Ye||!Ye.documentElement){Ye=O.createDocument(Ki,"template",null);try{Ye.documentElement.innerHTML=wi?N:an}catch{}}let Ln=Ye.body||Ye.documentElement;return Te&&yt&&Ln.insertBefore(n.createTextNode(yt),Ln.childNodes[0]||null),Ki===Mn?K.call(Ye,st?"html":"body")[0]:st?Ye.documentElement:Ln},DA=function(Te){let Ye=A?A(Te):Te.ownerDocument;return w.call(Ye||Te,Te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},HR=function(Te){return Te=HA(Te,$," "),Te=HA(Te,ee," "),Te=HA(Te,le," "),Te},_y=function(Te){var Ye;Te.normalize();let yt=A?A(Te):Te.ownerDocument,an=w.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=HR(Ln.data),Ln=an.nextNode();let ai=(Ye=Te.querySelectorAll)===null||Ye===void 0?void 0:Ye.call(Te,"template");ai&&qT(ai,Er=>{oe(Er.content)&&_y(Er.content)})},de=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)===bu.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&&qT(Vt,yt=>{yt.call(t,Te,Ye,qo)})}let et=function(Te,Ye){return!!(jt&&Te.hasChildNodes()&&!Re(Te.firstElementChild)&&Oc(ede,Te.textContent)&&Oc(ede,Te.innerHTML)||jt&&Te.namespaceURI===Mn&&vMe[Ye]&&(Re(Te.firstElementChild)||typeof Te.textContent=="string"&&Oc(FMe[Ye],Te.textContent))||Te.nodeType===bu.processingInstruction||jt&&Te.nodeType===bu.comment&&Oc(tde,Te.data))},Ct=function(Te,Ye){if(Te instanceof RegExp)return Oc(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?gu(Ye):Ye},Sn=function(Te,Ye){return Te===Ye||S(Te)!==null?!1:($i&&HT(Te),!0)},Kn=function(Te,Ye){if(Ve(H.beforeSanitizeElements,Te,null),Sn(Te,Ye))return!0;if(de(Te))return xp(Te),!0;let yt=si(F(Te));if(Fe=Gt(H.uponSanitizeElement,Fe,tt,Mi),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)===bu.element&&!aj(Te)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&&Oc(LMe,Te.innerHTML))return xp(Te),!0;if(ht&&Te.nodeType===bu.text){let Ln=HR(Te.textContent);Te.textContent!==Ln&&(zA(t.removed,{element:Te.cloneNode()}),Te.textContent=Ln)}return Ve(H.afterSanitizeElements,Te,null),!1},xn=function(Te,Ye,yt){if(Ke[Ye]||zR(Ye,Te)||Zi&&(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&&Oc(_e,Ye)||Et&&Oc(he,Ye)?!0:an?yi[Ye]||Oc(Ae,HA(yt,ye,""))||(Ye==="src"||Ye==="xlink:href"||Ye==="href")&&Te!=="script"&&zle(yt,"data:")===0&&Hs[Te]||ut&&!Oc(Ze,HA(yt,ye,""))?!0:!yt:pr(Te)&&Ct(qe.tagNameCheck,Te)&&Ct(qe.attributeNameCheck,Ye,Te)||Ye==="is"&&qe.allowCustomizedBuiltInElements&&Ct(qe.tagNameCheck,yt)},Vr=Ao({},["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[JA(Te)]&&Oc(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),de(Te)?xp(Te):Ole(t.removed)}catch{Wh(Ye,Te)}},Ll=function(Te){Ve(H.beforeSanitizeAttributes,Te,null);let Ye=Te.attributes;if(!Ye||de(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,Sd=ai.value,Zd=si(Er),lj=Sd,Wl=Er==="value"?lj:mMe(lj);if(yt.attrName=Zd,yt.attrValue=Wl,yt.keepAttr=!0,yt.forceKeepAttr=void 0,Ve(H.uponSanitizeAttribute,Te,yt),Wl=yt.attrValue,On&&(Zd==="id"||Zd==="name")&&zle(Wl,rn)!==0&&(Wh(Er,Te,ai),Wl=rn+Wl),jt&&Oc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wl)){Wh(Er,Te,ai);continue}if(Zd==="attributename"&&Ble(Wl,"href")){Wh(Er,Te,ai);continue}if(!yt.forceKeepAttr){if(!yt.keepAttr){Wh(Er,Te,ai);continue}if(!bt&&Oc(WMe,Wl)){Wh(Er,Te,ai);continue}if(ht&&(Wl=HR(Wl)),!xn(Ln,Zd,Wl)){Wh(Er,Te,ai);continue}Wl=Ks(Ln,Zd,ds,Wl),Wl!==lj&&Rc(Te,Er,ds,Wl)}}Ve(H.afterSanitizeAttributes,Te,null)},_d=function(Te){let Ye=null,yt=DA(Te);for(Ve(H.beforeSanitizeShadowDOM,Te,null);Ye=yt.nextNode();)if(Ve(H.uponSanitizeShadowNode,Ye,null),Kn(Ye,Te),Ll(Ye),oe(Ye.content)&&_d(Ye.content),L(Ye)===bu.element){let an=Z(Ye);oe(an)&&(J0(an),_d(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){_d(yt.shadow);continue}let an=yt.node,ai=L(an)===bu.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 Sd=an.content;oe(Sd)&&Ye.push({node:Sd,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(wi=!Vt,wi&&(Vt=""),typeof Vt!="string"&&!Re(Vt)&&(Vt=gMe(Vt),typeof Vt!="string"))throw QT("dirty is not a string, aborting");if(!t.isSupported)return Vt;pt?(Fe=Mi,Be=jn):va(Te),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(Fe=gu(Fe)),H.uponSanitizeAttribute.length>0&&(Be=gu(Be)),t.removed=[];let ai=$i&&typeof Vt!="string"&&Re(Vt);if(ai){Tp(Vt);let Sd=F(Vt);if(typeof Sd=="string"){let Zd=si(Sd);if(!Fe[Zd]||We[Zd])throw zT(Vt),QT("root node is forbidden and cannot be sanitized in-place")}if(de(Vt))throw zT(Vt),QT("root node is clobbered and cannot be sanitized in-place");try{J0(Vt)}catch(Zd){throw zT(Vt),Zd}}else if(Re(Vt))Ye=KT(""),yt=Ye.ownerDocument.importNode(Vt,!0),yt.nodeType===bu.element&&yt.nodeName==="BODY"||yt.nodeName==="HTML"?Ye=yt:Ye.appendChild(yt),J0(yt);else{if(!Hi&&!ht&&!st&&Vt.indexOf("<")===-1)return I&&pi?X(Vt):Vt;if(Ye=KT(Vt),!Ye)return Hi?null:pi?N:""}Ye&&Si&&xp(Ye.firstChild);let Er=ai?Vt:Ye;try{let Sd=DA(Er);for(;an=Sd.nextNode();)Kn(an,Er),Ll(an),oe(an.content)&&_d(an.content)}catch(Sd){throw ai&&(zT(Vt),qT(t.removed,Zd=>{Zd.element&&HT(Zd.element)})),Sd}if(ai)return qT(t.removed,Sd=>{Sd.element&&HT(Sd.element)}),ht&&_y(Vt),Vt;if(Hi){if(ht&&_y(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&&Oc(AMe,Ye.ownerDocument.doctype.name)&&(ds=" -`+ds),ht&&(ds=HR(ds)),I&&pi?X(ds):ds},t.setConfig=function(){let Vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(Vt),pt=!0,Mi=Fe,jn=Be},t.clearConfig=function(){qo=null,pt=!1,Mi=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"&&Rd(H,Vt)&&zA(H[Vt],Te)},t.removeHook=function(Vt,Te){if(Rd(H,Vt)){if(Te!==void 0){let Ye=dMe(H[Vt],Te);return Ye===-1?void 0:uMe(H[Vt],Ye,1)[0]}return Ole(H[Vt])}},t.removeHooks=function(Vt){Rd(H,Vt)&&(H[Vt]=[])},t.removeAllHooks=function(){H=nde()},t}var ade=sde();var XMe=0,_j={},Sj=class e{constructor(t,n){let i,o=t;l(_j[o])?i=_j[o]:(i=XMe++,_j[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=ade.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;o0){for(let[n,i]of this._toAdd.entries())for(let o of i)Rj(this,this._listeners,n,o);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let o of i)Zj(this,this._listeners,n,o);this._toRemove.clear()}};var Se=jA;var dHt=x(T(),1);var oHt=x(T(),1);function cde(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,cde(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)&&cde(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=MMe,o=wMe;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,OMe),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 Go=jMe;var yHt=x(T(),1);function QMe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Zy=QMe;var wHt=x(T(),1);var CHt=x(T(),1);var THt=x(T(),1);function qMe(e){return e%4===0&&e%100!==0||e%400===0}var Il=qMe;var mde=[31,28,31,30,31,30,31,31,30,31,30,31];function $Me(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&&Il(e)?mde[t-1]+1:mde[t-1];if(n>S)throw new ge("Month and Day represents invalid date")}}var Ih=$Me;var EHt=x(T(),1);function ewe(e,t){this.julianDate=e,this.offset=t}var To=ewe;var GHt=x(T(),1),hde={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(hde);var wn=hde;var WHt=x(T(),1),fde={UTC:0,TAI:1};Object.freeze(fde);var ci=fde;var pde=new Ih,dD=[31,28,31,30,31,30,31,31,30,31,30,31],uD=29;function Aj(e,t){return bi.compare(e.julianDate,t.julianDate)}var $R=new To;function mD(e){$R.julianDate=e;let t=bi.leapSeconds,n=Go(t,$R,Aj);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&bi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),bi.addSeconds(e,i,e)}function bde(e,t){$R.julianDate=e;let n=bi.leapSeconds,i=Go(n,$R,Aj);if(i<0&&(i=~i),i===0)return bi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return bi.addSeconds(e,-n[i-1].offset,t);let o=bi.secondsDifference(n[i].julianDate,e);if(o===0)return bi.addSeconds(e,-n[i].offset,t);if(!(o<=1))return bi.addSeconds(e,-n[i-1].offset,t)}function Ry(e,t,n){let i=t/wn.SECONDS_PER_DAY|0;return e+=i,t-=wn.SECONDS_PER_DAY*i,t<0&&(e--,t+=wn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Ej(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*wn.SECONDS_PER_HOUR+o*wn.SECONDS_PER_MINUTE+s*wn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var twe=/^(\d{4})$/,nwe=/^(\d{4})-(\d{2})$/,iwe=/^(\d{4})-?(\d{3})$/,owe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,rwe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Gj=/([Z+\-])?(\d{2})?:?(\d{2})?$/,swe=/^(\d{2})(\.\d+)?/.source+Gj.source,awe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Gj.source,cwe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Gj.source;var Cy={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},lwe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function Q0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var gde=NaN,yde=0;function xde(e,t,n,i,o,r,s){Cy.year=e,Cy.month=t,Cy.day=n,Cy.hour=i,Cy.minute=o,Cy.second=r,Cy.millisecond=s}function dwe(e){let t=e.length;if(t===4){let f=Q0(e,0),y=Q0(e,2);return f<0||y<0?!1:(xde(f*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let o=Q0(e,0),r=Q0(e,2),s=Q0(e,5),a=Q0(e,8),c=Q0(e,11),d=Q0(e,14),u=Q0(e,17);if(o<0||r<0||s<1||s>12||a<1||a>31||c<0||c>23||d<0||d>59||u<0||u>60)return!1;let m=0;if(i>19){let f=e.charCodeAt(19),y=i-20;if(f!==46&&f!==44||y<1||y>15)return!1;let _=0;for(let S=20;S9)return!1;_=_*10+Z}m=_/lwe[y]*1e3}let p=o*100+r,b=Il(p);if((s!==2||!b?dD[s-1]:uD)=60;)o-=60,i++;for(;i>=24;)i-=24,n++;for(d=a&&t===2?uD:dD[t-1];n>d;)n-=d,t++,t>12&&(t-=12,e++),d=a&&t===2?uD:dD[t-1];for(;o<0;)o+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),d=a&&t===2?uD:dD[t-1],n+=d;let m=Ej(e,t,n,i,o,r,s);return l(c)?(Ry(m[0],m[1],c),mD(c)):c=new bi(m[0],m[1],ci.UTC),u&&bi.addSeconds(c,1,c),c}var bi=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)*wn.SECONDS_PER_DAY,Ry(o,n,this),i===ci.UTC&&mD(this)}static fromGregorianDate(t,n){let i=Ej(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Ry(i[0],i[1],n),mD(n),n):new e(i[0],i[1],ci.UTC)}static fromDate(t,n){let i=Ej(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Ry(i[0],i[1],n),mD(n),n):new e(i[0],i[1],ci.UTC)}static fromIso8601(t,n){if(dwe(t)){let _=Cy;return Tde(_.year,_.month,_.day,_.hour,_.minute,_.second,_.millisecond,Il(_.year),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(rwe),i!==null)o=+i[1],r=+i[2],s=+i[3];else if(i=m.match(nwe),i!==null)o=+i[1],r=+i[2];else if(i=m.match(twe),i!==null)o=+i[1];else{let _;if(i=m.match(iwe),i!==null)o=+i[1],_=+i[2],f=Il(o);else if(i=m.match(owe),i!==null){o=+i[1];let S=+i[2],Z=+i[3]||0,R=new Date(Date.UTC(o,0,4));_=S*7+Z-R.getUTCDay()-3}b=new Date(Date.UTC(o,0,1)),b.setUTCDate(_),r=b.getUTCMonth()+1,s=b.getUTCDate()}f=Il(o);let y;if(l(p)){i=p.match(cwe),i!==null?(a=+i[1],c=+i[2],d=+i[3],u=+(i[4]||0)*1e3,y=5):(i=p.match(awe),i!==null?(a=+i[1],c=+i[2],d=+(i[3]||0)*60,y=4):(i=p.match(swe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let _=i[y],S=+i[y+1],Z=+(i[y+2]||0);switch(_){case"+":a=a-S,c=c-Z;break;case"-":a=a+S,c=c+Z;break;case"Z":break;default:c=c+new Date(Date.UTC(o,r-1,s,a,c)).getTimezoneOffset();break}}return Tde(o,r,s,a,c,d,u,f,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,o=bde(t,lD);l(o)||(e.addSeconds(t,-1,lD),o=bde(lD,lD),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/wn.SECONDS_PER_HOUR|0,y=s-f*wn.SECONDS_PER_HOUR,_=y/wn.SECONDS_PER_MINUTE|0;y=y-_*wn.SECONDS_PER_MINUTE;let S=y|0,Z=(y-S)/wn.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 Ih(b,p,m,f,_,S,Z,i)}static toDate(t){let n=e.toGregorianDate(t,pde),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,pde),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/wn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*wn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,o=(t.secondsOfDay-n.secondsOfDay)/wn.SECONDS_PER_DAY;return i+o}static computeTaiMinusUtc(t){$R.julianDate=t;let n=e.leapSeconds,i=Go(n,$R,Aj);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Ry(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_MINUTE;return Ry(t.dayNumber,o,i)}static addHours(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_HOUR;return Ry(t.dayNumber,o,i)}static addDays(t,n,i){let o=t.dayNumber+n;return Ry(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)}},lD=new bi(0,0,ci.TAI);bi.leapSeconds=[new To(new bi(2441317,43210,ci.TAI),10),new To(new bi(2441499,43211,ci.TAI),11),new To(new bi(2441683,43212,ci.TAI),12),new To(new bi(2442048,43213,ci.TAI),13),new To(new bi(2442413,43214,ci.TAI),14),new To(new bi(2442778,43215,ci.TAI),15),new To(new bi(2443144,43216,ci.TAI),16),new To(new bi(2443509,43217,ci.TAI),17),new To(new bi(2443874,43218,ci.TAI),18),new To(new bi(2444239,43219,ci.TAI),19),new To(new bi(2444786,43220,ci.TAI),20),new To(new bi(2445151,43221,ci.TAI),21),new To(new bi(2445516,43222,ci.TAI),22),new To(new bi(2446247,43223,ci.TAI),23),new To(new bi(2447161,43224,ci.TAI),24),new To(new bi(2447892,43225,ci.TAI),25),new To(new bi(2448257,43226,ci.TAI),26),new To(new bi(2448804,43227,ci.TAI),27),new To(new bi(2449169,43228,ci.TAI),28),new To(new bi(2449534,43229,ci.TAI),29),new To(new bi(2450083,43230,ci.TAI),30),new To(new bi(2450630,43231,ci.TAI),31),new To(new bi(2451179,43232,ci.TAI),32),new To(new bi(2453736,43233,ci.TAI),33),new To(new bi(2454832,43234,ci.TAI),34),new To(new bi(2456109,43235,ci.TAI),35),new To(new bi(2457204,43236,ci.TAI),36),new To(new bi(2457754,43237,ci.TAI),37)];var Q=bi;var CJt=x(T(),1),Mde=x(yu(),1);var zHt=x(T(),1);function uwe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var QA=uwe;var KHt=x(T(),1);function mwe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Cd=mwe;var QHt=x(T(),1),Ede=x(yu(),1);function Lj(e,t){let n;return typeof document<"u"&&(n=document),Lj._implementation(e,t,n)}Lj._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Ede.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var ym=Lj;var $Ht=x(T(),1),Ade=x(yu(),1);function hwe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Ade.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var qA=hwe;var tKt=x(T(),1),Gde=x(yu(),1);function fwe(e){let t=new Gde.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=fwe;var oKt=x(T(),1);var Lde={};function pwe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Lde[t];l(i)||(i={},Lde[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 Ph=pwe;var sKt=x(T(),1);var bwe=/^blob:/i;function gwe(e){return bwe.test(e)}var $T=gwe;var lKt=x(T(),1);var Sp;function ywe(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 Vy=ywe;var uKt=x(T(),1);var xwe=/^data:/i;function Twe(e){return xwe.test(e)}var Xh=Twe;var hKt=x(T(),1);function _we(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 e_=_we;var pKt=x(T(),1);function Swe(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 $A=Rwe;function Fde(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=$A(this.responseHeaders))}Fde.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Zp=Fde;var jKt=x(T(),1),gD=x(yu(),1);var NKt=x(T(),1);function n_(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(n_.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)};n_.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};n_.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Wj(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var eG=n_;var wKt=x(T(),1);function tG(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(tG.prototype=Object.create(Error.prototype),tG.prototype.constructor=tG);tG.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var ae=tG;function Cwe(e,t){return e.priority-t.priority}var Lo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},n1=20,zc=new eG({comparator:Cwe});zc.maximumLength=n1;zc.reserve(n1);var Rp=[],$0={},Vwe=typeof document<"u"?new gD.default(document.location.href):new gD.default,yD=new Se;function Gr(){}Gr.maximumRequests=50;Gr.maximumRequestsPerServer=18;Gr.requestsByServer={};Gr.throttleRequests=!0;Gr.debugShowStatistics=!1;Gr.requestCompletedEvent=yD;Object.defineProperties(Gr,{statistics:{get:function(){return Lo}},priorityHeapLength:{get:function(){return n1},set:function(e){if(ee;){let t=zc.pop();i_(t)}n1=e,zc.maximumLength=e,zc.reserve(e)}}});function Ide(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Gr.serverHasOpenSlots=function(e,t){t=t??1;let n=Gr.requestsByServer[e]??Gr.maximumRequestsPerServer;return $0[e]+t<=n};Gr.heapHasOpenSlots=function(e){return zc.length+e<=n1};function Pde(e){return e.state===Ri.UNISSUED&&(e.state=Ri.ISSUED,e.deferred=Cd()),e.deferred.promise}function Ewe(e){return function(t){if(e.state===Ri.CANCELLED)return;let n=e.deferred;--Lo.numberOfActiveRequests,--$0[e.serverKey],yD.raiseEvent(),e.state=Ri.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Awe(e){return function(t){e.state!==Ri.CANCELLED&&(++Lo.numberOfFailedRequests,--Lo.numberOfActiveRequests,--$0[e.serverKey],yD.raiseEvent(t),e.state=Ri.FAILED,e.deferred.reject(t))}}function Xde(e){let t=Pde(e);return e.state=Ri.ACTIVE,Rp.push(e),++Lo.numberOfActiveRequests,++Lo.numberOfActiveRequestsEver,++$0[e.serverKey],e.requestFunction().then(Ewe(e)).catch(Awe(e)),t}function i_(e){let t=e.state===Ri.ACTIVE;if(e.state=Ri.CANCELLED,++Lo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new ae(`Request cancelled: "${e.url}"`))}t&&(--Lo.numberOfActiveRequests,--$0[e.serverKey],++Lo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Gr.update=function(){let e,t,n=0,i=Rp.length;for(e=0;e0&&(Rp[e-n]=t)}Rp.length-=n;let o=zc.internalArray,r=zc.length;for(e=0;e0;){if(t=zc.pop(),t.cancelled){i_(t);continue}if(t.throttleByServer&&!Gr.serverHasOpenSlots(t.serverKey)){i_(t);continue}Xde(t),++a}Gwe()};Gr.getServerKey=function(e){let t=new gD.default(e);t.scheme()===""&&(t=t.absoluteTo(Vwe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=$0[n];return l(i)||($0[n]=0),n};Gr.request=function(e){if(Xh(e.url)||$T(e.url))return yD.raiseEvent(),e.state=Ri.RECEIVED,e.requestFunction();if(++Lo.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 Xde(e);if(Rp.length>=Gr.maximumRequests)return;Ide(e);let t=zc.insert(e);if(l(t)){if(t===e)return;i_(t)}return Pde(e)};function Gwe(){Gr.debugShowStatistics&&(Lo.numberOfActiveRequests===0&&Lo.lastNumberOfActiveRequests>0&&(Lo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Lo.numberOfAttemptedRequests}`),Lo.numberOfAttemptedRequests=0),Lo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Lo.numberOfCancelledRequests}`),Lo.numberOfCancelledRequests=0),Lo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Lo.numberOfCancelledActiveRequests}`),Lo.numberOfCancelledActiveRequests=0),Lo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Lo.numberOfFailedRequests}`),Lo.numberOfFailedRequests=0)),Lo.lastNumberOfActiveRequests=Lo.numberOfActiveRequests)}Gr.clearForSpecs=function(){for(;zc.length>0;){let t=zc.pop();i_(t)}let e=Rp.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 Mde.default(e),r=Wwe(o.query());this._queryParameters=t?TD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(ym(i))),this._url=o.toString()};function Wwe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:xu(e)}function TD(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}${vwe(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 vwe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${t_(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=TD(this._queryParameters,e,!1):this._queryParameters=TD(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=TD(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 qA(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=QA(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(vj(this.request),!wde||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=Cd();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",vj(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return kde(this,e,t)};function kde(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=Cd();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,kde(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;vj(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=Cd(),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 vj(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 Fwe=/^data:(.*?)(;base64)?,(.*)$/;function xD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Yde(e,t){let n=xD(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 Zp(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 Zp)})}var Xwe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=Fwe.exec(e);if(a!==null){r.resolve(Iwe(a,t));return}if(Xwe){Pwe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(o1.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 Zp(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 Zp)},c.send(i),c};Ut._Implementations.loadAndExecuteScript=function(e,t,n){return e_(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 oG(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)?Ude(this,e.data):Ude(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}oG.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 oG({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};oG.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 Zy(0,0,0,0,0),t}});oG.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Zy(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,Ode(this,n,this._samples,e,o,r,t),t}let s=Go(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 Dde(e,n,o,a,s),s;if(i.equals(d))return Dde(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=iG(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=iG(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=iG(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=iG(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=iG(u,b,f),s}var rG=oG;var kJt=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 Vc=Kc;var ojt=x(T(),1);var zJt=x(T(),1);var Bde={};var zde=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Ywe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(_D)||(_D=document.createElement("a")),_D.href=e,_D.href)}var o_;function Kde(){if(l(o_))return o_;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(Bde?.url)?e=ym(".",Bde.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?e=ym("..",r_("Core/buildModuleUrl.js")):e=Ywe(),o_=new ve({url:Hde(e)}),o_.appendForwardSlash(),o_}function Mwe(e){return Hde($5.toUrl(`../${e}`))}function Jde(e){return Kde().getDerivedResource({url:e}).url}var SD;function r_(e){return l(SD)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?SD=Mwe:SD=Jde),SD(e)}r_._cesiumScriptRegex=zde;r_._buildModuleUrlFromBaseUrl=Jde;r_._clearBaseResource=function(){o_=void 0};r_.setBaseUrl=function(e){o_=ve.DEFAULT.getDerivedResource({url:e})};r_.getCesiumBaseUrl=Kde;var en=r_;var JJt=x(T(),1);function wwe(e,t,n){this.x=e,this.y=t,this.s=n}var s_=wwe;function ZD(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 kwe=new Q(0,0,ci.TAI);function Fj(e,t,n){let i=kwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}ZD.prototype.preload=function(e,t,n,i){let o=Fj(this,e,t),r=Fj(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(Ij(this,m));return Promise.all(u)};ZD.prototype.computeXysRadians=function(e,t,n){let i=Fj(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])||(Ij(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(Ij(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new s_(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};ZD.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let o=0;od;)Qwe(c,RD),e.transpose(RD,Qde),e.multiply(c,RD,c),e.multiply(Qde,c,c),e.multiply(a,RD,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,Kwe),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]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};LYe.exports=ple});var V3t={};Cle(V3t,{AlphaMode:()=>Mp,AlphaPipelineStage:()=>WI,AnchorPointDirect:()=>GF,AnchorPointIndirect:()=>LF,Animation:()=>g5,AnimationViewModel:()=>y5,Appearance:()=>Go,ApproximateTerrainHeights:()=>Pi,ArcGISTiledElevationTerrainProvider:()=>goe,ArcGisBaseMapType:()=>mf,ArcGisMapServerImageryProvider:()=>zb,ArcGisMapService:()=>vu,ArcType:()=>un,ArticulationStageType:()=>cl,AssociativeArray:()=>wt,Atmosphere:()=>oS,AtmospherePipelineStage:()=>cI,AttributeCompression:()=>dn,AttributeType:()=>Dt,AutoExposure:()=>Mw,AutomaticUniforms:()=>cb,Axis:()=>Bi,AxisAlignedBoundingBox:()=>Tu,Azure2DImageryProvider:()=>hP,B3dmLoader:()=>HF,B3dmParser:()=>OF,BaseLayerPicker:()=>m5,BaseLayerPickerViewModel:()=>u5,BatchTable:()=>g_,BatchTableHierarchy:()=>U_,BatchTexture:()=>zl,BatchTexturePipelineStage:()=>vI,Billboard:()=>Mo,BillboardCollection:()=>Mu,BillboardGraphics:()=>Oc,BillboardLoadState:()=>Os,BillboardTexture:()=>$b,BillboardVisualizer:()=>lG,BingMapsGeocoderService:()=>xoe,BingMapsImageryProvider:()=>iP,BingMapsStyle:()=>AC,BlendEquation:()=>Ec,BlendFunction:()=>$o,BlendOption:()=>Yi,BlendingState:()=>on,BoundingRectangle:()=>nt,BoundingSphere:()=>me,BoundingSphereState:()=>Wt,BoundingVolumeSemantics:()=>rx,BoxEmitter:()=>wre,BoxGeometry:()=>Vc,BoxGeometryUpdater:()=>_2,BoxGraphics:()=>C_,BoxOutlineGeometry:()=>Yh,BrdfLutGenerator:()=>Uw,Buffer:()=>ot,BufferLoader:()=>K_,BufferPoint:()=>Pc,BufferPointCollection:()=>Bd,BufferPointMaterial:()=>Sf,BufferPolygon:()=>Ir,BufferPolygonCollection:()=>Ya,BufferPolygonMaterial:()=>Eu,BufferPolyline:()=>ga,BufferPolylineCollection:()=>ml,BufferPolylineMaterial:()=>Au,BufferPrimitive:()=>os,BufferPrimitiveCollection:()=>na,BufferPrimitiveMaterial:()=>Jl,BufferUsage:()=>Pe,CPUStylingPipelineStage:()=>XI,CallbackPositionProperty:()=>S2,CallbackProperty:()=>Jh,Camera:()=>Io,CameraEventAggregator:()=>f9,CameraEventType:()=>lo,CameraFlightPath:()=>u9,Cartesian2:()=>k,Cartesian3:()=>h,Cartesian4:()=>ce,CartesianRectangle:()=>wC,Cartographic:()=>pe,CartographicGeocoderService:()=>_oe,CatmullRomSpline:()=>Soe,Cesium3DContentGroup:()=>k_,Cesium3DTile:()=>$m,Cesium3DTileBatchTable:()=>$h,Cesium3DTileColorBlendMode:()=>Pd,Cesium3DTileContent:()=>nse,Cesium3DTileContentFactory:()=>FS,Cesium3DTileContentState:()=>Fo,Cesium3DTileContentType:()=>Za,Cesium3DTileFeature:()=>ea,Cesium3DTileFeatureTable:()=>cf,Cesium3DTileOptimizationHint:()=>Jm,Cesium3DTileOptimizations:()=>pN,Cesium3DTilePass:()=>lr,Cesium3DTilePassState:()=>_h,Cesium3DTilePointFeature:()=>eg,Cesium3DTileRefine:()=>xr,Cesium3DTileStyle:()=>rg,Cesium3DTileStyleEngine:()=>_N,Cesium3DTileVectorFeature:()=>LS,Cesium3DTilesInspector:()=>S5,Cesium3DTilesInspectorViewModel:()=>_5,Cesium3DTilesTerrainData:()=>gw,Cesium3DTilesTerrainGeometryProcessor:()=>QE,Cesium3DTilesTerrainProvider:()=>Goe,Cesium3DTilesVoxelProvider:()=>dse,Cesium3DTileset:()=>zr,Cesium3DTilesetBaseTraversal:()=>EN,Cesium3DTilesetCache:()=>yN,Cesium3DTilesetGraphics:()=>v_,Cesium3DTilesetHeatmap:()=>xN,Cesium3DTilesetMetadata:()=>DS,Cesium3DTilesetMostDetailedTraversal:()=>RN,Cesium3DTilesetSkipTraversal:()=>LN,Cesium3DTilesetStatistics:()=>Rf,Cesium3DTilesetTraversal:()=>Ba,Cesium3DTilesetVisualizer:()=>WN,CesiumInspector:()=>E5,CesiumInspectorViewModel:()=>V5,CesiumTerrainProvider:()=>HZ,CesiumWidget:()=>i5,Check:()=>Ko,CheckerboardMaterialProperty:()=>cV,CircleEmitter:()=>T9,CircleGeometry:()=>Poe,CircleOutlineGeometry:()=>Xoe,ClassificationModelDrawCommand:()=>tX,ClassificationPipelineStage:()=>FI,ClassificationPrimitive:()=>T1,ClassificationType:()=>ti,ClearCommand:()=>mi,ClippingPlane:()=>ta,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>iC,ClippingPolygonCollection:()=>Wc,Clock:()=>Lf,ClockRange:()=>As,ClockStep:()=>Oo,ClockViewModel:()=>d5,CloudCollection:()=>pse,CloudType:()=>uA,Color:()=>U,ColorBlendMode:()=>al,ColorGeometryInstanceAttribute:()=>$t,ColorMaterialProperty:()=>Qt,Command:()=>$ce,ComponentDatatype:()=>J,Composite3DTileContent:()=>W2,CompositeEntityCollection:()=>v$,CompositeMaterialProperty:()=>dV,CompositePositionProperty:()=>mc,CompositeProperty:()=>pl,CompressedTextureBuffer:()=>yG,ComputeCommand:()=>Gu,ComputeEngine:()=>tw,ConditionsExpression:()=>jX,ConeEmitter:()=>yse,ConstantPositionProperty:()=>kl,ConstantProperty:()=>ui,ConstantSpline:()=>QF,ContentMetadata:()=>sN,Context:()=>UZ,ContextLimits:()=>kt,Controller:()=>Nce,ControllerHost:()=>SU,CoplanarPolygonGeometry:()=>fY,CoplanarPolygonGeometryLibrary:()=>ug,CoplanarPolygonOutlineGeometry:()=>qm,CornerType:()=>ro,CorrelationGroup:()=>WF,CorridorGeometry:()=>HS,CorridorGeometryLibrary:()=>bo,CorridorGeometryUpdater:()=>wN,CorridorGraphics:()=>E_,CorridorOutlineGeometry:()=>MN,Credit:()=>Lt,CreditDisplay:()=>A9,CubeMap:()=>$r,CubeMapFace:()=>AG,CubeMapPanorama:()=>mR,CubicRealPolynomial:()=>s_,CullFace:()=>Di,CullingVolume:()=>$s,CumulusCloud:()=>cm,CustomDataSource:()=>BN,CustomHeightmapTerrainProvider:()=>Noe,CustomShader:()=>I0,CustomShaderMode:()=>Bb,CustomShaderPipelineStage:()=>DI,CustomShaderTranslucencyMode:()=>yx,CylinderGeometry:()=>zN,CylinderGeometryLibrary:()=>KS,CylinderGeometryUpdater:()=>KN,CylinderGraphics:()=>A_,CylinderOutlineGeometry:()=>HN,CzmlDataSource:()=>oY,DataSource:()=>Es,DataSourceClock:()=>Wf,DataSourceCollection:()=>rY,DataSourceDisplay:()=>jY,DebugAppearance:()=>Zse,DebugCameraPrimitive:()=>X0,DebugInspector:()=>P9,DebugModelMatrixPrimitive:()=>X9,DefaultProxy:()=>Moe,DepthFunction:()=>rc,DepthPlane:()=>D9,DequantizationPipelineStage:()=>BI,DerivedCommand:()=>rp,DeveloperError:()=>ge,DeviceOrientationCameraController:()=>O9,DirectionalLight:()=>Gse,DiscardEmptyTileImagePolicy:()=>GC,DiscardMissingTileImagePolicy:()=>tP,DistanceDisplayCondition:()=>Ot,DistanceDisplayConditionGeometryInstanceAttribute:()=>Qn,DoubleEndedPriorityQueue:()=>$g,DoublyLinkedList:()=>gN,DracoLoader:()=>Ab,DrawCommand:()=>lt,DynamicAtmosphereLightingType:()=>Fb,DynamicEnvironmentMapManager:()=>Ib,DynamicGeometryBatch:()=>eZ,DynamicGeometryUpdater:()=>Li,EarthOrientationParameters:()=>nG,EarthOrientationParametersSample:()=>Zy,EasingFunction:()=>vs,EdgeDetectionPipelineStage:()=>HI,EdgeDisplayMode:()=>Mm,EdgeFramebuffer:()=>B9,EdgeVisibilityPipelineStage:()=>jI,EllipseGeometry:()=>ud,EllipseGeometryLibrary:()=>Jd,EllipseGeometryUpdater:()=>aY,EllipseGraphics:()=>G_,EllipseOutlineGeometry:()=>Ku,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>hb,EllipsoidGeometry:()=>Ha,EllipsoidGeometryUpdater:()=>lY,EllipsoidGraphics:()=>L_,EllipsoidOutlineGeometry:()=>Uu,EllipsoidPrimitive:()=>z9,EllipsoidRhumbLine:()=>Ac,EllipsoidSurfaceAppearance:()=>Wse,EllipsoidTangentPlane:()=>Ms,EllipsoidTerrainProvider:()=>G0,EllipsoidalOccluder:()=>Af,Empty3DTileContent:()=>Qp,EncodedCartesian3:()=>An,Entity:()=>er,EntityCluster:()=>Ou,EntityCollection:()=>za,EntityView:()=>qY,EquirectangularPanorama:()=>vse,Event:()=>Se,EventHelper:()=>Hr,Expression:()=>Wm,ExpressionNodeType:()=>Pt,ExtrapolationType:()=>cd,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>gx,Fog:()=>j9,ForEach:()=>we,FrameRateMonitor:()=>Q9,FrameState:()=>Ix,Framebuffer:()=>ps,FramebufferManager:()=>li,Frozen:()=>B,FrustumCommands:()=>q9,FrustumGeometry:()=>jZ,FrustumOutlineGeometry:()=>Rw,Fullscreen:()=>qr,FullscreenButton:()=>R5,FullscreenButtonViewModel:()=>Z5,GaussianSplat3DTileContent:()=>Lx,GaussianSplatPrimitive:()=>rN,GaussianSplatRenderResources:()=>eN,GaussianSplatSorter:()=>WS,GaussianSplatTextureGenerator:()=>$X,GeoJsonDataSource:()=>dT,GeoJsonLoader:()=>KF,GeoJsonPrimitive:()=>Nse,GeocodeType:()=>RT,Geocoder:()=>G5,GeocoderService:()=>nA,GeocoderViewModel:()=>A5,GeographicProjection:()=>ki,GeographicTilingScheme:()=>to,Geometry:()=>At,Geometry3DTileContent:()=>I2,GeometryAttribute:()=>Xe,GeometryAttributes:()=>Rn,GeometryFactory:()=>Doe,GeometryInstance:()=>Yt,GeometryInstanceAttribute:()=>Qc,GeometryOffsetAttribute:()=>bn,GeometryPipeline:()=>zn,GeometryPipelineStage:()=>eP,GeometryType:()=>Sm,GeometryUpdater:()=>Wi,GeometryUpdaterSet:()=>uZ,GeometryVisualizer:()=>PY,GetFeatureInfoFormat:()=>hf,Globe:()=>pk,GlobeDepth:()=>bk,GlobeSurfaceShaderSet:()=>ok,GlobeSurfaceTile:()=>Zh,GlobeSurfaceTileProvider:()=>sk,GlobeTranslucency:()=>ak,GlobeTranslucencyFramebuffer:()=>gk,GlobeTranslucencyState:()=>yk,GltfBufferViewLoader:()=>P1,GltfDracoLoader:()=>X1,GltfGpmLoader:()=>FF,GltfGpmLocal:()=>cC,GltfImageLoader:()=>N1,GltfIndexBufferLoader:()=>Y1,GltfJsonLoader:()=>w1,GltfLoader:()=>Lu,GltfLoaderUtil:()=>Yd,GltfMeshPrimitiveGpmLoader:()=>NF,GltfSpzLoader:()=>q2,GltfStructuralMetadataLoader:()=>EF,GltfTextureLoader:()=>O1,GltfVertexBufferLoader:()=>B1,Google2DImageryProvider:()=>mP,GoogleEarthEnterpriseImageryProvider:()=>iae,GoogleEarthEnterpriseMapsProvider:()=>sP,GoogleEarthEnterpriseMetadata:()=>ty,GoogleEarthEnterpriseTerrainData:()=>iA,GoogleEarthEnterpriseTerrainProvider:()=>joe,GoogleEarthEnterpriseTileInformation:()=>Ew,GoogleGeocoderService:()=>qoe,GoogleMaps:()=>_a,GoogleStreetViewCubeMapPanoramaProvider:()=>oae,GpxDataSource:()=>OM,GregorianDate:()=>vh,GridImageryProvider:()=>rae,GridMaterialProperty:()=>TV,GroundGeometryUpdater:()=>ri,GroundPolylineGeometry:()=>__,GroundPolylinePrimitive:()=>Oh,GroundPrimitive:()=>Yl,GroupMetadata:()=>rV,HeadingPitchRange:()=>dh,HeadingPitchRoll:()=>Cc,Heap:()=>QA,HeightReference:()=>He,HeightmapEncoding:()=>gh,HeightmapTerrainData:()=>wc,HeightmapTessellator:()=>zE,HermitePolynomialApproximation:()=>JN,HermiteSpline:()=>fx,HilbertOrder:()=>W1,HomeButton:()=>W5,HomeButtonViewModel:()=>L5,HorizontalOrigin:()=>Ui,HybridScreenSpacePanCameraController:()=>Uce,I3SBuildingSceneLayerExplorer:()=>cle,I3SBuildingSceneLayerExplorerViewModel:()=>v5,I3SDataProvider:()=>lp,I3SDecoder:()=>xk,I3SFeature:()=>Tk,I3SField:()=>_k,I3SGeometry:()=>ZA,I3SLayer:()=>ZR,I3SNode:()=>RA,I3SStatistics:()=>Rk,I3SSublayer:()=>Vk,I3SSymbology:()=>Zk,I3dmLoader:()=>jF,I3dmParser:()=>JF,ITwinData:()=>lae,ITwinPlatform:()=>ca,Iau2000Orientation:()=>Gw,Iau2006XysData:()=>iG,Iau2006XysSample:()=>o_,IauOrientationAxes:()=>Lw,IauOrientationParameters:()=>Aw,ImageBasedLighting:()=>w_,ImageBasedLightingPipelineStage:()=>dI,ImageMaterialProperty:()=>My,Imagery:()=>YC,ImageryConfiguration:()=>uX,ImageryCoverage:()=>kC,ImageryFlags:()=>bP,ImageryInput:()=>yP,ImageryLayer:()=>Zs,ImageryLayerCollection:()=>OS,ImageryLayerFeatureInfo:()=>uf,ImageryPipelineStage:()=>xP,ImageryProvider:()=>Fu,ImageryState:()=>Dn,Implicit3DTileContent:()=>j1,ImplicitAvailabilityBitstream:()=>F1,ImplicitMetadataView:()=>I1,ImplicitSubdivisionScheme:()=>Us,ImplicitSubtree:()=>Wb,ImplicitSubtreeCache:()=>b9,ImplicitSubtreeMetadata:()=>X2,ImplicitTileCoordinates:()=>e0,ImplicitTileset:()=>$p,IndexDatatype:()=>Oe,InfoBox:()=>I5,InfoBoxViewModel:()=>F5,InspectorShared:()=>fu,InstanceAttributeSemantic:()=>Pr,InstancingPipelineStage:()=>EI,InterpolationAlgorithm:()=>tre,InterpolationType:()=>sf,Intersect:()=>qt,IntersectionTests:()=>xi,Intersections2D:()=>Qf,Interval:()=>Ns,InvertClassification:()=>VA,Ion:()=>vd,IonGeocodeProviderType:()=>ny,IonGeocoderService:()=>qZ,IonImageryProvider:()=>ed,IonImageryProviderFactory:()=>XC,IonResource:()=>Ur,IonSnapGeometryType:()=>ore,IonSnapHeat:()=>rre,IonSnapMode:()=>vw,IonSnapParentGeometryType:()=>sre,IonSnapService:()=>are,IonWorldImageryStyle:()=>Kb,Iso8601:()=>it,JobScheduler:()=>Ak,JobType:()=>Lc,JsonMetadataTable:()=>Pb,JulianDate:()=>Q,KTX2Transcoder:()=>xG,KeyboardEventModifier:()=>ir,KeyframeNode:()=>zo,KmlCamera:()=>BM,KmlDataSource:()=>MZ,KmlLookAt:()=>zM,KmlTour:()=>HM,KmlTourFlyTo:()=>JM,KmlTourWait:()=>jM,Label:()=>Rx,LabelCollection:()=>Jp,LabelGraphics:()=>zh,LabelStyle:()=>Tr,LabelVisualizer:()=>XY,LagrangePolynomialApproximation:()=>jN,LeapSecond:()=>To,Light:()=>uae,LightingModel:()=>zp,LightingPipelineStage:()=>_P,LinearApproximation:()=>Dx,LinearSpline:()=>hx,MVTDataProvider:()=>fae,ManagedArray:()=>Bl,MapMode2D:()=>pd,MapProjection:()=>lre,MapboxImageryProvider:()=>aP,MapboxStyleImageryProvider:()=>mae,MappedPositions:()=>gP,Material:()=>eo,MaterialAppearance:()=>Co,MaterialPipelineStage:()=>CP,MaterialProperty:()=>yr,Math:()=>W,Matrix2:()=>Ji,Matrix3:()=>q,Matrix4:()=>P,Megatexture:()=>Lk,MeshPrimitiveGpmLocal:()=>XF,MetadataClass:()=>nf,MetadataClassProperty:()=>Xp,MetadataComponentType:()=>Nt,MetadataEntity:()=>Jn,MetadataEnum:()=>tF,MetadataEnumValue:()=>eF,MetadataPicking:()=>Wk,MetadataPickingPipelineStage:()=>Xu,MetadataPipelineStage:()=>wm,MetadataSchema:()=>Hl,MetadataSchemaLoader:()=>ix,MetadataSemantic:()=>Pm,MetadataTable:()=>vm,MetadataTableProperty:()=>M2,MetadataType:()=>St,MipmapHint:()=>Cm,Model:()=>Nu,Model3DTileContent:()=>Yu,ModelAlphaOptions:()=>bS,ModelAnimation:()=>tI,ModelAnimationChannel:()=>eI,ModelAnimationCollection:()=>nI,ModelAnimationLoop:()=>Md,ModelAnimationState:()=>lf,ModelArticulation:()=>mI,ModelArticulationStage:()=>uI,ModelClippingPlanesPipelineStage:()=>pI,ModelClippingPolygonsPipelineStage:()=>yI,ModelColorPipelineStage:()=>bx,ModelComponents:()=>Vn,ModelDrawCommand:()=>nX,ModelDrawCommands:()=>rX,ModelFeature:()=>iI,ModelFeatureTable:()=>oI,ModelGraphics:()=>yb,ModelImagery:()=>mX,ModelImageryMapping:()=>hS,ModelLightingOptions:()=>qP,ModelMatrixUpdateStage:()=>AI,ModelNode:()=>SI,ModelPrimitiveImagery:()=>fS,ModelReader:()=>xa,ModelRenderResources:()=>BP,ModelRuntimeNode:()=>LI,ModelRuntimePrimitive:()=>kP,ModelSceneGraph:()=>sX,ModelSilhouettePipelineStage:()=>KP,ModelSkin:()=>UP,ModelSplitterPipelineStage:()=>jP,ModelStatistics:()=>aX,ModelType:()=>Or,ModelUtility:()=>Zt,ModelVectorLookupPipelineStage:()=>_I,ModelVisualizer:()=>YY,Moon:()=>Fk,MorphTargetsPipelineStage:()=>EP,MorphWeightSpline:()=>hre,MortonOrder:()=>Px,MouseButton:()=>qa,Multiple3DTileContent:()=>lN,MultisampleFramebuffer:()=>wF,NavigationHelpButton:()=>X5,NavigationHelpButtonViewModel:()=>P5,NearFarScalar:()=>Kt,NeverTileDiscardPolicy:()=>bae,NodeRenderResources:()=>QP,NodeStatisticsPipelineStage:()=>GI,NodeTransformationProperty:()=>W_,OIT:()=>Xk,Occluder:()=>Fw,OffsetGeometryInstanceAttribute:()=>Zo,OpenCageGeocoderService:()=>bre,OpenStreetMapImageryProvider:()=>ly,OrderedGroundPrimitiveCollection:()=>sY,OrientedBoundingBox:()=>tn,OrthographicFrustum:()=>yn,OrthographicOffCenterFrustum:()=>bs,Packable:()=>gre,PackableForInterpolation:()=>yre,Panorama:()=>Tae,PanoramaProvider:()=>_ae,Particle:()=>GA,ParticleBurst:()=>Zae,ParticleEmitter:()=>Rae,ParticleSystem:()=>Cae,Pass:()=>Le,PassState:()=>gc,PathGraphics:()=>xb,PathMode:()=>n0,PathVisualizer:()=>UY,PeliasGeocoderService:()=>Ww,PerInstanceColorAppearance:()=>Tn,PerformanceDisplay:()=>dy,PerformanceWatchdog:()=>Y5,PerformanceWatchdogViewModel:()=>N5,PerspectiveFrustum:()=>qi,PerspectiveOffCenterFrustum:()=>fd,PickDepth:()=>Yk,PickDepthFramebuffer:()=>wk,PickFramebuffer:()=>Uk,PickId:()=>nw,PickedMetadataInfo:()=>kk,Picking:()=>Qk,PickingPipelineStage:()=>AP,PinBuilder:()=>Bg,PixelDatatype:()=>Ue,PixelFormat:()=>Qe,PlanarFillIdFramebuffer:()=>Dk,Plane:()=>cn,PlaneGeometry:()=>dY,PlaneGeometryUpdater:()=>mY,PlaneGraphics:()=>f2,PlaneOutlineGeometry:()=>uY,PntsLoader:()=>lX,PntsParser:()=>yS,PointCloud:()=>$k,PointCloudEyeDomeLighting:()=>Nb,PointCloudShading:()=>Up,PointCloudStylingPipelineStage:()=>LP,PointGraphics:()=>F_,PointPrimitive:()=>Ea,PointPrimitiveCollection:()=>pV,PointVisualizer:()=>OY,PolygonGeometry:()=>kp,PolygonGeometryLibrary:()=>oi,PolygonGeometryUpdater:()=>bY,PolygonGraphics:()=>Hh,PolygonHierarchy:()=>Gc,PolygonOutlineGeometry:()=>pY,PolygonPipeline:()=>hi,Polyline:()=>Bm,PolylineArrowMaterialProperty:()=>SV,PolylineCollection:()=>xf,PolylineColorAppearance:()=>ws,PolylineDashMaterialProperty:()=>RV,PolylineGeometry:()=>Pg,PolylineGeometryUpdater:()=>HY,PolylineGlowMaterialProperty:()=>VV,PolylineGraphics:()=>qc,PolylineMaterialAppearance:()=>sc,PolylineOutlineMaterialProperty:()=>Ox,PolylinePipeline:()=>oo,PolylineVisualizer:()=>JY,PolylineVolumeGeometry:()=>xY,PolylineVolumeGeometryLibrary:()=>Cf,PolylineVolumeGeometryUpdater:()=>ZY,PolylineVolumeGraphics:()=>I_,PolylineVolumeOutlineGeometry:()=>SY,PositionProperty:()=>Bh,PositionPropertyArray:()=>Cg,PostProcessStage:()=>Uo,PostProcessStageCollection:()=>_U,PostProcessStageComposite:()=>hu,PostProcessStageLibrary:()=>mm,PostProcessStageSampleMode:()=>um,PostProcessStageTextureCache:()=>vR,PpeMetadata:()=>PF,PpeSource:()=>Jce,PpeTexture:()=>IF,Primitive:()=>In,PrimitiveCollection:()=>xl,PrimitiveLoadPlan:()=>cS,PrimitiveOutlineGenerator:()=>aS,PrimitiveOutlinePipelineStage:()=>FP,PrimitivePipeline:()=>y_,PrimitiveRenderResources:()=>$P,PrimitiveState:()=>ts,PrimitiveStatisticsPipelineStage:()=>IP,PrimitiveType:()=>Ie,ProjectionPicker:()=>w5,ProjectionPickerViewModel:()=>M5,Property:()=>j,PropertyArray:()=>AV,PropertyAttribute:()=>rS,PropertyAttributeProperty:()=>ZF,PropertyBag:()=>Dl,PropertyTable:()=>jl,PropertyTexture:()=>Xb,PropertyTextureProperty:()=>SF,ProviderViewModel:()=>mr,Proxy:()=>Tre,QuadraticRealPolynomial:()=>Xl,QuadtreeOccluders:()=>ck,QuadtreePrimitive:()=>fk,QuadtreeTile:()=>lk,QuadtreeTileLoadState:()=>Qa,QuadtreeTileProvider:()=>zae,QuantizedMeshTerrainData:()=>zZ,QuarticRealPolynomial:()=>SG,Quaternion:()=>Ne,QuaternionSpline:()=>$F,Queue:()=>cx,Ray:()=>gn,Rectangle:()=>re,RectangleCollisionChecker:()=>hZ,RectangleGeometry:()=>rZ,RectangleGeometryLibrary:()=>Ca,RectangleGeometryUpdater:()=>RY,RectangleGraphics:()=>Kh,RectangleOutlineGeometry:()=>XS,ReferenceFrame:()=>Oi,ReferenceProperty:()=>Vg,RenderState:()=>ze,Renderbuffer:()=>Wu,RenderbufferFormat:()=>$l,Request:()=>Ar,RequestErrorEvent:()=>Sp,RequestScheduler:()=>Hc,RequestState:()=>Ri,RequestType:()=>js,Resource:()=>ve,ResourceCache:()=>Ni,ResourceCacheKey:()=>Kl,ResourceCacheStatistics:()=>oF,ResourceLoader:()=>io,ResourceLoaderState:()=>Rt,Rotation:()=>oh,RuntimeError:()=>ae,S2Cell:()=>Cb,SDFSettings:()=>Da,SampledPositionProperty:()=>fc,SampledProperty:()=>zu,Sampler:()=>Bt,ScaledPositionProperty:()=>l0,Scene:()=>wU,SceneFramebuffer:()=>ER,SceneMode:()=>se,SceneMode2DPipelineStage:()=>PP,SceneModePicker:()=>U5,SceneModePickerViewModel:()=>k5,SceneTransforms:()=>fo,SceneTransitioner:()=>RU,ScreenSpaceCameraController:()=>EU,ScreenSpaceElevatorCameraController:()=>o5,ScreenSpaceEventHandler:()=>la,ScreenSpaceEventType:()=>mn,ScreenSpaceInputBindings:()=>hp,ScreenSpaceMapCameraController:()=>r5,ScreenSpaceTiltOrbitCameraController:()=>Oce,ScreenSpaceZoomCameraController:()=>zce,SelectedFeatureIdPipelineStage:()=>xx,SelectionIndicator:()=>B5,SelectionIndicatorViewModel:()=>O5,SensorVolumePortionToDisplay:()=>vV,ShaderBuilder:()=>jb,ShaderCache:()=>iw,ShaderDestination:()=>fe,ShaderFunction:()=>OP,ShaderProgram:()=>nn,ShaderSource:()=>Je,ShaderStruct:()=>DP,ShadowMap:()=>my,ShadowMapShader:()=>dp,ShadowMode:()=>vn,ShadowVolumeAppearance:()=>_u,SharedContext:()=>cw,ShowGeometryInstanceAttribute:()=>Wn,Simon1994PlanetaryPositions:()=>gT,SimplePolylineGeometry:()=>Wre,SingleTileImageryProvider:()=>cP,SkinningPipelineStage:()=>NP,SkyAtmosphere:()=>DU,SkyBox:()=>OU,SnapFramebuffer:()=>GU,SnapService:()=>vre,Snapping:()=>WU,SpatialNode:()=>NU,Spdcf:()=>vF,SpecularEnvironmentCubeMap:()=>Qh,SphereEmitter:()=>Zce,SphereGeometry:()=>Nw,SphereOutlineGeometry:()=>hg,Spherical:()=>QN,Spline:()=>vo,SplitDirection:()=>wr,Splitter:()=>WA,StaticGeometryColorBatch:()=>ch,StaticGeometryPerMaterialBatch:()=>lh,StaticGroundGeometryColorBatch:()=>qV,StaticGroundGeometryPerMaterialBatch:()=>IY,StaticGroundPolylinePerMaterialBatch:()=>KY,StaticOutlineGeometryBatch:()=>tE,StencilConstants:()=>Jt,StencilFunction:()=>ni,StencilOperation:()=>Ft,SteppedSpline:()=>qF,Stereographic:()=>rl,StorageType:()=>ux,StripeMaterialProperty:()=>LV,StripeOrientation:()=>vf,StructuralMetadata:()=>Ma,StyleCommandsNeeded:()=>df,StyleExpression:()=>Rce,Sun:()=>QU,SunLight:()=>Jg,SunPostProcess:()=>IU,SupportedImageFormats:()=>AF,SvgPathBindingHandler:()=>c5,Sync:()=>lw,TaskProcessor:()=>$n,Terrain:()=>qU,TerrainData:()=>ru,TerrainEncoding:()=>Cr,TerrainFillMesh:()=>TA,TerrainMesh:()=>yc,TerrainOffsetProperty:()=>P_,TerrainPicker:()=>mw,TerrainProvider:()=>Qo,TerrainQuantization:()=>Ka,TerrainState:()=>wo,Texture:()=>vt,Texture3D:()=>dw,TextureAtlas:()=>TS,TextureCache:()=>ow,TextureMagnificationFilter:()=>ei,TextureManager:()=>Ow,TextureMinificationFilter:()=>Ht,TexturePacker:()=>BC,TextureUniform:()=>zw,TextureWrap:()=>pn,TileAvailability:()=>jf,TileBoundingRegion:()=>ku,TileBoundingS2Cell:()=>hN,TileBoundingSphere:()=>fg,TileBoundingVolume:()=>Cce,TileCoordinatesImageryProvider:()=>e5,TileDiscardPolicy:()=>Ece,TileEdge:()=>Gn,TileImagery:()=>MC,TileMapServiceImageryProvider:()=>Tx,TileMetadata:()=>aN,TileOrientedBoundingBox:()=>zd,TileProviderError:()=>tr,TileReplacementQueue:()=>dk,TileSelectionResult:()=>gi,TileState:()=>Ace,Tileset3DTileContent:()=>pX,TilesetMetadata:()=>fN,TilesetPipelineStage:()=>rI,TilingScheme:()=>Ire,TimeConstants:()=>wn,TimeDynamicImagery:()=>mS,TimeDynamicPointCloud:()=>MA,TimeInterval:()=>Cn,TimeIntervalCollection:()=>Vs,TimeIntervalCollectionPositionProperty:()=>Eg,TimeIntervalCollectionProperty:()=>Ag,TimeStandard:()=>ci,Timeline:()=>K5,TimelineHighlightRange:()=>z5,TimelineTrack:()=>H5,Tipsify:()=>ZG,ToggleButtonViewModel:()=>kT,Tonemapper:()=>py,TrackingReferenceFrame:()=>mb,Transforms:()=>_t,TranslationRotationScale:()=>wy,TranslucentTileClassification:()=>Bk,TridiagonalSystemSolver:()=>bC,TrustedServers:()=>t1,TweenCollection:()=>PR,UniformState:()=>sw,UniformType:()=>F0,UrlTemplate3DTilesDataProvider:()=>Ik,UrlTemplateImageryProvider:()=>Ss,VERSION:()=>C3t,VRButton:()=>j5,VRButtonViewModel:()=>J5,VRTheWorldTerrainProvider:()=>Xre,VaryingType:()=>Hce,Vector3DTileBatch:()=>Pp,Vector3DTileClampedPolylines:()=>NX,Vector3DTileContent:()=>MX,Vector3DTileGeometry:()=>Rb,Vector3DTilePoints:()=>LX,Vector3DTilePolygons:()=>WX,Vector3DTilePolylines:()=>ES,Vector3DTilePrimitive:()=>B_,VectorGltf3DTileContent:()=>Gx,VectorPipeline:()=>Ts,VectorProvider:()=>sg,VelocityOrientationProperty:()=>$N,VelocityVectorProperty:()=>Gg,VertexArray:()=>Un,VertexArrayFacade:()=>qb,VertexAttributeSemantic:()=>dt,VertexFormat:()=>Me,VerticalExaggeration:()=>_o,VerticalExaggerationPipelineStage:()=>MP,VerticalOrigin:()=>Bn,VideoSynchronizer:()=>Pre,View:()=>GR,Viewer:()=>yle,ViewportQuad:()=>Wce,Visibility:()=>Jr,Visualizer:()=>noe,VoxelBoundsCollection:()=>iy,VoxelBoxShape:()=>aR,VoxelCell:()=>PU,VoxelContent:()=>sR,VoxelCylinderShape:()=>cR,VoxelEllipsoidShape:()=>lR,VoxelInspector:()=>q5,VoxelInspectorViewModel:()=>Q5,VoxelMetadataOrder:()=>P0,VoxelPrimitive:()=>MT,VoxelProvider:()=>Fce,VoxelRenderResources:()=>c9,VoxelShape:()=>Ice,VoxelShapeType:()=>xc,VoxelTraversal:()=>YU,VulkanConstants:()=>Nre,WallGeometry:()=>VY,WallGeometryLibrary:()=>sZ,WallGeometryUpdater:()=>GY,WallGraphics:()=>Tb,WallOutlineGeometry:()=>AY,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>dP,WebMapTileServiceImageryProvider:()=>uP,WebMercatorProjection:()=>Ti,WebMercatorTilingScheme:()=>Xr,WindingOrder:()=>qs,WireframeIndexGenerator:()=>UC,WireframePipelineStage:()=>wP,_shadersAcesTonemappingStage:()=>eU,_shadersAdditiveBlend:()=>vU,_shadersAdjustTranslucentFS:()=>AA,_shadersAllMaterialAppearanceFS:()=>mG,_shadersAllMaterialAppearanceVS:()=>hG,_shadersAmbientOcclusionGenerate:()=>tU,_shadersAmbientOcclusionModulate:()=>nU,_shadersAspectRampMaterial:()=>FG,_shadersAtmosphereCommon:()=>rf,_shadersAtmosphereStageFS:()=>sI,_shadersAtmosphereStageVS:()=>aI,_shadersBasicMaterialAppearanceFS:()=>fG,_shadersBasicMaterialAppearanceVS:()=>pG,_shadersBillboardCollectionFS:()=>bX,_shadersBillboardCollectionVS:()=>gX,_shadersBlackAndWhite:()=>iU,_shadersBloomComposite:()=>oU,_shadersBrdfLutGeneratorFS:()=>ww,_shadersBrightPass:()=>FU,_shadersBrightness:()=>rU,_shadersBufferPointMaterialFS:()=>kX,_shadersBufferPointMaterialVS:()=>wX,_shadersBufferPolygonMaterialFS:()=>uF,_shadersBufferPolygonMaterialVS:()=>dF,_shadersBufferPolylineMaterialFS:()=>zX,_shadersBufferPolylineMaterialVS:()=>BX,_shadersBumpMapMaterial:()=>IG,_shadersCPUStylingStageFS:()=>PI,_shadersCPUStylingStageVS:()=>II,_shadersCheckerboardMaterial:()=>PG,_shadersCloudCollectionFS:()=>_9,_shadersCloudCollectionVS:()=>S9,_shadersCloudNoiseFS:()=>Z9,_shadersCloudNoiseVS:()=>R9,_shadersCompareAndPackTranslucentDepth:()=>Ok,_shadersCompositeOITFS:()=>Pk,_shadersCompositeTranslucentClassification:()=>AR,_shadersComputeIrradianceFS:()=>gF,_shadersComputeRadianceMapFS:()=>yF,_shadersConstantLodStageFS:()=>RP,_shadersConstantLodStageVS:()=>ZP,_shadersContrastBias:()=>sU,_shadersConvolveSpecularMapFS:()=>xF,_shadersConvolveSpecularMapVS:()=>TF,_shadersCubeMapPanoramaVS:()=>W9,_shadersCustomShaderStageFS:()=>YI,_shadersCustomShaderStageVS:()=>NI,_shadersCzmBuiltins:()=>b_,_shadersDepthOfField:()=>aU,_shadersDepthPlaneFS:()=>M9,_shadersDepthPlaneVS:()=>w9,_shadersDepthView:()=>cU,_shadersDepthViewPacked:()=>Kce,_shadersDotMaterial:()=>XG,_shadersEdgeDetection:()=>lU,_shadersEdgeDetectionStageFS:()=>zI,_shadersEdgeVisibilityStageFS:()=>KI,_shadersEdgeVisibilityStageVS:()=>JI,_shadersElevationBandMaterial:()=>NG,_shadersElevationContourMaterial:()=>YG,_shadersElevationRampMaterial:()=>MG,_shadersEllipsoidFS:()=>pA,_shadersEllipsoidSurfaceAppearanceFS:()=>H9,_shadersEllipsoidSurfaceAppearanceVS:()=>K9,_shadersEllipsoidVS:()=>bA,_shadersFXAA:()=>mU,_shadersFXAA3_11:()=>yU,_shadersFadeMaterial:()=>wG,_shadersFeatureIdStageFS:()=>MI,_shadersFeatureIdStageVS:()=>wI,_shadersFilmicTonemapping:()=>dU,_shadersGaussianBlur1D:()=>NT,_shadersGeometryStageFS:()=>QI,_shadersGeometryStageVS:()=>qI,_shadersGlobeFS:()=>nk,_shadersGlobeVS:()=>ik,_shadersGridMaterial:()=>kG,_shadersGroundAtmosphere:()=>gA,_shadersHSBToRGB:()=>kW,_shadersHSLToRGB:()=>UW,_shadersImageBasedLightingStageFS:()=>lI,_shadersInstancingStageCommon:()=>ZI,_shadersInstancingStageVS:()=>RI,_shadersIntersectBox:()=>e9,_shadersIntersectCylinder:()=>t9,_shadersIntersectDepth:()=>qw,_shadersIntersectEllipsoid:()=>n9,_shadersIntersectLongitude:()=>cA,_shadersIntersectPlane:()=>$w,_shadersIntersection:()=>rR,_shadersIntersectionUtils:()=>Qw,_shadersLegacyInstancingStageVS:()=>CI,_shadersLensFlare:()=>hU,_shadersLightingStageFS:()=>TP,_shadersMaterialStageFS:()=>SP,_shadersMegatexture:()=>a9,_shadersMetadataStageFS:()=>kI,_shadersMetadataStageVS:()=>UI,_shadersModelClippingPlanesStageFS:()=>fI,_shadersModelClippingPolygonsStageFS:()=>bI,_shadersModelClippingPolygonsStageVS:()=>gI,_shadersModelColorStageFS:()=>hI,_shadersModelFS:()=>oX,_shadersModelSilhouetteStageFS:()=>zP,_shadersModelSilhouetteStageVS:()=>HP,_shadersModelSplitterStageFS:()=>JP,_shadersModelVS:()=>iX,_shadersModelVectorLookupStageFS:()=>TI,_shadersModelVectorLookupStageVS:()=>xI,_shadersModifiedReinhardTonemapping:()=>fU,_shadersMorphTargetsStageVS:()=>VP,_shadersNightVision:()=>pU,_shadersNormalMapMaterial:()=>UG,_shadersOctree:()=>s9,_shadersPassThrough:()=>uu,_shadersPassThroughDepth:()=>vT,_shadersPbrNeutralTonemapping:()=>uU,_shadersPerInstanceColorAppearanceFS:()=>$G,_shadersPerInstanceColorAppearanceVS:()=>eL,_shadersPerInstanceFlatColorAppearanceFS:()=>f_,_shadersPerInstanceFlatColorAppearanceVS:()=>tL,_shadersPointCloudEyeDomeLighting:()=>UF,_shadersPointCloudStylingStageVS:()=>GP,_shadersPointPrimitiveCollectionFS:()=>Ux,_shadersPointPrimitiveCollectionVS:()=>kN,_shadersPolylineArrowMaterial:()=>DG,_shadersPolylineColorAppearanceVS:()=>t2,_shadersPolylineCommon:()=>wl,_shadersPolylineDashMaterial:()=>OG,_shadersPolylineFS:()=>Z_,_shadersPolylineGlowMaterial:()=>BG,_shadersPolylineMaterialAppearanceVS:()=>n2,_shadersPolylineOutlineMaterial:()=>zG,_shadersPolylineShadowVolumeFS:()=>Qv,_shadersPolylineShadowVolumeMorphFS:()=>qv,_shadersPolylineShadowVolumeMorphVS:()=>$v,_shadersPolylineShadowVolumeVS:()=>e2,_shadersPolylineVS:()=>RX,_shadersPrimitiveGaussianSplatFS:()=>nN,_shadersPrimitiveGaussianSplatVS:()=>tN,_shadersPrimitiveOutlineStageFS:()=>vP,_shadersPrimitiveOutlineStageVS:()=>WP,_shadersRGBToHSB:()=>fv,_shadersRGBToHSL:()=>pv,_shadersRGBToXYZ:()=>bv,_shadersReinhardTonemapping:()=>bU,_shadersReprojectWebMercatorFS:()=>fP,_shadersReprojectWebMercatorVS:()=>pP,_shadersRimLightingMaterial:()=>HG,_shadersSelectedFeatureIdStageCommon:()=>CC,_shadersShadowVolumeAppearanceFS:()=>y1,_shadersShadowVolumeAppearanceVS:()=>Uv,_shadersShadowVolumeFS:()=>Xy,_shadersSilhouette:()=>gU,_shadersSkinningStageVS:()=>XP,_shadersSkyAtmosphereCommon:()=>FA,_shadersSkyAtmosphereFS:()=>kU,_shadersSkyAtmosphereVS:()=>UU,_shadersSkyBoxFS:()=>G9,_shadersSkyBoxVS:()=>L9,_shadersSlopeRampMaterial:()=>KG,_shadersStripeMaterial:()=>JG,_shadersSunFS:()=>zU,_shadersSunTextureFS:()=>HU,_shadersSunVS:()=>KU,_shadersTexturedMaterialAppearanceFS:()=>bG,_shadersTexturedMaterialAppearanceVS:()=>gG,_shadersVector3DTileClampedPolylinesFS:()=>PX,_shadersVector3DTileClampedPolylinesVS:()=>IX,_shadersVector3DTilePolylinesVS:()=>vX,_shadersVectorCommon:()=>Ob,_shadersVectorTileVS:()=>L1,_shadersVerticalExaggerationStageVS:()=>YP,_shadersViewportQuadFS:()=>t5,_shadersViewportQuadVS:()=>wZ,_shadersVoxelFS:()=>Jw,_shadersVoxelUtils:()=>Kw,_shadersVoxelVS:()=>jw,_shadersWater:()=>QG,_shadersWaterMaskMaterial:()=>jG,_shadersXYZToRGB:()=>wv,_shadersacesTonemapping:()=>iW,_shadersalphaWeight:()=>oW,_shadersantialias:()=>rW,_shadersapplyHSBShift:()=>sW,_shadersapproximateSphericalCoordinates:()=>aW,_shadersapproximateTanh:()=>cW,_shadersbackFacing:()=>lW,_shadersbranchFreeTernary:()=>dW,_shaderscascadeColor:()=>uW,_shaderscascadeDistance:()=>mW,_shaderscascadeMatrix:()=>hW,_shaderscascadeWeights:()=>fW,_shaderscolumbusViewMorph:()=>pW,_shaderscomputeAtmosphereColor:()=>bW,_shaderscomputeGroundAtmosphereScattering:()=>gW,_shaderscomputePosition:()=>yW,_shaderscomputeScattering:()=>xW,_shaderscomputeTextureTransform:()=>TW,_shadersconvertLocalToBoxUv:()=>i9,_shadersconvertLocalToCylinderUv:()=>o9,_shadersconvertLocalToEllipsoidUv:()=>r9,_shaderscosineAndSine:()=>_W,_shadersdecodeRGB8:()=>SW,_shadersdecompressTextureCoordinates:()=>ZW,_shadersdegreesPerRadian:()=>aL,_shadersdepthClamp:()=>RW,_shadersdepthRange:()=>cL,_shadersdepthRangeStruct:()=>JL,_shaderseastNorthUpToEyeCoordinates:()=>CW,_shadersellipsoidContainsPoint:()=>VW,_shadersellipsoidTextureCoordinates:()=>EW,_shadersepsilon1:()=>lL,_shadersepsilon2:()=>dL,_shadersepsilon3:()=>uL,_shadersepsilon4:()=>mL,_shadersepsilon5:()=>hL,_shadersepsilon6:()=>fL,_shadersepsilon7:()=>pL,_shadersequalsEpsilon:()=>AW,_shaderseyeOffset:()=>GW,_shaderseyeToCartographicDelta:()=>LW,_shaderseyeToWindowCoordinates:()=>WW,_shadersfastApproximateAtan:()=>vW,_shadersfog:()=>FW,_shadersgammaCorrect:()=>IW,_shadersgeodeticSurfaceNormal:()=>PW,_shadersgetDefaultMaterial:()=>XW,_shadersgetDynamicAtmosphereLightDirection:()=>NW,_shadersgetLambertDiffuse:()=>YW,_shadersgetSpecular:()=>MW,_shadersgetWaterNoise:()=>wW,_shadershue:()=>DW,_shadersinfinity:()=>bL,_shadersinverseGamma:()=>OW,_shadersisEmpty:()=>BW,_shadersisFull:()=>zW,_shaderslatitudeToWebMercatorFraction:()=>HW,_shaderslineDistance:()=>JW,_shaderslinearToSrgb:()=>KW,_shadersluminance:()=>jW,_shadersmaterial:()=>jL,_shadersmaterialInput:()=>QL,_shadersmaximumComponent:()=>QW,_shadersmetersPerPixel:()=>qW,_shadersmodelMaterial:()=>qL,_shadersmodelToWindowCoordinates:()=>$W,_shadersmodelVertexOutput:()=>$L,_shadersmultiplyWithColorBalance:()=>ev,_shadersnearFarScalar:()=>tv,_shadersoctDecode:()=>nv,_shadersoneOverPi:()=>gL,_shadersoneOverTwoPi:()=>yL,_shaderspackDepth:()=>iv,_shaderspassCesium3DTile:()=>xL,_shaderspassCesium3DTileClassification:()=>TL,_shaderspassCesium3DTileClassificationIgnoreShow:()=>_L,_shaderspassCesium3DTileEdges:()=>SL,_shaderspassCesium3DTileEdgesDirect:()=>ZL,_shaderspassCesium3DTilePlanarFillId:()=>RL,_shaderspassClassification:()=>CL,_shaderspassCompute:()=>VL,_shaderspassEnvironment:()=>EL,_shaderspassGaussianSplats:()=>AL,_shaderspassGlobe:()=>GL,_shaderspassOpaque:()=>LL,_shaderspassOverlay:()=>WL,_shaderspassTerrainClassification:()=>vL,_shaderspassTranslucent:()=>FL,_shaderspassVoxels:()=>IL,_shaderspbrLighting:()=>ov,_shaderspbrNeutralTonemapping:()=>rv,_shadersphong:()=>sv,_shaderspi:()=>PL,_shaderspiOverFour:()=>XL,_shaderspiOverSix:()=>NL,_shaderspiOverThree:()=>YL,_shaderspiOverTwo:()=>ML,_shadersplaneDistance:()=>av,_shaderspointAlongRay:()=>cv,_shadersradiansPerDegree:()=>wL,_shadersray:()=>eW,_shadersrayEllipsoidIntersectionInterval:()=>lv,_shadersraySegment:()=>tW,_shadersraySphereIntersectionInterval:()=>dv,_shadersreadDepth:()=>uv,_shadersreadNonPerspective:()=>mv,_shadersreverseLogDepth:()=>hv,_shadersround:()=>gv,_shaderssaturation:()=>yv,_shaderssceneMode2D:()=>kL,_shaderssceneMode3D:()=>UL,_shaderssceneModeColumbusView:()=>DL,_shaderssceneModeMorphing:()=>OL,_shadersshadowDepthCompare:()=>xv,_shadersshadowParameters:()=>nW,_shadersshadowVisibility:()=>Tv,_shaderssignNotZero:()=>_v,_shaderssolarRadius:()=>BL,_shaderssphericalHarmonics:()=>Sv,_shaderssrgbToLinear:()=>Zv,_shaderstangentToEyeSpaceMatrix:()=>Rv,_shaderstextureCube:()=>Cv,_shadersthreePiOver2:()=>zL,_shaderstransformPlane:()=>Vv,_shaderstranslateRelativeToEye:()=>Ev,_shaderstranslucentPhong:()=>Av,_shaderstranspose:()=>Gv,_shaderstwoPi:()=>HL,_shadersunpackDepth:()=>Lv,_shadersunpackFloat:()=>Wv,_shadersunpackTexture:()=>vv,_shadersunpackUint:()=>Fv,_shadersvalueTransform:()=>Iv,_shadersvertexLogDepth:()=>Pv,_shaderswebMercatorMaxLatitude:()=>KL,_shaderswindowToEyeCoordinates:()=>Xv,_shaderswriteDepthClamp:()=>Nv,_shaderswriteLogDepth:()=>Yv,_shaderswriteNonPerspective:()=>Mv,addAllToArray:()=>ii,addBuffer:()=>K2,addDefaults:()=>k2,addExtensionsRequired:()=>B2,addExtensionsUsed:()=>Fm,addPipelineExtras:()=>$y,addToArray:()=>pa,appendForwardSlash:()=>KA,arrayRemoveDuplicates:()=>Yo,assert:()=>w4,barycentricCoordinates:()=>r_,binarySearch:()=>Eo,buildModuleUrl:()=>en,buildVectorGltfFromMVT:()=>Dw,buildVoxelCustomShader:()=>aA,buildVoxelDrawCommands:()=>l9,clone:()=>$e,combine:()=>It,computeFlyToLocationForRectangle:()=>uR,createBillboardPointCallback:()=>ZS,createColorRamp:()=>xw,createCommand:()=>Fn,createDefaultImageryProviderViewModels:()=>h5,createDefaultTerrainProviderViewModels:()=>f5,createElevationBandMaterial:()=>xse,createGooglePhotorealistic3DTileset:()=>Tse,createGuid:()=>qn,createMaterialPropertyDescriptor:()=>sr,createOsmBuildingsAsync:()=>_se,createPropertyDescriptor:()=>be,createRawPropertyDescriptor:()=>Ul,createTangentSpaceDebugPrimitive:()=>Sse,createTaskProcessorWorker:()=>jce,createUniform:()=>rL,createUniformArray:()=>sL,createVectorTileBuffersFromModelComponents:()=>QX,createWorldBathymetryAsync:()=>Tw,createWorldImageryAsync:()=>Jb,createWorldTerrainAsync:()=>KZ,decodeGoogleEarthEnterpriseData:()=>_w,decodeMVT:()=>Y9,decodeVectorPolylinePositions:()=>YX,defaultPickWorldPosition:()=>mp,defer:()=>Rd,defined:()=>l,demodernizeShader:()=>kv,deprecationWarning:()=>Jo,destroyObject:()=>ue,exportKml:()=>rie,findAccessorMinMax:()=>eS,findContentMetadata:()=>IS,findGroupMetadata:()=>PS,findMeshoptExtension:()=>Qy,findTileMetadata:()=>cN,forEachTextureInMaterial:()=>M1,formatError:()=>Op,freezeRenderState:()=>H4,getAbsoluteUri:()=>ym,getAccessorByteStride:()=>Nd,getBaseUri:()=>JA,getBinaryAccessor:()=>Lm,getClipAndStyleCode:()=>$9,getClippingFunction:()=>bR,getComponentReader:()=>Lb,getElement:()=>Nn,getExtensionFromUri:()=>q0,getFilenameFromUri:()=>Zg,getImageFromTypedArray:()=>Cw,getImagePixels:()=>Fh,getJsonFromTypedArray:()=>vr,getMagic:()=>qh,getMeshPrimitives:()=>YF,getMetadataClassProperty:()=>ek,getMetadataProperty:()=>tk,getStringFromTypedArray:()=>Id,getTimestamp:()=>Zn,hasExtension:()=>no,heightReferenceOnEntityPropertyChanged:()=>_b,isBitSet:()=>_l,isBlobUri:()=>QT,isCrossOriginUrl:()=>Vy,isDataUri:()=>Ih,isLeapYear:()=>Il,knockout:()=>Ee,knockout_3_5_1:()=>UR,knockout_es5:()=>a5,loadAndExecuteScript:()=>qT,loadCubeMap:()=>aw,loadImageFromTypedArray:()=>Gb,loadKTX2:()=>Ad,mergeSort:()=>v0,mostDetailedSurfaceHeight:()=>Nh,moveTechniqueRenderStates:()=>O2,moveTechniquesToExtension:()=>z2,numberOfComponentsForType:()=>Vu,objectToQuery:()=>$T,oneTimeWarning:()=>xt,parseBatchTable:()=>wb,parseFeatureMetadataLegacy:()=>VF,parseGlb:()=>$_,parseResponseHeaders:()=>jA,parseStructuralMetadata:()=>CF,pickModel:()=>OC,pointInsideTriangle:()=>xre,positionForSurfaceHeight:()=>ib,preprocess3DTileContent:()=>dg,processVoxelProperties:()=>Hw,queryToObject:()=>gu,readAccessorPacked:()=>J2,removeExtension:()=>tS,removeExtensionsRequired:()=>U2,removeExtensionsUsed:()=>q_,removePipelineExtras:()=>D2,removeUnusedElements:()=>H2,renderBufferPointCollection:()=>OX,renderBufferPolygonCollection:()=>fF,renderBufferPolylineCollection:()=>JX,resizeImageToNextPowerOfTwo:()=>nx,sampleTerrain:()=>Iw,sampleTerrainMostDetailed:()=>$Z,scaleToGeodeticSurface:()=>jT,srgbToLinear:()=>tR,subdivideArray:()=>Dv,subscribeAndEvaluate:()=>Sc,updateAccessorComponentTypes:()=>j2,updateVersion:()=>Q2,usesExtension:()=>Dr,viewerCesium3DTilesInspectorMixin:()=>xle,viewerCesiumInspectorMixin:()=>Tle,viewerDragDropMixin:()=>Sle,viewerPerformanceWatchdogMixin:()=>Zle,viewerVoxelInspectorMixin:()=>Rle,webGLConstantToGlslType:()=>Yre,wrapFunction:()=>Yw,writeTextToCanvas:()=>CS});var O0r=x(T(),1);var eBo=x(T(),1);var izt=x(T(),1);var W3t=x(T(),1),dj={};dj.EMPTY_OBJECT=Object.freeze({});dj.EMPTY_ARRAY=Object.freeze([]);var B=dj;var F3t=x(T(),1);function HYe(e){return e!=null}var l=HYe;var X3t=x(T(),1);function JT(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(JT.prototype=Object.create(Error.prototype),JT.prototype.constructor=JT);JT.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};JT.throwInstantiationError=function(){throw new JT("This function defines an interface and should not be called directly.")};var ge=JT;var D3t=x(T(),1);var w3t=x(T(),1);var ma={};ma.typeOf={};function KYe(e){return`${e} is required, actual value was undefined`}function KR(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(KYe(e))};ma.typeOf.func=function(e,t){if(typeof t!="function")throw new ge(KR(typeof t,"function",e))};ma.typeOf.string=function(e,t){if(typeof t!="string")throw new ge(KR(typeof t,"string",e))};ma.typeOf.number=function(e,t){if(typeof t!="number")throw new ge(KR(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){for(let[n,i]of this._toAdd.entries())for(let o of i)mj(this,this._listeners,n,o);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let o of i)uj(this,this._listeners,n,o);this._toRemove.clear()}};var Se=BA;var Q3t=x(T(),1);var H3t=x(T(),1);function Sy(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Se,this.setValue(e)}Object.defineProperties(Sy.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Sy.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Sy.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Sy.prototype.equals=function(e){return this===e||e instanceof Sy&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Sy.prototype.valueOf=function(){return this._value};Sy.prototype.toString=function(){return String(this._value)};var ui=Sy;function QYe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function qYe(e){return new ui(e)}function $Ye(e,t,n){return QYe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??qYe)}var be=$Ye;function zA(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(zA.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),image:be("image"),scale:be("scale"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),color:be("color"),rotation:be("rotation"),alignedAxis:be("alignedAxis"),sizeInMeters:be("sizeInMeters"),width:be("width"),height:be("height"),scaleByDistance:be("scaleByDistance"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),imageSubRegion:be("imageSubRegion"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance"),splitDirection:be("splitDirection")});zA.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 zA(this)};zA.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 Oc=zA;var lQt=x(T(),1);var szt=x(T(),1);var hj=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 o=this._array;o.splice(o.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},wt=hj;var i4t=x(T(),1);var fzt=x(T(),1);var dzt=x(T(),1),fj=x(nD(),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 iD=[1];Tt.factorial=function(e){let t=iD.length;if(e>=t){let n=iD[t-1];for(let i=t;i<=e;i++){let o=n*i;iD.push(o),n=o}}return iD[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 Ale=new fj.default;Tt.setRandomNumberSeed=function(e){Ale=new fj.default(e)};Tt.nextRandomNumber=function(){return Ale.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 jT=oMe;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=jT(t,o,r,s,sMe);if(!l(a))return;let c=h.multiplyComponents(a,r,rMe);c=h.normalize(c,c);let d=h.subtract(t,a,aMe),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 HA=vl;HA.ZERO=Object.freeze(new HA(0,0,0));var rMe=new h,sMe=new h,aMe=new h,pe=HA;var Yzt=x(T(),1);function Fle(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,Fle(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)&&Fle(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=cMe,o=lMe;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,hMe),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=xMe;var eHt=x(T(),1);function TMe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Zy=TMe;var SHt=x(T(),1);var aHt=x(T(),1);var nHt=x(T(),1);function _Me(e){return e%4===0&&e%100!==0||e%400===0}var Il=_Me;var Yle=[31,28,31,30,31,30,31,31,30,31,30,31];function SMe(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&&Il(e)?Yle[t-1]+1:Yle[t-1];if(n>S)throw new ge("Month and Day represents invalid date")}}var vh=SMe;var lHt=x(T(),1);function ZMe(e,t){this.julianDate=e,this.offset=t}var To=ZMe;var uHt=x(T(),1),Mle={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(Mle);var wn=Mle;var hHt=x(T(),1),wle={UTC:0,TAI:1};Object.freeze(wle);var ci=wle;var kle=new vh,lD=[31,28,31,30,31,30,31,31,30,31,30,31],dD=29;function xj(e,t){return bi.compare(e.julianDate,t.julianDate)}var jR=new To;function uD(e){jR.julianDate=e;let t=bi.leapSeconds,n=Eo(t,jR,xj);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&bi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),bi.addSeconds(e,i,e)}function Ule(e,t){jR.julianDate=e;let n=bi.leapSeconds,i=Eo(n,jR,xj);if(i<0&&(i=~i),i===0)return bi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return bi.addSeconds(e,-n[i-1].offset,t);let o=bi.secondsDifference(n[i].julianDate,e);if(o===0)return bi.addSeconds(e,-n[i].offset,t);if(!(o<=1))return bi.addSeconds(e,-n[i-1].offset,t)}function Ry(e,t,n){let i=t/wn.SECONDS_PER_DAY|0;return e+=i,t-=wn.SECONDS_PER_DAY*i,t<0&&(e--,t+=wn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function yj(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*wn.SECONDS_PER_HOUR+o*wn.SECONDS_PER_MINUTE+s*wn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var RMe=/^(\d{4})$/,CMe=/^(\d{4})-(\d{2})$/,VMe=/^(\d{4})-?(\d{3})$/,EMe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,AMe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Tj=/([Z+\-])?(\d{2})?:?(\d{2})?$/,GMe=/^(\d{2})(\.\d+)?/.source+Tj.source,LMe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Tj.source,WMe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Tj.source;var Cy={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},vMe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function Q0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var Dle=NaN,Ole=0;function Ble(e,t,n,i,o,r,s){Cy.year=e,Cy.month=t,Cy.day=n,Cy.hour=i,Cy.minute=o,Cy.second=r,Cy.millisecond=s}function FMe(e){let t=e.length;if(t===4){let f=Q0(e,0),y=Q0(e,2);return f<0||y<0?!1:(Ble(f*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let o=Q0(e,0),r=Q0(e,2),s=Q0(e,5),a=Q0(e,8),c=Q0(e,11),d=Q0(e,14),u=Q0(e,17);if(o<0||r<0||s<1||s>12||a<1||a>31||c<0||c>23||d<0||d>59||u<0||u>60)return!1;let m=0;if(i>19){let f=e.charCodeAt(19),y=i-20;if(f!==46&&f!==44||y<1||y>15)return!1;let _=0;for(let S=20;S9)return!1;_=_*10+Z}m=_/vMe[y]*1e3}let p=o*100+r,b=Il(p);if((s!==2||!b?lD[s-1]:dD)=60;)o-=60,i++;for(;i>=24;)i-=24,n++;for(d=a&&t===2?dD:lD[t-1];n>d;)n-=d,t++,t>12&&(t-=12,e++),d=a&&t===2?dD:lD[t-1];for(;o<0;)o+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),d=a&&t===2?dD:lD[t-1],n+=d;let m=yj(e,t,n,i,o,r,s);return l(c)?(Ry(m[0],m[1],c),uD(c)):c=new bi(m[0],m[1],ci.UTC),u&&bi.addSeconds(c,1,c),c}var bi=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)*wn.SECONDS_PER_DAY,Ry(o,n,this),i===ci.UTC&&uD(this)}static fromGregorianDate(t,n){let i=yj(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Ry(i[0],i[1],n),uD(n),n):new e(i[0],i[1],ci.UTC)}static fromDate(t,n){let i=yj(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Ry(i[0],i[1],n),uD(n),n):new e(i[0],i[1],ci.UTC)}static fromIso8601(t,n){if(FMe(t)){let _=Cy;return zle(_.year,_.month,_.day,_.hour,_.minute,_.second,_.millisecond,Il(_.year),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(AMe),i!==null)o=+i[1],r=+i[2],s=+i[3];else if(i=m.match(CMe),i!==null)o=+i[1],r=+i[2];else if(i=m.match(RMe),i!==null)o=+i[1];else{let _;if(i=m.match(VMe),i!==null)o=+i[1],_=+i[2],f=Il(o);else if(i=m.match(EMe),i!==null){o=+i[1];let S=+i[2],Z=+i[3]||0,R=new Date(Date.UTC(o,0,4));_=S*7+Z-R.getUTCDay()-3}b=new Date(Date.UTC(o,0,1)),b.setUTCDate(_),r=b.getUTCMonth()+1,s=b.getUTCDate()}f=Il(o);let y;if(l(p)){i=p.match(WMe),i!==null?(a=+i[1],c=+i[2],d=+i[3],u=+(i[4]||0)*1e3,y=5):(i=p.match(LMe),i!==null?(a=+i[1],c=+i[2],d=+(i[3]||0)*60,y=4):(i=p.match(GMe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let _=i[y],S=+i[y+1],Z=+(i[y+2]||0);switch(_){case"+":a=a-S,c=c-Z;break;case"-":a=a+S,c=c+Z;break;case"Z":break;default:c=c+new Date(Date.UTC(o,r-1,s,a,c)).getTimezoneOffset();break}}return zle(o,r,s,a,c,d,u,f,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,o=Ule(t,cD);l(o)||(e.addSeconds(t,-1,cD),o=Ule(cD,cD),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/wn.SECONDS_PER_HOUR|0,y=s-f*wn.SECONDS_PER_HOUR,_=y/wn.SECONDS_PER_MINUTE|0;y=y-_*wn.SECONDS_PER_MINUTE;let S=y|0,Z=(y-S)/wn.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,kle),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,kle),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/wn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*wn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,o=(t.secondsOfDay-n.secondsOfDay)/wn.SECONDS_PER_DAY;return i+o}static computeTaiMinusUtc(t){jR.julianDate=t;let n=e.leapSeconds,i=Eo(n,jR,xj);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Ry(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_MINUTE;return Ry(t.dayNumber,o,i)}static addHours(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_HOUR;return Ry(t.dayNumber,o,i)}static addDays(t,n,i){let o=t.dayNumber+n;return Ry(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)}},cD=new bi(0,0,ci.TAI);bi.leapSeconds=[new To(new bi(2441317,43210,ci.TAI),10),new To(new bi(2441499,43211,ci.TAI),11),new To(new bi(2441683,43212,ci.TAI),12),new To(new bi(2442048,43213,ci.TAI),13),new To(new bi(2442413,43214,ci.TAI),14),new To(new bi(2442778,43215,ci.TAI),15),new To(new bi(2443144,43216,ci.TAI),16),new To(new bi(2443509,43217,ci.TAI),17),new To(new bi(2443874,43218,ci.TAI),18),new To(new bi(2444239,43219,ci.TAI),19),new To(new bi(2444786,43220,ci.TAI),20),new To(new bi(2445151,43221,ci.TAI),21),new To(new bi(2445516,43222,ci.TAI),22),new To(new bi(2446247,43223,ci.TAI),23),new To(new bi(2447161,43224,ci.TAI),24),new To(new bi(2447892,43225,ci.TAI),25),new To(new bi(2448257,43226,ci.TAI),26),new To(new bi(2448804,43227,ci.TAI),27),new To(new bi(2449169,43228,ci.TAI),28),new To(new bi(2449534,43229,ci.TAI),29),new To(new bi(2450083,43230,ci.TAI),30),new To(new bi(2450630,43231,ci.TAI),31),new To(new bi(2451179,43232,ci.TAI),32),new To(new bi(2453736,43233,ci.TAI),33),new To(new bi(2454832,43234,ci.TAI),34),new To(new bi(2456109,43235,ci.TAI),35),new To(new bi(2457204,43236,ci.TAI),36),new To(new bi(2457754,43237,ci.TAI),37)];var Q=bi;var mJt=x(T(),1),hde=x(bu(),1);var AHt=x(T(),1);function IMe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var KA=IMe;var LHt=x(T(),1);function $le(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=$le(o,t)),n[i]=o}return n}var $e=$le;var FHt=x(T(),1);function ede(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]=ede(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=ede;var PHt=x(T(),1);function PMe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Rd=PMe;var YHt=x(T(),1),tde=x(bu(),1);function _j(e,t){let n;return typeof document<"u"&&(n=document),_j._implementation(e,t,n)}_j._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new tde.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var ym=_j;var wHt=x(T(),1),nde=x(bu(),1);function XMe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new nde.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var JA=XMe;var UHt=x(T(),1),ide=x(bu(),1);function NMe(e){let t=new ide.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=NMe;var BHt=x(T(),1);var ode={};function YMe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=ode[t];l(i)||(i={},ode[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=YMe;var HHt=x(T(),1);var MMe=/^blob:/i;function wMe(e){return MMe.test(e)}var QT=wMe;var jHt=x(T(),1);var _p;function kMe(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 Vy=kMe;var qHt=x(T(),1);var UMe=/^data:/i;function DMe(e){return UMe.test(e)}var Ih=DMe;var eKt=x(T(),1);function OMe(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 qT=OMe;var nKt=x(T(),1);function BMe(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 jA=HMe;function ade(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=jA(this.responseHeaders))}ade.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Sp=ade;var NKt=x(T(),1),bD=x(bu(),1);var RKt=x(T(),1);function e_(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(e_.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)};e_.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};e_.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Sj(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var QA=e_;var EKt=x(T(),1);function qA(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(qA.prototype=Object.create(Error.prototype),qA.prototype.constructor=qA);qA.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var ae=qA;function KMe(e,t){return e.priority-t.priority}var Ao={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},$R=20,zc=new QA({comparator:KMe});zc.maximumLength=$R;zc.reserve($R);var Zp=[],$0={},JMe=typeof document<"u"?new bD.default(document.location.href):new bD.default,gD=new Se;function Gr(){}Gr.maximumRequests=50;Gr.maximumRequestsPerServer=18;Gr.requestsByServer={};Gr.throttleRequests=!0;Gr.debugShowStatistics=!1;Gr.requestCompletedEvent=gD;Object.defineProperties(Gr,{statistics:{get:function(){return Ao}},priorityHeapLength:{get:function(){return $R},set:function(e){if(e<$R)for(;zc.length>e;){let t=zc.pop();t_(t)}$R=e,zc.maximumLength=e,zc.reserve(e)}}});function cde(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Gr.serverHasOpenSlots=function(e,t){t=t??1;let n=Gr.requestsByServer[e]??Gr.maximumRequestsPerServer;return $0[e]+t<=n};Gr.heapHasOpenSlots=function(e){return zc.length+e<=$R};function lde(e){return e.state===Ri.UNISSUED&&(e.state=Ri.ISSUED,e.deferred=Rd()),e.deferred.promise}function jMe(e){return function(t){if(e.state===Ri.CANCELLED)return;let n=e.deferred;--Ao.numberOfActiveRequests,--$0[e.serverKey],gD.raiseEvent(),e.state=Ri.RECEIVED,e.deferred=void 0,n.resolve(t)}}function QMe(e){return function(t){e.state!==Ri.CANCELLED&&(++Ao.numberOfFailedRequests,--Ao.numberOfActiveRequests,--$0[e.serverKey],gD.raiseEvent(t),e.state=Ri.FAILED,e.deferred.reject(t))}}function dde(e){let t=lde(e);return e.state=Ri.ACTIVE,Zp.push(e),++Ao.numberOfActiveRequests,++Ao.numberOfActiveRequestsEver,++$0[e.serverKey],e.requestFunction().then(jMe(e)).catch(QMe(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,--$0[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}dde(t),++a}qMe()};Gr.getServerKey=function(e){let t=new bD.default(e);t.scheme()===""&&(t=t.absoluteTo(JMe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=$0[n];return l(i)||($0[n]=0),n};Gr.request=function(e){if(Ih(e.url)||QT(e.url))return gD.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 dde(e);if(Zp.length>=Gr.maximumRequests)return;cde(e);let t=zc.insert(e);if(l(t)){if(t===e)return;t_(t)}return lde(e)};function qMe(){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 hde.default(e),r=ewe(o.query());this._queryParameters=t?xD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(ym(i))),this._url=o.toString()};function ewe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:gu(e)}function xD(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}${twe(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 twe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${$T(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=xD(this._queryParameters,e,!1):this._queryParameters=xD(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=xD(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 JA(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=KA(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(Zj(this.request),!fde||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=Rd();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",Zj(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return pde(this,e,t)};function pde(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=Rd();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,pde(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;Zj(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=Rd(),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 Zj(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 nwe=/^data:(.*?)(;base64)?,(.*)$/;function yD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function mde(e,t){let n=yD(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 rwe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=nwe.exec(e);if(a!==null){r.resolve(iwe(a,t));return}if(rwe){owe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(t1.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 qT(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 tG(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)?bde(this,e.data):bde(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}tG.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 tG({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};tG.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 Zy(0,0,0,0,0),t}});tG.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Zy(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,yde(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 gde(e,n,o,a,s),s;if(i.equals(d))return gde(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=eG(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=eG(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=eG(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=eG(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=eG(u,b,f),s}var nG=tG;var AJt=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 BJt=x(T(),1);var FJt=x(T(),1);var xde={};var Tde=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function awe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(TD)||(TD=document.createElement("a")),TD.href=e,TD.href)}var n_;function Sde(){if(l(n_))return n_;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(xde?.url)?e=ym(".",xde.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?e=ym("..",i_("Core/buildModuleUrl.js")):e=awe(),n_=new ve({url:_de(e)}),n_.appendForwardSlash(),n_}function cwe(e){return _de($5.toUrl(`../${e}`))}function Zde(e){return Sde().getDerivedResource({url:e}).url}var _D;function i_(e){return l(_D)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?_D=cwe:_D=Zde),_D(e)}i_._cesiumScriptRegex=Tde;i_._buildModuleUrlFromBaseUrl=Zde;i_._clearBaseResource=function(){n_=void 0};i_.setBaseUrl=function(e){n_=ve.DEFAULT.getDerivedResource({url:e})};i_.getCesiumBaseUrl=Sde;var en=i_;var XJt=x(T(),1);function lwe(e,t,n){this.x=e,this.y=t,this.s=n}var o_=lwe;function SD(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 dwe=new Q(0,0,ci.TAI);function Rj(e,t,n){let i=dwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}SD.prototype.preload=function(e,t,n,i){let o=Rj(this,e,t),r=Rj(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(Cj(this,m));return Promise.all(u)};SD.prototype.computeXysRadians=function(e,t,n){let i=Rj(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])||(Cj(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(Cj(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new o_(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};SD.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let o=0;od;)Twe(c,ZD),e.transpose(ZD,Cde),e.multiply(c,ZD,c),e.multiply(Cde,c,c),e.multiply(a,ZD,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,gwe),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]})`}};So.packedLength=9;So.fromArray=So.unpack;So.IDENTITY=new So(1,0,0,0,1,0,0,0,1);So.ZERO=new So(0,0,0,0,0,0,0,0,0);So.COLUMN0ROW0=0;So.COLUMN0ROW1=1;So.COLUMN0ROW2=2;So.COLUMN1ROW0=3;So.COLUMN1ROW1=4;So.COLUMN1ROW2=5;So.COLUMN2ROW0=6;So.COLUMN2ROW1=7;So.COLUMN2ROW2=8;var Owe=new h,Bwe=new h,Pj=new h,jde=new h,zwe=new h,Hwe=new h,RD=new So,Qde=new So,Kwe=new So;function Jwe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var Xj=[1,0,0],Nj=[2,2,1];function jwe(e){let t=0;for(let n=0;n<3;++n){let i=e[So.getElementIndex(Nj[n],Xj[n])];t+=2*i*i}return Math.sqrt(t)}function Qwe(e,t){let n=W.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[So.getElementIndex(Nj[d],Xj[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=Xj[o],c=Nj[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 yjt=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;ri&&(o=d,i=u)}let r=1,s=0,a=Ej[o],c=Aj[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 rjt=x(T(),1);var _we=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,_we,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{let t=new Image;t.onload=function(){Pl._result=t.width>0&&t.height>0,e(Pl._result)},t.onerror=function(){Pl._result=!1,e(Pl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Pl._promise};Object.defineProperties(Pl,{initialized:{get:function(){return l(Pl._result)}}});var c1=[];typeof ArrayBuffer<"u"&&(c1.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&c1.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&c1.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&c1.push(BigInt64Array),typeof BigUint64Array<"u"&&c1.push(BigUint64Array));var Tm={isChrome:Dj,chromeVersion:c9e,isSafari:tue,safariVersion:l9e,isWebkit:nue,webkitVersion:d9e,isEdge:WD,edgeVersion:u9e,isFirefox:vD,firefoxVersion:f9e,isWindows:m9e,isIPadOrIOS:h9e,hardwareConcurrency:xm.hardwareConcurrency??3,supportsPointerEvents:p9e,supportsImageRenderingPixelated:rue,supportsWebP:Pl,imageRenderingValue:b9e,typedArrayTypes:c1};Tm.supportsBasis=function(e){return Tm.supportsWebAssembly()&&e.context.supportsBasis};Tm.supportsFullscreen=function(){return qr.supportsFullscreen()};Tm.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Tm.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Tm.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Tm.supportsBigInt=function(){return typeof BigInt<"u"};Tm.supportsWebWorkers=function(){return typeof Worker<"u"};Tm.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Tm.supportsWebgl2=function(e){return e.context.webgl2};Tm.supportsEsmWebWorkers=function(){return!vD()||parseInt(Oj)>=114};var fn=Tm;function ft(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var lG=new h;ft.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);lG=h.normalize(e,lG);let r=lG.x*o,s=lG.y*o,a=lG.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 g9e=[1,2,0],y9e=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=g9e,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=y9e;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 sue=new ft,aue=new ft,Bj=new ft,cue=new ft;ft.fromHeadingPitchRoll=function(e,t){return cue=ft.fromAxisAngle(h.UNIT_X,e.roll,sue),Bj=ft.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ft.multiply(Bj,cue,Bj),aue=ft.fromAxisAngle(h.UNIT_Z,-e.heading,sue),ft.multiply(aue,t,t)};var FD=new h,zj=new h,Nh=new ft,lue=new ft,ID=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,ID),ft.conjugate(ID,ID);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)eb[b]=(PD[b]*c-XD[b])*s,tb[b]=(PD[b]*d-XD[b])*s;let u=r*n*(1+eb[0]*(1+eb[1]*(1+eb[2]*(1+eb[3]*(1+eb[4]*(1+eb[5]*(1+eb[6]*(1+eb[7])))))))),m=a*(1+tb[0]*(1+tb[1]*(1+tb[2]*(1+tb[3]*(1+tb[4]*(1+tb[5]*(1+tb[6]*(1+tb[7])))))))),p=ft.multiplyByScalar(e,m,_9e);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,dG),a=ft.fastSlerp(n,i,o,l1);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={},jj={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"}},d1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Qj={},Ed={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Ay=new h,Gy=new h,Ly=new h;Ci.localFrameToFixedFrameGenerator=function(e,t){if(!jj.hasOwnProperty(e)||!jj[e].hasOwnProperty(t))throw new ge("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=jj[e][t],i,o=e+t;return l(Qj[o])?i=Qj[o]:(i=function(r,s,a){if(l(a)||(a=new P),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(d1[e],0,Ay),h.unpack(d1[t],0,Gy),h.unpack(d1[n],0,Ly);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(d1[e],0,Ay),e!=="east"&&e!=="west"&&h.multiplyByScalar(Ay,c,Ay),h.unpack(d1[t],0,Gy),t!=="east"&&t!=="west"&&h.multiplyByScalar(Gy,c,Gy),h.unpack(d1[n],0,Ly),n!=="east"&&n!=="west"&&h.multiplyByScalar(Ly,c,Ly)}else{s=s??ne.default,s.geodeticSurfaceNormal(r,Ed.up);let c=Ed.up,d=Ed.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,Ed.east),h.cross(c,d,Ed.north),h.multiplyByScalar(Ed.up,-1,Ed.down),h.multiplyByScalar(Ed.east,-1,Ed.west),h.multiplyByScalar(Ed.north,-1,Ed.south),Ay=Ed[e],Gy=Ed[t],Ly=Ed[n]}return a[0]=Ay.x,a[1]=Ay.y,a[2]=Ay.z,a[3]=0,a[4]=Gy.x,a[5]=Gy.y,a[6]=Gy.z,a[7]=0,a[8]=Ly.x,a[9]=Ly.y,a[10]=Ly.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},Qj[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 S9e=new Ne,Z9e=new h(1,1,1),R9e=new P;Ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ci.eastNorthUpToFixedFrame;let r=Ne.fromHeadingPitchRoll(t,S9e),s=P.fromTranslationQuaternionRotationScale(h.ZERO,r,Z9e,R9e);return o=i(e,n,o),P.multiply(o,s,o)};var C9e=new P,V9e=new q;Ci.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ci.headingPitchRollToFixedFrame(e,t,n,i,C9e),s=P.getMatrix3(r,V9e);return Ne.fromRotationMatrix(s,o)};var E9e=new h(1,1,1),A9e=new h,mue=new P,G9e=new P,L9e=new q,W9e=new Ne;Ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ne.default,n=n??Ci.eastNorthUpToFixedFrame,l(i)||(i=new Vc);let o=P.getTranslation(e,A9e);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=P.inverseTransformation(n(o,t,mue),mue),s=P.setScale(e,E9e,G9e);s=P.setTranslation(s,h.ZERO,s),r=P.multiply(r,s,r);let a=Ne.fromRotationMatrix(P.getMatrix3(r,L9e),W9e);return a=Ne.normalize(a,a),Vc.fromQuaternion(a,i)};var v9e=6*3600+2460+50.54841,F9e=8640184812866e-6,I9e=.093104,P9e=-62e-7,X9e=11772758384668e-32,N9e=72921158553e-15,Y9e=W.TWO_PI/86400,ND=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){ND=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),ND);let n=ND.dayNumber,i=ND.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/wn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/wn.DAYS_PER_JULIAN_CENTURY;let a=(v9e+o*(F9e+o*(I9e+o*P9e)))*Y9e%W.TWO_PI,c=N9e+X9e*(n-24515455e-1),d=(i+wn.SECONDS_PER_DAY*.5)%wn.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 sG;Ci.earthOrientationParameters=rG.NONE;var e4=32.184,M9e=2451545;Ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+e4,i=e.stop.dayNumber,o=e.stop.secondsOfDay+e4;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 w9e=32.184,k9e=2451545,YD=new Vc,U9e=new q,D9e=new Q;Ci.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Q.addSeconds(e,w9e,D9e),i=Q.totalDays(n)-k9e,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 YD.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),YD.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),YD.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(YD,U9e,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 O9e=new s_(0,0,0),B9e=new Zy(0,0,0,0,0,0),qj=new q,$j=new q;Ci.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Ci.earthOrientationParameters.compute(e,B9e);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+e4,r=Ci.iau2006XysData.computeXysRadians(i,o,O9e);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=qj;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,$j),m=q.multiply(d,u,qj),p=e.dayNumber,b=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,y=b/wn.SECONDS_PER_DAY,_=.779057273264+y+.00273781191135448*(f+y);_=_%1*W.TWO_PI;let S=q.fromRotationZ(_,$j),Z=q.multiply(m,S,qj),R=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),A=Math.sin(n.yPoleWander),L=i-M9e+o/wn.SECONDS_PER_DAY;L/=36525;let F=-47e-6*L*W.RADIANS_PER_DEGREE/3600,I=Math.cos(F),N=Math.sin(F),g=$j;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 z9e=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=z9e;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 H9e=new h,K9e=new h,J9e=new h;Ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ne.default).geodeticSurfaceNormal(e,H9e),r=h.cross(t,o,K9e);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,J9e);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 hue=new pe,t4=new h,j9e=new h,Q9e=new q,n4=new P,fue=new P;Ci.basisTo2D=function(e,t,n){let i=P.getTranslation(t,j9e),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,t4);else{let u=o.cartesianToCartographic(i,hue);r=e.project(u,t4),h.fromElements(r.z,r.x,r.y,r)}let s=Ci.eastNorthUpToFixedFrame(i,o,n4),a=P.inverseTransformation(s,fue),c=P.getMatrix3(t,Q9e),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,n4),r=P.inverseTransformation(o,fue),s=i.cartesianToCartographic(t,hue),a=e.project(s,t4);h.fromElements(a.z,a.x,a.y,a);let c=P.fromTranslation(a,n4);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,r,n),P.multiply(c,n,n),n};var _t=Ci;var u1=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,q9e),a=P.multiplyByPointAsVector(s,h.UNIT_X,$9e);h.normalize(a,a);let c=P.multiplyByPointAsVector(s,h.UNIT_Y,eke);h.normalize(c,c),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,nke),u=h.negate(a,tke),m=i4,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=ike;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}};u1.packedLength=4;var q9e=new P,$9e=new h,eke=new h,tke=new h,nke=new h,i4=new Array(5);for(let e=0;e=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)}},eo=o4;var Z4t=x(T(),1);var uG=class e{constructor(t){this._ellipsoid=t??ne.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return W.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,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)}};uG.MaximumLatitude=uG.mercatorAngleToGeodeticLatitude(Math.PI);var xi=uG;var F4t=x(T(),1);var r4=new pe,s4=new pe,pue=new h,bue=new h,a4=class{constructor(t){mt(this,"_rectangleSouthwestInMeters");mt(this,"_rectangleNortheastInMeters");if(t=t??B.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ne.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 o=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new k(-o,-o),this._rectangleNortheastInMeters=new k(o,o)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,pue),this._projection.unproject(pue,r4),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,bue),this._projection.unproject(bue,s4),this._rectangle=new re(r4.longitude,r4.latitude,s4.longitude,s4.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<=r&&(y=r-1);let _=f/u|0;return _>=s&&(_=s-1),l(i)?(i.x=y,i.y=_,i):new k(y,_)}},Lr=a4;var M4t=x(T(),1);var c4,gue="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",m1={};m1.defaultAccessToken=gue;m1.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});m1.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});m1.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});m1.getDefaultTokenCredit=function(e){if(e===gue){if(!l(c4)){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/.';c4=new Lt(t,!0)}return c4}};var Tu=m1;var B4t=x(T(),1);function l4(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=Ph(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)}l4.prototype.isReady=function(){return this._isReady};l4.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=Ph(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])};d4.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 Yh=d4;var VQt=x(T(),1);var TQt=x(T(),1);var bQt=x(T(),1);var Q4t=x(T(),1);function h1(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(h1.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}}});h1.clone=function(e){if(l(e))return new h1(e._format,e._datatype,e._width,e._height,e._buffer)};h1.prototype.clone=function(){return h1.clone(this)};var hG=h1;var dQt=x(T(),1),yue=x(yu(),1);var $4t=x(T(),1);function oke(){return!0}function rke(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=oke}var ue=rke;function xue(){if(!l(tc._canTransferArrayBuffer)){let e=h4("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return tc._canTransferArrayBuffer=!1,tc._canTransferArrayBuffer}tc._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),tc._canTransferArrayBuffer=s}})}return tc._canTransferArrayBuffer}var m4=new Se;function u4(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 h4(e){let t=new yue.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Vy(e))s=e;else if(!n){let a=en(`${tc._workerModulePrefix}/${i}.js`);Vy(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=u4(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${u4(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return r=u4(a),new Worker(r,o)}if(r=e,n||(r=en(`${tc._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 ske(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 tc(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var ake=(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),m4.raiseEvent(s),i(s)}else m4.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},cke=[];async function lke(e,t,n){let i=await Promise.resolve(xue());l(n)?i||(n.length=0):n=cke;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",ake(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function dke(e,t,n){++e._activeTasks;try{let i=await lke(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}tc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=h4(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return dke(this,e,t)};tc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=h4(this._workerPath),i=await ske(this,e),o=await Promise.resolve(xue()),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};tc.prototype.isDestroyed=function(){return!1};tc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};tc.taskCompletedEvent=m4;tc._defaultWorkerModulePrefix="Workers/";tc._workerModulePrefix=tc._defaultWorkerModulePrefix;tc._canTransferArrayBuffer=void 0;var Qn=tc;function nb(){}nb._transcodeTaskProcessor=new Qn("transcodeKTX2",Number.POSITIVE_INFINITY);nb._readyPromise=void 0;function uke(){let e=nb._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return nb._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});nb._readyPromise=e}nb.transcode=function(e,t){return l(nb._readyPromise)||uke(),nb._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;r0&&(l(t.credit)?t.tileCredits=[new Lt(e.copyrightText)]:t.credit=new Lt(e.copyrightText))}function fke(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 pke(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();hke(i,t)}catch(i){fke(e,i)}}function Vp(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 eo({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}Vp.fromBasemapType=async function(e,t){t=t??B.EMPTY_OBJECT;let n,i,o;switch(e){case vh.SATELLITE:{n=t.token??Tu.defaultAccessToken,i=ve.createIfNeeded(Tu.defaultWorldImageryServer),i.appendForwardSlash();let r=Tu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case vh.OCEANS:{n=t.token??Tu.defaultAccessToken,i=ve.createIfNeeded(Tu.defaultWorldOceanServer),i.appendForwardSlash();let r=Tu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case vh.HILLSHADE:{n=t.token??Tu.defaultAccessToken,i=ve.createIfNeeded(Tu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Tu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;default:}return Vp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Zue(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 Ui?(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(Vp.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}}});Vp.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 Vp(t);i._resource=n;let o=new Sue(t);return(t.usePreCachedTilesIfAvailable??!0)&&await pke(n,o),o.build(i),i};Vp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Vp.prototype.requestImage=function(e,t,n,i){return _u.loadImage(this,Zue(this,e,t,n,i))};Vp.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 Ui)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;y1&&(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 b4[0]=t,e.fromBytes(rb[0],rb[1],rb[2],rb[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=f4(u,d,t+1/3),a=f4(u,d,t),c=f4(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=_ke.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=Zke.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=Rke.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 rb[0]=t,rb[1]=n,rb[2]=i,rb[3]=o,b4[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}},p4,b4,rb;fn.supportsTypedArrays()&&(p4=new ArrayBuffer(4),b4=new Uint32Array(p4),rb=new Uint8Array(p4));var _ke=/^#([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,Zke=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,Rke=/^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 Z8t=x(T(),1);function MD(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}MD.ALL=Object.freeze(new MD({color:new U(0,0,0,0),depth:1,stencil:0}));MD.prototype.execute=function(e,t){e.clear(this,t)};var ui=MD;var K6t=x(T(),1);var Y8t=x(T(),1);var L8t=x(T(),1);var V8t=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|=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)};b1.prototype.isDestroyed=function(){return!1};b1.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var pG=b1;var t6t=x(T(),1);var K8t=x(T(),1);var Xl={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===Xl.RGBA4||e===Xl.RGBA8||e===Xl.RGBA16F||e===Xl.RGBA32F||e===Xl.RGB5_A1||e===Xl.RGB565||e===Xl.DEPTH_COMPONENT16||e===Xl.STENCIL_INDEX8||e===Xl.DEPTH_STENCIL||e===Xl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Xl.RGBA32F:e===ie.HALF_FLOAT_OES?Xl.RGBA16F:Xl.RGBA8}};Object.freeze(Xl);var Nl=Xl;function bG(e){e=e??B.EMPTY_OBJECT;let t=e.context,n=t._gl,i=wt.maximumRenderbufferSize,o=e.format??Nl.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(bG.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});bG.prototype._getRenderbuffer=function(){return this._renderbuffer};bG.prototype.isDestroyed=function(){return!1};bG.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Su=bG;var g6t=x(T(),1);var o6t=x(T(),1);var gG={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};gG.validate=function(e){return e===gG.NEAREST||e===gG.LINEAR};Object.freeze(gG);var qn=gG;var a6t=x(T(),1);var sb={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};sb.validate=function(e){return e===sb.NEAREST||e===sb.LINEAR||e===sb.NEAREST_MIPMAP_NEAREST||e===sb.LINEAR_MIPMAP_NEAREST||e===sb.NEAREST_MIPMAP_LINEAR||e===sb.LINEAR_MIPMAP_LINEAR};Object.freeze(sb);var Ht=sb;var d6t=x(T(),1);var yG={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===yG.CLAMP_TO_EDGE||e===yG.REPEAT||e===yG.MIRRORED_REPEAT}};Object.freeze(yG);var pn=yG;function xG(e){e=e??B.EMPTY_OBJECT;let{wrapR:t=pn.CLAMP_TO_EDGE,wrapS:n=pn.CLAMP_TO_EDGE,wrapT:i=pn.CLAMP_TO_EDGE,minificationFilter:o=Ht.LINEAR,magnificationFilter:r=qn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=s}Object.defineProperties(xG.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}}});xG.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};xG.NEAREST=Object.freeze(new xG({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:qn.NEAREST}));var Ot=xG;var X6t=x(T(),1);var x6t=x(T(),1);function Cke(){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 $n=Cke;var S6t=x(T(),1);var TG={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===TG.DONT_CARE||e===TG.FASTEST||e===TG.NICEST}};Object.freeze(TG);var _m=TG;function Sm(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 Ot}=e,{width:c,height:d}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(d)||(d=n.videoHeight??n.naturalHeight??n.height));let u=e.preMultiplyAlpha||i===Qe.RGB||i===Qe.LUMINANCE,m=Qe.toInternalFormat(i,o,t),p=Qe.isCompressedFormat(m),b=t._gl,f=p?Qe.compressedTextureSizeInBytes(i,c,d):Qe.textureSizeInBytes(i,o,c,d);this._id=e.id??$n(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=b.TEXTURE_2D,this._texture=b.createTexture(),this._internalFormat=m,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._dimensions=new k(c,d),this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Lue(this,a),b.activeTexture(b.TEXTURE0),b.bindTexture(this._textureTarget,this._texture),l(n)?(s?b.pixelStorei(b.UNPACK_COLORSPACE_CONVERSION_WEBGL,b.NONE):b.pixelStorei(b.UNPACK_COLORSPACE_CONVERSION_WEBGL,b.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?Qe.isCompressedFormat(m)?Vke(this,n):Eue(this,n):l(n.framebuffer)?Ake(this,n):Aue(this,n),this._initialized=!0):Gue(this),b.bindTexture(this._textureTarget,null)}function Vke(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,d=a;for(let u=0;u1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});fa.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])};fa.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=Nl.getColorFormat(o);this._colorRenderbuffers[s]=new Su({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:Ot.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Su({context:e,width:t,height:n,format:Nl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Su({context:e,width:t,height:n,format:Nl.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:Ot.NEAREST}):this._depthRenderbuffer=new Su({context:e,width:t,height:n,format:Nl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new pG({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 hs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};fa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};fa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};fa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};fa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};fa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};fa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};fa.prototype.getDepthTexture=function(){return this._depthTexture};fa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};fa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};fa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};fa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};fa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};fa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};fa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};fa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};fa.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n 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 Fke(e,t){vue(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r 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.`;y4=new Lt(t,!0)}return y4}};var Ld=UD;function Jc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Ike};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 x4.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)&&(Jc.prototype=Object.create(ve.prototype),Jc.prototype.constructor=Jc);Jc.fromAssetId=function(e,t){let n=Jc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Jc(i,n)})};Object.defineProperties(Jc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Jc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Jc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Lt.getIonCredit),i=Ld.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Lt.clone(i)),n};Jc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(Jc.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};Jc.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)};Jc.prototype._makeRequest=function(e){return this._isExternal||new x4.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(e.headers=T4(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,ve.prototype._makeRequest.call(this,e))};Jc._createEndpointResource=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.server??Ld.defaultServer,i=t.accessToken??Ld.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=T4(o.headers),n.getDerivedResource(o)};function T4(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}Jc._addClientHeaders=T4;function Ike(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 kr=Jc;var X7t=x(T(),1);var Iue=/{[^}]+}/g,Pue={x:Yke,y:wke,z:Dke,s:Oke,reverseX:Mke,reverseY:kke,reverseZ:Uke,westDegrees:Bke,southDegrees:zke,eastDegrees:Hke,northDegrees:Kke,westProjected:Jke,southProjected:jke,eastProjected:Qke,northProjected:qke,width:$ke,height:eUe},Pke=It(Pue,{i:tUe,j:nUe,reverseI:iUe,reverseJ:oUe,longitudeDegrees:sUe,latitudeDegrees:aUe,longitudeProjected:cUe,latitudeProjected:lUe,format:uUe});function SG(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 Lr({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(Pue,r),a=It(Pke,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(SG.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}}});SG.prototype.getTileCredits=function(e,t,n){};SG.prototype.requestImage=function(e,t,n,i){return _u.loadImage(this,Xke(this,e,t,n,i))};SG.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=Nke(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 DD=!1,Zu=new re,OD=!1,ZG=new re;function Xke(e,t,n,i,o){DD=!1,OD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(Iue);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 _4=!1,y1=new k,S4=!1;function Nke(e,t,n,i,o,r,s){DD=!1,OD=!1,_4=!1,S4=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(Iue);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 x1(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 Yke(e,t,n,i){return x1(e,"{x}",t)}function Mke(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return x1(e,"{reverseX}",o)}function wke(e,t,n,i){return x1(e,"{y}",n)}function kke(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return x1(e,"{reverseY}",o)}function Uke(e,t,n,i){let o=e.maximumLevel,r=l(o)&&ir[0])};T1.prototype.pickFeatures=function(e,t,n,i,o){};T1.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function VG(e,t,n){return t<=e&&e<=n}function pUe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c=570425344?(t-=ab*2,m=a,d=c,u=0,a=0,c=0,_1._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-=ab,m=d,d=a,u=c,a=0,c=0,_1._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=Wr(i,t,a),t+=a);let b=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=Wr(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,_):(_1._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 EG=_1;var Cqt=x(T(),1);var uqt=x(T(),1);var _n={BYTE:ie.BYTE,UNSIGNED_BYTE:ie.UNSIGNED_BYTE,SHORT:ie.SHORT,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,INT:ie.INT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,DOUBLE:ie.DOUBLE};_n.getSizeInBytes=function(e){switch(e){case _n.BYTE:return Int8Array.BYTES_PER_ELEMENT;case _n.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case _n.SHORT:return Int16Array.BYTES_PER_ELEMENT;case _n.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case _n.INT:return Int32Array.BYTES_PER_ELEMENT;case _n.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case _n.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case _n.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};_n.fromTypedArray=function(e){if(e instanceof Int8Array)return _n.BYTE;if(e instanceof Uint8Array)return _n.UNSIGNED_BYTE;if(e instanceof Int16Array)return _n.SHORT;if(e instanceof Uint16Array)return _n.UNSIGNED_SHORT;if(e instanceof Int32Array)return _n.INT;if(e instanceof Uint32Array)return _n.UNSIGNED_INT;if(e instanceof Float32Array)return _n.FLOAT;if(e instanceof Float64Array)return _n.DOUBLE};_n.validate=function(e){return l(e)&&(e===_n.BYTE||e===_n.UNSIGNED_BYTE||e===_n.SHORT||e===_n.UNSIGNED_SHORT||e===_n.INT||e===_n.UNSIGNED_INT||e===_n.FLOAT||e===_n.DOUBLE)};_n.createTypedArray=function(e,t){switch(e){case _n.BYTE:return new Int8Array(t);case _n.UNSIGNED_BYTE:return new Uint8Array(t);case _n.SHORT:return new Int16Array(t);case _n.UNSIGNED_SHORT:return new Uint16Array(t);case _n.INT:return new Int32Array(t);case _n.UNSIGNED_INT:return new Uint32Array(t);case _n.FLOAT:return new Float32Array(t);case _n.DOUBLE:return new Float64Array(t)}};_n.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/_n.getSizeInBytes(e),e){case _n.BYTE:return new Int8Array(t,n,i);case _n.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case _n.SHORT:return new Int16Array(t,n,i);case _n.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case _n.INT:return new Int32Array(t,n,i);case _n.UNSIGNED_INT:return new Uint32Array(t,n,i);case _n.FLOAT:return new Float32Array(t,n,i);case _n.DOUBLE:return new Float64Array(t,n,i)}};_n.fromName=function(e){switch(e){case"BYTE":return _n.BYTE;case"UNSIGNED_BYTE":return _n.UNSIGNED_BYTE;case"SHORT":return _n.SHORT;case"UNSIGNED_SHORT":return _n.UNSIGNED_SHORT;case"INT":return _n.INT;case"UNSIGNED_INT":return _n.UNSIGNED_INT;case"FLOAT":return _n.FLOAT;case"DOUBLE":return _n.DOUBLE}};_n.dequantize=function(e,t){switch(t){case _n.BYTE:return Math.max(e/127,-1);case _n.UNSIGNED_BYTE:return e/255;case _n.SHORT:return Math.max(e/32767,-1);case _n.UNSIGNED_SHORT:return e/65535;case _n.INT:return Math.max(e/2147483647,-1);case _n.UNSIGNED_INT:return e/4294967295}};Object.freeze(_n);var J=_n;function cb(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=gUe(t),o=e.floatingPointTexture,r=i===Ue.FLOAT&&!o,s=yUe(t,r),a=xUe(s,t,r),c=Math.floor(wt.maximumTextureSize/a),d=Math.min(n,c),u=a*d,m=Math.ceil(n/d),p=1/u,b=p*.5,f=1/m,y=f*.5;this._textureDimensions=new k(u,m),this._textureStep=new ce(p,b,f,y),this._pixelDatatype=r?Ue.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let _=4*u*m;this._batchValues=i===Ue.FLOAT&&!r?new Float32Array(_):new Uint8Array(_),this._batchValuesDirty=!1}Object.defineProperties(cb.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function gUe(e){let t=!1,n=e.length;for(let i=0;in.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};ps.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};ps.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};ps.prototype.clone=function(e){return ps.clone(this,e)};ps.prototype.intersect=function(e){return ps.intersect(this,e)};ps.prototype.equals=function(e){return ps.equals(this,e)};var nt=ps;var o$t=x(T(),1);var GG={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};GG.validate=function(e){return e===GG.CLOCKWISE||e===GG.COUNTER_CLOCKWISE};Object.freeze(GG);var Qs=GG;var s$t=x(T(),1);function Uue(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i{let t=new Image;t.onload=function(){Pl._result=t.width>0&&t.height>0,e(Pl._result)},t.onerror=function(){Pl._result=!1,e(Pl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Pl._promise};Object.defineProperties(Pl,{initialized:{get:function(){return l(Pl._result)}}});var r1=[];typeof ArrayBuffer<"u"&&(r1.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&r1.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&r1.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&r1.push(BigInt64Array),typeof BigUint64Array<"u"&&r1.push(BigUint64Array));var Tm={isChrome:Ij,chromeVersion:Wwe,isSafari:Gde,safariVersion:vwe,isWebkit:Lde,webkitVersion:Fwe,isEdge:LD,edgeVersion:Iwe,isFirefox:WD,firefoxVersion:Nwe,isWindows:Pwe,isIPadOrIOS:Xwe,hardwareConcurrency:xm.hardwareConcurrency??3,supportsPointerEvents:Ywe,supportsImageRenderingPixelated:Fde,supportsWebP:Pl,imageRenderingValue:Mwe,typedArrayTypes:r1};Tm.supportsBasis=function(e){return Tm.supportsWebAssembly()&&e.context.supportsBasis};Tm.supportsFullscreen=function(){return qr.supportsFullscreen()};Tm.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Tm.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Tm.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Tm.supportsBigInt=function(){return typeof BigInt<"u"};Tm.supportsWebWorkers=function(){return typeof Worker<"u"};Tm.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Tm.supportsWebgl2=function(e){return e.context.webgl2};Tm.supportsEsmWebWorkers=function(){return!WD()||parseInt(Pj)>=114};var fn=Tm;function ft(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var sG=new h;ft.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);sG=h.normalize(e,sG);let r=sG.x*o,s=sG.y*o,a=sG.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 wwe=[1,2,0],kwe=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=wwe,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=kwe;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 Ide=new ft,Pde=new ft,Xj=new ft,Xde=new ft;ft.fromHeadingPitchRoll=function(e,t){return Xde=ft.fromAxisAngle(h.UNIT_X,e.roll,Ide),Xj=ft.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ft.multiply(Xj,Xde,Xj),Pde=ft.fromAxisAngle(h.UNIT_Z,-e.heading,Ide),ft.multiply(Pde,t,t)};var vD=new h,Nj=new h,Ph=new ft,Nde=new ft,FD=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,FD),ft.conjugate(FD,FD);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)eb[b]=(ID[b]*c-PD[b])*s,tb[b]=(ID[b]*d-PD[b])*s;let u=r*n*(1+eb[0]*(1+eb[1]*(1+eb[2]*(1+eb[3]*(1+eb[4]*(1+eb[5]*(1+eb[6]*(1+eb[7])))))))),m=a*(1+tb[0]*(1+tb[1]*(1+tb[2]*(1+tb[3]*(1+tb[4]*(1+tb[5]*(1+tb[6]*(1+tb[7])))))))),p=ft.multiplyByScalar(e,m,Owe);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,aG),a=ft.fastSlerp(n,i,o,s1);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={},kj={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"}},a1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Uj={},Vd={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Ay=new h,Gy=new h,Ly=new h;Ci.localFrameToFixedFrameGenerator=function(e,t){if(!kj.hasOwnProperty(e)||!kj[e].hasOwnProperty(t))throw new ge("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=kj[e][t],i,o=e+t;return l(Uj[o])?i=Uj[o]:(i=function(r,s,a){if(l(a)||(a=new P),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(a1[e],0,Ay),h.unpack(a1[t],0,Gy),h.unpack(a1[n],0,Ly);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(a1[e],0,Ay),e!=="east"&&e!=="west"&&h.multiplyByScalar(Ay,c,Ay),h.unpack(a1[t],0,Gy),t!=="east"&&t!=="west"&&h.multiplyByScalar(Gy,c,Gy),h.unpack(a1[n],0,Ly),n!=="east"&&n!=="west"&&h.multiplyByScalar(Ly,c,Ly)}else{s=s??ne.default,s.geodeticSurfaceNormal(r,Vd.up);let c=Vd.up,d=Vd.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,Vd.east),h.cross(c,d,Vd.north),h.multiplyByScalar(Vd.up,-1,Vd.down),h.multiplyByScalar(Vd.east,-1,Vd.west),h.multiplyByScalar(Vd.north,-1,Vd.south),Ay=Vd[e],Gy=Vd[t],Ly=Vd[n]}return a[0]=Ay.x,a[1]=Ay.y,a[2]=Ay.z,a[3]=0,a[4]=Gy.x,a[5]=Gy.y,a[6]=Gy.z,a[7]=0,a[8]=Ly.x,a[9]=Ly.y,a[10]=Ly.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},Uj[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 Bwe=new Ne,zwe=new h(1,1,1),Hwe=new P;Ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ci.eastNorthUpToFixedFrame;let r=Ne.fromHeadingPitchRoll(t,Bwe),s=P.fromTranslationQuaternionRotationScale(h.ZERO,r,zwe,Hwe);return o=i(e,n,o),P.multiply(o,s,o)};var Kwe=new P,Jwe=new q;Ci.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ci.headingPitchRollToFixedFrame(e,t,n,i,Kwe),s=P.getMatrix3(r,Jwe);return Ne.fromRotationMatrix(s,o)};var jwe=new h(1,1,1),Qwe=new h,wde=new P,qwe=new P,$we=new q,e9e=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,Qwe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=P.inverseTransformation(n(o,t,wde),wde),s=P.setScale(e,jwe,qwe);s=P.setTranslation(s,h.ZERO,s),r=P.multiply(r,s,r);let a=Ne.fromRotationMatrix(P.getMatrix3(r,$we),e9e);return a=Ne.normalize(a,a),Cc.fromQuaternion(a,i)};var t9e=6*3600+2460+50.54841,n9e=8640184812866e-6,i9e=.093104,o9e=-62e-7,r9e=11772758384668e-32,s9e=72921158553e-15,a9e=W.TWO_PI/86400,XD=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){XD=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),XD);let n=XD.dayNumber,i=XD.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/wn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/wn.DAYS_PER_JULIAN_CENTURY;let a=(t9e+o*(n9e+o*(i9e+o*o9e)))*a9e%W.TWO_PI,c=s9e+r9e*(n-24515455e-1),d=(i+wn.SECONDS_PER_DAY*.5)%wn.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 iG;Ci.earthOrientationParameters=nG.NONE;var Bj=32.184,c9e=2451545;Ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Bj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Bj;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 l9e=32.184,d9e=2451545,ND=new Cc,u9e=new q,m9e=new Q;Ci.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Q.addSeconds(e,l9e,m9e),i=Q.totalDays(n)-d9e,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 ND.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),ND.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),ND.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(ND,u9e,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 h9e=new o_(0,0,0),f9e=new Zy(0,0,0,0,0,0),Dj=new q,Oj=new q;Ci.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Ci.earthOrientationParameters.compute(e,f9e);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+Bj,r=Ci.iau2006XysData.computeXysRadians(i,o,h9e);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=Dj;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,Oj),m=q.multiply(d,u,Dj),p=e.dayNumber,b=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,y=b/wn.SECONDS_PER_DAY,_=.779057273264+y+.00273781191135448*(f+y);_=_%1*W.TWO_PI;let S=q.fromRotationZ(_,Oj),Z=q.multiply(m,S,Dj),R=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),A=Math.sin(n.yPoleWander),L=i-c9e+o/wn.SECONDS_PER_DAY;L/=36525;let F=-47e-6*L*W.RADIANS_PER_DEGREE/3600,I=Math.cos(F),N=Math.sin(F),g=Oj;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 p9e=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=p9e;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 b9e=new h,g9e=new h,y9e=new h;Ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ne.default).geodeticSurfaceNormal(e,b9e),r=h.cross(t,o,g9e);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,y9e);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 kde=new pe,zj=new h,x9e=new h,T9e=new q,Hj=new P,Ude=new P;Ci.basisTo2D=function(e,t,n){let i=P.getTranslation(t,x9e),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,zj);else{let u=o.cartesianToCartographic(i,kde);r=e.project(u,zj),h.fromElements(r.z,r.x,r.y,r)}let s=Ci.eastNorthUpToFixedFrame(i,o,Hj),a=P.inverseTransformation(s,Ude),c=P.getMatrix3(t,T9e),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,Hj),r=P.inverseTransformation(o,Ude),s=i.cartesianToCartographic(t,kde),a=e.project(s,zj);h.fromElements(a.z,a.x,a.y,a);let c=P.fromTranslation(a,Hj);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,r,n),P.multiply(c,n,n),n};var _t=Ci;var c1=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,_9e),a=P.multiplyByPointAsVector(s,h.UNIT_X,S9e);h.normalize(a,a);let c=P.multiplyByPointAsVector(s,h.UNIT_Y,Z9e);h.normalize(c,c),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,C9e),u=h.negate(a,R9e),m=Kj,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=V9e;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}};c1.packedLength=4;var _9e=new P,S9e=new h,Z9e=new h,R9e=new h,C9e=new h,Kj=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 l4t=x(T(),1);function Jj(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 Qj[0]=t,e.fromBytes(nb[0],nb[1],nb[2],nb[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=Jj(u,d,t+1/3),a=Jj(u,d,t),c=Jj(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=G9e.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=L9e.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=W9e.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=v9e.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 nb[0]=t,nb[1]=n,nb[2]=i,nb[3]=o,Qj[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}},jj,Qj,nb;fn.supportsTypedArrays()&&(jj=new ArrayBuffer(4),Qj=new Uint32Array(jj),nb=new Uint8Array(jj));var G9e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,L9e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,W9e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,v9e=/^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 u4t=x(T(),1);function F9e(){return!0}function I9e(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=F9e}var ue=I9e;var f4t=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 g4t=x(T(),1);function _m(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}_m.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 _m(e.near,e.nearValue,e.far,e.farValue)};_m.packedLength=4;_m.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};_m.unpack=function(e,t,n){return t=t??0,l(n)||(n=new _m),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};_m.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};_m.prototype.clone=function(e){return _m.clone(this,e)};_m.prototype.equals=function(e){return _m.equals(this,e)};var Kt=_m;var x4t=x(T(),1),Wy={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(Wy);var He=Wy;function fs(e){return e===Wy.CLAMP_TO_GROUND||e===Wy.CLAMP_TO_3D_TILE||e===Wy.CLAMP_TO_TERRAIN}function vy(e){return e===Wy.RELATIVE_TO_GROUND||e===Wy.RELATIVE_TO_3D_TILE||e===Wy.RELATIVE_TO_TERRAIN}var _4t=x(T(),1),Ode={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Ode);var Ui=Ode;var Z4t=x(T(),1),Bde={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Bde);var Bn=Bde;var C4t=x(T(),1),P9e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Wt=P9e;var G4t=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;iX9e&&(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=N9e;var k4t=x(T(),1);var Y9e=new pe;function M9e(e,t,n,i,o){let r=i.cartesianToCartographic(e,Y9e);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=ib(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};Fy.prototype.isDestroyed=function(){return!1};Fy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Fy.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 Hde(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 Hde(r)):(qj(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],qj(s.get(r.id),r,a),s.remove(r.id)};function qj(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var lG=Fy;var eZn=x(T(),1);var C8t=x(T(),1);var RQt=x(T(),1);var uQt=x(T(),1);function ske(e,t){this.start=e??0,this.stop=t??0}var Ns=ske;var YD=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],r4),o=h.clone(i,$j),r=h.clone(i,e4),s=h.clone(i,t4),a=h.clone(i,n4),c=h.clone(i,i4),d=h.clone(i,o4),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=s4;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=a4;E.x=o.x,E.y=r.y,E.z=s.z;let A=c4;A.x=a.x,A.y=c.y,A.z=d.z;let L=h.midpoint(E,A,l4),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=s4;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=a4;L.x=s.x,L.y=a.y,L.z=c.z;let F=c4;F.x=d.x,F.y=u.y,F.z=m.z;let I=h.midpoint(L,F,l4),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=s4;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=a4;A.x=r.x,A.y=s.y,A.z=a.z;let L=c4;L.x=c.x,L.y=d.y,L.z=u.z;let F=h.midpoint(A,L,l4),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,gke);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,yke));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:s czm_epsilon7 ? hsb.z + hsbShift.z : 0.0; -} else { -hsb.z = hsb.z + hsbShift.z; +`;var H6t=x(T(),1);var X6t=x(T(),1);var G6t=x(T(),1);var hue={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX};Object.freeze(hue);var Ec=hue;var v6t=x(T(),1);var fue={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(fue);var $o=fue;var pue={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(pue);var on=pue;var M6t=x(T(),1);var bue={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK};Object.freeze(bue);var Di=bue;function u1(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(u1.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}}});u1.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(` +`)};u1.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};u1.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};u1.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=u1;var xnn=x(T(),1);var J6t=x(T(),1);function Hke(){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=Hke;var x7t=x(T(),1);var p7t=x(T(),1);var q6t=x(T(),1);function m1(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(m1.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}}});m1.clone=function(e){if(l(e))return new m1(e._format,e._datatype,e._width,e._height,e._buffer)};m1.prototype.clone=function(){return m1.clone(this)};var yG=m1;var l7t=x(T(),1),gue=x(bu(),1);function yue(){if(!l(nc._canTransferArrayBuffer)){let e=b4("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 p4=new Se;function f4(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 b4(e){let t=new gue.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Vy(e))s=e;else if(!n){let a=en(`${nc._workerModulePrefix}/${i}.js`);Vy(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=f4(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${f4(CESIUM_WORKERS)}"); + CesiumWorkers["${i}"](); + `;return r=f4(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 Kke(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 Jke=(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),p4.raiseEvent(s),i(s)}else p4.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},jke=[];async function Qke(e,t,n){let i=await Promise.resolve(yue());l(n)?i||(n.length=0):n=jke;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",Jke(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function qke(e,t,n){++e._activeTasks;try{let i=await Qke(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=b4(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return qke(this,e,t)};nc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=b4(this._workerPath),i=await Kke(this,e),o=await Promise.resolve(yue()),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(),ue(this)};nc.taskCompletedEvent=p4;nc._defaultWorkerModulePrefix="Workers/";nc._workerModulePrefix=nc._defaultWorkerModulePrefix;nc._canTransferArrayBuffer=void 0;var $n=nc;function ob(){}ob._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);ob._readyPromise=void 0;function $ke(){let e=ob._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return ob._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});ob._readyPromise=e}ob.transcode=function(e,t){return l(ob._readyPromise)||$ke(),ob._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 k7t=x(T(),1);var Zue=new h,Rue=new h,Cue=new h;function tUe(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,Zue),s=h.subtract(i,t,Rue),a=h.subtract(e,t,Cue),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,Zue),s=k.subtract(i,t,Rue),a=k.subtract(e,t,Cue),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 r_=tUe;var B7t=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 rb={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,rb),n.x=rb.high,i.x=rb.low,Vp.encode(e.y,rb),n.y=rb.high,i.y=rb.low,Vp.encode(e.z,rb),n.z=rb.high,i.z=rb.low,t};var T4=new Vp;Vp.writeElements=function(e,t,n){Vp.fromCartesian(e,T4);let i=T4.high,o=T4.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 j7t=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 Sqt=x(T(),1);var $7t=x(T(),1);var _4={};_4.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Vue(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 Xl=_4;var aqt=x(T(),1);var nqt=x(T(),1);var Z4={};Z4.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 S4(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,M=-g*X-V*v,O=g*v,w=(s*M-r*O)/(-r*M+s*D);return G<=w?G<=Y?w<=Y?[G,w,Y]:[G,Y,w]:[Y,G,w]:G<=Y?[w,G,Y]:w<=Y?[w,Y,G]:[Y,w,G]}Z4.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Xl.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=Xl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return S4(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):S4(e,t,0,i);if(i===0)return o=Xl.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 S4(e,t,n,i)};var s_=Z4;var R4={};R4.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 Mh(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=s_.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=Xl.computeRealRoots(1,m,p),y=Xl.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,Aue),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,Aue),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 oUe=new gn;rr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=oUe;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 rUe(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 cUe=new h,lUe=new h;rr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,cUe),o=h.multiplyComponents(n,e.direction,lUe),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 E4=new h,Gue=new h,Lue=new h,kD=new h,hUe=new h,fUe=new q,pUe=new q,bUe=new q,gUe=new q,yUe=new q,Wue=new q,vue=new q,Fue=new h,xUe=new h,TUe=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,E4);if(h.dot(i,A)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,E4),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,kD),c=h.normalize(h.cross(a,s,Gue),Gue),d=h.normalize(h.cross(s,c,Lue),Lue),u=fUe;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,pUe),p=q.fromScale(t.radii,bUe),b=q.fromScale(t.oneOverRadii,gUe),f=yUe;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,Wue),f,Wue),_=q.multiply(q.multiply(y,p,vue),u,vue),S=q.multiplyByVector(y,n,hUe),Z=rr.quadraticVectorExpression(_,h.negate(S,E4),0,0,1),R,C,E=Z.length;if(E>0){let A=h.clone(h.ZERO,xUe),L=Number.NEGATIVE_INFINITY;for(let I=0;IL&&(L=g,A=h.clone(R,A))}let F=t.cartesianToCartographic(A,TUe);return L=W.clamp(L,0,1),C=h.magnitude(h.subtract(A,n,kD))*Math.sqrt(1-L*L),C=o?-C:C,F.height=C,t.cartographicToCartesian(F,new h)}};var _Ue=new h;rr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,_Ue),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 xi=rr;var Aqt=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 SUe=new h;Fa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,SUe),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 ZUe=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,ZUe);return h.subtract(t,o,n)};var RUe=new P,CUe=new ce,VUe=new h;Fa.transform=function(e,t,n){let i=e.normal,o=e.distance,r=P.inverseTranspose(t,RUe),s=ce.fromElements(i.x,i.y,i.z,o,CUe);s=P.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,VUe);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 vqt=x(T(),1);var A4={};A4.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)};A4.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 M=-1,O,w=-1,z=0;for(;zw||w===-1)&&(w=O,M=K)),++z}return M===-1?r(v,Y,g,D):M}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 ZG=A4;var Nl={};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 EUe(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=ZG.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Xue(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 LUe(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=Xue(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=Xue(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 Nue=new h,WUe=new pe;Nl.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 me(y,_):void 0})}Nl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(v4(t,"geometry")),n.length>0&&(o.push(v4(n,"westHemisphereGeometry")),o.push(v4(n,"eastHemisphereGeometry"))),o};var Zm=new h,RG=new h,h1=new h,f1=new h;Nl.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;Iy(e,a),Iy(t,a),Iy(n,a)}var kue=new h;function Rm(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,kue),e.y/(e.y-t.y),kue),n),h.clone(n,i),Iy(n,!0),Iy(i,!1)}var c_=new h,l_=new h,d_=new h,u_=new h,F4={positions:new Array(7),indices:new Array(9)};function OUe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;DUe(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=F4.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Rm(e,t,c_,d_),Rm(e,n,l_,u_),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Rm(t,n,c_,d_),Rm(t,e,l_,u_),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Rm(n,e,c_,d_),Rm(n,t,l_,u_),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||(Rm(n,e,c_,d_),Rm(n,t,l_,u_),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Rm(t,n,c_,d_),Rm(t,e,l_,u_),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Rm(e,t,c_,d_),Rm(e,n,l_,u_),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=F4.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=c_,c[4]=l_,c[5]=d_,c[6]=u_,c.length=7),F4}function Uue(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=me.fromVertices(n.position.values)),e}function b1(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 N4(e,t,n){let i=l(e.geometry.boundingSphere);t=Uue(t,i),n=Uue(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 Y4(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 BUe=Y4(ce,4),HD=Y4(h,3),Kue=Y4(k,2),zUe=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},VG=new h,I4=new h,P4=new h,HUe=new h;function BD(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,VG),S=h.fromArray(o,t*3,I4),Z=h.fromArray(o,n*3,P4),R=r_(i,_,S,Z,HUe);if(l(R)){if(l(r)&&HD(e,t,n,R,r,m.normal.values,y,!0),l(d)){let C=h.fromArray(d,e*3,VG),E=h.fromArray(d,t*3,I4),A=h.fromArray(d,n*3,P4);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=VG,L.x=0,L.y=0,L.z=0),h.pack(L,m.extrudeDirection.values,y*3)}if(l(u)&&zUe(e,t,n,R,u,m.applyOffset.values,y),l(s)&&HD(e,t,n,R,s,m.tangent.values,y,!0),l(a)&&HD(e,t,n,R,a,m.bitangent.values,y,!0),l(c)&&Kue(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,Que);(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,X4);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||me.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==Sm.NONE)switch(t.geometryType){case Sm.POLYLINES:i5e(e);break;case Sm.TRIANGLES:Due(e);break;case Sm.LINES:Oue(e);break}else UUe(t),t.primitiveType===Ie.TRIANGLES?Due(e):t.primitiveType===Ie.LINES&&Oue(e);return e};var zn=Nl;var d$t=x(T(),1);var s$t=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 $ue(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),$ue(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 que(e){return e.values.length/e.componentsPerAttribute}function s5e(e){return J.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function a5e(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=que(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 c5e(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 l5e(e,t){let n=e._attributes,i=n.length;for(let o=0;o maxHeight) { +material.diffuse = vec3(0.0); +material.alpha = 0.0; +return material; } -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 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; } -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); +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 Rtn=x(T(),1),IL=`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 Vtn=x(T(),1),PL=`uniform vec4 shadowMap_cascadeDistances; -float czm_cascadeDistance(vec4 weights) -{ -return dot(shadowMap_cascadeDistances, weights); +color.rgb = czm_gammaCorrect(color.rgb); +material.diffuse = color.rgb; +material.alpha = color.a; +return material; } -`;var Atn=x(T(),1),XL=`uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +`;var ctn=x(T(),1),YG=`uniform vec4 color; +uniform float spacing; +uniform float width; +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 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 Ltn=x(T(),1),NL=`uniform vec4 shadowMap_cascadeSplits[2]; -vec4 czm_cascadeWeights(float depthEye) +`;var dtn=x(T(),1),MG=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; +czm_material czm_getMaterial(czm_materialInput materialInput) { -vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); -vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); -return near * far; +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 vtn=x(T(),1),YL=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var mtn=x(T(),1),wG=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; +float getTime(float t, float coord) { -vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; -return vec4(p, 1.0); -} -`;var Itn=x(T(),1),ML=`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 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); } -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); +return clamp(q, 0.0, 1.0); } -`;var Xtn=x(T(),1),wL=`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 -); +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 Ytn=x(T(),1),kL=`vec4 czm_computePosition(); -`;var wtn=x(T(),1),UL=`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; +`;var ftn=x(T(),1),kG=`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 +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; } -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; +`;var btn=x(T(),1),UG=`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; } -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 ytn=x(T(),1),DG=`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; } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +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 +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); } -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); +else +{ +float d1 = czm_infinity; +if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +{ +d1 = abs(st.s - base); } -rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = czm_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); +float d2 = abs(st.t - ptOnUpperLine); +float d3 = abs(st.t - ptOnLowerLine); +dist = min(min(d1, d2), d3); +} +vec4 outsideColor = vec4(0.0); +vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); +vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); +outColor = czm_gammaCorrect(outColor); +material.diffuse = outColor.rgb; +material.alpha = outColor.a; +return material; +} +`;var Ttn=x(T(),1),OG=`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 Utn=x(T(),1),DL=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) +czm_material czm_getMaterial(czm_materialInput materialInput) { -return vec2(textureTransform * vec3(texCoord, 1.0)); +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; +} +fragColor = czm_gammaCorrect(fragColor); +material.emission = fragColor.rgb; +material.alpha = fragColor.a; +return material; } -`;var Otn=x(T(),1),OL=`vec2 cordic(float angle) +`;var Stn=x(T(),1),BG=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; +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); +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)); } -vec2 czm_cosineAndSine(float angle) -{ -if (angle < -czm_piOverTwo || angle > czm_piOverTwo) -{ -if (angle < 0.0) +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; +} +`;var Rtn=x(T(),1),zG=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; +in float v_width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle + czm_pi); +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; } -else +`;var Vtn=x(T(),1),HG=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle - czm_pi); +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 Atn=x(T(),1),KG=`uniform sampler2D image; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); +rampColor = czm_gammaCorrect(rampColor); +material.diffuse = rampColor.rgb; +material.alpha = rampColor.a; +return material; } -else +`;var Ltn=x(T(),1),JG=`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_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; } +`;var vtn=x(T(),1),jG=`uniform vec4 waterColor; +uniform vec4 landColor; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); +outColor = czm_gammaCorrect(outColor); +material.diffuse = outColor.rgb; +material.alpha = outColor.a; +return material; } -`;var ztn=x(T(),1),BL=`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 Itn=x(T(),1),QG=`uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +float time = czm_frameNumber * animationSpeed; +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 Ktn=x(T(),1),zL=`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,p5e(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(ame(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function ame(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];ame(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 _5e(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&&T5e(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 jtn=x(T(),1),HL=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif -vec4 czm_depthClamp(vec4 coords) +`}}var sme={mat2:Ji,mat3:q,mat4:P},S5e=/\.ktx2$/i;function Z5e(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}cme(n,e)}}}function cme(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 S5e.test(o.url)?a=Ad(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 R5e(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),lme(t,e)}}function lme(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 C5e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&dme(e,n)}function dme(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=V5e(o),s;if(r==="channels")s=qG(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;A5e(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},dme(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=qG(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Z5e(t)),e._initializationPromises.push(cme(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(R5e(t)),e._initializationPromises.push(lme(e,t));else if(r.indexOf("mat")!==-1){let d=new sme[r];e._uniforms[c]=function(){return sme[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function V5e(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 E5e(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++}`;qG(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=qG(e,i,a)}}function qG(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 A5e(e,t,n){return qG(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:IG},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:UG},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:kG},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:JG},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:PG},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:XG},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:QG},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:HG},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:wG},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:DG},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:OG},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:BG},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:zG},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:YG},translucent:!1});rt.ElevationRampType="ElevationRamp";rt._materialCache.addMaterial(rt.ElevationRampType,{fabric:{type:rt.ElevationRampType,uniforms:{image:rt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:MG},translucent:!1});rt.SlopeRampMaterialType="SlopeRamp";rt._materialCache.addMaterial(rt.SlopeRampMaterialType,{fabric:{type:rt.SlopeRampMaterialType,uniforms:{image:rt.DefaultImageId},source:KG},translucent:!1});rt.AspectRampMaterialType="AspectRamp";rt._materialCache.addMaterial(rt.AspectRampMaterialType,{fabric:{type:rt.AspectRampMaterialType,uniforms:{image:rt.DefaultImageId},source:FG},translucent:!1});rt.ElevationBandType="ElevationBand";rt._materialCache.addMaterial(rt.ElevationBandType,{fabric:{type:rt.ElevationBandType,uniforms:{heights:rt.DefaultImageId,colors:rt.DefaultImageId},source:NG},translucent:!0});rt.WaterMaskType="WaterMask";rt._materialCache.addMaterial(rt.WaterMaskType,{fabric:{type:rt.WaterMaskType,source:jG,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var eo=rt;function h_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??h_.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(h_.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}}});h_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;h_.prototype.isTranslucent=Go.prototype.isTranslucent;h_.prototype.getRenderState=Go.prototype.getRenderState;h_.MaterialSupport={BASIC:Object.freeze({vertexFormat:Me.POSITION_AND_NORMAL,vertexShaderSource:pG,fragmentShaderSource:fG}),TEXTURED:Object.freeze({vertexFormat:Me.POSITION_NORMAL_AND_ST,vertexShaderSource:gG,fragmentShaderSource:bG}),ALL:Object.freeze({vertexFormat:Me.ALL,vertexShaderSource:hG,fragmentShaderSource:mG})};var Co=h_;var Jnn=x(T(),1);var Inn=x(T(),1),$G=`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; +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 qtn=x(T(),1),KL=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) +`;var Xnn=x(T(),1),eL=`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() { -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); +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var enn=x(T(),1),JL=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var Ynn=x(T(),1),f_=`in vec4 v_color; +void main() { -vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; -return (dot(scaled, scaled) <= 1.0); +out_FragColor = czm_gammaCorrect(v_color); } -`;var nnn=x(T(),1),jL=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) +`;var wnn=x(T(),1),tL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() { -return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;var onn=x(T(),1),QL=`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))); +vec4 p = czm_computePosition(); +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -bool czm_equalsEpsilon(float left, float right, float epsilon) { -return (abs(left - right) <= epsilon); +`;function ab(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?tL:eL,r=i?f_:$G,s=i?ab.FLAT_VERTEX_FORMAT:ab.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(ab.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}}});ab.VERTEX_FORMAT=Me.POSITION_AND_NORMAL;ab.FLAT_VERTEX_FORMAT=Me.POSITION_ONLY;ab.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;ab.prototype.isTranslucent=Go.prototype.isTranslucent;ab.prototype.getRenderState=Go.prototype.getRenderState;var Tn=ab;var iin=x(T(),1);function g1(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(g1.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});g1.prototype.getType=function(e){return"Color"};var G5e=new Q;g1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(G5e)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};g1.prototype.equals=function(e){return this===e||e instanceof g1&&j.equals(this._color,e._color)};var Qt=g1;var D0n=x(T(),1);var S0n=x(T(),1);var Rin=x(T(),1);var min=x(T(),1);var D4=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=D4;var ume=new h,mme=new h,hme=new pe,O4=new h,L5e=new h,fme=new me,W5e=new to,nL=[new pe,new pe,new pe,new pe],iL=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=pme(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,hme),ume),t.cartographicToCartesian(re.southwest(e,hme),mme),h.midpoint(mme,ume,O4);let a=t.scaleToGeodeticSurface(O4,L5e);if(l(a)){let c=h.distance(O4,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=pme(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=me.fromRectangle3D(e,t,0);return me.fromRectangle3D(e,t,i,fme),me.union(o,fme,o)};function pme(e){pe.fromRadians(e.east,e.north,0,nL[0]),pe.fromRadians(e.west,e.north,0,nL[1]),pe.fromRadians(e.east,e.south,0,nL[2]),pe.fromRadians(e.west,e.south,0,nL[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=nL[c];if(W5e.positionToTileXY(d,s,iL),c===0)i=iL.x,o=iL.y;else if(i!==iL.x||o!==iL.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 oon=x(T(),1);var Uin=x(T(),1);var Gin=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 B4=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,B4)),this._yAxis=h.fromCartesian4(P.getColumn(n,1,B4));let i=h.fromCartesian4(P.getColumn(n,2,B4));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 v5e=new Tu;Ap.fromPoints=function(e,t){let n=Tu.fromPoints(e,v5e);return new Ap(n.center,t)};var bme=new gn,qD=new h;Ap.prototype.projectPointOntoPlane=function(e,t){let n=bme;n.origin=e,h.normalize(e,n.direction);let i=xi.rayPlane(n,this._plane,qD);if(l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,qD)),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,O5e),G=pe.fromRadians(e.west,e.north,n,B5e),v=pe.fromRadians(e.west,g,n,z5e),X=pe.fromRadians(e.west,e.south,n,H5e),Y=pe.fromRadians(N,e.south,n,K5e),D=i.cartographicToCartesian(V,J5e),M=i.cartographicToCartesian(G,xme),O=i.cartographicToCartesian(v,j5e),w=i.cartographicToCartesian(X,Tme),z=i.cartographicToCartesian(Y,Q5e),K=I.projectPointToNearestOnPlane(D,q5e),te=I.projectPointToNearestOnPlane(M,$5e),H=I.projectPointToNearestOnPlane(O,eDe),$=I.projectPointToNearestOnPlane(w,tDe),ee=I.projectPointToNearestOnPlane(z,nDe);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,M=i.cartographicToCartesian(G,xme),w=i.cartographicToCartesian(X,Tme),d=Math.min(cn.getPointDistance(m,M),cn.getPointDistance(m,w)),u=n,gme(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,yme).longitude,_=h.fromRadians(y,f,n,i,iDe);_.z=0;let Z=Math.abs(_.x)=c?qt.INSIDE:qt.INTERSECTING};var Zme=new h,Rme=new h,Cme=new h,mDe=new h,_me=new h,hDe=new h;ho.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Sme),i=e.halfAxes,o=q.getColumn(i,0,Zme),r=q.getColumn(i,1,Rme),s=q.getColumn(i,2,Cme),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,_me),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,mDe),h.normalize(y,y),_=h.cross(f,y,_me),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=hDe;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 fDe=new h,pDe=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,Zme),d=q.getColumn(a,1,Rme),u=q.getColumn(a,2,Cme),m=h.add(c,d,fDe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,pDe),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 bDe=new h,gDe=new h,yDe=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,bDe),r=q.getColumn(i,1,gDe),s=q.getColumn(i,2,yDe);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 xDe=new q;ho.computeTransformation=function(e,t){l(t)||(t=new P);let n=e.center,i=q.multiplyByUniformScale(e.halfAxes,2,xDe);return P.fromRotationTranslation(i,n,t)};var TDe=new me;ho.isOccluded=function(e,t){let n=me.fromOrientedBoundingBox(e,TDe);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 lon=x(T(),1);var $D={};$D.getHeight=function(e,t,n){return(e-n)*t+n};var _De=new pe;$D.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,_De);if(!l(r))return h.clone(e,o);let s=$D.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var _o=$D;var o0n=x(T(),1);var fon=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},z4=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&&(Py(this,es.CULL,t),this.dirty=!0)}get occlude(){return jc(this,es.OCCLUDE)}set occlude(t){jc(this,es.OCCLUDE)!==t&&(Py(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&&(Py(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&&(Py(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&&(Py(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&&(Py(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&&(Py(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&&(Py(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 Py(e,t,n){n?e._flags|=t:e._flags&=~t}var lt=z4;var bon=x(T(),1),Vme={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(Vme);var Le=Vme;var Gon=x(T(),1);var xon=x(T(),1);var oL={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};oL.validate=function(e){return e===oL.CLOCKWISE||e===oL.COUNTER_CLOCKWISE};Object.freeze(oL);var qs=oL;var _on=x(T(),1);function Eme(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 XDe(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 sme(e,t,n){let i="",o=e.sources;if(l(o))for(let b=0;b0){let o=Math.min(t,wt.maximumTextureSize),r=Math.ceil(t/wt.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(Qc.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}}});Qc.DEFAULT_COLOR_VALUE=U.WHITE;Qc.DEFAULT_SHOW_VALUE=!0;function lme(e){let t=e._textureDimensions;return t.x*t.y*4}function dme(e){if(!l(e._batchValues)){let t=lme(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function ume(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Qc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=ume(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=dme(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Qc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=lme(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${r} -${i5e(i)}${s}`}};function bme(e,t){return e=Je.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function o5e(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};function r5e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===vd.HIGHLIGHT)return 0;if(n===vd.REPLACE)return 1;if(n===vd.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 r5e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Fy={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=s5e(this);for(let d=t;d>>Jt.SKIP_LOD_BIT_SHIFT}function f5e(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 p5e(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(),ue(this)};var wh=jo;function db(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,b5e(this,e.extension,e.binaryBody)}Object.defineProperties(db.prototype,{byteLength:{get:function(){return this._byteLength}}});function b5e(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,m=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??J.UNSIGNED_SHORT,c.type=Dt.SCALAR,r=Zm(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let b;if(l(d)){for(l(d.byteOffset)&&(d.componentType=d.componentType??J.UNSIGNED_SHORT,d.type=Dt.SCALAR,r=Zm(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),b=new Uint16Array(s),m=0,i=0;i0;){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;f{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 ub=kh;var Hcn=x(T(),1),Iy={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(Iy);var He=Iy;function bs(e){return e===Iy.CLAMP_TO_GROUND||e===Iy.CLAMP_TO_3D_TILE||e===Iy.CLAMP_TO_TERRAIN}function Py(e){return e===Iy.RELATIVE_TO_GROUND||e===Iy.RELATIVE_TO_3D_TILE||e===Iy.RELATIVE_TO_TERRAIN}var Jcn=x(T(),1),xme={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(xme);var Oi=xme;var Qcn=x(T(),1),mv={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};mv.getMorphTime=function(e){return e===mv.SCENE3D?1:e===mv.MORPHING?void 0:0};Object.freeze(mv);var se=mv;var Mln=x(T(),1);var Cln=x(T(),1);var xln=x(T(),1);var dln=x(T(),1);var iln=x(T(),1);function Pa(e,t){this.normal=h.clone(e),this.distance=t}Pa.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Pa(t,i)};var V5e=new h;Pa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,V5e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Pa(n,i)};Pa.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var E5e=new h;Pa.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Pa.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,E5e);return h.subtract(t,o,n)};var A5e=new P,G5e=new ce,L5e=new h;Pa.transform=function(e,t,n){let i=e.normal,o=e.distance,r=P.inverseTranspose(t,A5e),s=ce.fromElements(i.x,i.y,i.z,o,G5e);s=P.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,L5e);return s=ce.divideByScalar(s,h.magnitude(a),s),Pa.fromCartesian4(s,n)};Pa.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Pa(e.normal,e.distance)};Pa.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Pa.ORIGIN_XY_PLANE=Object.freeze(new Pa(h.UNIT_Z,0));Pa.ORIGIN_YZ_PLANE=Object.freeze(new Pa(h.UNIT_X,0));Pa.ORIGIN_ZX_PLANE=Object.freeze(new Pa(h.UNIT_Y,0));var cn=Pa;function Cm(e){this.planes=e??[]}var hv=[new h,new h,new h];h.clone(h.UNIT_X,hv[0]);h.clone(h.UNIT_Y,hv[1]);h.clone(h.UNIT_Z,hv[2]);var Xy=new h,W5e=new h,Tme=new cn(new h(1,0,0),0);function _me(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Cm.fromBoundingSphere=function(e,t){l(t)||(t=new Cm);let n=hv.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a=s.clientWidth)d=!0;else{if(R.x>s.clientWidth*.5){a.width=R.x,c.frustum.right=p.x-S,qc=fv(r,n,c,qc),Ec.clipToGLWindowCoordinates(a,qc,G4),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,qc=fv(r,n,c,qc),Ec.clipToGLWindowCoordinates(a,qc,L4)}else{a.x+=R.x,a.width-=R.x,c.frustum.left=-p.x-S,qc=fv(r,n,c,qc),Ec.clipToGLWindowCoordinates(a,qc,G4),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,qc=fv(r,n,c,qc),Ec.clipToGLWindowCoordinates(a,qc,L4)}h.clone(b,c.position),c.frustum=f.clone(),i=k.clone(G4,i),(i.x<0||i.x>s.clientWidth)&&(i.x=L4.x)}}if(o.mode!==se.SCENE2D||d){if(qc=fv(r,n,c,qc),qc.z<0&&!(c.frustum instanceof bn)&&!(c.frustum instanceof gs))return;i=Ec.clipToGLWindowCoordinates(a,qc,i)}return i.y=s.clientHeight-i.y,i};Ec.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ec.worldToWindowCoordinates(e,t,n),!!l(n))return Ec.transformWindowToDrawingBuffer(e,n,n)};var mb=new h,w5e=new pe;Ec.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,w5e);if(!l(r))return;if(o.project(r,mb),i===se.COLUMBUS_VIEW)return h.fromElements(mb.z,mb.x,mb.y,n);if(i===se.SCENE2D)return h.fromElements(0,mb.x,mb.y,n);let s=e.morphTime;return h.fromElements(W.lerp(mb.z,t.x,s),W.lerp(mb.x,t.y,s),W.lerp(mb.y,t.z,s),n)};var Cme=new h,Vme=new h,Eme=new P;Ec.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Cme),P.computeViewportTransformation(e,0,1,Eme),P.multiplyByPoint(Eme,Cme,Vme),k.fromCartesian3(Vme,n)};Ec.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 k5e=new ce,Ame=new ce;Ec.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,k5e);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,Ame);let b=1/m.w;h.multiplyByScalar(m,b,m)}else{let b=p.offCenterFrustum;l(b)&&(p=b),m=Ame,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 ho=Ec;var kln=x(T(),1),Gme={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Gme);var Bn=Gme;var Dln=x(T(),1),Lme={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(Lme);var Ur=Lme;function Pi(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=Bt.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??Oi.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 ub(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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!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??Ur.NONE,this._positionFromParent=!1}var Wme=Pi.SHOW_INDEX=0,jD=Pi.POSITION_INDEX=1,wme=Pi.PIXEL_OFFSET_INDEX=2,U5e=Pi.EYE_OFFSET_INDEX=3,D5e=Pi.HORIZONTAL_ORIGIN_INDEX=4,O5e=Pi.VERTICAL_ORIGIN_INDEX=5,B5e=Pi.SCALE_INDEX=6,vme=Pi.IMAGE_INDEX_INDEX=7,Fme=Pi.COLOR_INDEX=8,z5e=Pi.ROTATION_INDEX=9,H5e=Pi.ALIGNED_AXIS_INDEX=10,K5e=Pi.SCALE_BY_DISTANCE_INDEX=11,J5e=Pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,j5e=Pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Q5e=Pi.DISTANCE_DISPLAY_CONDITION=14,q5e=Pi.DISABLE_DEPTH_DISTANCE=15;Pi.TEXTURE_COORDINATE_BOUNDS=16;var Ime=Pi.SDF_INDEX=17,$5e=Pi.SPLIT_DIRECTION_INDEX=18;Pi.NUMBER_OF_PROPERTIES=19;function vr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function W4(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function h_(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Pi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,vr(this,Wme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;W4(t,e)||(h_(e,t),h_(e,this._actualPosition),this._updateClamping(),vr(this,jD))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),vr(this,jD))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),vr(this,wme))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),vr(this,K5e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),vr(this,J5e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Kt.equals(t,e)||(this._pixelOffsetScaleByDistance=Kt.clone(e,t),vr(this,j5e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),vr(this,U5e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,vr(this,D5e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,vr(this,O5e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,vr(this,B5e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),vr(this,Fme))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,vr(this,z5e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),vr(this,H5e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,vr(this,vme))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,vr(this,vme))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,vr(this,Fme))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),vr(this,Q5e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,vr(this,q5e))}},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_(e,this._actualClampedPosition),vr(this,jD)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,vr(this,Wme))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),vr(this,Ime))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,vr(this,Ime))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,vr(this,$5e))}}});Pi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Pi.prototype._updateClamping=function(){Pi._updateClamping(this._billboardCollection,this)};var QD=new pe,eDe=new pe,Pme=200,Xme=30;function Nme(e,t,n,i){let o=t.cartographicToCartesian(i,e._clampedPosition);Py(e._heightReference)?e._mode===se.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,o)):o.x+=n.height:e._heightReference===He.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===se.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,o)):o.x=n.height),e._clampedPosition=o}Pi._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=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===He.CLIP_TO_GROUND&&o===se.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFramet._lastSurfaceHeight+Pme){t._clampedToSurface=!0,t._clampedPosition=_;return}}let a=i.cartesianToCartographic(t._position,eDe);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=h_(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===He.CLIP_TO_GROUND,d=s-t._lastSurfaceQueryFramet._lastSurfaceHeight+Pme,m=u&&d,p=c&&d&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||u)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let _=pe.clone(a);t._removeCallbackFunc=n.updateHeight(_,S=>{let Z=n.getHeight(_,t._heightReference);l(Z)&&(S.height=Z,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=S.height,t._clampedToSurface=!0,Nme(t,i,_,S)},t._heightReference)}pe.clone(a,QD);let y;m||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(QD.height=y),Nme(t,i,a,QD)};Pi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Pi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Pi.prototype.setImageTexture=function(e){ub.clone(e,this._imageTexture)};var Yme=512;Pi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=$n();return}let n;typeof t=="string"?n=t:t instanceof ve?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??$n(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&tDe(n)&&(this._imageWidth=Math.min(this._width,Yme),this._imageHeight=Math.min(this._height,Yme))};function tDe(e){return l(e)?Xh(e)?e.startsWith("data:image/svg+xml"):q0(e)==="svg":!1}Pi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Pi.prototype._setTranslate=function(e){let t=this._translate;k.equals(t,e)||(k.clone(e,t),vr(this,wme))};Pi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Pi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),vr(this,jD)};var Mme=new ce;Pi._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,Mme),ho.computeActualEllipsoidPosition(n,Mme))};var kme=new h;Pi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=P.multiplyByPoint(e,t,kme),a=ho.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return k.add(a,i,a),a};var JD=new k(0,0);Pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,JD),k.add(JD,this._translate,JD);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,QD);o=a.cartographicToCartesian(c,kme),i=P.IDENTITY}return Pi._computeScreenSpacePosition(i,o,this._eyeOffset,JD,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===Oi.RIGHT?s-=i:e.horizontalOrigin===Oi.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};Pi.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)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Pi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var No=Pi;var Nhn=x(T(),1);var Sdn=x(T(),1);var Ume=1/256,nDe=65536,F4=256,Yo={};Yo.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*W.signNotZero(i),n.y=(1-Math.abs(i))*W.signNotZero(o)}return n.x=W.toSNorm(n.x,t),n.y=W.toSNorm(n.y,t),n};Yo.octEncode=function(e,t){return Yo.octEncodeInRange(e,255,t)};var pv=new k,Dme=new Uint8Array(1);function qD(e){return Dme[0]=e,Dme[0]}Yo.octEncodeToCartesian4=function(e,t){return Yo.octEncodeInRange(e,65535,pv),t.x=qD(pv.x*Ume),t.y=qD(pv.x),t.z=qD(pv.y*Ume),t.w=qD(pv.y),t};Yo.octDecodeInRange=function(e,t,n,i){if(i.x=W.fromSNorm(e,n),i.y=W.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*W.signNotZero(o),i.y=(1-Math.abs(o))*W.signNotZero(i.y)}return h.normalize(i,i)};Yo.octDecode=function(e,t,n){return Yo.octDecodeInRange(e,t,255,n)};Yo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*F4+i,a=o*F4+r;return Yo.octDecodeInRange(s,a,65535,t)};Yo.octPackFloat=function(e){return 256*e.x+e.y};var I4=new k;Yo.octEncodeFloat=function(e){return Yo.octEncode(e,I4),Yo.octPackFloat(I4)};Yo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return Yo.octDecode(i,o,t)};Yo.octPack=function(e,t,n,i){let o=Yo.octEncodeFloat(e),r=Yo.octEncodeFloat(t),s=Yo.octEncode(n,I4);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};Yo.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;Yo.octDecodeFloat(s,t),Yo.octDecodeFloat(c,n),Yo.octDecode(r,a,i)};Yo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Yo.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 v4(e){return e>>1^-(e&1)}Yo.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};Yo.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=Yo;var Ndn=x(T(),1);var Rdn=x(T(),1);function iDe(e,t){this.start=e??0,this.stop=t??0}var Ys=iDe;var $D=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],k4),o=h.clone(i,P4),r=h.clone(i,X4),s=h.clone(i,N4),a=h.clone(i,Y4),c=h.clone(i,M4),d=h.clone(i,w4),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,oc)),b=h.magnitudeSquared(h.subtract(c,r,oc)),f=h.magnitudeSquared(h.subtract(d,s,oc)),y=o,_=a,S=p;b>S&&(S=b,y=r,_=c),f>S&&(y=s,_=d);let Z=U4;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,oc)),C=Math.sqrt(R),E=D4;E.x=o.x,E.y=r.y,E.z=s.z;let A=O4;A.x=a.x,A.y=c.y,A.z=d.z;let L=h.midpoint(E,A,B4),F=0;for(m=0;mF&&(F=I);let N=h.magnitudeSquared(h.subtract(i,Z,oc));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,oc)),y=h.magnitudeSquared(h.subtract(u,a,oc)),_=h.magnitudeSquared(h.subtract(m,c,oc)),S=s,Z=d,R=f;y>R&&(R=y,S=a,Z=u),_>R&&(S=c,Z=m);let C=U4;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,oc)),A=Math.sqrt(E),L=D4;L.x=s.x,L.y=a.y,L.z=c.z;let F=O4;F.x=d.x,F.y=u.y,F.z=m.z;let I=h.midpoint(L,F,B4),N=0;for(b=0;bN&&(N=g);let V=h.magnitudeSquared(h.subtract(r,C,oc));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,oc)),f=h.magnitudeSquared(h.subtract(d,s,oc)),y=h.magnitudeSquared(h.subtract(u,a,oc)),_=r,S=c,Z=b;f>Z&&(Z=f,_=s,S=d),y>Z&&(_=a,S=u);let R=U4;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,oc)),E=Math.sqrt(C),A=D4;A.x=r.x,A.y=s.y,A.z=a.z;let L=O4;L.x=c.x,L.y=d.y,L.z=u.z;let F=h.midpoint(A,L,B4),I=0;for(p=0;pI&&(I=N);let g=h.magnitudeSquared(h.subtract(o,R,oc));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,fDe);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,pDe));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:s=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 hb={high:0,low:0};Wp.fromCartesian=function(e,t){l(t)||(t=new Wp);let n=t.high,i=t.low;return Wp.encode(e.x,hb),n.x=hb.high,i.x=hb.low,Wp.encode(e.y,hb),n.y=hb.high,i.y=hb.low,Wp.encode(e.z,hb),n.z=hb.high,i.z=hb.low,t};var K4=new Wp;Wp.writeElements=function(e,t,n){Wp.fromCartesian(e,K4);let i=K4.high,o=K4.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=Wp;var zdn=x(T(),1);var pa={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};pa.getSizeInBytes=function(e){switch(e){case pa.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case pa.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case pa.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};pa.fromSizeInBytes=function(e){switch(e){case 2:return pa.UNSIGNED_SHORT;case 4:return pa.UNSIGNED_INT;case 1:return pa.UNSIGNED_BYTE}};pa.validate=function(e){return l(e)&&(e===pa.UNSIGNED_BYTE||e===pa.UNSIGNED_SHORT||e===pa.UNSIGNED_INT)};pa.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};pa.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};pa.fromTypedArray=function(e){if(e instanceof Uint8Array)return pa.UNSIGNED_BYTE;if(e instanceof Uint16Array)return pa.UNSIGNED_SHORT;if(e instanceof Uint32Array)return pa.UNSIGNED_INT};Object.freeze(pa);var Oe=pa;var oun=x(T(),1);var Jdn=x(T(),1);var f_={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,DYNAMIC_READ:ie.DYNAMIC_READ};f_.validate=function(e){return e===f_.STREAM_DRAW||e===f_.STATIC_DRAW||e===f_.DYNAMIC_DRAW||e===f_.DYNAMIC_READ};Object.freeze(f_);var Pe=f_;function $c(e){e=e??B.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=$n(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}$c.createPixelBuffer=function(e){if(!e.context._webgl2)throw new ge("A WebGL 2 context is required to create PixelBuffers.");return new $c({context:e.context,bufferTarget:ie.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};$c.createVertexBuffer=function(e){return new $c({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};$c.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Oe.getSizeInBytes(n),o=new $c({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties($c.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});$c.prototype._getBuffer=function(){return this._buffer};$c.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};$c.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};$c.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)};$c.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};$c.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};$c.prototype.isDestroyed=function(){return!1};$c.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var it=$c;var Xun=x(T(),1);var pun=x(T(),1);function ZDe(e,t,n,i){switch(t.type){case e.FLOAT:return new J4(e,t,n,i);case e.FLOAT_VEC2:return new j4(e,t,n,i);case e.FLOAT_VEC3:return new Q4(e,t,n,i);case e.FLOAT_VEC4:return new q4(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new eO(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new eO(e,t,n,i);case e.INT:case e.BOOL:return new $4(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new eQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new tQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new nQ(e,t,n,i);case e.FLOAT_MAT2:return new iQ(e,t,n,i);case e.FLOAT_MAT3:return new oQ(e,t,n,i);case e.FLOAT_MAT4:return new rQ(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var J4=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=o}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},j4=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new k,this._gl=t,this._location=o}set(){let t=this.value;k.equals(t,this._value)||(k.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},Q4=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=o}set(){let t=this.value;l(t.red)?U.equals(t,this._value)||(this._value=U.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)))}},q4=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=o}set(){let t=this.value;l(t.red)?U.equals(t,this._value)||(this._value=U.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(ce.equals(t,this._value)||(this._value=ce.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},eO=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._gl=t,this._location=o,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}},$4=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=o}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},eQ=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new k,this._gl=t,this._location=o}set(){let t=this.value;k.equals(t,this._value)||(k.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},tQ=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=o}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))}},nQ=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new ce,this._gl=t,this._location=o}set(){let t=this.value;ce.equals(t,this._value)||(ce.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},RDe=new Float32Array(4),iQ=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new Ji,this._gl=t,this._location=o}set(){if(!Ji.equalsArray(this.value,this._value,0)){Ji.clone(this.value,this._value);let t=Ji.toArray(this.value,RDe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},CDe=new Float32Array(9),oQ=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new q,this._gl=t,this._location=o}set(){if(!q.equalsArray(this.value,this._value,0)){q.clone(this.value,this._value);let t=q.toArray(this.value,CDe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},VDe=new Float32Array(16),rQ=class{constructor(t,n,i,o){this.name=i,this.value=void 0,this._value=new P,this._gl=t,this._location=o}set(){if(!P.equalsArray(this.value,this._value,0)){P.clone(this.value,this._value);let t=P.toArray(this.value,VDe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},bv=ZDe;var Vun=x(T(),1);function EDe(e,t,n,i){switch(t.type){case e.FLOAT:return new sQ(e,t,n,i);case e.FLOAT_VEC2:return new aQ(e,t,n,i);case e.FLOAT_VEC3:return new cQ(e,t,n,i);case e.FLOAT_VEC4:return new lQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new dQ(e,t,n,i);case e.INT:case e.BOOL:return new uQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new mQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new hQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new fQ(e,t,n,i);case e.FLOAT_MAT2:return new pQ(e,t,n,i);case e.FLOAT_MAT3:return new bQ(e,t,n,i);case e.FLOAT_MAT4:return new gQ(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var sQ=class{constructor(t,n,i,o){let r=o.length;this.name=i,this.value=new Array(r),this._value=new Float32Array(r),this._gl=t,this._location=o[0]}set(){let t=this.value,n=t.length,i=this._value,o=!1;for(let r=0;r0&&console.log(`${vp}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${vp}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${vp}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(`${vp}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(`${vp}Vertex shader compile log: ${c}`),console.error(`${vp} Vertex shader source: -${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${vp}Fragment shader compile log: ${c}`),console.error(`${vp} 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(`${vp}${b} shader translation failed.`);return}console.error(`${vp}Translated ${b} shaderSource: -${f}`)}}function WDe(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;ya){e.childNode1=new Tv({x:i.x,y:i.y,width:t,height:r});let u=s-c;return u>0&&(e.childNode2=new Tv({x:i.x+t+c,y:i.y,width:u,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new Tv({x:i.x,y:i.y,width:o,height:n});let d=a-c;return d>0&&(e.childNode2=new Tv({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 S1=_Q;var the=16;function Ml(e){e=e??B.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k(the,the);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=$n(),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 l(this._texture)?this._texture.sizeInBytes:0}}});Ml.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};Ml.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 hs({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;bnew nhe({index:S,image:_})).filter((_,S)=>l(_.image)&&!l(c.get(S))),u=0,m=0,p=0;for(let _=t;_=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 S1({height:a,width:s,borderPadding:n});let _;for(_=0;_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=$n()};Ml.prototype.getImageIndex=function(e){return 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}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function nhe({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 new Promise((n,i)=>{this._imagesToAddQueue.push(new nhe({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{let a=await eOe(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)};Ml.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};Ml.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}))};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var p_=Ml;var tOe=No.SHOW_INDEX,_v=No.POSITION_INDEX,ohe=No.PIXEL_OFFSET_INDEX,rhe=No.EYE_OFFSET_INDEX,nOe=No.HORIZONTAL_ORIGIN_INDEX,iOe=No.VERTICAL_ORIGIN_INDEX,oOe=No.SCALE_INDEX,b_=No.IMAGE_INDEX_INDEX,she=No.COLOR_INDEX,rOe=No.ROTATION_INDEX,sOe=No.ALIGNED_AXIS_INDEX,ahe=No.SCALE_BY_DISTANCE_INDEX,che=No.TRANSLUCENCY_BY_DISTANCE_INDEX,lhe=No.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,dhe=No.DISTANCE_DISPLAY_CONDITION,aOe=No.DISABLE_DEPTH_DISTANCE,cOe=No.TEXTURE_COORDINATE_BOUNDS,uhe=No.SDF_INDEX,mhe=No.SPLIT_DIRECTION_INDEX,EQ=No.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 Am(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new p_),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(EQ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,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??Ni.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;re.radius&&(e.radius=s)}function phe(e,t,n,i){let o=n[Do.positionHighAndScale],r=n[Do.positionLowAndRotation],s=i._getActualPosition();e._mode===se.SCENE3D&&(fhe(e._baseVolume,s),e._boundingVolumeDirty=!0),An.fromCartesian(s,SQ);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let d=SQ.high,u=SQ.low;o(i._index,d.x,d.y,d.z,a),r(i._index,u.x,u.y,u.z,c)}var Yy=new k,Em=32768,GQ=65536,ZQ=4096,g_=256,uOe=128,mOe=32,hOe=8,nO=4,fOe=1/256,bhe=new nt;function ghe(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===Oi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Bn.CENTER;let f=0,y=0;if(i.ready){let L=i.computeTextureCoordinates(bhe);f=L.x,y=L.y}let _=Math.floor(W.clamp(s,-Em,Em)+Em)*uOe;_+=(m+1)*mOe,_+=(p+1)*hOe,_+=(b?1:0)*nO;let S=Math.floor(W.clamp(a,-Em,Em)+Em)*g_,Z=Math.floor(W.clamp(d*nO,-Em,Em)+Em)*g_,R=(W.clamp(u*nO,-Em,Em)+Em)*fOe,C=Math.floor(R),E=Math.floor((R-C)*g_);S+=C,Z+=E,Yy.x=f,Yy.y=y;let A=dn.compressTextureCoordinates(Yy);o(i._index,_,S,Z,A)}function yhe(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,GQ),b=0;Math.abs(h.magnitudeSquared(r)-1)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,ZQ)),b=Math.floor(W.clamp(u,0,ZQ)),f=p*ZQ+b;o(i._index,r,s,c,f)}function She(e,t,n,i){if(bs(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 pOe(e,t,n,i){if(!l(e._batchTable))return;let o=n[Do.a_batchId],r=i._batchIndex;o(i._index,r)}function Zhe(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/Na.RADIUS,d=U.floatToByte(r.alpha)*GQ+U.floatToByte(c)*g_;o(i._index,a,d)}function Rhe(e,t,n,i){let o=n[Do.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s),o(i._index,r)}function bOe(e,t,n,i){phe(e,t,n,i),ghe(e,t,n,i),yhe(e,t,n,i),CQ(e,t,n,i),VQ(e,t,n,i),xhe(e,t,n,i),The(e,t,n,i),_he(e,t,n,i),She(e,t,n,i),pOe(e,t,n,i),Zhe(e,t,n,i),Rhe(e,t,n,i)}function RQ(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;c0;){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 Hme(e,t,n){let i="",o=e.sources;if(l(o))for(let b=0;b0))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{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;gOe(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;L0){this._vaf=dOe(t,i,this._buffersUsage,this._batchTable,this._sdf),m=this._vaf.writers;for(let L=0;L0){let L=TOe;L.length=0,(c[_v]||c[rOe]||c[oOe])&&L.push(phe),(c[b_]||c[ohe]||c[nOe]||c[iOe]||c[tOe])&&(L.push(ghe),L.push(VQ)),(c[b_]||c[sOe]||c[che])&&(L.push(yhe),L.push(CQ)),(c[b_]||c[she])&&L.push(CQ),(c[b_]||c[rhe])&&L.push(VQ),c[ahe]&&L.push(xhe),c[lhe]&&L.push(The),(c[dhe]||c[aOe]||c[b_]||c[_v])&&L.push(_he),(c[b_]||c[_v])&&L.push(She),c[uhe]&&L.push(Zhe),c[mhe]&&L.push(Rhe);let F=L.length;if(m=this._vaf.writers,a/i>.1){for(let I=0;Ii*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,y=P.IDENTITY;e.mode===se.SCENE3D?(y=this.modelMatrix,f=me.clone(this._baseVolumeWC,this._boundingVolume)):f=me.clone(this._baseVolume2D,this._boundingVolume),yOe(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Ni.OPAQUE||this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let L=this._blendOption===Ni.TRANSLUCENT;this._blendOption===Ni.TRANSLUCENT||this._blendOption===Ni.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=xv,Z=yv,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-Na.CUTOFF;this._sdf&&R.defines.push("SDF");let F=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ni.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=tn.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=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._blendOption===Ni.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=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._blendOption===Ni.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=tn.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===Ni.OPAQUE,I=this._blendOption===Ni.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;X0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Fp(i)}`),c};iO.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var er=iO;var zhn=x(T(),1),Che={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(Che);var Z1=Che;var Jhn=x(T(),1);function Sv(e){}Sv.prototype.isReady=function(){return!0};Sv.prototype.shouldDiscardImage=function(e){return Sv.EMPTY_IMAGE===e};var oO;Object.defineProperties(Sv,{EMPTY_IMAGE:{get:function(){return l(oO)||(oO=new Image,oO.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),oO}}});var R1=Sv;function Vhe(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}Vhe.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 ZOe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),er.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function ROe(e,t,n){let i=e.url,o=ba._metadataCache[i];l(o)||(o=e.fetchJson(),ba._metadataCache[i]=o);try{let r=await o;return SOe(r,t)}catch(r){ZOe(e,r,n)}}function ba(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??Z1.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new R1),this._proxy=e.proxy,this._credit=new Lt(``),this._tilingScheme=new Lr({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(ba.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)}}});ba.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??Z1.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 ba(t);a._resource=o;let c=new Vhe(t);return await ROe(s,c),c.build(a),a};var COe=new re;ba.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,COe);return AOe(this._attributionList,n,i)};ba.prototype.requestImage=function(e,t,n,i){let o=_u.loadImage(this,VOe(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?R1.EMPTY_IMAGE:Promise.reject(r)})};ba.prototype.pickFeatures=function(e,t,n,i,o){};ba.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,EOe);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ba._metadataCache={};var Zv=ba;var ffn=x(T(),1);var My={};My.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:My.parseBoundingVolumeSemantic(e,t),minimumHeight:My._parseMinimumHeight(e,t),maximumHeight:My._parseMaximumHeight(e,t)}};My.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};My._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};My._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var wy=My;var yfn=x(T(),1);var GOe=new h(1,1,1);function LQ(e){e=e??GOe,this._dimensions=h.clone(e)}Object.defineProperties(LQ.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var LOe=new h;LQ.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,LOe),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 WQ=LQ;var vfn=x(T(),1);var Tfn=x(T(),1),Rv=`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) + czm_old_main(); + czm_pickColor = pickColor; +}`};Ia.createPickFragmentShaderSource=function(e,t){let n=Ia.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +void main() +{ + czm_old_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = czm_pickColor; +}`;return`${n} +${i}`};function DDe(e,t){let n=e.defines,i=n.length;for(let o=0;o planes2D_high.w && position3DLow.y > 0.0; +planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); +planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); +idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; +idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); +planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); +planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); +vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; +vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; +vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D +vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; +vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; +vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D +vec3 eastWard = southEastCorner - southWestCorner; +float eastExtent = length(eastWard); +eastWard /= eastExtent; +vec3 northWard = northWestCorner - southWestCorner; +float northExtent = length(northWard); +northWard /= northExtent; +v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); +v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); +v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL +vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); +vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); +v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); +v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); +v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#endif +gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +`;var _hn=x(T(),1),Xy=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif +void main(void) { -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; +#ifdef VECTOR_TILE +out_FragColor = czm_gammaCorrect(u_highlightColor); +#else +out_FragColor = vec4(1.0); +#endif +czm_writeDepthClamp(); } -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) -{ -float alphaRoughnessSq = alphaRoughness * alphaRoughness; -float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); -float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); -float GGX = GGXV + GGXL; -if (GGX > 0.0) +`;var Zhn=x(T(),1),gQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};gQ.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(gQ);var ti=gQ;var Vhn=x(T(),1);var jme={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(jme);var rc=jme;var tpn=x(T(),1);var Ahn=x(T(),1);function zDe(e,t){let n=[],i=e.length,o=0;for(;oe.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)}};Bv.MaximumLatitude=Bv.mercatorAngleToGeodeticLatitude(Math.PI);var Ti=Bv;function sOe(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 lOe(e,t){let n=[];return xQ(e,"geometry",t,n),xQ(e,"westHemisphereGeometry",t,n),xQ(e,"eastHemisphereGeometry",t,n),n}var ub={};ub.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=cOe(e),t.length>0&&(n=zn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=lOe(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}};ub.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 0.0) + +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} { -float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); -float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; -float Fc = pow(1.0 - VdotH, 5.0); -A += (1.0 - Fc) * G_Vis; -B += Fc * G_Vis; -} -} -return vec2(A, B) / float(NumSamples); + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); } -void main() + +`:(r+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} { -out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); + vec4 p; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); + } + return p; } -`;function Cv(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(Cv.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function WOe(e,t,n){let i=t.createViewportQuadCommand(Rv,{framebuffer:n,renderState:ze.fromCache({viewport:new nt(0,0,256,256)})});e._drawCommand=i}Cv.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:Ot.NEAREST});this._colorTexture=n;let i=new hs({context:t,colorTextures:[n],destroyAttachments:!1});WOe(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var Vv=Cv;var zfn=x(T(),1);var Yfn=x(T(),1);var vQ=class{get cacheKey(){ge.throwInstantiationError()}load(){ge.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` -${n.message}`);let i=new ae(t);return l(n)&&(i.stack=`Original stack: -${n.stack} -Handler stack: -${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),ue(this)}},to=vQ;var wfn=x(T(),1),Ehe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(Ehe);var Rt=Ehe;var rO=class extends to{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=vOe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function vOe(e){let t=e._resource;e._state=Rt.LOADING;try{let n=await rO._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 y_=rO;var gpn=x(T(),1);var Kfn=x(T(),1);var Dh=class Dh{constructor(){mt(this,"_collection",null);mt(this,"_index",-1);mt(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(Dh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Dh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Dh.Layout.SHOW_U8)===1}set show(t){this._setUint8(Dh.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(Dh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Dh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Dh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Dh.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()}}};mt(Dh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var FQ=Dh,es=FQ;var dpn=x(T(),1);var Ev=class Ev{constructor(t=B.EMPTY_OBJECT){mt(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??He.NONE,this._blendOption=t.blendOption??Ni.TRANSLUCENT,this._modelMatrix=P.clone(t.modelMatrix??P.IDENTITY),this._boundingVolume=me.clone(t.boundingVolume??new me,new me),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??Ev.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??Ev.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??J.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(){ge.throwInstantiationError()}_getPrimitiveClass(){ge.throwInstantiationError()}_getMaterialClass(){ge.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=J.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(),o=this._getCollectionClass(),{primitiveCount:r}=this,s=new i,a=new i,c=new Uint32Array(r);for(let u=0;ut(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&&!bs(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;o= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${o}`};function ohe(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; +`,m+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(u+=`vec3 normal; +`,m+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); +`),o&&(u+=`vec3 tangent; +`,m+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); +`),r&&(u+=`vec3 bitangent; +`,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() +{ +${m} czm_non_compressed_main(); +}`;return[d,u,p,b].join(` +`)}function ZOe(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 ROe(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(); + #else + czm_writeDepthClamp(); + #endif } -`;var Spn=x(T(),1),Gv=`in vec4 v_pickColor; +`,t}function rhe(e,t){let n=e.vertexAttributes}function COe(e,t){return function(){return e[t]}}var TQ=Math.max(fn.hardwareConcurrency-1,1),nO,VOe=new $n("combineGeometry");function EOe(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):Hv(e,t,ts.FAILED,void 0)}).catch(function(m){Hv(e,t,ts.FAILED,m)})}}function AOe(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):Hv(e,t,ts.FAILED,void 0)}function GOe(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||me.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?EOe(this,e):AOe(this,e)),this._state===ts.COMBINED&&(LOe(this,e),ahe(this,e),vOe(this,e)),!this.show||this._state!==ts.COMPLETE)return;this._batchTableOffsetsUpdated||ahe(this,e),this._recomputeBoundingSpheres&&GOe(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??FOe)(this,t,n,d),r&&(this._createShaderProgramFunction??IOe)(this,e,n),(o||r)&&(this._createCommandsFunction??POe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??XOe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var NOe=new me,YOe=new me;function phe(e,t,n){if(n===bn.TOP){let i=me.clone(e,NOe),o=me.clone(e,YOe);o.center=h.add(o.center,t,o.center),e=me.union(i,o,e)}else n===bn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function MOe(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 wOe(e,t,n,i,o){return function(r){let s=uhe(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var kOe=new h;function UOe(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)&&phe(i,h.fromArray(r.get(),0,kOe),e._offsetInstanceExtend[n]),l(o)&&(i=me.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function DOe(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;d 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); +float useDownOrLeft = float(useUpOrRight == 0.0); +vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); +vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); +return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; } -`;var Wpn=x(T(),1);var Vpn=x(T(),1);var Lv=class{constructor(t=B.EMPTY_OBJECT){this.color=U.clone(t.color??U.WHITE),this.outlineColor=U.clone(t.outlineColor??U.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 U.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),U.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}}};mt(Lv,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),mt(Lv,"DEFAULT_MATERIAL");var wl=Lv;var Wv=class Wv extends wl{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(Wv,"Layout",{...wl.Layout,SIZE_U8:wl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:wl.Layout.__BYTE_LENGTH+4}),mt(Wv,"DEFAULT_MATERIAL",Object.freeze(new Wv));var PQ=Wv,Oh=PQ;var XQ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},Ahe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},x_=new Ac,Bh=new Oh,vv=new U,Ghe=new h,NQ=new An;function IOe(e,t,n){let i=t.context;n=n||{destroy:POe};let o=e._positionDatatype===J.DOUBLE,r=o?XQ:Ahe;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,x_),x_._dirty&&(o&&(x_.getPosition(Ghe),An.fromCartesian(Ghe,NQ),h.pack(NQ.high,c,y*3),h.pack(NQ.low,d,y*3)),x_.getMaterial(Bh),U.fromRgba(x_._pickId,vv),u[y*4]=U.floatToByte(vv.red),u[y*4+1]=U.floatToByte(vv.green),u[y*4+2]=U.floatToByte(vv.blue),u[y*4+3]=U.floatToByte(vv.alpha),m[y*4]=x_.show?1:0,m[y*4+1]=Bh.size,m[y*4+2]=dn.encodeRGB8(Bh.color),m[y*4+3]=Bh.color.alpha,p[y*3]=Bh.outlineWidth,p[y*3+1]=dn.encodeRGB8(Bh.outlineWidth>0?Bh.outlineColor:Bh.color),p[y*3+2]=Bh.outlineWidth>0?Bh.outlineColor.alpha:Bh.color.alpha,x_._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:XQ.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:XQ.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:Ahe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:e._positionView,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showSizeColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Pe.STATIC_DRAW})},{index:r.outlineWidthColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Ni.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Av],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Gv]}),attributeLocations:r})),l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.POINTS,pass:e._blendOption===Ni.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 POe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var Fv=IOe;var YQ=class e extends $s{constructor(t=B.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Ac}_getMaterialClass(){return Oh}_cloneEmpty(t=B.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Ac){return super.add(t,n),n._setUint32(Ac.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=Fv(this,t,this._renderContext))}},Id=YQ;var g0n=x(T(),1);var{ERR_CAPACITY:h0n,ERR_RESIZE:f0n,ERR_OUT_OF_RANGE:p0n}=$s.Error,Gm=class Gm extends es{constructor(){super(...arguments);mt(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(Gm.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Gm.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,s=n.length/3,a=i.vertexCount+s-r;i._positionCount=a,this._setUint32(Gm.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let d=0;d0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Gm.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Gm.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}=NOe(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:it.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:kQ.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:kQ.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:Lhe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Ni.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Iv],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Pv]}),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===Ni.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 NOe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ga);let i=ga.vertexOffset,o=ga.triangleOffset*3;e.get(t+n-1,ga);let r=ga.vertexOffset+ga.vertexCount-i,s=(ga.triangleOffset+ga.triangleCount)*3-o;return{indexOffset:o,indexCount:s,vertexOffset:i,vertexCount:r}}function YOe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var Nv=XOe;var{ERR_CAPACITY:rbn}=$s.Error,OQ=class e extends $s{constructor(t=B.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??$s.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??$s.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Fr}_getMaterialClass(){return Vu}_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 Fr){super.add(t,n);let i=this._positionCount;n._setUint32(Fr.Layout.POSITION_OFFSET_U32,i),n._setUint32(Fr.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(Fr.Layout.HOLE_OFFSET_U32,o),n._setUint32(Fr.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(Fr.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(Fr.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=Nv(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=OQ;var fbn=x(T(),1);var{ERR_RESIZE:ubn,ERR_CAPACITY:mbn}=$s.Error,C1=class C1 extends es{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(C1.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(C1.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;sd&&(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 Rhe(b,t),Ehe(e,i,b),b};Em.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)};Em.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 iBe(e){return Math.max(e.width,e.height)>Em.MAX_WIDTH_FOR_PLANAR_EXTENTS}Em.shouldUseSphericalCoordinates=function(e){return iBe(e)};Em.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var _u=Em;var vpn=x(T(),1);var Cpn=x(T(),1);var Ahe={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(Ahe);var ni=Ahe;var Apn=x(T(),1);var Ghe={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(Ghe);var Ft=Ghe;var oO={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};oO.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:oO.CESIUM_3D_TILE_MASK,mask:oO.CESIUM_3D_TILE_MASK}};var Jt=Object.freeze(oO);function x_(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(x_.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}}});x_.isSupported=function(e){return e.context.stencilBuffer};function x1(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 RQ(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 oBe={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 rBe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(x1(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(x1(o,!0)),e._rsColorPass=ze.fromCache(RQ(o,!1)),e._rsPickPass=ze.fromCache(oBe)}function sBe(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=Je.replaceMain(s,"czm_non_compressed_main");let a=`void main() +{ +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function aBe(e,t){let n=t.context,i=e._primitive,o=Uv;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=sBe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Je({defines:[a],sources:[o]}),d=new Je({sources:[Xy]}),u=e._primitive._attributeLocations,m=new _u(s,r,e.appearance);if(e._spStencil=nn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=Je.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let y=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=nn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(S)){let Z=m.createPickFragmentShader(!0),R=m.createPickVertexShader([a],f,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:R,fragmentShaderSource:Z,attributeLocations:u})}e._spPick2D=S}}else e._spPick=nn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new Je({defines:[a],sources:[o]}),e._sp=nn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),b=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=nn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:b,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let y=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u})}e._spColor2D=f}}function cBe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o0&&(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))})};x_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};x_.prototype.isDestroyed=function(){return!1};x_.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 T1=x_;var mBe={u_globeMinimumAltitude:function(){return 55e3}};function Ld(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))})};Ld.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Ld.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};Ld._supportsMaterials=function(e){return e.depthTexture};Ld.supportsMaterials=function(e){return Ld._supportsMaterials(e.frameState.context)};var Yl=Ld;var G0n=x(T(),1);function _1(){ge.throwInstantiationError()}Object.defineProperties(_1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});_1.prototype.getType=ge.throwInstantiationError;_1.prototype.getValue=ge.throwInstantiationError;_1.prototype.equals=ge.throwInstantiationError;var _Be=new Q;_1.getValue=function(e,t,n){let i;return l(e)||(e=Q.now(_Be)),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=_1;function T_(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}T_.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};T_.prototype._setOptions=ge.throwInstantiationError;T_.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof 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 Yl({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}))}};T_.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(me.clone(o.boundingSphere,e),Wt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(me.clone(o.boundingSphere,e),Wt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Wt.PENDING:Wt.FAILED};T_.prototype.isDestroyed=function(){return!1};T_.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var Li=T_;var lSn=x(T(),1);var z0n=x(T(),1);var Phe={};function Kv(e,t){l(Phe[e])||(Phe[e]=!0,console.warn(t??e))}Kv.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.";Kv.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Kv.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Kv.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var xt=Kv;var H_n=x(T(),1);var K0n=x(T(),1),Xhe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(Xhe);var mb=Xhe;var Jgn=x(T(),1);var Mbn=x(T(),1);var j0n=x(T(),1),Nhe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Nhe);var un=Nhe;var ebn=x(T(),1);var Yhe=W.EPSILON10;function SBe(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),M=Math.atan2(b*A,_-Z*E),O=Math.atan2(m*A,_*E-Z);e._distance=D,e._startHeading=M,e._endHeading=O,e._uSquared=V}var VBe=new h,EQ=new h;function whe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,EQ),VBe),r=h.normalize(i.cartographicToCartesian(n,EQ),EQ);CBe(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,ZBe(e)}function Jv(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)&&whe(this,e,t,i)}Object.defineProperties(Jv.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}}});Jv.prototype.setEndPoints=function(e,t){whe(this,e,t,this._ellipsoid)};Jv.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};Jv.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)-Mhe(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 hb=Jv;var fbn=x(T(),1);function GQ(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 EBe(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 S1(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 ABe(e,t,n,i,o){let r=S1(e._ellipticity,n),s=S1(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function GBe(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=GQ(e._ellipticity,t,o);d=(GQ(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var LBe=new h,AQ=new h;function khe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,AQ),LBe),r=h.normalize(i.cartographicToCartesian(n,AQ),AQ),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=ABe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=GBe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Uhe(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=GQ(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=EBe(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 fb(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)&&khe(this,e,t,i)}Object.defineProperties(fb.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}}});fb.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=Uhe(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new fb(e,m,r):(o.setEndPoints(e,m),o)};fb.prototype.setEndPoints=function(e,t){khe(this,e,t,this._ellipsoid)};fb.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};fb.prototype.interpolateUsingSurfaceDistance=function(e,t){return Uhe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};fb.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};fb.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=S1(n,o.latitude),s=S1(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=fb;var NQ=[ki,Ti],WBe=NQ.length,cfe=Math.cos(W.toRadians(30)),Dhe=Math.cos(W.toRadians(150)),lfe=0,dfe=1e3;function Yy(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(Yy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});Yy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;icfe||rW.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,Qhe),d=c.cartesianToCartographic(s,jhe)),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 QBe=new h,qhe=new h;function $he(e,t,n,i,o,r){let s=h.subtract(t,e,QBe);h.normalize(s,s);let a=n-lfe,c=h.multiplyByScalar(s,a,qhe);h.add(e,c,o);let d=i-dfe;c=h.multiplyByScalar(s,d,qhe),h.add(t,c,r)}var qBe=new h;function cO(e,t){let n=cn.getPointDistance(lO,e),i=cn.getPointDistance(lO,t),o=qBe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=pb(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=pb(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function $Be(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 mfe=new pe,hfe=new pe,efe=new h,FQ=new h,tfe=new h,nfe=new h,e3e=new h,ife=new h,t3e=[mfe,hfe],n3e=new re,i3e=new h,o3e=new h,r3e=new h,s3e=new h,a3e=new h,c3e=new h,IQ=new h,PQ=new h,l3e=new h,d3e=new h,u3e=new h,ofe=new h,m3e=new h,h3e=new h,f3e=new An,p3e=new An,rfe=new h,b3e=new h,sfe=new h,g3e=[new me,new me],ffe=[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],afe=ffe.length;function y3e(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=mfe;g.height=0;let V=hfe;V.height=0;let G=efe,v=FQ;if(s)for(c=0,a=1;acfe?(qe=jv(t,g,tt,Be,IQ),We=jv(t,V,$,je,PQ)):yi===1?(We=jv(t,V,$,je,PQ),qe.x=0,qe.y=W.sign(g.longitude-Math.abs(V.longitude)),qe.z=0):(qe=jv(t,g,tt,Be,IQ),We.x=0,We.y=W.sign(g.longitude-V.longitude),We.z=0)}let Ke=h.distance(Fe,H),ct=An.fromCartesian(Ae,f3e),Et=h.subtract(te,Ae,l3e),zt=h.normalize(Et,ofe),ut=h.subtract(Fe,Ae,d3e);ut=h.normalize(ut,ut);let bt=h.cross(zt,ut,ofe);bt=h.normalize(bt,bt);let ht=h.cross(ut,tt,m3e);ht=h.normalize(ht,ht);let jt=h.subtract(H,te,u3e);jt=h.normalize(jt,jt);let st=h.cross($,jt,h3e);st=h.normalize(st,st);let pt=Ke/Y,Mi=ee/Y,jn=0,Si,Hi,Gi,pi=0,Zi=0;if(s){jn=h.distance(Be,je),Si=An.fromCartesian(Be,p3e),Hi=h.subtract(je,Be,rfe),Gi=h.normalize(Hi,b3e);let yi=Gi.x;Gi.x=Gi.y,Gi.y=-yi,pi=jn/N,Zi=le/N}for(D=0;D<8;D++){let yi=z+D*4,fr=O+D*2,mo=yi+3,Qr=D<4?1:-1,Mn=D===2||D===3||D===6||D===7?1:-1;h.pack(ct.high,_,yi),_[mo]=Et.x,h.pack(ct.low,S,yi),S[mo]=Et.y,h.pack(ht,Z,yi),Z[mo]=Et.z,h.pack(st,R,yi),R[mo]=pt*Qr,h.pack(bt,C,yi);let Ki=Mi*Mn;Ki===0&&Mn<0&&(Ki=9),C[mo]=Ki,s&&(E[yi]=Si.high.x,E[yi+1]=Si.high.y,E[yi+2]=Si.low.x,E[yi+3]=Si.low.y,L[yi]=-qe.y,L[yi+1]=qe.x,L[yi+2]=We.y,L[yi+3]=-We.x,A[yi]=Hi.x,A[yi+1]=Hi.y,A[yi+2]=Gi.x,A[yi+3]=Gi.y,F[fr]=pi*Qr,Ki=Zi*Mn,Ki===0&&Mn<0&&(Ki=9),F[fr+1]=Ki)}let On=r3e,rn=s3e,Hn=i3e,$i=o3e,Po=re.fromCartographicArray(t3e,n3e),hr=Pi.getMinimumMaximumHeights(Po,d),Is=hr.minimumTerrainHeight,Hs=hr.maximumTerrainHeight;_e+=Math.abs(Is),_e+=Math.abs(Hs),$he(Ae,Fe,Is,Hs,On,Hn),$he(te,H,Is,Hs,rn,$i);let or=h.multiplyByScalar(bt,W.EPSILON5,sfe);h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),cO(On,rn),cO(Hn,$i),h.pack(On,y,w),h.pack(rn,y,w+3),h.pack($i,y,w+6),h.pack(Hn,y,w+9),or=h.multiplyByScalar(bt,-2*W.EPSILON5,sfe),h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),cO(On,rn),cO(Hn,$i),h.pack(On,y,w+12),h.pack(rn,y,w+15),h.pack($i,y,w+18),h.pack(Hn,y,w+21),M+=2,c+=3,O+=16,w+=24,z+=32,ee+=Ke,le+=jn}c=0;let he=0;for(a=0;a 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); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +eyeCoordinate /= eyeCoordinate.w; +float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); +float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); +float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); +float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); +if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -else { -lineDir = normalize(nextWindow.xy - positionWindow.xy); +vec3 alignedPlaneNormal; +alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); +alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); +distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); +alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); +alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); +distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); +#ifdef PER_INSTANCE_COLOR +out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR +float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); +s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; +float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); +czm_materialInput materialInput; +materialInput.s = s; +materialInput.st = vec2(s, t); +materialInput.str = vec3(s, t, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +out_FragColor.rgb *= out_FragColor.a; +czm_writeDepthClamp(); } -angle = atan(lineDir.x, lineDir.y) - 1.570796327; -angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +`;var Dbn=x(T(),1),qv=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; #endif -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; +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { +return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -vec2 thisSegmentForwardWC, otherSegmentForwardWC; -if (usePrevious) +void main(void) { -thisSegmentForwardWC = -directionToPrevWC; -otherSegmentForwardWC = directionToNextWC; +vec4 eyeCoordinate = gl_FragCoord; +eyeCoordinate /= eyeCoordinate.w; +#ifdef PER_INSTANCE_COLOR +out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR +float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); +float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); +distanceFromStart = max(0.0, distanceFromStart); +distanceFromEnd = max(0.0, distanceFromEnd); +float s = distanceFromStart / (distanceFromStart + distanceFromEnd); +s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; +czm_materialInput materialInput; +materialInput.s = s; +materialInput.st = vec2(s, v_texcoordT); +materialInput.str = vec3(s, v_texcoordT, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR } -else +`;var Bbn=x(T(),1),$v=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +in float batchId; +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif +void main() { -thisSegmentForwardWC = directionToNextWC; -otherSegmentForwardWC = -directionToPrevWC; +v_batchId = batchId; +vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); +vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); +vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); +vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; +vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; +vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +vec4 startPlane2D; +vec4 startPlane3D; +startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); +startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; +startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); +startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); +vec4 rightPlane2D; +vec4 rightPlane3D; +rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); +rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; +rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); +rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); +posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); +posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); +posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); +posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; +posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; +vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); +vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); +vec4 endPlane2D; +vec4 endPlane3D; +endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); +endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; +endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); +endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); +v_forwardDirectionEC = normalize(endEC - startEC); +vec2 cleanTexcoordNormalization2D; +cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); +cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); +vec2 cleanTexcoordNormalization3D; +cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); +cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; +cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); +v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR +v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); +v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR +#ifdef WIDTH_VARYING +float width = czm_batchTable_width(batchId); +float halfWidth = width * 0.5; +v_width = width; +v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else +float halfWidth = 0.5 * czm_batchTable_width(batchId); +v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif +vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); +float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); +float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); +vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); +vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); +vec3 normalEC = normalize(cross(planeDirection, upOrDown)); +vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); +geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); +geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; +positionEc3D.xyz += geodeticSurfaceNormal; +normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; +vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); +absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); +absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); +planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); +upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); +normalEC = normalize(cross(planeDirection, upOrDown)); +geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); +geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); +geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; +positionEc2D.xyz += geodeticSurfaceNormal; +normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR +v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif +positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; +gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); +#ifdef ANGLE_VARYING +vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); +approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); +v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } -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)) +`;var Hbn=x(T(),1),e2=`in vec3 position3DHigh; +in vec3 position3DLow; +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif +in float batchId; +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif +void main() { -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); +#ifdef COLUMBUS_VIEW_2D +vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; +vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); +vec3 ecEnd = forwardDirectionEC + ecStart; +forwardDirectionEC = normalize(forwardDirectionEC); +v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); +v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); +vec4 startPlaneEC; +startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); +startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); +vec4 endPlaneEC; +endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); +endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); +v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); +v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; +#else // COLUMBUS_VIEW_2D +vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; +vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); +vec3 ecEnd = ecStart + offset; +vec3 forwardDirectionEC = normalize(offset); +vec4 startPlaneEC; +startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; +startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); +vec4 endPlaneEC; +endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; +endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); +v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; +v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); +v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); +v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; +#endif // COLUMBUS_VIEW_2D +v_endEcAndStartEcX.xyz = ecEnd; +v_endEcAndStartEcX.w = ecStart.x; +v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR +vec4 positionRelativeToEye = czm_computePosition(); +vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; +float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); +float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); +vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); +vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); +vec3 normalEC = normalize(cross(planeDirection, upOrDown)); +upOrDown = cross(forwardDirectionEC, normalEC); +upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; +upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; +upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; +positionEC.xyz += upOrDown; +v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); +float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING +v_width = width; +#endif +v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; +v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; +v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; +v_endPlaneNormalEcAndBatchId.w = batchId; +width = width * max(0.0, czm_metersPerPixel(positionEC)); +width = width / dot(normalEC, v_rightPlaneEC.xyz); +#ifdef COLUMBUS_VIEW_2D +normalEC *= sign(texcoordNormalization2D.x); +#else +normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif +positionEC.xyz += width * normalEC; +gl_Position = czm_depthClamp(czm_projection * positionEC); +#ifdef ANGLE_VARYING +vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); +approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); +v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } -vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; -return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +`;var rgn=x(T(),1);var Jbn=x(T(),1),t2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() +{ +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = czm_computePosition(); +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_color = color; } -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +`;var Qbn=x(T(),1),wl=`void clipLineSegmentToNearPlane( +vec3 p0, +vec3 p1, +out vec4 positionWC, +out bool clipped, +out bool culledByNearPlane, +out vec4 clippedPositionEC) { -vec4 positionEC = czm_modelViewRelativeToEye * position; -vec4 prevEC = czm_modelViewRelativeToEye * previous; -vec4 nextEC = czm_modelViewRelativeToEye * next; -return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +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; } -`;var Cbn=x(T(),1);var wv=class wv extends wl{constructor(t=B.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}}};mt(wv,"Layout",{...wl.Layout,WIDTH_F32:wl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:wl.Layout.__BYTE_LENGTH+4}),mt(wv,"DEFAULT_MATERIAL",Object.freeze(new wv));var zQ=wv,Eu=zQ;var T_={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},lO={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},el=new ya,kv=new Eu,Uv=new U,vhe=new h,Fhe=new h,Ihe=new h,HQ=new An,KQ=new An,JQ=new An;function MOe(e,t,n){let i=t.context;n=n||{destroy:UOe};let o=e._positionDatatype===J.DOUBLE,r=o?T_:lO;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;F0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=kOe(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:it.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:T_.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:T_.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})},{index:T_.prevPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:T_.prevPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Pe.STATIC_DRAW})},{index:T_.nextPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:T_.nextPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:lO.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})},{index:lO.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Pe.STATIC_DRAW})},{index:lO.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorWidthAndTexCoord,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Pe.STATIC_DRAW})},{index:r.alpha,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:it.createVertexBuffer({typedArray:c.alpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Ni.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[kl,Yv],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Mv]}),attributeLocations:r}));let s=wOe(e);l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Ni.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 wOe(e){return(e.vertexCount-e.primitiveCount)*6}function kOe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,el);let i=el.vertexOffset*2,r=(el.vertexOffset-t)*6;e.get(t+n-1,el);let s=(el.vertexOffset+el.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:s}}function UOe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var Dv=MOe;var jQ=class e extends $s{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 ya}_getMaterialClass(){return Eu}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new ya){super.add(t,n);let i=this._positionCount;return n._setUint32(ya.Layout.POSITION_OFFSET_U32,i),n._setUint32(ya.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=Dv(this,t,this._renderContext))}},tl=jQ;var $gn=x(T(),1);var vgn=x(T(),1);var agn=x(T(),1);function $Q(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Xhe(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,d;if(i&&(r=HOe(e,t,r,n)),e.length>80*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 Bv(r,s,n,a,c,d,0),s}function Xhe(e,t,n,i,o){let r;if(o===oBe(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=Phe(s/i|0,e[s],e[s+1],r);return r&&V1(r,r.next)&&(Hv(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&&(V1(n,n.next)||ys(n.prev,n,n.next)===0)){if(Hv(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Bv(e,t,n,i,o,r,s){if(!e)return;!s&&r&&qOe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?OOe(e,i,o,r):DOe(e)){t.push(c.i,e.i,d.i),Hv(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=BOe(__(e),t),Bv(e,t,n,i,o,r,2)):s===2&&zOe(e,t,n,i,o,r):Bv(__(e),t,n,i,o,r,1);break}}}function DOe(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&&Ov(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 OOe(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=QQ(b,f,t,n,i),Z=QQ(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&&Ov(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&&Ov(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&&Ov(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&&Ov(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 BOe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!V1(i,o)&&Yhe(i,n,n.next,o)&&zv(i,o)&&zv(o,i)&&(t.push(i.i,n.i,o.i),Hv(n),Hv(n.next),n=e=o),n=n.next}while(n!==e);return __(n)}function zOe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&tBe(s,a)){let c=Mhe(s,a);s=__(s,s.next),c=__(c,c.next),Bv(s,t,n,i,o,r,0),Bv(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function HOe(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&&Nhe(os.x||n.x===s.x&&QOe(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function QOe(e,t){return ys(e.prev,e,t.prev)<0&&ys(t.next,e,e.next)<0}function qOe(e,t,n,i){let o=e;do o.z===0&&(o.z=QQ(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,$Oe(o)}function $Oe(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 QQ(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 eBe(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 Ov(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Nhe(e,t,n,i,o,r,s,a)}function tBe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!nBe(e,t)&&(zv(e,t)&&zv(t,e)&&iBe(e,t)&&(ys(e.prev,e,t.prev)||ys(e,t.prev,t))||V1(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 V1(e,t){return e.x===t.x&&e.y===t.y}function Yhe(e,t,n,i){let o=uO(ys(e,t,n)),r=uO(ys(e,t,i)),s=uO(ys(n,i,e)),a=uO(ys(n,i,t));return!!(o!==r&&s!==a||o===0&&dO(e,n,t)||r===0&&dO(e,i,t)||s===0&&dO(n,e,i)||a===0&&dO(n,t,i))}function dO(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 uO(e){return e>0?1:e<0?-1:0}function nBe(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&&Yhe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function zv(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 iBe(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 Mhe(e,t){let n=qQ(e.i,e.x,e.y),i=qQ(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 Phe(e,t,n,i){let o=qQ(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 Hv(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 qQ(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function oBe(e,t,n,i){let o=0;for(let r=t,s=n-i;rW.EPSILON8){let u=t8(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=rBe(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 bb(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)&&whe(this,e,t,i)}Object.defineProperties(bb.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}}});bb.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=khe(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new bb(e,m,r):(o.setEndPoints(e,m),o)};bb.prototype.setEndPoints=function(e,t){whe(this,e,t,this._ellipsoid)};bb.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};bb.prototype.interpolateUsingSurfaceDistance=function(e,t){return khe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};bb.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};bb.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=E1(n,o.latitude),s=E1(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 Gc=bb;var ggn=x(T(),1);function lBe(e){e=e??B.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Xe=lBe;var dBe=new h,uBe=new h,ky={};ky.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};ky.triangulate=function(e,t){let n=k.packArray(e);return $Q(n,t,2)};var Bhe=new h,zhe=new h,Hhe=new h,Uhe=new h,Dhe=new h,Ohe=new h,gb=new h,Khe=new k,Jhe=new k,jhe=new k,A1=new k;ky.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,Bhe),L=h.fromArray(d,C*3,zhe),F=h.fromArray(d,R*3,Hhe),I,N,g;r&&(I=k.fromArray(u,E*2,Khe),N=k.fromArray(u,C*2,Jhe),g=k.fromArray(u,R*2,jhe));let V=h.multiplyByScalar(h.normalize(A,Uhe),y,Uhe),G=h.multiplyByScalar(h.normalize(L,Dhe),y,Dhe),v=h.multiplyByScalar(h.normalize(F,Ohe),y,Ohe),X=h.magnitudeSquared(h.subtract(V,G,gb)),Y=h.magnitudeSquared(h.subtract(G,v,gb)),D=h.magnitudeSquared(h.subtract(v,V,gb)),M=Math.max(X,Y,D),O,w,z;M>S?X===M?(O=`${Math.min(E,C)} ${Math.max(E,C)}`,a=f[O],l(a)||(w=h.add(A,L,gb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(I,N,A1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(E,a,R),s.push(a,C,R)):Y===M?(O=`${Math.min(C,R)} ${Math.max(C,R)}`,a=f[O],l(a)||(w=h.add(L,F,gb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(N,g,A1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(C,a,E),s.push(a,R,E)):D===M&&(O=`${Math.min(R,E)} ${Math.max(R,E)}`,a=f[O],l(a)||(w=h.add(F,A,gb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(g,I,A1),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 mBe=new pe,hBe=new pe,fBe=new pe,n8=new pe;ky.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,Bhe),I=h.fromArray(d,A*3,zhe),N=h.fromArray(d,E*3,Hhe),g,V,G;r&&(g=k.fromArray(u,L*2,Khe),V=k.fromArray(u,A*2,Jhe),G=k.fromArray(u,E*2,jhe));let v=e.cartesianToCartographic(F,mBe),X=e.cartesianToCartographic(I,hBe),Y=e.cartesianToCartographic(N,fBe);S.setEndPoints(v,X);let D=S.surfaceDistance;Z.setEndPoints(X,Y);let M=Z.surfaceDistance;R.setEndPoints(Y,v);let O=R.surfaceDistance,w=Math.max(D,M,O),z,K,te,H,$;w>_?D===w?(z=`${Math.min(L,A)} ${Math.max(L,A)}`,a=f[z],l(a)||(K=S.interpolateUsingFraction(.5,n8),te=(v.height+X.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,gb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(g,V,A1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(L,a,E),s.push(a,A,E)):M===w?(z=`${Math.min(A,E)} ${Math.max(A,E)}`,a=f[z],l(a)||(K=Z.interpolateUsingFraction(.5,n8),te=(X.height+Y.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,gb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(V,G,A1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(A,a,L),s.push(a,E,L)):O===w&&(z=`${Math.min(E,L)} ${Math.max(E,L)}`,a=f[z],l(a)||(K=R.interpolateUsingFraction(.5,n8),te=(Y.height+v.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,gb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(G,g,A1),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)};ky.scaleToGeodeticHeight=function(e,t,n,i){n=n??ne.default;let o=dBe,r=uBe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a0&&(S.push(new Uint8Array(M)),Z+=M)}function C(M,O){R();let w=Z;S.push(new Uint8Array(M.buffer,M.byteOffset,M.byteLength)),Z+=M.byteLength;let z=y.length;return y.push({buffer:0,byteOffset:w,byteLength:M.byteLength,target:O}),z}function E(M,O){let w=C(M,O.target),z=St.getComponentCount(O.type),K={bufferView:w,byteOffset:0,componentType:O.componentType,count:M.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(M){let O=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,z=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,te=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY;for(let $=0;$K&&(K=ee),le>te&&(te=le),_e>H&&(H=_e)}return{min:[O,w,z],max:[K,te,H]}}function L(M,O,w){if(w.length===0)return;let z=new Uint32Array(w),K=E(z,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER});M._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(M,O){O=O??4;let w=(O-Z%O)%O;w>0&&(S.push(new Uint8Array(w)),Z+=w);let z=Z;S.push(M),Z+=M.byteLength;let K=y.length;return y.push({buffer:0,byteOffset:z,byteLength:M.byteLength}),K}function I(){if(f.size===0)return;let M=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=M.get(te);l(le)?le!==ee&&M.set(te,"STRING"):M.set(te,ee)}if(M.size===0)return;let O={};for(let[K,te]of M)te==="SCALAR"?O[K]={type:"SCALAR",componentType:"FLOAT64"}:te==="BOOLEAN"?O[K]={type:"BOOLEAN"}:O[K]={type:"STRING"};let w={},z=b.size;for(let[K,te]of M)if(te==="SCALAR"){let H=new Float64Array(z);for(let ee=0;ee>3]|=1<<(le&7));let ee=F($);w[K]={values:ee}}else{let H=new TextEncoder,$=[],ee=new Uint32Array(z+1),le=0;for(let Ge=0;Ge0&&ut.push(bt);for(let jn of Mi)Et.push(new k(jn.x,jn.y)),o8(jn,i,o,r,O,i8,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;pt0&&H[H.length-1]===p&&H.pop();let Fe=[];if(w.length>0){let Be=new Float32Array(w),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,Mi={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(Mi,jn,le),Fe.push({mode:Ie.TRIANGLES,indices:bt,attributes:Mi,extensions:jn})}if(Fe.length===0)continue;let tt=N.length;N.push({primitives:Fe}),g.push({name:M.name,mesh:tt,translation:V})}if(g.length===0)return;let G=I(),v=ZBe(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((M,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}),SBe(D,v)}function gBe(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function yBe(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 xBe(e){let t=[];for(let n of e){let i=_Be(n);if(i.length<3)continue;TBe(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function TBe(e){let t=0;for(let n=0,i=e.length-1;n1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function o8(e,t,n,i,o,r,s,a){let c=1<hn.clampToLimits(e,hn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:il.UNSIGNED_INTEGER,downcastFunction:e=>hn.clampToLimits(e,hn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:il.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:il.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!==il.FLOAT};hn.isUnsignedIntegerType=function(e){return hn.typeInfo[e].category===il.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 Hyn=x(T(),1);function PBe(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 Ot({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var $v=PBe;function XBe(e){let{names:t,types:n,componentTypes:i,minimumValues:o,maximumValues:r}=e;for(let s=0;s1))return new Pp({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +else if (endPoint0Distance > 0.0) { - material.diffuse = fsInput.metadata.${e}.rgb; - material.alpha = fsInput.metadata.${e}.a; -}`})}function wBe(e,t,n){let o=Jv([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 $v({typedArray:o,width:128,height:1});return new Pp({uniforms:{u_colorMap:{type:Ip.SAMPLER_2D,value:r},u_minimumValue:{type:Ip.FLOAT,value:t[0]},u_maximumValue:{type:Ip.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 L1=XBe;var W_n=x(T(),1);var Exn=x(T(),1);var axn=x(T(),1);function W1(e,t){this._distance=t,this._normal=new ife(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(W1.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)}}});W1.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new W1(e.normal,e.distance),t};W1.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new W1(e.normal,e.distance)};function ife(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(ife.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 ea=W1;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?cfe:lfe,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;s magnitude) +{ +culledByNearPlane = true; } -`;var bTn=x(T(),1),o2=`#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); +else +{ +p0 = p0 + t * direction; +p0.z = min(p0.z, -czm_currentFrustum.x); +clipped = true; } -#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); } -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; +clippedPositionEC = vec4(p0, 1.0); +positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); } -float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); -return vec4(entry.xyz, stepSize); +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); } -vec2 packIntToVec2(int value) { -float shifted = float(value) / 255.0; -float lowBits = fract(shifted); -float highBits = floor(shifted) / 255.0; -return vec2(highBits, lowBits); +else { +lineDir = normalize(nextWindow.xy - positionWindow.xy); } -vec2 packFloatToVec2(float value) { -float lowBits = fract(value); -float highBits = floor(value) / 255.0; -return vec2(highBits, lowBits); +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); } -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); +vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); +vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); +if (prevSegmentCulled) +{ +directionToPrevWC = -directionToNextWC; } -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); +else if (nextSegmentCulled) +{ +directionToNextWC = -directionToPrevWC; } -return Ray(origin, direction); +vec2 thisSegmentForwardWC, otherSegmentForwardWC; +if (usePrevious) +{ +thisSegmentForwardWC = -directionToPrevWC; +otherSegmentForwardWC = directionToNextWC; } -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); +else +{ +thisSegmentForwardWC = directionToNextWC; +otherSegmentForwardWC = -directionToPrevWC; } -void main() +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)) { -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; +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); } -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 -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; +vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; +return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; } -if (step.w == 0.0) { -step.w = 0.001; +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); } -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; +`;var x3e=`#define CLIP_POLYLINE +${wl} +${t2}`,T3e=f_;function S_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=S_.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??x3e,this._fragmentShaderSource=e.fragmentShaderSource??T3e,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(S_.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});S_.VERTEX_FORMAT=Me.POSITION_ONLY;S_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;S_.prototype.isTranslucent=Go.prototype.isTranslucent;S_.prototype.getRenderState=Go.prototype.getRenderState;var ws=S_;var xgn=x(T(),1);var agn=x(T(),1),n2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; +out float v_width; +out vec2 v_st; +out float v_polylineAngle; +void main() +{ +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = czm_computePosition(); +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_width = width; +v_st.s = st.s; +v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); +v_polylineAngle = angle; } +`;var lgn=x(T(),1),Z_=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; #endif -} -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 -out_FragColor = colorAccum; -#endif -} -`;var yTn=x(T(),1),r2=`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 TTn=x(T(),1),s2=`#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -struct RayShapeIntersection { -vec4 entry; -vec4 exit; -}; -vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1) -{ -if (intersect0.w == NO_HIT) { -return intersect1; -} else if (intersect1.w == NO_HIT) { -return intersect0; -} -return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; -} -vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) -{ -return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; -} -RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) +in vec2 v_st; +void main() { -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; +czm_materialInput materialInput; +vec2 st = v_st; +st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); +materialInput.s = st.s; +materialInput.st = st; +materialInput.str = vec3(st, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE +out_FragColor *= u_highlightColor; #endif -}; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ -return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +czm_writeLogDepth(); } -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +`;var _3e=`#define CLIP_POLYLINE +${wl} +${n2}`,S3e=Z_;function R_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=R_.VERTEX_FORMAT;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??_3e,this._fragmentShaderSource=e.fragmentShaderSource??S3e,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(R_.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}}});R_.VERTEX_FORMAT=Me.POSITION_AND_ST;R_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;R_.prototype.isTranslucent=Go.prototype.isTranslucent;R_.prototype.getRenderState=Go.prototype.getRenderState;var sc=R_;function bb(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=pfe(!1),this._renderState3DTiles=pfe(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},depthTest:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(bb.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}}});bb.initializeTerrainHeights=function(){return Pi.initialize()};function Z3e(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(e2);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()($v);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Qv),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()(qv);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 pfe(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 R3e(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof ws?{}: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))})};bb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};bb.isSupported=function(e){return e.frameState.context.depthTexture};bb.prototype.isDestroyed=function(){return!1};bb.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 Oh=bb;var xyn=x(T(),1);var myn=x(T(),1);var ryn=x(T(),1);var V3e=new k(1,1),E3e=!1,A3e=U.WHITE;function Z1(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(Z1.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")});Z1.prototype.getType=function(e){return"Image"};var G3e=new Q;Z1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(G3e)),l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,V3e,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,A3e,t.color),j.getValueOrDefault(this._transparent,e,E3e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};Z1.prototype.equals=function(e){return this===e||e instanceof Z1&&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 My=Z1;function L3e(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 My;return t.image=e,t}}function W3e(e,t){return be(e,t,L3e)}var sr=W3e;function i2(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(i2.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")});i2.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 i2(this)};i2.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 C_=i2;var Nyn=x(T(),1);var _yn=x(T(),1),gfe={FIXED:0,INERTIAL:1};Object.freeze(gfe);var Oi=gfe;var Gyn=x(T(),1);function R1(){ge.throwInstantiationError()}Object.defineProperties(R1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError},referenceFrame:{get:ge.throwInstantiationError}});R1.prototype.getValue=ge.throwInstantiationError;R1.prototype.getValueInReferenceFrame=ge.throwInstantiationError;R1.prototype.equals=ge.throwInstantiationError;var yfe=new q;R1.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,yfe);if(n===Oi.INERTIAL)return q.multiplyByVector(r,t,o);if(n===Oi.FIXED)return q.multiplyByVector(q.transpose(r,yfe),t,o)};var Bh=R1;function V_(e,t){this._definitionChanged=new Se,this._value=h.clone(e),this._referenceFrame=t??Oi.FIXED}Object.defineProperties(V_.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 v3e=new Q;V_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(v3e)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};V_.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)};V_.prototype.getValueInReferenceFrame=function(e,t,n){return Bh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};V_.prototype.equals=function(e){return this===e||e instanceof V_&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var kl=V_;var Oyn=x(T(),1);function o2(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(o2.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")});o2.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 o2(this)};o2.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 E_=o2;var Hyn=x(T(),1);function F3e(e){return e}function I3e(e,t){return be(e,t,F3e)}var Ul=I3e;var exn=x(T(),1);function r2(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(r2.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")});r2.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 r2(this)};r2.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 A_=r2;var axn=x(T(),1);function s2(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(s2.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")});s2.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 s2(this)};s2.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 G_=s2;var fxn=x(T(),1);function a2(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(a2.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")});a2.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 a2(this)};a2.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 L_=a2;var Txn=x(T(),1);function c2(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(c2.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")});c2.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 c2(this)};c2.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=c2;var jxn=x(T(),1);var Ixn=x(T(),1);var Cxn=x(T(),1);var P3e=new h(1,1,1),X3e=h.ZERO,N3e=Ne.IDENTITY;function xfe(e,t,n){this.translation=h.clone(e??X3e),this.rotation=Ne.clone(t??N3e),this.scale=h.clone(n??P3e)}xfe.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 wy=xfe;var YQ=new wy;function l2(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(l2.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 Y3e=new Q;l2.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Y3e)),l(t)||(t=new wy),t.translation=j.getValueOrClonedDefault(this._translation,e,YQ.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,YQ.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,YQ.scale,t.scale),t};l2.prototype.equals=function(e){return this===e||e instanceof l2&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var W_=l2;var Uxn=x(T(),1);function gb(e,t){this._propertyNames=[],this._definitionChanged=new Se,l(e)&&this.merge(e,t)}Object.defineProperties(gb.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 rze=new Q;V1.prototype.getValue=function(e,t){l(e)||(e=Q.now(rze));let n=j.getValueOrDefault(this._heightReference,e,He.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,He.NONE);if(n===He.NONE&&!vy(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,Rfe);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)};V1.prototype.isDestroyed=function(){return!1};V1.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var P_=V1;function sze(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 P_(this._scene,s,r)}}var _b=sze;var Cfe=h.ZERO,Vfe=new h,aze=new h,Efe=new U;function cze(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 cze(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,Efe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Cfe,Vfe))),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,Efe),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,Cfe,Vfe))),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=_b;Su.DynamicGeometryUpdater=E1;function E1(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(E1.prototype=Object.create(Li.prototype),E1.prototype.constructor=E1);E1.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,aze),o=this._options.dimensions;return!l(i)||!l(o)||Li.prototype._isHidden.call(this,e,t,n)};E1.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 _2=Su;var aZn=x(T(),1);function X_(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(X_.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var lze=new Q;X_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(lze)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};X_.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};X_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Bh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};X_.prototype.equals=function(e){return this===e||e instanceof X_&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var S2=X_;var x1i=x(T(),1);var c1i=x(T(),1);var hZn=x(T(),1);var lZn=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 Afe(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),Ife=typeof Symbol>"u"?null:fa(Symbol.prototype.toString),Wd=fa(Object.prototype.hasOwnProperty),C2=fa(Object.prototype.toString),$c=fa(RegExp.prototype.test),N_=Zze(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]:V2;if(Gfe&&Gfe(e,null),!G1(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(pze(t)||(t[i]=r),o=r)}e[o]=!0}return e}function Rze(e){for(let t=0;t/g),Wze=ac(/\${[\w\W]*/g),vze=ac(/^data-[\-\w.\u00B7-\uFFFF]+$/),Fze=ac(/^aria-[\-\w]+$/),Mfe=ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ize=ac(/^(?:\w+script|data):/i),Pze=ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xze=ac(/^html$/i),Nze=ac(/^[a-z][.\w]*(-[.\w]+)+$/i),wfe=ac(/<[/\w!]/g),kfe=ac(/<[/\w]/g),Yze=ac(/<\/no(script|embed|frames)/i),Mze=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},Bfe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],wze=Xa(Lo({},Bfe)),kze=(function(){let e={};return Y_(Bfe,t=>{e[t]=ac(new RegExp("])","i"))}),Xa(e)})(),Uze=function(){return typeof window>"u"?null:window},Dze=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}},Ufe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ky=function(t,n,i,o){return Wd(t,n)&&G1(t[n])?Lo(o.base?Ru(o.base):{},t[n],o.transform):i},zQ=function(t,n,i){let o=Wd(t,n)?t[n]:void 0;return o&&typeof o=="object"?Ru(o):i()};function zfe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uze(),t=Vt=>zfe(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 N_('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=Dze(m,o),V=!0),g},M=n,O=M.implementation,w=M.createNodeIterator,z=M.createDocumentFragment,K=M.getElementsByTagName,te=i.importNode,H=Ufe();t.isSupported=typeof Dfe=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;let $=Gze,ee=Lze,le=Wze,_e=vze,he=Fze,Ze=Ize,ye=Pze,Ge=Nze,Ae=Mfe,Fe=null,tt=Lo({},[...Pfe,...UQ,...DQ,...OQ,...Xfe]),Be=null,je=Lo({},[...Nfe,...BQ,...Yfe,...dO]),qe=Object.seal(A1(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(A1(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,Mi=null,jn=null,Si=!1,Hi=!1,Gi=!1,pi=!1,Zi=!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"]),yi=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",Mn="http://www.w3.org/1999/xhtml",Ki=Mn,wi=!1,Xo=null,Dc=Lo({},[mo,Qr,Mn],kQ),pm=Xa(["mi","mo","mn","ms","mtext"]),bp=Lo({},pm),Lh=Xa(["annotation-xml"]),ua=Lo({},Lh),gp=Lo({},["title","style","font","a","script"]),Ps=null,$a=["application/xhtml+xml","text/html"],BT="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?BT:Te.PARSER_MEDIA_TYPE,si=Ps==="application/xhtml+xml"?kQ:V2,Fe=ky(Te,"ALLOWED_TAGS",tt,{transform:si}),Be=ky(Te,"ALLOWED_ATTR",je,{transform:si}),Xo=ky(Te,"ALLOWED_NAMESPACES",Dc,{transform:kQ}),yi=ky(Te,"ADD_URI_SAFE_ATTR",fr,{transform:si,base:fr}),Hs=ky(Te,"ADD_DATA_URI_TAGS",or,{transform:si,base:or}),hr=ky(Te,"FORBID_CONTENTS",Is,{transform:si}),We=ky(Te,"FORBID_TAGS",Ru({}),{transform:si}),Ke=ky(Te,"FORBID_ATTR",Ru({}),{transform:si}),Po=Wd(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,pi=Te.RETURN_TRUSTED_TYPE||!1,Si=Te.FORCE_BODY||!1,Zi=Te.SANITIZE_DOM!==!1,On=Te.SANITIZE_NAMED_PROPS||!1,Hn=Te.KEEP_CONTENT!==!1,$i=Te.IN_PLACE||!1,Ae=Vze(Te.ALLOWED_URI_REGEXP)?Te.ALLOWED_URI_REGEXP:Mfe,Ki=typeof Te.NAMESPACE=="string"?Te.NAMESPACE:Mn,bp=zQ(Te,"MATHML_TEXT_INTEGRATION_POINTS",()=>Lo({},pm)),ua=zQ(Te,"HTML_INTEGRATION_POINTS",()=>Lo({},Lh));let Ye=zQ(Te,"CUSTOM_ELEMENT_HANDLING",()=>A1(null));if(qe=A1(null),Wd(Ye,"tagNameCheck")&&K0(Ye.tagNameCheck)&&(qe.tagNameCheck=Ye.tagNameCheck),Wd(Ye,"attributeNameCheck")&&K0(Ye.attributeNameCheck)&&(qe.attributeNameCheck=Ye.attributeNameCheck),Wd(Ye,"allowCustomizedBuiltInElements")&&typeof Ye.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=Ye.allowCustomizedBuiltInElements),ac(qe),ht&&(zt=!1),Gi&&(Hi=!0),Po&&(Fe=Lo({},Xfe),Be=A1(null),Po.html===!0&&(Lo(Fe,Pfe),Lo(Be,Nfe)),Po.svg===!0&&(Lo(Fe,UQ),Lo(Be,BQ),Lo(Be,dO)),Po.svgFilters===!0&&(Lo(Fe,DQ),Lo(Be,BQ),Lo(Be,dO)),Po.mathMl===!0&&(Lo(Fe,OQ),Lo(Be,Yfe),Lo(Be,dO))),ct.tagCheck=null,ct.attributeCheck=null,Wd(Te,"ADD_TAGS")&&(typeof Te.ADD_TAGS=="function"?ct.tagCheck=Te.ADD_TAGS:G1(Te.ADD_TAGS)&&(Fe===tt&&(Fe=Ru(Fe)),Lo(Fe,Te.ADD_TAGS,si))),Wd(Te,"ADD_ATTR")&&(typeof Te.ADD_ATTR=="function"?ct.attributeCheck=Te.ADD_ATTR:G1(Te.ADD_ATTR)&&(Be===je&&(Be=Ru(Be)),Lo(Be,Te.ADD_ATTR,si))),Wd(Te,"ADD_FORBID_CONTENTS")&&G1(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 N_('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw N_('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({},[...UQ,...DQ,...Eze]),Ty=Lo({},[...OQ,...Aze]),oj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="svg":Ye.namespaceURI===mo?Te==="svg"&&(yt==="annotation-xml"||bp[yt]):!!yp[Te]},rj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="math":Ye.namespaceURI===Qr?Te==="math"&&ua[yt]:!!Ty[Te]},sj=function(Te,Ye,yt){return Ye.namespaceURI===Qr&&!ua[yt]||Ye.namespaceURI===mo&&!bp[yt]?!1:!Ty[Te]&&(gp[Te]||!yp[Te])},aj=function(Te){let Ye=S(Te);(!Ye||!Ye.tagName)&&(Ye={namespaceURI:Ki,tagName:"template"});let yt=V2(Te.tagName),an=V2(Ye.tagName);return Xo[Te.namespaceURI]?Te.namespaceURI===Qr?oj(yt,Ye,an):Te.namespaceURI===mo?rj(yt,Ye,an):Te.namespaceURI===Mn?sj(yt,Ye,an):!!(Ps==="application/xhtml+xml"&&Xo[Te.namespaceURI]):!1},xp=function(Te){Z2(t.removed,{element:Te});try{S(Te).removeChild(Te)}catch{if(f(Te),!S(Te))throw N_("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},BR=function(Te,Ye,yt){try{Te.removeAttributeNode(Ye)}catch{try{Te.removeAttribute(yt)}catch{}}},zT=function(Te){HT(Te);let Ye=_(Te);if(Ye){let an=[];Y_(Ye,Ln=>{Z2(an,Ln)}),Y_(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"&&BR(Te,Ln,ai)}},Wh=function(Te,Ye,yt){if(!yt)try{yt=Ye.getAttributeNode(Te)}catch{yt=null}Z2(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{}},cj=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)]||BR(Te,an,Ln)}},HT=function(Te){let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop();L(yt)===Zu.element&&cj(yt);let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},zR=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(kfe,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")&&zR("for",Er)&&ai.removeAttribute("for")}catch{}}let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},KT=function(Te){let Ye=null,yt=null;if(Si)Te=""+Te;else{let ai=Wfe(Te,/^[\r\n\t ]+/);yt=ai&&ai[0]}Ps==="application/xhtml+xml"&&Ki===Mn&&(Te=''+Te+"");let an=I?X(Te):Te;if(Ki===Mn)try{Ye=new u().parseFromString(an,Ps)}catch{}if(!Ye||!Ye.documentElement){Ye=O.createDocument(Ki,"template",null);try{Ye.documentElement.innerHTML=wi?N:an}catch{}}let Ln=Ye.body||Ye.documentElement;return Te&&yt&&Ln.insertBefore(n.createTextNode(yt),Ln.childNodes[0]||null),Ki===Mn?K.call(Ye,st?"html":"body")[0]:st?Ye.documentElement:Ln},DA=function(Te){let Ye=A?A(Te):Te.ownerDocument;return w.call(Ye||Te,Te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},HR=function(Te){return Te=R2(Te,$," "),Te=R2(Te,ee," "),Te=R2(Te,le," "),Te},_y=function(Te){var Ye;Te.normalize();let yt=A?A(Te):Te.ownerDocument,an=w.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=HR(Ln.data),Ln=an.nextNode();let ai=(Ye=Te.querySelectorAll)===null||Ye===void 0?void 0:Ye.call(Te,"template");ai&&Y_(ai,Er=>{oe(Er.content)&&_y(Er.content)})},de=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&&Y_(Vt,yt=>{yt.call(t,Te,Ye,qo)})}let et=function(Te,Ye){return!!(jt&&Te.hasChildNodes()&&!Re(Te.firstElementChild)&&$c(wfe,Te.textContent)&&$c(wfe,Te.innerHTML)||jt&&Te.namespaceURI===Mn&&wze[Ye]&&(Re(Te.firstElementChild)||typeof Te.textContent=="string"&&$c(kze[Ye],Te.textContent))||Te.nodeType===Zu.processingInstruction||jt&&Te.nodeType===Zu.comment&&$c(kfe,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&&HT(Te),!0)},Kn=function(Te,Ye){if(Ve(H.beforeSanitizeElements,Te,null),Sn(Te,Ye))return!0;if(de(Te))return xp(Te),!0;let yt=si(F(Te));if(Fe=Gt(H.uponSanitizeElement,Fe,tt,Mi),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&&!aj(Te)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&&$c(Yze,Te.innerHTML))return xp(Te),!0;if(ht&&Te.nodeType===Zu.text){let Ln=HR(Te.textContent);Te.textContent!==Ln&&(Z2(t.removed,{element:Te.cloneNode()}),Te.textContent=Ln)}return Ve(H.afterSanitizeElements,Te,null),!1},xn=function(Te,Ye,yt){if(Ke[Ye]||zR(Ye,Te)||Zi&&(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?yi[Ye]||$c(Ae,R2(yt,ye,""))||(Ye==="src"||Ye==="xlink:href"||Ye==="href")&&Te!=="script"&&vfe(yt,"data:")===0&&Hs[Te]||ut&&!$c(Ze,R2(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[V2(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),de(Te)?xp(Te):Lfe(t.removed)}catch{Wh(Ye,Te)}},Ll=function(Te){Ve(H.beforeSanitizeAttributes,Te,null);let Ye=Te.attributes;if(!Ye||de(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,Sd=ai.value,Zd=si(Er),lj=Sd,Wl=Er==="value"?lj:Tze(lj);if(yt.attrName=Zd,yt.attrValue=Wl,yt.keepAttr=!0,yt.forceKeepAttr=void 0,Ve(H.uponSanitizeAttribute,Te,yt),Wl=yt.attrValue,On&&(Zd==="id"||Zd==="name")&&vfe(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(Zd==="attributename"&&Wfe(Wl,"href")){Wh(Er,Te,ai);continue}if(!yt.forceKeepAttr){if(!yt.keepAttr){Wh(Er,Te,ai);continue}if(!bt&&$c(Mze,Wl)){Wh(Er,Te,ai);continue}if(ht&&(Wl=HR(Wl)),!xn(Ln,Zd,Wl)){Wh(Er,Te,ai);continue}Wl=Ks(Ln,Zd,ds,Wl),Wl!==lj&&Rc(Te,Er,ds,Wl)}}Ve(H.afterSanitizeAttributes,Te,null)},_d=function(Te){let Ye=null,yt=DA(Te);for(Ve(H.beforeSanitizeShadowDOM,Te,null);Ye=yt.nextNode();)if(Ve(H.uponSanitizeShadowNode,Ye,null),Kn(Ye,Te),Ll(Ye),oe(Ye.content)&&_d(Ye.content),L(Ye)===Zu.element){let an=Z(Ye);oe(an)&&(J0(an),_d(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){_d(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 Sd=an.content;oe(Sd)&&Ye.push({node:Sd,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(wi=!Vt,wi&&(Vt=""),typeof Vt!="string"&&!Re(Vt)&&(Vt=Cze(Vt),typeof Vt!="string"))throw N_("dirty is not a string, aborting");if(!t.isSupported)return Vt;pt?(Fe=Mi,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 Sd=F(Vt);if(typeof Sd=="string"){let Zd=si(Sd);if(!Fe[Zd]||We[Zd])throw zT(Vt),N_("root node is forbidden and cannot be sanitized in-place")}if(de(Vt))throw zT(Vt),N_("root node is clobbered and cannot be sanitized in-place");try{J0(Vt)}catch(Zd){throw zT(Vt),Zd}}else if(Re(Vt))Ye=KT(""),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&&pi?X(Vt):Vt;if(Ye=KT(Vt),!Ye)return Hi?null:pi?N:""}Ye&&Si&&xp(Ye.firstChild);let Er=ai?Vt:Ye;try{let Sd=DA(Er);for(;an=Sd.nextNode();)Kn(an,Er),Ll(an),oe(an.content)&&_d(an.content)}catch(Sd){throw ai&&(zT(Vt),Y_(t.removed,Zd=>{Zd.element&&HT(Zd.element)})),Sd}if(ai)return Y_(t.removed,Sd=>{Sd.element&&HT(Sd.element)}),ht&&_y(Vt),Vt;if(Hi){if(ht&&_y(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(Xze,Ye.ownerDocument.doctype.name)&&(ds=" +`+ds),ht&&(ds=HR(ds)),I&&pi?X(ds):ds},t.setConfig=function(){let Vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(Vt),pt=!0,Mi=Fe,jn=Be},t.clearConfig=function(){qo=null,pt=!1,Mi=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"&&Wd(H,Vt)&&Z2(H[Vt],Te)},t.removeHook=function(Vt,Te){if(Wd(H,Vt)){if(Te!==void 0){let Ye=yze(H[Vt],Te);return Ye===-1?void 0:xze(H[Vt],Ye,1)[0]}return Lfe(H[Vt])}},t.removeHooks=function(Vt){Wd(H,Vt)&&(H[Vt]=[])},t.removeAllHooks=function(){H=Ufe()},t}var Hfe=zfe();var Oze=0,JQ={},jQ=class e{constructor(t,n){let i,o=t;l(JQ[o])?i=JQ[o]:(i=Oze++,JQ[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=Hfe.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 zze(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}}E2.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&&(zze(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)};E2.prototype.isDestroyed=function(){return!1};E2.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var w_=E2;var HZn=x(T(),1),$Q=x(bu(),1);var MZn=x(T(),1);var qQ,Kfe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",uO={};uO.defaultAccessToken=Kfe;uO.defaultServer=new ve({url:"https://api.cesium.com/"});uO.getDefaultTokenCredit=function(e){if(e===Kfe){if(!l(qQ)){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.`;qQ=new Lt(t,!0)}return qQ}};var vd=uO;function el(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Hze};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 $Q.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=vd.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 $Q.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(e.headers=e8(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??vd.defaultServer,i=t.accessToken??vd.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=e8(o.headers),n.getDerivedResource(o)};function e8(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}el._addClientHeaders=e8;function Hze(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 JZn=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 Bl=vp;var $Zn=x(T(),1);function mO(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}mO.ALL=Object.freeze(new mO({color:new U(0,0,0,0),depth:1,stencil:0}));mO.prototype.execute=function(e,t){e.clear(this,t)};var mi=mO;var iRn=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 aSi=x(T(),1);var dRn=x(T(),1);function Gm(e){this.planes=e??[]}var A2=[new h,new h,new h];h.clone(h.UNIT_X,A2[0]);h.clone(h.UNIT_Y,A2[1]);h.clone(h.UNIT_Z,A2[2]);var Uy=new h,Kze=new h,Jfe=new cn(new h(1,0,0),0);function jfe(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Gm.fromBoundingSphere=function(e,t){l(t)||(t=new Gm);let n=A2.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 G2(e,t,n){return t<=e&&e<=n}function qze(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 $fe(e){let t=e._textureDimensions;return t.x*t.y*4}function epe(e){if(!l(e._batchValues)){let t=$fe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function tpe(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=tpe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=epe(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=$fe(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; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${ZHe(i)}${s}`}};function ope(e,t){return e=Je.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function RHe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};function CHe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Pd.HIGHLIGHT)return 0;if(n===Pd.REPLACE)return 1;if(n===Pd.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 CHe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var By={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=VHe(this);for(let d=t;d>>Jt.SKIP_LOD_BIT_SHIFT}function IHe(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 PHe(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(),ue(this)};var $h=jo;var dVn=x(T(),1);var eCn=x(T(),1);function XHe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Pp=XHe;var qCn=x(T(),1);var nCn=x(T(),1),L1=`in vec3 position; +in float a_batchId; +uniform mat4 u_modifiedModelViewProjection; +void main() { -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; +gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; +`;var sCn=x(T(),1);var r8=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=r8;var SCn=x(T(),1);var lCn=x(T(),1),s8=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)})}},a8=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)})}},Xd=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"});Xd.max_unop_len=Xd.getMaxKeyLen(Xd.unary_ops);Xd.max_binop_len=Xd.getMaxKeyLen(Xd.binary_ops);var zy=e=>new Xd(e).parse(),YHe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Xd).filter(e=>!YHe.includes(e)&&zy[e]===void 0).forEach(e=>{zy[e]=Xd[e]});zy.Jsep=Xd;var MHe="ConditionalExpression",wHe={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:MHe,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 :")}})}};zy.plugins.register(wHe);var uCn=x(T(),1),ape={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(ape);var Pt=ape;function ef(e,t){this._expression=e,e=$He(e,t),e=tKe(eKe(e)),zy.addBinaryOp("=~",0),zy.addBinaryOp("!~",0);let n;try{n=zy(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}; } -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 STn=x(T(),1),a2=`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 RTn=x(T(),1),c2=`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 VTn=x(T(),1),v1=`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 ATn=x(T(),1),l2=`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 LTn=x(T(),1),d2=`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 vTn=x(T(),1),u2=`#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)); -} -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); -} -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 = u_ellipsoidRadii.x * inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; -} -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; -} -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; -} -} -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); -} -float tmin = intersect.x; -float tmax = intersect.y; -vec3 p0 = ray.pos + tmin * ray.dir; -vec3 p1 = ray.pos + tmax * ray.dir; -vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); -vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); -bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); -bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); -if (p0InShadowCone && p1InShadowCone) { -return RayShapeIntersection(miss, miss); -} else if (p0InShadowCone) { -return RayShapeIntersection(intersect1, farSide); -} else if (p1InShadowCone) { -return RayShapeIntersection(-1.0 * farSide, intersect0); -} else { -return RayShapeIntersection(intersect0, intersect1); -} -} -void intersectShape(in Ray ray, 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 -#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 ITn=x(T(),1),Z_=`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; -} -} -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; -} -`;var XTn=x(T(),1),m2=`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); -} -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 YTn=x(T(),1),h2=`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); -} -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); -} -#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 wTn=x(T(),1),f2=`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; -} -return vec3(v * sign(pos), length(v - evolute)); -} -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); -} -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); -} -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 UTn=x(T(),1),p2=`#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 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); -} -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { -return float(normU8x2_toInt(value)) / 65535.0; -} -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { -vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); -OctreeNodeData data; -data.data = normU8x2_toInt(texData.xy); -data.flag = normU8x2_toInt(texData.zw); -return data; -} -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { -int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; -int octreeCoordX = (parentOctreeIndex % u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; -int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; -vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); -return getOctreeNodeData(octreeUv); -} -int getOctreeParentIndex(in int octreeIndex) { -int octreeCoordX = (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 -#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); -} -#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; -} -traversalData.parentOctreeIndex = childData.data; -} -return childData; -} -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 -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(tileAndUv, sampleDatas[0]); -addSampleCoordinates(tileAndUv, sampleDatas[1]); -#endif -} -bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { -int levelDifference = tileCoordinate.w - octreeCoords.w; -if (levelDifference < 0) { -return false; -} -ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; -return coordinateAtLevel == octreeCoords.xyz; -} -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]); -} -return; -} -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); -} -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 -} -`;var OTn=x(T(),1),b2=`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); -} -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 zTn=x(T(),1),gfe={Z_UP:0,Y_UP:1};Object.freeze(gfe);var Xp=gfe;function n3e(e){let t=new Tb;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([r2]),e.provider.metadataOrder===Xp.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",p2,i2,b2,s2,c2,a2]),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([m2,l2,Z_]):d==="CYLINDER"?t.addFragmentLines([h2,v1,d2,Z_]):d==="ELLIPSOID"&&t.addFragmentLines([f2,v1,u2,Z_]),t.addFragmentLines([o2]);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 g2=n3e;var yfe=new k;function i3e(e,t){let n=new g2(e);e2(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=xs.getTextureResolution(o,t,yfe),A=xfe(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=xb.getTextureResolution(s,t,yfe),A=xfe(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:ki.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 xfe(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 y2=i3e;var WZn=x(T(),1);var U_n=x(T(),1);var M_n=x(T(),1),no=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-no.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?no.Bounce.In(e*2)*.5:no.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?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}}}}),x2=function(){return performance.now()},o3e=(function(){function e(){for(var t=[],n=0;n0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?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=F1.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=F1.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[n1;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}}},Tfe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),l8=new o3e,_fe=(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=no.Linear.None,this._interpolationFunction=F1.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Tfe.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=l8,l8.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=x2()),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"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=x2()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=x2()),!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;tc)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;bW.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),M=Math.atan2(b*A,_-Z*E),O=Math.atan2(m*A,_*E-Z);e._distance=D,e._startHeading=M,e._endHeading=O,e._uSquared=V}var l3e=new h,d8=new h;function Zfe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,d8),l3e),r=h.normalize(i.cartographicToCartesian(n,d8),d8);c3e(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,s3e(e)}function T2(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)&&Zfe(this,e,t,i)}Object.defineProperties(T2.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}}});T2.prototype.setEndPoints=function(e,t){Zfe(this,e,t,this._ellipsoid)};T2.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};T2.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)-Sfe(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 _b=T2;var Q_n=x(T(),1),u8;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?u8=function(){return performance.now()}:u8=function(){return Date.now()};var Zn=u8;var eSn=x(T(),1);function m8(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}m8.clone=function(e,t){if(l(e))return l(t)||(t=new m8),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Lm=m8;var VSn=x(T(),1);var iSn=x(T(),1);var h8={};h8.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Rfe(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 Dl=h8;var uSn=x(T(),1);var sSn=x(T(),1);var p8={};p8.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 f8(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,M=-g*X-V*v,O=g*v,w=(s*M-r*O)/(-r*M+s*D);return G<=w?G<=Y?w<=Y?[G,w,Y]:[G,Y,w]:[Y,G,w]:G<=Y?[w,G,Y]:w<=Y?[w,Y,G]:[Y,w,G]}p8.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Dl.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=Dl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return f8(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):f8(e,t,0,i);if(i===0)return o=Dl.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 f8(e,t,n,i)};var R_=p8;var b8={};b8.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 Hh(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=R_.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=Dl.computeRealRoots(1,m,p),y=Dl.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,Vfe),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,Vfe),f=h.dot(s,p)*_,f<0||b+f>1))return;y=h.dot(c,p)*_}return y};sr.rayTriangle=function(e,t,n,i,o,r){let s=sr.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 m3e=new gn;sr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=m3e;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=sr.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 h3e(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 b3e=new h,g3e=new h;sr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,b3e),o=h.multiplyComponents(n,e.direction,g3e),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 x8=new h,Efe=new h,Afe=new h,pO=new h,_3e=new h,S3e=new q,Z3e=new q,R3e=new q,C3e=new q,V3e=new q,Gfe=new q,Lfe=new q,Wfe=new h,E3e=new h,A3e=new pe;sr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let A=t.geodeticSurfaceNormal(n,x8);if(h.dot(i,A)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,x8),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,pO),c=h.normalize(h.cross(a,s,Efe),Efe),d=h.normalize(h.cross(s,c,Afe),Afe),u=S3e;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,Z3e),p=q.fromScale(t.radii,R3e),b=q.fromScale(t.oneOverRadii,C3e),f=V3e;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,Gfe),f,Gfe),_=q.multiply(q.multiply(y,p,Lfe),u,Lfe),S=q.multiplyByVector(y,n,_3e),Z=sr.quadraticVectorExpression(_,h.negate(S,x8),0,0,1),R,C,E=Z.length;if(E>0){let A=h.clone(h.ZERO,E3e),L=Number.NEGATIVE_INFINITY;for(let I=0;IL&&(L=g,A=h.clone(R,A))}let F=t.cartesianToCartographic(A,A3e);return L=W.clamp(L,0,1),C=h.magnitude(h.subtract(A,n,pO))*Math.sqrt(1-L*L),C=o?-C:C,F.height=C,t.cartographicToCartesian(F,new h)}};var G3e=new h;sr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,G3e),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};sr.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 sr.lineSegmentPlane(e,t,i,u),sr.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return sr.lineSegmentPlane(t,n,i,u),sr.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return sr.lineSegmentPlane(n,e,i,u),sr.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 sr.lineSegmentPlane(e,n,i,u),sr.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return sr.lineSegmentPlane(n,t,i,u),sr.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return sr.lineSegmentPlane(t,e,i,u),sr.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var Ti=sr;var kSn=x(T(),1);var PSn=x(T(),1);function Yp(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 qs,this._perspectiveMatrix=new P,this._infinitePerspective=new P}function T8(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(Yp.prototype,{projectionMatrix:{get:function(){return T8(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return T8(this),this._infinitePerspective}}});var L3e=new h,W3e=new h,v3e=new h,F3e=new h;Yp.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,L3e),m=W3e;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=v3e;h.multiplyByScalar(t,d,p),h.add(e,p,p);let b=F3e;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};Yp.prototype.getPixelDimensions=function(e,t,n,i,o){T8(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};Yp.prototype.clone=function(e){return l(e)||(e=new Yp),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};Yp.prototype.equals=function(e){return l(e)&&e instanceof Yp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Yp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Yp&&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 Ol=Yp;function Pd(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new Ol,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}Pd.packedLength=6;Pd.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};Pd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Pd),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 Kh(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(Pd.prototype,{projectionMatrix:{get:function(){return Kh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Kh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Kh(this),this._fovy}},sseDenominator:{get:function(){return Kh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Kh(this),this._offCenterFrustum}}});Pd.prototype.computeCullingVolume=function(e,t,n){return Kh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Pd.prototype.getPixelDimensions=function(e,t,n,i,o){return Kh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Pd.prototype.clone=function(e){return l(e)||(e=new Pd),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};Pd.prototype.equals=function(e){return!l(e)||!(e instanceof Pd)?!1:(Kh(this),Kh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Pd.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Pd)?!1:(Kh(this),Kh(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 ji=Pd;var $Sn=x(T(),1);var Nfe={};function I3e(e,t,n){let i,o,r;if(e instanceof ji){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 Ol)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var P3e=new h,Ife=new h;function Yfe(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 S8(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,P3e),b=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),Ife)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),Ife));r=Math.min(I3e(m,b,f)*.2,1e9)}if(se+Math.PI?e+=W.TWO_PI:tW.PI&&(t.longitude+=W.TWO_PI)}var M3e=new pe,w3e=new pe;function k3e(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,b=pe.clone(u.positionCartographic,M3e),f=u.pitch,y=Z2(u.heading,i),_=Z2(u.roll,r),S=p.cartesianToCartographic(n,w3e);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?N3e(b,S):Y3e(b,S);let R=S8(u,n,b.height,S.height,s),C=Yfe(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 U3e(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,Mfe),d=Z2(a.heading,i),u=a.frustum.right-a.frustum.left,m=S8(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 Pfe=new pe,D3e=new h;function _8(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Xfe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Nfe.createTween=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===se.MORPHING)return _8();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,Pfe),n=r.project(Pfe,D3e));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=Xfe(Z,t.complete),C=Xfe(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 _8(R,C);let L=new Array(4);if(L[se.SCENE2D]=U3e,L[se.SCENE3D]=k3e,L[se.COLUMBUS_VIEW]=X3e,f<=0)return _8(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=Ts.CUBIC_OUT:m=Ts.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:F,complete:R,cancel:C}};var R2=Nfe;var tZn=x(T(),1),wfe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(wfe);var Bl=wfe;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 ji,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,Qfe(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,lpe(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 Lm(0,-W.PI_OVER_FOUR,0);function Qfe(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 O3e(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(O3e(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;_R&&CL&&(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 B3e(e){_t.basisTo2D(e._projection,e._transform,e._actualTransform)}var z3e=new pe,H3e=new h,bO=new h,K3e=new ce,J3e=new ce,j3e=new ce,Q3e=new ce,q3e=new ce;function $3e(e){let t=e._projection,n=t.ellipsoid,i=P.getColumn(e._transform,3,K3e),o=n.cartesianToCartographic(i,z3e),r=t.project(o,H3e),s=J3e;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,q3e),c=ce.add(P.getColumn(e._transform,0,bO),i,bO);n.cartesianToCartographic(c,o),t.project(o,r);let d=j3e;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=Q3e;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=ce.add(P.getColumn(e._transform,1,bO),i,bO);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.EPSILON2){let y=1/h.magnitudeSquared(c),_=h.dot(c,s)*y,S=h.multiplyByScalar(s,_,Z8);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)&&Qfe(e)}function qfe(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 $fe(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function epe(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 xO=new P,TO=new P;Object.defineProperties(ln.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return sl(this),this._invTransform}},viewMatrix:{get:function(){return sl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return sl(this),this._invViewMatrix}},positionCartographic:{get:function(){return sl(this),this._positionCartographic}},positionWC:{get:function(){return sl(this),this._positionWC}},directionWC:{get:function(){return sl(this),this._directionWC}},upWC:{get:function(){return sl(this),this._upWC}},rightWC:{get:function(){return sl(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,xO),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,TO);this._setTransform(n);let i=qfe(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,xO),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,TO);this._setTransform(n);let i=$fe(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,xO),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,TO);this._setTransform(n);let i=epe(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&&ope(this,this.position)};var eze=new h,tze=new h,nze=new h;ln.prototype._setTransform=function(e){let t=h.clone(this.positionWC,eze),n=h.clone(this.upWC,tze),i=h.clone(this.directionWC,nze);P.clone(e,this._transform),this._transformChanged=!0,sl(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),sl(this)};var ize=new k,oze=new gn,rze=new h,sze=new h;function tpe(e){if(!P.equals(P.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=ize;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,oze);o=n.pickWorldCoordinates(a,t,!0,rze)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,sze));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 bn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=tpe(this)))};var _O=new h,A8=new P,aze=new P,G8=new Ne,L8=new q,npe=new pe;function cze(e,t,n){let i=P.clone(e.transform,A8),o=_t.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,aze);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,G8),s=q.fromQuaternion(r,L8);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 lze(e,t,n,i){let o=P.clone(e.transform,A8);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,npe);t=a.project(c,_O)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,G8),s=q.fromQuaternion(r,L8);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 dze(e,t,n,i){let o=P.clone(e.transform,A8);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,npe);t=c.project(d,_O)}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===Bl.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Ne.fromHeadingPitchRoll(n,G8),s=q.fromQuaternion(r,L8);q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var uze=new h,mze=new h,hze=new h;function ipe(e,t,n,i){let o=h.clone(n.direction,uze),r=h.clone(n.up,mze);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,c=_t.eastNorthUpToFixedFrame(t,a,xO),d=P.inverseTransformation(c,TO);P.multiplyByPointAsVector(d,o,o),P.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,hze);return i.heading=qfe(o,r),i.pitch=$fe(o),i.roll=epe(o,r,s),i}var E8={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},I1=new Vc;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,_O);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,_O),i=!1),l(t.direction)&&(t=ipe(this,o,t,E8.orientation)),I1.heading=t.heading??0,I1.pitch=t.pitch??-W.PI_OVER_TWO,I1.roll=t.roll??0,n===se.SCENE3D?cze(this,o,I1):n===se.SCENE2D?dze(this,o,I1,i):lze(this,o,I1,i)};var fze=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,fze).z),roll:0},endTransform:P.IDENTITY,convert:!1})}};ln.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ce),sl(this),P.multiplyByVector(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),sl(this),P.multiplyByPoint(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),sl(this),P.multiplyByPointAsVector(this._actualInvTransform,e,t)};ln.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ce),sl(this),P.multiplyByVector(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),sl(this),P.multiplyByPoint(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),sl(this),P.multiplyByPointAsVector(this._actualTransform,e,t)};function ope(e,t){let n=e._scene.mapMode2D===Bl.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 kfe=new h;ln.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,kfe),h.add(n,kfe,n),this._mode===se.SCENE2D&&ope(this,n),this._adjustOrthographicFrustum(!0)};ln.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?SO(this,e):this.move(this.direction,e)};ln.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?SO(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 pze=new Ne,bze=new q;ln.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Ne.fromAxisAngle(e,-n,pze),o=q.fromQuaternion(i,bze),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 gze=new Ne,yze=new q;ln.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Ne.fromAxisAngle(e,-n,gze),o=q.fromQuaternion(i,yze);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,rpe(this,e)};ln.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,rpe(this,-e)};var xze=new h,Tze=new h,_ze=new h,Ufe=new h;function rpe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,xze),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,Ufe),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,Tze),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,Ufe)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,_ze);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,spe(this,-e)};ln.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,spe(this,e)};function spe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function SO(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===Bl.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===Bl.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 ape(e,t){e.move(e.direction,t)}ln.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?SO(this,e):ape(this,e)};ln.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?SO(this,-e):ape(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 Sze=new P;ln.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ne.default,o=_t.eastNorthUpToFixedFrame(e,i,Sze);this.lookAtTransform(o,t)};var Zze=new h,Rze=new Ne,Cze=new Ne,Vze=new q;function cpe(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,Rze),r=Ne.fromAxisAngle(h.UNIT_Z,-e,Cze),s=Ne.multiply(r,o,r),a=q.fromQuaternion(s,Vze),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=cpe(t.heading,t.pitch,t.range,Zze):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)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=C2;I.longitude=u,I.latitude=s,I.height=0;let N=Gze;N.longitude=u,N.latitude=a,N.height=0;let g=Bfe;(!l(g)||g.ellipsoid!==o)&&(Bfe=g=new _b(void 0,void 0,o)),g.setEndPoints(I,N),m=g.interpolateUsingFraction(.5,C2).latitude}let p=C2;p.longitude=u,p.latitude=m,p.height=0;let b=o.cartographicToCartesian(p,Xze),f=C2;f.longitude=d,f.latitude=s;let y=o.cartographicToCartesian(f,Lze);f.longitude=c;let _=o.cartographicToCartesian(f,vze);f.longitude=u;let S=o.cartographicToCartesian(f,Ize);f.latitude=a;let Z=o.cartographicToCartesian(f,Pze);f.longitude=d;let R=o.cartographicToCartesian(f,Fze);f.longitude=c;let C=o.cartographicToCartesian(f,Wze);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 bn){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=C2;g.longitude=c,g.latitude=0,g.height=0;let V=o.cartographicToCartesian(g,R8);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,R8),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,R8),n)}var Yze=new pe,Mze=new h,wze=new h;function kze(e,t,n){let i=e._projection;t.west>t.east&&(t=re.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Yze;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Mze);P.multiplyByPoint(o,a,a),P.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,wze);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 Uze=new pe,Dze=new h,Oze=new h;function Bze(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Bl.INFINITE_SCROLL?o+=W.TWO_PI:(t=re.MAX_VALUE,o=t.east));let r=Uze;r.longitude=o,r.latitude=t.north;let s=i.project(r,Dze);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Oze),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 lpe(this,e,t);if(n===se.COLUMBUS_VIEW)return kze(this,e,t);if(n===se.SCENE2D)return Bze(this,e,t)};var zze=new gn;function Hze(e,t,n,i){n=n??ne.default;let o=e.getPickRay(t,zze),r=Ti.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var Kze=new gn;function Jze(e,t,n,i){let r=e.getPickRay(t,Kze).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 jze=new gn;function Qze(e,t,n,i){let o=e.getPickRay(t,jze),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=Hze(this,e,t,n);else if(this._mode===se.SCENE2D)n=Jze(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=Qze(this,e,this._projection,n);else return;return n}};var qze=new h,$ze=new h,eHe=new h;function tHe(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,qze);h.add(m,p,p);let b=h.multiplyByScalar(e.rightWC,d*c*a,$ze),f=h.multiplyByScalar(e.upWC,u*c*s,eHe),y=h.add(p,b,n.direction);return h.add(y,f,y),h.subtract(y,m,y),h.normalize(y,y),n}var gO=new h;function nHe(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,gO),h.add(gO,u,u),h.multiplyByScalar(e.upWC,d,gO),h.add(gO,u,u),h.clone(e.directionWC,n.direction),e._mode===se.SCENE2D&&e._scene.mapMode2D===Bl.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)?tHe(this,e,t):nHe(this,e,t)};var iHe=new h,oHe=new h;ln.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,iHe),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),oHe);return Math.max(0,h.magnitude(n)-e.radius)};var rHe=new k;ln.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,rHe);return Math.max(o.x,o.y)};function sHe(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:Ts.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var aHe=new h,zfe=new h,cHe=new h,lHe=new h;function dHe(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,aHe),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,zfe),zfe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,cHe);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,lHe)),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 sHe(e,n,s,f,y,t)}}ln.prototype.createCorrectPositionTween=function(e){if(this._mode===se.COLUMBUS_VIEW)return dHe(this,e)};var uHe=new h,Ma={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=Ma.destination,e.orientation.heading=Ma.heading,e.orientation.pitch=Ma.pitch,e.orientation.roll=Ma.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,uHe));let o=e.orientation??B.EMPTY_OBJECT;if(l(o.direction)&&(o=ipe(this,t,o,E8.orientation)),l(e.duration)&&e.duration<=0){let u=E8;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;Ma.destination=t,Ma.heading=o.heading,Ma.pitch=o.pitch,Ma.roll=o.roll,Ma.duration=e.duration,Ma.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ma.cancel=e.cancel,Ma.endTransform=e.endTransform,Ma.convert=i?!1:e.convert,Ma.maximumHeight=e.maximumHeight,Ma.pitchAdjustHeight=e.pitchAdjustHeight,Ma.flyOverLongitude=e.flyOverLongitude,Ma.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ma.easingFunction=e.easingFunction;let a=this._scene,c=R2.createTween(a,Ma);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 mHe(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function hHe(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 fHe=100;function dpe(e,t,n){n=Lm.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=fHe:e.frustum instanceof bn||e._mode===se.SCENE2D?n.range=hHe(e,s):n.range=mHe(e,s),n.range=W.clamp(n.range,i,o)}return n}ln.prototype.viewBoundingSphere=function(e,t){t=dpe(this,e,t),this.lookAt(e.center,t)};var pHe=new P,Hfe=new h,bHe=new h,gHe=new h,yHe=new h,xHe=new ce,THe=new Ne,_He=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=dpe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,Hfe):o=cpe(i.heading,i.pitch,i.range,Hfe);let s=this._scene.ellipsoid??ne.default,a=_t.eastNorthUpToFixedFrame(e.center,s,pHe);P.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,bHe),h.normalize(c,c),d=P.multiplyByPointAsVector(a,h.UNIT_Z,gHe),1-Math.abs(h.dot(c,d))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,By[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 ji)return;let e=this._scene;this.frustum=new ji,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 bn)return;let e=tpe(this),t=this._scene;this.frustum=new bn,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 Wo=ln;var sRn=x(T(),1);var FZn=x(T(),1),upe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(upe);var tr=upe;var KZn=x(T(),1);var XZn=x(T(),1);var W8=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 o=this._array;o.splice(o.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},kt=W8;var YZn=x(T(),1),mpe={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(mpe);var un=mpe;function zy(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 N8(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function V_(e){let t=[];if(e.shiftKey&&t.push(tr.SHIFT),e.ctrlKey&&t.push(tr.CTRL),e.altKey&&t.push(tr.ALT),t.length)return t}var _s={LEFT:0,MIDDLE:1,RIGHT:2};function Au(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 RHe(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(Au(e,"pointerdown",t,LHe),Au(e,"pointerup",t,Spe),Au(e,"pointermove",t,WHe),Au(e,"pointercancel",t,Spe)):(Au(e,"mousedown",t,Zpe),Au(e,"mouseup",n,Rpe),Au(e,"mousemove",n,Cpe),Au(e,"touchstart",t,AHe),Au(e,"touchend",n,gpe),Au(e,"touchmove",n,GHe),Au(e,"touchcancel",n,gpe)),Au(e,"dblclick",t,VHe);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Au(e,i,t,EHe)}function CHe(e){let t=e._removalFunctions;for(let n=0;nJh.mouseEmulationIgnoreMilliseconds}function X8(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=V_(t),o=e.getInputAction(un.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function AHe(e,t){Y8(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i=p+Math.PI;)m-=b;for(;m0||e}}});Wm.prototype.isMoving=function(e,t){let n=wa(e,t);return!this._update[n]};Wm.prototype.getMovement=function(e,t){let n=wa(e,t);return this._movement[n]};Wm.prototype.getLastMovement=function(e,t){let n=wa(e,t),i=this._lastMovement[n];if(i.valid)return i};Wm.prototype.isButtonDown=function(e,t){let n=wa(e,t);return this._isDown[n]};Wm.prototype.getStartMousePosition=function(e,t){if(e===io.WHEEL)return this._currentMousePosition;let n=wa(e,t);return this._eventStartPosition[n]};Wm.prototype.getButtonPressTime=function(e,t){let n=wa(e,t);return this._pressTime[n]};Wm.prototype.getButtonReleaseTime=function(e,t){let n=wa(e,t);return this._releaseTime[n]};Wm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Wm.prototype.isDestroyed=function(){return!1};Wm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var A2=Wm;var lRn=x(T(),1);function Fpe(e){e=e??B.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Fpe.prototype,{metadata:{get:function(){return this._metadata}}});var E_=Fpe;var sgi=x(T(),1);var fRn=x(T(),1);function X1(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([U.floatToByte(e),U.floatToByte(t),U.floatToByte(n),U.floatToByte(i)])}Object.defineProperties(X1.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});X1.fromColor=function(e){return new X1(e.red,e.green,e.blue,e.alpha)};X1.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};X1.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 $t=X1;var KRn=x(T(),1);var vRn=x(T(),1);var xRn=x(T(),1);function rc(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}rc.fromCorners=function(e,t,n){return l(n)||(n=new rc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};rc.fromPoints=function(e,t){if(l(t)||(t=new rc),!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};rc.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};rc.prototype.clone=function(e){return rc.clone(this,e)};rc.prototype.intersectPlane=function(e){return rc.intersectPlane(this,e)};rc.prototype.intersectAxisAlignedBoundingBox=function(e){return rc.intersectAxisAlignedBoundingBox(this,e)};rc.prototype.equals=function(e){return rc.equals(this,e)};var Gu=rc;var k8=new ce;function Mp(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,k8)),this._yAxis=h.fromCartesian4(P.getColumn(n,1,k8));let i=h.fromCartesian4(P.getColumn(n,2,k8));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(Mp.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 IHe=new Gu;Mp.fromPoints=function(e,t){let n=Gu.fromPoints(e,IHe);return new Mp(n.center,t)};var Ipe=new gn,CO=new h;Mp.prototype.projectPointOntoPlane=function(e,t){let n=Ipe;n.origin=e,h.normalize(e,n.direction);let i=Ti.rayPlane(n,this._plane,CO);if(l(i)||(h.negate(n.direction,n.direction),i=Ti.rayPlane(n,this._plane,CO)),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)}};Mp.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,zHe),G=pe.fromRadians(e.west,e.north,n,HHe),v=pe.fromRadians(e.west,g,n,KHe),X=pe.fromRadians(e.west,e.south,n,JHe),Y=pe.fromRadians(N,e.south,n,jHe),D=i.cartographicToCartesian(V,QHe),M=i.cartographicToCartesian(G,Npe),O=i.cartographicToCartesian(v,qHe),w=i.cartographicToCartesian(X,Ype),z=i.cartographicToCartesian(Y,$He),K=I.projectPointToNearestOnPlane(D,eKe),te=I.projectPointToNearestOnPlane(M,tKe),H=I.projectPointToNearestOnPlane(O,nKe),$=I.projectPointToNearestOnPlane(w,iKe),ee=I.projectPointToNearestOnPlane(z,oKe);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,M=i.cartographicToCartesian(G,Npe),w=i.cartographicToCartesian(X,Ype),d=Math.min(cn.getPointDistance(m,M),cn.getPointDistance(m,w)),u=n,Ppe(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,Xpe).longitude,_=h.fromRadians(y,f,n,i,rKe);_.z=0;let Z=Math.abs(_.x)=c?qt.INSIDE:qt.INTERSECTING};var kpe=new h,Upe=new h,Dpe=new h,fKe=new h,Mpe=new h,pKe=new h;fo.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,wpe),i=e.halfAxes,o=q.getColumn(i,0,kpe),r=q.getColumn(i,1,Upe),s=q.getColumn(i,2,Dpe),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,Mpe),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,fKe),h.normalize(y,y),_=h.cross(f,y,Mpe),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=pKe;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 bKe=new h,gKe=new h;fo.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ys);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=q.getColumn(a,0,kpe),d=q.getColumn(a,1,Upe),u=q.getColumn(a,2,Dpe),m=h.add(c,d,bKe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,gKe),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 yKe=new h,xKe=new h,TKe=new h;fo.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,yKe),r=q.getColumn(i,1,xKe),s=q.getColumn(i,2,TKe);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 _Ke=new q;fo.computeTransformation=function(e,t){l(t)||(t=new P);let n=e.center,i=q.multiplyByUniformScale(e.halfAxes,2,_Ke);return P.fromRotationTranslation(i,n,t)};var SKe=new me;fo.isOccluded=function(e,t){let n=me.fromOrientedBoundingBox(e,SKe);return!t.isBoundingSphereVisible(n)};fo.prototype.intersectPlane=function(e){return fo.intersectPlane(this,e)};fo.prototype.distanceSquaredTo=function(e){return fo.distanceSquaredTo(this,e)};fo.prototype.computePlaneDistances=function(e,t,n){return fo.computePlaneDistances(this,e,t,n)};fo.prototype.computeCorners=function(e){return fo.computeCorners(this,e)};fo.prototype.computeTransformation=function(e){return fo.computeTransformation(this,e)};fo.prototype.isOccluded=function(e){return fo.isOccluded(this,e)};fo.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&q.equals(e.halfAxes,t.halfAxes)};fo.prototype.clone=function(e){return fo.clone(this,e)};fo.prototype.equals=function(e){return fo.equals(this,e)};var nn=fo;var $ui=x(T(),1);var o1n=x(T(),1);var QRn=x(T(),1);function ZKe(e,t){return t=t??0,Wd(e,t,Math.min(4,e.length))}var jh=ZKe;var U8=class e{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._resource=i,l(o)||(o=[]),this._contents=o,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{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)})}},Xd=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"});Xd.max_unop_len=Xd.getMaxKeyLen(Xd.unary_ops);Xd.max_binop_len=Xd.getMaxKeyLen(Xd.binary_ops);var Ky=e=>new Xd(e).parse(),VKe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Xd).filter(e=>!VKe.includes(e)&&Ky[e]===void 0).forEach(e=>{Ky[e]=Xd[e]});Ky.Jsep=Xd;var EKe="ConditionalExpression",AKe={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:EKe,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 :")}})}};Ky.plugins.register(AKe);var R1n=x(T(),1),Bpe={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(Bpe);var Pt=Bpe;function Qh(e,t){this._expression=e,e=kKe(e,t),e=DKe(UKe(e)),Ky.addBinaryOp("=~",0),Ky.addBinaryOp("!~",0);let n;try{n=Ky(e)}catch(i){throw new ae(i)}this._runtimeAst=Qi(this,n)}Object.defineProperties(Qh.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++]}};Qh.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};Qh.prototype.evaluateColor=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};Qh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} -{ - return ${o}; -} -`,o};Qh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Qh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var GKe=["!","-","+"],zpe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],W2=/\${(.*?)}/g,LKe=/\\/g,WKe="@#%",vKe=/@#%/g,AO=new U,GO={abs:ka(Math.abs),sqrt:ka(Math.sqrt),cos:ka(Math.cos),sin:ka(Math.sin),tan:ka(Math.tan),acos:ka(Math.acos),asin:ka(Math.asin),atan:ka(Math.atan),radians:ka(W.toRadians),degrees:ka(W.toDegrees),sign:ka(W.sign),floor:ka(Math.floor),ceil:ka(Math.ceil),round:ka(Math.round),exp:ka(Math.exp),exp2:ka(IKe),log:ka(Math.log),log2:ka(PKe),fract:ka(FKe),length:XKe,normalize:NKe},LO={atan2:VO(Math.atan2,!1),pow:VO(Math.pow,!1),min:VO(Math.min,!0),max:VO(Math.max,!0),distance:YKe,dot:MKe,cross:wKe},J8={clamp:Hpe(W.clamp,!0),mix:Hpe(W.lerp,!0)};function FKe(e){return e-Math.floor(e)}function IKe(e){return Math.pow(2,e)}function PKe(e){return W.log2(e)}function ka(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 VO(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 Hpe(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 XKe(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 NKe(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 YKe(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 MKe(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 wKe(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 Yt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,$Ke(this)}function kKe(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 UKe(e){return e.replace(LKe,WKe)}function K8(e){return e.replace(vKe,"\\")}function DKe(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 Yt(Pt.VARIABLE_IN_STRING,e.value):new Yt(Pt.LITERAL_STRING,K8(e.value))}function BKe(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 Yt(Pt.LITERAL_BOOLEAN,!1):new Yt(Pt.LITERAL_NULL,null):(s=Qi(e,c),a=Qi(e,n[0]),new Yt(Pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Qi(e,c),new Yt(Pt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Yt(Pt.LITERAL_COLOR,o);if(r=Qi(e,n[0]),l(n[1])){let c=Qi(e,n[1]);return new Yt(Pt.LITERAL_COLOR,o,[r,c])}return new Yt(Pt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[Qi(e,n[0]),Qi(e,n[1]),Qi(e,n[2])],new Yt(Pt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[Qi(e,n[0]),Qi(e,n[1]),Qi(e,n[2]),Qi(e,n[3])],new Yt(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=Qi(e,n[0]),new Yt(Pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Yt(Pt.UNARY,o)}else if(l(GO[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=Qi(e,n[0]),new Yt(Pt.UNARY,o,r)}else if(l(LO[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=Qi(e,n[0]),a=Qi(e,n[1]),new Yt(Pt.BINARY,o,s,a)}else if(l(J8[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=Qi(e,n[0]),a=Qi(e,n[1]);let c=Qi(e,n[2]);return new Yt(Pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Yt(Pt.LITERAL_BOOLEAN,!1):(r=Qi(e,n[0]),new Yt(Pt.UNARY,o,r));if(o==="Number")return i===0?new Yt(Pt.LITERAL_NUMBER,0):(r=Qi(e,n[0]),new Yt(Pt.UNARY,o,r));if(o==="String")return i===0?new Yt(Pt.LITERAL_STRING,""):(r=Qi(e,n[0]),new Yt(Pt.UNARY,o,r));if(o==="regExp")return zKe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function zKe(e,t){let n=t.arguments;if(n.length===0)return new Yt(Pt.LITERAL_REGEX,new RegExp);let i=Qi(e,n[0]),o;if(n.length>1){let r=Qi(e,n[1]);if(H8(i)&&H8(r)){try{o=new RegExp(K8(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Yt(Pt.LITERAL_REGEX,o)}return new Yt(Pt.REGEX,i,r)}if(H8(i)){try{o=new RegExp(K8(String(i._value)))}catch(r){throw new ae(r)}return new Yt(Pt.LITERAL_REGEX,o)}return new Yt(Pt.REGEX,i)}function HKe(e){if(QKe(e.name)){let t=qKe(e.name);return t.substr(0,8)==="tiles3d_"?new Yt(Pt.BUILTIN_VARIABLE,t):new Yt(Pt.VARIABLE,t)}else{if(e.name==="NaN")return new Yt(Pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Yt(Pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Yt(Pt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function KKe(e){let t=e.property.name;if(t==="PI")return new Yt(Pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Yt(Pt.LITERAL_NUMBER,Math.E)}function JKe(e){if(e.property.name==="POSITIVE_INFINITY")return new Yt(Pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function jKe(e,t){if(t.object.name==="Math")return KKe(t);if(t.object.name==="Number")return JKe(t);let n,i=Qi(e,t.object);return t.computed?(n=Qi(e,t.property),new Yt(Pt.MEMBER,"brackets",i,n)):(n=new Yt(Pt.LITERAL_STRING,t.property.name),new Yt(Pt.MEMBER,"dot",i,n))}function H8(e){return e._type>=Pt.LITERAL_NULL}function QKe(e){return e.substr(0,4)==="czm_"}function qKe(e){return e.substr(4)}function Qi(e,t){let n,i,o,r;if(t.type==="Literal")n=OKe(t);else if(t.type==="CallExpression")n=BKe(e,t);else if(t.type==="Identifier")n=HKe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Qi(e,t.argument);if(GKe.indexOf(i)>-1)n=new Yt(Pt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Qi(e,t.left),r=Qi(e,t.right),zpe.indexOf(i)>-1)n=new Yt(Pt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Qi(e,t.left),r=Qi(e,t.right),zpe.indexOf(i)>-1&&(n=new Yt(Pt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Qi(e,t.test);o=Qi(e,t.consequent),r=Qi(e,t.alternate),n=new Yt(Pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=jKe(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(LO[e._value])&&(e.evaluate=nJe(e._value)):e._type===Pt.TERNARY?e.evaluate=iJe(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=eJe):e.evaluate=e._evaluateLiteral}function eJe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function tJe(e){let t=GO[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function nJe(e){let t=LO[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function iJe(e){let t=J8[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 WO(e,t){if(l(e))return e.getPropertyInherited(t)}Yt.prototype._evaluateLiteral=function(){return this._value};Yt.prototype._evaluateLiteralColor=function(e){let t=AO,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())};Yt.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())};Yt.prototype._evaluateLiteralString=function(){return this._value};Yt.prototype._evaluateVariableString=function(e){let t=this._value,n=W2.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=WO(e,o);l(r)||(r=""),t=t.replace(i,r),W2.lastIndex+=r.length-i.length,n=W2.exec(t)}return t};Yt.prototype._evaluateVariable=function(e){return WO(e,this._value)};function A_(e){return e._value==="feature"}Yt.prototype._evaluateMemberDot=function(e){if(A_(this._left))return WO(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]};Yt.prototype._evaluateMemberBrackets=function(e){if(A_(this._left))return WO(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]};Yt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Yt.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};Yt.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};Yt.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};Yt.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}.`)};Yt.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}.`)};Yt.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}.`)};Yt.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}.`)};Yt.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}.`)};Yt.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};Yt.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};Yt.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)};Yt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Yt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Yt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Yt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Yt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Yt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Yt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Yt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Yt.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};Yt.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)};Yt.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}.`)};Yt.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}.`)};Yt.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};Yt.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 Kpe(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=Jpe(this),l(i)?EO(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=Jpe(this),l(i)?EO(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=Kpe(this),l(i)?EO(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=Kpe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),EO(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;p",">=","<","<=","&&","||","!~","=~"],F2=/\${(.*?)}/g,UHe=/\\/g,DHe="@#%",OHe=/@#%/g,pO=new U,bO={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(zHe),log:Na(Math.log),log2:Na(HHe),fract:Na(BHe),length:KHe,normalize:JHe},gO={atan2:hO(Math.atan2,!1),pow:hO(Math.pow,!1),min:hO(Math.min,!0),max:hO(Math.max,!0),distance:jHe,dot:QHe,cross:qHe},d8={clamp:lpe(W.clamp,!0),mix:lpe(W.lerp,!0)};function BHe(e){return e-Math.floor(e)}function zHe(e){return Math.pow(2,e)}function HHe(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 hO(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 lpe(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 KHe(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 JHe(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 jHe(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 QHe(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 qHe(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 Mt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,uKe(this)}function $He(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 eKe(e){return e.replace(UHe,DHe)}function l8(e){return e.replace(OHe,"\\")}function tKe(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 Mt(Pt.VARIABLE_IN_STRING,e.value):new Mt(Pt.LITERAL_STRING,l8(e.value))}function iKe(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 Mt(Pt.LITERAL_BOOLEAN,!1):new Mt(Pt.LITERAL_NULL,null):(s=ji(e,c),a=ji(e,n[0]),new Mt(Pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=ji(e,c),new Mt(Pt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Mt(Pt.LITERAL_COLOR,o);if(r=ji(e,n[0]),l(n[1])){let c=ji(e,n[1]);return new Mt(Pt.LITERAL_COLOR,o,[r,c])}return new Mt(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 Mt(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 Mt(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 Mt(Pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Mt(Pt.UNARY,o)}else if(l(bO[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new Mt(Pt.UNARY,o,r)}else if(l(gO[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=ji(e,n[0]),a=ji(e,n[1]),new Mt(Pt.BINARY,o,s,a)}else if(l(d8[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 Mt(Pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Mt(Pt.LITERAL_BOOLEAN,!1):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="Number")return i===0?new Mt(Pt.LITERAL_NUMBER,0):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="String")return i===0?new Mt(Pt.LITERAL_STRING,""):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="regExp")return oKe(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function oKe(e,t){let n=t.arguments;if(n.length===0)return new Mt(Pt.LITERAL_REGEX,new RegExp);let i=ji(e,n[0]),o;if(n.length>1){let r=ji(e,n[1]);if(c8(i)&&c8(r)){try{o=new RegExp(l8(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Mt(Pt.LITERAL_REGEX,o)}return new Mt(Pt.REGEX,i,r)}if(c8(i)){try{o=new RegExp(l8(String(i._value)))}catch(r){throw new ae(r)}return new Mt(Pt.LITERAL_REGEX,o)}return new Mt(Pt.REGEX,i)}function rKe(e){if(lKe(e.name)){let t=dKe(e.name);return t.substr(0,8)==="tiles3d_"?new Mt(Pt.BUILTIN_VARIABLE,t):new Mt(Pt.VARIABLE,t)}else{if(e.name==="NaN")return new Mt(Pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Mt(Pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Mt(Pt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function sKe(e){let t=e.property.name;if(t==="PI")return new Mt(Pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Mt(Pt.LITERAL_NUMBER,Math.E)}function aKe(e){if(e.property.name==="POSITIVE_INFINITY")return new Mt(Pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function cKe(e,t){if(t.object.name==="Math")return sKe(t);if(t.object.name==="Number")return aKe(t);let n,i=ji(e,t.object);return t.computed?(n=ji(e,t.property),new Mt(Pt.MEMBER,"brackets",i,n)):(n=new Mt(Pt.LITERAL_STRING,t.property.name),new Mt(Pt.MEMBER,"dot",i,n))}function c8(e){return e._type>=Pt.LITERAL_NULL}function lKe(e){return e.substr(0,4)==="czm_"}function dKe(e){return e.substr(4)}function ji(e,t){let n,i,o,r;if(t.type==="Literal")n=nKe(t);else if(t.type==="CallExpression")n=iKe(e,t);else if(t.type==="Identifier")n=rKe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=ji(e,t.argument);if(kHe.indexOf(i)>-1)n=new Mt(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),cpe.indexOf(i)>-1)n=new Mt(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),cpe.indexOf(i)>-1&&(n=new Mt(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 Mt(Pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=cKe(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(gO[e._value])&&(e.evaluate=fKe(e._value)):e._type===Pt.TERNARY?e.evaluate=pKe(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=mKe):e.evaluate=e._evaluateLiteral}function mKe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function hKe(e){let t=bO[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function fKe(e){let t=gO[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function pKe(e){let t=d8[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 yO(e,t){if(l(e))return e.getPropertyInherited(t)}Mt.prototype._evaluateLiteral=function(){return this._value};Mt.prototype._evaluateLiteralColor=function(e){let t=pO,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())};Mt.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())};Mt.prototype._evaluateLiteralString=function(){return this._value};Mt.prototype._evaluateVariableString=function(e){let t=this._value,n=F2.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=yO(e,o);l(r)||(r=""),t=t.replace(i,r),F2.lastIndex+=r.length-i.length,n=F2.exec(t)}return t};Mt.prototype._evaluateVariable=function(e){return yO(e,this._value)};function D_(e){return e._value==="feature"}Mt.prototype._evaluateMemberDot=function(e){if(D_(this._left))return yO(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]};Mt.prototype._evaluateMemberBrackets=function(e){if(D_(this._left))return yO(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]};Mt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Mt.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};Mt.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};Mt.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};Mt.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}.`)};Mt.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}.`)};Mt.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}.`)};Mt.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}.`)};Mt.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}.`)};Mt.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};Mt.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};Mt.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)};Mt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Mt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Mt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Mt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Mt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Mt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Mt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Mt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Mt.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};Mt.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)};Mt.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}.`)};Mt.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}.`)};Mt.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};Mt.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 dpe(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=upe(this),l(i)?fO(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=upe(this),l(i)?fO(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=dpe(this),l(i)?fO(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=dpe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),fO(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(U.equals(u.color,a.color))d=j8(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=j8(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 Q8(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=Q8(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=Q8(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 fJe(e,t){return t.color.toRgba()-e.color.toRgba()}function pJe(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 WJe(e){l(e._primitive)||(e._primitive=new L_({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)}Lu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Lu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Lu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Lu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Lu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=LJe(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)};Lu.prototype.isDestroyed=function(){return!1};Lu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Zb=Lu;var q8=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,IJe(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 t0e(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){t0e(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 vJe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function FJe(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=Wr(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 wh(e,R,b,f,vJe(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=FJe(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 t0e(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 v2=q8;var j2n=x(T(),1);var PCn=x(T(),1);var $8={};$8.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),n0e(i,o,r,s);return c};$8.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,e6=2*v_+1,jy=4,r0e=[],s0e=[],NJe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Qy=1,M1=2,vO=[Qy,0,0,Qy|M1];function ws(e){if(!fn.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=ws.getLevel(e)}ws.fromToken=function(e){return new ws(ws.getIdFromToken(e))};ws.isValidId=function(e){return!(e<=0||e>>BigInt(e6)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ws.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ws.isValidId(ws.getIdFromToken(e)):!1};ws.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ws.getTokenFromId=function(e){let t=Math.floor(HJe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ws.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return v_-(t>>1)};ws.prototype.getChild=function(e){let t=l0e(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ws(n)};ws.prototype.getParent=function(){let e=l0e(this._cellId)<>1&1;return c0e(i[0],o[0][r^n&1],o[1][r])}function wJe(e,t){let n=a0e(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 a0e(e){r0e.length===0&&OJe();let t=Number(e>>BigInt(e6)),n=t&Qy,i=(1<=0;s--){let c=(1<<2*(s===7?v_-7*jy:jy))-1;n+=Number(e>>BigInt(s*2*jy+1)&BigInt(c))<<2,n=s0e[n];let d=s*jy;o+=n>>jy+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function i0e(e){return 1/XJe*e}function UJe(e,t){let n=[[],[]],i=DJe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=FO(o0e(r)),n[o][1]=FO(o0e(s))}return n}function DJe(e){return 1<>>0}function o0e(e){return 1/PJe*e}function qy(e,t,n,i,o,r){if(e===jy){let s=(t<>1),n+(s[0]&1),i,o,r^vO[0]),qy(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^vO[1]),qy(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^vO[2]),qy(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^vO[3])}}function OJe(){qy(0,0,0,0,0,0),qy(0,0,0,Qy,0,Qy),qy(0,0,0,M1,0,M1),qy(0,0,0,Qy|M1,0,Qy|M1)}function l0e(e){return e&~e+BigInt(1)}function BJe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(t6.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});t6.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 w1=t6;var qCn=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 k1=Cb;var eVn=x(T(),1);var F2={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};F2.getBranchingFactor=function(e){switch(e){case F2.OCTREE:return 8;case F2.QUADTREE:return 4}};Object.freeze(F2);var ks=F2;var dVn=x(T(),1);var rVn=x(T(),1);function ac(){}Object.defineProperties(ac.prototype,{class:{get:function(){ge.throwInstantiationError()}}});ac.prototype.hasProperty=function(e){ge.throwInstantiationError()};ac.prototype.hasPropertyBySemantic=function(e){ge.throwInstantiationError()};ac.prototype.getPropertyIds=function(e){ge.throwInstantiationError()};ac.prototype.getProperty=function(e){ge.throwInstantiationError()};ac.prototype.setProperty=function(e,t){ge.throwInstantiationError()};ac.prototype.getPropertyBySemantic=function(e){ge.throwInstantiationError()};ac.prototype.setPropertyBySemantic=function(e,t){ge.throwInstantiationError()};ac.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))};ac.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ac.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};ac.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)};ac.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};ac.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ac.getProperty(o.id,t,n)};ac.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ac.setProperty(r.id,t,n,i):!1};var Jn=ac;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 I2=Vb;var DVn=x(T(),1);var XVn=x(T(),1);var ZVn=x(T(),1);function ts(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)}ts.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.property,i=jJe(n),o=QJe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new ts({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(ts.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 jJe(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 QJe(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}}ts.prototype.normalize=function(e){return this._normalized?n6(e,this._valueType,Nt.normalize):e};ts.prototype.unnormalize=function(e){return this._normalized?n6(e,this._valueType,Nt.unnormalize):e};ts.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ts.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};ts.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ts.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};ts.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)};ts.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!h0e(e,t))return e};function P2(e){return Array.isArray(e)&&!(e instanceof Ji)&&!(e instanceof q)&&!(e instanceof P)}function h0e(e,t){if(!P2(e))return e===t;if(!P2(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};ts.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};ts.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?qJe(this,e):f0e(this,e)};function qJe(e,t){if(!P2(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?d0e(e,t,n):void 0}if(eNt.getMaximum(t))return d0e(e,t,n)}function m0e(e,t){return`value ${e} of type ${t} must be finite`}function n6(e,t,n){if(!P2(e))return n(e,t);for(let i=0;ie)};var i6=[void 0,"float","vec2","vec3","vec4"],b0e=[void 0,"int","ivec2","ivec3","ivec4"],rje=[void 0,"uint","uvec2","uvec3","uvec4"],sje={[il.FLOAT]:"uintBitsToFloat",[il.INTEGER]:"int",[il.UNSIGNED_INTEGER]:""};ts.prototype.getGlslTypeWebGL1=function(){let e=St.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?i6[e]:b0e[e]};ts.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?i6[t]:Nt.isUnsignedIntegerType(e)?rje[t]:b0e[t]};ts.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=`${i6[s]} ${u} = ${e};`;i.push(y);let _=sje[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};ts.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var kp=ts;function X2(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 o6(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 o6(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 o6(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=g0e(E),A=g0e(A);let F,I,N=this;u?F=function(g){return lje(g,N._values,N._stringOffsets)}:m?(F=function(g){return dje(g,N._values)},I=function(g,V){uje(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(X2.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}}});X2.prototype.get=function(e){let t=aje(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=xje(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};X2.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=Tje(this,t),t=n.unnormalize(t),cje(this,e,t)};X2.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function g0e(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 uje(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 hje(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?_-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 QVn=x(T(),1),ex=(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:cjbp9Upmbedilvor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taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;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 eEn=x(T(),1),qVn=(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: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UdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1: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:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJbbjZaIaOa8Fcdtfydbc8S2fgeIdyg81:va81Jbbbb9BEaeIdwa8NaKcx2fgHIdwg81NaeIdzaHIdbg80NaeIdaMgBaBMMa81NaeIdlaHIdlgBNaeIdCa81NaeId3Mg81a81MMaBNaeIdba80NaeIdxaBNaeIdKMg81a81MMa80NaeId8KMMM:lNh86ka8VaRNhBdnaCTmbagaKc8S2fgAIdwa8WNaAIdza8XN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ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9ma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:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmb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fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR: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(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 iEn=x(T(),1),tEn=(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: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 sEn=x(T(),1),oEn=(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:tghJbbbb9EEahJbbbb9BEg8Ea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dbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz: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(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 r6=class extends to{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=$y(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=Zje(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 Zje(e){try{let t=Rje(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);ex.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 Rje(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 U1=r6;var MEn=x(T(),1);var EEn=x(T(),1);var F_=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Qn("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])}};F_._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);F_._decoderTaskProcessor=void 0;F_._taskProcessorReady=!1;F_._error=void 0;var Eb=F_;var LEn=x(T(),1);var In={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 Cje(e){switch(e){case In.POSITION:return"positionMC";case In.NORMAL:return"normalMC";case In.TANGENT:return"tangentMC";case In.TEXCOORD:return"texCoord";case In.COLOR:return"color";case In.JOINTS:return"joints";case In.WEIGHTS:return"weights";case In.FEATURE_ID:return"featureId";case In.SCALE:return"scale";case In.ROTATION:return"rotation";case In.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}In.hasSetIndex=function(e){switch(e){case In.POSITION:case In.NORMAL:case In.TANGENT:case In.CUMULATIVE_DISTANCE:return!1;case In.TEXCOORD:case In.COLOR:case In.JOINTS:case In.WEIGHTS:case In.FEATURE_ID:case In.SCALE:case In.ROTATION:return!0}};In.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return In.POSITION;case"NORMAL":return In.NORMAL;case"TANGENT":return In.TANGENT;case"TEXCOORD":return In.TEXCOORD;case"COLOR":return In.COLOR;case"JOINTS":return In.JOINTS;case"WEIGHTS":return In.WEIGHTS;case"_FEATURE_ID":return In.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return In.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return In.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return In.CUMULATIVE_DISTANCE}};In.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return In.POSITION;case"RGBA":case"RGB":case"RGB565":return In.COLOR;case"NORMAL":case"NORMAL_OCT16P":return In.NORMAL;case"BATCH_ID":return In.FEATURE_ID}};In.getGlslType=function(e){switch(e){case In.POSITION:case In.NORMAL:case In.TANGENT:return"vec3";case In.TEXCOORD:return"vec2";case In.COLOR:return"vec4";case In.JOINTS:return"ivec4";case In.WEIGHTS:return"vec4";case In.FEATURE_ID:return"int";case In.SCALE:return"vec3";case In.ROTATION:return"vec4";case In.CUMULATIVE_DISTANCE:return"float";case In.OPACITY:return"float"}};In.getVariableName=function(e,t){let n=Cje(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(In);var dt=In;var s6=class extends to{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=Vje(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._dracoError)&&_0e(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=Aje(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=Eje(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 Vje(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;_0e(e,n)}}function _0e(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load Draco",t)}async function Eje(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 I_={};I_[dt.POSITION]="POSITION";I_[dt.NORMAL]="NORMAL";I_[dt.COLOR]="COLOR";I_[dt.TEXCOORD]="TEX_COORD";function Aje(e){for(let t in I_)if(I_.hasOwnProperty(t)&&e.startsWith(t))return I_[t]}var D1=s6;var qEn=x(T(),1);var DEn=x(T(),1);function Gje(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=Gje;var Y2=class extends to{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=Lje(this),this._promise):(this._promise=Wje(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 S0e(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 Lje(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 Fje(i);if(e.isDestroyed())return;let r=S0e(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(n){return e.isDestroyed()?void 0:Z0e(e,n,"Failed to load embedded image")}}async function Wje(e){e._state=Rt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await Pje(i);if(e.isDestroyed())return;let r=S0e(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(o){return e.isDestroyed()?void 0:Z0e(e,o,`Failed to load image: ${n}`)}}function Z0e(e,t,n){return e.unload(),e._state=Rt.FAILED,Promise.reject(e.getError(n,t))}function vje(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 Fje(e){let t=vje(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ad(n)}return Y2._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var Ije=/(^data:image\/ktx2)|(\.ktx2$)/i;function Pje(e){let t=e.getUrlComponent(!1,!0);return Ije.test(t)?Ad(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Y2._loadImageFromTypedArray=Ab;var O1=Y2;var mAn=x(T(),1);var eAn=x(T(),1),R0e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(R0e);var Lc=R0e;var a6=class extends to{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=Nje(this),this._promise):(this._promise=Yje(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){l6(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=Xje;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Lc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=C0e(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}},c6=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=C0e(this.typedArray,this.indexDatatype,this.context)}};function C0e(e,t,n){let i=it.createIndexBuffer({typedArray:e,context:n,usage:Pe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var Xje=new c6;async function Nje(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;l6(e,n)}}async function Yje(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=Mje(e,a),e._state=Rt.PROCESSING,e}catch(s){if(e.isDestroyed())return;l6(e,s)}}function Mje(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 l6(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load index buffer",t)}var B1=a6;var fWn=x(T(),1);var PAn=x(T(),1);var fAn=x(T(),1);function wje(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 xa=wje;var _An=x(T(),1);var gAn=x(T(),1);function kje(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Dr=kje;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)*Wu(t.type)}var Nd=Dje;function Oje(e){we.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),we.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),we.mesh(e,function(n){we.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=xa(e.materials,o)}})}),we.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=Nd(e,i),r.target=ie.ARRAY_BUFFER}}),we.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),we.material(e,function(n){let i=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)&&we.materialValue(n,function(c){l(c.index)&&P_(c)}),P_(n.emissiveTexture),P_(n.normalTexture),P_(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,P_(s.baseColorTexture),P_(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,P_(a.specularGlossinessTexture))}),we.animation(e,function(n){we.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=Bje(e);return we.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]}),we.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 Bje(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 P_(e){l(e)&&(e.texCoord=e.texCoord??0)}var M2=Oje;var MAn=x(T(),1);function zje(e){return we.shader(e,function(t){PO(t)}),we.buffer(e,function(t){PO(t)}),we.image(e,function(t){PO(t)}),PO(e),e}function PO(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var tx=zje;var eGn=x(T(),1);var zAn=x(T(),1);var UAn=x(T(),1);function Hje(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=Hje;function Kje(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 X_=Kje;var Jje=4;function jje(e){if(jh(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=V0e(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?Qje(e,n):qje(e,n)}function V0e(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 X_(c,"KHR_binary_glTF"),c}function qje(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var N_=jje;var oGn=x(T(),1);function $je(e){return we.shader(e,function(t){XO(t)}),we.buffer(e,function(t){XO(t)}),we.image(e,function(t){XO(t)}),XO(e),e}function XO(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var k2=$je;var XLn=x(T(),1);var cGn=x(T(),1);function e4e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),xa(n,t,!0)}var Im=e4e;var yGn=x(T(),1);var uGn=x(T(),1);function t4e(e){switch(e){case J.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var r4e=[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 s4e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(r4e.indexOf(e[n])===-1)return t;return e}function a4e(e){let t={},n={},i=e.techniques;return l(i)&&(we.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(E0e(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??i4e,blendFactors:s4e(c.blendFuncSeparate,o4e)})}E0e(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Im(e,"KHR_blend")),we.material(e,function(o){if(l(o.technique)){let r=n[o.technique];we.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var U2=a4e;var XGn=x(T(),1);var GGn=x(T(),1);function c4e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),xa(n,t,!0),Im(e,t)}var D2=c4e;function l4e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,we.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(we.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),we.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=xa(r.shaders,b,!0);let f=e.shaders[m.vertexShader];p.vertexShader=xa(r.shaders,f,!0),d.program=xa(r.programs,p),o[a.program]=d.program}i[c]=xa(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Im(e,"KHR_techniques_webgl"),D2(e,"KHR_techniques_webgl"))}return we.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};we.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var O2=l4e;var HGn=x(T(),1);var kGn=x(T(),1);function d4e(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=we.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var z1=d4e;var A0e=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function u4e(e,t){return t=t??A0e,A0e.forEach(function(n){t.indexOf(n)>-1&&h4e(e,n)}),e}var m4e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function h4e(e,t){let n=m4e[t],i=e[n];if(l(i)){let o=0,r=Dp[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),we.meshPrimitiveTarget(o,function(a){we.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),we.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),we.animation(e,function(i){we.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Up.buffer=function(e,t){e.buffers.splice(t,1),we.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--}})};Up.bufferView=function(e,t){if(e.bufferViews.splice(t,1),we.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Dr(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),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--}}}}};Up.image=function(e,t){e.images.splice(t,1),we.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Up.mesh=function(e,t){e.meshes.splice(t,1),we.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Up.node=function(e,t){e.nodes.splice(t,1),we.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),we.animation(e,function(i){we.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),we.technique(e,function(i){we.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),we.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),we.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Up.material=function(e,t){e.materials.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Up.sampler=function(e,t){e.samplers.splice(t,1),we.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Up.texture=function(e,t){if(e.textures.splice(t,1),we.material(e,function(i){z1(i,function(o,r){r.index>t&&--r.index})}),Dr(e,"EXT_feature_metadata")){we.mesh(e,function(r){we.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let 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")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;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 Dp(){}Dp.accessor=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){we.meshPrimitiveAttribute(i,function(r){t[r]=!0}),we.meshPrimitiveTarget(i,function(r){we.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),we.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),we.animation(e,function(n){we.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Dr(e,"EXT_mesh_gpu_instancing")&&we.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),Dr(e,"CESIUM_primitive_outline")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Dp.buffer=function(e){let t={};return we.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};Dp.bufferView=function(e){let t={};if(we.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Dr(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),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 G0e(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!G0e(e,o,n)}).length===0}Dp.node=function(e){let t={};return we.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),we.skinJoint(n,function(i){t[i]=!0})}),we.animation(e,function(n){we.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),we.technique(e,function(n){we.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),we.node(e,function(n,i){G0e(e,i,t)||(t[i]=!0)}),t};Dp.material=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Dp.texture=function(e){let t={};if(we.material(e,function(n){z1(n,function(i){t[i]=!0})}),Dr(e,"EXT_feature_metadata")){we.mesh(e,function(o){we.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;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}),we.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=X4e[a];l(u)?(d=u+c,t[r]=d):l(P4e[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),we.technique(e,function(n){we.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function Y4e(e){we.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function m6(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Nd(e,t)}function M4e(e){we.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),we.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=m6(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function w4e(e){let t,n,i,o=e.bufferViews,r={};we.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};we.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=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}}}),we.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),F0e(n)&&I0e(e,i))}}),delete e.nodes[t]}function U4e(e){return we.node(e,function(t,n){F0e(t)&&I0e(e,n)}),e}function D4e(e){we.animation(e,function(t){we.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=Y_(e,i);i.min=o.min,i.max=o.max}})})}function O4e(e){we.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Y_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function B4e(e){e.asset=e.asset??{},e.asset.version="2.0",v0e(e),C4e(e),U4e(e),V4e(e),E4e(e),G4e(e),W4e(e),M4e(e),w4e(e),k4e(e),D4e(e),O4e(e),v4e(e),F4e(e),I4e(e),N4e(e),K2(e),Y4e(e),U2(e),O2(e),A4e(e)}var z4e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],H4e=["u_diffuse","u_diffuse_mat"];function h6(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function f6(e){return l(e.index)}function p6(e){return Array.isArray(e)&&e.length===4}function P0e(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 K4e(e,t){t=t??{};let n=t.baseColorTextureNames??z4e,i=t.baseColorFactorNames??H4e;we.material(e,function(o){we.materialValue(o,function(r,s){n.indexOf(s)!==-1&&f6(r)?(h6(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&p6(r)&&(h6(o),o.pbrMetallicRoughness.baseColorFactor=P0e(r))})}),M_(e,"KHR_techniques_webgl"),M_(e,"KHR_blend")}function u6(e,t){l(t)&&(p6(t)?e.pbrMetallicRoughness.baseColorFactor=P0e(t):f6(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function W0e(e,t){l(t)&&(p6(t)?e.emissiveFactor=t.slice(0,3):f6(t)&&(e.emissiveTexture=t))}function J4e(e){we.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;h6(t),n.technique==="CONSTANT"?(Im(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},u6(t,s),u6(t,o)):(u6(t,r),W0e(t,o),W0e(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")}),M_(e,"KHR_materials_common")}var J2=x4e;var JLn=x(T(),1);function al(){}al.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +`;let m=new Je({sources:[a]}),p=new Je({defines:["VECTOR_TILE"],sources:[c]});e._spPick=nn.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:i})}function fpe(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:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:t,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 TKe={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},_Ke={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 SKe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(fpe(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(fpe(!0)),e._rsColorPass=ze.fromCache(TKe),e._rsPickPass=ze.fromCache(_Ke))}var O_=new P,ppe=new h;function ZKe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return P.clone(i,O_),P.multiplyByPoint(O_,e._center,ppe),P.setTranslation(O_,ppe,O_),P.multiply(o,O_,O_),O_},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function u8(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d0;){let u=t.pop();if(U.equals(u.color,a.color))d=u8(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=u8(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 m8(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=m8(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=m8(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 VKe(e,t){return t.color.toRgba()-e.color.toRgba()}function EKe(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 DKe(e){l(e._primitive)||(e._primitive=new B_({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject: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=UKe(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(),ue(this)};var Rb=Cu;var h8=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,zKe(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 gpe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){gpe(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 OKe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function BKe(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,OKe(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=BKe(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,Rb.packedBoxLength*y)}if(_>0){let V=p.byteOffset+m.CYLINDERS.byteOffset;I=new Float32Array(p.buffer,V,Rb.packedCylinderLength*_)}if(S>0){let V=p.byteOffset+m.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,V,Rb.packedEllipsoidLength*S)}if(Z>0){let V=p.byteOffset+m.SPHERES.byteOffset;g=new Float32Array(p.buffer,V,Rb.packedSphereLength*Z)}return e._geometries=new Rb({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 gpe(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 I2=h8;var xIn=x(T(),1);var SVn=x(T(),1);var f8={};f8.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),ype(i,o,r,s);return c};f8.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,p8=2*H_+1,Ky=4,_pe=[],Spe=[],JKe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Jy=1,v1=2,xO=[Jy,0,0,Jy|v1];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(p8)>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(rJe(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 H_-(t>>1)};ks.prototype.getChild=function(e){let t=Cpe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ks(n)};ks.prototype.getParent=function(){let e=Cpe(this._cellId)<>1&1;return Rpe(i[0],o[0][r^n&1],o[1][r])}function qKe(e,t){let n=Zpe(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 Zpe(e){_pe.length===0&&nJe();let t=Number(e>>BigInt(p8)),n=t&Jy,i=(1<=0;s--){let c=(1<<2*(s===7?H_-7*Ky:Ky))-1;n+=Number(e>>BigInt(s*2*Ky+1)&BigInt(c))<<2,n=Spe[n];let d=s*Ky;o+=n>>Ky+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function xpe(e){return 1/KKe*e}function eJe(e,t){let n=[[],[]],i=tJe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=TO(Tpe(r)),n[o][1]=TO(Tpe(s))}return n}function tJe(e){return 1<>>0}function Tpe(e){return 1/HKe*e}function jy(e,t,n,i,o,r){if(e===Ky){let s=(t<>1),n+(s[0]&1),i,o,r^xO[0]),jy(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^xO[1]),jy(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^xO[2]),jy(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^xO[3])}}function nJe(){jy(0,0,0,0,0,0),jy(0,0,0,Jy,0,Jy),jy(0,0,0,v1,0,v1),jy(0,0,0,Jy|v1,0,Jy|v1)}function Cpe(e){return e&~e+BigInt(1)}function iJe(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(b8.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});b8.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 F1=b8;var MVn=x(T(),1);function Vb(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(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 this._metadataTable.hasProperty(e)};Vb.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Vb.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Vb.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Vb.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Vb.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Vb.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var I1=Vb;var kVn=x(T(),1);var P2={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};P2.getBranchingFactor=function(e){switch(e){case P2.OCTREE:return 8;case P2.QUADTREE:return 4}};Object.freeze(P2);var Us=P2;var QVn=x(T(),1);var zVn=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 Eb(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(Eb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Eb.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};Eb.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};Eb.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};Eb.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};Eb.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};Eb.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};Eb.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var X2=Eb;var OEn=x(T(),1);var NEn=x(T(),1);var iEn=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 REn=x(T(),1);var uEn=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=cJe(n),o=lJe(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 cJe(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 lJe(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?g8(e,this._valueType,Nt.normalize):e};is.prototype.unnormalize=function(e){return this._normalized?g8(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(!Gpe(e,t))return e};function N2(e){return Array.isArray(e)&&!(e instanceof Ji)&&!(e instanceof q)&&!(e instanceof P)}function Gpe(e,t){if(!N2(e))return e===t;if(!N2(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?dJe(this,e):Lpe(this,e)};function dJe(e,t){if(!N2(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?Vpe(e,t,n):void 0}if(eNt.getMaximum(t))return Vpe(e,t,n)}function Ape(e,t){return`value ${e} of type ${t} must be finite`}function g8(e,t,n){if(!N2(e))return n(e,t);for(let i=0;ie)};var y8=[void 0,"float","vec2","vec3","vec4"],vpe=[void 0,"int","ivec2","ivec3","ivec4"],gJe=[void 0,"uint","uvec2","uvec3","uvec4"],yJe={[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?y8[e]:vpe[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?y8[t]:Nt.isUnsignedIntegerType(e)?gJe[t]:vpe[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=`${y8[s]} ${u} = ${e};`;i.push(y);let _=yJe[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 Y2(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 x8(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 x8(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 x8(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=Fpe(E),A=Fpe(A);let F,I,N=this;u?F=function(g){return _Je(g,N._values,N._stringOffsets)}:m?(F=function(g){return SJe(g,N._values)},I=function(g,V){ZJe(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(Y2.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}}});Y2.prototype.get=function(e){let t=xJe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=WJe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};Y2.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=vJe(this,t),t=n.unnormalize(t),TJe(this,e,t)};Y2.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Fpe(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 ZJe(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 CJe(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?_-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 mAn=x(T(),1),qy=(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: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",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 pAn=x(T(),1),hAn=(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:tjjjbhIcbh8RcbhgdnaCTmb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eclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;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:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8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AIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8Z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gKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRka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c98fheinaeydbcbyd: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:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydb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varaOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;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(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 yAn=x(T(),1),bAn=(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;7rBdbaqclfhqaDclf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aiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz: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 _An=x(T(),1),xAn=(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:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdb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ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOxekaxazc:e:G:cjbfydbcdtfhAaxazcj:G:cjbfydbcdtfhrawhOkaHasIdbggaoamaOcdtfydbgQaC2cdtfgOIdbg8KasIdwg8FaOIdwg8JNaga8KNasIdlg8EaOIdlggNMMghN:tgaJbbbbJbbjZa8Fa8JahN:tg8Fa8FNaaaaNa8EagahN:tghahNMMga:r:vaaJbbbb9BEJ;As6nJbbjZaiarydbaX2cdtfgOIdwaia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mekaehikaik;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 _8=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=Qy(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=XJe(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 XJe(e){try{let t=NJe(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);qy.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 NJe(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 P1=_8;var eGn=x(T(),1);var UAn=x(T(),1);var J_=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])}};J_._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);J_._decoderTaskProcessor=void 0;J_._taskProcessorReady=!1;J_._error=void 0;var Ab=J_;var BAn=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 YJe(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=YJe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Pn);var dt=Pn;var S8=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=MJe(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._dracoError)&&Ype(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=kJe(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=Ab.decodeBufferView(u);if(!l(m))return!1;this._decodePromise=wJe(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 MJe(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;Ype(e,n)}}function Ype(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load Draco",t)}async function wJe(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 j_={};j_[dt.POSITION]="POSITION";j_[dt.NORMAL]="NORMAL";j_[dt.COLOR]="COLOR";j_[dt.TEXCOORD]="TEX_COORD";function kJe(e){for(let t in j_)if(j_.hasOwnProperty(t)&&e.startsWith(t))return j_[t]}var X1=S8;var hGn=x(T(),1);var oGn=x(T(),1);function UJe(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 Gb=UJe;var w2=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=DJe(this),this._promise):(this._promise=OJe(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 Mpe(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 DJe(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 zJe(i);if(e.isDestroyed())return;let r=Mpe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(n){return e.isDestroyed()?void 0:wpe(e,n,"Failed to load embedded image")}}async function OJe(e){e._state=Rt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await KJe(i);if(e.isDestroyed())return;let r=Mpe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(o){return e.isDestroyed()?void 0:wpe(e,o,`Failed to load image: ${n}`)}}function wpe(e,t,n){return e.unload(),e._state=Rt.FAILED,Promise.reject(e.getError(n,t))}function BJe(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 zJe(e){let t=BJe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ad(n)}return w2._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var HJe=/(^data:image\/ktx2)|(\.ktx2$)/i;function KJe(e){let t=e.getUrlComponent(!1,!0);return HJe.test(t)?Ad(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}w2._loadImageFromTypedArray=Gb;var N1=w2;var EGn=x(T(),1);var pGn=x(T(),1),kpe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(kpe);var Lc=kpe;var Z8=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=jJe(this),this._promise):(this._promise=QJe(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){C8(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=JJe;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Lc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=Upe(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}},R8=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=Upe(this.typedArray,this.indexDatatype,this.context)}};function Upe(e,t,n){let i=ot.createIndexBuffer({typedArray:e,context:n,usage:Pe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var JJe=new R8;async function jJe(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;C8(e,n)}}async function QJe(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=qJe(e,a),e._state=Rt.PROCESSING,e}catch(s){if(e.isDestroyed())return;C8(e,s)}}function qJe(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 C8(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load index buffer",t)}var Y1=Z8;var Gvn=x(T(),1);var jGn=x(T(),1);var GGn=x(T(),1);function $Je(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=$Je;var XGn=x(T(),1);var vGn=x(T(),1);function eje(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Dr=eje;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 Nd=nje;function ije(e){we.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),we.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),we.mesh(e,function(n){we.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)}})}),we.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=Nd(e,i),r.target=ie.ARRAY_BUFFER}}),we.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),we.material(e,function(n){let i=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)&&we.materialValue(n,function(c){l(c.index)&&Q_(c)}),Q_(n.emissiveTexture),Q_(n.normalTexture),Q_(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,Q_(s.baseColorTexture),Q_(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,Q_(a.specularGlossinessTexture))}),we.animation(e,function(n){we.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=oje(e);return we.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]}),we.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 oje(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 Q_(e){l(e)&&(e.texCoord=e.texCoord??0)}var k2=ije;var eLn=x(T(),1);function rje(e){return we.shader(e,function(t){ZO(t)}),we.buffer(e,function(t){ZO(t)}),we.image(e,function(t){ZO(t)}),ZO(e),e}function ZO(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var $y=rje;var pLn=x(T(),1);var aLn=x(T(),1);var iLn=x(T(),1);function sje(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 U2=sje;function aje(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),U2(e,t),n.length===0&&delete e.extensionsUsed}}var q_=aje;var cje=4;function lje(e){if(qh(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=Dpe(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?dje(e,n):uje(e,n)}function Dpe(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 q_(c,"KHR_binary_glTF"),c}function uje(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var $_=lje;var xLn=x(T(),1);function mje(e){return we.shader(e,function(t){RO(t)}),we.buffer(e,function(t){RO(t)}),we.image(e,function(t){RO(t)}),RO(e),e}function RO(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var D2=mje;var QWn=x(T(),1);var ZLn=x(T(),1);function hje(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),pa(n,t,!0)}var Fm=hje;var FLn=x(T(),1);var VLn=x(T(),1);function fje(e){switch(e){case J.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var yje=[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 xje(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(yje.indexOf(e[n])===-1)return t;return e}function Tje(e){let t={},n={},i=e.techniques;return l(i)&&(we.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Ope(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??bje,blendFactors:xje(c.blendFuncSeparate,gje)})}Ope(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Fm(e,"KHR_blend")),we.material(e,function(o){if(l(o.technique)){let r=n[o.technique];we.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var O2=Tje;var QLn=x(T(),1);var OLn=x(T(),1);function _je(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),pa(n,t,!0),Fm(e,t)}var B2=_je;function Sje(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,we.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(we.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),we.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,Fm(e,"KHR_techniques_webgl"),B2(e,"KHR_techniques_webgl"))}return we.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};we.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var z2=Sje;var cWn=x(T(),1);var nWn=x(T(),1);function Zje(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=we.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var M1=Zje;var Bpe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function Rje(e,t){return t=t??Bpe,Bpe.forEach(function(n){t.indexOf(n)>-1&&Vje(e,n)}),e}var Cje={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Vje(e,t){let n=Cje[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]--}),we.meshPrimitiveTarget(o,function(a){we.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),we.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),we.animation(e,function(i){we.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Np.buffer=function(e,t){e.buffers.splice(t,1),we.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),we.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Dr(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),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),we.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Np.mesh=function(e,t){e.meshes.splice(t,1),we.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Np.node=function(e,t){e.nodes.splice(t,1),we.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),we.animation(e,function(i){we.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),we.technique(e,function(i){we.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),we.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),we.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Np.material=function(e,t){e.materials.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Np.sampler=function(e,t){e.samplers.splice(t,1),we.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Np.texture=function(e,t){if(e.textures.splice(t,1),we.material(e,function(i){M1(i,function(o,r){r.index>t&&--r.index})}),Dr(e,"EXT_feature_metadata")){we.mesh(e,function(r){we.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let 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")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;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 we.mesh(e,function(n){we.meshPrimitive(n,function(i){we.meshPrimitiveAttribute(i,function(r){t[r]=!0}),we.meshPrimitiveTarget(i,function(r){we.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),we.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),we.animation(e,function(n){we.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Dr(e,"EXT_mesh_gpu_instancing")&&we.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),Dr(e,"CESIUM_primitive_outline")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Yp.buffer=function(e){let t={};return we.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(we.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Dr(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),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 zpe(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!zpe(e,o,n)}).length===0}Yp.node=function(e){let t={};return we.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),we.skinJoint(n,function(i){t[i]=!0})}),we.animation(e,function(n){we.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),we.technique(e,function(n){we.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),we.node(e,function(n,i){zpe(e,i,t)||(t[i]=!0)}),t};Yp.material=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Yp.texture=function(e){let t={};if(we.material(e,function(n){M1(n,function(i){t[i]=!0})}),Dr(e,"EXT_feature_metadata")){we.mesh(e,function(o){we.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;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}),we.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=Jje[a];l(u)?(d=u+c,t[r]=d):l(Kje[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),we.technique(e,function(n){we.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function Qje(e){we.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function A8(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Nd(e,t)}function qje(e){we.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),we.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=A8(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function $je(e){let t,n,i,o=e.bufferViews,r={};we.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};we.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=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}}}),we.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),jpe(n)&&Qpe(e,i))}}),delete e.nodes[t]}function t4e(e){return we.node(e,function(t,n){jpe(t)&&Qpe(e,n)}),e}function n4e(e){we.animation(e,function(t){we.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=eS(e,i);i.min=o.min,i.max=o.max}})})}function i4e(e){we.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=eS(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function o4e(e){e.asset=e.asset??{},e.asset.version="2.0",Jpe(e),Yje(e),t4e(e),Mje(e),wje(e),Uje(e),Oje(e),qje(e),$je(e),e4e(e),n4e(e),i4e(e),Bje(e),zje(e),Hje(e),jje(e),j2(e),Qje(e),O2(e),z2(e),kje(e)}var r4e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],s4e=["u_diffuse","u_diffuse_mat"];function G8(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function L8(e){return l(e.index)}function W8(e){return Array.isArray(e)&&e.length===4}function qpe(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 a4e(e,t){t=t??{};let n=t.baseColorTextureNames??r4e,i=t.baseColorFactorNames??s4e;we.material(e,function(o){we.materialValue(o,function(r,s){n.indexOf(s)!==-1&&L8(r)?(G8(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&W8(r)&&(G8(o),o.pbrMetallicRoughness.baseColorFactor=qpe(r))})}),tS(e,"KHR_techniques_webgl"),tS(e,"KHR_blend")}function E8(e,t){l(t)&&(W8(t)?e.pbrMetallicRoughness.baseColorFactor=qpe(t):L8(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Kpe(e,t){l(t)&&(W8(t)?e.emissiveFactor=t.slice(0,3):L8(t)&&(e.emissiveTexture=t))}function c4e(e){we.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;G8(t),n.technique==="CONSTANT"?(Fm(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},E8(t,s),E8(t,o)):(E8(t,r),Kpe(t,o),Kpe(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")}),tS(e,"KHR_materials_common")}var Q2=vje;var dvn=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};al.getNodeTransform=function(e){return l(e.matrix)?e.matrix:P.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Ne.IDENTITY,l(e.scale)?e.scale:h.ONE)};al.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;rSQe);var d=de(w0e.url)}var u="./this.program",m=w0e.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 de=KT.buffer;Z=new Int8Array(de),C=new Int16Array(de),r.HEAPU8=R=new Uint8Array(de),E=new Uint16Array(de),A=new Int32Array(de),L=new Uint32Array(de),r.HEAPF32=F=new Float32Array(de),I=new Float64Array(de),N=new BigInt64Array(de),g=new BigUint64Array(de)}function v(de){var oe;throw(oe=r.onAbort)==null||oe.call(r,de),de="Aborted("+de+")",b(de),f=!0,de=new WebAssembly.RuntimeError(de+". Build with -sASSERTIONS for more info."),S?.(de),de}var X;async function Y(de){return de}async function D(de){var oe=X;try{var Re=await Y(oe);return await WebAssembly.instantiate(Re,de)}catch(Ve){b(`failed to asynchronously prepare wasm: ${Ve}`),v(Ve)}}async function M(de){return D(de)}var O=de=>{for(;0{var de=r.preRun.shift();z.push(de)},te={},H=de=>{for(;de.length;){var oe=de.pop();de.pop()(oe)}};function $(de){return this.O(L[de>>2])}var ee={},le={},_e={},he=class extends Error{constructor(de){super(de),this.name="InternalError"}},Ze=(de,oe,Re)=>{function Ve(Gt){if(Gt=Re(Gt),Gt.length!==de.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=de=>{for(var oe="";;){var Re=R[de++];if(!Re)return oe;oe+=String.fromCharCode(Re)}},Ge=class extends Error{constructor(de){super(de),this.name="BindingError"}},Ae=de=>{throw new Ge(de)};function Fe(de,oe,Re={}){var Ve=oe.name;if(!de)throw new Ge(`type "${Ve}" must have a positive integer typeid pointer`);if(le.hasOwnProperty(de)){if(Re.Aa)return;throw new Ge(`Cannot register type '${Ve}' twice`)}le[de]=oe,delete _e[de],ee.hasOwnProperty(de)&&(oe=ee[de],delete ee[de],oe.forEach(et=>et()))}function tt(de,oe,Re={}){return Fe(de,oe,Re)}var Be=(de,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}): ${de}`)}},je=de=>{throw new Ge(de.M.R.N.name+" instance already deleted")},qe=!1,We=()=>{},Ke=de=>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(de)):(Ke=oe=>oe,de);function ct(){}var Et=(de,oe)=>Object.defineProperty(oe,"name",{value:de}),zt={},ut=(de,oe,Re)=>{if(de[oe].U===void 0){var Ve=de[oe];de[oe]=function(...et){if(!de[oe].U.hasOwnProperty(et.length))throw new Ge(`Function '${Re}' called with an invalid number of arguments (${et.length}) - expects one of (${de[oe].U})!`);return de[oe].U[et.length].apply(this,et)},de[oe].U=[],de[oe].U[Ve.$]=Ve}},bt=(de,oe,Re)=>{if(r.hasOwnProperty(de)){if(Re===void 0||r[de].U!==void 0&&r[de].U[Re]!==void 0)throw new Ge(`Cannot register public name '${de}' twice`);if(ut(r,de,de),r[de].U.hasOwnProperty(Re))throw new Ge(`Cannot register multiple overloads of a function with the same number of arguments (${Re})!`);r[de].U[Re]=oe}else r[de]=oe,r[de].$=Re},ht=de=>{de=de.replace(/[^a-zA-Z0-9_]/g,"$");var oe=de.charCodeAt(0);return 48<=oe&&57>=oe?`_${de}`:de};function jt(de,oe,Re,Ve,et,Ct,gt,Gt){this.name=de,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=(de,oe,Re)=>{for(;oe!==Re;){if(!oe.fa)throw new Ge(`Expected null or instance of ${Re.name}, got an instance of ${oe.name}`);de=oe.fa(de),oe=oe.W}return de},pt=de=>{if(de===null)return"null";var oe=typeof de;return oe==="object"||oe==="array"||oe==="function"?de.toString():""+de};function Mi(de,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(de,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 de!==null&&de.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())),de!==null&&de.push(this.Z,Re)}break;default:throw new Ge("Unsupported sharing policy")}}return Re}function Si(de,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=(de,oe,Re)=>oe===Re?de:Re.W===void 0?null:(de=Hi(de,oe,Re.W),de===null?null:Re.ta(de)),Gi={},pi=(de,oe)=>{if(oe===void 0)throw new Ge("ptr should not be undefined");for(;de.W;)oe=de.fa(oe),de=de.W;return Gi[oe]},Zi=(de,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(de,{M:{value:oe,writable:!0}}))};function On(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn){this.name=de,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?Mi:Si,this.T=null)}var rn=(de,oe,Re)=>{if(!r.hasOwnProperty(de))throw new he("Replacing nonexistent public symbol");r[de].U!==void 0&&Re!==void 0?r[de].U[Re]=oe:(r[de]=oe,r[de].$=Re)},Hn=(de,oe)=>{de=ye(de);var Re=DA.get(oe);if(typeof Re!="function")throw new Ge(`unknown function pointer with signature ${de}: ${oe}`);return Re};class $i extends Error{}var Po=de=>{de=HT(de);var oe=ye(de);return Tp(de),oe},hr=(de,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(`${de}: `+Ve.map(Po).join([", "]))},Is=(de,oe)=>{for(var Re=[],Ve=0;Ve>2]);return Re};function Hs(de){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=[de,Ae,Ve,et,H,Kn.O.bind(Kn),xn?.S.bind(xn)],et=2;etX4e);var d=de(o0e.url)}var u="./this.program",m=o0e.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 de=KT.buffer;Z=new Int8Array(de),C=new Int16Array(de),r.HEAPU8=R=new Uint8Array(de),E=new Uint16Array(de),A=new Int32Array(de),L=new Uint32Array(de),r.HEAPF32=F=new Float32Array(de),I=new Float64Array(de),N=new BigInt64Array(de),g=new BigUint64Array(de)}function v(de){var oe;throw(oe=r.onAbort)==null||oe.call(r,de),de="Aborted("+de+")",b(de),f=!0,de=new WebAssembly.RuntimeError(de+". Build with -sASSERTIONS for more info."),S?.(de),de}var X;async function Y(de){return de}async function D(de){var oe=X;try{var Re=await Y(oe);return await WebAssembly.instantiate(Re,de)}catch(Ve){b(`failed to asynchronously prepare wasm: ${Ve}`),v(Ve)}}async function M(de){return D(de)}var O=de=>{for(;0{var de=r.preRun.shift();z.push(de)},te={},H=de=>{for(;de.length;){var oe=de.pop();de.pop()(oe)}};function $(de){return this.O(L[de>>2])}var ee={},le={},_e={},he=class extends Error{constructor(de){super(de),this.name="InternalError"}},Ze=(de,oe,Re)=>{function Ve(Gt){if(Gt=Re(Gt),Gt.length!==de.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=de=>{for(var oe="";;){var Re=R[de++];if(!Re)return oe;oe+=String.fromCharCode(Re)}},Ge=class extends Error{constructor(de){super(de),this.name="BindingError"}},Ae=de=>{throw new Ge(de)};function Fe(de,oe,Re={}){var Ve=oe.name;if(!de)throw new Ge(`type "${Ve}" must have a positive integer typeid pointer`);if(le.hasOwnProperty(de)){if(Re.Aa)return;throw new Ge(`Cannot register type '${Ve}' twice`)}le[de]=oe,delete _e[de],ee.hasOwnProperty(de)&&(oe=ee[de],delete ee[de],oe.forEach(et=>et()))}function tt(de,oe,Re={}){return Fe(de,oe,Re)}var Be=(de,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}): ${de}`)}},je=de=>{throw new Ge(de.M.R.N.name+" instance already deleted")},qe=!1,We=()=>{},Ke=de=>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(de)):(Ke=oe=>oe,de);function ct(){}var Et=(de,oe)=>Object.defineProperty(oe,"name",{value:de}),zt={},ut=(de,oe,Re)=>{if(de[oe].U===void 0){var Ve=de[oe];de[oe]=function(...et){if(!de[oe].U.hasOwnProperty(et.length))throw new Ge(`Function '${Re}' called with an invalid number of arguments (${et.length}) - expects one of (${de[oe].U})!`);return de[oe].U[et.length].apply(this,et)},de[oe].U=[],de[oe].U[Ve.$]=Ve}},bt=(de,oe,Re)=>{if(r.hasOwnProperty(de)){if(Re===void 0||r[de].U!==void 0&&r[de].U[Re]!==void 0)throw new Ge(`Cannot register public name '${de}' twice`);if(ut(r,de,de),r[de].U.hasOwnProperty(Re))throw new Ge(`Cannot register multiple overloads of a function with the same number of arguments (${Re})!`);r[de].U[Re]=oe}else r[de]=oe,r[de].$=Re},ht=de=>{de=de.replace(/[^a-zA-Z0-9_]/g,"$");var oe=de.charCodeAt(0);return 48<=oe&&57>=oe?`_${de}`:de};function jt(de,oe,Re,Ve,et,Ct,gt,Gt){this.name=de,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=(de,oe,Re)=>{for(;oe!==Re;){if(!oe.fa)throw new Ge(`Expected null or instance of ${Re.name}, got an instance of ${oe.name}`);de=oe.fa(de),oe=oe.W}return de},pt=de=>{if(de===null)return"null";var oe=typeof de;return oe==="object"||oe==="array"||oe==="function"?de.toString():""+de};function Mi(de,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(de,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 de!==null&&de.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())),de!==null&&de.push(this.Z,Re)}break;default:throw new Ge("Unsupported sharing policy")}}return Re}function Si(de,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=(de,oe,Re)=>oe===Re?de:Re.W===void 0?null:(de=Hi(de,oe,Re.W),de===null?null:Re.ta(de)),Gi={},pi=(de,oe)=>{if(oe===void 0)throw new Ge("ptr should not be undefined");for(;de.W;)oe=de.fa(oe),de=de.W;return Gi[oe]},Zi=(de,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(de,{M:{value:oe,writable:!0}}))};function On(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn){this.name=de,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?Mi:Si,this.T=null)}var rn=(de,oe,Re)=>{if(!r.hasOwnProperty(de))throw new he("Replacing nonexistent public symbol");r[de].U!==void 0&&Re!==void 0?r[de].U[Re]=oe:(r[de]=oe,r[de].$=Re)},Hn=(de,oe)=>{de=ye(de);var Re=DA.get(oe);if(typeof Re!="function")throw new Ge(`unknown function pointer with signature ${de}: ${oe}`);return Re};class $i extends Error{}var Po=de=>{de=HT(de);var oe=ye(de);return Tp(de),oe},hr=(de,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(`${de}: `+Ve.map(Po).join([", "]))},Is=(de,oe)=>{for(var Re=[],Ve=0;Ve>2]);return Re};function Hs(de){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=[de,Ae,Ve,et,H,Kn.O.bind(Kn),xn?.S.bind(xn)],et=2;et{setTimeout(()=>r.setStatus(""),1),de()},1)):de()})(),V?o=r:o=new Promise((de,oe)=>{_=de,S=oe}),o}var $1=(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)),xQe=e=>t=>t*e+.5,TQe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:$1(e,t.positions),scales:$1(e,t.scales,Math.exp),rotations:$1(e,t.rotations),alphas:$1(e,t.alphas,yQe),colors:$1(e,t.colors,xQe(i)),sh:$1(e,t.sh)}},_Qe=(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))},k0e=async(e,t)=>{var n;let i=await gQe(),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=TQe(i,a,t);return _Qe(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var SQe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ZQe=[0,9,24,45],RQe=14,CQe=1.6*1024*1024*1024;function VQe(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 EQe(e,t){let n=RQe+(ZQe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var Q6=class extends to{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=AQe(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._spzError)&&q6(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=VQe(this._gltf,this._primitive);if(l(n)){let o=EQe(n.numPoints,n.shDegree);if(o>CQe){let r=Math.round(o/1048576);return q6(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=k0e(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=GQe(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 AQe(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;q6(e,n)}}function q6(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load SPZ",t)}async function GQe(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=Q6;var Hvn=x(T(),1);var wvn=x(T(),1);var Zvn=x(T(),1);function Q2(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)}Q2.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=kp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new Q2({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Q2.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}}});Q2.BATCH_TABLE_CLASS_NAME="_batchTable";var $h=Q2;var Fvn=x(T(),1);var Evn=x(T(),1);function BO(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)}BO.fromJson=function(e){return new BO({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(BO.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=BO;function zO(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a>t};cc.fromSubtreeJson=async function(e,t,n,i,o){let r=new cc(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=IQe(n);let a=s.json;r._subtreeJson=a;let c;if(oo(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=wy.parseAllBoundingVolumeSemantics("CONTENT",g)}let N=e8e(b,I);l(N)&&(F.boundingVolume=N),f.push(It(F,s.contentHeaders[E]))}let y=J0e(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=ebe(e,s.baseResource,R,n);return C.implicitCoordinates=a,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function KO(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(oo(e,"3DTILES_bounding_volume_S2")||l(e.region))}function i7(e,t){l(t)&&(oo(e,"3DTILES_bounding_volume_S2")?qQe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&QQe(e.region,t.minimumHeight,t.maximumHeight))}function QQe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function qQe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function $Qe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!KO(r.boundingVolume,r)&&KO(e.boundingVolume,r)?s=j0e(e,t,n,i??!1,o):s=r.boundingVolume,i7(s,r),s}function e8e(e,t){let n;return l(t)&&(n=t.boundingVolume),KO(n,t)?i7(n,t):KO(e,t)&&(n=$e(e,!0),i7(n,t)),n}function j0e(e,t,n,i,o){let r=e.boundingVolume;return oo(r,"3DTILES_bounding_volume_S2")?Q0e(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:$0e(r.region,t.level,t.x,t.y,t.z)}:{box:q0e(r.box,t.level,t.x,t.y,t.z)}}function Q0e(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?Y1.encode2D(i,o,r):Y1.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 t8e=new h,n8e=new h,n7=new h,i8e=new q;function q0e(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,n8e),s=q.unpack(e,3,i8e),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,t8e);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,n7);p=q.multiplyByVector(s,p,n7),p=h.add(p,r,n7);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 o8e=new re;function $0e(e,t,n,i,o){if(t===0)return e.slice();let r=re.unpack(e,0,o8e),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 r8e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=j0e(i,o,n,!1,t),s=J0e(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=ebe(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function ebe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}nC._deriveBoundingBox=q0e;nC._deriveBoundingRegion=$0e;nC._deriveBoundingVolumeS2=Q0e;var iC=nC;var Pni=x(T(),1);var q2n=x(T(),1),tbe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(tbe);var Md=tbe;var Cni=x(T(),1);var iXn=x(T(),1);var SPn=x(T(),1);var fPn=x(T(),1);var eFn=x(T(),1),nbe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(nbe);var mn=nbe;var oFn=x(T(),1);function s8e(e){e=e??B.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Mt=s8e;var sFn=x(T(),1),ibe={NONE:0,TOP:1,ALL:2};Object.freeze(ibe);var yn=ibe;var kFn=x(T(),1);var mFn=x(T(),1);var obe=new h,rbe=new h,sbe=new h;function a8e(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,obe),s=h.subtract(i,t,rbe),a=h.subtract(e,t,sbe),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,obe),s=k.subtract(i,t,rbe),a=k.subtract(e,t,sbe),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 w_=a8e;var bFn=x(T(),1);var o7={};o7.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)};o7.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 M=-1,O,w=-1,z=0;for(;zw||w===-1)&&(w=O,M=K)),++z}return M===-1?r(v,Y,g,D):M}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 iF=o7;var Kl={};function tB(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function c8e(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);tB(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=iF.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function abe(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 u8e(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=abe(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=abe(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 cbe=new h,m8e=new pe;Kl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ui;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 me(y,_):void 0})}Kl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(c7(t,"geometry")),n.length>0&&(o.push(c7(n,"westHemisphereGeometry")),o.push(c7(n,"eastHemisphereGeometry"))),o};var Nm=new h,oF=new h,oC=new h,rC=new h;Kl.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;rx(e,a),rx(t,a),rx(n,a)}var mbe=new h;function Ym(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,mbe),e.y/(e.y-t.y),mbe),n),h.clone(n,i),rx(n,!0),rx(i,!1)}var k_=new h,U_=new h,D_=new h,O_=new h,l7={positions:new Array(7),indices:new Array(9)};function C8e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;R8e(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=l7.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Ym(e,t,k_,D_),Ym(e,n,U_,O_),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Ym(t,n,k_,D_),Ym(t,e,U_,O_),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Ym(n,e,k_,D_),Ym(n,t,U_,O_),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||(Ym(n,e,k_,D_),Ym(n,t,U_,O_),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Ym(t,n,k_,D_),Ym(t,e,U_,O_),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Ym(e,t,k_,D_),Ym(e,n,U_,O_),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=l7.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=k_,c[4]=U_,c[5]=D_,c[6]=O_,c.length=7),l7}function hbe(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=me.fromVertices(n.position.values)),e}function aC(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 h7(e,t,n){let i=l(e.geometry.boundingSphere);t=hbe(t,i),n=hbe(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 f7(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 V8e=f7(ce,4),eB=f7(h,3),xbe=f7(k,2),E8e=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},sF=new h,d7=new h,u7=new h,A8e=new h;function qO(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,sF),S=h.fromArray(o,t*3,d7),Z=h.fromArray(o,n*3,u7),R=w_(i,_,S,Z,A8e);if(l(R)){if(l(r)&&eB(e,t,n,R,r,m.normal.values,y,!0),l(d)){let C=h.fromArray(d,e*3,sF),E=h.fromArray(d,t*3,d7),A=h.fromArray(d,n*3,u7);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=sF,L.x=0,L.y=0,L.z=0),h.pack(L,m.extrudeDirection.values,y*3)}if(l(u)&&E8e(e,t,n,R,u,m.applyOffset.values,y),l(s)&&eB(e,t,n,R,s,m.tangent.values,y,!0),l(a)&&eB(e,t,n,R,a,m.bitangent.values,y,!0),l(c)&&xbe(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,Sbe);(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,m7);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||me.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==Vm.NONE)switch(t.geometryType){case Vm.POLYLINES:Y8e(e);break;case Vm.TRIANGLES:fbe(e);break;case Vm.LINES:pbe(e);break}else Z8e(t),t.primitiveType===Ie.TRIANGLES?fbe(e):t.primitiveType===Ie.LINES&&pbe(e);return e};var zn=Kl;var CIn=x(T(),1);var BFn=x(T(),1);var Zbe=W.EPSILON10;function M8e(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;s10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};sx.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};sx.prototype.contains=function(e){return this._array.indexOf(e)!==-1};sx.prototype.clear=function(){this._array.length=this._offset=this._length=0};sx.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ax=sx;var Ir={};Ir.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 Q8e(e,t,n,i){if(i===mn.RHUMB)return j8e(e,t,n);let o=Ti.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var q8e=new pe;function $8e(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(m,q8e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=Q8e(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 Ebe(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=Ebe(i,o,s,a,1,0,c)}return i};Ir.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new ax;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 Wc(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 cC=new pe,s6e=new h;Ss.prototype.getLatitude=function(e){l(e)||(e=ne.default),cC.latitude=this.conformalLatitude,cC.longitude=this.longitude,cC.height=0;let t=this.ellipsoid.cartographicToCartesian(cC,s6e);return e.cartesianToCartographic(t,cC),cC.latitude};var a6e=new gn,c6e=new h,l6e=new h;Ss.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ss.NORTH_POLE_TANGENT_PLANE,o=Ss.SOUTH_POLE;n<0&&(i=Ss.SOUTH_POLE_TANGENT_PLANE,o=Ss.NORTH_POLE);let r=a6e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,c6e),h.normalize(r.direction,r.direction);let s=Ti.rayPlane(r,i.plane,l6e),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 Ss(new k(c,d),i)};Ss.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!==mn.RHUMB){let p=k.subtract(t.position,e.position,E6e),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),A6e),y=cl.clone(t,G6e);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 Fbe=new cl,L6e=new cl,Mm={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};wm.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,Mm.northAngle=0,Mm.southAngle=0,Mm.westOverIdl=Number.POSITIVE_INFINITY,Mm.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=cl.fromCartesian(e[0],L6e);for(let s=1;sMm.eastOverIdl-Mm.westOverIdl&&(i.west=Mm.westOverIdl,i.east=Mm.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(Mm.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Mm.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var W6e=new cl;function v6e(e,t,n){return e.height>=W.PI||e.width>=W.PI?cl.fromCartesian(t[0],W6e).tangentPlane:Ms.fromPoints(t,n)}var Ibe=new pe;function F6e(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,Ibe);return l(r)||(r=new k),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return cl.fromCartesian(o,r)};let i=Ms.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function P6e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?ii.splitPolygonsOnEquator(o,t,n,r):o}function X6e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return nt.fromRectangle(t,void 0,Gbe);let o=e,r=Ms.fromPoints(o,n);return ii.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Gbe)}wm.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=ii.polygonsFromHierarchy(r,m,F6e(b,p,n),!s,n,P6e(b,n,d,s)),y=f.hierarchy,_=f.polygons,S=function(v){return v},Z=m?ii.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(y.length===0)return;let R=y[0].outerRing,C=X6e(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:v6e(b,R,n).plane.normal,projectTo2d:I6e(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=Z6e(n,_[N],m?Z[N]:void 0,i,y[N],s,a,c,t,d),X;a&&c?(X=v.topAndBottom,I.geometry=ii.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=p7(I),E.push(X));let Y=v.walls;I.wall=!0;for(let D=0;D0&&(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/Xbe))),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 K6e(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 J6e(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 lx(e,t){return Math.max(0,Math.min(t-1,e))}var g7=new Float64Array(512),kbe=new Float64Array(512),Ube={positions:new Float64Array(512),vertexCount:0};function j6e(e,t,n,i,o){g7.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?kbe: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 cB(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 Obe(e,t){let[n,i]=cB(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:Ot.NEAREST,flipY:!1})}function Bbe(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;uuC.equals(t.clippingPolygon,e))};ll.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(o=>uC.equals(o.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return Kbe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};ll.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n{setTimeout(()=>r.setStatus(""),1),de()},1)):de()})(),V?o=r:o=new Promise((de,oe)=>{_=de,S=oe}),o}var z1=(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)),F4e=e=>t=>t*e+.5,I4e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:z1(e,t.positions),scales:z1(e,t.scales,Math.exp),rotations:z1(e,t.rotations),alphas:z1(e,t.alphas,v4e),colors:z1(e,t.colors,F4e(i)),sh:z1(e,t.sh)}},P4e=(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))},r0e=async(e,t)=>{var n;let i=await W4e(),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=I4e(i,a,t);return P4e(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var X4e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var N4e=[0,9,24,45],Y4e=14,M4e=1.6*1024*1024*1024;function w4e(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 k4e(e,t){let n=Y4e+(N4e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var h6=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=U4e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._spzError)&&f6(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=w4e(this._gltf,this._primitive);if(l(n)){let o=k4e(n.numPoints,n.shDegree);if(o>M4e){let r=Math.round(o/1048576);return f6(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=r0e(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=D4e(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 U4e(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;f6(e,n)}}function f6(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load SPZ",t)}async function D4e(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 q2=h6;var hFn=x(T(),1);var sFn=x(T(),1);var D2n=x(T(),1);function $2(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)}$2.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 $2({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties($2.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}}});$2.BATCH_TABLE_CLASS_NAME="_batchTable";var nf=$2;var $2n=x(T(),1);var H2n=x(T(),1);function FO(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)}FO.fromJson=function(e){return new FO({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(FO.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 eF=FO;function IO(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=K4e(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=rx.parseAllBoundingVolumeSemantics("CONTENT",g)}let N=fQe(b,I);l(N)&&(F.boundingVolume=N),f.push(It(F,s.contentHeaders[E]))}let y=h0e(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=y0e(e,s.baseResource,R,n);return C.implicitCoordinates=a,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function XO(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(no(e,"3DTILES_bounding_volume_S2")||l(e.region))}function x6(e,t){l(t)&&(no(e,"3DTILES_bounding_volume_S2")?mQe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&uQe(e.region,t.minimumHeight,t.maximumHeight))}function uQe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function mQe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function hQe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!XO(r.boundingVolume,r)&&XO(e.boundingVolume,r)?s=f0e(e,t,n,i??!1,o):s=r.boundingVolume,x6(s,r),s}function fQe(e,t){let n;return l(t)&&(n=t.boundingVolume),XO(n,t)?x6(n,t):XO(e,t)&&(n=$e(e,!0),x6(n,t)),n}function f0e(e,t,n,i,o){let r=e.boundingVolume;return no(r,"3DTILES_bounding_volume_S2")?p0e(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:g0e(r.region,t.level,t.x,t.y,t.z)}:{box:b0e(r.box,t.level,t.x,t.y,t.z)}}function p0e(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Cb.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?W1.encode2D(i,o,r):W1.encode2D(i,r,o),u=Cb.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:Cb.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var pQe=new h,bQe=new h,y6=new h,gQe=new q;function b0e(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,bQe),s=q.unpack(e,3,gQe),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,pQe);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,y6);p=q.multiplyByVector(s,p,y6),p=h.add(p,r,y6);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 yQe=new re;function g0e(e,t,n,i,o){if(t===0)return e.slice();let r=re.unpack(e,0,yQe),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 xQe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=f0e(i,o,n,!1,t),s=h0e(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=y0e(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function y0e(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}J1._deriveBoundingBox=b0e;J1._deriveBoundingRegion=g0e;J1._deriveBoundingVolumeS2=p0e;var j1=J1;var vai=x(T(),1);var _In=x(T(),1),x0e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(x0e);var Md=x0e;var Sai=x(T(),1);var BIn=x(T(),1);var CIn=x(T(),1);function Q1(e,t){this._distance=t,this._normal=new T0e(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(Q1.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)}}});Q1.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new Q1(e.normal,e.distance),t};Q1.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new Q1(e.normal,e.distance)};function T0e(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(T0e.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=Q1;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?C0e:V0e,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 sF(r,s,n,a,c,d,0),s}function L0e(e,t,n,i,o){let r;if(o===MQe(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=G0e(s/i|0,e[s],e[s+1],r);return r&&q1(r,r.next)&&(cF(r),r=r.next),r}function nS(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(q1(n,n.next)||ys(n.prev,n,n.next)===0)){if(cF(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function sF(e,t,n,i,o,r,s){if(!e)return;!s&&r&&FQe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?CQe(e,i,o,r):RQe(e)){t.push(c.i,e.i,d.i),cF(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=VQe(nS(e),t),sF(e,t,n,i,o,r,2)):s===2&&EQe(e,t,n,i,o,r):sF(nS(e),t,n,i,o,r,1);break}}}function RQe(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&&rF(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 CQe(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=T6(b,f,t,n,i),Z=T6(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&&rF(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&&rF(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&&rF(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&&rF(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 VQe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!q1(i,o)&&v0e(i,n,n.next,o)&&aF(i,o)&&aF(o,i)&&(t.push(i.i,n.i,o.i),cF(n),cF(n.next),n=e=o),n=n.next}while(n!==e);return nS(n)}function EQe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&XQe(s,a)){let c=F0e(s,a);s=nS(s,s.next),c=nS(c,c.next),sF(s,t,n,i,o,r,0),sF(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function AQe(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&&W0e(os.x||n.x===s.x&&vQe(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function vQe(e,t){return ys(e.prev,e,t.prev)<0&&ys(t.next,e,e.next)<0}function FQe(e,t,n,i){let o=e;do o.z===0&&(o.z=T6(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,IQe(o)}function IQe(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 T6(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 PQe(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 rF(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&W0e(e,t,n,i,o,r,s,a)}function XQe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!NQe(e,t)&&(aF(e,t)&&aF(t,e)&&YQe(e,t)&&(ys(e.prev,e,t.prev)||ys(e,t.prev,t))||q1(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 q1(e,t){return e.x===t.x&&e.y===t.y}function v0e(e,t,n,i){let o=YO(ys(e,t,n)),r=YO(ys(e,t,i)),s=YO(ys(n,i,e)),a=YO(ys(n,i,t));return!!(o!==r&&s!==a||o===0&&NO(e,n,t)||r===0&&NO(e,i,t)||s===0&&NO(n,e,i)||a===0&&NO(n,t,i))}function NO(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 YO(e){return e>0?1:e<0?-1:0}function NQe(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&&v0e(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function aF(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 YQe(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 F0e(e,t){let n=_6(e.i,e.x,e.y),i=_6(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 G0e(e,t,n,i){let o=_6(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 cF(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 _6(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function MQe(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?qs.COUNTER_CLOCKWISE:qs.CLOCKWISE};sx.triangulate=function(e,t){let n=k.packArray(e);return S6(n,t,2)};var N0e=new h,Y0e=new h,M0e=new h,I0e=new h,P0e=new h,X0e=new h,vb=new h,w0e=new k,k0e=new k,U0e=new k,$1=new k;sx.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,N0e),L=h.fromArray(d,C*3,Y0e),F=h.fromArray(d,R*3,M0e),I,N,g;r&&(I=k.fromArray(u,E*2,w0e),N=k.fromArray(u,C*2,k0e),g=k.fromArray(u,R*2,U0e));let V=h.multiplyByScalar(h.normalize(A,I0e),y,I0e),G=h.multiplyByScalar(h.normalize(L,P0e),y,P0e),v=h.multiplyByScalar(h.normalize(F,X0e),y,X0e),X=h.magnitudeSquared(h.subtract(V,G,vb)),Y=h.magnitudeSquared(h.subtract(G,v,vb)),D=h.magnitudeSquared(h.subtract(v,V,vb)),M=Math.max(X,Y,D),O,w,z;M>S?X===M?(O=`${Math.min(E,C)} ${Math.max(E,C)}`,a=f[O],l(a)||(w=h.add(A,L,vb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(I,N,$1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(E,a,R),s.push(a,C,R)):Y===M?(O=`${Math.min(C,R)} ${Math.max(C,R)}`,a=f[O],l(a)||(w=h.add(L,F,vb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(N,g,$1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(C,a,E),s.push(a,R,E)):D===M&&(O=`${Math.min(R,E)} ${Math.max(R,E)}`,a=f[O],l(a)||(w=h.add(F,A,vb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(g,I,$1),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 UQe=new pe,DQe=new pe,OQe=new pe,Z6=new pe;sx.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,N0e),I=h.fromArray(d,A*3,Y0e),N=h.fromArray(d,E*3,M0e),g,V,G;r&&(g=k.fromArray(u,L*2,w0e),V=k.fromArray(u,A*2,k0e),G=k.fromArray(u,E*2,U0e));let v=e.cartesianToCartographic(F,UQe),X=e.cartesianToCartographic(I,DQe),Y=e.cartesianToCartographic(N,OQe);S.setEndPoints(v,X);let D=S.surfaceDistance;Z.setEndPoints(X,Y);let M=Z.surfaceDistance;R.setEndPoints(Y,v);let O=R.surfaceDistance,w=Math.max(D,M,O),z,K,te,H,$;w>_?D===w?(z=`${Math.min(L,A)} ${Math.max(L,A)}`,a=f[z],l(a)||(K=S.interpolateUsingFraction(.5,Z6),te=(v.height+X.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,vb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(g,V,$1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(L,a,E),s.push(a,A,E)):M===w?(z=`${Math.min(A,E)} ${Math.max(A,E)}`,a=f[z],l(a)||(K=Z.interpolateUsingFraction(.5,Z6),te=(X.height+Y.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,vb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(V,G,$1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(A,a,L),s.push(a,E,L)):O===w&&(z=`${Math.min(E,L)} ${Math.max(E,L)}`,a=f[z],l(a)||(K=R.interpolateUsingFraction(.5,Z6),te=(Y.height+v.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,vb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(G,g,$1),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)};sx.scaleToGeodeticHeight=function(e,t,n,i){n=n??ne.default;let o=wQe,r=kQe;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};ax.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ax.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ax.prototype.clear=function(){this._array.length=this._offset=this._length=0};ax.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var cx=ax;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 e8e(e,t,n,i){if(i===un.RHUMB)return $Qe(e,t,n);let o=xi.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var t8e=new pe;function n8e(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(m,t8e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=e8e(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 z0e(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=z0e(i,o,s,a,1,0,c)}return i};Fr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new cx;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 eC=new pe,l8e=new h;xs.prototype.getLatitude=function(e){l(e)||(e=ne.default),eC.latitude=this.conformalLatitude,eC.longitude=this.longitude,eC.height=0;let t=this.ellipsoid.cartographicToCartesian(eC,l8e);return e.cartesianToCartographic(t,eC),eC.latitude};var d8e=new gn,u8e=new h,m8e=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=d8e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,u8e),h.normalize(r.direction,r.direction);let s=xi.rayPlane(r,i.plane,m8e),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,L8e),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),W8e),y=rl.clone(t,v8e);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 q0e=new rl,F8e=new rl,Xm={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Nm.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,Xm.northAngle=0,Xm.southAngle=0,Xm.westOverIdl=Number.POSITIVE_INFINITY,Xm.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=rl.fromCartesian(e[0],F8e);for(let s=1;sXm.eastOverIdl-Xm.westOverIdl&&(i.west=Xm.westOverIdl,i.east=Xm.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(Xm.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Xm.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var I8e=new rl;function P8e(e,t,n){return e.height>=W.PI||e.width>=W.PI?rl.fromCartesian(t[0],I8e).tangentPlane:Ms.fromPoints(t,n)}var $0e=new pe;function X8e(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,$0e);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=Ms.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function Y8e(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 M8e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return nt.fromRectangle(t,void 0,K0e);let o=e,r=Ms.fromPoints(o,n);return oi.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,K0e)}Nm.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,X8e(b,p,n),!s,n,Y8e(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=M8e(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:P8e(b,R,n).plane.normal,projectTo2d:N8e(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=V8e(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=hi.scaleToGeodeticHeight(X.geometry.attributes.position.values,A,n,!s),I.geometry=X.geometry):c&&(X=v.topAndBottom,X.geometry.attributes.position.values=hi.scaleToGeodeticHeight(X.geometry.attributes.position.values,L,n,!0),I.geometry=X.geometry),(a||c)&&(I.wall=!1,X.geometry=R6(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(Ym.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Ym.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}=O8e(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:G6.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:G6.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:nbe.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:[dF],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[uF]}),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 O8e(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 B8e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var fF=D8e;var{ERR_CAPACITY:QNn}=na.Error,v6=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=fF(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=v6;var LYn=x(T(),1);var sYn=x(T(),1);var{ERR_RESIZE:iYn,ERR_CAPACITY:oYn}=na.Error,oC=class oC 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(oC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(oC.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/obe))),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 e6e(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 t6e(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 dx(e,t){return Math.max(0,Math.min(t-1,e))}var P6=new Float64Array(512),lbe=new Float64Array(512),dbe={positions:new Float64Array(512),vertexCount:0};function n6e(e,t,n,i,o){P6.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?lbe: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 HO(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 mbe(e,t){let[n,i]=HO(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 hbe(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;uiC.equals(t.clippingPolygon,e))};sl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(o=>iC.equals(o.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return bbe(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= PRIMARY_STEPS) { +break; +} +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; +} +vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); +float lightHeight = length(lightPosition) - atmosphereInnerRadius; +lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; +lightPositionLength += lightStepLength; +} +vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); +rayleighAccumulation += sampleDensity.x * attenuation; +mieAccumulation += sampleDensity.y * attenuation; +rayPositionLength += (rayStepLength += rayStepLengthIncrease); +} +rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; +mieColor = u_atmosphereMieCoefficient * mieAccumulation; +opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); +} +vec4 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 = u_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) * u_atmosphereLightIntensity; +return vec4(color, opacity); +} +`;var cMn=x(T(),1),gF=`uniform samplerCube u_radianceMap; +in vec2 v_textureCoordinates; +const float twoSqrtPi = 2.0 * sqrt(czm_pi); +float computeShBasis(int index, vec3 s) { +if (index == 0) { +return 1.0 / twoSqrtPi; +} +if (index == 1) { +return -sqrt(3.0) * s.y / twoSqrtPi; +} +if (index == 2) { +return sqrt(3.0) * s.z / twoSqrtPi; +} +if (index == 3) { +return -sqrt(3.0) * s.x / twoSqrtPi; +} +if (index == 4) { +return sqrt(15.0) * s.y * s.x / twoSqrtPi; +} +if (index == 5) { +return -sqrt(15.0) * s.y * s.z / twoSqrtPi; +} +if (index == 6) { +return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; +} +if (index == 7) { +return -sqrt(15.0) * s.x * s.z / twoSqrtPi; +} +if (index == 8) { +return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; +} +return 0.0; +} +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +const int samples = 256; +const float solidAngle = 1.0 / float(samples); +void main() { +vec2 uv = v_textureCoordinates.xy * 3.0; +int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); +for (int i = 0; i < samples; ++i) { +vec2 xi = hammersley2D(i, samples); +float phi = czm_twoPi * xi.x; +float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); +float Ylm = computeShBasis(coefficientIndex, direction); +vec3 lookupDirection = -direction.xyz; +lookupDirection.z = -lookupDirection.z; +vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); +out_FragColor += Ylm * color * solidAngle * sinTheta; +} +} +`;var dMn=x(T(),1),yF=`precision highp float; +in vec2 v_textureCoordinates; +uniform vec3 u_faceDirection; +uniform vec3 u_positionWC; +uniform mat4 u_enuToFixedFrame; +uniform vec4 u_brightnessSaturationGammaIntensity; +uniform vec4 u_groundColor; +vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { +vec2 scaledUV = uv * 2.0 - 1.0; +if (faceDir.x != 0.0) { +return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); +} else if (faceDir.y != 0.0) { +return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); +} else { +return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); +} +} +void main() { +float height = length(u_positionWC); +float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; +float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); +vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); +float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; +float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; +vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; +vec3 normalizedDirection = normalize(direction); +czm_ray ray = czm_ray(positionWC, normalizedDirection); +czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); +if (!czm_isEmpty(intersection)) { +intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); +} +bool onEllipsoid = intersection.start >= 0.0; +float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); +vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; +float lightEnum = u_radiiAndDynamicAtmosphereColor.z; +vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); +vec3 mieColor; +vec3 rayleighColor; +float opacity; +czm_computeScattering( +ray, +rayLength, +lightDirectionWC, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); +#ifdef ATMOSPHERE_COLOR_CORRECT +const bool ignoreBlackPixels = true; +atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); +#endif +vec3 lookupDirection = -normalizedDirection; +lookupDirection.x = -lookupDirection.x; +lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); +lookupDirection.x = -lookupDirection.x; +float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); +skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); +float intensity = u_brightnessSaturationGammaIntensity.w; +vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); +vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); +vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); +vec3 up = normalize(positionWC); +float occlusion = max(dot(lightDirectionWC, up), 0.05); +vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); +vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); +vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); +float brightness = u_brightnessSaturationGammaIntensity.x; +float saturation = u_brightnessSaturationGammaIntensity.y; +float gamma = u_brightnessSaturationGammaIntensity.z; +#ifdef ENVIRONMENT_COLOR_CORRECT +color.rgb = mix(vec3(0.0), color.rgb, brightness); +color.rgb = czm_saturation(color.rgb, saturation); +#endif +color.rgb = pow(color.rgb, vec3(gamma)); +color.rgb = czm_gammaCorrect(color.rgb); +out_FragColor = color; +} +`;var mMn=x(T(),1),xF=`precision highp float; +in vec3 v_textureCoordinates; +uniform float u_roughness; +uniform samplerCube u_radianceTexture; +uniform vec3 u_faceDirection; +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float phi = czm_twoPi * xi.x; +float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); +vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); +vec3 tangentX = normalize(cross(upVector, N)); +vec3 tangentY = cross(N, tangentX); +return tangentX * H.x + tangentY * H.y + N * H.z; +} +const int samples = 128; +void main() { +vec3 normal = u_faceDirection; +vec3 V = normalize(v_textureCoordinates); +float roughness = u_roughness; +vec4 color = vec4(0.0); +float weight = 0.0; +for (int i = 0; i < samples; ++i) { +vec2 xi = hammersley2D(i, samples); +vec3 H = importanceSampleGGX(xi, roughness, V); +vec3 L = 2.0 * dot(V, H) * H - V; +float NdotL = max(dot(V, L), 0.0); +if (NdotL > 0.0) { +color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; +weight += NdotL; +} +} +out_FragColor = color / weight; +} +`;var fMn=x(T(),1),TF=`in vec3 position; +out vec3 v_textureCoordinates; +uniform vec3 u_faceDirection; +vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { +vec2 scaledUV = uv; +if (faceDir.x != 0.0) { +return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); +} else if (faceDir.y != 0.0) { +return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); +} else { +return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); +} +} +void main() +{ +v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); +v_textureCoordinates.y = -v_textureCoordinates.y; +v_textureCoordinates.z = -v_textureCoordinates.z; +gl_Position = vec4(position, 1.0); +} +`;function Vi(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??B.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=Vi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new k(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??Vi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Vi.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}}});Vi._maximumComputeCommandCount=8;Vi._activeComputeCommandCount=0;Vi._nextFrameCommandQueue=[];Vi._queueCommand=(e,t)=>{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,xbe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,m6e)},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 f6e(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,xbe)}});S.postExecute=u(S,m,f,b,p),e._convolutionComputeCommands[m]=S,Vi._queueCommand(S,t),++m}r/=2,s/=2}d()}var Tbe=new k(3,3);function p6e(e,t){let n=t.context,i=Tbe,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:[gF]}),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 b6e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new ps({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Tbe,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=l6e(this,e)||i===Fb.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&&(h6e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(f6e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(p6e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){b6e(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=S6e(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 T6e(e,t,n,i){let o=[],r=n.properties;for(let[s,a]of Object.entries(r)){if(!a.isGpuCompatible(RF))continue;let c=e[s],d=l(c)?t[c.values]:_6e(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 _6e(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]=_}_>k6e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>U6e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=_,t[a]=_):y===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),y=Abe(i,c,d,u,p,b,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Abe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=O6(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,b=r?1:0,f=O6(e,n,m,p,b);if(f===0)return n;let y=s?1:0,_=0,S=r?1:0,Z=O6(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=B6(u),g=B6(f),V=B6(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(Gbe(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 Gbe(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 Lbe(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,jO(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,jO(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=cr.FAILED,jO(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,Dqe(this),Ube(this),Oqe(this),Bqe(this),zqe(this),Hqe(this),this._components=void 0,this._typedArray=void 0,this._state=cr.UNLOADED}};async function A7e(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,jO(e,t)}}async function G7e(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new AF({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=Uqe(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 jO(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function L7e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s{if(e.isDestroyed())return;let s=J6(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 Y7e(e){return e===Number?0:new e}function M7e(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 w7e={VEC2:new k(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function k7e(e,t){let n=M7e(e.componentDatatype),i=w7e[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 U7e(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 D7e(e,t,n,i,o){let r=e.accessors[t],s=Dt.getMathType(r.type),a=r.normalized??!1,c=new i7e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=Y7e(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=Nd(e,r),no(r,"WEB3D_quantized_attributes")&&U7e(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&&k7e(c,s),c}function Hbe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var O7e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function j6(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=O7e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function B7e(e){let t=e===dt.POSITION,n=e===dt.FEATURE_ID,i=e===dt.TEXCOORD;return t||n||i}function z7e(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 H7e(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])?z7e(S,Z,s,a):l(r)?H7e(S,Z,s,a):K7e(d,u,S,Z,s,a)},S}function Jbe(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=Kbe(e,t,n,i,o,r,a?!1:_,a?!0:S,c),E=new cS.AttributeLoadPlan(C);return E.loadBuffer=_,E.loadTypedArray=S,E}function J7e(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=j6(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 Kbe(e,t,c,void 0,void 0,void 0,f,p||m&&(!a||y||b),o)}function j7e(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 o7e;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=I7e(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 cS.IndicesLoadPlan(m);return L.loadBuffer=_,L.loadTypedArray=S,L}function Q7e(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 Ql(e,t,n,i,o){let r=e.gltfJson,s=Yd.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=Yd.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=Q7e(m.sampler,i,o))},c}function q7e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new _7e;return l(i)&&(c.diffuseTexture=Ql(e,i,n)),l(o)&&(c.specularGlossinessTexture=Ql(e,o,n)),c.diffuseFactor=wd(ce,r),c.specularFactor=wd(h,s),c.glossinessFactor=a,c}function $7e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new T7e;return l(i)&&(c.baseColorTexture=Ql(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Ql(e,o,n)),c.baseColorFactor=wd(ce,r),c.metallicFactor=s,c.roughnessFactor=a,c}function eqe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new S7e;return l(o)&&(a.specularTexture=Ql(e,o,n)),l(s)&&(a.specularColorTexture=Ql(e,s,n)),a.specularFactor=i,a.specularColorFactor=wd(h,r),a}function tqe(e,t,n){let{anisotropyStrength:i=z6.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=z6.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new z6;return l(r)&&(s.anisotropyTexture=Ql(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function nqe(e,t,n){let{clearcoatFactor:i=H6.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=H6.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new H6;return l(o)&&(c.clearcoatTexture=Ql(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=Ql(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Ql(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function iqe(e){return new Z7e(e)}function oqe(e){if(!l(e))return;let t=new R7e;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 rqe(e,t,n){let i=new C7e,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=q7e(e,r,n):(l(d)&&(i.metallicRoughness=$7e(e,d,n)),l(s)&&!i.unlit&&(i.specular=eqe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=tqe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=nqe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ql(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ql(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ql(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=iqe(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=oqe(o.BENTLEY_materials_line_style),i}function jbe(e,t){let n=new Dbe;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 Qbe(e,t,n,i){let o=new Dbe,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Hbe(r.attribute),o.positionalLabel=i,o}function qbe(e,t){let n=new Bbe;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 $be(e,t,n,i){let o=new Bbe,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 sqe(e,t,n,i){let o=new Obe;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=Ql(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 aqe(e,t,n,i,o,r){let s=new Obe,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Ql(e,c,i,Ht.NEAREST,ei.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function cqe(e,t,n,i,o){let r=new r7e,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=j6(e,dt,u),b=Jbe(e,m,p,s,a,c,d,n,o);r.attributes.push(b.attribute),i.attributePlans.push(b)}return r}function lqe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function ege(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 dqe(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 uqe(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=MF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(P.IDENTITY);return i}function Aqe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=Eqe(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)};dC.prototype.isDestroyed=function(){return!1};dC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var wF=dC;var DUn=x(T(),1);var XUn=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 $l=ql;function kF(e){e=e??B.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumRenderbufferSize,o=e.format??$l.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(kF.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});kF.prototype._getRenderbuffer=function(){return this._renderbuffer};kF.prototype.isDestroyed=function(){return!1};kF.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var Wu=kF;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=$l.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:$l.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Wu({context:e,width:t,height:n,format:$l.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:$l.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new wF({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(R.x>s.clientWidth*.5){a.width=R.x,c.frustum.right=p.x-S,ll=DF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,q6),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=DF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,$6)}else{a.x+=R.x,a.width-=R.x,c.frustum.left=-p.x-S,ll=DF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,q6),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=DF(r,n,c,ll),Fc.clipToGLWindowCoordinates(a,ll,$6)}h.clone(b,c.position),c.frustum=f.clone(),i=k.clone(q6,i),(i.x<0||i.x>s.clientWidth)&&(i.x=$6.x)}}if(o.mode!==se.SCENE2D||d){if(ll=DF(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 Yb=new h,i$e=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,i$e);if(!l(r))return;if(o.project(r,Yb),i===se.COLUMBUS_VIEW)return h.fromElements(Yb.z,Yb.x,Yb.y,n);if(i===se.SCENE2D)return h.fromElements(0,Yb.x,Yb.y,n);let s=e.morphTime;return h.fromElements(W.lerp(Yb.z,t.x,s),W.lerp(Yb.x,t.y,s),W.lerp(Yb.y,t.z,s),n)};var rge=new h,sge=new h,age=new P;Fc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,rge),P.computeViewportTransformation(e,0,1,age),P.multiplyByPoint(age,rge,sge),k.fromCartesian3(sge,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 o$e=new ce,cge=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,o$e);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,cge);let b=1/m.w;h.multiplyByScalar(m,b,m)}else{let b=p.offCenterFrustum;l(b)&&(p=b),m=cge,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 ADn=x(T(),1);var k5n=x(T(),1);var mC={};mC._deprecationWarning=Jo;var Mb=Uint32Array.BYTES_PER_ELEMENT;mC.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Mb;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+=Mb;let s=o.getUint32(t,!0);t+=Mb;let a=o.getUint32(t,!0);t+=Mb;let c=o.getUint32(t,!0);t+=Mb;let d=o.getUint32(t,!0);t+=Mb;let u=o.getUint32(t,!0);t+=Mb;let m;d>=570425344?(t-=Mb*2,m=a,d=c,u=0,a=0,c=0,mC._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-=Mb,m=d,d=a,u=c,a=0,c=0,mC._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,_):(mC._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 OF=mC;var B5n=x(T(),1);function BF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function lge(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 r$e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=J.createTypedArray(n,i),o[t]=r),r}BF.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,lge(this,e,t,n,1,i.byteOffset)):i};BF.prototype.hasProperty=function(e){return l(this.json[e])};BF.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)),lge(this,e,t,n,this.featuresLength,i.byteOffset)):r$e(this,e,t,i)};BF.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,_):(qO._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 JF=qO;var kb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},$O=Vn.Attribute,V$e=Vn.FeatureIdAttribute,pge=Vn.Instances,o7=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=kb.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=JF.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=Id(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=kb.LOADING,this._promise=m.load().then(()=>{if(!this.isDestroyed())return this._state=kb.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw E$e(this,p)}),this._promise}process(t){if(this._state===kb.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===kb.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=P.multiplyTransformation(this._transform,o.transform,o.transform),L$e(this,o,t),A$e(this,o),this._components=o,this._arrayBuffer=void 0,this._state=kb.READY,!0}isUnloaded(){return this._state===kb.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),P$e(this),this._components=void 0,this._arrayBuffer=void 0,this._state=kb.UNLOADED}};function E$e(e,t){return e.unload(),e._state=kb.FAILED,e.getError("Failed to load i3dm",t)}function A$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 Ma({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var eB=new h,r7=new Array(4),G$e=new P;function L$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=v$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 M=me.fromPoints(f);for(i=0;i0&&(M.instances=D?W$e(I):I,D=!0)}}function W$e(e){let t=new pge;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};hC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var vo=hC;function fC(e){this._value=e,this._valueType=vo.getPointType(e)}Object.defineProperties(fC.prototype,{value:{get:function(){return this._value}}});fC.prototype.findTimeInterval=function(e){};fC.prototype.wrapTime=function(e){return 0};fC.prototype.clampTime=function(e){return 0};fC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var QF=fC;var cBn=x(T(),1);var JOn=x(T(),1);function pC(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(pC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});pC.prototype.findTimeInterval=vo.prototype.findTimeInterval;pC.prototype.wrapTime=vo.prototype.wrapTime;pC.prototype.clampTime=vo.prototype.clampTime;pC.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 hx=pC;var qOn=x(T(),1);var gge={};gge.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 bC=gge;var yge=[],xge=[],Tge=[],_ge=[];function X$e(e,t,n){let i=yge,o=Tge,r=xge,s=_ge;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===Md.REPEAT)b=b-Math.floor(b);else if(a.loop===Md.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&&tB.push(a))}}n=tB.length;for(let s=0;sW.EPSILON3}};var cI=Rge;var D3n=x(T(),1);var P3n=x(T(),1),lI=`#ifdef DIFFUSE_IBL +vec3 sampleDiffuseEnvironment(vec3 cubeDir) +{ +#ifdef CUSTOM_SPHERICAL_HARMONICS +return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); +#else +return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); +#endif +} +#endif +#ifdef SPECULAR_IBL +vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +{ +#ifdef CUSTOM_SPECULAR_IBL +float lod = roughness * model_specularEnvironmentMapsMaximumLOD; +return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; +#else +float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; +return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; +#endif +} +vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +{ +vec3 f90 = max(vec3(1.0 - roughness), f0); +vec3 F = fresnelSchlick2(f0, f90, NdotV); +vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; +vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); +return specularSample * (F * brdfLut.x + brdfLut.y); +} +#endif +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { +vec3 f0 = material.specular; +float roughness = material.roughness; +float specularWeight = 1.0; +#ifdef USE_SPECULAR +specularWeight = material.specularWeight; +#endif +float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); +vec3 f90 = max(vec3(1.0 - roughness), f0); +vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); +vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; +vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); +#ifdef DIFFUSE_IBL +vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); +vec3 irradiance = sampleDiffuseEnvironment(normalMC); +vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; +float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); +vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); +vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; +vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; +#else +vec3 diffuseContribution = vec3(0.0); +#endif +#ifdef USE_ANISOTROPY +vec3 anisotropyDirection = material.anisotropicB; +vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); +vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); +float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); +float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; +vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); +vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); +#else +vec3 reflectEC = reflect(-viewDirectionEC, normalEC); +#endif +#ifdef SPECULAR_IBL +vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); +vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); +vec3 specularContribution = radiance * FssEss * model_iblFactor.y; +#else +vec3 specularContribution = vec3(0.0); +#endif +return diffuseContribution + specularContribution; +} +#endif +`;var Cge={name:"ImageBasedLightingPipelineStage"},J$e=new k;Cge.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,fe.FRAGMENT),r.addUniform("vec2","model_iblFactor",fe.FRAGMENT),Qh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",fe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,fe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,fe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,fe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",fe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,fe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,fe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,fe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",fe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",fe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,fe.FRAGMENT)),r.addFragmentLines(lI);let c={model_iblFactor:function(){return k.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,J$e)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=It(c,e.uniformMap)};var dI=Cge;var izn=x(T(),1);var Q3n=x(T(),1);var j$e=W.EPSILON16;function d7(e){e=e??B.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(d7.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,j$e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Q$e=new h,l7=new q;d7.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Q$e,o;switch(t){case cl.XROTATE:o=q.fromRotationX(W.toRadians(n),l7),e=P.multiplyByMatrix3(e,o,e);break;case cl.YROTATE:o=q.fromRotationY(W.toRadians(n),l7),e=P.multiplyByMatrix3(e,o,e);break;case cl.ZROTATE:o=q.fromRotationZ(W.toRadians(n),l7),e=P.multiplyByMatrix3(e,o,e);break;case cl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case cl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case cl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=P.multiplyByTranslation(e,i,e);break;case cl.XSCALE:i.x=n,i.y=1,i.z=1,e=P.multiplyByScale(e,i,e);break;case cl.YSCALE:i.x=1,i.y=n,i.z=1,e=P.multiplyByScale(e,i,e);break;case cl.ZSCALE:i.x=1,i.y=1,i.z=n,e=P.multiplyByScale(e,i,e);break;case cl.UNIFORMSCALE:e=P.multiplyByUniformScale(e,n,e);break;default:break}return e};var uI=d7;function nB(e){e=e??B.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,q$e(this)}Object.defineProperties(nB.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 q$e(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 Vge={name:"ModelClippingPlanesPipelineStage"},tet=new k,net=new P,iet=new P;Vge.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,tet);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(fI);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,net);return P.multiply(c,t._clippingPlanesMatrix,iet)}};e.uniformMap=It(a,e.uniformMap)};var pI=Vge;var Mzn=x(T(),1);var Czn=x(T(),1),bI=`void modelClippingPolygonsStage() +{ +bool insideAny = vectorClip(v_clippingUv); +#ifdef CLIPPING_INVERSE +if (!insideAny) +{ +discard; +} +#else +if (insideAny) +{ +discard; +} +#endif +} +`;var Ezn=x(T(),1),gI=`void modelClippingPolygonsStage() +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; +} +`;var Gzn=x(T(),1),Ob=`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; +} +} +return inside; +} +`;var Age={name:"ModelClippingPolygonsPipelineStage"},oet=new k,ret=new k,Ege=re.MAX_VALUE;Age.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(gI),o.addFragmentLines(Ob),o.addFragmentLines(bI);let r={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??Ege,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,oet)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??Ege;return k.fromElements(1/s.width,1/s.height,ret)},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 yI=Age;var qzn=x(T(),1);var kzn=x(T(),1),xI=`void modelVectorLookupStage(ProcessedAttributes attributes) +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; +} +`;var Dzn=x(T(),1),TI=`void modelVectorLookupStage(inout vec4 color) +{ +color = vectorPolygonRender(v_vectorUv, color); +color = vectorPolylineRender(v_vectorUv, color); +} +`;var set={name:"ModelVectorLookupPipelineStage",process:det},aet=new k,cet=new k;function det(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(xI),i.addFragmentLines(Ob),i.addFragmentLines(TI);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,aet)},u_vectorRectangleInverseSize:function(){let u=t._vectorData?.rectangle??a;return k.fromElements(1/u.width,1/u.height,cet)},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 _I=set;var tHn=x(T(),1);function Gge(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Gge.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 SI=Gge;var jHn=x(T(),1);var LHn=x(T(),1);var iHn=x(T(),1),ZI=`mat4 getInstancingTransform() +{ +mat4 instancingTransform; +#ifdef HAS_INSTANCE_MATRICES +instancingTransform = mat4( +a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, +a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, +a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, +a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 +); +#else +vec3 translation = vec3(0.0, 0.0, 0.0); +vec3 scale = vec3(1.0, 1.0, 1.0); +#ifdef HAS_INSTANCE_TRANSLATION +translation = a_instanceTranslation; +#endif +#ifdef HAS_INSTANCE_SCALE +scale = a_instanceScale; +#endif +instancingTransform = mat4( +scale.x, 0.0, 0.0, 0.0, +0.0, scale.y, 0.0, 0.0, +0.0, 0.0, scale.z, 0.0, +translation.x, translation.y, translation.z, 1.0 +); +#endif +return instancingTransform; +} +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ +mat4 instancingTransform2D; +#ifdef HAS_INSTANCE_MATRICES +instancingTransform2D = mat4( +a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, +a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, +a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, +a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 +); +#else +vec3 translation2D = vec3(0.0, 0.0, 0.0); +vec3 scale = vec3(1.0, 1.0, 1.0); +#ifdef HAS_INSTANCE_TRANSLATION +translation2D = a_instanceTranslation2D; +#endif +#ifdef HAS_INSTANCE_SCALE +scale = a_instanceScale; +#endif +instancingTransform2D = mat4( +scale.x, 0.0, 0.0, 0.0, +0.0, scale.y, 0.0, 0.0, +0.0, 0.0, scale.z, 0.0, +translation2D.x, translation2D.y, translation2D.z, 1.0 +); +#endif +return instancingTransform2D; } -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(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); -for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { -if (i >= PRIMARY_STEPS) { -break; +#endif +`;var rHn=x(T(),1),RI=`void instancingStage(inout ProcessedAttributes attributes) +{ +vec3 positionMC = attributes.positionMC; +mat4 instancingTransform = getInstancingTransform(); +attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; +#endif +#ifdef USE_2D_INSTANCING +mat4 instancingTransform2D = getInstancingTransform2D(); +attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#endif } -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 aHn=x(T(),1),CI=`void legacyInstancingStage( +inout ProcessedAttributes attributes, +out mat4 instanceModelView, +out mat3 instanceModelViewInverseTranspose) +{ +vec3 positionMC = attributes.positionMC; +mat4 instancingTransform = getInstancingTransform(); +mat4 instanceModel = instancingTransform * u_instance_nodeTransform; +instanceModelView = u_instance_modifiedModelView; +instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); +attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; +#ifdef USE_2D_INSTANCING +mat4 instancingTransform2D = getInstancingTransform2D(); +attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#endif } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +`;var iB=new P,uet=new P,met=new P,Wge={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Xge,_transformsToTypedArray:m7};Wge.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(ZI);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==se.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,m=[];Aet(e,n,i,m,d,u),Wet(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,fe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",fe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",fe.VERTEX),p.u_instance_modifiedModelView=function(){let b=P.multiplyTransformation(s.modelMatrix,a.components.transform,iB);return d?P.multiplyTransformation(n.context.uniformState.view3D,b,iB):(n.mode!==se.SCENE3D&&(b=_t.basisTo2D(n.mapProjection,b,iB)),P.multiplyTransformation(n.context.uniformState.view,b,iB))},p.u_instance_nodeTransform=function(){return P.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,uet)},r.addVertexLines(CI)):r.addVertexLines(RI),d){r.addDefine("USE_2D_INSTANCING",void 0,fe.VERTEX),r.addUniform("mat4","u_modelView2D",fe.VERTEX);let b=n.context,f=P.fromTranslation(c.instancingReferencePoint2D,new P);p.u_modelView2D=function(){return P.multiplyTransformation(b.uniformState.view,f,met)}}e.uniformMap=It(p,e.uniformMap),e.instanceCount=o,ii(e.attributes,m)};var VI=new P,het=new h;function fet(e,t,n,i,o){let r=P.multiplyTransformation(t,e,VI);return r=P.multiplyTransformation(r,n,VI),o=_t.basisTo2D(i.mapProjection,r,o),o}function pet(e,t,n,i,o){let r=P.fromTranslation(e,VI),s=P.multiplyTransformation(t,r,VI);s=P.multiplyTransformation(s,n,VI);let a=P.getTranslation(s,het);return o=fo.computeActualEllipsoidPosition(i,a,o),o}function vge(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(P.multiplyTransformation(i.modelMatrix,o.components.transform,t),P.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=P.clone(o.computedModelMatrix,t),P.multiplyTransformation(t,e.runtimeNode.computedTransform,t),P.clone(P.IDENTITY,n))}var Fge=new P,Ige=new P,bet=new P,get=new h;function yet(e,t,n,i){let o=Fge,r=Ige;vge(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d=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 EI=Wge;var XHn=x(T(),1);var Nge=[],f7={};f7.name="ModelMatrixUpdateStage";f7.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;Yge(e,t,o,e.transformToRoot,0),e._transformDirty=!1}};function vet(e,t,n){e.modelMatrix=P.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Zt.getCullFace(e.modelMatrix,e.primitiveType)}function Yge(e,t,n,i,o){let r,s=Nge[o];l(s)||(s=Nge[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 vI=Dge;var mKn=x(T(),1);var Oge={name:"ClassificationPipelineStage"};Oge.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,fe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Iet(t,o)};function Iet(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;yOet(i,t,n)):[]}function Oet(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;uzet(n,t)):[]}function zet(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=>Jet(s,r,i,o))}function Jet(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(Het))continue;let y=d[b],_=fe.intersection(dtt(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 jet(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=x7({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 g7(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Kge(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 y7(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=Kge(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 rtt(e,t,n){stt(e,t,n),g7(e.shaderBuilder,t),y7(e.shaderBuilder,t)}function stt(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=x7({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 Kge(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 x7(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 att(e,t){let n=new Set,i=new Set;return ctt(e,n,i),ltt(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function ctt(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 ltt(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 dtt(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 wm=vi;var uJn=x(T(),1),Jge={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Jge);var yx=Jge;var wa={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};wa.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===yx.TRANSLUCENT?r.pass=Le.TRANSLUCENT:c===yx.OPAQUE&&(r.pass=void 0);let d=ytt(s,t,e);if(!d.customShaderEnabled)return;if(Stt(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=Bb.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 utt(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 $ge(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return wa._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 DI=wa;var vJn=x(T(),1);var OI={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};OI.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(OI.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,OI.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; } -if (index == 5) { -return -sqrt(15.0) * s.y * s.z / twoSqrtPi; } -if (index == 6) { -return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; } -if (index == 7) { -return -sqrt(15.0) * s.x * s.z / twoSqrtPi; +`;var tye={name:"EdgeDetectionPipelineStage"};tye.process=function(e){e.shaderBuilder.addFragmentLines([zI])};var HI=tye;var Zjn=x(T(),1);var MJn=x(T(),1),KI=`#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; } -if (index == 8) { -return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; +float edgeTypeInt = v_edgeType * 255.0; +if (edgeTypeInt < 0.5) { +discard; } -return 0.0; +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +if (v_shouldDiscard > 0.5) { +discard; } -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); +vec4 finalColor = color; +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +if (v_edgeColor.a >= 0.0) { +finalColor = v_edgeColor; } -return value; +#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; } -vec2 hammersley2D(int i, int N) -{ -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +#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 } -const int samples = 256; -const float solidAngle = 1.0 / float(samples); -void main() { -vec2 uv = v_textureCoordinates.xy * 3.0; -int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); -for (int i = 0; i < samples; ++i) { -vec2 xi = hammersley2D(i, samples); -float phi = czm_twoPi * xi.x; -float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); -float Ylm = computeShBasis(coefficientIndex, direction); -vec3 lookupDirection = -direction.xyz; -lookupDirection.z = -lookupDirection.z; -vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); -out_FragColor += Ylm * color * solidAngle * sinTheta; +`;var kJn=x(T(),1),JI=`#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; } } -`;var jXn=x(T(),1),uF=`precision highp float; -in vec2 v_textureCoordinates; -uniform vec3 u_faceDirection; -uniform vec3 u_positionWC; -uniform mat4 u_enuToFixedFrame; -uniform vec4 u_brightnessSaturationGammaIntensity; -uniform vec4 u_groundColor; -vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { -vec2 scaledUV = uv * 2.0 - 1.0; -if (faceDir.x != 0.0) { -return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); -} else if (faceDir.y != 0.0) { -return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); +#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 { -return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); +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; } -void main() { -float height = length(u_positionWC); -float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; -float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); -vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); -float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; -float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; -vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; -vec3 normalizedDirection = normalize(direction); -czm_ray ray = czm_ray(positionWC, normalizedDirection); -czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); -if (!czm_isEmpty(intersection)) { -intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); +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; } -bool onEllipsoid = intersection.start >= 0.0; -float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); -vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; -float lightEnum = u_radiiAndDynamicAtmosphereColor.z; -vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); -vec3 mieColor; -vec3 rayleighColor; -float opacity; -czm_computeScattering( -ray, -rayLength, -lightDirectionWC, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); -vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); -#ifdef ATMOSPHERE_COLOR_CORRECT -const bool ignoreBlackPixels = true; -atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); #endif -vec3 lookupDirection = -normalizedDirection; -lookupDirection.x = -lookupDirection.x; -lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); -lookupDirection.x = -lookupDirection.x; -float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); -skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); -float intensity = u_brightnessSaturationGammaIntensity.w; -vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); -vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); -vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); -vec3 up = normalize(positionWC); -float occlusion = max(dot(lightDirectionWC, up), 0.05); -vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); -vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); -vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); -float brightness = u_brightnessSaturationGammaIntensity.x; -float saturation = u_brightnessSaturationGammaIntensity.y; -float gamma = u_brightnessSaturationGammaIntensity.z; -#ifdef ENVIRONMENT_COLOR_CORRECT -color.rgb = mix(vec3(0.0), color.rgb, brightness); -color.rgb = czm_saturation(color.rgb, saturation); +`;var rjn=x(T(),1);var T7=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 Gtt(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===RC.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===RC.SILHOUETTE&&(Y=b,b++),m.push({edgeType:V===RC.REPEATED_HARD?RC.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:RC.HARD,silhouetteEdgeIndex:-1,color:l(R)?R:void 0}))}}return{edgeIndices:u,edgeData:m,silhouetteEdgeCount:b}}function Ltt(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===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[(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 jI=nye;var jjn=x(T(),1);var Cjn=x(T(),1),QI=`void geometryStage(out ProcessedAttributes attributes) +{ +attributes.positionMC = v_positionMC; +attributes.positionEC = v_positionEC; +#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) +attributes.positionWC = v_positionWC; +#endif +#ifdef HAS_NORMALS +attributes.normalEC = normalize(v_normalEC); +#endif +#ifdef HAS_TANGENTS +attributes.tangentEC = normalize(v_tangentEC); +#endif +#ifdef HAS_BITANGENTS +attributes.bitangentEC = normalize(v_bitangentEC); +#endif +setDynamicVaryings(attributes); +} +`;var Ejn=x(T(),1),qI=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +{ +vec4 computedPosition; +vec3 positionMC = attributes.positionMC; +v_positionMC = positionMC; +v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; +#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) +vec3 position2D = attributes.position2D; +vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; +computedPosition = czm_projection * vec4(positionEC, 1.0); +#else +computedPosition = czm_projection * vec4(v_positionEC, 1.0); +#endif +#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) +v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; +#endif +#ifdef HAS_NORMALS +v_normalEC = normalize(normal * attributes.normalMC); +#endif +#ifdef HAS_TANGENTS +v_tangentEC = normalize(normal * attributes.tangentMC); +#endif +#ifdef HAS_BITANGENTS +v_bitangentEC = normalize(normal * attributes.bitangentMC); +#endif +setDynamicVaryings(attributes); +return computedPosition; +} +`;var Xjn=x(T(),1);var Gjn=x(T(),1),CC=`vec2 computeSt(float featureId) +{ +float stepX = model_textureStep.x; +float centerX = model_textureStep.y; +#ifdef MULTILINE_BATCH_TEXTURE +float stepY = model_textureStep.z; +float centerY = model_textureStep.w; +float xId = mod(featureId, model_textureDimensions.x); +float yId = floor(featureId / model_textureDimensions.x); +return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +#else +return vec2(centerX + (featureId * stepX), 0.5); #endif -color.rgb = pow(color.rgb, vec3(gamma)); -color.rgb = czm_gammaCorrect(color.rgb); -out_FragColor = color; } -`;var qXn=x(T(),1),mF=`precision highp float; -in vec3 v_textureCoordinates; -uniform float u_roughness; -uniform samplerCube u_radianceTexture; -uniform vec3 u_faceDirection; -float vdcRadicalInverse(int i) +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) { -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++) +int featureId = featureIds.SELECTED_FEATURE_ID; +if (featureId < model_featuresLength) { -if (i <= 0) +vec2 featureSt = computeSt(float(featureId)); +feature.id = featureId; +feature.st = featureSt; +feature.color = texture(model_batchTexture, featureSt); +} +else { -break; +feature.id = model_featuresLength + 1; +feature.st = vec2(0.0); +feature.color = vec4(1.0); } -r = mod(float(i), base); -value += r * invBi; -invBi *= invBase; -i = int(float(i) * invBase); +#ifdef HAS_NULL_FEATURE_ID +if (featureId == model_nullFeatureId) { +feature.id = featureId; +feature.st = vec2(0.0); +feature.color = vec4(1.0); } -return value; +#endif } -vec2 hammersley2D(int i, int N) +`;var $I={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};$I.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=vtt(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),Ftt(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===fe.BOTH&&i.addVertexLines(CC),i.addFragmentLines(CC)};function iye(e){return e instanceof Vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function oye(e){return e instanceof Vn.FeatureIdTexture?fe.FRAGMENT:fe.BOTH}function vtt(e,t,n){let i,o;return l(t.instances)&&(o=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:oye(o),featureIdDefine:iye(o)}):(o=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:oye(o),featureIdDefine:iye(o)})}function Ftt(e){e.addStructField($I.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField($I.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField($I.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var xx=$I;var ka={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)"};ka.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(ka.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",fe.VERTEX),i.addStruct(ka.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",fe.FRAGMENT),i.addStruct(xx.STRUCT_ID_SELECTED_FEATURE,xx.STRUCT_NAME_SELECTED_FEATURE,fe.BOTH),i.addFunction(ka.FUNCTION_ID_INITIALIZE_ATTRIBUTES,ka.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,fe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(ka.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(ka.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(ka.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,ka.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.VERTEX),i.addFunction(ka.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,ka.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.FRAGMENT),o.type===Or.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,fe.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d1?(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;Itt(e,u,b,m,r,s,f)}Dtt(i,t.attributes),t.primitiveType===Ie.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(qI),i.addFragmentLines(QI)};function Itt(e,t,n,i,o,r,s){let a=e.shaderBuilder,c=Zt.getAttributeInfo(t),d=o&&!r;i>1?Ntt(e,t,n,i):Xtt(e,t,n,d),Mtt(a,c,d),Ytt(a,c,s),l(t.semantic)&&Ptt(a,t),wtt(a,c,o),ktt(a,c,d),Utt(a,c)}function Ptt(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 Xtt(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 Ntt(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=Z7;var m4n=x(T(),1);var R7,aye="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",VC={};VC.defaultAccessToken=aye;VC.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});VC.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});VC.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});VC.getDefaultTokenCredit=function(e){if(e===aye){if(!l(R7)){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/.';R7=new Lt(t,!0)}return R7}};var vu=VC;var y4n=x(T(),1);function C7(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)}C7.prototype.isReady=function(){return this._isReady};C7.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])};V7.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=V7;var E4n=x(T(),1);function EC(){ge.throwInstantiationError()}Object.defineProperties(EC.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}});EC.prototype.getTileCredits=function(e,t,n){ge.throwInstantiationError()};EC.prototype.requestImage=function(e,t,n,i){ge.throwInstantiationError()};EC.prototype.pickFeatures=function(e,t,n,i,o){ge.throwInstantiationError()};var Ott=/\.ktx2$/i;EC.loadImage=function(e,t){let n=ve.createIfNeeded(t);return Ott.test(n.url)?Ad(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Fu=EC;var G4n=x(T(),1),cye={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(cye);var mf=cye;function lye(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}lye.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 tP({missingImageUrl:dye(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 Btt(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 Ti,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 ztt(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 Htt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Btt(i,t)}catch(i){ztt(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 dye(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 lye(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Htt(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,dye(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};oB.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var tr=oB;var sQn=x(T(),1),uye={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(uye);var AC=uye;var lQn=x(T(),1);function nP(e){}nP.prototype.isReady=function(){return!0};nP.prototype.shouldDiscardImage=function(e){return nP.EMPTY_IMAGE===e};var rB;Object.defineProperties(nP,{EMPTY_IMAGE:{get:function(){return l(rB)||(rB=new Image,rB.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),rB}}});var GC=nP;function mye(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}mye.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 jtt(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 Qtt(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 Jtt(r,t)}catch(r){jtt(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??AC.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GC),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??AC.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 mye(t);return await Qtt(s,c),c.build(a),a};var qtt=new re;Ta.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,qtt);return tnt(this._attributionList,n,i)};Ta.prototype.requestImage=function(e,t,n,i){let o=Fu.loadImage(this,$tt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?GC.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,ent);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ta._metadataCache={};var iP=Ta;var n8n=x(T(),1);var kQn=x(T(),1);var hye=/{[^}]+}/g,fye={x:rnt,y:ant,z:dnt,s:unt,reverseX:snt,reverseY:cnt,reverseZ:lnt,westDegrees:mnt,southDegrees:hnt,eastDegrees:fnt,northDegrees:pnt,westProjected:bnt,southProjected:gnt,eastProjected:ynt,northProjected:xnt,width:Tnt,height:_nt},nnt=It(fye,{i:Snt,j:Znt,reverseI:Rnt,reverseJ:Cnt,longitudeDegrees:Ent,latitudeDegrees:Ant,longitudeProjected:Gnt,latitudeProjected:Lnt,format:vnt});function oP(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(fye,r),a=It(nnt,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(oP.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}}});oP.prototype.getTileCredits=function(e,t,n){};oP.prototype.requestImage=function(e,t,n,i){return Fu.loadImage(this,int(this,e,t,n,i))};oP.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=ont(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 sB=!1,Iu=new re,aB=!1,rP=new re;function int(e,t,n,i,o){sB=!1,aB=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(hye);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 E7=!1,WC=new k,A7=!1;function ont(e,t,n,i,o,r,s){sB=!1,aB=!1,E7=!1,A7=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(hye);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 vC(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 rnt(e,t,n,i){return vC(e,"{x}",t)}function snt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return vC(e,"{reverseX}",o)}function ant(e,t,n,i){return vC(e,"{y}",n)}function cnt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return vC(e,"{reverseY}",o)}function lnt(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 bye(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}km._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(Ud.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}}});Ud.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 gye(n);s.channel=t,await Pnt(r,s);let a=new Ud(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Ud.prototype.getTileCredits=function(e,t,n){};Ud.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)};Ud.prototype.pickFeatures=function(e,t,n,i,o){};Ud._logoUrl=void 0;Object.defineProperties(Ud,{logoUrl:{get:function(){return l(Ud._logoUrl)||(Ud._logoUrl=en("Assets/Images/google_earth_credit.png")),Ud._logoUrl},set:function(e){Ud._logoUrl=e}}});var sP=Ud;var S8n=x(T(),1);var Xnt=/\/$/,yye=new Lt('© Mapbox © OpenStreetMap Improve this map');function FC(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();Xnt.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=yye,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(FC.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}}});FC.prototype.getTileCredits=function(e,t,n){};FC.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};FC.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};FC._defaultCredit=yye;var aP=FC;var I8n=x(T(),1);function uS(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(uS.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 Nnt(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 L7(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function L7(e,t,n){try{return await Fu.loadImage(null,e)}catch(i){return Nnt(e,i,t,n)}}uS.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await L7(n);t=t??B.EMPTY_OBJECT;let o=new uS({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};uS.prototype.getTileCredits=function(e,t,n){};uS.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await L7(this._resource,this);return this._image=o,tr.reportSuccess(this._errorEvent),o}return this._image};uS.prototype.pickFeatures=function(e,t,n,i,o){};var cP=uS;var o6n=x(T(),1);var w8n=x(T(),1);function Ynt(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=Mnt:e==="xml"?n=Dnt:(e==="html"||e==="text")&&(n=xye)),this.callback=n}function Mnt(e){let t=[],n=e.features;for(let i=0;i0)for(let r=0;r\s*<\/body>/im,jnt=//im,Qnt=/([\s\S]*)<\/title>/im;function xye(e){if(Jnt.test(e)||jnt.test(e))return;let t,n=Qnt.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=Ynt;var H8n=x(T(),1);function lP(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(lP.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)}}});lP.prototype.getFromCache=function(e,t,n,i){let o=Tye(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};lP.prototype.checkApproachingInterval=function(e,t,n,i){let o=Tye(e,t,n),r=this._tilesRequestedForInterval,s=_ye(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!Sye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};lP.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=_ye(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Sye(this,c,r),a||s.push(c)}}};function Tye(e,t,n){return`${e}-${t}-${n}`}function qnt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function _ye(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 Sye(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=qnt(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 mS=lP;var $nt=[3034,3035,3042,3043,3044],eit=[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(Zye(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Zye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new mS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return Rye(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 Ti?"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&&!eit.includes(a)||$nt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"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 Rye(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 tit(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=Rye(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 tit(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 Zye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var dP=ff;var p6n=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(Cye(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(Cye(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 mS({clock:e.clock,times:e.times,requestImageFunction:function(u,m,p,b,f){return Vye(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:iit(this)})}function Vye(e,t,n,i,o,r){let s=e._tileProvider;return Eye(e,s._resource,r),s.requestImage(t,n,i,o)}function nit(e,t,n,i,o,r,s){let a=e._tileProvider;return Eye(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=Vye(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 nit(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 Eye(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 iit(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 Cye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var uP=Pu;var G6n=x(T(),1);var x6n=x(T(),1);var IC={};IC.defaultApiKey=void 0;IC.mapTilesApiEndpoint=new ve({url:"https://tile.googleapis.com/"});IC.defaultStreetViewStaticApiKey=void 0;IC.streetViewStaticApiEndpoint=new ve({url:"https://maps.googleapis.com/maps/api/streetview"});IC.getDefaultCredit=function(){return new Lt('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var _a=IC;var Aye=/\/$/;function Hb(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();Aye.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(Hb.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}}});Hb.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=Gye(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},F7(s,r,i)};Hb.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 rit(e);return new Hb({...n,...e,credit:e.credit??_a.getDefaultCredit()})};Hb.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};Hb.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])};Hb.prototype.pickFeatures=function(e,t,n,i,o){};Hb.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(oit(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 oit(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 Gye(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 rit(e){let{language:t,region:n,key:i,url:o}=e,r=Gye(e),s=o.url??o;Aye.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 mP=Hb;var N6n=x(T(),1);var sit=/\/$/;function PC(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();sit.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(PC.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}}});PC.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};PC.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])};PC.prototype.pickFeatures=function(e,t,n,i,o){};PC.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(ait(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 ait(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 hP=PC;var cit=async(e,t,n)=>Tx.fromUrl(new Ur(t,n)),lit=async(e,{options:t})=>zb.fromUrl(e,t),dit=async(e,{options:t})=>iP.fromUrl(e,t),uit=async(e,{options:t})=>{let n=t.channel;return delete t.channel,sP.fromUrl(e,n,t)},mit=async(e,{options:t})=>new aP({url:e,...t}),hit=async(e,{options:t})=>cP.fromUrl(e,t),fit=async(e,{options:t})=>Tx.fromUrl(e,t),pit=async(e,{options:t})=>new Ss({url:e,...t}),bit=async(e,{options:t})=>new dP({url:e,...t}),git=async(e,{options:t})=>new uP({url:e,...t}),F7=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 mP({...t.options,url:i})},yit=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 hP({...t.options,url:i})},xit={ARCGIS_MAPSERVER:lit,BING:dit,GOOGLE_EARTH:uit,MAPBOX:mit,SINGLE_TILE:hit,TMS:fit,URL_TEMPLATE:pit,WMS:bit,WMTS:git,GOOGLE_2D_MAPS:F7,AZURE_MAPS:yit,defaultFactoryCallback:cit},XC=Object.freeze(xit);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=XC.defaultFactoryCallback;r=$e(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=XC[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 ed=Bp;var c7n=x(T(),1),Lye={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(Lye);var Kb=Lye;function Tit(e){e=e??B.EMPTY_OBJECT;let t=e.style??Kb.AERIAL;return ed.fromAssetId(t)}var Jb=Tit;var x7n=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 Wye=[];Ds.getRegularGridIndices=function(e,t){let n=Wye[e];l(n)||(Wye[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),Pye(e,t,i,0)),i};var vye=[];Ds.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=vye[e];l(n)||(vye[e]=n=[]);let i=n[t];if(!l(i)){let o=Ds.getRegularGridIndices(e,t),r=Iye(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 Fye=[];Ds.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Fye[e];l(n)||(Fye[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=Iye(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,b=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,y=Oe.createTypedArray(c,d);Pye(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=mB(e,a,r,s),a+=e.length,s=mB(t,a,r,s),a+=t.length,s=mB(n,a,r,s),a+=n.length,mB(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 Iye(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 Pye(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 mB(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 _7n=x(T(),1),fP=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() { -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +out_FragColor = texture(u_texture, v_textureCoordinates); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +`;var Z7n=x(T(),1),pP=`in vec4 position; +in float webMercatorT; +uniform vec2 u_textureDimensions; +out vec2 v_textureCoordinates; +void main() { -float alphaRoughnessSquared = alphaRoughness * alphaRoughness; -float phi = czm_twoPi * xi.x; -float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); -vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); -vec3 tangentX = normalize(cross(upVector, N)); -vec3 tangentY = cross(N, tangentX); -return tangentX * H.x + tangentY * H.y + N * H.z; +v_textureCoordinates = vec2(position.x, webMercatorT); +gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); } -const int samples = 128; -void main() { -vec3 normal = u_faceDirection; -vec3 V = normalize(v_textureCoordinates); -float roughness = u_roughness; -vec4 color = vec4(0.0); -float weight = 0.0; -for (int i = 0; i < samples; ++i) { -vec2 xi = hammersley2D(i, samples); -vec3 H = importanceSampleGGX(xi, roughness, V); -vec3 L = 2.0 * dot(V, H) * H - V; -float NdotL = max(dot(V, L), 0.0); -if (NdotL > 0.0) { -color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; -weight += NdotL; +`;var L7n=x(T(),1);var C7n=x(T(),1),Xye={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(Xye);var Dn=Xye;function NC(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}NC.createPlaceholder=function(e){let t=new NC(e,0,0,0);return t.addReference(),t.state=Dn.PLACEHOLDER,t};NC.prototype.addReference=function(){++this.referenceCount};NC.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};NC.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 YC=NC;var I7n=x(T(),1);function I7(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}I7.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};I7.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 MC=I7;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 MC(YC.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=wr.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 Cit(n,Promise.resolve(e)),n};zi.fromWorldImagery=function(e){return e=e??B.EMPTY_OBJECT,zi.fromProviderAsync(Jb({style:e.style}),e)};zi.prototype.isBaseLayer=function(){return this._isBaseLayer};zi.prototype.isDestroyed=function(){return!1};zi.prototype.destroy=function(){return ue(this)};var Mye=new re,Nye=new re,P7=new re,wye=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 Ti&&e.rectangle.north<Ti.MaximumLatitude&&e.rectangle.south>-Ti.MaximumLatitude,s=re.intersection(o.rectangle,this._rectangle,Mye),a=re.intersection(e.rectangle,s,Nye);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,v=e.rectangle;a=Nye,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=Zit(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,wye),E=b.tileXYToRectangle(f.x,f.y,m),A=re.intersection(E,s,P7),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,P7),!!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,P7),!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 MC(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,Mye),i=c.rectangleToNativeRectangle(i,wye)}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 Ti?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Dn.TEXTURE_LOADED};function Yye(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=Yye(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(Cm.NICEST),t.sampler=d}else{let r=Yye(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){Sit(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=kye(e,t,n),r=this._imageryCache[o];return l(r)||(r=new YC(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};zi.prototype.removeImageryFromCache=function(e){let t=kye(e.x,e.y,e.level);delete this._imageryCache[t]};function kye(e,t,n){return JSON.stringify([e,t,n])}var hB={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},_it=fn.supportsTypedArrays()?new Float32Array(128):void 0;function Sit(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:[pP]});o.shaderProgram=nn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:fP,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;hB.textureDimensions.x=r,hB.textureDimensions.y=s,hB.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(Cm.NICEST);let p=i.south,b=i.north,f=_it,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=hB,e.vertexArray=o.vertexArray}function Zit(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 Rit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Cit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Rit(e._errorEvent,i)}}var Zs=zi;var Sqn=x(T(),1),X7=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},bP=X7;var i$n=x(T(),1);var Gqn=x(T(),1);var Rqn=x(T(),1),N7=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}},wC=N7;var Vit=new re,Uye=new re,Eit=new re,Ait=new re,Git=new re,Lit=new re,Y7=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,Vit),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),d=Ait;a.rectangleToNativeRectangle(t,d);let u=Git;a.rectangleToNativeRectangle(s,u);let m=(b,f,y)=>{let _=a.tileXYToRectangle(b,f,y),S=re.intersection(_,s,Eit);if(!l(S))return;let Z=Lit;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 wC;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,Uye);return l(i)?i:e._clampRectangle(t,n,Uye)}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 wC);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}},kC=Y7;var Uqn=x(T(),1);var M7=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}}},hS=M7;var Oqn=x(T(),1);var w7=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}},gP=w7;var k7=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=hS.createCartographicPositions(o,s,m),b=hS.computeCartographicBoundingRectangle(p),f=new gP(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=hS.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 kC.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 kC._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(),ue(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}},fS=k7;var r$n=x(T(),1),U7=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},yP=U7;var Wit=!1,vit=new re,Fit=new re,D7=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=fS._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 bP;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));"]),Wit&&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 yP(t,s,a,d,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,vit),s=o.rectangleToNativeRectangle(i,Fit);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}},xP=D7;var A$n=x(T(),1);var T$n=x(T(),1),TP=`#ifdef USE_IBL_LIGHTING +vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 viewDirection = -normalize(position); +vec3 iblColor = textureIBL(viewDirection, normal, material); +return iblColor; +#endif +return vec3(0.0); } +#endif +#ifdef USE_CLEARCOAT +vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ +vec3 viewDirection = -normalize(position); +vec3 halfwayDirection = normalize(viewDirection + lightDirection); +vec3 normal = material.clearcoatNormal; +float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); +vec3 f0 = vec3(0.04); +vec3 f90 = vec3(1.0); +float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); +vec3 F = fresnelSchlick2(f0, f90, NdotV); +float roughness = material.clearcoatRoughness; +float alphaRoughness = roughness * roughness; +float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); +vec3 directReflection = F * directStrength * NdotL; +vec3 color = lightColorHdr * directReflection; +#ifdef SPECULAR_IBL +vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); +vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); +color += iblColor * material.occlusion; +#endif +float clearcoatFactor = material.clearcoatFactor; +vec3 clearcoatColor = color * clearcoatFactor; +return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; } -out_FragColor = color / weight; +#endif +#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) +vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +{ +#ifdef USE_CUSTOM_LIGHT_COLOR +vec3 lightColorHdr = model_lightColorHdr; +#else +vec3 lightColorHdr = czm_lightColorHdr; +#endif +vec3 viewDirection = -normalize(position); +vec3 normal = material.normalEC; +vec3 lightDirection = normalize(czm_lightDirectionEC); +vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); +vec3 directColor = lightColorHdr * directLighting; +vec3 color = directColor + material.emissive; +#ifdef USE_IBL_LIGHTING +color += computeIBL(position, normal, lightDirection, lightColorHdr, material); +#endif +#ifdef USE_CLEARCOAT +color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); +#endif +return color; } -`;var eNn=x(T(),1),hF=`in vec3 position; -out vec3 v_textureCoordinates; -uniform vec3 u_faceDirection; -vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { -vec2 scaledUV = uv; -if (faceDir.x != 0.0) { -return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); -} else if (faceDir.y != 0.0) { -return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); -} else { -return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); +#endif +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ +#ifdef LIGHTING_PBR +#ifdef HAS_NORMALS +vec3 color = computePbrLighting(material, attributes.positionEC); +#else +vec3 color = material.diffuse * material.occlusion + material.emissive; +#endif +#ifndef HDR +color = czm_pbrNeutralTonemapping(color); +#endif +#else // unlit +vec3 color = material.diffuse; +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +color = czm_gammaCorrect(color); +#elif !defined(HDR) +color = czm_linearToSrgb(color); +#endif +material.diffuse = color; } +`;var S$n=x(T(),1),Dye={UNLIT:0,PBR:1};Object.freeze(Dye);var zp=Dye;var Oye={name:"LightingPipelineStage"};Oye.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(TP)};var _P=Oye;var $$n=x(T(),1);var L$n=x(T(),1),SP=`bool isDefaultStyleColor(vec3 color) +{ +return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } -void main() +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) { -v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); -v_textureCoordinates.y = -v_textureCoordinates.y; -v_textureCoordinates.z = -v_textureCoordinates.z; -gl_Position = vec4(position, 1.0); +vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); +vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; +return color; } -`;function Vi(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??B.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(wt.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=Vi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new k(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??Vi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Vi.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}}});Vi._maximumComputeCommandCount=8;Vi._activeComputeCommandCount=0;Vi._nextFrameCommandQueue=[];Vi._queueCommand=(e,t)=>{if(Vi._activeComputeCommandCount>=Vi._maximumComputeCommandCount){Vi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Vi._activeComputeCommandCount++};Vi._updateCommandQueue=e=>{if(Vi._maximumComputeCommandCount=Math.log2(wt.maximumCubeMapSize),Vi._nextFrameCommandQueue.length>0&&Vi._activeComputeCommandCount<Vi._maximumComputeCommandCount){let t=Vi._nextFrameCommandQueue.shift();for(;l(t)&&Vi._activeComputeCommandCount<Vi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Vi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Vi._activeComputeCommandCount++,t=Vi._nextFrameCommandQueue.shift()}l(t)&&Vi._nextFrameCommandQueue.push(t)}};Vi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Vi.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 i7e=new h,o7e=new h;function r7e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,o7e),s=1.025,a=i7e,c=l(r)?h.magnitude(r):o.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 tge=new h,s7e=new P,a7e=new ce,c7e=new U;function l7e(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:Ue.UNSIGNED_BYTE,pixelFormat:Qe.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new Je({sources:[nf,uF]}),e._radianceMapFS=o),a_.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=_t.eastNorthUpToFixedFrame(r,a,s7e),d=a7e;d.x=e.brightness,d.y=e.saturation,d.z=e.gamma,d.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let u=0;for(let m of ns.faceNames()){let p=e._radianceMapTextures[u];l(p)&&!p.isDestroyed()&&p.destroy(),p=new vt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:Qe.RGBA}),e._radianceMapTextures[u]=p;let b=u,f=new vu({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ns.getDirection(m,tge),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,c7e)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){Vi._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[b]=void 0;let _=new hs({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 d7e(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 Ot({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;p<i;++p){for(let b of ns.faceNames()){l(e._specularMapTextures[m])&&e._specularMapTextures[m].destroy();let f=e._specularMapTextures[m]=new vt({context:a,width:r,height:s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:Qe.RGBA}),y=e._va;l(y)||(y=ns.createVertexArray(a,b),e._va=y);let _=e._convolveSP;l(_)||(_=tn.fromCache({context:a,vertexShaderSource:hF,fragmentShaderSource:mF,attributeLocations:{positions:0}}),e._convolveSP=_);let S=new vu({shaderProgram:_,vertexArray:y,outputTexture:f,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ns.getDirection(b,tge)}});S.postExecute=u(S,m,f,b,p),e._convolutionComputeCommands[m]=S,Vi._queueCommand(S,t),++m}r/=2,s/=2}d()}var nge=new k(3,3);function u7e(e,t){let n=t.context,i=nge,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:[dF]}),e._irradianceMapFS=r);let s=new vu({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 m7e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new hs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=nge,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=r7e(this,e)||i===ob.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&&(l7e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(d7e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(u7e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){m7e(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;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)};Vi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Vi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(U.fromCssColorString("#717145"));Vi.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 Wb=Vi;var INn=x(T(),1);var mC={HIGHLIGHT:0,REPLACE:1,MIX:2};mC.getColorBlend=function(e,t){if(e===mC.HIGHLIGHT)return 0;if(e===mC.REPLACE)return 1;if(e===mC.MIX)return W.clamp(t,W.EPSILON4,1)};Object.freeze(mC);var dl=mC;var XNn=x(T(),1),ige={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(ige);var km=ige;var m9n=x(T(),1);var YNn=x(T(),1),oge={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(oge);var ul=oge;var wNn=x(T(),1),rge={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(rge);var of=rge;var aMn=x(T(),1);var DYn=x(T(),1);var qNn=x(T(),1);var BNn=x(T(),1);var sge={};function fF(e){this._count=e.count,this._properties=$e(e.properties,!0)}fF.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,sge)};fF.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,sge,e)};fF.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return $e(n[e],!0)};fF.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=$e(n,!0)};var vb=fF;function Ic(e){e=e??B.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(Ic.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}}});Ic.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))};Ic.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Ic.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))};Ic.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var R7=[];Ic.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(R7);ti(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,R7);ti(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(R7);ti(t,n)}return t};Ic.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};Ic.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 vb({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Ic.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Ic.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Ic.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Ic.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Ic.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Ic.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Ic.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Ic.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var Jl=Ic;var cYn=x(T(),1);var iYn=x(T(),1);function age(e){e=e??B.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Yd.createModelTextureReader({textureInfo:r,channels:h7e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,d=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(age.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 h7e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var pF=age;function C7(e){e=e??B.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new pF({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(C7.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}}});C7.prototype.getProperty=function(e){return this._properties[e]};var Fb=C7;var gYn=x(T(),1);var mYn=x(T(),1);function cge(e){e=e??B.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=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(cge.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 bF=cge;function V7(e){e=e??B.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new bF({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(V7.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}}});V7.prototype.getProperty=function(e){return this._properties[e]};var z_=V7;var SYn=x(T(),1);function hC(e){e=e??B.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(hC.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}}});hC.prototype.getPropertyTable=function(e){return this._propertyTables[e]};hC.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};hC.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};hC.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 Ua=hC;function f7e(e){e=e??B.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],d=p7e(a,e.bufferViews,c,e.context),u=new Fm({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Jl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions,texture:d}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new Fb({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new z_({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ua({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var gF=4;function p7e(e,t,n,i){let o=e.properties;if(!l(o))return;let r=e.count,s;try{s=b7e(o,t,n,r)}catch(u){console.warn(`Failed to create texture for property table "${e.name}": ${u.message}`);return}let a=s.length;if(a===0)return;if(r>wt.maximumTextureSize||a>wt.maximumTextureSize){xt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${wt.maximumTextureSize}.`);return}let c=y7e(s,r),d=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:qn.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 b7e(e,t,n,i){let o=[],r=n.properties;for(let[s,a]of Object.entries(r)){if(!a.isGpuCompatible(gF))continue;let c=e[s],d=l(c)?t[c.values]:g7e(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 g7e(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<t;u++)for(let m=0;m<o;m++)for(let p=0;p<i;p++){let b=m*i+p;d.set(r*u+b*s,n[m][p])}return new Uint8Array(a)}function y7e(e,t){let n=e.length,i=new Uint8Array(n*t*gF),o=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let r=0;r<n;r++){let s=e[r],a=s.classProperty,c=r*t*gF,d=a.valueType,u=Nt.gpuComponentType(d);if(d!==u){T7e(s,o,c);continue}x7e(s,i,c)}return i}function x7e(e,t,n){let i=e.view,o=e.classProperty.cpuBytesPerElement(),r=i.length/o;for(let s=0;s<r;s++){let a=s*o,c=n+s*gF;t.set(i.subarray(a,a+o),c)}}function T7e(e,t,n){let i=e.classProperty,o=e.view,r=i.valueType,s=Nt.gpuComponentType(r),a=i.cpuBytesPerElement(),c=o.length/a,d=new DataView(o.buffer,o.byteOffset,o.byteLength),u=Nt.getDataViewAccessors(d,r),m=Nt.getDataViewAccessors(t,s),p=Nt.downcastFunction(r);for(let b=0;b<c;b++){let f=b*a,y=n+b*gF,_=u.get(f);m.set(y,p(_))}}var yF=f7e;var qYn=x(T(),1);function _7e(e){e=e??B.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],d=n.classes[c.class],u=new Fm({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new Jl({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new Fb({id:a,propertyTexture:S7e(c),class:n.classes[c.class],textures:e.textures}))}return new Ua({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function S7e(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:Z7e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=It(o.texture,r,!0)}return t}function Z7e(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 xF=_7e;var E7=class extends to{constructor(t){super(),t=t??B.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:o,gltfResource:r,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:d,asynchronous:u=!0}=t;this._gltfResource=r,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=o,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=d,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=R7e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED)return!1;let n=this._textureLoaders,i=n.length,o=!0;for(let c=0;c<i;++c){let u=n[c].process(t);o=o&&u}if(!o)return!1;let r=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let d=this._bufferViewIds[c],u=this._bufferViewLoaders[c];if(!u.isDestroyed()){let m=new Uint8Array(u.typedArray);s[d]=m}}let a={};for(let c=0;c<this._textureIds.length;++c){let d=this._textureIds[c],u=n[c];u.isDestroyed()||(a[d]=u.texture)}return l(this._extension)?this._structuralMetadata=yF({extension:this._extension,schema:r,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=xF({extension:this._extensionLegacy,schema:r,bufferViews:s,textures:a}),lge(this),this._state=Rt.READY,!0}unload(){lge(this),X7e(this),l(this._schemaLoader)&&Yi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function R7e(e){try{let t=G7e(e),n=I7e(e),i=P7e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Rt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load structural metadata",t)}}function C7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function V7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function E7e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];C7e(o.properties,n)}return n}function A7e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&V7e(r,n)}}return n}async function G7e(e){let t;l(e._extension)?t=E7e(e._extension):t=A7e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Yi.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 L7e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&W7e(r,t)}return t}function W7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function v7e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&F7e(r,t)}}return t}function F7e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function I7e(e){let t;l(e._extension)?t=L7e(e._extension):t=v7e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Yi.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),c.push(u.load())}return Promise.all(c)}async function P7e(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Yi.getSchemaLoader({resource:i})}else n=Yi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function lge(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Yi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function X7e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Yi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var TF=E7;var lMn=x(T(),1);var H_={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};H_.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return H_.TRANSLATION;case"ROTATION":return H_.ROTATION;case"SCALE":return H_.SCALE;case"_FEATURE_ID":return H_.FEATURE_ID}};Object.freeze(H_);var Xr=H_;var LMn=x(T(),1);var TMn=x(T(),1);var N7e=65534,Y7e=255;function lB(e){e=e??B.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new mge(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],M7e(this)}Object.defineProperties(lB.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function M7e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],d=t[a+1],u=t[a+2],m=!1,p=m||n.hasEdge(c,d),b=m||n.hasEdge(d,u),f=m||n.hasEdge(u,c),y=dge(i,c,d,u,p,b,f);for(;l(y);){let _=s[y];if(!l(_)){_=r+o.length;let S=y;for(;S>=r;)S=o[S-r];o.push(S),s[y]=_}_>N7e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>Y7e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=_,t[a]=_):y===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),y=dge(i,c,d,u,p,b,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function dge(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=A7(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,b=r?1:0,f=A7(e,n,m,p,b);if(f===0)return n;let y=s?1:0,_=0,S=r?1:0,Z=A7(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=G7(u),g=G7(f),V=G7(Z);return N<g&&N<V?t:g<V?n:i}let L=t*3;e[L+C]=a,e[L+E]=c,e[L+A]=d;let F=n*3;e[F+C]=m,e[F+E]=p,e[F+A]=b;let I=i*3;e[I+C]=y,e[I+E]=_,e[I+A]=S}function A7(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function G7(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}lB.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[c+u]}return s};lB.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,wt.maximumTextureSize),i=n,o=uge(i),r=[];for(;i>1;)i>>=1,r.push(uge(i));let s=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:Qe.LUMINANCE,sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR_MIPMAP_LINEAR,magnificationFilter:qn.LINEAR})});return t.outlineTexture=s,s};function uge(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 mge(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)}}mge.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 K_=lB;function hge(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function w7e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function dB(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}dB.prototype.postProcess=function(e){this.needsOutlines&&(k7e(this),O7e(this,e)),this.needsGaussianSplats&&D7e(this,e)};function k7e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new K_({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Oe.fromTypedArray(n.typedArray);let r=U7e(o.outlineCoordinates),s=new hge(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let d=0;d<c;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function U7e(e){let t=new Rn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=J.FLOAT,t.type=Dt.VEC3,t.normalized=!1,t.count=e.length/3,t}function D7e(e,t){let n=e.attributePlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.loadBuffer=!1,r.loadTypedArray=!0}}function O7e(e,t){B7e(e.attributePlans,t),l(e.indicesPlan)&&z7e(e.indicesPlan,t)}function B7e(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=it.createVertexBuffer({typedArray:s,context:t,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function z7e(e,t){let n=e.indices;if(e.loadBuffer){let i=it.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Pe.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}dB.AttributeLoadPlan=hge;dB.IndicesLoadPlan=w7e;var J_=dB;var FMn=x(T(),1);function H7e(e){e=e??B.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var _F=H7e;var nwn=x(T(),1);var PMn=x(T(),1);function fge(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(fge.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var SF=fge;var NMn=x(T(),1);function pge(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(pge.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var ZF=pge;var MMn=x(T(),1);function bge(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(bge.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var RF=bge;var DMn=x(T(),1);var kMn=x(T(),1),gge={Direct:"Direct",Indirect:"Indirect"};Object.freeze(gge);var dx=gge;function yge(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(yge.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 fC=yge;var BMn=x(T(),1);function xge(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(xge.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 CF=xge;function pC(){}function Tge(e){return new q(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function K7e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new SF({position:t,adjustmentParams:n})}function J7e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Tge(e.covarianceMatrix);return new ZF({position:t,adjustmentParams:n,covarianceMatrix:i})}function j7e(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let s=new CF({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new RF({groupFlags:t,rotationThetas:n,params:i})}pC.load=function(e){let t=e.storageType;if(t===dx.Direct)return pC.loadDirect(e);if(t===dx.Indirect)return pC.loadIndirect(e);throw new ae(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};pC.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=K7e(r);t.push(s)}let i=Tge(e.covarianceDirectUpperTriangle);return new fC({storageType:dx.Direct,anchorPointsDirect:t,covarianceDirect:i})};pC.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=J7e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=j7e(s);o.push(a)}return new fC({storageType:dx.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var VF=pC;var _wn=x(T(),1);var own=x(T(),1);function _ge(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(_ge.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 EF=_ge;var swn=x(T(),1);function Sge(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Sge.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var AF=Sge;var cwn=x(T(),1);function Zge(e){this._ppeTextures=e}Object.defineProperties(Zge.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var GF=Zge;function is(e){e=e??B.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Rt.UNLOADED,this._promise=void 0}l(Object.create)&&(is.prototype=Object.create(to.prototype),is.prototype.constructor=is);Object.defineProperties(is.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});is.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Rt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Rt.FAILED,this.getError("Failed to load GPM data",e)}};is.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=this._loadResources(this),this._promise)};function Q7e(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}is.prototype._loadTextures=function(){let e;l(this._extension)&&(e=Q7e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let d=Yi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(d),this._textureIds.push(c),a.push(d.load())}return Promise.all(a)};is.ppeTexturesMetadataSchemaCache=new Map;is._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}}}};is._obtainPpeTexturesMetadataSchema=function(e){let n=is._collectPpeTexturePropertyIdentifiers(e).toString(),i=is.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${is.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],d=`ppeTexture_${a}`,u=is._createPpeTextureClassJson(c,a);r.classes[d]=u}return i=zl.fromJson(r),is.ppeTexturesMetadataSchemaCache.set(n,i),i};is._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=is._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};is._convertToStructuralMetadata=function(e,t){let n=[],i=is._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,u=a.traits.source,m=i.classes[c],p={class:c,properties:{[u]:{index:a.index,texCoord:a.texCoord}}};n.push(new Fb({id:s,name:a.name,propertyTexture:p,class:m,textures:t}))}return new Ua({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};is.prototype.process=function(e){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let d=0;d<n;++d){let m=t[d].process(e);i=i&&m}if(!i)return!1;let o={};for(let d=0;d<this._textureIds.length;++d){let u=this._textureIds[d],m=t[d];m.isDestroyed()||(o[u]=m.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let d=s.ppeTextures;for(let u of d){let m=u.traits,p=new AF({min:m.min,max:m.max,source:m.source}),b=new EF({traits:p,noData:u.noData,offset:u.offset,scale:u.scale,index:u.index,texCoord:u.texCoord});r.push(b)}}let a=new GF(r);this._meshPrimitiveGpmLocal=a;let c=is._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=Rt.READY,!0};is.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Yi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};is.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var LF=is;var Ewn=x(T(),1);function q7e(e){let n=(e.extensions??B.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let o=[];ti(o,i);for(let r of n.primitiveGroups){let s=r.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:r.indices};switch(a.mode){case ie.TRIANGLE_FAN:case ie.TRIANGLE_STRIP:case ie.LINE_STRIP:case ie.LINE_LOOP:break;default:return i}for(let c of r.primitives){let d=o[c];if(!l(d?.indices)||d.mode!==a.mode)return i;o[c]=void 0}o[s]=a}return o.filter(l)}var WF=q7e;var{Attribute:$7e,Indices:eqe,FeatureIdAttribute:Cge,FeatureIdTexture:Vge,FeatureIdImplicitRange:Ege,MorphTarget:tqe,Primitive:nqe,Instances:iqe,Skin:oqe,Node:rqe,AnimatedPropertyType:sqe,AnimationSampler:aqe,AnimationTarget:cqe,AnimationChannel:lqe,Animation:dqe,ArticulationStage:uqe,Articulation:mqe,Asset:hqe,Scene:fqe,Components:pqe,MetallicRoughness:bqe,SpecularGlossiness:gqe,Specular:yqe,Anisotropy:L7,Clearcoat:W7,PlanarFill:xqe,LineStyle:Tqe,Material:_qe,Vector:Sqe,Polygon:Zqe}=Rn,ar={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},v7=class extends to{constructor(t){super(),t=t??B.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:o=!1,asynchronous:r=!0,incrementallyLoadTextures:s=!0,upAxis:a=Di.Y,forwardAxis:c=Di.Z,loadAttributesAsTypedArray:d=!1,loadAttributesFor2D:u=!1,enablePick:m=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:b=!0,loadForClassification:f=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:_=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=_,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=u,this._enablePick=m,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=b,this._loadForClassification=f,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=ar.NOT_LOADED,this._textureState=ar.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=Rqe(this),this._promise)}_process(t){return this._state===ar.READY?!0:(this._state===ar.PROCESSING&&Vqe(this,t),this._resourcesLoaded&&this._state===ar.POST_PROCESSING&&(Eqe(this,t.context),this._state=ar.PROCESSED),this._resourcesLoaded&&this._state===ar.PROCESSED?(Rge(this),this._typedArray=void 0,this._state=ar.READY,!0):!1)}_processTextures(t){if(this._textureState===ar.READY)return!0;if(this._textureState!==ar.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let o=0;o<i.length;++o){let r=i[o].process(t);r&&l(this._textureCallbacks[o])&&(this._textureCallbacks[o](),this._textureCallbacks[o]=void 0),n=n&&r}return n?(this._textureState=ar.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===ar.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Cqe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=ar.FAILED;let r=this._processError;this._processError=void 0,uB(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===ar.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=ar.FAILED,uB(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=ar.FAILED,uB(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===ar.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Yi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,M$e(this),Rge(this),w$e(this),k$e(this),U$e(this),D$e(this),this._components=void 0,this._typedArray=void 0,this._state=ar.UNLOADED}};async function Rqe(e){e._state=ar.LOADING,e._textureState=ar.LOADING;try{let t=Yi.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=ar.LOADED,e._textureState=ar.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=ar.FAILED,e._textureState=ar.FAILED,uB(e,t)}}async function Cqe(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new _F({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=Y$e(e,t);return e._state=ar.PROCESSING,e._textureState=ar.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Yi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function uB(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function Vqe(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&xt("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=ar.POST_PROCESSING)}function Eqe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),(o.needsOutlines||o.needsGaussianSplats)&&Aqe(e,o)}}function Aqe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function Gqe(e,t,n,i,o,r,s,a,c){let d=e.gltfJson,m=d.accessors[t].bufferView;return Yi.getVertexBufferLoader({gltf:d,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:m,primitive:i,draco:o,spz:r,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function Lqe(e,t,n,i,o,r,s){return Yi.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 Age(e,t){let n=Yi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function F7(e,t,n){let i=t.byteOffset,o=Nd(e,t),r=t.count,s=Wu(t.type),a=t.componentType,c=J.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),J.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let m=J.createTypedArray(a,u),p=new DataView(n.buffer),b=new Array(s),f=Gb(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){f(p,i,s,c,b);for(let _=0;_<s;++_)m[y*s+_]=b[_];i+=o}return m}function Wqe(e,t){let n=e.type;if(n===Dt.SCALAR)return t.fill(0);let i=Dt.getMathType(n);return t.fill(i.clone(i.ZERO))}function vqe(e,t,n,i){let o=e.type,r=e.count;if(o===Dt.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===Dt.VEC4&&i)for(let s=0;s<r;s++)n[s]=Ne.unpack(t,s*4);else{let s=Dt.getMathType(o),a=Dt.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function Fqe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=F7(r,n,t.typedArray);i=i??!1,vqe(n,s,o,i)}function vF(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=Age(e,o),s=Fqe(e,r,t,n,i);return e._loaderPromises.push(s),i}return Wqe(t,i)}function rf(e,t){let n=J.createTypedArray(t.componentType,t.count*Dt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=Age(e,t.bufferView),{gltfJson:o}=e,r=i.load().then(()=>{if(e.isDestroyed())return;let s=F7(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 Iqe(e){return e===Number?0:new e}function Pqe(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 Xqe={VEC2:new k(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function Nqe(e,t){let n=Pqe(e.componentDatatype),i=Xqe[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 Yqe(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 Rn.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 Mqe(e,t,n,i,o){let r=e.accessors[t],s=Dt.getMathType(r.type),a=r.normalized??!1,c=new $7e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=Iqe(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=Nd(e,r),oo(r,"WEB3D_quantized_attributes")&&Yqe(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&&Nqe(c,s),c}function Gge(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var wqe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function I7(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=wqe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function kqe(e){let t=e===dt.POSITION,n=e===dt.FEATURE_ID,i=e===dt.TEXCOORD;return t||n||i}function Uqe(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 Dqe(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<s.length;b+=3){let f=s[b],y=s[b+1],_=s[b+2];a=Math.min(a,f),c=Math.max(c,f),d=Math.min(d,y),u=Math.max(u,y),m=Math.min(m,_),p=Math.max(p,_)}return[new h(a,d,m),new h(c,u,p)]},r=e.typedArray;[e.min,e.max]=o(r)}}function Oqe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=F7(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Lge(e,t,n,i,o,r,s,a,c){let d=e.gltfJson,u=d.accessors[t],m=u.bufferView,p=n.gltfSemantic,b=n.renamedSemantic,f=n.modelSemantic,y=l(f)?Gge(b):void 0,S=Mqe(d,t,p,f,y);if(!l(o)&&!l(m)&&!l(r))return S;let Z=Gqe(e,t,p,i,o,r,s,a,c),R=e._geometryLoaders.length;e._geometryLoaders.push(Z);let C=Z.load();return e._loaderPromises.push(C),e._geometryCallbacks[R]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[p])?Uqe(S,Z,s,a):l(r)?Dqe(S,Z,s,a):Oqe(d,u,S,Z,s,a)},S}function Wge(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=Lge(e,t,n,i,o,r,a?!1:_,a?!0:S,c),E=new J_.AttributeLoadPlan(C);return E.loadBuffer=_,E.loadTypedArray=S,E}function Bqe(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=I7(e,Xr,i),d=c.modelSemantic,u=d===Xr.TRANSLATION||d===Xr.ROTATION||d===Xr.SCALE,m=d===Xr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,b=e._enablePick&&!o.context.webgl2,f=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Lge(e,t,c,void 0,void 0,void 0,f,p||m&&(!a||y||b),o)}function zqe(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 eqe;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=Lqe(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 J_.IndicesLoadPlan(m);return L.loadBuffer=_,L.loadTypedArray=S,L}function Hqe(e,t,n){return new Ot({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=Yd.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Yi.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Yd.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=ar.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=Hqe(m.sampler,i,o))},c}function Kqe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new gqe;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 Jqe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new bqe;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 jqe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new yqe;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 Qqe(e,t,n){let{anisotropyStrength:i=L7.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=L7.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new L7;return l(r)&&(s.anisotropyTexture=jl(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function qqe(e,t,n){let{clearcoatFactor:i=W7.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=W7.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new W7;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 $qe(e){return new xqe(e)}function e$e(e){if(!l(e))return;let t=new Tqe;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 t$e(e,t,n){let i=new _qe,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=Kqe(e,r,n):(l(d)&&(i.metallicRoughness=Jqe(e,d,n)),l(s)&&!i.unlit&&(i.specular=jqe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=Qqe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=qqe(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=$qe(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=e$e(o.BENTLEY_materials_line_style),i}function vge(e,t){let n=new Cge;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 Fge(e,t,n,i){let o=new Cge,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Gge(r.attribute),o.positionalLabel=i,o}function Ige(e,t){let n=new Ege;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 Pge(e,t,n,i){let o=new Ege,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 n$e(e,t,n,i){let o=new Vge;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,qn.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function i$e(e,t,n,i,o,r){let s=new Vge,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=jl(e,c,i,Ht.NEAREST,qn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function o$e(e,t,n,i,o){let r=new tqe,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=I7(e,dt,u),b=Wge(e,m,p,s,a,c,d,n,o);r.attributes.push(b.attribute),i.attributePlans.push(b)}return r}function r$e(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Xge(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 s$e(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 a$e(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;o<t.length;o++){let r=t[o]??B.EMPTY_OBJECT,s=r.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new ae("Edge visibility line string accessor not found!");let c=rf(e,a),d=s$e(a.componentType),u=l(r.material)?r.material:n;i[o]={indices:c,restartIndex:d,componentType:a.componentType,materialColor:Xge(e,u)}}return i}function c$e(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let o=e.gltfJson.accessors[i];if(!l(o))throw new ae("Edge visibility accessor not found!");n.visibility=rf(e,o)}if(n.materialColor=Xge(e,t.material),l(t.silhouetteNormals)){let o=e.gltfJson.accessors[t.silhouetteNormals];l(o)&&(n.silhouetteNormals=rf(e,o))}return l(t.lineStrings)&&(n.lineStrings=a$e(e,t.lineStrings,t.material)),n}function l$e(e,t,n,i){let o=new nqe,r=new J_(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=t$e(e,e.gltfJson.materials[s],i));let a=t.extensions??B.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(o.polygon=u$e(e,t,c));let d=a.CESIUM_mesh_vector;l(d)&&(o.vector=m$e(e,d));let u=!1,m=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(m)&&(u=!0,r.needsOutlines=!0,r.outlineIndices=d$e(e,m,r)),o.edgeVisibility=c$e(e,a.EXT_mesh_primitive_edge_visibility);let p=r$e(a);l(p)&&(u=!0,r.needsGaussianSplats=!0);let b=e._loadForClassification,f=a.KHR_draco_mesh_compression,y=!1,_=t.attributes;if(l(_))for(let I in _){if(!_.hasOwnProperty(I))continue;let N=_[I],g=I7(e,dt,I),V=g.modelSemantic;if(b&&!kqe(V))continue;V===dt.FEATURE_ID&&(y=!0);let G=Wge(e,N,g,t,f,p,n,u,i);r.attributePlans.push(G),o.attributes.push(G.attribute)}let S=t.targets;if(l(S)&&!b)for(let I=0;I<S.length;++I)o.morphTargets.push(o$e(e,S[I],u,r,i));let Z=t.indices;if(l(Z)){let I=zqe(e,Z,t,y,u,i);l(I)&&(r.indicesPlan=I,o.indices=I.indices)}let R=a.EXT_structural_metadata,C=a.EXT_mesh_features,E=a.EXT_feature_metadata,A=l(E),L=a.NGA_gpm_local;l(C)?h$e(e,o,C,i):A&&f$e(e,o,E,i),l(R)?p$e(o,R):A&&b$e(e,o,E),l(L)&&g$e(o,L);let F=t.mode;if(b&&F!==Ie.TRIANGLES)throw new ae("Only triangle meshes can be used for classification.");return o.primitiveType=F,o}function d$e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return vF(e,i,!1)}function u$e(e,t,n){let i=new Zqe,o=e.gltfJson.accessors;return i.count=n.count,t.mode===Ie.LINE_LOOP?(i.loopIndices=rf(e,o[t.indices]),i.loopIndicesOffsets=rf(e,o[n.indicesOffsets]),i.triangleIndices=rf(e,o[n.triangleIndices]),i.triangleIndicesOffsets=rf(e,o[n.triangleIndicesOffsets])):t.mode===Ie.TRIANGLES&&(i.loopIndices=rf(e,o[n.loopIndices]),i.loopIndicesOffsets=rf(e,o[n.loopIndicesOffsets]),i.triangleIndices=rf(e,o[t.indices]),i.triangleIndicesOffsets=rf(e,o[n.indicesOffsets])),i}function m$e(e,t){if(!l(t))return;let n=new Sqe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function o(r,s){if(l(r))return vF(e,i[r])}return n.polygonAttributeOffsets=o(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=o(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=o(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=o(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function h$e(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=n$e(e,s,i,a):l(s.attribute)?c=vge(s,a):c=Ige(s,a),t.featureIds.push(c)}}function f$e(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let d=s[c],u=d.featureTable,m=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,b=`featureId_${r}`;r++;let f;l(d.featureIds.attribute)?f=Fge(d,m,p,b):f=Pge(d,m,p,b),t.featureIds.push(f)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let d=a[c],u=d.featureTable,m=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,b=`featureId_${r}`;r++;let f=i$e(e,d,m,i,p,b);t.featureIds.push(f)}}function p$e(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function b$e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function g$e(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function y$e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new iqe,r=i.attributes;if(l(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(Bqe(e,u,r,d,n))}let s=i.extensions??B.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?x$e(o,a):l(c)&&T$e(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function x$e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=vge(o,r):s=Ige(o,r),e.featureIds.push(s)}}function T$e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,d=i.indexOf(c),u=o[c].count,m=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Fge(a,d,u,m):p=Pge(a,d,u,m),t.featureIds.push(p)}}function _$e(e,t,n){let i=new rqe;i.name=t.name,i.matrix=wd(P,t.matrix),i.translation=wd(h,t.translation),i.rotation=wd(Ne,t.rotation),i.scale=wd(h,t.scale);let o=t.extensions??B.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations,a=o.CESIUM_mesh_vector;if(l(r)){if(e._loadForClassification)throw new ae("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=y$e(e,o,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let d=e.gltfJson.meshes[c],u=WF(d);for(let b=0;b<u.length;++b)i.primitives.push(l$e(e,u[b],l(i.instances),n));let m=t.weights??d.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(m)?m.slice():new Array(p.length).fill(0)}return i}function S$e(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=_$e(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function Z$e(e,t,n){let i=new oqe,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=vF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(P.IDENTITY);return i}function R$e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=Z$e(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function C$e(e,t,n,i){let o=new TF({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 V$e(e,t,n,i){let o=new LF({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 E$e(e,t){let n=new aqe,i=e.gltfJson.accessors,o=i[t.input];n.input=vF(e,o);let r=t.interpolation;n.interpolation=of[r]??of.LINEAR;let s=i[t.output];return n.output=vF(e,s,!0),n}function A$e(e,t){let n=new cqe,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=sqe[o],n}function G$e(e,t,n){let i=new lqe,o=e.sampler;return i.sampler=t[o],i.target=A$e(e.target,n),i}function L$e(e,t,n){let i=new dqe;i.name=t.name;let o=t.samplers.map(function(s,a){let c=E$e(e,s);return c.index=a,c}),r=t.channels.map(function(s){return G$e(s,o,n)});return i.samplers=o,i.channels=r,i}function W$e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=L$e(e,o,t);return s.index=r,s})}function v$e(e){let t=new uqe;t.name=e.name;let n=e.type.toUpperCase();return t.type=ul[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function F$e(e){let t=new mqe;return t.name=e.name,t.stages=e.stages.map(v$e),t}function I$e(e){let n=(e.extensions??B.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(F$e):[]}function P$e(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 X$e(e,t){let n=new fqe,i=P$e(e);return n.nodes=i.map(function(o){return t[o]}),n}var N$e=new h;function Y$e(e,t){let n=e.gltfJson,i=n.extensions??B.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let Z=r.featureTables,R=r.featureTextures,C=l(Z)?Z:[],E=l(R)?R:[];e._sortedPropertyTableIds=Object.keys(C).sort(),e._sortedFeatureTextureIds=Object.keys(E).sort()}let a=S$e(e,t),c=R$e(e,a),d=W$e(e,a),u=I$e(n),m=X$e(n,a),p=new pqe,b=new hqe,f=n.asset.copyright;if(l(f)){let Z=f.split(";").map(function(R){return new Lt(R.trim())});b.credits=Z}if(p.asset=b,p.scene=m,p.nodes=a,p.skins=c,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let Z=h.fromArray(s.center,0,N$e);p.transform=P.fromTranslation(Z,p.transform)}if(e._components=p,l(o)||l(r)){let Z=C$e(e,o,r,t);e._loaderPromises.push(Z)}let y=i.NGA_gpm_local;if(l(y)){let Z=VF.load(y);e._components.extensions.NGA_gpm_local=Z}let _=n.meshes;if(l(_))for(let Z of _){let R=Z.primitives;if(l(R))for(let C of R){let E=C.extensions;if(l(E)){let A=E.NGA_gpm_local;if(l(A)){let L=V$e(e,n,A,t);e._loaderPromises.push(L)}}}}let S=[];return ti(S,e._loaderPromises),e._incrementallyLoadTextures||ti(S,e._texturesPromises),Promise.all(S)}function M$e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Yi.unload(t[n]);e._textureLoaders.length=0}function Rge(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Yi.unload(t[n]);e._bufferViewLoaders.length=0}function w$e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Yi.unload(t[n]);e._geometryLoaders.length=0}function k$e(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 U$e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function D$e(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Iu=v7;var L9n=x(T(),1);var Z9n=x(T(),1);function j_(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 Se}Object.defineProperties(j_.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}}});j_.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function P7(e){e._cubeMapBuffers=void 0}j_.prototype.update=function(e){let{context:t}=e;if(!j_.isSupported(t))return;if(l(this._texture)){P7(this);return}if(!l(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);l(u)&&(P7(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let u=this;Ad(this._url).then(function(m){u._cubeMapBuffers=m,u._loading=!1}).catch(function(m){u.isDestroyed()||u._errorEvent.raiseEvent(m)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT);let o=Qe.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(ns.FaceName).forEach(m=>{u[m]=void 0});for(let m=r;m<a;m++)n.push(u)}let c=new Ot({minificationFilter:Ht.LINEAR_MIPMAP_LINEAR}),d=new ns({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};j_.prototype.isDestroyed=function(){return!1};j_.prototype.destroy=function(){return P7(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var sf=j_;function FF(e){e=e??B.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?k.clone(e.imageBasedLightingFactor):new k(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=k.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(FF.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=k.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 O$e(e,t){if(sf.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new sf(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}FF.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&&(O$e(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)};FF.prototype.isDestroyed=function(){return!1};FF.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var Q_=FF;var Q9n=x(T(),1);var K9n=x(T(),1);var v9n=x(T(),1),IF=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; -vec2 neighborContribution(float log2Depth, vec2 offset) +#ifdef HAS_NORMAL_TEXTURE +vec2 getNormalTexCoords() { -float dist = u_distanceAndEdlStrength.x; -vec2 texCoordOrig = v_textureCoordinates + offset * dist; -vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); -vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); -float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); -float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); -if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { -return vec2(0.0); +vec2 texCoord = TEXCOORD_NORMAL; +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); +#endif +return texCoord; +} +#endif +#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) +vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +{ +vec2 tex_dx = dFdx(normalTexCoords); +vec2 tex_dy = dFdy(normalTexCoords); +float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; +vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); +return tangent / determinant; +} +#endif +#ifdef USE_ANISOTROPY +struct NormalInfo { +vec3 tangent; +vec3 bitangent; +vec3 normal; +vec3 geometryNormal; +}; +NormalInfo getNormalInfo(ProcessedAttributes attributes) +{ +vec3 geometryNormal = attributes.normalEC; +#ifdef HAS_NORMAL_TEXTURE +vec2 normalTexCoords = getNormalTexCoords(); +#endif +#ifdef HAS_BITANGENTS +vec3 tangent = attributes.tangentEC; +vec3 bitangent = attributes.bitangentEC; +#else // Assume HAS_NORMAL_TEXTURE +vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); +tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); +vec3 bitangent = normalize(cross(geometryNormal, tangent)); +#endif +#ifdef HAS_NORMAL_TEXTURE +mat3 tbn = mat3(tangent, bitangent, geometryNormal); +vec3 normalSample; +#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; +#endif +vec3 normal = normalize(tbn * normalSample); +#else +vec3 normal = geometryNormal; +#endif +#ifdef HAS_DOUBLE_SIDED_MATERIAL +if (czm_backFacing()) { +tangent *= -1.0; +bitangent *= -1.0; +normal *= -1.0; +geometryNormal *= -1.0; } -float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); -return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +#endif +NormalInfo normalInfo; +normalInfo.tangent = tangent; +normalInfo.bitangent = bitangent; +normalInfo.normal = normal; +normalInfo.geometryNormal = geometryNormal; +return normalInfo; } -void main() -{ -float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); -eyeCoordinate /= eyeCoordinate.w; -float log2Depth = log2(-eyeCoordinate.z); -if (depthOrLogDepth == 0.0) +#endif +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) { -discard; -} -vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); -vec2 texelSize = 1.0 / czm_viewport.zw; -vec2 responseAndCount = vec2(0.0); -responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); -responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); -responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); -responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); -float response = responseAndCount.x / responseAndCount.y; -float strength = u_distanceAndEdlStrength.y; -float shade = exp(-response * 300.0 * strength); -color.rgb *= shade; -out_FragColor = vec4(color); -gl_FragDepth = depthOrLogDepth; -} -`;function bC(){this._framebuffer=new li({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(bC.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 B$e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var X7=new k;function z$e(e,t){let n=new Je({defines:["LOG_DEPTH_WRITE"],sources:[IF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return X7.x=e._radius,X7.y=e._strength,X7}},o=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Le.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ui({framebuffer:e.framebuffer,color:new U(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:Le.CESIUM_3D_TILE,owner:e})}function H$e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),z$e(e,t)}function Nge(e){return e.drawBuffers&&e.fragmentDepth}bC.isSupported=Nge;function K$e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; -layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Je.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() -{ - czm_point_cloud_post_process_main(); -#ifdef LOG_DEPTH - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); +vec2 normalTexCoords = getNormalTexCoords(); +#ifdef HAS_BITANGENTS +vec3 t = attributes.tangentEC; +vec3 b = attributes.bitangentEC; #else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); +vec3 t = computeTangent(attributes.positionEC, normalTexCoords); +t = normalize(t - geometryNormal * dot(geometryNormal, t)); +vec3 b = normalize(cross(geometryNormal, t)); #endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}bC.prototype.update=function(e,t,n,i){if(!Nge(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,H$e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==Ie.POINTS||d.pass===Le.TRANSLUCENT)continue;let u,m,p=d.derivedCommands.pointCloudProcessor;l(p)&&(u=p.command,m=p.originalShaderProgram),(!l(u)||d.dirty||m!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=lt.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=K$e(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,l(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};bC.prototype.isDestroyed=function(){return!1};bC.prototype.destroy=function(){return B$e(this),ue(this)};var Ib=bC;function Yge(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}Yge.isSupported=function(e){return Ib.isSupported(e.context)};var Hp=Yge;var $9n=x(T(),1),kd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};kd.NUMBER_OF_SHADOW_MODES=4;kd.castShadows=function(e){return e===kd.ENABLED||e===kd.CAST_ONLY};kd.receiveShadows=function(e){return e===kd.ENABLED||e===kd.RECEIVE_ONLY};kd.fromCastReceive=function(e,t){return e&&t?kd.ENABLED:e?kd.CAST_ONLY:t?kd.RECEIVE_ONLY:kd.DISABLED};Object.freeze(kd);var Wn=kd;var wkn=x(T(),1);var ikn=x(T(),1);function PF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Mge(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 J$e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=J.createTypedArray(n,i),o[t]=r),r}PF.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,Mge(this,e,t,n,1,i.byteOffset)):i};PF.prototype.hasProperty=function(e){return l(this.json[e])};PF.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)),Mge(this,e,t,n,this.featuresLength,i.byteOffset)):J$e(this,e,t,i)};PF.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var af=PF;var _kn=x(T(),1);function XF(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,s=j$e(n),a;l(s.jsonProperties)&&(a=new vb({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new m_({extension:s.hierarchy,binaryBody:i}));let d=$h.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,m,p,b;if(o){let _=q$e(t,d,u,i,r);b=_.transcodedSchema,p=[new z_({propertyAttribute:_.propertyAttributeJson,class:_.transcodedClass})]}else{let _=Q$e(t,d,u,i);b=_.transcodedSchema;let S=_.featureTableJson;m=new Fm({count:S.count,properties:S.properties,class:_.transcodedClass,bufferViews:_.bufferViewsTypedArrays}),p=[]}let f=[];if(l(m)||l(a)||l(c)){let _=new Jl({id:0,name:"Batch Table",count:t,metadataTable:m,jsonMetadataTable:a,batchTableHierarchy:c});f.push(_)}let y={schema:b,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ua(y)}function j$e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(XF._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function Q$e(e,t,n,i){let o={},r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;if(!l(i))throw new ae(`Property ${m} requires a batch table binary.`);let p=n[m],b=Zm(p);r[m]={bufferView:a},o[m]=wge(p),s[a]=b.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=zl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function q$e(e,t,n,i,o){let r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;let p=n[m];if(!l(i)&&!l(p.typedArray))throw new ae(`Property ${m} requires a batch table binary.`);let b=Zt.sanitizeGlslIdentifier(m);(b===""||r.hasOwnProperty(b))&&(b=`property_${a}`,a++);let f=wge(p);f.name=m,r[b]=f;let y=b.toUpperCase();y.startsWith("_")||(y=`_${y}`);let _=p.typedArray;l(_)||(_=Zm(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let S=new Rn.Attribute;S.name=y,S.count=e,S.type=p.type;let Z=J.fromTypedArray(_);(Z===J.INT||Z===J.UNSIGNED_INT||Z===J.DOUBLE)&&(XF._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.`),_=new Float32Array(_)),S.componentDatatype=J.fromTypedArray(_),S.typedArray=_,o.push(S),s[b]={attribute:y}}let c={classes:{}};c.classes[t]={properties:r};let d=zl.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function wge(e){let t=$$e(e.componentType);return{type:e.type,componentType:t}}function $$e(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"}}XF._deprecationWarning=Jo;XF._oneTimeWarning=xt;var Pb=XF;var q_={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},eet=Rn.FeatureIdAttribute,N7=class extends to{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,o=t.arrayBuffer,r=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,d=t.upAxis??Di.Y,u=t.forwardAxis??Di.X,m=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,b=t.enablePick??!1,f=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,_=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=o,this._byteOffset=r,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=d,this._forwardAxis=u,this._loadAttributesAsTypedArray=m,this._loadAttributesFor2D=p,this._enablePick=b,this._loadIndicesForWireframe=f,this._loadPrimitiveOutline=y,this._loadForClassification=_,this._state=q_.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=P.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=EG.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,s=new af(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(c)&&(this._transform=P.fromTranslation(h.fromArray(c))),this._batchTable={json:o,binary:r};let d=new Iu({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=d,this._state=q_.LOADING;let u=this;return this._promise=d.load().then(function(){if(!u.isDestroyed())return u._state=q_.PROCESSING,u}).catch(function(m){if(!u.isDestroyed())return tet(u,m)}),this._promise}process(t){if(this._state===q_.READY)return!0;if(this._state!==q_.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=P.multiplyTransformation(this._transform,i.transform,i.transform),net(this,i),this._components=i,this._arrayBuffer=void 0,this._state=q_.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function tet(e,t){return e.unload(),e._state=q_.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function net(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=Pb({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Jl({name:$h.BATCH_TABLE_CLASS_NAME,count:i});o=new Ua({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)kge(r[a]);t.structuralMetadata=o}function kge(e){let t=e.children.length;for(let i=0;i<t;i++)kge(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Zt.getAttributeBySemantic(o,dt.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new eet;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}var NF=N7;var lUn=x(T(),1);var Y7=class extends to{constructor(t){super(),t=t??B.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=bet(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function iet(){this.lines=void 0,this.points=void 0,this.properties=void 0}function oet(){this.features=[]}function M7(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function w7(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=M7(e[o]);return[n]}function ret(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=w7(e[i])[0];return n}function Uge(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=w7(e[i])[0];return n}function set(e){let t=e.length,n=[];for(let i=0;i<t;i++){let o=Uge(e[i]);ti(n,o)}return n}function aet(e){return[M7(e)]}function cet(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=M7(e[i]);return n}var det={LineString:w7,MultiLineString:ret,MultiPolygon:set,Polygon:Uge,MultiPoint:cet,Point:aet},uet={LineString:Ie.LINES,MultiLineString:Ie.LINES,MultiPolygon:Ie.LINES,Polygon:Ie.LINES,MultiPoint:Ie.POINTS,Point:Ie.POINTS};function Dge(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=det[n],o=uet[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new iet;o===Ie.LINES?s.lines=i(r):o===Ie.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function met(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Dge(n[o],t)}var het={FeatureCollection:met,Feature:Dge},mB=new h;function fet(e,t,n){let i=0,o=0,r=e.length;for(let I=0;I<r;I++){let N=e[I];if(l(N.lines)){let g=N.lines.length;for(let V=0;V<g;V++){let G=N.lines[V];i+=G.length,o+=(G.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Oe.createTypedArray(i,o),d=Oe.fromTypedArray(c),u=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,b=0;for(let I=0;I<r;I++){let N=e[I];if(!l(N.lines))continue;let g=N.lines.length;for(let V=0;V<g;V++){let G=N.lines[V],v=G.length;for(let X=0;X<v;X++){let Y=G[X],D=h.fromDegrees(Y.x,Y.y,Y.z,ne.WGS84,mB),M=P.multiplyByPoint(t,D,mB);h.minimumByComponent(u,M,u),h.maximumByComponent(m,M,m),h.pack(M,s,p*3),a[p]=I,X<v-1&&(c[b*2]=p,c[b*2+1]=p+1,b++),p++}}}let f=it.createVertexBuffer({typedArray:s,context:n.context,usage:Pe.STATIC_DRAW});f.vertexArrayDestroyable=!1;let y=it.createVertexBuffer({typedArray:a,context:n.context,usage:Pe.STATIC_DRAW});y.vertexArrayDestroyable=!1;let _=it.createIndexBuffer({typedArray:c,context:n.context,usage:Pe.STATIC_DRAW,indexDatatype:d});_.vertexArrayDestroyable=!1;let S=new Rn.Attribute;S.semantic=dt.POSITION,S.componentDatatype=J.FLOAT,S.type=Dt.VEC3,S.count=i,S.min=u,S.max=m,S.buffer=f;let Z=new Rn.Attribute;Z.semantic=dt.FEATURE_ID,Z.setIndex=0,Z.componentDatatype=J.FLOAT,Z.type=Dt.SCALAR,Z.count=i,Z.buffer=y;let R=[S,Z],C=new Rn.Material;C.unlit=!0;let E=new Rn.Indices;E.indexDatatype=d,E.count=c.length,E.buffer=_;let A=new Rn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let L=[A],F=new Rn.Primitive;return F.attributes=R,F.indices=E,F.featureIds=L,F.primitiveType=Ie.LINES,F.material=C,F}function pet(e,t,n){let i=0,o=e.length;for(let R=0;R<o;R++){let C=e[R];l(C.points)&&(i+=C.points.length)}let r=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),d=0;for(let R=0;R<o;R++){let C=e[R];if(!l(C.points))continue;let E=C.points.length;for(let A=0;A<E;A++){let L=C.points[A],F=h.fromDegrees(L.x,L.y,L.z,ne.WGS84,mB),I=P.multiplyByPoint(t,F,mB);h.minimumByComponent(a,I,a),h.maximumByComponent(c,I,c),h.pack(I,r,d*3),s[d]=R,d++}}let u=it.createVertexBuffer({typedArray:r,context:n.context,usage:Pe.STATIC_DRAW});u.vertexArrayDestroyable=!1;let m=it.createVertexBuffer({typedArray:s,context:n.context,usage:Pe.STATIC_DRAW});m.vertexArrayDestroyable=!1;let p=new Rn.Attribute;p.semantic=dt.POSITION,p.componentDatatype=J.FLOAT,p.type=Dt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let b=new Rn.Attribute;b.semantic=dt.FEATURE_ID,b.setIndex=0,b.componentDatatype=J.FLOAT,b.type=Dt.SCALAR,b.count=i,b.buffer=m;let f=[p,b],y=new Rn.Material;y.unlit=!0;let _=new Rn.FeatureIdAttribute;_.featureCount=o,_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0";let S=[_],Z=new Rn.Primitive;return Z.attributes=f,Z.featureIds=S,Z.primitiveType=Ie.POINTS,Z.material=y,Z}function bet(e,t){let n=new oet,i=het[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ae("GeoJSON must have at least one feature");let s={};for(let I=0;I<r;I++){let g=o[I].properties??B.EMPTY_OBJECT;for(let V in g)g.hasOwnProperty(V)&&(l(s[V])||(s[V]=new Array(r)))}for(let I=0;I<r;I++){let N=o[I];for(let g in s)if(s.hasOwnProperty(g)){let V=N.properties[g]??"";s[g][I]=V}}let a=new vb({count:r,properties:s}),d=[new Jl({id:0,count:r,jsonMetadataTable:a})],u=zl.fromJson({}),m=new Ua({schema:u,propertyTables:d}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),b=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,y=!1;for(let I=0;I<r;I++){let N=o[I];if(l(N.lines)){f=!0;let g=N.lines.length;for(let V=0;V<g;V++){let G=N.lines[V],v=G.length;for(let X=0;X<v;X++)h.minimumByComponent(p,G[X],p),h.maximumByComponent(b,G[X],b)}}if(l(N.points)){y=!0;let g=N.points.length;for(let V=0;V<g;V++){let G=N.points[V];h.minimumByComponent(p,G,p),h.maximumByComponent(b,G,b)}}}let _=h.midpoint(p,b,new h),S=h.fromDegrees(_.x,_.y,_.z,ne.WGS84,new h),Z=_t.eastNorthUpToFixedFrame(S,ne.WGS84,new P),R=P.inverseTransformation(Z,new P),C=[];f&&C.push(fet(o,R,t)),y&&C.push(pet(o,R,t));let E=new Rn.Node;E.index=0,E.primitives=C;let A=[E],L=new Rn.Scene;L.nodes=A;let F=new Rn.Components;return F.scene=L,F.nodes=A,F.transform=Z,F.structuralMetadata=m,F}var YF=Y7;var OUn=x(T(),1);var fUn=x(T(),1);var hB={};hB._deprecationWarning=Jo;var ux=Uint32Array.BYTES_PER_ELEMENT;hB.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ux;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+=ux;let s=o.getUint32(t,!0);t+=ux;let a=o.getUint32(t,!0);if(a===0)throw new ae("featureTableJsonByteLength is zero, the feature table must be defined.");t+=ux;let c=o.getUint32(t,!0);t+=ux;let d=o.getUint32(t,!0);t+=ux;let u=o.getUint32(t,!0);t+=ux;let m=o.getUint32(t,!0);if(m!==1&&m!==0)throw new ae(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${m} is not.`);t+=ux;let p=Wr(i,t,a);t+=a;let b=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=Wr(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,_):(hB._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 MF=hB;var Xb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},fB=Rn.Attribute,get=Rn.FeatureIdAttribute,Bge=Rn.Instances,k7=class extends to{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??Di.Y,u=t.forwardAxis??Di.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=Xb.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=MF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,s=t.gltfFormat,a=new af(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=Wd(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 Iu(u);return this._gltfLoader=m,this._state=Xb.LOADING,this._promise=m.load().then(()=>{if(!this.isDestroyed())return this._state=Xb.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw yet(this,p)}),this._promise}process(t){if(this._state===Xb.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Xb.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=P.multiplyTransformation(this._transform,o.transform,o.transform),_et(this,o,t),xet(this,o),this._components=o,this._arrayBuffer=void 0,this._state=Xb.READY,!0}isUnloaded(){return this._state===Xb.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Eet(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Xb.UNLOADED}};function yet(e,t){return e.unload(),e._state=Xb.FAILED,e.getError("Failed to load i3dm",t)}function xet(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Pb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Jl({name:$h.BATCH_TABLE_CLASS_NAME,count:i});o=new Ua({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var pB=new h,U7=new Array(4),Tet=new P;function _et(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=Ret(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 M=me.fromPoints(f);for(i=0;i<f.length;i++)h.subtract(f[i],M.center,pB),u[3*i+0]=pB.x,u[3*i+1]=pB.y,u[3*i+2]=pB.z;let O=P.fromTranslation(M.center,Tet);t.transform=P.multiplyTransformation(O,t.transform,t.transform)}for(i=0;i<r;i++){y=h.clone(f[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(Cet(o,a,i,C,y,S,_,Z,R,F),Ne.pack(C,E,0),m[4*i+0]=E[0],m[4*i+1]=E[1],m[4*i+2]=E[2],m[4*i+3]=E[3]),d&&(Vet(o,i,A),h.pack(A,L,0),p[3*i+0]=L[0],p[3*i+1]=L[1],p[3*i+2]=L[2]);let M=o.getProperty("BATCH_ID",J.UNSIGNED_SHORT,1,i);l(M)||(M=i),b[i]=M}let I=new Bge;I.transformInWorldSpace=!0;let N=e._buffers,g=new fB;if(g.name="Instance Translation",g.semantic=Xr.TRANSLATION,g.componentDatatype=J.FLOAT,g.type=Dt.VEC3,g.count=r,g.typedArray=u,!c){let M=it.createVertexBuffer({context:n.context,typedArray:u,usage:Pe.STATIC_DRAW});M.vertexArrayDestroyable=!1,N.push(M),g.buffer=M}if(I.attributes.push(g),c){let M=new fB;M.name="Instance Rotation",M.semantic=Xr.ROTATION,M.componentDatatype=J.FLOAT,M.type=Dt.VEC4,M.count=r,M.typedArray=m,I.attributes.push(M)}if(d){let M=new fB;if(M.name="Instance Scale",M.semantic=Xr.SCALE,M.componentDatatype=J.FLOAT,M.type=Dt.VEC3,M.count=r,c)M.typedArray=p;else{let O=it.createVertexBuffer({context:n.context,typedArray:p,usage:Pe.STATIC_DRAW});O.vertexArrayDestroyable=!1,N.push(O),M.buffer=O}I.attributes.push(M)}let V=new fB;V.name="Instance Feature ID",V.setIndex=0,V.semantic=Xr.FEATURE_ID,V.componentDatatype=J.FLOAT,V.type=Dt.SCALAR,V.count=r;let G=it.createVertexBuffer({context:n.context,typedArray:b,usage:Pe.STATIC_DRAW});G.vertexArrayDestroyable=!1,N.push(G),V.buffer=G,I.attributes.push(V);let v=new get;v.propertyTableId=0,v.setIndex=0,v.positionalLabel="instanceFeatureId_0",I.featureIds.push(v);let X=t.nodes,Y=X.length,D=!1;for(i=0;i<Y;i++){let M=X[i];M.primitives.length>0&&(M.instances=D?Zet(I):I,D=!0)}}function Zet(e){let t=new Bge;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=$e(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function Ret(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",J.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",J.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",J.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",J.FLOAT,3);if(!l(o))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new ae("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Oge=new Array(4);function Cet(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",J.FLOAT,3,n,U7),m=e.getProperty("NORMAL_RIGHT",J.FLOAT,3,n,Oge),p=!1;if(l(u)){if(!l(m))throw new ae("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(u,0,r),h.unpack(m,0,s),p=!0}else{let b=e.getProperty("NORMAL_UP_OCT32P",J.UNSIGNED_SHORT,2,n,U7),f=e.getProperty("NORMAL_RIGHT_OCT32P",J.UNSIGNED_SHORT,2,n,Oge);if(l(b)){if(!l(f))throw new ae("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");dn.octDecodeInRange(b[0],b[1],65535,r),dn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(_t.eastNorthUpToFixedFrame(o,ne.WGS84,d),P.getMatrix3(d,c)):q.clone(q.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),q.setColumn(c,0,s,c),q.setColumn(c,1,r,c),q.setColumn(c,2,a,c)),Ne.fromRotationMatrix(c,i)}function Vet(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",J.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",J.FLOAT,3,t,U7);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function Eet(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}var wF=k7;var cDn=x(T(),1);var q5n=x(T(),1);var zUn=x(T(),1),zge={STOPPED:0,ANIMATING:1};Object.freeze(zge);var cf=zge;var O5n=x(T(),1);var t5n=x(T(),1);var qUn=x(T(),1);function gC(){this.times=void 0,this.points=void 0,ge.throwInstantiationError()}gC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Ne)return Ne};gC.prototype.evaluate=ge.throwInstantiationError;gC.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 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};gC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};gC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var Fo=gC;function yC(e){this._value=e,this._valueType=Fo.getPointType(e)}Object.defineProperties(yC.prototype,{value:{get:function(){return this._value}}});yC.prototype.findTimeInterval=function(e){};yC.prototype.wrapTime=function(e){return 0};yC.prototype.clampTime=function(e){return 0};yC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var kF=yC;var T5n=x(T(),1);var a5n=x(T(),1);function xC(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Fo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(xC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});xC.prototype.findTimeInterval=Fo.prototype.findTimeInterval;xC.prototype.wrapTime=Fo.prototype.wrapTime;xC.prototype.clampTime=Fo.prototype.clampTime;xC.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 mx=xC;var d5n=x(T(),1);var Hge={};Hge.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var TC=Hge;var Kge=[],Jge=[],jge=[],Qge=[];function Aet(e,t,n){let i=Kge,o=jge,r=Jge,s=Qge;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;a<i.length-1;++a)i[a]=o[a]=1,r[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,o[a]=1,r[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),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),TC.solve(i,r,o,s)}function Get(e){let t=Kge,n=jge,i=Jge,o=Qge;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),TC.solve(t,i,n,o)}function Ud(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=Fo.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Ud.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}}});Ud.createC1=function(e){e=e??B.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Ud({times:t,points:n,inTangents:r,outTangents:o})};Ud.createNaturalCubic=function(e){e=e??B.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new mx({points:n,times:t});let i=Get(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Ud({times:t,points:n,inTangents:r,outTangents:o})};Ud.createClampedCubic=function(e){e=e??B.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=Fo.getPointType(n[0]);if(n.length<3)return new mx({points:n,times:t});let s=Aet(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Ud({times:t,points:n,inTangents:c,outTangents:a})};Ud.hermiteCoefficientMatrix=new P(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Ud.prototype.findTimeInterval=Fo.prototype.findTimeInterval;var Let=new ce,_C=new h;Ud.prototype.wrapTime=Fo.prototype.wrapTime;Ud.prototype.clampTime=Fo.prototype.clampTime;Ud.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,d=Let;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=P.multiplyByVector(Ud.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let m=this._pointType;return m===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(l(t)||(t=new m),t=m.multiplyByScalar(n[s],u.x,t),m.multiplyByScalar(n[s+1],u.y,_C),m.add(t,_C,t),m.multiplyByScalar(r[s],u.z,_C),m.add(t,_C,t),m.multiplyByScalar(o[s],u.w,_C),m.add(t,_C,t))};var hx=Ud;var C5n=x(T(),1);function SC(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Fo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(SC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});SC.prototype.findTimeInterval=Fo.prototype.findTimeInterval;SC.prototype.wrapTime=Fo.prototype.wrapTime;SC.prototype.clampTime=Fo.prototype.clampTime;SC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var UF=SC;var W5n=x(T(),1);function Wet(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Ne);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Ne.fastSlerp(a,c,s,o)}}function ZC(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=Wet(this),this._lastTimeIndex=0}Object.defineProperties(ZC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ZC.prototype.findTimeInterval=Fo.prototype.findTimeInterval;ZC.prototype.wrapTime=Fo.prototype.wrapTime;ZC.prototype.clampTime=Fo.prototype.clampTime;ZC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var DF=ZC;var RC=Rn.AnimatedPropertyType;function D7(e){e=e??B.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,Xet(this)}Object.defineProperties(D7.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 vet(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 hx({times:e,points:n,inTangents:i,outTangents:o})}function qge(e,t,n,i){if(e.length===1&&t.length===1)return new kF(t[0]);switch(n){case of.STEP:return new UF({times:e,points:t});case of.CUBICSPLINE:return vet(e,t);case of.LINEAR:return i===RC.ROTATION?new DF({times:e,points:t}):new mx({times:e,points:t})}}function Fet(e,t,n,i,o){let r=[];if(i===RC.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),m=c;if(n===of.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[m],u[d+1]=t[m+o],u[d+2]=t[m+2*o],m+=o*3;else for(d=0;d<a;d++)u[d]=t[m],m+=o;r.push(qge(e,u,n,i))}}else r.push(qge(e,t,n,i));return r}var Iet=new h,Pet=new Ne;function Xet(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,d=l(c.morphWeights)?c.morphWeights.length:1,u=Fet(i,o,r,a,d);e._splines=u,e._path=a}D7.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===RC.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],d=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===RC.TRANSLATION||n===RC.SCALE?o[n]=r.evaluate(s,Iet):n===RC.ROTATION&&(o[n]=r.evaluate(s,Pet))}}};var OF=D7;function O7(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??Md.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new Se,this.update=new Se,this.stop=new Se,this._state=cf.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,Net(this)}Object.defineProperties(O7.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 Net(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let d=r[c],u=d.target;if(!l(u))continue;let m=u.node.index,p=i._runtimeNodes[m],b=new OF({channel:d,runtimeAnimation:e,runtimeNode:p}),f=d.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(b)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}O7.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var BF=O7;function Nb(e){this.animationAdded=new Se,this.animationRemoved=new Se,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Nb.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function B7(e,t,n){let i=e._model,o=new BF(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Nb.prototype.add=function(e){e=e??B.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return B7(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return B7(this,n[i],e)};Nb.prototype.addAll=function(e){e=e??B.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=B7(this,n[r],e);i.push(s)}return i};Nb.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};Nb.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])};Nb.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Nb.prototype.get=function(e){return this._runtimeAnimations[e]};var bB=[];function Yet(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Nb.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Q.equals(e.time,this._previousTime))return!1;this._previousTime=Q.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=Q.addSeconds(a.startTime??o,a.delay,new Q)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,m=Q.lessThanOrEquals(c,o),p=l(u)&&Q.greaterThan(o,u),b=0;if(d!==0){let _=Q.secondsDifference(p?u:o,c);b=l(a._animationTime)?a._animationTime(d,_):_/d}let f=a.loop===Md.REPEAT||a.loop===Md.MIRRORED_REPEAT,y=(m||f&&!l(a.startTime))&&(b<=1||f)&&!p;if(b===a._prevAnimationDelta){let _=a._state===cf.STOPPED;if(y!==_)continue}if(a._prevAnimationDelta=b,y||a._state===cf.ANIMATING){if(y&&a._state===cf.STOPPED&&(a._state=cf.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Md.REPEAT)b=b-Math.floor(b);else if(a.loop===Md.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=cf.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&bB.push(a))}}n=bB.length;for(let s=0;s<n;++s){let a=bB[s];t.splice(t.indexOf(a),1),e.afterRender.push(Yet(this,r,a))}return bB.length=0,i};var zF=Nb;var VDn=x(T(),1);var mDn=x(T(),1);function $_(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties($_.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 U),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}}});$_.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};$_.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};$_.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};$_.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};$_.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var HF=$_;var fDn=x(T(),1),CC={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};CC.getStyleCommandsNeeded=function(e,t){return t===0?CC.ALL_OPAQUE:t===e?CC.ALL_TRANSLUCENT:CC.OPAQUE_AND_TRANSLUCENT};Object.freeze(CC);var lf=CC;var bDn=x(T(),1);var Yb={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Yb.is3DTiles=function(e){switch(e){case Yb.TILE_GLTF:case Yb.TILE_B3DM:case Yb.TILE_I3DM:case Yb.TILE_PNTS:case Yb.TILE_GEOJSON:return!0;case Yb.GLTF:return!1}};Object.freeze(Yb);var Or=Yb;function Rs(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=lf.ALL_OPAQUE,Met(this)}Object.defineProperties(Rs.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 Met(e){let t=e._model,n=Or.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 na(s,o)}else for(o=0;o<i;o++)r[o]=new HF({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Yl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Rs.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=lf.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Rs.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Rs.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Rs.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Rs.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Rs.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Rs.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Rs.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Rs.prototype.getFeature=function(e){return this._features[e]};Rs.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Rs.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Rs.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Rs.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Rs.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Rs.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Rs.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Rs.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Rs.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var wet=new U;Rs.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Yl.DEFAULT_COLOR_VALUE),this.setAllShow(Yl.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,wet)??Yl.DEFAULT_COLOR_VALUE:Yl.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??Yl.DEFAULT_SHOW_VALUE:Yl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Rs.prototype.isDestroyed=function(){return!1};Rs.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var KF=Rs;var bei=x(T(),1);var vDn=x(T(),1);var $ge={name:"TilesetPipelineStage"};$ge.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,fe.FRAGMENT);let r={u_polygonOffset:function(){return k.ZERO}};e.uniformMap=It(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Jt.setCesium3DTileBit(),i.stencilMask=Jt.CESIUM_3D_TILE_MASK};var JF=$ge;var DDn=x(T(),1);var IDn=x(T(),1),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; -vec2 tTrigs = vec2(0.70710678118); -vec2 v = radii * tTrigs; -vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -return v * sign(pos); -} -vec3 computeEllipsoidPositionWC(vec3 positionMC) { -vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; -vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); -vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); -return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); +mat3 tbn = mat3(t, b, geometryNormal); +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; +#endif +return normalize(tbn * normalSample); } -void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { -vec3 fogColor = groundAtmosphereColor.rgb; -const float NONE = 0.0; -if (czm_atmosphereDynamicLighting != NONE) { -float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); -fogColor *= darken; +#endif +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +{ +vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM +normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); +#endif +#ifdef HAS_BITANGENTS +vec3 t = attributes.tangentEC; +vec3 b = attributes.bitangentEC; +#else +vec3 t = computeTangent(attributes.positionEC, normalTexCoords); +t = normalize(t - geometryNormal * dot(geometryNormal, t)); +vec3 b = normalize(cross(geometryNormal, t)); +#endif +mat3 tbn = mat3(t, b, geometryNormal); +vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; +normalSample = 2.0 * normalSample - 1.0; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE +normalSample.xy *= u_clearcoatNormalTextureScale; +#endif +return normalize(tbn * normalSample); } -#ifndef HDR -fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); #endif -vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); -color = vec4(withFog, color.a); +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) +{ +vec3 normal = attributes.normalEC; +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +normal = getNormalFromTexture(attributes, normal); +#endif +#ifdef HAS_DOUBLE_SIDED_MATERIAL +if (czm_backFacing()) { +normal = -normal; } -void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { -vec3 rayleighColor; -vec3 mieColor; -float opacity; -vec3 positionWC; -vec3 lightDirection; -if (false) { -positionWC = computeEllipsoidPositionWC(attributes.positionMC); -lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); -czm_computeGroundAtmosphereScattering( -positionWC, -lightDirection, -rayleighColor, -mieColor, -opacity -); -} else { -positionWC = attributes.positionWC; -lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); -rayleighColor = v_atmosphereRayleighColor; -mieColor = v_atmosphereMieColor; -opacity = v_atmosphereOpacity; +#endif +return normal; } -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); -vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); -if (u_isInFog) { -float distanceToCamera = length(attributes.positionEC); -applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); -} else { +#endif +#ifdef HAS_BASE_COLOR_TEXTURE +vec4 getBaseColorFromTexture() +{ +vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; +#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM +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; } +#endif +#ifdef HAS_EMISSIVE_TEXTURE +vec3 getEmissiveFromTexture() +{ +vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; +#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM +emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); +#endif +vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); +#ifdef HAS_EMISSIVE_FACTOR +emissive *= u_emissiveFactor; +#endif +return emissive; } -`;var XDn=x(T(),1),QF=`void atmosphereStage(ProcessedAttributes attributes) { -vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); -czm_computeGroundAtmosphereScattering( -v_positionWC, -lightDirection, -v_atmosphereRayleighColor, -v_atmosphereMieColor, -v_atmosphereOpacity -); +#endif +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +void setSpecularGlossiness(inout czm_modelMaterial material) +{ +#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE +vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; +#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM +specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); +#endif +vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); +vec3 specular = specularGlossiness.rgb; +float glossiness = specularGlossiness.a; +#ifdef HAS_LEGACY_SPECULAR_FACTOR +specular *= u_legacySpecularFactor; +#endif +#ifdef HAS_GLOSSINESS_FACTOR +glossiness *= u_glossinessFactor; +#endif +#else +#ifdef HAS_LEGACY_SPECULAR_FACTOR +vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); +#else +vec3 specular = vec3(1.0); +#endif +#ifdef HAS_GLOSSINESS_FACTOR +float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); +#else +float glossiness = 1.0; +#endif +#endif +#ifdef HAS_DIFFUSE_TEXTURE +vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; +#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM +diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); +#endif +vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); +#ifdef HAS_DIFFUSE_FACTOR +diffuse *= u_diffuseFactor; +#endif +#elif defined(HAS_DIFFUSE_FACTOR) +vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); +#else +vec4 diffuse = vec4(1.0); +#endif +material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); +material.alpha = diffuse.a; +material.specular = specular; +material.roughness = 1.0 - glossiness; } -`;var eye={name:"AtmospherePipelineStage"};eye.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([QF]),i.addFragmentLines([jF]),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 qF=eye;var $Dn=x(T(),1);var BDn=x(T(),1),$F=`#ifdef DIFFUSE_IBL -vec3 sampleDiffuseEnvironment(vec3 cubeDir) +#elif defined(LIGHTING_PBR) +float setMetallicRoughness(inout czm_modelMaterial material) { -#ifdef CUSTOM_SPHERICAL_HARMONICS -return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); +#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE +vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; +#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM +metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); +#endif +vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; +float metalness = clamp(metallicRoughness.b, 0.0, 1.0); +float roughness = clamp(metallicRoughness.g, 0.0, 1.0); +#ifdef HAS_METALLIC_FACTOR +metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); +#endif +#ifdef HAS_ROUGHNESS_FACTOR +roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); +#endif #else -return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); +#ifdef HAS_METALLIC_FACTOR +float metalness = clamp(u_metallicFactor, 0.0, 1.0); +#else +float metalness = 1.0; #endif -} +#ifdef HAS_ROUGHNESS_FACTOR +float roughness = clamp(u_roughnessFactor, 0.0, 1.0); +#else +float roughness = 1.0; #endif -#ifdef SPECULAR_IBL -vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +#endif +const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); +vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); +material.specular = f0; +material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); +material.roughness = roughness; +return metalness; +} +#ifdef USE_SPECULAR +void setSpecular(inout czm_modelMaterial material, in float metalness) { -#ifdef CUSTOM_SPECULAR_IBL -float lod = roughness * model_specularEnvironmentMapsMaximumLOD; -return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; +#ifdef HAS_SPECULAR_TEXTURE +vec2 specularTexCoords = TEXCOORD_SPECULAR; +#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM +specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); +#endif +float specularWeight = texture(u_specularTexture, specularTexCoords).a; +#ifdef HAS_SPECULAR_FACTOR +specularWeight *= u_specularFactor; +#endif #else -float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; -return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; +#ifdef HAS_SPECULAR_FACTOR +float specularWeight = u_specularFactor; +#else +float specularWeight = 1.0; +#endif +#endif +#ifdef HAS_SPECULAR_COLOR_TEXTURE +vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; +#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM +specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); +#endif +vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; +vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); +#ifdef HAS_SPECULAR_COLOR_FACTOR +specularColorFactor *= u_specularColorFactor; +#endif +#else +#ifdef HAS_SPECULAR_COLOR_FACTOR +vec3 specularColorFactor = u_specularColorFactor; +#else +vec3 specularColorFactor = vec3(1.0); +#endif #endif +material.specularWeight = specularWeight; +vec3 f0 = material.specular; +vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); +material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); } -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +#endif +#ifdef USE_ANISOTROPY +void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) { -vec3 f90 = max(vec3(1.0 - roughness), f0); -vec3 F = fresnelSchlick2(f0, f90, NdotV); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); -return specularSample * (F * brdfLut.x + brdfLut.y); +mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); +float anisotropyStrength = u_anisotropy.z; +vec2 direction = vec2(1.0, 0.0); +#ifdef HAS_ANISOTROPY_TEXTURE +vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; +#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM +anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); +#endif +vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; +direction = anisotropySample.rg * 2.0 - vec2(1.0); +anisotropyStrength *= anisotropySample.b; +#endif +direction = rotation * direction; +mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); +vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); +vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); +material.anisotropicT = anisotropicT; +material.anisotropicB = anisotropicB; +material.anisotropyStrength = anisotropyStrength; } #endif -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { -vec3 f0 = material.specular; -float roughness = material.roughness; -float specularWeight = 1.0; -#ifdef USE_SPECULAR -specularWeight = material.specularWeight; +#ifdef USE_CLEARCOAT +void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +{ +#ifdef HAS_CLEARCOAT_TEXTURE +vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; +#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM +clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); +#endif +float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; +#ifdef HAS_CLEARCOAT_FACTOR +clearcoatFactor *= u_clearcoatFactor; #endif -float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); -vec3 f90 = max(vec3(1.0 - roughness), f0); -vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); -#ifdef DIFFUSE_IBL -vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); -vec3 irradiance = sampleDiffuseEnvironment(normalMC); -vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; -float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); -vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); -vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; -vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; #else -vec3 diffuseContribution = vec3(0.0); +#ifdef HAS_CLEARCOAT_FACTOR +float clearcoatFactor = u_clearcoatFactor; +#else +float clearcoatFactor = 0.0; +#endif +#endif +#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE +vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; +#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM +clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); +#endif +float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; +#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR +clearcoatRoughness *= u_clearcoatRoughnessFactor; #endif -#ifdef USE_ANISOTROPY -vec3 anisotropyDirection = material.anisotropicB; -vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); -vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); -float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); -float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; -vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); -vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); #else -vec3 reflectEC = reflect(-viewDirectionEC, normalEC); +#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR +float clearcoatRoughness = u_clearcoatRoughnessFactor; +#else +float clearcoatRoughness = 0.0; #endif -#ifdef SPECULAR_IBL -vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); -vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); -vec3 specularContribution = radiance * FssEss * model_iblFactor.y; +#endif +material.clearcoatFactor = clearcoatFactor; +material.clearcoatRoughness = clearcoatRoughness; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); #else -vec3 specularContribution = vec3(0.0); +material.clearcoatNormal = attributes.normalEC; #endif -return diffuseContribution + specularContribution; } #endif -`;var tye={name:"ImageBasedLightingPipelineStage"},ket=new k;tye.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,fe.FRAGMENT),r.addUniform("vec2","model_iblFactor",fe.FRAGMENT),sf.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",fe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,fe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,fe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,fe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",fe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,fe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,fe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,fe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",fe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",fe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,fe.FRAGMENT)),r.addFragmentLines($F);let c={model_iblFactor:function(){return k.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,ket)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=It(c,e.uniformMap)};var eI=tye;var hOn=x(T(),1);var aOn=x(T(),1);var Uet=W.EPSILON16;function H7(e){e=e??B.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(H7.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,Uet)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Det=new h,z7=new q;H7.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Det,o;switch(t){case ul.XROTATE:o=q.fromRotationX(W.toRadians(n),z7),e=P.multiplyByMatrix3(e,o,e);break;case ul.YROTATE:o=q.fromRotationY(W.toRadians(n),z7),e=P.multiplyByMatrix3(e,o,e);break;case ul.ZROTATE:o=q.fromRotationZ(W.toRadians(n),z7),e=P.multiplyByMatrix3(e,o,e);break;case ul.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case ul.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case ul.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=P.multiplyByTranslation(e,i,e);break;case ul.XSCALE:i.x=n,i.y=1,i.z=1,e=P.multiplyByScale(e,i,e);break;case ul.YSCALE:i.x=1,i.y=n,i.z=1,e=P.multiplyByScale(e,i,e);break;case ul.ZSCALE:i.x=1,i.y=1,i.z=n,e=P.multiplyByScale(e,i,e);break;case ul.UNIFORMSCALE:e=P.multiplyByUniformScale(e,n,e);break;default:break}return e};var tI=H7;function gB(e){e=e??B.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,Oet(this)}Object.defineProperties(gB.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 Oet(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new tI({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}gB.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Bet=new P,zet=new P;gB.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=P.clone(P.IDENTITY,Bet),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=P.multiplyTransformation(s.originalTransform,e,zet);s.transform=a}};var nI=gB;var SOn=x(T(),1);var pOn=x(T(),1),iI=`void modelColorStage(inout czm_modelMaterial material) +#endif +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) { -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 VC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};VC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,fe.FRAGMENT),i.addFragmentLines(iI);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=Le.TRANSLUCENT),i.addUniform("vec4",VC.COLOR_UNIFORM_NAME,fe.FRAGMENT),o[VC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",VC.COLOR_BLEND_UNIFORM_NAME,fe.FRAGMENT),o[VC.COLOR_BLEND_UNIFORM_NAME]=function(){return dl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=It(o,e.uniformMap)};var fx=VC;var FOn=x(T(),1);var ROn=x(T(),1),oI=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( -highp sampler2D packedClippingPlanes, -int clippingPlaneNumber, -mat4 transform -) { -int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; -int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); -float u = (float(pixX) + 0.5) * pixelWidth; -float v = (float(pixY) + 0.5) * pixelHeight; -vec4 plane = texture(packedClippingPlanes, vec2(u, v)); -return czm_transformPlane(plane, transform); -} -#else -vec4 getClippingPlane( -highp sampler2D packedClippingPlanes, -int clippingPlaneNumber, -mat4 transform -) { -int clippingPlaneStartIndex = clippingPlaneNumber * 2; -int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; -int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); -float u = (float(pixX) + 0.5) * pixelWidth; -float v = (float(pixY) + 0.5) * pixelHeight; -vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; -vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); -vec4 plane; -plane.xyz = czm_octDecode(oct, 65535.0); -plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); -return czm_transformPlane(plane, transform); -} +#ifdef USE_ANISOTROPY +NormalInfo normalInfo = getNormalInfo(attributes); +material.normalEC = normalInfo.normal; +#elif defined(HAS_NORMALS) +material.normalEC = computeNormal(attributes); +#endif +vec4 baseColorWithAlpha = vec4(1.0); +#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) +vec4 color = attributes.color_0; +#ifdef HAS_SRGB_COLOR +color = czm_srgbToLinear(color); +#endif +baseColorWithAlpha *= color; +#endif +#ifdef USE_CPU_STYLING +baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); +#endif +material.baseColor = baseColorWithAlpha; +material.diffuse = baseColorWithAlpha.rgb; +material.alpha = baseColorWithAlpha.a; +#ifdef HAS_OCCLUSION_TEXTURE +vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; +#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM +occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -vec4 position = czm_windowToEyeCoordinates(fragCoord); -vec3 clipNormal = vec3(0.0); -vec3 clipPosition = vec3(0.0); -float pixelWidth = czm_metersPerPixel(position); -#ifdef UNION_CLIPPING_REGIONS -float clipAmount; -#else -float clipAmount = 0.0; -bool clipped = true; +material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; +#endif +#ifdef HAS_EMISSIVE_TEXTURE +material.emissive = getEmissiveFromTexture(); +#elif defined(HAS_EMISSIVE_FACTOR) +material.emissive = u_emissiveFactor; +#endif +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +setSpecularGlossiness(material); +#elif defined(LIGHTING_PBR) +float metalness = setMetallicRoughness(material); +#ifdef USE_SPECULAR +setSpecular(material, metalness); +#endif +#ifdef USE_ANISOTROPY +setAnisotropy(material, normalInfo); +#endif +#ifdef USE_CLEARCOAT +setClearcoat(material, attributes); #endif -for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { -vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); -clipNormal = clippingPlane.xyz; -clipPosition = -clippingPlane.w * clipNormal; -float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; -#ifdef UNION_CLIPPING_REGIONS -clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); -if (amount <= 0.0) { -discard; -} -#else -clipAmount = max(amount, clipAmount); -clipped = clipped && (amount <= 0.0); #endif } -#ifndef UNION_CLIPPING_REGIONS -if (clipped) { -discard; -} +`;var v$n=x(T(),1),ZP=`#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 -return clipAmount; +`;var I$n=x(T(),1),RP=`#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); } -void modelClippingPlanesStage(inout vec4 color) -{ -float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; -if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { -color = clippingPlanesEdgeColor; +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); } -`;var nye={name:"ModelClippingPlanesPipelineStage"},Het=new k,Ket=new P,Jet=new P;nye.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),xs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,fe.FRAGMENT);let s=xs.getTextureResolution(i,o,Het);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(oI);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,Ket);return P.multiply(c,t._clippingPlanesMatrix,Jet)}};e.uniformMap=It(a,e.uniformMap)};var rI=nye;var JOn=x(T(),1);var POn=x(T(),1),sI=`void modelClippingPolygonsStage() -{ -bool insideAny = vectorClip(v_clippingUv); -#ifdef CLIPPING_INVERSE -if (!insideAny) -{ -discard; +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); } -#else -if (insideAny) +#endif +`;var{Material:Iit,MetallicRoughness:O7,SpecularGlossiness:B7,Specular:Bye,Clearcoat:zye}=Vn,Hye={name:"MaterialPipelineStage",_processTexture:Dd,_processTextureTransform:Kye};Hye.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;Mit(i,r,s,d,u,m,c,e),l(i.specularGlossiness)?wit(i.specularGlossiness,r,s,d,c,e):(l(i.specular)&&Zt.supportedExtensions.KHR_materials_specular&&kit(i.specular,r,s,d,c),l(i.anisotropy)&&Zt.supportedExtensions.KHR_materials_anisotropy&&Dit(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Zt.supportedExtensions.KHR_materials_clearcoat&&Oit(i.clearcoat,r,s,d,c),Bit(i.metallicRoughness,r,s,d,c,e));let p=Zt.getAttributeBySemantic(t,dt.NORMAL),b=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading;l(i.planarFill)&&Pit(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===Mp.BLEND?S.pass=Le.TRANSLUCENT:i.alphaMode===Mp.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)&&Nit(i.lineStyle,t,n,r,s),s.addFragmentLines(SP),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,fe.BOTH)};function Pit(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 Xit(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(RP);let d=ZP.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 Nit(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) { -discard; -} + float cumDist = attributes.${d}; +#ifdef LINE_CUM_DIST_NORMALIZED + cumDist *= u_cumulativeDistanceMax; #endif + const float textureCoordinateBase = 8192.0; + v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; } -`;var NOn=x(T(),1),aI=`void modelClippingPolygonsStage() +#endif +`)}else l(s)&&o.addVertexLines(` +#ifdef HAS_LINE_PATTERN +void lineStyleStageVS(in ProcessedAttributes attributes) { -vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; -v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; + 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; + } } -`;var MOn=x(T(),1),Mb=`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 +`)}function Kye(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 Yit(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 Dd(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)&&Kye(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&Yit(e,t,n,i,o),Xit(e,t,n,i,o,s)}function Mit(e,t,n,i,o,r,s,a){let{emissiveFactor:c,emissiveTexture:d,normalTexture:u,occlusionTexture:m}=e;l(c)&&!h.equals(c,Iit.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&&Dd(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),Dd(n,t,b,"u_normalTexture","NORMAL",o,a)}l(m)&&!s&&Dd(n,t,m,"u_occlusionTexture","OCCLUSION",i)}function wit(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&&Dd(n,t,s,"u_diffuseTexture","DIFFUSE",i,r),l(a)&&!ce.equals(a,B7.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&&Dd(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(d)&&!h.equals(d,B7.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!==B7.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 kit(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&&Dd(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Bye.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&&Dd(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,Bye.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 Uit=new h;function Dit(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,fe.FRAGMENT),l(a)&&!o&&Dd(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,Uit)}}function Oit(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!==zye.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&&Dd(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==zye.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&&Dd(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Dd(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Bit(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,fe.FRAGMENT);let s=e.baseColorTexture;l(s)&&!o&&Dd(n,t,s,"u_baseColorTexture","BASE_COLOR",i,r);let a=e.baseColorFactor;l(a)&&!ce.equals(a,O7.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&&Dd(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let d=e.metallicFactor;l(d)&&d!==O7.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!==O7.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 CP=Hye;var nei=x(T(),1);var td={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"};td.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(td.METADATA_PICKING_VALUE_TYPE,"float",fe.FRAGMENT),i.addDefine(td.METADATA_PICKING_VALUE_STRING,"0.0",fe.FRAGMENT),i.addDefine(td.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",fe.FRAGMENT),i.addDefine(td.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",fe.FRAGMENT),i.addDefine(td.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",fe.FRAGMENT),i.addDefine(td.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",[`${td.METADATA_PICKING_VALUE_TYPE} value = ${td.METADATA_PICKING_VALUE_TYPE}(${td.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${td.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${td.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${td.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${td.METADATA_PICKING_VALUE_COMPONENT_W};`],fe.FRAGMENT)};var Xu=td;var mei=x(T(),1);var oei=x(T(),1),VP=`void morphTargetsStage(inout ProcessedAttributes attributes) +{ +vec3 positionMC = attributes.positionMC; +attributes.positionMC = getMorphedPosition(positionMC); +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = getMorphedNormal(normalMC); #endif -#ifdef HAS_VECTOR_POLYGONS -uniform highp sampler2D u_vectorPolygonEdgeTexture; -uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture; -uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture; +#ifdef HAS_TANGENTS +vec3 tangentMC = attributes.tangentMC; +attributes.tangentMC = getMorphedTangent(tangentMC); #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); +`;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),Qit(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||(Hit(e,m,e.attributeIndex,a),e.attributeIndex++)}}qit(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,fe.VERTEX),n.addVertexLines(VP);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=It(s,e.uniformMap)};var zit={attributeString:void 0,functionId:void 0};function Hit(e,t,n,i){let o=e.shaderBuilder;Kit(e,t,n);let r=Jit(t,zit);jit(o,r,i)}function Kit(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 Jit(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 jit(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 Qit(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 qit(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 EP=Ic;var Sei=x(T(),1);var Jye={name:"PickingPipelineStage"};function z7(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}Jye.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)$it(e,t,a,i);else if(l(a))eot(e,i);else{let c=jye(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=z7(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function jye(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 $it(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=z7(e.pickId)}function eot(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=jye(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=z7(e.pickId)}var AP=Jye;var Oei=x(T(),1);var Rei=x(T(),1),Qye={ADD:0,REPLACE:1};Object.freeze(Qye);var xr=Qye;var Vei=x(T(),1),GP=`float getPointSizeFromAttenuation(vec3 positionEC) { +float pointSize = model_pointCloudParameters.x; +float geometricError = model_pointCloudParameters.y; +float depthMultiplier = model_pointCloudParameters.z; +float depth = -positionEC.z; +return min((geometricError / depth) * depthMultiplier, pointSize); } -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 HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); } -#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; +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); } -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; -} +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); } -if (nearestEdgeDistance > vectorCoverageRadius) -{ -return baseColor; +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +return getPointSizeFromAttenuation(v_positionEC); } -#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); +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { +#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) +return step(-v_normalEC.z, 0.0); #else -return baseColor; +return 1.0; #endif } -vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize) -{ -if (!inside || primitiveIndex < 0) -{ -return baseColor; +#endif +`;var tot=new ce,$ye={name:"PointCloudStylingPipelineStage"};$ye.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=rot(a),_=sot(r,y);aot(i,_);let Z=cot(_).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(GP);let f=e.uniformMap;f.model_pointCloudParameters=function(){let y=tot,_=1;p&&(_=b?5:m.tileset.memoryAdjustedScreenSpaceError),y.x=u.maximumAttenuation??_,y.x*=n.pixelRatio;let S=not(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 qye=new h;function not(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,qye);a=P.multiplyByPointAsVector(s,a,qye);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var iot={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},oot={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function rot(e){let t=$e(oot);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 H7="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function sot(e,t){let n=iot,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${H7})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${H7})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${H7})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function aot(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 K7(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 cot(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&K7(t,o),l(n)&&K7(n,o),l(i)&&K7(i,o),o}var LP=$ye;var tti=x(T(),1);var zei=x(T(),1),WP=`void primitiveOutlineStage() { +v_outlineCoordinates = a_outlineCoordinates; } -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); +`;var Kei=x(T(),1),vP=`void primitiveOutlineStage(inout czm_modelMaterial material) { +if (!model_showOutline) { +return; } -bool vectorEdgeCrossesRay(vec4 edge, vec2 p) -{ -if ((edge.y > p.y) == (edge.w > p.y)) +float outlineX = +texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; +float outlineY = +texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; +float outlineZ = +texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; +float outlineness = max(outlineX, max(outlineY, outlineZ)); +material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} +`;var exe={name:"PrimitiveOutlinePipelineStage"};exe.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=aS.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(WP),i.addFragmentLines(vP)};var FP=exe;var ati=x(T(),1);var txe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:nxe,_count2DPositions:ixe,_countMorphTargetAttributes:oxe,_countMaterialTextures:rxe,_countFeatureIdTextures:sxe,_countBinaryMetadata:axe};txe.process=function(e,t,n){let i=e.model,o=i.statistics;nxe(o,t),ixe(o,e.runtimePrimitive),oxe(o,t),rxe(o,t.material),sxe(o,t.featureIds),axe(o,i)};function nxe(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+=lot(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 lot(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 ixe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function oxe(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 rxe(e,t){let n=dot(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 dot(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 sxe(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 axe(e,t){let n=t.structuralMetadata;l(n)&&(uot(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 uot(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 IP=txe;var Sti=x(T(),1);var mot=new P,hot=new P,cxe={name:"SceneMode2DPipelineStage"};cxe.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,mot),d=bot(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=xot(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,hot)}};e.uniformMap=It(f,e.uniformMap)};var fot=new h,pot=new h;function bot(e,t,n){let i=P.multiplyByPoint(t,e.positionMin,fot),o=fo.computeActualEllipsoidPosition(n,i,i),r=P.multiplyByPoint(t,e.positionMax,pot),s=fo.computeActualEllipsoidPosition(n,r,r);return me.fromCornerPoints(o,s,new me)}var lxe=new h;function got(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,lxe),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 yot(e,t,n,i){let o;l(e.quantization)?o=got(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,lxe);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 xot(e,t,n,i){let o=$e(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=yot(e,t,r,o),a=ot.createVertexBuffer({context:i.context,typedArray:s,usage:Pe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var PP=cxe;var Lti=x(T(),1);var Rti=x(T(),1),XP=`void skinningStage(inout ProcessedAttributes attributes) { -return false; +mat4 skinningMatrix = getSkinningMatrix(); +mat3 skinningMatrixMat3 = mat3(skinningMatrix); +vec4 positionMC = vec4(attributes.positionMC, 1.0); +attributes.positionMC = vec3(skinningMatrix * positionMC); +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = skinningMatrixMat3 * normalMC; +#endif +#ifdef HAS_TANGENTS +vec3 tangentMC = attributes.tangentMC; +attributes.tangentMC = skinningMatrixMat3 * tangentMC; +#endif } -float t = (p.y - edge.y) / (edge.w - edge.y); -float xIntersect = edge.x + t * (edge.z - edge.x); -return p.x < xIntersect; +`;var pS={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};pS.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,fe.VERTEX),_ot(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,fe.VERTEX),n.addVertexLines(XP);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=It(r,e.uniformMap)};function Tot(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 _ot(e,t){e.addFunction(pS.FUNCTION_ID_GET_SKINNING_MATRIX,pS.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,fe.VERTEX),e.addFunctionLines(pS.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=Tot(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(pS.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(pS.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var NP=pS;var Nti=x(T(),1);var vti=x(T(),1),YP=`void verticalExaggerationStage( +inout ProcessedAttributes attributes +) { +vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); +vec2 vertexAzimuth = normalize(vertexPositionENU.xy); +float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); +float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; +vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; +vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; +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, vertexEllipsoidNormalEC); +float smallAngleVersine = 0.5 * sinTheta * sinTheta; +float versine = isSmallAngle ? smallAngleVersine : exactVersine; +float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; +float vertexHeight = czm_eyeHeight + dHeight; +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 * exaggerationDirectionScaledMC; } -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; +`;var dxe={name:"VerticalExaggerationPipelineStage"},Sot=new k;dxe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(YP),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,Sot)}};var MP=dxe;var $ti=x(T(),1);var Uti=x(T(),1);var J7={};function Zot(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 Rot(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 Cot(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 Vot(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 Eot(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 Aot(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}J7.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ie.TRIANGLES)return i?Rot(t,n):Zot(t);if(e===Ie.TRIANGLE_STRIP)return i?Vot(t,n):Cot(t);if(e===Ie.TRIANGLE_FAN)return i?Aot(t,n):Eot(t)};J7.getWireframeIndicesCount=function(e,t){return e===Ie.TRIANGLES?t*2:e===Ie.TRIANGLE_STRIP||e===Ie.TRIANGLE_FAN?2+(t-2)*4:t};var UC=J7;var uxe={name:"WireframePipelineStage"};uxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,fe.FRAGMENT);let o=e.model,r=Got(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=UC.getWireframeIndicesCount(a,c)};function Got(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=UC.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 wP=uxe;function mxe(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=[]}mxe.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!==Bb.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=Lot(o,i,n),N=l(o.classificationType);d&&t.push(PP),t.push(eP),Z&&t.push(wP),N&&t.push(FI),m&&t.push(EP),p&&t.push(NP),A&&t.push(LP),S&&t.push(BI),b&&(L?xt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(xP)),_&&t.push(CP),t.push(gx),t.push(wm),t.push(Xu),I.hasPropertyTable&&(t.push(xx),t.push(vI),t.push(XI)),u&&t.push(MP),f&&t.push(DI),t.push(_P),o.allowPicking&&t.push(AP),L&&t.push(FP),F&&(e.edgeVisibilityRequested=!0,t.push(jI),t.push(HI)),t.push(WI),t.push(IP)};function Lot(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 kP=mxe;var Nni=x(T(),1);function j7(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=[],Wot(this)}Object.defineProperties(j7.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 Wot(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=hxe(u,m,new P);a.push(p)}}function hxe(e,t,n){let i=P.multiplyTransformation(e.transformToRoot,e.transform,n);return n=P.multiplyTransformation(i,t,n),n}j7.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]=hxe(i,o,e[n])}};var UP=j7;var rii=x(T(),1);var Mni=x(T(),1);function vot(){this.pass=void 0,this.alphaCutoff=void 0}var bS=vot;var $ni=x(T(),1);var kni=x(T(),1);function Q7(e){this.name=e,this.fields=[]}Q7.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};Q7.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var DP=Q7;var Dni=x(T(),1);function q7(e){this.signature=e,this.body=[]}q7.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}`)};q7.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var OP=q7;function nd(){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(nd.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});nd.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)};nd.prototype.addStruct=function(e,t,n){this._structs[e]=new DP(t),fe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),fe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};nd.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};nd.prototype.addFunction=function(e,t,n){this._functions[e]=new OP(t),fe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),fe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};nd.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};nd.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)};nd.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};nd.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+=Iot(e),i};nd.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}`)};nd.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?ii(t,e):t.push(e)};nd.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?ii(t,e):t.push(e)};nd.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=Fot(this),i=Pot(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})};nd.prototype.clone=function(){return $e(this,!0)};function Fot(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 Iot(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Pot(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=nd;function Xot(e){this.shaderBuilder=new jb,this.model=e,this.uniformMap={},this.alphaOptions=new bS,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:rc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var BP=Xot;var bii=x(T(),1);var aii=x(T(),1),zP=`void silhouetteStage(inout vec4 color) { +if(model_silhouettePass) { +color = czm_gammaCorrect(model_silhouetteColor); } -if (vectorEdgeCrossesRay(edge, vectorUv)) -{ -inside = !inside; } +`;var lii=x(T(),1),HP=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +#ifdef HAS_NORMALS +if(model_silhouettePass) { +vec3 normal = normalize(czm_normal3D * attributes.normalMC); +normal.x *= czm_projection[0][0]; +normal.y *= czm_projection[1][1]; +positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; } -baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); -return baseColor; -#else -return baseColor; #endif } -vec4 vectorPickColorOver(vec4 surfacePickColor) -{ -if (vectorPickPrimitiveIndex < 0) +`;var fB={name:"ModelSilhouettePipelineStage"};fB.silhouettesLength=0;fB.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++fB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,fe.BOTH),i.addVertexLines(HP),i.addFragmentLines(zP),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 KP=fB;var Zii=x(T(),1);var yii=x(T(),1),JP=`void modelSplitterStage() { -return surfacePickColor; +#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 } -ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0); -return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0); +`;var pB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};pB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,fe.FRAGMENT),i.addFragmentLines(JP);let o={};i.addUniform("float",pB.SPLIT_DIRECTION_UNIFORM_NAME,fe.FRAGMENT),o[pB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=It(o,e.uniformMap)};var jP=pB;var Vii=x(T(),1);function Not(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 QP=Not;var Yii=x(T(),1);var Lii=x(T(),1);function Yot(e){e=e??B.EMPTY_OBJECT,this.lightingModel=e.lightingModel??zp.UNLIT}var qP=Yot;function Mot(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=me.fromCornerPoints(this.positionMin,this.positionMax,new me),this.lightingOptions=new qP,this.pickId=void 0,this.snapId=void 0}var $P=Mot;var koi=x(T(),1);var $ii=x(T(),1);function eq(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=[],Dot(this)}function wot(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 kot={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},Uot={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},bxe=[];function Dot(e){let t=e._command,n=bxe;if(e._useDebugWireframe){t.pass=Le.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=eX(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=$7(t,r),a=fxe(t,r);n.length=0,n.push(s,a),e._commandListTerrain=eX(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=pxe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Le.CESIUM_3D_TILE_CLASSIFICATION,s=$7(t,r),a=fxe(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=eX(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=pxe(e,n,e._commandList3DTilesPicking))}}function eX(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 $7(e,t){let n=lt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Le.TERRAIN_CLASSIFICATION?ni.ALWAYS:ni.EQUAL,o=wot(i);return n.renderState=ze.fromCache(o),n}function fxe(e,t){let n=lt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(kot),n}var Oot=[];function pxe(e,t,n){let i=ze.fromCache(Uot),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=Oot;return c.length=0,c.push(s,a),eX(e,c,n)}Object.defineProperties(eq.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=me.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});eq.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=$7(this._command,o),s=bxe;s.length=0,s.push(r),this._commandListIgnoreShow=eX(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 tX=eq;var _oi=x(T(),1);function DC(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=me.clone(t.boundingVolume),this._modelMatrix2D=new P,this._boundingVolume2D=new me,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,Bot(this)}function Um(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}Um.clone=function(e){return new Um({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Bot(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 Um({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Um({command:qot(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Um({command:rrt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Um({command:srt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Um({command:$ot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Um({command:ert(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 Um({command:gxe(t,r,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Um({command:gxe(t,r,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand),o.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Um({command:trt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(DC.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=me.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,Hot(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Kot(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Jot(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,jot(this))}}});function zot(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=me.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Hot(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 Kot(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 Jot(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 jot(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}}}DC.prototype.pushCommands=function(e,t){let n=bB(this,e);n&&!this._has2DCommands&&(Qot(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(zot(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),nrt(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}};DC.prototype.pushSilhouetteCommands=function(e,t){let n=bB(this,e);return Hp(t,this._silhouetteColorCommand,n),t};DC.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,o=bB(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};DC.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=bB(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 bB(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 Qb(e,t){if(!l(t))return;let n=Um.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 Qot(e){Qb(e,e._originalCommand),Qb(e,e._translucentCommand),Qb(e,e._skipLodBackfaceCommand),Qb(e,e._skipLodStencilCommand),Qb(e,e._silhouetteModelCommand),Qb(e,e._silhouetteColorCommand),Qb(e,e._edgeCommand),Qb(e,e._edgeSnapCommand),Qb(e,e._planarFillIdCommand)}function qot(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 $ot(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 ert(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 gxe(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 trt(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 nrt(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=irt(o);if(r!==s){let a=ort(r),c=$e(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function irt(e){return(e.renderState.stencilTest.reference&Jt.SKIP_LOD_MASK)>>>Jt.SKIP_LOD_BIT_SHIFT}function ort(e){return Jt.CESIUM_3D_TILE_MASK|e<<Jt.SKIP_LOD_BIT_SHIFT}function rrt(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 srt(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 nX=DC;var Zoi=x(T(),1),iX=`precision highp float; +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { +czm_modelVertexOutput vsOutput; +vsOutput.positionMC = positionMC; +vsOutput.pointSize = 1.0; +return vsOutput; } -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++) +void main() { -ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); -int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r); -if (primitiveIndex != currentPrimitive) +ProcessedAttributes attributes; +initializeAttributes(attributes); +#ifdef HAS_IMAGERY +initializeImageryAttributes(); +#endif +#ifdef USE_DEQUANTIZATION +dequantizationStage(attributes); +#endif +#ifdef HAS_MORPH_TARGETS +morphTargetsStage(attributes); +#endif +#ifdef HAS_SKINNING +skinningStage(attributes); +#endif +#ifdef HAS_PRIMITIVE_OUTLINE +primitiveOutlineStage(); +#endif +#ifdef HAS_BITANGENTS +attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); +#endif +FeatureIds featureIds; +featureIdStage(featureIds, attributes); +#ifdef HAS_SELECTED_FEATURE_ID +SelectedFeature feature; +selectedFeatureIdStage(feature, featureIds); +cpuStylingStage(attributes.positionMC, feature); +#endif +#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) +mat4 modelView = czm_modelView3D; +mat3 normal = czm_normal3D; +#else +mat4 modelView = czm_modelView; +mat3 normal = czm_normal; +#endif +#ifdef HAS_INSTANCING +#ifdef USE_LEGACY_INSTANCING +mat4 instanceModelView; +mat3 instanceModelViewInverseTranspose; +legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); +modelView = instanceModelView; +normal = instanceModelViewInverseTranspose; +#else +instancingStage(attributes); +#endif +#ifdef USE_PICKING +v_pickColor = a_pickColor; +#endif +#endif +Metadata metadata; +MetadataClass metadataClass; +MetadataStatistics metadataStatistics; +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); +#ifdef HAS_VERTICAL_EXAGGERATION +verticalExaggerationStage(attributes); +#endif +#ifdef HAS_CUSTOM_VERTEX_SHADER +czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); +customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); +#endif +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 HAS_VECTOR_LOOKUP +modelVectorLookupStage(attributes); +#endif +#ifdef HAS_SILHOUETTE +silhouetteStage(attributes, positionClip); +#endif +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float show = pointCloudShowStylingStage(attributes, metadata); +#else +float show = 1.0; +#endif +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +show *= pointCloudBackFaceCullingStage(); +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); +#endif +#ifdef PRIMITIVE_TYPE_POINTS +#ifdef HAS_CUSTOM_VERTEX_SHADER +gl_PointSize = vsOutput.pointSize; +#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) +gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); +#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 Coi=x(T(),1),oX=`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() { -if (inside) +czm_modelMaterial material; +material.diffuse = vec3(0.0); +material.specular = vec3(1.0); +material.roughness = 1.0; +material.occlusion = 1.0; +material.normalEC = vec3(0.0, 0.0, 1.0); +material.emissive = vec3(0.0); +material.alpha = 1.0; +return material; +} +vec4 handleAlpha(vec3 color, float alpha) { -return true; +#ifdef ALPHA_MODE_MASK +if (alpha < u_alphaCutoff) { +discard; } -currentPrimitive = primitiveIndex; -inside = false; +#endif +return vec4(color, alpha); } -vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0); -if (vectorEdgeCrossesRay(edge, uv)) +void lineStyleStage() { -inside = !inside; -} +#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; } -return inside; +#endif } -`;var oye={name:"ModelClippingPolygonsPipelineStage"},jet=new k,Qet=new k,iye=re.MAX_VALUE;oye.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(aI),o.addFragmentLines(Mb),o.addFragmentLines(sI);let r={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??iye,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,jet)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??iye;return k.fromElements(1/s.width,1/s.height,Qet)},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 cI=oye;var cBn=x(T(),1);var QOn=x(T(),1),lI=`void modelVectorLookupStage(ProcessedAttributes attributes) +SelectedFeature selectedFeature; +bool isEdge = false; +void main() { -vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; -v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; +#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER) +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +if (distanceToCenter > 0.5) { +discard; } -`;var $On=x(T(),1),dI=`void modelVectorLookupStage(inout vec4 color) +#endif +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +if (v_pointCloudShow == 0.0) { -color = vectorPolygonRender(v_vectorUv, color); -color = vectorPolylineRender(v_vectorUv, color); +discard; } -`;var qet={name:"ModelVectorLookupPipelineStage",process:ttt},$et=new k,ett=new k;function ttt(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(lI),i.addFragmentLines(Mb),i.addFragmentLines(dI);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,$et)},u_vectorRectangleInverseSize:function(){let u=t._vectorData?.rectangle??a;return k.fromElements(1/u.width,1/u.height,ett)},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 uI=qet;var uBn=x(T(),1);function rye(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(rye.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 mI=rye;var u3n=x(T(),1);var bBn=x(T(),1);var ntt=new h(1,1,1),itt=h.ZERO,ott=Ne.IDENTITY;function sye(e,t,n){this.translation=h.clone(e??itt),this.rotation=Ne.clone(t??ott),this.scale=h.clone(n??ntt)}sye.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 px=sye;var BBn=x(T(),1);var yBn=x(T(),1),hI=`mat4 getInstancingTransform() -{ -mat4 instancingTransform; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform = mat4( -a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, -a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, -a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, -a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 -); -#else -vec3 translation = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation = a_instanceTranslation; #endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; +#ifdef HAS_MODEL_SPLITTER +modelSplitterStage(); #endif -instancingTransform = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation.x, translation.y, translation.z, 1.0 -); +czm_modelMaterial material = defaultModelMaterial(); +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 instancingTransform; +return; } -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ -mat4 instancingTransform2D; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform2D = mat4( -a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, -a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, -a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, -a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 -); +#endif +Metadata metadata; +MetadataClass metadataClass; +MetadataStatistics metadataStatistics; +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); +#ifndef METADATA_PICKING_ENABLED +#ifdef HAS_SELECTED_FEATURE_ID +selectedFeatureIdStage(selectedFeature, featureIds); +#endif +#ifndef CUSTOM_SHADER_REPLACE_MATERIAL +materialStage(material, attributes, selectedFeature); +#endif +#ifdef HAS_CUSTOM_FRAGMENT_SHADER +customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); +#endif +lightingStage(material, attributes); +#ifdef HAS_SELECTED_FEATURE_ID +cpuStylingStage(material, selectedFeature); +#endif +#ifdef HAS_MODEL_COLOR +modelColorStage(material); +#endif +#ifdef HAS_PRIMITIVE_OUTLINE +primitiveOutlineStage(material); +#endif +vec4 color = handleAlpha(material.diffuse, material.alpha); #else -vec3 translation2D = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation2D = a_instanceTranslation2D; +vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); +metadataPickingStage(metadata, metadataClass, metadataValues); +vec4 color = metadataValues; #endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; +lineStyleStage(); +#ifdef HAS_CLIPPING_PLANES +modelClippingPlanesStage(color); #endif -instancingTransform2D = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation2D.x, translation2D.y, translation2D.z, 1.0 -); +#ifdef ENABLE_CLIPPING_POLYGONS +modelClippingPolygonsStage(); #endif -return instancingTransform2D; +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(color); +#endif +#ifndef METADATA_PICKING_ENABLED +#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) +silhouetteStage(color); +#endif +#ifdef HAS_ATMOSPHERE +atmosphereStage(color, attributes); +#endif +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStage(color, featureIds); +edgeDetectionStage(color, featureIds); +if (u_isEdgePass) { +isEdge = true; } #endif -`;var TBn=x(T(),1),fI=`void instancingStage(inout ProcessedAttributes attributes) +#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 { -vec3 positionMC = attributes.positionMC; -mat4 instancingTransform = getInstancingTransform(); -attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; +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 -#ifdef USE_2D_INSTANCING -mat4 instancingTransform2D = getInstancingTransform2D(); -attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +} +`;function yxe(){}yxe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=art(e,n,t),o=crt(e,i,t),r=e.model;return l(r.classificationType)?new tX({primitiveRenderResources:e,command:o}):new nX({primitiveRenderResources:e,command:o})};function art(e,t,n){t.addVertexLines(iX),t.addFragmentLines(oX);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function crt(e,t,n){let i=lrt(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=me.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 lrt(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var rX=yxe;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={},drt(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 drt(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;xxe(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 mI({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=Txe(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 UP({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 xxe(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 urt=new h;function mrt(e,t){let n=e._computedModelMatrix,i=P.getTranslation(n,urt);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=me.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Txe(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=Txe(e,m,p);i.push(b)}let s=new LI({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 kP({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 SI(u,s);u._nodesByName[d]=m}return c}var hrt=new h,frt=new h,prt=new h,brt=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 BP(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 QP(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 $P(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,hrt),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,frt);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=me.clone(u.boundingSphere,new me);let m=P.multiplyByPoint(a,u.positionMin,prt),p=P.multiplyByPoint(a,u.positionMax,brt);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=me.fromCornerPoints(n,i,new me),this._boundingSphere=me.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=me.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=me.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=rX.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(bx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(dI),n.isClippingEnabled()&&t.push(pI);let o=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&o&&t.push(yI),n.hasDrapedVectors()&&t.push(_I),n.hasSilhouette(e)&&t.push(KP),l(n.splitDirection)&&n.splitDirection!==wr.NONE&&t.push(jP),Or.is3DTiles(n.type)&&t.push(rI),i&&t.push(cI)};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){xxe(this,e),t.mode!==se.SCENE3D&&mrt(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 _xe(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);_xe(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 gB(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];_xe(e,c,t,n,i)}}var grt={backFaceCulling:void 0};dl.prototype.updateBackFaceCulling=function(e){let t=grt;t.backFaceCulling=e,gB(this,!1,yrt,t)};function yrt(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var xrt={shadowMode:void 0};dl.prototype.updateShadows=function(e){let t=xrt;t.shadowMode=e,gB(this,!1,Trt,t)};function Trt(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var _rt={debugShowBoundingVolume:void 0};dl.prototype.updateShowBoundingVolume=function(e){let t=_rt;t.debugShowBoundingVolume=e,gB(this,!1,Srt,t)};function Srt(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Sxe=[],Zxe=[],Rxe=[],Zrt={frameState:void 0,hasSilhouette:void 0};dl.prototype.pushDrawCommands=function(e){let t=Sxe;t.length=0;let n=Zxe;n.length=0;let i=Rxe;i.length=0;let o=Zrt;o.hasSilhouette=this._model.hasSilhouette(e),o.frameState=e,gB(this,!0,Rrt,o),ii(e.commandList,t),ii(e.commandList,n),ii(e.commandList,i)};function Rrt(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Sxe,s=Zxe,a=Rxe,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 sX=dl;var _ri=x(T(),1);function _x(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new wt}Object.defineProperties(_x.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}}});_x.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()};_x.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};_x.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};_x.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};_x.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};_x.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var aX=_x;var osi=x(T(),1);var Axe=x(nD(),1);var Iri=x(T(),1);var Cxe={},gS=Uint32Array.BYTES_PER_ELEMENT;Cxe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=gS;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+=gS,t+=gS;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=gS;let s=i.getUint32(t,!0);t+=gS;let a=i.getUint32(t,!0);t+=gS;let c=i.getUint32(t,!0);t+=gS;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 _=Vrt(b,m);if(_.rtcCenter=y,_.pointsLength=f,!_.hasPositions){let S=Ert(b);_.positions=S,_.hasPositions=_.hasPositions||l(S)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let S=Grt(b);_.normals=S,_.hasNormals=_.hasNormals||l(S)}if(!_.hasColors){let S=Art(b);_.colors=S,_.hasColors=_.hasColors||l(S),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(S)&&S.isTranslucent}if(!_.hasBatchIds){let S=Lrt(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),Crt(_),_};function Crt(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 Vrt(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 Ert(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 Art(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 Grt(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 Lrt(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 yS=Cxe;var Wrt=Vn.Components,vrt=Vn.Scene,Frt=Vn.Node,Irt=Vn.Primitive,Prt=Vn.Attribute,Vxe=Vn.Quantization,Xrt=Vn.FeatureIdAttribute,Nrt=Vn.Material,Yrt=Vn.MetallicRoughness,tq=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=yS.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=Mrt(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 Mrt(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Ab.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&wrt(e,i,r),Qrt(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 wrt(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:krt(d.componentsPerAttribute),componentType:Urt(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function krt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Urt(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 cX(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Vxe,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Vxe;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 Prt;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 Exe,yB;function Drt(e){if(!l(yB)){Exe=new Axe.default(0),yB=new Array(e);for(let t=0;t<e;++t)yB[t]=Exe.random()}return yB}var Ort=new h,Brt=new h,zrt=new h;function Hrt(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=Drt(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Ort),d=h.fromElements(a,a,a,Brt),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,zrt),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var Krt={name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:!1};function Jrt(e,t,n){let i=[],o,r=t.positions;return l(r)&&(Hrt(r),o=cX(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=cX(e,t.normals,n),o.count=t.pointsLength,i.push(o)),l(t.colors)?(o=cX(e,t.colors,n),o.count=t.pointsLength,i.push(o)):(o=cX(e,Krt,n),o.count=t.pointsLength,i.push(o)),l(t.batchIds)&&(o=cX(e,t.batchIds,n),o.count=t.pointsLength,i.push(o)),i}function jrt(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 Ma({schema:{},propertyTables:[]})}function Qrt(e,t){let n=e._parsedContent,i=new Yrt;i.metallicFactor=0,i.roughnessFactor=.9;let o=new Nrt;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Mp.BLEND);let s=!l(n.normals);o.unlit=s;let a=new Irt;if(a.attributes=Jrt(e,n,t),a.primitiveType=Ie.POINTS,a.material=o,l(n.batchIds)){let b=new Xrt;b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0",a.featureIds.push(b)}let c=new Frt;c.index=0,c.primitives=[a];let d=new vrt;d.nodes=[c],d.upAxis=Bi.Z,d.forwardAxis=Bi.X;let u=new Wrt;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=jrt(n,m),m.length>0&&qrt(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 qrt(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 lX=tq;var _si=x(T(),1);var xB=new h,Gxe=new h,Lxe=new h,dX=new h,$rt=new h,est=new h,tst=new pe,nst=new me;function TB(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 ist=32,nq=new Map,iq=[];function ost(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 M=v*N+X*g+Y*V;if(M<0||M>G)continue;let O=X*A-Y*E,w=Y*C-v*A,z=v*E-X*C,K=d*O+u*w+m*z;if(K<0||M+K>G)continue;D=(L*O+F*w+I*z)/G}else{if(Math.abs(G)<p)continue;let M=1/G,O=(v*N+X*g+Y*V)*M;if(O<0||O>1)continue;let w=X*A-Y*E,z=Y*C-v*A,K=v*E-X*C,te=(d*w+u*z+m*K)*M;if(te<0||O+te>1)continue;D=(L*w+F*z+I*K)*M}D>=0&&D<r&&(r=D)}return r}function OC(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=me.transform(d.boundingSphere,p,nst),C=xi.raySphere(t,R);if(!l(C))return}if(!l(u.indices))return;let b,f,y=Zt.getAttributeBySemantic(u,dt.POSITION),_=nq.get(u);l(_)||(_={},l(y)&&(_.vertices=xa.readAttributeAsTypedArray(y)),l(u.indices)&&(_.indices=xa.readIndicesAsTypedArray(u.indices)),nq.set(u,_),iq.push(u),iq.length>ist&&nq.delete(iq.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++)TB(b,I,f,xB),P.multiplyByPoint(R,xB,dX),F[I*3]=dX.x,F[I*3+1]=dX.y,F[I*3+2]=dX.z;_.world=F,_.worldTransform=P.clone(R,_.worldTransform)}let C=_.world,E=e.backFaceCulling??!0,A=ost(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];TB(b,C,f,xB),TB(b,E,f,Gxe),TB(b,A,f,Lxe);for(let L of m){let F=P.multiplyByPoint(L.transform,xB,dX),I=P.multiplyByPoint(L.transform,Gxe,$rt),N=P.multiplyByPoint(L.transform,Lxe,est);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=xi.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,tst);u.cartographicToCartesian(m,s)}return s}}var Lsi=x(T(),1);var Zsi=x(T(),1),oq=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}},uX=oq;var rq=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 fS(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 uX(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},mX=rq;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 nI(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 me,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,Fxe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new re,this._modelImagery=new mX(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new w_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Ib(e.environmentMapOptions);Ib.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??wr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new aX,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 sq(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function rst(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 oI({model:e,propertyTable:s});n.push(a)}return n}function sst(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 lq(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){lq(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=lq(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 Pxe(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"),Fxe(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&&(Ib.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 ast=new P,cst=new q,lst=new P;Vo.prototype.update=function(e){let t=!1;try{t=dst(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")sq(this,i);else{let o=Zt.getError("model",this._resource,i);sq(this,o)}}if(ust(this,e),mst(this,e),hst(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."));sq(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&rst(this,o);let r=new sX({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(fst(this),pst(this),bst(this,e),gst(this),yst(this,e),xst(this,e),Tst(this,e),_st(this,e),Rst(this,e),Cst(this,e),Vst(this,e),Est(this,e),this._defaultTexture=e.context.defaultTexture,Ast(this,e),Lst(this,e),Fst(this),Ist(this,e),Yst(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)),Xst(this),Mst(this,e),wst(this),Ust(this,e)}};function dst(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function ust(e,t){l(e._customShader)&&e._customShader.update(t)}function mst(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 hst(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function fst(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=sst(t,e),e._styleDirty=!0,e.resetDrawCommands())}function pst(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function bst(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&&vxe(e)}function vxe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=df.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function gst(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 yst(e,t){e._silhouetteDirty&&(Nxe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function xst(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Tst(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 Fxe(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 _st(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 Sst=new re;function Ixe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function Zst(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function Rst(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,Sst);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 Ixe(e);let o=Zst(e._vectorData);o!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=o)}function Cst(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Vst(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Est(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 Ast(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Gst(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function dq(e,t){if(!l(e)||!l(t))return P.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function Lst(e,t){Gst(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=dq(e.modelMatrix,e._modelMatrix))}var Sx=new h,aq=new pe,Wst=new pe,vst=200,Wxe=30;function Fst(e){let t=e.heightReference!==He.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=Wxe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===He.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ne.default,o=e.modelMatrix;Sx.x=o[12],Sx.y=o[13],Sx.z=o[14];let r=i.cartesianToCartographic(Sx,Wst);l(e._clampedModelMatrix)||(e._clampedModelMatrix=P.clone(o,new P));let s=n.frameState.frameNumber,a=e.heightReference===He.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Wxe,d=a&&l(e._lastSurfaceHeight)&&r.height>e._lastSurfaceHeight+vst,u=d&&c,m=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||d)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=pe.clone(r),_=Kst(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,S=>{let Z=n.getHeight(y,e.heightReference);l(Z)&&(S.height=Z,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=S.height,_(S)},e.heightReference)}let f;u||m?f=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,f=n.getHeight(r,e.heightReference),e._lastSurfaceQueryMissed=!l(f),l(f)?e._lastSurfaceHeight=f:f=e._lastSurfaceHeight),l(f)?(pe.clone(r,aq),aq.height=f,Xxe(e,i,r,aq)):dq(o,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function Ist(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Pxe(e,n),Pst(e,n,t)}function Pxe(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=me.transform(e._boundingSphere,t,e._boundingSphere)}function Pst(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,Sx),e._sceneMode!==se.SCENE3D&&fo.computeActualEllipsoidPosition(n,Sx,Sx);let s=e._boundingSphere.radius,a=Dst(Sx,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 Xst(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 Nst=new q(1,0,0,0,0,1,0,-1,0);function Yst(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=cst,s=ast;if(s=P.multiply(o.uniformState.view3D,i,s),r=P.getRotation(s,r),r=q.transpose(r,r),e._iblReferenceFrameMatrix=q.multiply(Nst,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=P.multiply(i,e._clippingPlanes.modelMatrix,lst);e._clippingPlanesMatrix=P.inverseTranspose(a,e._clippingPlanesMatrix)}}function Mst(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 wst(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 kst(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Ust(e,t){let n=jst(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o)&&!kst(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Qst(e,t),e._sceneGraph.pushDrawCommands(t))}var cq=new me;function Dst(e,t,n){return cq.center=e,cq.radius=t,n.camera.getPixelSize(cq,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var _B=new h,Ost=new h,SB=new h,Bst=new h,zst=new P;function Hst(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,Bst),a=P.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,zst),c=e.scale,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,Ost);h.multiplyByScalar(p,c,p),P.multiplyByPoint(a,p,SB),P.multiplyByPointAsVector(d,SB,SB);let b=h.dot(SB,s);b<u&&(u=b)}return-u}function Xxe(e,t,n,i){if(e.heightReference===He.CLIP_TO_GROUND){let r=i.height+Hst(e,t,i);e._heightAboveSurface=Math.max(0,n.height-r),i.height=Math.max(n.height,r)}else vy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,_B);let o=e._clampedModelMatrix;dq(e.modelMatrix,o),o[12]=_B.x,o[13]=_B.y,o[14]=_B.z,e._heightDirty=!0}function Kst(e,t,n){return function(i){Xxe(e,t,n,i)}}var Jst=new h;function jst(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,Jst);fo.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Qst(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 Nxe(e){return e.context.stencilBuffer}Vo.prototype.hasSilhouette=function(e){return Nxe(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 OC(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(),Ixe(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,ue(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=hX(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 HF(t);try{await n.load();let i=hX(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 lX(t);try{await n.load();let i=hX(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 jF(t);try{await n.load();let i=hX(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 KF(t),i=hX(n,Or.TILE_GEOJSON,e);return new Vo(i)};var qst=new U;Vo.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,qst),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,lq(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),vxe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function hX(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 uq=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:Md.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=fX(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=fX(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=fX(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=fX(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=fX(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 fX(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=uq;var Pai=x(T(),1);var mq=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 ue(this)}},pX=mq;var rfi=x(T(),1);var dmi=x(T(),1);var Wli=x(T(),1);var Oai=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)}hq(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 $st=[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]=$st[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=eat(this,i)||t;if(t||!l(this.va)){hq(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 eat(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)tat(n[i],e,t)};function tat(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 hq(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 hq(this),ue(this)};var qb=Ua;var zai=x(T(),1),bX=`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; +flat in vec2 v_splitDirectionAndEllipsoidDepthEC; +#ifdef SDF +in vec4 v_outlineColor; +in float v_outlineWidth; #endif +in vec4 v_compressed; +const float SHIFT_LEFT1 = 2.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; +float getGlobeDepthAtCoords(vec2 st) +{ +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); +if (logDepthOrDepth == 0.0) +{ +return 0.0; } -`;var SBn=x(T(),1),pI=`void legacyInstancingStage( -inout ProcessedAttributes attributes, -out mat4 instanceModelView, -out mat3 instanceModelViewInverseTranspose) +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +return eyeCoordinate.z / eyeCoordinate.w; +} +#ifdef SDF +float getDistance(vec2 position) { -vec3 positionMC = attributes.positionMC; -mat4 instancingTransform = getInstancingTransform(); -mat4 instanceModel = instancingTransform * u_instance_nodeTransform; -instanceModelView = u_instance_modifiedModelView; -instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); -attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; -#ifdef USE_2D_INSTANCING -mat4 instancingTransform2D = getInstancingTransform2D(); -attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; -#endif +return texture(u_atlas, position).r; } -`;var yB=new P,rtt=new P,stt=new P,cye={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:hye,_transformsToTypedArray:J7};cye.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(hI);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==se.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,m=[];_tt(e,n,i,m,d,u),Rtt(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,fe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",fe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",fe.VERTEX),p.u_instance_modifiedModelView=function(){let b=P.multiplyTransformation(s.modelMatrix,a.components.transform,yB);return d?P.multiplyTransformation(n.context.uniformState.view3D,b,yB):(n.mode!==se.SCENE3D&&(b=_t.basisTo2D(n.mapProjection,b,yB)),P.multiplyTransformation(n.context.uniformState.view,b,yB))},p.u_instance_nodeTransform=function(){return P.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,rtt)},r.addVertexLines(pI)):r.addVertexLines(fI),d){r.addDefine("USE_2D_INSTANCING",void 0,fe.VERTEX),r.addUniform("mat4","u_modelView2D",fe.VERTEX);let b=n.context,f=P.fromTranslation(c.instancingReferencePoint2D,new P);p.u_modelView2D=function(){return P.multiplyTransformation(b.uniformState.view,f,stt)}}e.uniformMap=It(p,e.uniformMap),e.instanceCount=o,ti(e.attributes,m)};var bI=new P,att=new h;function ctt(e,t,n,i,o){let r=P.multiplyTransformation(t,e,bI);return r=P.multiplyTransformation(r,n,bI),o=_t.basisTo2D(i.mapProjection,r,o),o}function ltt(e,t,n,i,o){let r=P.fromTranslation(e,bI),s=P.multiplyTransformation(t,r,bI);s=P.multiplyTransformation(s,n,bI);let a=P.getTranslation(s,att);return o=ho.computeActualEllipsoidPosition(i,a,o),o}function lye(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(P.multiplyTransformation(i.modelMatrix,o.components.transform,t),P.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=P.clone(o.computedModelMatrix,t),P.multiplyTransformation(t,e.runtimeNode.computedTransform,t),P.clone(P.IDENTITY,n))}var dye=new P,uye=new P,dtt=new P,utt=new h;function mtt(e,t,n,i){let o=dye,r=uye;lye(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=ctt(u,o,r,n,dtt),p=P.getTranslation(m,utt),b=h.subtract(p,a,p);i[d]=P.setTranslation(m,b,i[d])}return i}function htt(e,t,n,i){let o=dye,r=uye;lye(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=ltt(u,o,r,n,u);i[d]=h.subtract(m,a,i[d])}return i}var ftt=new h,ptt=new h;function mye(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=P.multiplyByPoint(i,n.instancingTranslationMin,ftt),r=ho.computeActualEllipsoidPosition(t,o,o),s=P.multiplyByPoint(i,n.instancingTranslationMax,ptt),a=ho.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function J7(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 btt(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 gtt=new h,ytt=new Ne,xtt=new h;function hye(e,t,n){let i=new Array(t),o=Zt.getAttributeBySemantic(e,Xr.TRANSLATION),r=Zt.getAttributeBySemantic(e,Xr.ROTATION),s=Zt.getAttributeBySemantic(e,Xr.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),d=l(o),u=l(r),m=l(s),p=d?o.typedArray:new Float32Array(t*3),b=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(b=dn.dequantize(b,r.componentDatatype,r.type,t));let f;m?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let _=0;_<t;_++){let S=new h(p[_*3],p[_*3+1],p[_*3+2],gtt);h.maximumByComponent(a,S,a),h.minimumByComponent(c,S,c);let Z=new Ne(b[_*4],b[_*4+1],b[_*4+2],u?b[_*4+3]:1,ytt),R=new h(f[_*3],f[_*3+1],f[_*3+2],xtt),C=P.fromTranslationQuaternionRotationScale(S,Z,R,new P);i[_]=C}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),m&&(s.typedArray=void 0),i}function Ttt(e,t,n){let i=new Array(t),o=e.typedArray,r=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 d=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=d,h.minimumByComponent(r,d,r),h.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function j7(e,t){let n=it.createVertexBuffer({context:t.context,typedArray:e,usage:Pe.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function _tt(e,t,n,i,o,r){let s=Zt.getAttributeBySemantic(n,Xr.ROTATION);l(s)||r?Stt(e,n,i,t,o,r):Ztt(e,n,i,t,o)}function Stt(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",m,p=d.instancingTransformsBuffer;if(!l(p)){m=hye(t,a,e);let _=J7(m);p=j7(_,i),c._modelResources.push(p),r&&(d.transformsTypedArray=_),d.instancingTransformsBuffer=p}if(aye(e,p,n,u),!o)return;let b=$e(i);b.mode=se.COLUMBUS_VIEW,mye(e,b);let f=d.instancingTransformsBuffer2D;if(!l(f)){let _=mtt(m,e,b,m),S=J7(_);f=j7(S,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}aye(e,f,n,"Transform2D")}function Ztt(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=Zt.getAttributeBySemantic(t,Xr.TRANSLATION),d=Zt.getAttributeBySemantic(t,Xr.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),K7(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,m=c.typedArray;if(l(m)?u=Ttt(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),K7(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let b=$e(i);b.mode=se.COLUMBUS_VIEW,mye(e,b);let f=a.instancingTranslationBuffer2D;if(!l(f)){let Z=htt(u,e,b,u),R=btt(Z);r&&(a.transformsTypedArray=R),f=j7(R,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;K7(e,f,0,void 0,n,"Translation2D")}function aye(e,t,n,i){let r=J.getSizeInBytes(J.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),ti(n,a)}function K7(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function Rtt(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===Xr.FEATURE_ID&&(a.setIndex>=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 gI=cye;var QBn=x(T(),1);var fye=[],Q7={};Q7.name="ModelMatrixUpdateStage";Q7.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;pye(e,t,o,e.transformToRoot,0),e._transformDirty=!1}};function Ctt(e,t,n){e.modelMatrix=P.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Zt.getCullFace(e.modelMatrix,e.primitiveType)}function pye(e,t,n,i,o){let r,s=fye[o];l(s)||(s=fye[o]=new P),i=P.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(r=0;r<a;r++){let d=e.runtimePrimitives[r];Ctt(d.drawCommand,n,i)}let c=e.children.length;for(r=0;r<c;r++){let d=t._runtimeNodes[e.children[r]];if(d._transformToRoot=P.clone(i,d._transformToRoot),!d.show){d._transformDirty=!0;continue}pye(d,t,n,i,o+1),d._transformDirty=!1}}var yI=Q7;var e3n=x(T(),1);var bye={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:gye,_countGeneratedBuffers:yye};bye.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;gye(i,o),yye(i,r)};function gye(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function yye(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 xI=bye;function EC(e){e=e??B.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=P.clone(n,this._originalTransform),this._transform=P.clone(n,this._transform),this._transformToRoot=P.clone(i,this._transformToRoot),this._computedTransform=new P,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,Vtt(this)}Object.defineProperties(EC.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=P.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),q7(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Ne.equals(n,e)||(t.rotation=Ne.clone(e,t.rotation),q7(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),q7(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 Vtt(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=P.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new px(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function q7(e,t){e._transformDirty=!0,e._transform=P.fromTranslationRotationScale(t,e._transform)}EC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};EC.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(gI),t.push(xI),n.push(yI)};EC.prototype.updateComputedTransform=function(){this._computedTransform=P.multiply(this._transformToRoot,this._transform,this._computedTransform)};EC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new P);let r=P.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=P.inverseTransformation(r,t[o]);t[o]=P.multiplyTransformation(s,n[o],t[o])}};var TI=EC;var B7n=x(T(),1);var g3n=x(T(),1);var xye={name:"AlphaPipelineStage"};xye.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Le.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=on.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,fe.FRAGMENT),s.addUniform("float","u_alphaCutoff",fe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var _I=xye;var T3n=x(T(),1);var Tye={name:"BatchTexturePipelineStage"};Tye.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=It(o,e.uniformMap)};var SI=Tye;var E3n=x(T(),1);var _ye={name:"ClassificationPipelineStage"};_ye.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,fe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Ett(t,o)};function Ett(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;y<s;y++){let _=r?i[y]:y,S=c[_];if(S!==p){let Z=y-b,R=y;d.push(Z),u.push(R),b=R,p=S}}let f=s-b;d.push(f),t.batchLengths=d,t.batchOffsets=u}var ZI=_ye;var w3n=x(T(),1);var G3n=x(T(),1),RI=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) { -bool styleTranslucent = (featureColor.a != 1.0); -if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) +float distance = getDistance(position); +if (outlineWidth > 0.0) { -#ifdef HAS_SILHOUETTE -positionMC *= float(model_silhouettePass); -#else -positionMC *= 0.0; -#endif +float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); +float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); +vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); +float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); +return vec4(sdfColor.rgb, sdfColor.a * alpha); } -else if (czm_pass != czm_passTranslucent && styleTranslucent) +else { -positionMC *= 0.0; +float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); +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; } -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ -float show = ceil(feature.color.a); -positionMC *= show; -#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) -filterByPassType(positionMC, feature.color); -#endif +return depthDifferential; } -`;var W3n=x(T(),1),CI=`void filterByPassType(vec4 featureColor) -{ -bool styleTranslucent = (featureColor.a != 1.0); -if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) -{ -#ifdef HAS_SILHOUETTE -if(!model_silhouettePass) { +void doDepthTest(float eyeDepth, float globeDepth) { +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (eyeDepth > -u_threePointDepthTestDistance) { +if (eyeDepth == 0.0) { discard; } -#else -discard; +return; +} #endif +bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; +if (useGlobeDepth && globeDepth == 0.0) { +return; } -else if (czm_pass != czm_passTranslucent && styleTranslucent) -{ +if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { discard; } } -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) -{ -vec4 featureColor = feature.color; -if (featureColor.a == 0.0) +#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_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { discard; } -#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) -filterByPassType(featureColor); +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 -featureColor = czm_gammaCorrect(featureColor); -#ifdef HAS_CLASSIFICATION -material.diffuse = featureColor.rgb * featureColor.a; +} +vec4 color = texture(u_atlas, v_textureCoordinates); +#ifdef SDF +float outlineWidth = v_outlineWidth; +vec4 outlineColor = v_outlineColor; +float distance = getDistance(v_textureCoordinates); +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) +float smoothing = fwidth(distance); +vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); +vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); +vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); +color = (center + color1 + color2 + color3 + color4)/5.0; #else -float highlight = ceil(model_colorBlend); -material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); +float smoothing = 1.0/32.0; +color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); #endif -material.alpha *= featureColor.a; -} -`;var Sye={name:"CPUStylingPipelineStage"};Sye.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(RI),o.addFragmentLines(CI),o.addDefine("USE_CPU_STYLING",void 0,fe.BOTH),l(i.color)||(o.addUniform("float",fx.COLOR_BLEND_UNIFORM_NAME,fe.FRAGMENT),e.uniformMap[fx.COLOR_BLEND_UNIFORM_NAME]=function(){return dl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",fe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Le.TRANSLUCENT}};var VI=Sye;var Xzn=x(T(),1);var U3n=x(T(),1),EI=`void customShaderStage( -inout czm_modelVertexOutput vsOutput, -inout ProcessedAttributes attributes, -FeatureIds featureIds, -Metadata metadata, -MetadataClass metadataClass, -MetadataStatistics metadataStatistics -) { -VertexInput vsInput; -initializeInputStruct(vsInput, attributes); -vsInput.featureIds = featureIds; -vsInput.metadata = metadata; -vsInput.metadataClass = metadataClass; -vsInput.metadataStatistics = metadataStatistics; -vertexMain(vsInput, vsOutput); -attributes.positionMC = vsOutput.positionMC; -} -`;var O3n=x(T(),1),AI=`void customShaderStage( -inout czm_modelMaterial material, -ProcessedAttributes attributes, -FeatureIds featureIds, -Metadata metadata, -MetadataClass metadataClass, -MetadataStatistics metadataStatistics -) { -FragmentInput fsInput; -initializeInputStruct(fsInput, attributes); -fsInput.featureIds = featureIds; -fsInput.metadata = metadata; -fsInput.metadataClass = metadataClass; -fsInput.metadataStatistics = metadataStatistics; -fragmentMain(fsInput, material); -} -`;var azn=x(T(),1);var z3n=x(T(),1),GI=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { -initializeFeatureIds(featureIds, attributes); -initializeFeatureIdAliases(featureIds); -} -`;var K3n=x(T(),1),LI=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +color = czm_gammaCorrect(color); +#else +color = czm_gammaCorrect(color); +color *= czm_gammaCorrect(v_color); +#endif +#if !defined(OPAQUE) && !defined(TRANSLUCENT) +if (color.a < 0.005) { -initializeFeatureIds(featureIds, attributes); -initializeFeatureIdAliases(featureIds); -setFeatureIdVaryings(); +discard; } -`;var po={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()"};po.process=function(e,t,n){let i=e.shaderBuilder;Att(i);let o=e.runtimeNode.node.instances;l(o)&&Gtt(e,o,n),Ltt(e,t,n),i.addVertexLines(LI),i.addFragmentLines(GI)};function Att(e){e.addStruct(po.STRUCT_ID_FEATURE_IDS_VS,po.STRUCT_NAME_FEATURE_IDS,fe.VERTEX),e.addStruct(po.STRUCT_ID_FEATURE_IDS_FS,po.STRUCT_NAME_FEATURE_IDS,fe.FRAGMENT),e.addFunction(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,po.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,fe.VERTEX),e.addFunction(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,po.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,fe.FRAGMENT),e.addFunction(po.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,po.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,fe.VERTEX),e.addFunction(po.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,po.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,fe.FRAGMENT),e.addFunction(po.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,po.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,fe.VERTEX)}function Gtt(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 Rn.FeatureIdAttribute?Wtt(e,s,a):Zye(e,s,a,o,1,n);let c=s.label;l(c)&&Rye(e,a,c,fe.BOTH)}}function Ltt(e,t,n){let i=t.featureIds,r=Zt.getAttributeBySemantic(t,dt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=fe.BOTH;a instanceof Rn.FeatureIdAttribute?vtt(e,a,c):a instanceof Rn.FeatureIdImplicitRange?Zye(e,a,c,r,void 0,n):(Ftt(e,a,c,s,n),d=fe.FRAGMENT);let u=a.label;l(u)&&Rye(e,c,u,d)}}function Wtt(e,t,n){let i=e.shaderBuilder;i.addStructField(po.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(po.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(po.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function vtt(e,t,n){let i=e.shaderBuilder;i.addStructField(po.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(po.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(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Zye(e,t,n,i,o,r){Itt(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(po.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(po.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(po.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Ftt(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 c=a.channels,d=e.shaderBuilder;d.addStructField(po.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,fe.FRAGMENT);let m=`v_texCoord_${a.texCoord}`,p=m,b=a.transform;if(l(b)&&!q.equals(b,q.IDENTITY)){let _=`${r}Transform`;d.addUniform("mat3",_,fe.FRAGMENT),s[_]=function(){return b},p=`vec2(${_} * vec3(${m}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Rye(e,t,n,i){let o=e.shaderBuilder,r=fe.includesVertexShader(i);r&&o.addStructField(po.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(po.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(po.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Itt(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=Ptt(t,n);s=it.createVertexBuffer({context:o.context,typedArray:d,usage:Pe.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:J.FLOAT,strideInBytes:J.getSizeInBytes(J.FLOAT),offsetInBytes:0};e.attributes.push(c)}function Ptt(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 bx=po;var Szn=x(T(),1);var lzn=x(T(),1),WI=`void metadataStage( -FeatureIds featureIds, -out Metadata metadata, -out MetadataClass metadataClass, -out MetadataStatistics metadataStatistics, -ProcessedAttributes attributes -) +#else +#ifdef OPAQUE +if (color.a < 0.995) { -initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); +discard; } -`;var uzn=x(T(),1),vI=`void metadataStage( -FeatureIds featureIds, -out Metadata metadata, -out MetadataClass metadataClass, -out MetadataStatistics metadataStatistics, -ProcessedAttributes attributes -) +#else +if (color.a >= 0.995) { -initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); -setMetadataVaryings(); -} -`;var Li={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"}]};Li.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,d=ent(o,t),u=Xtt(r.propertyAttributes,t,a),m=Ytt(r.propertyTextures,a),p=ktt(r.propertyTables,t,e,a,d),b=u.concat(m).concat(p);Ott(i,b),Htt(i),i.addVertexLines(vI),i.addFragmentLines(WI);for(let f=0;f<u.length;f++){let y=u[f];Ktt(e,y)}for(let f=0;f<m.length;f++){let y=m[f];jtt(e,y,c)}for(let f=0;f<p.length;f++){let y=p[f];qtt(e,y,c)}};function Xtt(e,t,n){return l(e)?e.flatMap(i=>Ntt(i,t,n)):[]}function Ntt(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<c.length;u++){let[m,p]=c[u],b=i(t,p.attribute),{glslType:f,variableName:y}=o(b);d[u]={metadataVariable:r(m),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:f,variableName:y,propertyStatistics:a?.properties[m],shaderDestination:fe.BOTH}}return d}function Ytt(e,t){return l(e)?e.flatMap(n=>Mtt(n,t)):[]}function Mtt(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;a<r.length;a++){let[c,d]=r[a];s[a]={metadataVariable:n(c),property:d,classProperty:d.classProperty,type:d.classProperty.type,glslType:d.classProperty.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:fe.FRAGMENT}}return s}var wtt=4;function ktt(e,t,n,i,o){if(!l(e))return[];let r=Dtt(n,t);return e.filter(s=>l(s.class)&&r.has(String(s.id))).flatMap(s=>Utt(s,r,i,o))}function Utt(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(wtt))continue;let y=d[b],_=fe.intersection(int(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 Dtt(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;a<o.length;a++){let c=o[a],d=l(c?.textureReader);i(c,d?fe.FRAGMENT:fe.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,fe.BOTH)}return n}function Ott(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:d,propertyStatistics:u}=t[a];n.add(d),l(u)&&c!==St.ENUM&&i.add(d)}let o=Li.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Li.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,d){e.addStruct(a,a,fe.BOTH);for(let u=0;u<d.length;u++){let{shaderName:m}=d[u],p=d[u].type==="float"?ztt(c):c;e.addStructField(a,p,m)}}}var Btt={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function ztt(e){let t=Btt[e];return l(t)?t:e}function Htt(e){e.addStruct(Li.STRUCT_ID_METADATA_VS,Li.STRUCT_NAME_METADATA,fe.VERTEX),e.addStruct(Li.STRUCT_ID_METADATA_FS,Li.STRUCT_NAME_METADATA,fe.FRAGMENT),e.addStruct(Li.STRUCT_ID_METADATA_CLASS_VS,Li.STRUCT_NAME_METADATA_CLASS,fe.VERTEX),e.addStruct(Li.STRUCT_ID_METADATA_CLASS_FS,Li.STRUCT_NAME_METADATA_CLASS,fe.FRAGMENT),e.addStruct(Li.STRUCT_ID_METADATA_STATISTICS_VS,Li.STRUCT_NAME_METADATA_STATISTICS,fe.VERTEX),e.addStruct(Li.STRUCT_ID_METADATA_STATISTICS_FS,Li.STRUCT_NAME_METADATA_STATISTICS,fe.FRAGMENT),e.addFunction(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,Li.FUNCTION_SIGNATURE_INITIALIZE_METADATA,fe.VERTEX),e.addFunction(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,Li.FUNCTION_SIGNATURE_INITIALIZE_METADATA,fe.FRAGMENT),e.addFunction(Li.FUNCTION_ID_SET_METADATA_VARYINGS,Li.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,fe.VERTEX)}function Ktt(e,t){Jtt(e,t),$7(e.shaderBuilder,t),eq(e.shaderBuilder,t)}function Jtt(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=tq({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:fe.BOTH,property:o});n.addStructField(Li.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Li.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function jtt(e,t,n){Qtt(e,t,n),$7(e.shaderBuilder,t),eq(e.shaderBuilder,t)}function Qtt(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:s,property:a}=t,{texCoord:c,channels:d,index:u,texture:m,transform:p}=a.textureReader,b=`u_propertyTexture_${u}`,f=[];o.hasOwnProperty(b)||(i.addUniform("sampler2D",b,fe.FRAGMENT),o[b]=()=>m),i.addStructField(Li.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=tq({valueExpression:R,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:fe.FRAGMENT,property:a}),E=`metadata.${r} = ${C};`;f.push(E),i.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,f)}function $7(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Cye(Li.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Li.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,s),fe.includesVertexShader(r)&&(e.addStructField(Li.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function eq(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=Li.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Cye(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Li.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,c),fe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Li.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function qtt(e,t,n){$tt(e,t,n),$7(e.shaderBuilder,t),eq(e.shaderBuilder,t)}function $tt(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(Li.STRUCT_ID_METADATA_VS,s,r),fe.includesFragmentShader(b)&&i.addStructField(Li.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=tq({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(Li.FUNCTION_ID_INITIALIZE_METADATA_VS,p),fe.includesFragmentShader(b)&&i.addFunctionLines(Li.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function Cye(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 tq(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 ent(e,t){let n=new Set,i=new Set;return tnt(e,n,i),nnt(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function tnt(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 nnt(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 int(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 Um=Li;var Da={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};Da.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===Dy.TRANSLUCENT?r.pass=Le.TRANSLUCENT:c===Dy.OPAQUE&&(r.pass=void 0);let d=unt(s,t,e);if(!d.customShaderEnabled)return;if(pnt(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=yb.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 ont(e){let t={};for(let n=0;n<e.length;n++){let i=Zt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var rnt={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},snt={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 Vye(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=rnt[t],i=snt[t];if(l(n))return{attributeField:[n,e],value:i}}function ant(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!Gye(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=Eye(t,o,!1),s=Aye(t,o,!1),a,c=[],d=[];for(let u in r){if(!r.hasOwnProperty(u))continue;let p=[r[u].glslType,u];c.push(p),a=`vsInput.attributes.${u} = attributes.${u};`,d.push(a)}for(let u=0;u<s.length;u++){let m=s[u],p=Vye(m);if(!l(p))return Da._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${m}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${m} = ${p.value};`,d.push(a)}return{enabled:!0,attributeFields:c,initializationLines:d}}function cnt(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 lnt(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!Gye(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=Eye(t,o,!0),s=Aye(t,o,!0),a,c=[],d=[];for(let m in r){if(!r.hasOwnProperty(m))continue;let b=[r[m].glslType,m];c.push(b),a=`fsInput.attributes.${m} = attributes.${m};`,d.push(a)}for(let m=0;m<s.length;m++){let p=s[m],b=Vye(p);if(!l(b))return Da._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(b.attributeField),a=`fsInput.attributes.${p} = ${b.value};`,d.push(a)}let u=cnt(e);return{enabled:!0,attributeFields:c.concat(u.attributeFields),initializationLines:u.initializationLines.concat(d)}}var dnt={positionWC:!0,positionEC:!0};function Eye(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 Aye(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||dnt.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 unt(e,t,n){let i=ont(t.attributes),o=bnt(t,n.model.structuralMetadata),r=ant(e,i,o),s=lnt(e,i,o),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:r,fragmentLines:s,customShaderEnabled:r.enabled||s.enabled,shouldComputePositionWC:c}}function mnt(e,t){let n=Da.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Da.STRUCT_NAME_ATTRIBUTES,fe.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Da.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Da.STRUCT_NAME_VERTEX_INPUT,fe.VERTEX),e.addStructField(n,Da.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,bx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Um.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Um.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Um.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Da.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Da.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,fe.VERTEX),e.addFunctionLines(r,o)}function hnt(e,t){let n=Da.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Da.STRUCT_NAME_ATTRIBUTES,fe.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Da.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Da.STRUCT_NAME_FRAGMENT_INPUT,fe.FRAGMENT),e.addStructField(n,Da.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,bx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Um.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Um.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Um.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Da.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Da.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,fe.FRAGMENT),e.addFunctionLines(r,o)}var fnt=[];function pnt(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=fnt;i.enabled&&(mnt(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,EI),e.addVertexLines(r)),o.enabled&&(hnt(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,AI),e.addFragmentLines(r))}function bnt(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,o=l(e.featureIds)?e.featureIds.map(a=>a.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 Gye(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Da._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 FI=Da;var Dzn=x(T(),1);var II={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};II.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(II.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,II.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,fe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],d=c.quantization;if(!l(d))continue;let u=c.semantic===dt.POSITION,m=c.semantic===dt.TEXCOORD;if(r&&!u&&!m)continue;let p=Zt.getAttributeInfo(c);ynt(i,p),gnt(e,p)}};function gnt(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,fe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,fe.VERTEX),n.addUniform(c,a,fe.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=Lye(d,0),u=Lye(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function Lye(e,t){return e instanceof ce?e:new ce(e.x,e.y,e.z,t)}function ynt(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=xnt(n,i):o=Tnt(n),e.addFunctionLines(II.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function xnt(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 Tnt(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var PI=II;var Kzn=x(T(),1);var Bzn=x(T(),1),XI=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { -if (u_isEdgePass) { -return; +discard; } -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; -} -} +#ifdef VECTOR_TILE +color *= u_highlightColor; +#endif +out_FragColor = color; } -`;var Wye={name:"EdgeDetectionPipelineStage"};Wye.process=function(e){e.shaderBuilder.addFragmentLines([XI])};var NI=Wye;var IHn=x(T(),1);var jzn=x(T(),1),YI=`#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; +`;var Kai=x(T(),1),gX=`uniform float u_threePointDepthTestDistance; +in vec2 direction; +in vec4 positionHighAndScale; +in vec4 positionLowAndRotation; +in vec4 compressedAttribute0; +in vec4 compressedAttribute1; +in vec4 compressedAttribute2; +in vec4 eyeOffset; +in vec4 scaleByDistance; +in vec4 pixelOffsetScaleByDistance; +in vec4 compressedAttribute3; +in vec2 sdf; +in float splitDirection; +#ifdef VS_THREE_POINT_DEPTH_CHECK +in vec4 textureCoordinateBoundsOrLabelTranslate; #endif -void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds) +#ifdef VECTOR_TILE +in float a_batchId; +#endif +out vec2 v_textureCoordinates; +out vec4 v_compressed; +out vec4 v_pickColor; +out vec4 v_color; +flat out vec2 v_splitDirectionAndEllipsoidDepthEC; +#ifdef SDF +out vec4 v_outlineColor; +out float v_outlineWidth; +#endif +const float UPPER_BOUND = 32768.0; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_LEFT7 = 128.0; +const float SHIFT_LEFT5 = 32.0; +const float SHIFT_LEFT3 = 8.0; +const float SHIFT_LEFT2 = 4.0; +const float SHIFT_LEFT1 = 2.0; +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_RIGHT7 = 1.0 / 128.0; +const float SHIFT_RIGHT5 = 1.0 / 32.0; +const float SHIFT_RIGHT3 = 1.0 / 8.0; +const float SHIFT_RIGHT2 = 1.0 / 4.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; +vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) { -#ifdef HAS_EDGE_VISIBILITY -if (!u_isEdgePass) { -return; +vec2 halfSize = imageSize * scale * 0.5; +halfSize *= ((direction * 2.0) - 1.0); +vec2 originTranslate = origin * abs(halfSize); +#if defined(ROTATION) || defined(ALIGNED_AXIS) +if (validAlignedAxis || rotation != 0.0) +{ +float angle = rotation; +if (validAlignedAxis) +{ +vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); +angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / +(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); } -float edgeTypeInt = v_edgeType * 255.0; -if (edgeTypeInt < 0.5) { -discard; +float cosTheta = cos(angle); +float sinTheta = sin(angle); +rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); +halfSize = rotationMatrix * halfSize; } -if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { -if (v_shouldDiscard > 0.5) { -discard; +else +{ +rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } +#endif +mpp = czm_metersPerPixel(positionEC); +positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); +positionEC.xy += (translate + pixelOffset) * mpp; +return positionEC; } -vec4 finalColor = color; -#ifdef HAS_EDGE_COLOR_ATTRIBUTE -if (v_edgeColor.a >= 0.0) { -finalColor = v_edgeColor; +#ifdef VS_THREE_POINT_DEPTH_CHECK +float getGlobeDepth(vec4 positionEC) +{ +vec4 posWC = czm_eyeToWindowCoordinates(positionEC); +float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); +if (globeDepth == 0.0) +{ +return 0.0; } -#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; +vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); +return eyeCoordinate.z / eyeCoordinate.w; } #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); +void main() +{ +vec3 positionHigh = positionHighAndScale.xyz; +vec3 positionLow = positionLowAndRotation.xyz; +float scale = positionHighAndScale.w; +#if defined(ROTATION) || defined(ALIGNED_AXIS) +float rotation = positionLowAndRotation.w; #else -out_id.g = 0.0; -#endif -out_edgeDepth = czm_packDepth(gl_FragCoord.z); -#endif +float rotation = 0.0; #endif -} -`;var qzn=x(T(),1),MI=`#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; +float compressed = compressedAttribute0.x; +vec2 pixelOffset; +pixelOffset.x = floor(compressed * SHIFT_RIGHT7); +compressed -= pixelOffset.x * SHIFT_LEFT7; +pixelOffset.x -= UPPER_BOUND; +vec2 origin; +origin.x = floor(compressed * SHIFT_RIGHT5); +compressed -= origin.x * SHIFT_LEFT5; +origin.y = floor(compressed * SHIFT_RIGHT3); +compressed -= origin.y * SHIFT_LEFT3; +origin -= vec2(1.0); +float show = floor(compressed * SHIFT_RIGHT2); +compressed -= show * SHIFT_LEFT2; +vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); +vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); +vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; +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 EYE_DISTANCE_TRANSLUCENCY +vec4 translucencyByDistance; +translucencyByDistance.x = compressedAttribute1.z; +translucencyByDistance.z = compressedAttribute1.w; +translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +temp = compressedAttribute1.y * SHIFT_RIGHT8; +translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -#ifdef HAS_EDGE_COLOR_ATTRIBUTE -v_edgeColor = a_edgeColor; +#ifdef VS_THREE_POINT_DEPTH_CHECK +temp = compressedAttribute3.w; +temp = temp * SHIFT_RIGHT12; +vec2 dimensions; +dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; +dimensions.x = floor(temp); #endif -#ifdef HAS_LINE_PATTERN -#ifdef HAS_EDGE_CUMULATIVE_DISTANCE -v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld; +#ifdef ALIGNED_AXIS +vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); +temp = compressedAttribute2.z * SHIFT_RIGHT5; +bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; #else -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 +vec3 alignedAxis = vec3(0.0); +bool validAlignedAxis = false; #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; +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.a /= 255.0; +color.a = floor(temp); +color.a /= 255.0; +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); +positionEC.xyz *= show; +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) +{ +lengthSq = czm_eyeHeight2D.y; } -gl_Position = posClip; +else +{ +lengthSq = dot(positionEC.xyz, positionEC.xyz); } #endif -`;var bHn=x(T(),1);var nq=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;E<i;++E){let A=d+E*S;C(Z,A,o,R);for(let L=0;L<o;++L)_[E*o+L]=R[L]}return _}static dequantize(t,n,i,o){if(o.octEncoded){let a=e.octDecode(t,n,o.normalizationRange,void 0);return o.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let r=o.quantizedVolumeStepSize,s=o.quantizedVolumeOffset;if(i===Dt.SCALAR)return e.dequantize1D(t,n,r,s,void 0);if(i===Dt.VEC2)return e.dequantize2D(t,n,r,s,void 0);if(i===Dt.VEC3)return e.dequantize3D(t,n,r,s,void 0);if(i===Dt.VEC4)return e.dequantize4D(t,n,r,s,void 0);throw new ge(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,o){l(o)||(o=new Float32Array(t.length));let r=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,r),dn.octDecodeInRange(r.x,r.y,i,r),h.pack(r,o,s*3);return o}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let o=0;for(let r=0;r<n;r++,o+=3){let s=t[o+0],a=t[o+1],c=t[o+2];i[o+0]=a,i[o+1]=c,i[o+2]=s}return i}static dequantize1D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+o;r[s]=c}return r}static dequantize2D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new k;for(let a=0;a<n;a++)k.unpack(t,a*2,s),k.multiplyComponents(s,i,s),k.add(s,o,s),k.pack(s,r,a*2);return r}static dequantize3D(t,n,i,o,r){l(r)||(r=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,o,s),h.pack(s,r,a*3);return r}static dequantize4D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let s=new ce;for(let a=0;a<n;a++)ce.unpack(t,a*4,s),ce.multiplyComponents(s,i,s),ce.add(s,o,s),ce.pack(s,r,a*4);return r}static createComponentsReader(t){let n=e.createComponentReader(t),i=J.getSizeInBytes(t);return function(o,r,s,a){let c=r;for(let d=0;d<s;++d)a[d]=n(o,c),c+=i}}static createComponentReader(t){switch(t){case J.BYTE:return function(n,i){return n.getInt8(i)};case J.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case J.SHORT:return function(n,i){return n.getInt16(i,!0)};case J.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case J.INT:return function(n,i){return n.getInt32(i,!0)};case J.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case J.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case J.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new ge(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let o=new h,r=t.length/3;for(let s=0;s<r;s++)h.unpack(t,s*3,o),P.multiplyByPoint(n,o,o),h.pack(o,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,o=t.offset,r=t.repeat,s=new Float32Array(i);if(l(r))for(let a=0;a<i;a++)s[a]=o+Math.floor(a/r);else s.fill(o);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,o=t.count,r=t.indexDatatype,s=e.createIndexTypedArray(r,o);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Ie.TRIANGLES)return i;if(n===Ie.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Ie.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new ge(`The primitiveType must be TRIANGLES (${Ie.TRIANGLES}, TRIANGLE_STRIP (${Ie.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Ie.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 Oe.UNSIGNED_BYTE:return new Uint8Array(n);case Oe.UNSIGNED_SHORT:return new Uint16Array(n);case Oe.UNSIGNED_INT:return new Uint32Array(n)}throw new ge(`The indexDatatype must be UNSIGNED_BYTE (${Oe.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Oe.UNSIGNED_SHORT}, or UNSIGNED_INT (${Oe.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let o=n?.mapProjection,r=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new P,modelMatrix:new P,computedModelMatrix:new P},c=s._runtimeNodes,d=c.length;for(let u=0;u<d;u++){let m=c[u],p=e.computeNodeTransforms(m,s,t,a),b=p.computedModelMatrix;l(o)&&(b=_t.basisTo2D(o,b,b));let f=e.computeInstanceTransforms(m,b,p.nodeComputedTransform,p.modelMatrix),y=l(r)?e.computeInstanceFeatureIds(m,r):void 0,_=[];for(let Z=0;Z<f.length;Z++)_.push({transform:f[Z],featureId:l(y)?y[Z]:void 0});let S=m.runtimePrimitives.length;for(let Z=0;Z<S;Z++){let R=m.runtimePrimitives[Z];i(R,R.primitive,_,b)}}}static computeNodeTransforms(t,n,i,o){let r=t.node,s=P.clone(t.computedTransform,o.nodeComputedTransform),a=P.clone(n.computedModelMatrix,o.modelMatrix),c=r.instances;l(c)&&c.transformInWorldSpace&&(a=P.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=P.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let d=P.multiplyTransformation(a,s,o.computedModelMatrix);return o.computedModelMatrix=d,o.nodeComputedTransform=s,o.modelMatrix=a,o}static computeInstanceTransforms(t,n,i,o){let r=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,d=a.attributes[0].componentDatatype,u=12,m=t.transformsTypedArray;if(!l(m)){let p=t.instancingTransformsBuffer;l(p)&&(m=J.createTypedArray(d,c*u),p.getBufferData(m))}l(m)?e.computeInstanceTransformsFromTypedArray(m,c,r):e.computeInstanceTransformsFromAttributes(a,c,r);for(let p=0;p<r.length;p++){let b=r[p];a.transformInWorldSpace?(P.multiplyTransformation(b,i,b),P.multiplyTransformation(o,b,b)):P.multiplyTransformation(n,b,b)}}return r.length===0&&r.push(n),r}static computeInstanceFeatureIds(t,n){let o=t.node.instances;if(!l(o))return;let r=Zt.getFeatureIdsByLabel(o.featureIds,n);if(!l(r))return;let s;if("setIndex"in r){let c=Zt.getAttributeBySemantic(o,dt.FEATURE_ID,r.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in r&&(s=e.readImplicitRangeAsTypedArray(r,o)),!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 r=0;r<n;r++){let s=r*12,a=new P(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 o=Zt.getAttributeBySemantic(t,Xr.TRANSLATION),r=Zt.getAttributeBySemantic(t,Xr.ROTATION),s=Zt.getAttributeBySemantic(t,Xr.SCALE),a=l(o),c=l(r),d=l(s);if(!a&&!c&&!d)return;let u,m,p;a&&(u=e.readAttributeAsRawCompactTypedArray(o)),c&&(m=e.readAttributeAsRawCompactTypedArray(r)),d&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let b=0;b<n;b++){let f=a?new h(u[b*3],u[b*3+1],u[b*3+2]):h.ZERO,y=c?new Ne(m[b*4],m[b*4+1],m[b*4+2],m[b*4+3]):Ne.IDENTITY,_=d?new h(p[b*3],p[b*3+1],p[b*3+2]):h.ONE,S=P.fromTranslationQuaternionRotationScale(f,y,_,new P);i.push(S)}}},Ta=nq;var AC=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),vye={name:"EdgeVisibilityPipelineStage"};vye.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,fe.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,fe.FRAGMENT),i.addFragmentLines(YI),i.addVertexLines(MI),i.addUniform("bool","u_isEdgePass",fe.BOTH);let o=t.material,r=l(o)?o.lineStyle:void 0;(!l(r)||!l(r.width))&&i.addUniform("float","u_lineWidth",fe.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"),d=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let u=i.addAttribute("vec3","a_edgeOtherPos"),m=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=Snt(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let b=e.runtimePrimitive.primitive,f=Znt(b),_=p.edgeData.some(function(F){return l(F.color)})||l(f),S;_&&(S=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,fe.BOTH));let Z,R,C=Zt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(C)&&(Z=C,R=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,fe.VERTEX));let E=_nt(p.edgeIndices,p.edgeData,t.edgeVisibility),A=Rnt(p.edgeIndices,p.edgeData,e,n.context,s,c,d,a,S,u,m,f,t.edgeVisibility,E,Z,R);if(!l(A))return;A.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,fe.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(Z)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let L=l(r)&&l(r.width)?r.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:A.vertexArray,indexCount:A.indexCount,primitiveType:Ie.TRIANGLES,pass:Le.CESIUM_3D_TILE_EDGES,lineWidth:L}};function _nt(e,t,n){let i=e.length/2,o=new Float32Array(i*6),r=n.silhouetteNormals;if(!l(r))return o;let s=r.length/3,a=new Float32Array(r.length),c=new h;for(let d=0;d<s;d++)c.x=r[d*3],c.y=r[d*3+1],c.z=r[d*3+2],h.magnitudeSquared(c)>0?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<i;d++){let{edgeType:u,silhouetteEdgeIndex:m}=t[d];if(u!==AC.SILHOUETTE||m<0)continue;let p=m*2;if((p+1)*3+2>=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 Snt(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===AC.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===AC.SILHOUETTE&&(Y=b,b++),m.push({edgeType:V===AC.REPEATED_HARD?AC.HARD:V,silhouetteEdgeIndex:Y,color:f})}}}if(c)for(let y=0;y<o.length;y++){let _=o[y];if(!l(_)||!l(_.indices))continue;let S=_.indices;if(!l(S)||S.length<2)continue;let Z=_.restartIndex,R=l(_.materialColor)?_.materialColor:f,C;for(let E=0;E<S.length;E++){let A=S[E];if(l(Z)&&A===Z){C=void 0;continue}if(!l(C)){C=A;continue}let L=C,F=A;if(C=A,L===F||s>0&&(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:AC.HARD,silhouetteEdgeIndex:-1,color:l(R)?R:void 0}))}}return{edgeIndices:u,edgeData:m,silhouetteEdgeCount:b}}function Znt(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=Ta.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length<o*n)return;let r=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!r&&!s&&!a)return;let c=new Float32Array(o*4),d=function(u){let m;return r?m=u:s?m=u/255:a&&(m=u/65535),Math.min(Math.max(m,0),1)};for(let u=0;u<o;u++){let m=u*n,p=u*4;c[p]=d(i[m]),c[p+1]=d(i[m+1]),c[p+2]=d(i[m+2]),n===4?c[p+3]=d(i[m+3]):c[p+3]=1}return{colors:c,count:o}}function Rnt(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y){if(!l(e)||e.length===0)return;let _=t.length,Z=_*4,R=0,C=Zt.getAttributeBySemantic(n.runtimePrimitive.primitive,dt.POSITION),E=l(C.typedArray)?C.typedArray:Ta.readAttributeAsTypedArray(C),A=new Float32Array(Z*3),L=new Float32Array(Z),F=new Float32Array(Z*3),I=new Float32Array(Z*3),N=new Float32Array(Z*3),g=new Float32Array(Z),V=l(f),G=V?new Float32Array(Z):void 0,v;V&&(v=l(f.typedArray)?f.typedArray:Ta.readAttributeAsTypedArray(f));let X=l(c),Y=X?new Float32Array(Z*4):void 0,D=l(m)?m.colors:void 0,M=l(m)?m.count:0;function O(qe){if(!X)return;let We=qe*4;Y[We]=0,Y[We+1]=0,Y[We+2]=0,Y[We+3]=-1}function w(qe,We){if(!X)return;let Ke=qe*4,ct=l(We.x)?We.x:We[0],Et=l(We.y)?We.y:We[1],zt=l(We.z)?We.z:We[2],ut=l(We.w)?We.w:l(We[3])?We[3]:1;Y[Ke]=ct,Y[Ke+1]=Et,Y[Ke+2]=zt,Y[Ke+3]=ut}function z(qe,We){if(!X)return;if(We>=M){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 Mi=t[qe].color;if(l(Mi))for(let rn=0;rn<4;rn++)w(pt+rn,Mi);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,Si=b[jn],Hi=b[jn+1],Gi=b[jn+2],pi=b[jn+3],Zi=b[jn+4],On=b[jn+5];for(let rn=0;rn<4;rn++)F[(pt+rn)*3]=Si,F[(pt+rn)*3+1]=Hi,F[(pt+rn)*3+2]=Gi,I[(pt+rn)*3]=pi,I[(pt+rn)*3+1]=Zi,I[(pt+rn)*3+2]=On}let K=it.createVertexBuffer({context:i,typedArray:A,usage:Pe.STATIC_DRAW}),te=it.createVertexBuffer({context:i,typedArray:L,usage:Pe.STATIC_DRAW}),H=it.createVertexBuffer({context:i,typedArray:F,usage:Pe.STATIC_DRAW}),$=it.createVertexBuffer({context:i,typedArray:I,usage:Pe.STATIC_DRAW}),ee=it.createVertexBuffer({context:i,typedArray:N,usage:Pe.STATIC_DRAW}),le=it.createVertexBuffer({context:i,typedArray:g,usage:Pe.STATIC_DRAW}),_e=X?it.createVertexBuffer({context:i,typedArray:Y,usage:Pe.STATIC_DRAW}):void 0,he=V?it.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=it.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:Ta.readAttributeAsTypedArray(We),ct=new Float32Array(Z);for(let zt=0;zt<_;zt++){let ut=e[zt*2],bt=ut<Ke.length?Ke[ut]:0;for(let ht=0;ht<4;ht++)ct[zt*4+ht]=bt}let Et=it.createVertexBuffer({context:i,typedArray:ct,usage:Pe.STATIC_DRAW});tt.push({index:a,vertexBuffer:Et,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1})}}}return{vertexArray:new Un({context:i,attributes:tt,indexBuffer:Fe}),indexCount:ye,hasEdgeFeatureIds:l(Be.featureIds)&&Be.featureIds.length>0}}var wI=vye;var aKn=x(T(),1);var XHn=x(T(),1),kI=`void geometryStage(out ProcessedAttributes attributes) +#ifdef EYE_DISTANCE_SCALING +float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); +scale *= distanceScale; +translate *= distanceScale; +if (scale == 0.0) { -attributes.positionMC = v_positionMC; -attributes.positionEC = v_positionEC; -#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) -attributes.positionWC = v_positionWC; -#endif -#ifdef HAS_NORMALS -attributes.normalEC = normalize(v_normalEC); -#endif -#ifdef HAS_TANGENTS -attributes.tangentEC = normalize(v_tangentEC); -#endif -#ifdef HAS_BITANGENTS -attributes.bitangentEC = normalize(v_bitangentEC); -#endif -setDynamicVaryings(attributes); +positionEC.xyz = vec3(0.0); } -`;var YHn=x(T(),1),UI=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) -{ -vec4 computedPosition; -vec3 positionMC = attributes.positionMC; -v_positionMC = positionMC; -v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; -#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) -vec3 position2D = attributes.position2D; -vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; -computedPosition = czm_projection * vec4(positionEC, 1.0); -#else -computedPosition = czm_projection * vec4(v_positionEC, 1.0); #endif -#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) -v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; -#endif -#ifdef HAS_NORMALS -v_normalEC = normalize(normal * attributes.normalMC); +float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY +translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); +if (translucency == 0.0) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef HAS_TANGENTS -v_tangentEC = normalize(normal * attributes.tangentMC); +#ifdef EYE_DISTANCE_PIXEL_OFFSET +float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); +pixelOffset *= pixelOffsetScale; #endif -#ifdef HAS_BITANGENTS -v_bitangentEC = normalize(normal * attributes.bitangentMC); +#ifdef DISTANCE_DISPLAY_CONDITION +float nearSq = compressedAttribute3.x; +float farSq = compressedAttribute3.y; +if (lengthSq < nearSq || lengthSq > farSq) +{ +positionEC.xyz = vec3(0.0); +} #endif -setDynamicVaryings(attributes); -return computedPosition; +mat2 rotationMatrix; +float mpp; +float enableDepthCheck = 1.0; +#ifdef DISABLE_DEPTH_DISTANCE +float disableDepthTestDistanceSq = compressedAttribute3.z; +if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; } -`;var HHn=x(T(),1);var wHn=x(T(),1),GC=`vec2 computeSt(float featureId) +if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) { -float stepX = model_textureStep.x; -float centerX = model_textureStep.y; -#ifdef MULTILINE_BATCH_TEXTURE -float stepY = model_textureStep.z; -float centerY = model_textureStep.w; -float xId = mod(featureId, model_textureDimensions.x); -float yId = floor(featureId / model_textureDimensions.x); -return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -#else -return vec2(centerX + (featureId * stepX), 0.5); +enableDepthCheck = 0.0; +} #endif +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; } -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +v_compressed.y = enableDepthCheck; +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) { +float depthsilon = 10.0; +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) { -int featureId = featureIds.SELECTED_FEATURE_ID; -if (featureId < model_featuresLength) +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) { -vec2 featureSt = computeSt(float(featureId)); -feature.id = featureId; -feature.st = featureSt; -feature.color = texture(model_batchTexture, featureSt); +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) +{ +positionEC.xyz = vec3(0.0); } -else +} +} +} +#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; +#ifdef LOG_DEPTH +czm_vertexLogDepth(); +#endif +#ifdef DISABLE_DEPTH_DISTANCE +if (disableDepthTestDistanceSq != 0.0) { -feature.id = model_featuresLength + 1; -feature.st = vec2(0.0); -feature.color = vec4(1.0); +float zclip = gl_Position.z / gl_Position.w; +bool clipped = (zclip < -1.0 || zclip > 1.0); +if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) +{ +gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = 1.0; +#endif } -#ifdef HAS_NULL_FEATURE_ID -if (featureId == model_nullFeatureId) { -feature.id = featureId; -feature.st = vec2(0.0); -feature.color = vec4(1.0); } #endif +#ifdef SDF +vec4 outlineColor = czm_decodeRGB8(sdf.x); +float outlineWidth; +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.a /= 255.0; +v_outlineWidth = outlineWidth / 255.0; +v_outlineColor = outlineColor; +v_outlineColor.a *= translucency; +#endif +v_pickColor = pickColor; +v_color = color; +v_color.a *= translucency; +v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; } -`;var DI={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};DI.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=Cnt(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),Vnt(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===fe.BOTH&&i.addVertexLines(GC),i.addFragmentLines(GC)};function Fye(e){return e instanceof Rn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Iye(e){return e instanceof Rn.FeatureIdTexture?fe.FRAGMENT:fe.BOTH}function Cnt(e,t,n){let i,o;return l(t.instances)&&(o=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Iye(o),featureIdDefine:Fye(o)}):(o=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Iye(o),featureIdDefine:Fye(o)})}function Vnt(e){e.addStructField(DI.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(DI.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(DI.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var gx=DI;var Oa={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)"};Oa.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",fe.VERTEX),i.addStruct(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",fe.FRAGMENT),i.addStruct(gx.STRUCT_ID_SELECTED_FEATURE,gx.STRUCT_NAME_SELECTED_FEATURE,fe.BOTH),i.addFunction(Oa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Oa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,fe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Oa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.VERTEX),i.addFunction(Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Oa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.FRAGMENT),o.type===Or.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,fe.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],m=Dt.getAttributeLocationCount(u.type),p=u.semantic===dt.POSITION,b;m>1?(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;Ent(e,u,b,m,r,s,f)}Xnt(i,t.attributes),t.primitiveType===Ie.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(UI),i.addFragmentLines(kI)};function Ent(e,t,n,i,o,r,s){let a=e.shaderBuilder,c=Zt.getAttributeInfo(t),d=o&&!r;i>1?Lnt(e,t,n,i):Gnt(e,t,n,d),vnt(a,c,d),Wnt(a,c,s),l(t.semantic)&&Ant(a,t),Fnt(a,c,o),Int(a,c,d),Pnt(a,c)}function Ant(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 Gnt(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 Lnt(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<i;b++){let f=t.byteOffset+b*m,y={index:n+b,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(y)}}function Wnt(e,t,n){let i=t.variableName,o=`v_${i}`,r;i==="normalMC"?(o="v_normalEC",r=t.glslType):i==="tangentMC"?(r="vec3",o="v_tangentEC"):r=t.glslType,e.addVarying(r,o,n)}function vnt(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===dt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function Fnt(e,t,n){let i=Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Oa.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 Int(e,t,n){let i=Oa.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 Pnt(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function Xnt(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===dt.NORMAL?n=!0:r.semantic===dt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var OI=Oa;var LQn=x(T(),1);var v4n=x(T(),1);var Cjn=x(T(),1);var yjn=x(T(),1);var ljn=x(T(),1);var SKn=x(T(),1);function Dm(e){fs.call(this,e)}Dm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Dm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Zp)return Dm._metadataFailure(e,t);throw o}};Dm.fromUrl=async function(e,t){let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??B.EMPTY_OBJECT;let r=await Dm._requestMetadata(t,i,o);return new Dm(r)};l(Object.create)&&(Dm.prototype=Object.create(fs.prototype),Dm.prototype.constructor=Dm);function Pye(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(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}Dm._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<b.length;F++)if(r.test(b.item(F).nodeName))d=b.item(F);else if(a.test(b.item(F).nodeName)){m=b.item(F);let I=b.item(F).childNodes;for(let N=0;N<I.length;N++)s.test(I.item(N).nodeName)&&p.push(I.item(N))}else c.test(b.item(F).nodeName)&&(u=b.item(F));let f;if(!l(m)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&er.reportError(void 0,o,o.errorEvent,f),new ae(f);let y=t.fileExtension??d.getAttribute("extension"),_=t.tileWidth??parseInt(d.getAttribute("width"),10),S=t.tileHeight??parseInt(d.getAttribute("height"),10),Z=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),R=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),C=m.getAttribute("profile"),E=t.tilingScheme;if(!l(E))if(C==="geodetic"||C==="global-geodetic")E=new eo({ellipsoid:t.ellipsoid});else if(C==="mercator"||C==="global-mercator")E=new Lr({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${C}.`,l(o)&&er.reportError(void 0,o,o.errorEvent,f),new ae(f);let A=re.clone(t.rectangle);if(!l(A)){let F,I,N,g;t.flipXY??!1?(N=new k(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),g=new k(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(N=new k(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),g=new k(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let G=C==="geodetic"||C==="mercator";if(E.projection instanceof Ui||G)F=pe.fromDegrees(N.x,N.y),I=pe.fromDegrees(g.x,g.y);else{let v=E.projection;F=v.unproject(N),I=v.unproject(g)}A=new re(F.longitude,F.latitude,I.longitude,I.latitude)}return A=Pye(A,E),Z=Xye(E,A,Z),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:E,rectangle:A,tileWidth:_,tileHeight:S,minimumLevel:Z,maximumLevel:R,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Dm._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Lr({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Pye(a,s);let c=Xye(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var yx=Dm;var PKn=x(T(),1);function Nye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Nye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Nnt(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new eo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Lr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function Ynt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),er.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function Mnt(e,t,n){try{let i=await e.fetchText();Nnt(i,t)}catch(i){Ynt(i,e,n)}}function Dd(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 Lt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Dd.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 Se}Object.defineProperties(Dd.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}}});Dd.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 Nye(n);s.channel=t,await Mnt(r,s);let a=new Dd(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Dd.prototype.getTileCredits=function(e,t,n){};Dd.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 _u.loadImage(this,o)};Dd.prototype.pickFeatures=function(e,t,n,i,o){};Dd._logoUrl=void 0;Object.defineProperties(Dd,{logoUrl:{get:function(){return l(Dd._logoUrl)||(Dd._logoUrl=en("Assets/Images/google_earth_credit.png")),Dd._logoUrl},set:function(e){Dd._logoUrl=e}}});var BI=Dd;var UKn=x(T(),1);var wnt=/\/$/,Yye=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 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();wnt.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=Yye,this._resource=i,this._imageryProvider=new fs({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=Yye;var zI=LC;var eJn=x(T(),1);function eS(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 eo({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(eS.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 knt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=er.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return iq(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function iq(e,t,n){try{return await _u.loadImage(null,e)}catch(i){return knt(e,i,t,n)}}eS.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await iq(n);t=t??B.EMPTY_OBJECT;let o=new eS({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};eS.prototype.getTileCredits=function(e,t,n){};eS.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await iq(this._resource,this);return this._image=o,er.reportSuccess(this._errorEvent),o}return this._image};eS.prototype.pickFeatures=function(e,t,n,i,o){};var HI=eS;var RJn=x(T(),1);var sJn=x(T(),1);function Unt(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=Dnt:e==="xml"?n=Hnt:(e==="html"||e==="text")&&(n=Mye)),this.callback=n}function Dnt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Yh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=pe.fromDegrees(s,a)}t.push(r)}return t}var oq="http://www.mapinfo.com/mxp",Ont="http://www.esri.com/wms",Bnt="http://www.opengis.net/wfs",znt="http://www.opengis.net/gml";function Hnt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===oq)return Knt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Ont)return Jnt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Bnt)return jnt(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Qnt(e):qnt(e)}function Knt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(oq,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(oq,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let m=u.getAttribute("ref"),p=u.textContent.trim();s[m]=p}}let c=new Yh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Jnt(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(xB(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(xB(a,i))}}return n}function jnt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(znt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};rq(r,s),t.push(xB(r,s))}return t}function Qnt(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new ae("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};rq(s,a),t.push(xB(s,a))}}return t}function rq(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()&&rq(o,t)&&(t[o.localName]=o.textContent)}return n}function xB(e,t){let n=new Yh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function qnt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Yh;return o.data=e,o.description=n.innerHTML,[o]}var $nt=/<body>\s*<\/body>/im,eit=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,tit=/<title>([\s\S]*)<\/title>/im;function Mye(e){if($nt.test(e)||eit.test(e))return;let t,n=tit.exec(e);n&&n.length>1&&(t=n[1]);let i=new Yh;return i.name=t,i.description=e,i.data=e,[i]}var df=Unt;var hJn=x(T(),1);function KI(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(KI.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)}}});KI.prototype.getFromCache=function(e,t,n,i){let o=wye(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};KI.prototype.checkApproachingInterval=function(e,t,n,i){let o=wye(e,t,n),r=this._tilesRequestedForInterval,s=kye(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!Uye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};KI.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=kye(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 wye(e,t,n){return`${e}-${t}-${n}`}function nit(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function kye(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=nit(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 tS=KI;var iit=[3034,3035,3042,3043,3044],oit=[4471,4559];function uf(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(uf.DefaultParameters,!0),n.setQueryParameters(uf.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Dye(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Dye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new tS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return Oye(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&&!oit.includes(a)||iit.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 fs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new eo({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??uf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Oye(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 rit(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(uf.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}}});uf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};uf.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=Oye(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};uf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return rit(this,e,t,n,i,o,s)};uf.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});uf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});uf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new df("json","application/json")),Object.freeze(new df("xml","text/xml")),Object.freeze(new df("text","text/html"))]);function Dye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var JI=uf;var PJn=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(Bye(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(Bye(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 tS({clock:e.clock,times:e.times,requestImageFunction:function(u,m,p,b,f){return zye(d,u,m,p,b,f)},reloadFunction:function(){l(d._reload)&&d._reload()}})),this._errorEvent=new Se,this._tileProvider=new fs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Lr({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:ait(this)})}function zye(e,t,n,i,o,r){let s=e._tileProvider;return Hye(e,s._resource,r),s.requestImage(t,n,i,o)}function sit(e,t,n,i,o,r,s){let a=e._tileProvider;return Hye(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=zye(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 sit(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 df("json","application/json")),Object.freeze(new df("xml","text/xml")),Object.freeze(new df("text","text/html"))]);function Hye(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 ait(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 Bye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var jI=Pu;var JJn=x(T(),1);var MJn=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 Kye=/\/$/;function wb(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 kr?e.url:ve.createIfNeeded(e.url??_a.mapTilesApiEndpoint),n=t.getUrlComponent();Kye.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 fs({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(wb.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}}});wb.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=Jye(e),i=kr._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},sq(s,r,i)};wb.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 lit(e);return new wb({...n,...e,credit:e.credit??_a.getDefaultCredit()})};wb.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};wb.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])};wb.prototype.pickFeatures=function(e,t,n,i,o){};wb.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(cit(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 cit(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 Jye(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 lit(e){let{language:t,region:n,key:i,url:o}=e,r=Jye(e),s=o.url??o;Kye.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 QI=wb;var dit=async(e,t,n)=>yx.fromUrl(new kr(t,n)),uit=async(e,{options:t})=>ib.fromUrl(e,t),mit=async(e,{options:t})=>Zv.fromUrl(e,t),hit=async(e,{options:t})=>{let n=t.channel;return delete t.channel,BI.fromUrl(e,n,t)},fit=async(e,{options:t})=>new zI({url:e,...t}),pit=async(e,{options:t})=>HI.fromUrl(e,t),bit=async(e,{options:t})=>yx.fromUrl(e,t),git=async(e,{options:t})=>new fs({url:e,...t}),yit=async(e,{options:t})=>new JI({url:e,...t}),xit=async(e,{options:t})=>new jI({url:e,...t}),sq=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new kr(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 QI({...t.options,url:i})},Tit=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new kr(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 RG({...t.options,url:i})},_it={ARCGIS_MAPSERVER:uit,BING:mit,GOOGLE_EARTH:hit,MAPBOX:fit,SINGLE_TILE:pit,TMS:bit,URL_TEMPLATE:git,WMS:yit,WMTS:xit,GOOGLE_2D_MAPS:sq,AZURE_MAPS:Tit,defaultFactoryCallback:dit},vC=Object.freeze(_it);function Kp(){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(Kp.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(){}}});Kp.fromAssetId=async function(e,t){t=t??B.EMPTY_OBJECT;let n=kr._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Kp._endpointCache[i];l(o)||(o=n.fetchJson(),Kp._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=vC.defaultFactoryCallback;r=$e(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=vC[s],!l(a)))throw new ae(`Unrecognized Cesium ion imagery type: ${s}`);let d=await a(c,r,n),u=new Kp(t);return d.errorEvent.addEventListener(function(m){m.provider=u,u._errorEvent.raiseEvent(m)}),u._tileCredits=kr.getCreditsFromEndpoint(r,n),u._imageryProvider=d,u};Kp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Kp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Kp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Kp._endpointCache={};var Ql=Kp;var Tjn=x(T(),1),jye={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(jye);var kb=jye;function Sit(e){e=e??B.EMPTY_OBJECT;let t=e.style??kb.AERIAL;return Ql.fromAssetId(t)}var Ub=Sit;var Wjn=x(T(),1);function Us(){ge.throwInstantiationError()}Object.defineProperties(Us.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 Qye=[];Us.getRegularGridIndices=function(e,t){let n=Qye[e];l(n)||(Qye[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),txe(e,t,i,0)),i};var qye=[];Us.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=qye[e];l(n)||(qye[e]=n=[]);let i=n[t];if(!l(i)){let o=Us.getRegularGridIndices(e,t),r=exe(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 $ye=[];Us.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=$ye[e];l(n)||($ye[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=exe(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,b=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,y=Oe.createTypedArray(c,d);txe(e,t,y,0),Us.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};Us.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Us.getSkirtIndexCount=function(e){return(e-4)*2*3};Us.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Us.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=TB(e,a,r,s),a+=e.length,s=TB(t,a,r,s),a+=t.length,s=TB(n,a,r,s),a+=n.length,TB(i,a,r,s)};Us.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,s){Us.addSkirtIndices(e,t,n,i,o,r,s);let a=Us.getSkirtVertexCount(e,t,n,i),c=Us.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 exe(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 txe(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 TB(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}Us.heightmapTerrainQuality=.25;Us.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Us.heightmapTerrainQuality/(t*n)};Us.prototype.requestTileGeometry=ge.throwInstantiationError;Us.prototype.getLevelMaximumGeometricError=ge.throwInstantiationError;Us.prototype.getTileDataAvailable=ge.throwInstantiationError;Us.prototype.loadTileDataAvailability=ge.throwInstantiationError;var Qo=Us;var Fjn=x(T(),1),qI=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; +`;var Cci=x(T(),1);var eci=x(T(),1);var jai=x(T(),1),nat=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Os=nat;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 $b=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 $b(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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!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??wr.NONE,this._positionFromParent=!1}var Yxe=Xi.SHOW_INDEX=0,RB=Xi.POSITION_INDEX=1,Hxe=Xi.PIXEL_OFFSET_INDEX=2,iat=Xi.EYE_OFFSET_INDEX=3,oat=Xi.HORIZONTAL_ORIGIN_INDEX=4,rat=Xi.VERTICAL_ORIGIN_INDEX=5,sat=Xi.SCALE_INDEX=6,Mxe=Xi.IMAGE_INDEX_INDEX=7,wxe=Xi.COLOR_INDEX=8,aat=Xi.ROTATION_INDEX=9,cat=Xi.ALIGNED_AXIS_INDEX=10,lat=Xi.SCALE_BY_DISTANCE_INDEX=11,dat=Xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,uat=Xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,mat=Xi.DISTANCE_DISPLAY_CONDITION=14,hat=Xi.DISABLE_DEPTH_DISTANCE=15;Xi.TEXTURE_COORDINATE_BOUNDS=16;var kxe=Xi.SDF_INDEX=17,fat=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)}function fq(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function xS(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nr(this,Yxe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;fq(t,e)||(xS(e,t),xS(e,this._actualPosition),this._updateClamping(),Nr(this,RB))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Nr(this,RB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),Nr(this,Hxe))}},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,lat))}},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,dat))}},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,uat))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Nr(this,iat))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Nr(this,oat))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Nr(this,rat))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Nr(this,sat))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Nr(this,wxe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Nr(this,aat))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Nr(this,cat))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Nr(this,Mxe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Nr(this,Mxe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Nr(this,wxe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ot.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ot.clone(e,this._distanceDisplayCondition),Nr(this,mat))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Nr(this,hat))}},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=xS(e,this._actualClampedPosition),Nr(this,RB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Nr(this,Yxe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Nr(this,kxe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Nr(this,kxe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Nr(this,fat))}}});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 CB=new pe,pat=new pe,Uxe=200,Dxe=30;function Oxe(e,t,n,i){let o=t.cartographicToCartesian(i,e._clampedPosition);vy(e._heightReference)?e._mode===se.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,o)):o.x+=n.height:e._heightReference===He.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===se.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,o)):o.x=n.height),e._clampedPosition=o}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=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===He.CLIP_TO_GROUND&&o===se.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<Dxe){let _=t._position,S=t._clampingCartesian,Z=_.x-S.x,R=_.y-S.y,C=_.z-S.z,E=Math.sqrt(Z*Z+R*R+C*C);if(t._clampingHeight-E>t._lastSurfaceHeight+Uxe){t._clampedToSurface=!0,t._clampedPosition=_;return}}let a=i.cartesianToCartographic(t._position,pat);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=xS(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===He.CLIP_TO_GROUND,d=s-t._lastSurfaceQueryFrame<Dxe,u=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+Uxe,m=u&&d,p=c&&d&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||u)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let _=pe.clone(a);t._removeCallbackFunc=n.updateHeight(_,S=>{let Z=n.getHeight(_,t._heightReference);l(Z)&&(S.height=Z,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=S.height,t._clampedToSurface=!0,Oxe(t,i,_,S)},t._heightReference)}pe.clone(a,CB);let y;m||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(CB.height=y),Oxe(t,i,a,CB)};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){$b.clone(e,this._imageTexture)};var Bxe=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&&bat(n)&&(this._imageWidth=Math.min(this._width,Bxe),this._imageHeight=Math.min(this._height,Bxe))};function bat(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,Hxe))};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,RB)};var zxe=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,zxe),fo.computeActualEllipsoidPosition(n,zxe))};var Kxe=new h;Xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=P.multiplyByPoint(e,t,Kxe),a=fo.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return k.add(a,i,a),a};var ZB=new k(0,0);Xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,ZB),k.add(ZB,this._translate,ZB);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,CB);o=a.cartographicToCartesian(c,Kxe),i=P.IDENTITY}return Xi._computeScreenSpacePosition(i,o,this._eyeOffset,ZB,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 Mo=Xi;var Eci=x(T(),1),gat={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Da=Object.freeze(gat);var zci=x(T(),1);var Wci=x(T(),1);function yX({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 pq({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new yX({x:n,y:n,width:e-2*n,height:t-2*n})}pq.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};pq.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 yX({x:i.x,y:i.y,width:t,height:r});let u=s-c;return u>0&&(e.childNode2=new yX({x:i.x+t+c,y:i.y,width:u,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new yX({x:i.x,y:i.y,width:o,height:n});let d=a-c;return d>0&&(e.childNode2=new yX({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 BC=pq;var Jxe=16;function id(e){e=e??B.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k(Jxe,Jxe);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(id.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}}});id.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};id.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};id.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 jxe({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 BC({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()};id.prototype.getImageIndex=function(e){return this._indexById.get(e)};id.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 jxe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}id.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new jxe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};id.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};id.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 BC({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function yat(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof ve)&&(e=ve.createIfNeeded(e).fetchImage()),e}id.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 yat(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)};id.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};id.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}))};id.prototype.isDestroyed=function(){return!1};id.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var TS=id;var xat=Mo.SHOW_INDEX,xX=Mo.POSITION_INDEX,qxe=Mo.PIXEL_OFFSET_INDEX,$xe=Mo.EYE_OFFSET_INDEX,Tat=Mo.HORIZONTAL_ORIGIN_INDEX,_at=Mo.VERTICAL_ORIGIN_INDEX,Sat=Mo.SCALE_INDEX,_S=Mo.IMAGE_INDEX_INDEX,eTe=Mo.COLOR_INDEX,Zat=Mo.ROTATION_INDEX,Rat=Mo.ALIGNED_AXIS_INDEX,tTe=Mo.SCALE_BY_DISTANCE_INDEX,nTe=Mo.TRANSLUCENCY_BY_DISTANCE_INDEX,iTe=Mo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,oTe=Mo.DISTANCE_DISPLAY_CONDITION,Cat=Mo.DISABLE_DEPTH_DISTANCE,Vat=Mo.TEXTURE_COORDINATE_BOUNDS,rTe=Mo.SDF_INDEX,sTe=Mo.SPLIT_DIRECTION_INDEX,_q=Mo.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 Om(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new TS),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(_q),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,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(Om.prototype,{length:{get:function(){return Sq(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 aTe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Om.prototype.add=function(e){let t=new Mo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Om.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Om.prototype.removeAll=function(){aTe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Sq(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}}Om.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Om.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Om.prototype.get=function(e){return Sq(this),this._billboards[e]};function Qxe(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 Eat(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}Om.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<_q;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Aat(e,t,n,i,o){let r=[{index:Do.positionHighAndScale,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[xX]},{index:Do.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[xX]},{index:Do.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[qxe]},{index:Do.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[nTe]},{index:Do.compressedAttribute2,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[eTe]},{index:Do.eyeOffset,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[$xe]},{index:Do.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[tTe]},{index:Do.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[iTe]},{index:Do.compressedAttribute3,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[oTe]},{index:Do.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[Vat]},{index:Do.splitDirection,componentsPerAttribute:1,componentDatatype:J.FLOAT,usage:n[sTe]},{index:Do.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:Eat(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[rTe]}),new qb(e,r,t,!0)}var bq=new An;function cTe(e,t){let n=e.center,i=t.x-n.x,o=t.y-n.y,r=t.z-n.z,s=Math.sqrt(i*i+o*o+r*r);s>e.radius&&(e.radius=s)}function lTe(e,t,n,i){let o=n[Do.positionHighAndScale],r=n[Do.positionLowAndRotation],s=i._getActualPosition();e._mode===se.SCENE3D&&(cTe(e._baseVolume,s),e._boundingVolumeDirty=!0),An.fromCartesian(s,bq);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let d=bq.high,u=bq.low;o(i._index,d.x,d.y,d.z,a),r(i._index,u.x,u.y,u.z,c)}var Zx=new k,Dm=32768,Zq=65536,gq=4096,SS=256,Gat=128,Lat=32,Wat=8,VB=4,vat=1/256,dTe=new nt;function uTe(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(dTe);f=L.x,y=L.y}let _=Math.floor(W.clamp(s,-Dm,Dm)+Dm)*Gat;_+=(m+1)*Lat,_+=(p+1)*Wat,_+=(b?1:0)*VB;let S=Math.floor(W.clamp(a,-Dm,Dm)+Dm)*SS,Z=Math.floor(W.clamp(d*VB,-Dm,Dm)+Dm)*SS,R=(W.clamp(u*VB,-Dm,Dm)+Dm)*vat,C=Math.floor(R),E=Math.floor((R-C)*SS);S+=C,Z+=E,Zx.x=f,Zx.y=y;let A=dn.compressTextureCoordinates(Zx);o(i._index,_,S,Z,A)}function mTe(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,Zq),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*SS+a,d=W.clamp(d,0,1),d=d===1?255:d*255|0,b=b*SS+d,o(i._index,p,b,s,c)}function xq(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)*Zq+U.floatToByte(s.alpha)*SS+(a*2+u),_=m*VB+p;o(i._index,b,f,y,_)}function Tq(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)),Zx.x=0,Zx.y=0,i.ready){let c=i.computeTextureCoordinates(dTe);Zx.x=c.width,Zx.y=c.height}let a=dn.compressTextureCoordinates(Zx);o(i._index,r.x,r.y,s,a)}function hTe(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 fTe(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 pTe(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,gq)),b=Math.floor(W.clamp(u,0,gq)),f=p*gq+b;o(i._index,r,s,c,f)}function bTe(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 Fat(e,t,n,i){if(!l(e._batchTable))return;let o=n[Do.a_batchId],r=i._batchIndex;o(i._index,r)}function gTe(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)*Zq+U.floatToByte(c)*SS;o(i._index,a,d)}function yTe(e,t,n,i){let o=n[Do.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s),o(i._index,r)}function Iat(e,t,n,i){lTe(e,t,n,i),uTe(e,t,n,i),mTe(e,t,n,i),xq(e,t,n,i),Tq(e,t,n,i),hTe(e,t,n,i),fTe(e,t,n,i),pTe(e,t,n,i),bTe(e,t,n,i),Fat(e,t,n,i),gTe(e,t,n,i),yTe(e,t,n,i)}function yq(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=Mo._computeActualPosition(d,u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):cTe(s,m))}r&&me.fromPoints(a,s)}function Pat(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)&&yq(e,i,i.length,t,r,!0)):n===se.MORPHING?yq(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&yq(e,o,e._billboardsToUpdateIndex,t,r,!1)}function Xat(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 Nat(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=Le.OVERLAY,i}var Yat=[];Om.prototype.update=function(e){if(Sq(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,_S),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;Pat(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<_q;++L)c[L]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=Aat(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,Iat(this,e,m,F)}this._vaf.commit(Qxe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let L=Yat;L.length=0,(c[xX]||c[Zat]||c[Sat])&&L.push(lTe),(c[_S]||c[qxe]||c[Tat]||c[_at]||c[xat])&&(L.push(uTe),L.push(Tq)),(c[_S]||c[Rat]||c[nTe])&&(L.push(mTe),L.push(xq)),(c[_S]||c[eTe])&&L.push(xq),(c[_S]||c[$xe])&&L.push(Tq),c[tTe]&&L.push(hTe),c[iTe]&&L.push(fTe),(c[oTe]||c[Cat]||c[_S]||c[xX])&&L.push(pTe),(c[_S]||c[xX])&&L.push(bTe),c[rTe]&&L.push(gTe),c[sTe]&&L.push(yTe);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(Qxe(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,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,y=P.IDENTITY;e.mode===se.SCENE3D?(y=this.modelMatrix,f=me.clone(this._baseVolumeWC,this._boundingVolume)):f=me.clone(this._baseVolume2D,this._boundingVolume),Xat(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=gX,Z=bX,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 M=I?Math.floor(X/2):X;Y.boundingVolume=f,Y.modelMatrix=y,Y.count=N[M].indicesCount,Y.shaderProgram=D?this._sp:this._spTranslucent,Y.uniformMap=V,Y.vertexArray=N[M].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=Nat(this,e.context)),A.push(this.debugCommand))}this._allBillboardsReady=o};Om.prototype.isDestroyed=function(){return!1};Om.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(),aTe(this._billboards),ue(this)};var Mu=Om;var wli=x(T(),1);var Fli=x(T(),1);function Mat(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 ZS=Mat;var wat=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),zC(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),zC(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,zC(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),zC(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,zC(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,wat);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&&zC(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 zC(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,ZS(u,m,p,o,r))}var eg=bf;var Idi=x(T(),1);var zli=x(T(),1);function kat(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 RS;function Uat(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(RS)||(l(u.imageSmoothingEnabled)?RS="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?RS="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?RS="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(RS="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[RS]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=kat(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[RS]=!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 CS=Uat;var WTe=x(STe(),1);var mdi=x(T(),1);var jli=x(T(),1),ZTe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(ZTe);var Tr=ZTe;var RTe={},CTe=0,Oat=256,Bat=new U(.165,.165,.165,.8),zat=new k(7,5),ia=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function VS(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function _X(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function SX(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function ETe(e){let t=RTe[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(SX(n,"line-height"));isNaN(i)&&(i=void 0),t={family:SX(n,"font-family"),size:SX(n,"font-size").replace("px",""),style:SX(n,"font-style"),weight:SX(n,"font-weight"),lineHeight:i},document.body.removeChild(n),CTe<Oat&&(RTe[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??Bat),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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,ETe(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(!fq(t,e)){xS(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),_X(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?qat(t):t,VS(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,VS(this),ETe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),VS(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),VS(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,VS(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,VS(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),_X(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,VS(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,_X(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),_X(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),_X(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=xS(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(){Mo._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 Mo._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 Hat(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 Kat(e){return e.split("").reverse().join("")}function ZX(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Jat(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var jat="\u05D0-\u05EA",Qat="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",VTe=new RegExp(`[${jat}${Qat}]`);function qat(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=VTe.test(o.charAt(0)),s=Hat(o,VTe),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===ia.BRACKETS?Jat(u.Word):Kat(u.Word);r?u.Type===ia.RTL?(c=m+c,a=0):u.Type===ia.LTR?(c=ZX(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=ZX(c,a,u.Word),a+=u.Word.length):c=ZX(c,0,m)):u.Type===ia.RTL?c=ZX(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=ZX(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 Rx=gf;var vTe=x(ATe(),1);function ect(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var tct=1.2,GTe="ID_WHITE_PIXEL",Rq=new k(4,4),nct=new nt(1,1,1,1);function ict(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=Rq.x,o.height=Rq.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(GTe,o),n.addImageSubRegion(GTe,nct)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new k,i}var tg={};function oct(e,t,n,i,o,r){return tg.font=t,tg.fillColor=n,tg.strokeColor=i,tg.strokeWidth=o,tg.padding=Da.PADDING,tg.fill=r===Tr.FILL||r===Tr.FILL_AND_OUTLINE,tg.stroke=r===Tr.OUTLINE||r===Tr.FILL_AND_OUTLINE,tg.backgroundColor=U.BLACK,CS(e,tg)}function Cq(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 rct=new vTe.default,sct=/\s/;function act(e,t){let n=t._renderedText,i=rct.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)Cq(e,r[p]);r.length=o;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=ict(c,e),t._backgroundBillboard=a),cct(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 $b(d),u.set(y,S);let E=`${t._fontStyle} ${t._fontWeight} ${Da.FONT_SIZE}px ${t._fontFamily}`,A=oct(b,E,U.WHITE,U.WHITE,0,Tr.FILL);if(_=A.dimensions,m[y]=_,A.width>0&&A.height>0&&!sct.test(b)){let L=(0,WTe.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 ect,Z.dimensions=_,Z.billboardTexture=S,r[p]=Z),Z.billboardTexture.id!==y&&(Z.billboardTexture=S,Z.dimensions=_),!S.hasImage){Cq(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 cct(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 LTe(e,t,n){return t===Ui.CENTER?-e/2:t===Ui.RIGHT?-(e+n.x):n.x}var Br=new k,lct=new k;function dct(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,lct);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=LTe(S,f,m),R=(l(e._lineHeight)?e._lineHeight:tct*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=LTe(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 FTe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Cq(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??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Mu({scene:this._scene,textureAtlas:new TS({initialSize:Rq}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new $b(t),this._glyphBillboardCollection=new Mu({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 Rx(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),FTe(this,e),!0}return!1};Kp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)FTe(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&&(act(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(dct(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(),ue(this)};var Jp=Kp;var Oui=x(T(),1);var Xdi=x(T(),1),RX=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; void main() { -out_FragColor = texture(u_texture, v_textureCoordinates); +float texCoord = texCoordExpandAndBatchIndex.x; +float expandDir = texCoordExpandAndBatchIndex.y; +bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; +float batchTableIndex = texCoordExpandAndBatchIndex.w; +vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); +float width = widthAndShow.x + 0.5; +float show = widthAndShow.y; +if (width < 1.0) +{ +show = 0.0; } -`;var Pjn=x(T(),1),$I=`in vec4 position; -in float webMercatorT; -uniform vec2 u_textureDimensions; -out vec2 v_textureCoordinates; -void main() +vec4 pickColor = batchTable_getPickColor(batchTableIndex); +vec4 p, prev, next; +if (czm_morphTime == 1.0) { -v_textureCoordinates = vec2(position.x, webMercatorT); -gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); +prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); +next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); } -`;var Ujn=x(T(),1);var Njn=x(T(),1),nxe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(nxe);var Dn=nxe;function FC(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}FC.createPlaceholder=function(e){let t=new FC(e,0,0,0);return t.addReference(),t.state=Dn.PLACEHOLDER,t};FC.prototype.addReference=function(){++this.referenceCount};FC.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};FC.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 IC=FC;var zjn=x(T(),1);function aq(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}aq.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};aq.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 PC=aq;function Bi(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??Bi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Bi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Bi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Bi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Bi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Bi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Bi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Bi.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 PC(IC.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??Bi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Bi.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}}});Bi.DEFAULT_BRIGHTNESS=1;Bi.DEFAULT_CONTRAST=1;Bi.DEFAULT_HUE=0;Bi.DEFAULT_SATURATION=1;Bi.DEFAULT_GAMMA=1;Bi.DEFAULT_SPLIT=Ur.NONE;Bi.DEFAULT_MINIFICATION_FILTER=Ht.LINEAR;Bi.DEFAULT_MAGNIFICATION_FILTER=qn.LINEAR;Bi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Bi.fromProviderAsync=function(e,t){let n=new Bi(void 0,t);return Eit(n,Promise.resolve(e)),n};Bi.fromWorldImagery=function(e){return e=e??B.EMPTY_OBJECT,Bi.fromProviderAsync(Ub({style:e.style}),e)};Bi.prototype.isBaseLayer=function(){return this._isBaseLayer};Bi.prototype.isDestroyed=function(){return!1};Bi.prototype.destroy=function(){return ue(this)};var rxe=new re,ixe=new re,cq=new re,sxe=new re;Bi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return re.intersection(e.rectangle,t)};Bi.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,rxe),a=re.intersection(e.rectangle,s,ixe);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,v=e.rectangle;a=ixe,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=Cit(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,sxe),E=b.tileXYToRectangle(f.x,f.y,m),A=re.intersection(E,s,cq),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,cq),!!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,cq),!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 PC(Y,X,r)),++n}}return!0};Bi.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,rxe),i=c.rectangleToNativeRectangle(i,sxe)}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)};Bi.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,er.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=er.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()};Bi.prototype._createTextureWebGL=function(e,t){let n=new Ot({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})};Bi.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 oxe(e,t,n){return`${e}:${t}:${n}`}Bi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Ht.LINEAR&&i===qn.LINEAR&&!Qe.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=Ht.LINEAR_MIPMAP_LINEAR;let r=wt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=oxe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(_m.NICEST),t.sampler=d}else{let r=oxe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Bi.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 Ui)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new vu({persists:!0,owner:this,preExecute:function(c){Rit(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};Bi.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};Bi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Bi.prototype.getImageryFromCache=function(e,t,n,i){let o=axe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new IC(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Bi.prototype.removeImageryFromCache=function(e){let t=axe(e.x,e.y,e.level);delete this._imageryCache[t]};function axe(e,t,n){return JSON.stringify([e,t,n])}var _B={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},Zit=fn.supportsTypedArrays()?new Float32Array(128):void 0;function Rit(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=it.createIndexBuffer({context:t,typedArray:R,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});o.vertexArray=new Un({context:t,attributes:[{index:Z.position,vertexBuffer:it.createVertexBuffer({context:t,typedArray:_,usage:Pe.STATIC_DRAW}),componentsPerAttribute:2},{index:Z.webMercatorT,vertexBuffer:it.createVertexBuffer({context:t,sizeInBytes:512,usage:Pe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:C});let E=new Je({sources:[$I]});o.shaderProgram=tn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:qI,attributeLocations:Z}),o.sampler=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:qn.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;_B.textureDimensions.x=r,_B.textureDimensions.y=s,_B.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(_m.NICEST);let p=i.south,b=i.north,f=Zit,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=_B,e.vertexArray=o.vertexArray}function Cit(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ui?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 Vit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Eit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Vit(e._errorEvent,i)}}var Cs=Bi;var I4n=x(T(),1),lq=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},eP=lq;var pQn=x(T(),1);var k4n=x(T(),1);var X4n=x(T(),1),dq=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}},XC=dq;var Ait=new re,cxe=new re,Git=new re,Lit=new re,Wit=new re,vit=new re,uq=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,Ait),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),d=Lit;a.rectangleToNativeRectangle(t,d);let u=Wit;a.rectangleToNativeRectangle(s,u);let m=(b,f,y)=>{let _=a.tileXYToRectangle(b,f,y),S=re.intersection(_,s,Git);if(!l(S))return;let Z=vit;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 XC;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,cxe);return l(i)?i:e._clampRectangle(t,n,cxe)}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 XC);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}},NC=uq;var eQn=x(T(),1);var mq=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=Ta.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}}},nS=mq;var nQn=x(T(),1);var hq=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}},tP=hq;var fq=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=it.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=nS.createCartographicPositions(o,s,m),b=nS.computeCartographicBoundingRectangle(p),f=new tP(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=nS.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 NC.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 NC._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(),ue(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}},iS=fq;var gQn=x(T(),1),pq=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},nP=pq;var Fit=!1,Iit=new re,Pit=new re,bq=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=iS._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 eP;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==Cs.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==Cs.DEFAULT_CONTRAST,n.hue|=o.hue!==Cs.DEFAULT_HUE,n.saturation|=o.saturation!==Cs.DEFAULT_SATURATION,n.gamma|=o.gamma!==Cs.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));"]),Fit&&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 nP(t,s,a,d,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,Iit),s=o.rectangleToNativeRectangle(i,Pit);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}},iP=bq;var wQn=x(T(),1);var vQn=x(T(),1),oP=`#ifdef USE_IBL_LIGHTING -vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +else if (czm_morphTime == 0.0) { -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 viewDirection = -normalize(position); -vec3 iblColor = textureIBL(viewDirection, normal, material); -return iblColor; -#endif -return vec3(0.0); +p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); +prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); +next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } -#endif -#ifdef USE_CLEARCOAT -vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +else { -vec3 viewDirection = -normalize(position); -vec3 halfwayDirection = normalize(viewDirection + lightDirection); -vec3 normal = material.clearcoatNormal; -float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); -vec3 f0 = vec3(0.04); -vec3 f90 = vec3(1.0); -float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); -vec3 F = fresnelSchlick2(f0, f90, NdotV); -float roughness = material.clearcoatRoughness; -float alphaRoughness = roughness * roughness; -float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); -vec3 directReflection = F * directStrength * NdotL; -vec3 color = lightColorHdr * directReflection; -#ifdef SPECULAR_IBL -vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); -vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); -color += iblColor * material.occlusion; -#endif -float clearcoatFactor = material.clearcoatFactor; -vec3 clearcoatColor = color * clearcoatFactor; -return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; +p = czm_columbusViewMorph( +czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), +czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), +czm_morphTime); +prev = czm_columbusViewMorph( +czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), +czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), +czm_morphTime); +next = czm_columbusViewMorph( +czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), +czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), +czm_morphTime); } -#endif -#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) -vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +#ifdef DISTANCE_DISPLAY_CONDITION +vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); +vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); +vec3 centerLow = centerLowAndRadius.xyz; +float radius = centerLowAndRadius.w; +vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) { -#ifdef USE_CUSTOM_LIGHT_COLOR -vec3 lightColorHdr = model_lightColorHdr; -#else -vec3 lightColorHdr = czm_lightColorHdr; -#endif -vec3 viewDirection = -normalize(position); -vec3 normal = material.normalEC; -vec3 lightDirection = normalize(czm_lightDirectionEC); -vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); -vec3 directColor = lightColorHdr * directLighting; -vec3 color = directColor + material.emissive; -#ifdef USE_IBL_LIGHTING -color += computeIBL(position, normal, lightDirection, lightColorHdr, material); -#endif -#ifdef USE_CLEARCOAT -color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); -#endif -return color; +lengthSq = czm_eyeHeight2D.y; } -#endif -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +else { -#ifdef LIGHTING_PBR -#ifdef HAS_NORMALS -vec3 color = computePbrLighting(material, attributes.positionEC); -#else -vec3 color = material.diffuse * material.occlusion + material.emissive; -#endif -#ifndef HDR -color = czm_pbrNeutralTonemapping(color); -#endif -#else // unlit -vec3 color = material.diffuse; -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -color = czm_gammaCorrect(color); -#elif !defined(HDR) -color = czm_linearToSrgb(color); +vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); +lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); +} +float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; +float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; +if (lengthSq < nearSq || lengthSq > farSq) +{ +show = 0.0; +} #endif -material.diffuse = color; +float polylineAngle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); +gl_Position = czm_viewportOrthographic * positionWC * show; +v_st.s = texCoord; +v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); +v_width = width; +v_pickColor = pickColor; +v_polylineAngle = polylineAngle; } -`;var IQn=x(T(),1),lxe={UNLIT:0,PBR:1};Object.freeze(lxe);var Jp=lxe;var dxe={name:"LightingPipelineStage"};dxe.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===Jp.PBR?o.addDefine("LIGHTING_PBR",void 0,fe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,fe.FRAGMENT),o.addFragmentLines(oP)};var rP=dxe;var u8n=x(T(),1);var UQn=x(T(),1),sP=`bool isDefaultStyleColor(vec3 color) +`;var sui=x(T(),1);var Kdi=x(T(),1);var od={};od.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};od.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 uct=new pe;od.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,uct).height}return i};var mct=new P,hct=new h,ITe=new h,fct=new cn(h.UNIT_X,0),PTe=new h,pct=new cn(h.UNIT_X,0),bct=new h,gct=new h,Eq=[];function NTe(e,t,n){let i=Eq;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 GB=new pe,AB=new pe,Cx=new h,Aq=new h,yct=new h,Vq=new hb,CX=new Ac;function xct(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Aq),d=i.scaleToGeodeticSurface(t,yct),u=od.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,GB),p=i.cartesianToCartographic(d,AB),b=NTe(u,o,r);Vq.setEndPoints(m,p);let f=Vq.surfaceDistance/u,y=a;m.height=o;let _=i.cartographicToCartesian(m,Cx);h.pack(_,s,y),y+=3;for(let S=1;S<u;S++){let Z=Vq.interpolateUsingSurfaceDistance(S*f,AB);Z.height=b[S],_=i.cartographicToCartesian(Z,Cx),h.pack(_,s,y),y+=3}return y}function Tct(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,GB),d=i.cartesianToCartographic(t,AB),u=od.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=NTe(u,o,r);CX.ellipsoid.equals(i)||(CX=new Ac(void 0,void 0,i)),CX.setEndPoints(c,d);let p=CX.surfaceDistance/u,b=a;c.height=o;let f=i.cartographicToCartesian(c,Cx);h.pack(f,s,b),b+=3;for(let y=1;y<u;y++){let _=CX.interpolateUsingSurfaceDistance(y*p,AB);_.height=m[y],f=i.cartographicToCartesian(_,Cx),h.pack(f,s,b),b+=3}return b}od.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??P.IDENTITY;let o=P.inverseTransformation(t,mct),r=P.multiplyByPoint(o,h.ZERO,hct),s=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_Y,ITe),ITe),a=cn.fromPointNormal(r,s,fct),c=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_X,PTe),PTe),d=cn.fromPointNormal(r,c,pct),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=xi.lineSegmentPlane(m,f,a,bct);if(l(y)){let _=h.multiplyByScalar(s,5e-9,gct);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}};od.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],Aq);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(y,Cx);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+=od.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=xct(y,_,s,i,S,Z,u,m)}Eq.length=0;let p=t[n-1],b=i.cartesianToCartographic(p,GB);b.height=r?o[n-1]:o;let f=i.cartographicToCartesian(b,Cx);return h.pack(f,u,d-3),u};var XTe=new pe,_ct=new pe;od.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],Aq);if(o=r?o[0]:o,o!==0){let Z=i.geodeticSurfaceNormal(S,Cx);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],_ct),a+=od.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=Tct(S,Z,s,i,R,C,p,b)}Eq.length=0;let f=t[n-1],y=i.cartesianToCartographic(f,GB);y.height=r?o[n-1]:o;let _=i.cartographicToCartesian(y,Cx);return h.pack(_,p,m-3),p};od.generateCartesianArc=function(e){let t=od.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};od.generateCartesianRhumbArc=function(e){let t=od.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=od;function wu(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(MTe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=me.fromPoints(this._actualPositions),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new me}var YTe=wu.POSITION_INDEX=0,Sct=wu.SHOW_INDEX=1,Zct=wu.WIDTH_INDEX=2,Rct=wu.MATERIAL_INDEX=3,VX=wu.POSITION_SIZE_INDEX=4,Cct=wu.DISTANCE_DISPLAY_CONDITION=5,MTe=wu.NUMBER_OF_PROPERTIES=6;function ng(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(wu.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,ng(this,Sct))}},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)&&ng(this,VX),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=me.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),ng(this,YTe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,ng(this,Rct))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,ng(this,Zct))}},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,ng(this,VX)}}},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),ng(this,Cct))}}});wu.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[YTe]>0||this._propertiesChanged[VX]>0;if((!P.equals(e,this._modelMatrix)||i)&&(this._segments=oo.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=me.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=P.clone(e,this._modelMatrix),this._segments.positions.length!==t)ng(this,VX);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){ng(this,VX);break}}};wu.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};wu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<MTe-1;++t)e[t]=0};wu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Bm=wu;var Vct=Bm.SHOW_INDEX,Ect=Bm.WIDTH_INDEX,Lq=Bm.POSITION_INDEX,Act=Bm.MATERIAL_INDEX,wTe=Bm.POSITION_SIZE_INDEX,Gct=Bm.DISTANCE_DISPLAY_CONDITION,HTe=Bm.NUMBER_OF_PROPERTIES,Od={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(HTe),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 Wq(this),this._polylines.length}}});yf.prototype.add=function(e){let t=new Bm(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(){vq(this),qTe(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 Wq(this),this._polylines[e]};function Lct(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 g_(t,n,e._polylines.length)}var KTe=new An,JTe=new ce,jTe=new k;yf.prototype.update=function(e){if(Wq(this),this._polylines.length===0||!this.show)return;Xct(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.");Lct(this,t),this._createBatchTable=!1}if(this._createVertexArray||vct(this))DTe(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[wTe]||o[Act])DTe(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[Lq]&&p.writeUpdate(b,i,this._positionBuffer,n);break}b+=u[f].lengthOfPositions}if((o[Vct]||o[Ect])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Lq]||o[wTe]){let f=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=An.fromCartesian(f.center,KTe),_=ce.fromElements(y.low.x,y.low.y,y.low.z,f.radius,JTe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[Gct]){let f=jTe;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<HTe;++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;Wct(this,e,c,r)}};var EX=new me,kTe=new me;function Wct(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=Ict(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=me.clone(EX,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 w=Y[O];w.locator===R&&(N+=w.count)}let M;t.mode===se.SCENE3D?M=v._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?M=v._boundingVolume2D:t.mode===se.SCENE2D?l(v._boundingVolume2D)&&(M=me.clone(v._boundingVolume2D,kTe),M.center.x=0):l(v._boundingVolumeWC)&&l(v._boundingVolume2D)&&(M=me.union(v._boundingVolumeWC,v._boundingVolume2D,kTe)),c?(c=!1,me.clone(M,EX)):me.union(M,EX,EX)}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=me.clone(EX,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 QTe(this),vq(this),qTe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function vct(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Lq]?(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 UTe=[0,0,0];function DTe(e,t,n){e._createVertexArray=!1,vq(e),QTe(e),Pct(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,M=F+D,O=F+M,w=F+O,z=V*(I*W.SIXTY_FOUR_KILOBYTES)-N*I,K=[{index:Od.position3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Od.position3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Od.position2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Od.position2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Od.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Od.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Od.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Od.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Od.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Od.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Od.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Od.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Od.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:J.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:z}],te,H,$,ee;f===se.SCENE3D?(H=e._positionBuffer,te="vertexBuffer",$=UTe,ee="value"):f===se.SCENE2D||f===se.COLUMBUS_VIEW?(H=UTe,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 Fct(e,t){return t instanceof vt?t.id:t}var LB=[];function Ict(e){let t=eo._uniformList[e.type],n=t.length;LB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];LB[i]=r,LB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(LB,Fct)}`}function Pct(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 Xct(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 Wq(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 vq(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 QTe(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 qTe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Gq(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,Z_]}),r=t.getVertexShaderCallback()(RX),s=new Je({defines:i,sources:[wl,r]});this.shaderProgram=nn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Od})};function $Te(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||!$Te(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,zm=new h,Hm=new h,WB=new h,Nct=new ce,Yct=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=WB,h.subtract(Z[0],Z[1],F),h.add(Z[0],F,F)):F=Z[D-1],h.clone(F,zm),h.clone(Z[D],Sa),D===C-1?b._loop?F=Z[1]:(F=WB,h.subtract(Z[C-1],Z[C-2],F),h.add(Z[C-1],F,F)):F=Z[D+1],h.clone(F,Hm);let M=R[A];D===L+M&&(L+=M,++A);let O=D-L===0,w=D===L+R[A]-1;c===se.SCENE2D&&(zm.z=0,Sa.z=0,Hm.z=0),(c===se.SCENE2D||c===se.MORPHING)&&(O||w)&&d-Math.abs(Sa.x)<1&&((Sa.x<0&&zm.x>0||Sa.x>0&&zm.x<0)&&h.clone(Sa,zm),(Sa.x<0&&Hm.x>0||Sa.x>0&&Hm.x<0)&&h.clone(Sa,Hm));let z=O?2:0,K=w?2:4;for(let te=z;te<K;++te){An.writeElements(Sa,e,n),An.writeElements(zm,e,n+6),An.writeElements(Hm,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=Nct;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=Yct;N.x=f,N.y=y?1:0;let g=c===se.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,V=An.fromCartesian(g.center,KTe),G=V.high,v=ce.fromElements(V.low.x,V.low.y,V.low.z,g.radius,JTe),X=jTe;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 Mct=new h,wct=new h,kct=new h,OTe=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=OTe,h.subtract(a[0],a[1],b),h.add(a[0],b,b)):b=a[p-1],b=P.multiplyByPoint(n,b,wct);let f=P.multiplyByPoint(n,a[p],Mct),y;p===d-1?s._loop?y=a[1]:(y=OTe,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,kct);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 Uct=new Array(1);jp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Gq(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=Uct;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 Gq(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 Gq(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 HC={positions:void 0,lengths:void 0},BTe=new Array(1),Dct=new h,Oct=new pe;jp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return BTe[0]=n.length,HC.positions=n,HC.lengths=BTe,HC;$Te(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=Dct;for(let d=0;d<s;++d)a=n[d],c=P.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,Oct)));if(o.length>0){e._boundingVolume2D=me.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return HC.positions=o,HC.lengths=e._segments.lengths,HC};var zTe;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=zTe,c=6*s*3;!l(a)||a.length<c?a=zTe=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=WB,h.subtract(u[0],u[1],y),h.add(u[0],y,y)):y=u[_-1],h.clone(y,zm),h.clone(u[_],Sa),_===s-1?t._loop?y=u[1]:(y=WB,h.subtract(u[s-1],u[s-2],y),h.add(u[s-1],y,y)):y=u[_+1],h.clone(y,Hm);let S=m[b];_===f+S&&(f+=S,++b);let Z=_-f===0,R=_===f+m[b]-1;o===se.SCENE2D&&(zm.z=0,Sa.z=0,Hm.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(Z||R)&&r-Math.abs(Sa.x)<1&&((Sa.x<0&&zm.x>0||Sa.x>0&&zm.x<0)&&h.clone(Sa,zm),(Sa.x<0&&Hm.x>0||Sa.x>0&&Hm.x<0)&&h.clone(Sa,Hm));let C=Z?2:0,E=R?2:4;for(let A=C;A<E;++A)An.writeElements(Sa,a,p),An.writeElements(zm,a,p+6),An.writeElements(Hm,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var xf=yf;function Vx(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 Mu({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(Vx.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 Bct(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),Hct=new h;function Kct(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Bct(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,Hct),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)})}Vx.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 eg(e,c,d,u,m)}};Vx.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 Jct(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=eg.defaultPointSize,s.color=eg.defaultColor,s.pointOutlineColor=eg.defaultPointOutlineColor,s.pointOutlineWidth=eg.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 jct=new U,Qct=new U,qct=new U,$ct=new U,elt=new U,tlt=new U,AX=new Kt,GX=new Kt,Fq=new Ot;Vx.prototype.applyStyle=function(e,t){if(!l(e)){Jct(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,jct)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Qct)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,qct)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,$ct)),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,elt)),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)?(AX.near=a.x,AX.nearValue=a.y,AX.far=a.z,AX.farValue=a.w,s.scaleByDistance=AX):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(GX.near=a.x,GX.nearValue=a.y,GX.far=a.z,GX.farValue=a.w,s.translucencyByDistance=GX):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Fq.near=a.x,Fq.far=a.y,s.distanceDisplayCondition=Fq):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,tlt)),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))}};Vx.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Kct(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)};Vx.prototype.isDestroyed=function(){return!1};Vx.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 LX=Vx;var Rmi=x(T(),1);function ig(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(ig.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 nlt(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 ilt(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 olt=new $n("createVectorTilePolygons",5),rlt=new U;function slt(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,rlt);s[y]=_.toRgba()}a=e._packedBuffer=nlt(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=olt.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];ilt(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),alt(e),e._ready=!0}).catch(b=>{e.isDestroyed()||(e._error=b)})}function alt(e){l(e._primitive)||(e._primitive=new B_({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}ig.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};ig.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};ig.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};ig.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};ig.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=slt(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)};ig.prototype.isDestroyed=function(){return!1};ig.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var WX=ig;var jmi=x(T(),1);var Vmi=x(T(),1),vX=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; +uniform mat4 u_modifiedModelView; +void main() { -return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = u_modifiedModelView * currentPosition; +vec4 prev = u_modifiedModelView * previousPosition; +vec4 next = u_modifiedModelView * nextPosition; +float angle; +vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; } -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +`;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 clt(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 llt=new $n("createVectorTilePolylines",5),KC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function dlt(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=clt(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=llt.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),ult(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function ult(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:KC.previousPosition,vertexBuffer:d,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:KC.currentPosition,vertexBuffer:u,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:KC.nextPosition,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:KC.expandAndWidth,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:2},{index:KC.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 FX=new P,e_e=new h;function mlt(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,e_e),P.setTranslation(FX,e_e,FX),FX},u_highlightColor:function(){return e._highlightColor}})}function hlt(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 flt=`uniform vec4 u_highlightColor; +void main() { -vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); -vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; -return color; + out_FragColor = u_highlightColor; } -#ifdef HAS_NORMAL_TEXTURE -vec2 getNormalTexCoords() +`;function plt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(vX),o=n.getFragmentShaderCallback(!1,void 0,!1)(flt),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:KC})}function blt(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 glt(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 ylt=new U,xlt=U.WHITE,Tlt=!0;Tf.prototype.applyStyle=function(e,t){if(!l(e)){glt(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,ylt):xlt,s.show=l(e.show)?e.show.evaluate(s):Tlt}};Tf.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=dlt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}mlt(this,t),plt(this,t),hlt(this);let n=e.passes;(n.render||n.pick)&&blt(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(),ue(this)};var ES=Tf;var Ihi=x(T(),1);var qmi=x(T(),1),IX=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; +void main() { -vec2 texCoord = TEXCOORD_NORMAL; -#ifdef HAS_NORMAL_TEXTURE_TRANSFORM -texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); -#endif -return texCoord; +float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); +float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); +vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; +vec3 right = normalize(cross(forward, startEllipsoidNormal)); +vec4 position = vec4(startPositionAndHeight.xyz, 1.0); +position.xyz += forward * isEnd; +v_volumeUpEC = czm_normal * normalize(cross(right, forward)); +float offset; +vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); +offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); +offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; +position.xyz += offset * ellipsoidNormal; +position = u_modifiedModelView * position; +right = czm_normal * right; +vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); +scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); +vec3 miterPushNormal = czm_normal * normalize(scratchNormal); +offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); +offset = offset / dot(miterPushNormal, right); +position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); +gl_Position = czm_depthClamp(czm_projection * position); +position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); +vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; +v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); +v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); +position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); +vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; +v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); +v_halfWidth = endFaceNormalAndHalfWidth.w; } -#endif -#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) -vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +`;var ehi=x(T(),1),PX=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; +uniform vec4 u_highlightColor; +void main() { -vec2 tex_dx = dFdx(normalTexCoords); -vec2 tex_dy = dFdy(normalTexCoords); -float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; -vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); -return tangent / determinant; +float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); +if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -#endif -#ifdef USE_ANISOTROPY -struct NormalInfo { -vec3 tangent; -vec3 bitangent; -vec3 normal; -vec3 geometryNormal; -}; -NormalInfo getNormalInfo(ProcessedAttributes attributes) -{ -vec3 geometryNormal = attributes.normalEC; -#ifdef HAS_NORMAL_TEXTURE -vec2 normalTexCoords = getNormalTexCoords(); -#endif -#ifdef HAS_BITANGENTS -vec3 tangent = attributes.tangentEC; -vec3 bitangent = attributes.bitangentEC; -#else // Assume HAS_NORMAL_TEXTURE -vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); -tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); -vec3 bitangent = normalize(cross(geometryNormal, tangent)); -#endif -#ifdef HAS_NORMAL_TEXTURE -mat3 tbn = mat3(tangent, bitangent, geometryNormal); -vec3 normalSample; -#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; -#endif -vec3 normal = normalize(tbn * normalSample); -#else -vec3 normal = geometryNormal; -#endif -#ifdef HAS_DOUBLE_SIDED_MATERIAL -if (czm_backFacing()) { -tangent *= -1.0; -bitangent *= -1.0; -normal *= -1.0; -geometryNormal *= -1.0; +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +eyeCoordinate /= eyeCoordinate.w; +float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); +halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); +float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); +float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); +float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); +if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -#endif -NormalInfo normalInfo; -normalInfo.tangent = tangent; -normalInfo.bitangent = bitangent; -normalInfo.normal = normal; -normalInfo.geometryNormal = geometryNormal; -return normalInfo; +out_FragColor = u_highlightColor; +czm_writeDepthClamp(); } -#endif -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ -vec2 normalTexCoords = getNormalTexCoords(); -#ifdef HAS_BITANGENTS -vec3 t = attributes.tangentEC; -vec3 b = attributes.bitangentEC; -#else -vec3 t = computeTangent(attributes.positionEC, normalTexCoords); -t = normalize(t - geometryNormal * dot(geometryNormal, t)); -vec3 b = normalize(cross(geometryNormal, t)); -#endif -mat3 tbn = mat3(t, b, geometryNormal); -vec3 normalSample; -#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 +`;function og(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(og.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function _lt(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 Slt(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 Zlt=new $n("createVectorTileClampedPolylines"),Ex={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Rlt(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=Slt(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=Zlt.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),Clt(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function Clt(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:Ex.startEllipsoidNormal,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Ex.endEllipsoidNormal,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Ex.startPositionAndHeight,vertexBuffer:b,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Ex.endPositionAndHeight,vertexBuffer:f,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Ex.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Ex.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Ex.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 XX=new P,t_e=new h;function Vlt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,XX),P.multiplyByPoint(XX,e._center,t_e),P.setTranslation(XX,t_e,XX),XX},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function n_e(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 Elt(e){l(e._rs)||(e._rs=n_e(!1),e._rs3DTiles=n_e(!0))}function Alt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(IX),o=n.getFragmentShaderCallback(!1,void 0,!0)(PX),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:Ex})}function Glt(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)}og.prototype.getPositions=function(e){return ES.getPolylinePositions(this,e)};og.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)}};og.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Llt(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 Wlt=new U,vlt=U.WHITE,Flt=!0;og.prototype.applyStyle=function(e,t){if(!l(e)){Llt(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,Wlt):vlt,s.show=l(e.show)?e.show.evaluate(s):Flt}};function Ilt(e){return Pi.initialize().then(function(){_lt(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}og.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Ilt(this).then(Rlt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Vlt(this,t),Alt(this,t),Elt(this);let n=e.passes;(n.render||n.pick)&&Glt(this,e)};og.prototype.isDestroyed=function(){return!1};og.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var NX=og;var whi=x(T(),1);var Iq=32767,Plt=new pe,Xlt=new h;function Nlt(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/Iq),y=W.lerp(t.south,t.north,p/Iq),_=W.lerp(n,i,b/Iq),S=pe.fromRadians(f,y,_,Plt),Z=o.cartographicToCartesian(S,Xlt);h.pack(Z,d,u*3)}return d}var YX=Nlt;var Xq=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,Ult(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)||Pq(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)||Pq(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)||Pq(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 Ylt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Mlt(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 wlt(e){return new ES(e)}function klt(e){return new NX(e)}function Ult(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,Ylt(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=Mlt(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 M=Y.reduce(function(H,$){return H+$*2},0),O=D.reduce(function(H,$){return H+$},0),w=new Uint32Array(t,n,O);n+=m;let z=new Uint16Array(t,n,M);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 WX({positions:z,counts:Y,indexCounts:D,indices:w,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 M=Y.reduce(function(K,te){return K+te*3},0),O=new Uint16Array(t,n,M);n+=b;let w=X.examineVectorLinesFunction;if(l(w)){let K=YX(new Uint16Array(O),I,N,g,ne.WGS84);Dlt(K,Y,v.polylines,A,e.url,w)}let z=wlt;l(X.classificationType)&&(z=klt),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 LX({positions:Y,batchIds:v.points,minimumHeight:N,maximumHeight:g,rectangle:I,batchTable:A,heightReference:X.heightReference,scene:X.scene})}}function Pq(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 Dlt(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 MX=Xq;var cbi=x(T(),1);var ufi=x(T(),1);var{ERR_CAPACITY:lfi}=na.Error,Olt=new h,vB=class vB extends os{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Olt)),i}get vertexOffset(){return this._getUint32(vB.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(vB,"Layout",{...os.Layout,POSITION_OFFSET_U32:os.Layout.__BYTE_LENGTH,__BYTE_LENGTH:os.Layout.__BYTE_LENGTH+4});var Nq=vB,Pc=Nq;var qfi=x(T(),1);var Ofi=x(T(),1);var ffi=x(T(),1),wX=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; #else -normalSample = texture(u_normalTexture, normalTexCoords).rgb; -#endif -normalSample = 2.0 * normalSample - 1.0; -#ifdef HAS_NORMAL_TEXTURE_SCALE -normalSample.xy *= u_normalTextureScale; -#endif -return normalize(tbn * normalSample); -} +in vec3 position; #endif -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +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() { -vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM -normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); -#endif -#ifdef HAS_BITANGENTS -vec3 t = attributes.tangentEC; -vec3 b = attributes.bitangentEC; +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 -vec3 t = computeTangent(attributes.positionEC, normalTexCoords); -t = normalize(t - geometryNormal * dot(geometryNormal, t)); -vec3 b = normalize(cross(geometryNormal, t)); -#endif -mat3 tbn = mat3(t, b, geometryNormal); -vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; -normalSample = 2.0 * normalSample - 1.0; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE -normalSample.xy *= u_clearcoatNormalTextureScale; +vec4 positionEC = czm_modelView * vec4(position, 1.0); #endif -return normalize(tbn * normalSample); +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; } -#endif -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) +`;var bfi=x(T(),1),kX=`in vec4 v_pickColor; +in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerRadiusFrac; +void main() { -vec3 normal = attributes.normalEC; -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -normal = getNormalFromTexture(attributes, normal); -#endif -#ifdef HAS_DOUBLE_SIDED_MATERIAL -if (czm_backFacing()) { -normal = -normal; +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; } -#endif -return normal; +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); } +`;var Tfi=x(T(),1);var UX=class UX extends Jl{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(UX,"Layout",{...Jl.Layout,SIZE_U8:Jl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Jl.Layout.__BYTE_LENGTH+4}),mt(UX,"DEFAULT_MATERIAL",Object.freeze(new UX));var Yq=UX,Sf=Yq;var Mq={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},i_e={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},AS=new Pc,Zf=new Sf,DX=new U,o_e=new h,wq=new An;function Blt(e,t,n){let i=t.context;n=n||{destroy:zlt};let o=e._positionDatatype===J.DOUBLE,r=o?Mq:i_e;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,AS),AS._dirty&&(o&&(AS.getPosition(o_e),An.fromCartesian(o_e,wq),h.pack(wq.high,c,y*3),h.pack(wq.low,d,y*3)),AS.getMaterial(Zf),U.fromRgba(AS._pickId,DX),u[y*4]=U.floatToByte(DX.red),u[y*4+1]=U.floatToByte(DX.green),u[y*4+2]=U.floatToByte(DX.blue),u[y*4+3]=U.floatToByte(DX.alpha),m[y*4]=AS.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,AS._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:Mq.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:Mq.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:i_e.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:[wX],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[kX]}),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 OX=Blt;var kq=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=OX(this,t,this._renderContext))}},Bd=kq;var Ppi=x(T(),1);var Epi=x(T(),1);var epi=x(T(),1),BX=`#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 -#ifdef HAS_BASE_COLOR_TEXTURE -vec4 getBaseColorFromTexture() +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() { -vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; -#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM -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)); +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 -baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); +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 -baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); -#endif -#ifdef HAS_BASE_COLOR_FACTOR -baseColorWithAlpha *= u_baseColorFactor; +vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); #endif -return baseColorWithAlpha; +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; } -#endif -#ifdef HAS_EMISSIVE_TEXTURE -vec3 getEmissiveFromTexture() +`;var npi=x(T(),1),zX=`in vec4 v_pickColor; +in vec4 v_color; +void main() { -vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; -#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM -emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); -#endif -vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); -#ifdef HAS_EMISSIVE_FACTOR -emissive *= u_emissiveFactor; -#endif -return emissive; -} -#endif -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -void setSpecularGlossiness(inout czm_modelMaterial material) +if (v_color.a < 0.005) { -#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE -vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; -#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM -specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); -#endif -vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); -vec3 specular = specularGlossiness.rgb; -float glossiness = specularGlossiness.a; -#ifdef HAS_LEGACY_SPECULAR_FACTOR -specular *= u_legacySpecularFactor; -#endif -#ifdef HAS_GLOSSINESS_FACTOR -glossiness *= u_glossinessFactor; -#endif -#else -#ifdef HAS_LEGACY_SPECULAR_FACTOR -vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); -#else -vec3 specular = vec3(1.0); -#endif -#ifdef HAS_GLOSSINESS_FACTOR -float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); -#else -float glossiness = 1.0; -#endif -#endif -#ifdef HAS_DIFFUSE_TEXTURE -vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; -#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM -diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); -#endif -vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); -#ifdef HAS_DIFFUSE_FACTOR -diffuse *= u_diffuseFactor; -#endif -#elif defined(HAS_DIFFUSE_FACTOR) -vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); -#else -vec4 diffuse = vec4(1.0); -#endif -material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); -material.alpha = diffuse.a; -material.specular = specular; -material.roughness = 1.0 - glossiness; +discard; } -#elif defined(LIGHTING_PBR) -float setMetallicRoughness(inout czm_modelMaterial material) +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var GS={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},FB={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},ul=new ga,HX=new Au,KX=new U,r_e=new h,s_e=new h,a_e=new h,Uq=new An,Dq=new An,Oq=new An;function Hlt(e,t,n){let i=t.context;n=n||{destroy:jlt};let o=e._positionDatatype===J.DOUBLE,r=o?GS:FB;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(HX);let N=dn.encodeRGB8(HX.color),g=HX.color.alpha,V=u?-HX.width:HX.width;U.fromRgba(ul._pickId,KX);let G=ul.show,v=ul.vertexOffset*2,X=(ul.vertexOffset-F)*6,Y=e._positionView,D=ul.vertexOffset*3;for(let M=0,O=ul.vertexCount;M<O;M++){let w=M===0,z=M===O-1,K=Y[D+M*3],te=Y[D+M*3+1],H=Y[D+M*3+2],$,ee,le,_e,he,Ze;w?(_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+(M-1)*3],ee=Y[D+(M-1)*3+1],le=Y[D+(M-1)*3+2],_e=2*K-$,he=2*te-ee,Ze=2*H-le):($=Y[D+(M-1)*3],ee=Y[D+(M-1)*3+1],le=Y[D+(M-1)*3+2],_e=Y[D+(M+1)*3],he=Y[D+(M+1)*3+1],Ze=Y[D+(M+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,r_e),h.fromElements($,ee,le,s_e),h.fromElements(_e,he,Ze,a_e),An.fromCartesian(r_e,Uq),An.fromCartesian(s_e,Dq),An.fromCartesian(a_e,Oq));for(let ye=0;ye<2;ye++)o?(h.pack(Uq.high,Z,v*3),h.pack(Uq.low,R,v*3),h.pack(Dq.high,C,v*3),h.pack(Dq.low,E,v*3),h.pack(Oq.high,A,v*3),h.pack(Oq.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(KX.red),p[v*4+1]=U.floatToByte(KX.green),p[v*4+2]=U.floatToByte(KX.blue),p[v*4+3]=U.floatToByte(KX.alpha),b[v*4]=G?1:0,b[v*4+1]=N,b[v*4+2]=V,b[v*4+3]=M/(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}=Jlt(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:GS.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:GS.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})},{index:GS.prevPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:GS.prevPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Pe.STATIC_DRAW})},{index:GS.nextPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:GS.nextPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:ot.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:FB.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})},{index:FB.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:ot.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Pe.STATIC_DRAW})},{index:FB.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,BX],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[zX]}),attributeLocations:r}));let s=Klt(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 Klt(e){return(e.vertexCount-e.primitiveCount)*6}function Jlt(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 jlt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var JX=Hlt;var Bq=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=JX(this,t,this._renderContext))}},ml=Bq;var jpi=x(T(),1);var kpi=x(T(),1);function JC(e,t){this._conditionsExpression=$e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,qlt(this,t)}Object.defineProperties(JC.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Qlt(e,t){this.condition=e,this.expression=t}function qlt(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 Qlt(new Wm(a,t),new Wm(c,t)))}e._runtimeConditions=n}JC.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)}};JC.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)}};JC.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} { -#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE -vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; -#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM -metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); -#endif -vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; -float metalness = clamp(metallicRoughness.b, 0.0, 1.0); -float roughness = clamp(metallicRoughness.g, 0.0, 1.0); -#ifdef HAS_METALLIC_FACTOR -metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); -#endif -#ifdef HAS_ROUGHNESS_FACTOR -roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); -#endif -#else -#ifdef HAS_METALLIC_FACTOR -float metalness = clamp(u_metallicFactor, 0.0, 1.0); -#else -float metalness = 1.0; -#endif -#ifdef HAS_ROUGHNESS_FACTOR -float roughness = clamp(u_roughnessFactor, 0.0, 1.0); -#else -float roughness = 1.0; -#endif -#endif -const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); -vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); -material.specular = f0; -material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); -material.roughness = roughness; -return metalness; +${r} return ${i}(1.0); +} +`,r};JC.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 jX=JC;function Ax(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,$lt(this,e)}function $lt(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 Wm(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 Wm(String(t));if(typeof t=="string")return new Wm(t,n);if(l(t.conditions))return new jX(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(Ax.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}}});Ax.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new Ax(n)})};Ax.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)};Ax.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)};Ax.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)};Ax.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 rg=Ax;var s0i=x(T(),1);var d_e=new re,c_e=new re,zq=new re,IB=new Map;IB.set(ml,{packCollectionData:Ts.packPolylineCollectionData,packTilePrimitives:Ts.packPolylineSegments});IB.set(Ya,{packCollectionData:Ts.packPolygonCollectionData,packTilePrimitives:Ts.packPolygonRings});var Hq=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 IB.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,d_e);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:edt(t,o.ellipsoid)};for(let[d,u]of r){if(!l_e(u,i))continue;let m=re.fromBoundingSphere(d.boundingVolume,o.ellipsoid,c_e);if(!!!re.intersection(t,m,zq))continue;let b=IB.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 tdt(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(!l_e(c,i))continue;let d=re.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,c_e),u=!!re.intersection(n,d,zq),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 l_e(e,t){return e===He.CLAMP_TO_GROUND||e===t}function edt(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 tdt(e,t,n,i,o){if(i.length===0)return!1;let r=o.tileXYToRectangle(e,t,n,d_e);for(let s=0;s<i.length;s++)if(re.intersection(r,i[s],zq))return!0;return!1}var sg=Hq;var w0i=x(T(),1);var _0i=x(T(),1);var u_e=new Pc,m_e=new ga,h_e=new Ir,ndt=new Sf,idt=new Au,odt=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(Bd,u_e),yield*this._iteratePrimitivesWith(ml,m_e),yield*this._iteratePrimitivesWith(Ya,h_e)}*_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(Bd,u_e,ndt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ml,m_e,idt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Ya,h_e,odt)}*_iterateMaterialsWith(t,n,i){for(let o of this._iteratePrimitivesWith(t,n))o.getMaterial(i),yield i,o.setMaterial(i)}},LS=Kq;var f_e=new h,rdt=new Pc,sdt=new ga,b_e=new Ir;function adt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let o=0;o<n.length;o++)g_e(e,n[o],P.IDENTITY,i);return i}function PB(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function cdt(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:p_e(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=p_e(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 p_e(e){let t=PB(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function ldt(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=ddt(e,t,o);n instanceof Bd?udt(n,i,s,a,c):n instanceof ml?mdt(n,i,s,a,c):n instanceof Ya&&(l(t.vector)?hdt(n,i,s,a,c,t.vector):fdt(n,i,s,c,t.polygon))}function ddt(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 LS(e,c,o.propertyTableId);n.set(c,d)}}return function(c){let d=s[c];if(d!==o.nullFeatureId)return n.get(d)}}function udt(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,f_e);let d=o(c);d&&d.addPrimitiveByCollection(t,s),e.add({position:f_e,pickObject:d,featureId:d?.featureId},rdt)}}function mdt(e,t,n,i,o){let r=PB(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=y_e(n,p,3),f=o(i[s]);f&&f.addPrimitiveByCollection(t,c),e.add({positions:b,pickObject:f,featureId:f?.featureId},sdt),s=d+1,a=0,c++}}function hdt(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},b_e)}}function fdt(e,t,n,i,o){let r=o.loopIndices.constructor,s=new r(o.loopIndices.length),a=PB(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=y_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},b_e)}}function g_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=cdt(d),b=Zt.getAttributeBySemantic(d,dt.POSITION),f=b.normalized??!1,y=b.componentDatatype;u===Ie.POINTS?m=new Bd({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),ldt(e,d,m,i.collections.length-1,i.featuresByTableId.get(S))}let a=t.children;for(let c=0;c<a.length;c++)g_e(e,a[c],r,i)}function y_e(e,t,n,i){let o=PB(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 QX=adt;var XB=new Pc,NB=new ga,YB=new Ir,qX=new Sf,Jq=new Au,x_e=new Eu,T_e=new P,jq=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 Bd).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 rg({color:i}))}applyStyle(t){let n=r=>r instanceof Bd,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,XB);let d=this.getFeature(XB.featureId,s);l(t.show)&&(XB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,qX.color),l(t.pointSize)&&(qX.size=t.pointSize.evaluate(d)),l(t.pointOutlineWidth)&&(qX.outlineWidth=t.pointOutlineWidth.evaluate(d)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(d,qX.outlineColor),XB.setMaterial(qX)}}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,NB);let d=this.getFeature(NB.featureId,s);l(t.show)&&(NB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,Jq.color),l(t.lineWidth)&&(Jq.width=t.lineWidth.evaluate(d)),NB.setMaterial(Jq)}}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,YB);let d=this.getFeature(YB.featureId,s);l(t.show)&&(YB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,x_e.color),YB.setMaterial(x_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&&(bdt(this),this._ready=!0)}P.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,T_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(T_e,this._collectionLocalMatrices[s],a.modelMatrix),!fs(i._heightReference)||!sg.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,ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),s=pdt(t,n,r,o),a=await Nu.fromGltfAsync(s);return a.show=!1,r._model=a,r}};function pdt(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 bdt(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=QX(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Gx=jq;var Agi=x(T(),1);var bgi=x(T(),1);var fbi=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 WS=dc;var Tbi=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 $X=uc;var Ebi=x(T(),1);function gdt(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 bS,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT)}var eN=gdt;var Gbi=x(T(),1),tN=`#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; } -#ifdef USE_SPECULAR -void setSpecular(inout czm_modelMaterial material, in float metalness) -{ -#ifdef HAS_SPECULAR_TEXTURE -vec2 specularTexCoords = TEXCOORD_SPECULAR; -#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM -specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); -#endif -float specularWeight = texture(u_specularTexture, specularTexCoords).a; -#ifdef HAS_SPECULAR_FACTOR -specularWeight *= u_specularFactor; -#endif -#else -#ifdef HAS_SPECULAR_FACTOR -float specularWeight = u_specularFactor; -#else -float specularWeight = 1.0; -#endif -#endif -#ifdef HAS_SPECULAR_COLOR_TEXTURE -vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; -#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM -specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); -#endif -vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; -vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); -#ifdef HAS_SPECULAR_COLOR_FACTOR -specularColorFactor *= u_specularColorFactor; -#endif -#else -#ifdef HAS_SPECULAR_COLOR_FACTOR -vec3 specularColorFactor = u_specularColorFactor; -#else -vec3 specularColorFactor = vec3(1.0); -#endif -#endif -material.specularWeight = specularWeight; -vec3 f0 = material.specular; -vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); -material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); +} +} +return result; } #endif -#ifdef USE_ANISOTROPY -void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) -{ -mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); -float anisotropyStrength = u_anisotropy.z; -vec2 direction = vec2(1.0, 0.0); -#ifdef HAS_ANISOTROPY_TEXTURE -vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; -#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM -anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); -#endif -vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; -direction = anisotropySample.rg * 2.0 - vec2(1.0); -anisotropyStrength *= anisotropySample.b; -#endif -direction = rotation * direction; -mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); -vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); -vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); -material.anisotropicT = anisotropicT; -material.anisotropicB = anisotropicB; -material.anisotropyStrength = anisotropyStrength; +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 -#ifdef USE_CLEARCOAT -void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +v_splitDirection = u_splitDirection; +} +`;var Wbi=x(T(),1),nN=`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 vS=new P,V_e=new P,iN=new P,Ei=new q,oN=new Ne,ydt=new h,xdt=new Ne,Tdt=new h,_dt=1e-12,MB=1e-5,Qq=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"},Sdt=2,Zdt=30,Rdt=3,Cdt=.008726646259971648,Vdt=1;function Edt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Rdt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Vdt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Cdt:!1}function __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 Adt(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 S_e(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function qq(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function Z_e(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Gdt(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 Ldt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function Wdt(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=Ldt(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 vdt(e,t){return e.length===t?e:e.subarray(0,t)}function Fdt(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&&Z_e(e,r,i);let s=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&Z_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 Idt(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=Xdt(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 Pdt(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,Fdt(e,c,t),e._pendingSnapshot=void 0,rd.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 R_e(e,t,n){try{let i=await n,o=S_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(!S_e(e,t))return;e._sorterState=Oa.ERROR,e._sorterError=i}}function Xdt(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 rd(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=wr.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(rd.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)}}});rd.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)};rd.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,qq(this._pendingSnapshot),qq(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)};rd.prototype.isDestroyed=function(){return this._isDestroyed};rd.prototype.onTileLoad=function(e){this._dirty=!0};rd.prototype.onTileVisible=function(e){};rd.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,vS);P.multiplyTransformation(r,e.content.worldTransform,r);let s=P.inverse(o,V_e),a=P.multiplyTransformation(s,r,vS),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&P.equalsEpsilon(a,c,_dt))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)<=Qq&&Math.abs(b-1)<=Qq&&Math.abs(f-1)<=Qq,R=Math.abs(y)<=MB&&Math.abs(_)<=MB&&Math.abs(S)<=MB,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)<=MB;Ne.fromRotationMatrix(Ei,oN),Ne.normalize(oN,oN);let A=Zt.getAttributeBySemantic(n,dt.POSITION).typedArray,L=Zt.getAttributeBySemantic(n,dt.ROTATION).typedArray,F=Zt.getAttributeBySemantic(n,dt.SCALE).typedArray,I=ydt,N=xdt,g=Tdt;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(oN,N,N),Ne.normalize(N,N)):(P.fromTranslationQuaternionRotationScale(I,N,g,iN),P.multiplyTransformation(a,iN,iN),P.getTranslation(iN,I),P.getScale(iN,g),Ne.multiply(oN,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};rd.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Bs.BUILDING)return;n.state=Bs.TEXTURE_PENDING;let i=$X.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}Idt(e,t,n,i)};rd.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new eN(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(tN),o.addFragmentLines(nN);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=_};rd.prototype.update=function(e){let t=this._tileset;if(Gdt(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&&Adt(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>=Sdt,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>=Zdt;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)&&qq(this._pendingSnapshot);let d=t._selectedTiles;this._rootTransform=_t.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=d[0],E=P.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,V_e);P.multiplyTransformation(E,C.content.worldTransform??P.IDENTITY,E),P.getRotation(P.inverse(E,E),this._shInverseRotation)}for(let C of d)rd.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=Wdt(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 vdt(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){rd.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,vS),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=WS.radixSortIndexes({primitive:{positions:new Float32Array(d.positions),modelView:Float32Array.from(vS),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;Pdt(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,vS),!l(this._sorterPromise)){if(!Edt(this,e))return;let d=++this._sortRequestId,u=this._splatDataGeneration,m=this._numSplats;this._activeSort={requestId:d,dataGeneration:u,expectedCount:m};let p=WS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(vS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){__e(this,e);let b=this._activeSort;this._sorterState=Oa.SORTING,R_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=WS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(vS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){__e(this,e);let c=this._activeSort;this._sorterState=Oa.SORTING,R_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)rd.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 rN=rd;var e$=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 rN({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}=Ydt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=o,this._sphericalHarmonicsCoefficientCount=r,this._packedSphericalHarmonicsData=Udt(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 Ndt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Ydt(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 E_e=new ArrayBuffer(4),Mdt=new Float32Array(E_e),wdt=new Uint32Array(E_e);function $q(e){Mdt[0]=e;let t=wdt[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 kdt(e){let t=Ndt(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 Udt(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}=kdt(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]=$q(r[d].typedArray[y])|$q(r[d].typedArray[y+1])<<16,o[f+1]=$q(r[d].typedArray[y+2])}}return o}var Lx=e$;var A_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 W2.fromTileType(e,t,n,i,o,A_e)},externalTileset:function(e,t,n,i){return pX.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new I2(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new MX(e,t,n,i,o)},subt:function(e,t,n,i,o){return j1.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return j1.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 Lx.tilesetRequiresGaussianSplattingExt(e)?Lx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Gx.fromGltf(e,t,n,c):Yu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Lx.tilesetRequiresGaussianSplattingExt(e)?Lx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Gx.fromGltf(e,t,n,i):Yu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Yu.fromGeoJson(e,t,n,i)}},FS=A_e;var kgi=x(T(),1),G_e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(G_e);var Fo=G_e;var Dgi=x(T(),1),Km={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"};Km.isBinaryFormat=function(e){switch(e){case Km.BATCHED_3D_MODEL:case Km.INSTANCED_3D_MODEL:case Km.COMPOSITE:case Km.POINT_CLOUD:case Km.VECTOR:case Km.GEOMETRY:case Km.IMPLICIT_SUBTREE:case Km.VOXEL_BINARY:case Km.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Km);var Za=Km;var Bgi=x(T(),1),L_e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(L_e);var Jm=L_e;var Hgi=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},ag=new Array(Ra.NUMBER_OF_PASSES);ag[Ra.RENDER]=Object.freeze({pass:Ra.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});ag[Ra.PICK]=Object.freeze({pass:Ra.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});ag[Ra.SHADOW]=Object.freeze({pass:Ra.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});ag[Ra.PRELOAD]=Object.freeze({pass:Ra.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[Ra.PRELOAD_FLIGHT]=Object.freeze({pass:Ra.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[Ra.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ra.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[Ra.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ra.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});ag[Ra.MOST_DETAILED_PICK]=Object.freeze({pass:Ra.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ra.getPassOptions=function(e){return ag[e]};Object.freeze(Ra);var lr=Ra;var jgi=x(T(),1);var t$=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)}},Qp=t$;var ayi=x(T(),1);var eyi=x(T(),1);function cg(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(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 sN=cg;function n$(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){n$._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 sN({content:n,class:o})}}n$._oneTimeWarning=xt;var IS=n$;var uyi=x(T(),1);function Ddt(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 PS=Ddt;var Syi=x(T(),1);var pyi=x(T(),1);function lg(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(lg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});lg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};lg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};lg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};lg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};lg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};lg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};lg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var aN=lg;function i$(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){i$._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 aN({tile:n,class:o})}}i$._oneTimeWarning=xt;var cN=i$;var Oyi=x(T(),1);var Gyi=x(T(),1);function Odt(e){let t=new Uint8Array(e),n=qh(t);if(n==="glTF"&&(n="glb"),Za.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Bdt(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 Bdt(e){let t;try{t=vr(e)}catch{throw new ae("Invalid tile content.")}return t}var dg=Odt;var o$=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;r$(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Hdt(this,i,n,this._tile._contentState);return Kdt(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 ue(this)}};function r$(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function W_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 Hdt(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){W_e(e,i);return}return r$(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){W_e(e,i);return}r$(e,-1),v_e(e,t,u)}})}async function Kdt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>Jdt(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 Jdt(e,t,n){if(l(t))try{let i=dg(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=FS[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=IS(o,d));let u=PS(o,d);return l(u)&&(a.group=new k_({metadata:u})),a}catch(i){v_e(e,n,i)}}function v_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 lN=o$;var Yxi=x(T(),1);var xxi=x(T(),1);var exi=x(T(),1);var F_e=Math.cos,I_e=Math.sin,jdt=Math.sqrt,s$={};s$.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=F_e(u),p=I_e(u),b=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,y=m*F_e(f),_=m*I_e(f),S=a.x*y,Z=a.y*_,R=jdt(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 Qdt=new Ji,jm=new h,qdt=new pe,wB=new h,dN=new ki;function P_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;dN._ellipsoid=ne.default,jm=dN.project(e,jm),jm=h.subtract(jm,wB,jm);let b=Ji.fromRotation(t,Qdt);jm=Ji.multiplyByVector(b,jm,jm),jm=h.add(jm,wB,jm),e=dN.unproject(jm,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}}s$.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,qdt);(n!==0||i!==0)&&(C.longitude<R.longitude&&(C.longitude+=W.TWO_PI),dN._ellipsoid=ne.default,wB=dN.project(C,wB));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=P_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=P_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=s$;var $dt=new me,eut=new me,tut=new h,nut=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=tut;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 iut(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=X_e(e,t),s=t.height,a=t.width,c=hi.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let m=hi.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 QC(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"}QC.packedLength=re.packedLength+ne.packedLength+5;QC.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 N_e=new re,Y_e=ne.clone(ne.UNIT_SPHERE),jC={rectangle:N_e,ellipsoid:Y_e,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};QC.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,N_e);t+=re.packedLength;let o=ne.unpack(e,t,Y_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):(jC.granularity=r,jC.height=s,jC.rotation=a,jC.extrudedHeight=c,jC.offsetAttribute=d===-1?void 0:d,new QC(jC))};var out=new pe;QC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ca.computeOptions(t,e._granularity,e._rotation,0,nut,out),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=iut(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=me.fromRectangle3D(t,n,s,eut),m=me.fromRectangle3D(t,n,a,$dt);r=me.union(u,m)}else{if(o=X_e(e,i),o.attributes.position.values=hi.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=me.fromRectangle3D(t,n,s)}return new At({attributes:o.attributes,indices:o.indices,primitiveType:Ie.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var XS=QC;function $C(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;lut(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties($C.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});$C.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=tn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)};var M_e=new h,kB=new h,w_e=new h,rut=new h,sut=new h,aut=new h,cut=new h,Qm=new pe,k_e=new cn(h.UNIT_X,0),qC=new gn;function lut(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,aut),o=h.cross(i,h.UNIT_Z,rut);h.normalize(o,e.westNormal),Qm.longitude=t.east;let r=n.cartographicToCartesian(Qm,cut),s=h.cross(h.UNIT_Z,r,M_e);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,M_e);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,sut),d=t.south,u;if(d>0){Qm.longitude=(t.west+t.east)*.5,Qm.latitude=d;let y=n.cartographicToCartesian(Qm,qC.origin);h.clone(c,qC.direction);let _=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,k_e);xi.rayPlane(qC,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(y,kB)}else u=n.geodeticSurfaceNormalCartographic(re.southeast(t),kB);let m=h.cross(u,a,w_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,qC.origin);h.negate(c,qC.direction);let _=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,k_e);xi.rayPlane(qC,_,e.northeastCornerCartesian),b=n.geodeticSurfaceNormal(y,kB)}else b=n.geodeticSurfaceNormalCartographic(re.northwest(t),kB);let f=h.cross(a,b,w_e);h.normalize(f,e.northNormal)}var dut=new h,uut=new h,mut=new h(0,-1,0),hut=new h(0,0,-1),U_e=new h;function fut(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),dut),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(re.northeast(e.rectangle),uut),u.z=u.y,u.y=u.x,u.x=0,m=mut,b=h.UNIT_Y,p=hut,f=h.UNIT_Z);let y=h.subtract(i,d,U_e),_=h.dot(y,m),S=h.dot(y,p),Z=h.subtract(i,u,U_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)}$C.prototype.distanceToCamera=function(e){let t=fut(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};$C.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};$C.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new XS({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=$C;var RTi=x(T(),1);var aTi=x(T(),1);var Oxi=x(T(),1);var uN={},put=new h,D_e=new h,O_e=new h,B_e=new h,z_e=new tn;uN.validOutline=function(e){let n=tn.fromPoints(e,z_e).halfAxes,i=q.getColumn(n,0,D_e),o=q.getColumn(n,1,O_e),r=q.getColumn(n,2,B_e),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};uN.computeProjectTo2DArguments=function(e,t,n,i){let o=tn.fromPoints(e,z_e),r=o.halfAxes,s=q.getColumn(r,0,D_e),a=q.getColumn(r,1,O_e),c=q.getColumn(r,2,B_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 H_e(e,t,n,i,o){let r=h.subtract(e,t,put),s=h.dot(n,r),a=h.dot(i,r);return k.fromElements(s,a,o)}uN.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=H_e(i[r],e,t,n);return o}};uN.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return H_e(i,e,t,n,o)}};var ug=uN;function but(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 NS(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=oi.computeHierarchyPackedLength(t,h)+1}NS.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new NS(t)};NS.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var gut={polygonHierarchy:{}};NS.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 NS(gut)),n._polygonHierarchy=i,n.packedLength=o,n};NS.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Yo(n,h.equalsEpsilon,!0),n.length<3||!ug.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:but(o[c])});r.push(d)}let s=zn.combineInstances(r)[0],a=me.fromPoints(t.positions);return new At({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var qm=NS;var UB=new pe;function mN(e){let t=Cb.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=Vut(t,n,i,o);this._boundingPlanes=r;let s=Lut(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=f$(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]=f$(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=f$(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();UB=o.cartesianToCartographic(c,UB),UB.height=(i+n)/2,this.center=o.cartographicToCartesian(UB,c),this._boundingSphere=me.fromPoints(s)}var yut=new h,xut=new pe,Tut=new h,_ut=new pe,Sut=new h,Zut=new h,Rut=new h,Cut=new h;function Vut(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,yut),a=i.cartesianToCartographic(r,xut);a.height=n;let c=i.cartographicToCartesian(a,Tut),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,_ut),f.height=t;let _=cn.getPointDistance(d,i.cartographicToCartesian(f,Sut));_<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,Zut),Z=h.subtract(_,b,Cut),R=h.cross(Z,S,Rut);R=h.normalize(R,R),o[2+m]=cn.fromPointNormal(b,R)}return o}var YS=new h,MS=new h,wS=new h,a$=new h,c$=new h,l$=new h,Eut=new h,Aut=new h,Gut=new h,d$=new h,u$=new h,m$=new h,Wx=new h,qp=new q;function K_e(e,t,n){YS=e.normal,MS=t.normal,wS=n.normal,a$=h.multiplyByScalar(e.normal,-e.distance,a$),c$=h.multiplyByScalar(t.normal,-t.distance,c$),l$=h.multiplyByScalar(n.normal,-n.distance,l$),d$=h.multiplyByScalar(h.cross(MS,wS,Eut),h.dot(a$,YS),d$),u$=h.multiplyByScalar(h.cross(wS,YS,Aut),h.dot(c$,MS),u$),m$=h.multiplyByScalar(h.cross(YS,MS,Gut),h.dot(l$,wS),m$),qp[0]=YS.x,qp[1]=MS.x,qp[2]=wS.x,qp[3]=YS.y,qp[4]=MS.y,qp[5]=wS.y,qp[6]=YS.z,qp[7]=MS.z,qp[8]=wS.z;let i=q.determinant(qp);return Wx=h.add(d$,u$,Wx),Wx=h.add(Wx,m$,Wx),new h(Wx.x/i,Wx.y/i,Wx.z/i)}function Lut(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=K_e(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=K_e(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var h$=new h,eV=new h;function f$(e,t){let n=[];for(let i=0;i<4;i++)h$=h.subtract(t[(i+1)%4],t[i],h$),eV=h.cross(e.normal,h$,eV),eV=h.normalize(eV,eV),n[i]=h.clone(eV);return n}Object.defineProperties(mN.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var p$=new h;mN.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=b$(cn.projectPointOntoPlane(c,t,p$),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=J_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=b$(cn.projectPointOntoPlane(c,t,p$),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=b$(cn.projectPointOntoPlane(this._boundingPlanes[1],t,p$),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 Wut=new h,vut=new h;function J_e(e,t,n){let i=h.subtract(n,t,Wut),o=h.subtract(e,t,vut),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 Fut=new cn(h.UNIT_X,0);function b$(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],Fut);cn.getPointDistance(d,e)<0||(a=J_e(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}mN.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};mN.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new qm({polygonHierarchy:{positions:this._planeVertices[0]}}),i=qm.createGeometry(n),o=new Yt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),r=new qm({polygonHierarchy:{positions:this._planeVertices[1]}}),s=qm.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 qm({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=qm.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 hN=mN;var t_i=x(T(),1);var OTi=x(T(),1);var MTi=x(T(),1);var Iut=new h(1,1,1),DB=Math.cos,OB=Math.sin;function tV(e){e=e??B.EMPTY_OBJECT;let t=e.radii??Iut,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"}tV.packedLength=2*h.packedLength+8;tV.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 j_e=new h,Q_e=new h,mg={radii:j_e,innerRadii:Q_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};tV.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,j_e);t+=h.packedLength;let o=h.unpack(e,t,Q_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):(mg.minimumClock=r,mg.maximumClock=s,mg.minimumCone=a,mg.maximumCone=c,mg.stackPartitions=d,mg.slicePartitions=u,mg.subdivisions=m,mg.offsetAttribute=p===-1?void 0:p,new tV(mg))};tV.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]=OB(L),N[C]=DB(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]=OB(A),V[C]=DB(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]=OB(L),N[C]=DB(L);for(g.length=d,V.length=d,C=0;C<d;C++)A=i+C*(o-i)/(d-1),g[C]=OB(A),V[C]=DB(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:me.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Uu=tV;function nV(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"}nV.packedLength=Uu.packedLength;nV.pack=function(e,t,n){return Uu.pack(e._ellipsoidGeometry,t,n)};var Put=new Uu,kS={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};nV.unpack=function(e,t,n){let i=Uu.unpack(e,t,Put);return kS.stackPartitions=i._stackPartitions,kS.slicePartitions=i._slicePartitions,kS.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,kS.radii),n._ellipsoidGeometry=new Uu(kS),n):(kS.radius=i._radii.x,new nV(kS))};nV.createGeometry=function(e){return Uu.createGeometry(e._ellipsoidGeometry)};var hg=nV;function iV(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new me(e,t)}Object.defineProperties(iV.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}}});iV.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};iV.prototype.intersectPlane=function(e){return me.intersectPlane(this._boundingSphere,e)};iV.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};iV.prototype.createDebugVolume=function(e){let t=new hg({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 fg=iV;var f_i=x(T(),1);var Xut=new h,Nut=new h,Yut=new h,Mut=new h;function US(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function g$(e,t){let n=h.normalize(e,Mut),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return US(e,i,t)}function q_e(e){let t=q.getColumn(e,0,Xut),n=q.getColumn(e,1,Nut),i=q.getColumn(e,2,Yut),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=US(n,i,t):!o&&r&&!s?n=US(t,i,n):!o&&!r&&s?i=US(n,t,i):o?r?s||(t=g$(i,t),n=US(i,t,n)):(t=g$(n,t),i=US(n,t,i)):(n=g$(t,n),i=US(n,t,i)),q.setColumn(e,0,t,e),q.setColumn(e,1,n,e),q.setColumn(e,2,i,e),e)}function oV(e,t){t=q_e(t),this._orientedBoundingBox=new tn(e,t),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(oV.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});oV.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};oV.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};oV.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=q_e(t),q.clone(t,this._orientedBoundingBox.halfAxes),me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};oV.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 zd=oV;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=cN(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(r)y=Fo.UNLOADED,_=ve.createIfNeeded(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,S=E)}else b=new Qp(e,this),f=!0,y=Fo.READY;this._content=b,this._contentResourceValue=_,this._contentBaseResource=l(S)?t:void 0,this._contentUri=S,this._contentState=y,this._expiredContent=void 0,this._serverKeyValue=void 0,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;function $_e(e){let t=ve.createIfNeeded(e._contentBaseResource).getDerivedResource({url:e._contentUri});e._contentResourceValue=t,e._serverKeyValue=Hc.getServerKey(t.getUrlComponent()),e._contentBaseResource=void 0,e._contentUri=void 0}Object.defineProperties(dr.prototype,{_contentResource:{get:function(){return l(this._contentUri)&&$_e(this),this._contentResourceValue},set:function(e){this._contentResourceValue=e,this._contentBaseResource=void 0,this._contentUri=void 0}},_serverKey:{get:function(){return l(this._contentUri)&&$_e(this),this._serverKeyValue},set:function(e){this._serverKeyValue=e}},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 vx=new h;function wut(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,vx),c=h.add(s.positionWC,a,vx),d=h.subtract(c,r,vx);if(h.magnitude(d)>o){let C=h.normalize(d,vx),E=h.multiplyByScalar(C,o,vx),A=h.add(r,E,vx),L=h.subtract(A,s.positionWC,vx),F=h.normalize(L,vx);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 rSe=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 kut(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 Uut(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=Uut(n,this),this._priorityProgressiveResolution=kut(n,this),this.priorityDeferred=wut(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};dr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(rSe);Q.lessThan(this.expireDate,e)&&(this._contentState=Fo.EXPIRED,this._expiredContent=this._content)}};function Dut(e){if(!l(e.expireDuration))return;let t=Q.now(rSe);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 Out(e){return function(){return e._priority}}dr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?But(this):Hut(this)};function But(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 lN(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(sSe(e,a))return i&&(e.expireDate=void 0),e._content=new Qp(t,e),eSe(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 Kut(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof Qp&&eSe(e),e._contentState=Fo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Fo.FAILED,a}}function Hut(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:Out(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 sSe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function eSe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}dr._isEmptyTile=sSe;async function Kut(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=dg(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=FS[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=IS(n,a));let c=PS(n,a);return l(c)&&(r.group=new k_({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 aSe=new me;function x$(e,t){if(t.mode!==se.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,aSe);e._boundingVolume2D=new fg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Jut(e,t){if(t.mode!==se.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,aSe);e._contentBoundingVolume2D=new fg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}dr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=x$(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=Jut(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 x$(this,e).distanceToCamera(e)};var jut=new h;dr.prototype.distanceToTileCenter=function(e){let n=x$(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,jut);return h.dot(e.camera.directionWC,i)};dr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var cSe=new q,lSe=new h,Qut=new q,T$=new h,dSe=new re,uSe=new tn,y$=new P;function qut(e,t,n){let i=h.fromElements(e[0],e[1],e[2],T$),o=q.fromArray(e,3,Qut);i=P.multiplyByPoint(t,i,i);let r=P.getMatrix3(t,cSe);return o=q.multiply(r,o,o),l(n)?(n.update(i,o),n):new zd(i,o)}function tSe(e,t,n,i){let o=re.unpack(e,0,dSe),r=e[4],s=e[5],a=tn.fromRectangle(o,r,s,ne.WGS84,uSe),c=a.center,d=a.halfAxes;t=P.multiplyTransformation(t,P.inverseTransformation(n,y$),y$),c=P.multiplyByPoint(t,c,c);let u=P.getMatrix3(t,cSe);return d=q.multiply(u,d,d),l(i)&&i instanceof zd?(i.update(c,d),i):new zd(c,d)}function $ut(e,t,n,i){if(!P.equalsEpsilon(t,n,W.EPSILON8))return i instanceof zd?tSe(e,t,n,i):tSe(e,t,n,void 0);let o=re.unpack(e,0,dSe);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 emt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],T$),o=e[3];i=P.multiplyByPoint(t,i,i);let r=P.getScale(t,lSe),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new fg(i,o)}dr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=rx.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 hN(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=qut(r,t,n);return this._verticalExaggeration!==1&&nSe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=$ut(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof zd?nSe(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=emt(a,t,n);if(this._verticalExaggeration!==1){let d=_o.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,T$),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var tmt=h.unpackArray(new Array(24).fill(0));function nSe(e,t,n){let i=e.boundingVolume.computeCorners(tmt).map(r=>_o.getPosition(r,ne.WGS84,t,n,r)),o=tn.fromPoints(i,uSe);e.update(o.center,o.halfAxes)}dr.prototype.updateTransform=function(e,t){e=e??P.IDENTITY;let n=P.multiplyTransformation(e,this.transform,y$),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,lSe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function nmt(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 imt(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 omt(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 rmt(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;omt(this,e),rmt(this,e),nmt(this,e,t,n),imt(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 iSe=[];dr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Dut(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=iSe;try{this._content.update(e,t)}catch(i){throw this._contentState=Fo.FAILED,i}iSe.length=0,t.commandList=n};function oSe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function BB(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=BB(this._depth,n.depth,i.depth);Z=t?1-Z:Z;let C=!e.isSkippingLevelOfDetail&&this.refine===xr.REPLACE?BB(this._priorityHolder._distanceToCamera,n.distance,i.distance):BB(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=oSe(C,a,s),A=this._priorityProgressiveResolution?0:p,L=BB(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),F=oSe(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(),ue(this)};var $m=dr;var ZSi=x(T(),1);var mSi=x(T(),1);function pg(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(pg.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}}});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 rV=pg;var gSi=x(T(),1);function bg(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(bg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};bg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};bg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};bg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};bg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};bg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};bg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var fN=bg;function mSe(e){e=e??B.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new fN({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 rV({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 rV({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(mSe.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 DS=mSe;var GSi=x(T(),1);var hSe={},smt=new h;hSe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof zd||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 zd||a instanceof ku)){e._optimChildrenWithinParent=Jm.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,smt),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 pN=hSe;var XSi=x(T(),1);var vSi=x(T(),1);function bN(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(bN.prototype,{length:{get:function(){return this._length}}});function amt(e,t,n){this.item=e,this.previous=t,this.next=n}bN.prototype.add=function(e){let t=new amt(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 fSe(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}bN.prototype.remove=function(e){l(e)&&(fSe(this,e),--this._length)};bN.prototype.splice=function(e,t){if(e===t)return;fSe(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 gN=bN;function Fx(){this._list=new gN,this._sentinel=this._list.add(),this._trimTiles=!1}Fx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Fx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Fx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Fx.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Fx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Fx.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)}};Fx.prototype.trim=function(){this._trimTiles=!0};var yN=Fx;var USi=x(T(),1);function zB(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 S$(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}zB.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=S$(e,n),this._referenceMaximum[n]=S$(t,n)};function cmt(e,t){let n=e.tilePropertyName;if(l(n)){let i=S$(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 _$=[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)];zB.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=cmt(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=_$.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),b=u-m,f=_$[m],y=_$[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=_};zB.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 xN=zB;var zSi=x(T(),1);function sV(){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}sV.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};sV.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])}};sV.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])}};sV.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])}};sV.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=sV;var JSi=x(T(),1);function TN(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(TN.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});TN.prototype.makeDirty=function(){this._styleDirty=!0};TN.prototype.resetDirty=function(){this._styleDirty=!1};TN.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 _N=TN;var qSi=x(T(),1);function pSe(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}pSe.maximumFrameNumber=15e6;var Ix=pSe;var sZi=x(T(),1);function lmt(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=dmt(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=umt(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 dmt(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 umt(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=lmt;var fZi=x(T(),1);var lZi=x(T(),1);var SN={};function bSe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function Z$(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function gSe(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 R$(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}SN.encode2D=function(e,t){return(bSe(e)|bSe(t)<<1)>>>0};SN.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=gSe(e),t[1]=gSe(e>>1),t};SN.encode3D=function(e,t,n){return Z$(e)|Z$(t)<<1|Z$(n)<<2};SN.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=R$(e),t[1]=R$(e>>1),t[2]=R$(e>>2),t};var Px=SN;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?Px.encode3D(this.x,this.y,this.z):Px.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 ySe=[0,0,0];Zr.fromMortonIndex=function(e,t,n,i){let o;return e===Us.OCTREE?(o=Px.decode3D(i,ySe),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Px.decode2D(i,ySe),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 EZi=x(T(),1);var _Zi=x(T(),1);function gg(){}gg.selectTiles=function(e,t){ge.throwInstantiationError()};gg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};gg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};gg.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)};gg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};gg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};gg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!mmt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function mmt(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}gg.updateTile=function(e,t){xSe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,pmt(e),e._shouldSelect=!1,e._finalResolution=!0};function xSe(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];xSe(r,t),e._visible=r._visible;return}if(hmt(e,t)){e._visible=!1;return}let i=e.refine===xr.REPLACE,o=e._optimChildrenWithinParent===Jm.USE_OPTIMIZATION;if(i&&o&&n&&!fmt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function hmt(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 fmt(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 pmt(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=gg;function TSe(){}var ZN={stack:new Bl,stackMaximumLength:0};TSe.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=ZN.stack;for(s.push(i);s.length>0;){ZN.stackMaximumLength=Math.max(ZN.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===xr.ADD,d=a.refine===xr.REPLACE,u=bmt(a);u&&gmt(a,s,t),(c||d&&!u)&&(ymt(e,a),o(a,t),xmt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return ZN.stack.trim(ZN.stackMaximumLength),n};function bmt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function gmt(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 ymt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function xmt(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var RN=TSe;var FZi=x(T(),1);function _Se(){}var CN={stack:new Bl,stackMaximumLength:0},VN={stack:new Bl,stackMaximumLength:0};_Se.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;_mt(n,t),CN.stack.trim(CN.stackMaximumLength),VN.stack.trim(VN.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function C$(e,t){e.contentAvailable&&Ba.selectTile(e,t)}function Tmt(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:_=Smt(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 _mt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ba,a=CN.stack;for(a.push(e);a.length>0;){CN.stackMaximumLength=Math.max(CN.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?Tmt(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===xr.ADD?(C$(c,t),o(c,t)):c.refine===xr.REPLACE&&(o(c,t),m&&C$(c,t)):(n._emptyTiles.push(c),o(c,t),m&&C$(c,t)),r(c,t),s(c,t)}}function Smt(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ba,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=VN.stack;for(c.push(e);c.length>0;){VN.stackMaximumLength=Math.max(VN.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 EN=_Se;var MZi=x(T(),1);function SSe(){}var AN={stack:new Bl,stackMaximumLength:0},GN={stack:new Bl,stackMaximumLength:0},yg={stack:new Bl,stackMaximumLength:0,ancestorStack:new Bl,ancestorStackMaximumLength:0},Zmt=2;SSe.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;Gmt(n,t),Lmt(n,t),AN.stack.trim(AN.stackMaximumLength),GN.stack.trim(GN.stackMaximumLength),yg.stack.trim(yg.stackMaximumLength),yg.ancestorStack.trim(yg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Rmt(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ba,r=GN.stack;for(r.push(e);r.length>0;){GN.stackMaximumLength=Math.max(GN.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<Zmt&&r.push(d))}}}function HB(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Rmt(e,t)}function Cmt(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 Vmt(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 Emt(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 Amt(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 Gmt(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=AN.stack;for(c.push(e);c.length>0;){AN.stackMaximumLength=Math.max(AN.stackMaximumLength,c.length);let d=c.pop();Cmt(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?Emt(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===xr.ADD?(HB(d,t),r(d,t)):d.refine===xr.REPLACE&&(Amt(d,i)?(r(d,t),p&&HB(d,t)):p?(HB(d,t),r(d,t)):Vmt(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&HB(d,t)),s(d,t),a(d,t)}}function Lmt(e,t){let{selectTile:n,canTraverse:i}=Ba,{stack:o,ancestorStack:r}=yg,s;for(o.push(e);o.length>0||r.length>0;){if(yg.stackMaximumLength=Math.max(yg.stackMaximumLength,o.length),yg.ancestorStackMaximumLength=Math.max(yg.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 LN=SSe;var QZi=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 ZSe(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);ZSe(this,t,t+1)};Va.prototype.lower=function(e){let t=KB(this._layers,e);ZSe(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 RSe=new re;function CSe(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=RSe,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(CSe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};var Wmt=new re,vmt=new re,V$=new k,E$=new k,Fmt=new pe,Imt=new pe;function Pmt(e,t,n,i){let o=n.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(e,Wmt),s=1/1024,a=vmt;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;V$.x=a.west,V$.y=a.south,E$.x=a.east,E$.y=a.north;let d=c.unproject(V$,Fmt),u=c.unproject(E$,Imt);return i.west=d.longitude,i.south=d.latitude,i.east=u.longitude,i.north=u.latitude,i}function Xmt(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=Pmt(_,m.textureCoordinateRectangle,b,RSe);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)&&CSe(t,o,!0,function(c){a(c)}),l(i)&&Xmt(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),ue(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 OS=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 yN,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 Bl,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 _N,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 xN(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 OS(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=Pd.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Up(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Nb,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"),LSe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new w_,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Ib(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??wr.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"),LSe(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,PSe(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 Nmt(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,PSe(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=VSe(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=VSe(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&pN.checkChildrenWithinParent(c)}return s};function VSe(e,t,n,i){if(!(l(n.implicitTiling)||no(n,"3DTILES_implicit_tiling")))return new $m(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 $m(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function Nmt(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 DS({schema:i.schema,metadataJson:n});return Ni.unload(i),o}var ESe=new h,Ymt=new pe,Mmt=new P,wmt=new h,kmt=new h,Umt=new h,Dmt=new h;function Omt(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,ESe),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let y=P.inverseTransformation(c.computedTransform,Mmt),_=t.mapProjection.ellipsoid,S=d.boundingVolume,Z=P.multiplyByPoint(y,S.center,wmt);if(h.magnitude(Z)>_.minimumRadius){let R=pe.fromCartesian(Z,_,Ymt);n=h.normalize(a.positionWC,ESe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=R.height*2}else{let R=P.multiplyByPoint(y,a.positionWC,kmt);if(n=h.UNIT_Z,i=P.multiplyByPointAsVector(y,a.directionWC,Umt),i=h.normalize(i,i),o=R.z,d instanceof zd){let C=q.getColumn(S.halfAxes,2,Dmt),E=h.magnitude(C);r=Z.z-E,s=Z.z+E}else if(d instanceof fg){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 Bmt(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=>{WSe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?FSe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function GSe(e,t){return e._priority-t._priority}ur.prototype.postPassesUpdate=function(e){l(this._root)&&(zmt(this,e),dht(this,e),this._cache.unloadTiles(this,ISe),cht(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function LSe(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;$mt(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&&Omt(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 Hmt(e){let t=e._requestedTiles;t.sort(GSe);for(let n=0;n<t.length;++n)Bmt(e,t[n])}function WSe(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 Kmt(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 Jmt=new pe,jmt=new pe,Qmt=new h;function qmt(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,Jmt),u=pe.fromCartesian(o.center,c,jmt);l(u)&&(d.height=u.height);let m=pe.toCartesian(d,c,Qmt);h.distance(m,o.center)<=o.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function $mt(e,t){Kmt(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,WSe(u,e,d)}}e.totalMemoryUsageInBytes<i?tht(e):a&&n.length>0&&eht(e)}function eht(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(GSe)}function tht(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var JB=new h,nht={maximumFractionDigits:3};function ASe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,nht):Math.round(t).toLocaleString()}function A$(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,JB);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,JB);r=h.multiplyByScalar(r,.75*n,JB),o=h.add(r,i,JB)}return o}function G$(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: ${ASe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${ASe(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 iht(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:A$(e.debugPickedTile),a=G$(e.debugPickedTile,e,s);a.pixelOffset=new k(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];G$(a,e,A$(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&G$(a,e,A$(a))}}e._tileDebugLabels.update(t)}function oht(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 mi({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),qmt(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),iht(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var vSe=[],rht=[];function FSe(e,t){let n=t,i=vSe;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&&(lht(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function ISe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function jB(e,t){let n=e-t;return n<0?n+Ix.maximumFrameNumber:n}var sht=64;function aht(e,t,n){let i=rht;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(jB(t,o._visitedFrame),jB(t,o._touchedFrame),jB(t,o._selectedFrame),jB(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 cht(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,o=e._externalTilesetIdleFrames,r=e._externalTilesetSweepCount,s=0,a=0;for(;s<r&&a<sht&&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,!aht(d,i,o)&&(FSe(e,d),d.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function lht(e,t){e._cache.unloadTile(e,t,ISe),t.destroy()}ur.prototype.trimLoadedTiles=function(){this._cache.trim()};function dht(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 uht(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 mht(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 hht(e,t,n,i){if(t.mode===se.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,uht(e),mht(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Hmt(e),oht(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 PSe(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?RN:this.isSkippingLevelOfDetail?LN:EN};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=hht(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=vSe;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)};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 fht=new gn,pht=new h,bht=new h,ght=new pe;ur.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=fht,o=n.cartographicToCartesian(e,pht),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,bht,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,ght)?.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 yht=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,yht);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 xht=new P;function Xx(e,t){t.collectionChanged.addEventListener(Xx.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new wt,this._onCollectionChanged(t,t.values,[],[])}Xx.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,xht),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],Tht(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};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Xx.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)L$(this,e[i],t,n);return ue(this)};Xx.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?(me.clone(i.boundingSphere,t),Wt.DONE):Wt.FAILED:Wt.PENDING};Xx.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):(L$(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],L$(this,r,a,c),s.remove(r.id)};function L$(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function Tht(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 WN=Xx;var G1i=x(T(),1);var _ht=U.WHITE,Sht=U.BLACK,Zht=new k(2,2);function aV(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(aV.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")});aV.prototype.getType=function(e){return"Checkerboard"};var Rht=new Q;aV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Rht)),l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,_ht,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,Sht,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,Zht),t};aV.prototype.equals=function(e){return this===e||e instanceof aV&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var cV=aV;var H1i=x(T(),1);var w1i=x(T(),1);var XSe={id:void 0};function vN(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 wt,this._addedEntities=new wt,this._removedEntities=new wt,this._changedEntities=new wt,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--,vN(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),vN(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),vN(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(),vN(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)||(XSe.id=e,t=new er(XSe),this.add(t)),t};hl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),vN(this)};var za=hl;var QB={id:void 0},lV=new Array(2);function W$(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 NSe(e,t,n,i){lV[0]=n,lV[1]=i.id,t[JSON.stringify(lV)]=i.definitionChanged.addEventListener(Rs.prototype._onDefinitionChanged,e)}function YSe(e,t,n,i){lV[0]=n,lV[1]=i.id;let o=JSON.stringify(lV);t[o](),t[o]=void 0}function Nx(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],YSe(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],NSe(e,p,b,s);let y=m.getById(s.id);l(y)||(y=u.getById(s.id),l(y)?W$(y):(QB.id=s.id,y=new er(QB)),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={},Nx(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),Nx(this)};Rs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Nx(this),!0):!1};Rs.prototype.removeAllCollections=function(){this._collections.length=0,Nx(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 qB(e,t){return e.indexOf(t)}function MSe(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,Nx(e)}Rs.prototype.raiseCollection=function(e){let t=qB(this._collections,e);MSe(this,t,t+1)};Rs.prototype.lowerCollection=function(e){let t=qB(this._collections,e);MSe(this,t,t-1)};Rs.prototype.raiseCollectionToTop=function(e){let t=qB(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Nx(this))};Rs.prototype.lowerCollectionToBottom=function(e){let t=qB(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Nx(this))};Rs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Rs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Nx(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];YSe(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),W$(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];NSe(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)?W$(d):(QB.id=y,d=new er(QB),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 v$=Rs;var _Ci=x(T(),1);var fCi=x(T(),1);var J1i=x(T(),1);function F$(){this._removalFunctions=[]}F$.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)}};F$.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Hr=F$;var sCi=x(T(),1);function X$(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 I$=new Cn;Cs.prototype.indexOf=function(e){let t=this._intervals;I$.start=e,I$.stop=e;let n=Eo(t,I$,X$);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,X$);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,X$);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,FN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function P$(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),FN[2]=Il(d)?29:28;a>FN[c]||c>=13;)a>FN[c]&&(a-=FN[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),FN[2]=Il(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 Cht=new Q,Vht=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function wSe(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(Vht);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,Cht),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var IN=new vh;Cs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!wSe(n[2],IN))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=P$(s,IN),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)(wSe(i[d],IN)||d===0)&&(o&&l(a)?s=P$(a,IN):s=P$(n,IN),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 Eht(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 BS(){this._eventHelper=new Hr,this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(BS.prototype._intervalsChanged,this)}Object.defineProperties(BS.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Aht=new Q;BS.prototype.getValue=function(e,t){l(e)||(e=Q.now(Aht));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};BS.prototype.equals=function(e){return this===e||e instanceof BS&&this._intervals.equals(e._intervals,j.equals)};BS.prototype._intervalsChanged=function(){Eht(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var pl=BS;function Yx(){this._definitionChanged=new Se,this._composite=new pl,this._composite.definitionChanged.addEventListener(Yx.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Yx.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Yx.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Ght=new Q;Yx.prototype.getValue=function(e,t){l(e)||(e=Q.now(Ght));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Yx.prototype.equals=function(e){return this===e||e instanceof Yx&&this._composite.equals(e._composite,j.equals)};Yx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var dV=Yx;var GCi=x(T(),1);function Mx(e){this._referenceFrame=e??Oi.FIXED,this._definitionChanged=new Se,this._composite=new pl,this._composite.definitionChanged.addEventListener(Mx.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Mx.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 Lht=new Q;Mx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Lht)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Mx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Mx.prototype.equals=function(e){return this===e||e instanceof Mx&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};Mx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var mc=Mx;var REi=x(T(),1);var RVi=x(T(),1);var WCi=x(T(),1),kSe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(kSe);var ro=kSe;var nVi=x(T(),1);var zCi=x(T(),1);var hc=[new h,new h],Wht=new h,vht=new h,Fht=new h,Iht=new h,Pht=new h,Xht=new h,Nht=new h,Yht=new h,Mht=new h,uV=new h,$B=new h,PN={},N$=new pe;function wht(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];N$=t.cartesianToCartographic(o,N$),n[i]=N$.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Y$(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 e3=new h,t3=new h;function kht(e,t,n,i){let o=new Ms(n,i),r=o.projectPointOntoPlane(h.add(n,e,e3),e3),s=o.projectPointOntoPlane(h.add(n,t,t3),t3),a=k.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var Uht=new h(-1,0,0),zS=new P,Dht=new P,M$=new q,Oht=q.IDENTITY.clone(),Bht=new h,zht=new ce,USe=new h;function xg(e,t,n,i,o,r,s,a){let c=Bht,d=zht;zS=_t.eastNorthUpToFixedFrame(e,o,zS),c=P.multiplyByPointAsVector(zS,Uht,c),c=h.normalize(c,c);let u=kht(c,t,e,o);M$=q.fromRotationZ(u,M$),USe.z=r,zS=P.multiplyTransformation(zS,P.fromRotationTranslation(M$,USe,Dht),zS);let m=Oht;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(zS,d,d),i.push(d.x,d.y,d.z);return i}var Hht=new h;function w$(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,Hht);i=xg(c,t,n,i,o,r[a/3],s,1)}return i}function Kht(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 DSe(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 OSe=new Ne,BSe=new h,zSe=new q;function HSe(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,uV),h.subtract(n,e,$B)),m=i===ro.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=q.fromQuaternion(Ne.fromAxisAngle(h.negate(e,uV),u/(m+1),OSe),zSe):p=q.fromQuaternion(Ne.fromAxisAngle(e,u/(m+1),OSe),zSe);let b,f;if(t=h.clone(t,BSe),m>0){let y=d?2:1;for(let _=0;_<m;_++)t=q.multiplyByVector(p,t,t),b=h.subtract(t,e,uV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,$B),s=xg(f,b,a,s,r,c,1,y)}else b=h.subtract(t,e,uV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,$B),s=xg(f,b,a,s,r,c,1,1),n=h.clone(n,BSe),b=h.subtract(n,e,uV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(n,$B),s=xg(f,b,a,s,r,c,1,1);return s}PN.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};PN.angleIsGreaterThanPi=function(e,t,n,i){let o=new Ms(n,i),r=o.projectPointOntoPlane(h.add(n,e,e3),e3),s=o.projectPointOntoPlane(h.add(n,t,t3),t3);return s.x*r.y-s.y*r.x>=0};var Jht=new h,jht=new h;PN.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=wht(e,r),a=i._granularity,c=i._cornerType,d=o?Kht(t,n):DSe(t,n),u=o?DSe(t,n):void 0,m=n.height/2,p=n.width/2,b=e.length,f=[],y=o?[]:void 0,_=Wht,S=vht,Z=Fht,R=Iht,C=Pht,E=Xht,A=Nht,L=Yht,F=Mht,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=xg(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 M=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),Jht);h.subtract(_,O,O),h.normalize(O,O);let w=h.multiplyByScalar(R,h.dot(S,R),jht);if(h.subtract(S,w,w),h.normalize(w,w),!W.equalsEpsilon(Math.abs(h.dot(O,w)),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,uV))),te=PN.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=Y$(hc,g+m,V+m,a),v=oo.generateArc({positions:hc,granularity:a,ellipsoid:r}),f=w$(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?HSe(C,E,A,c,te,r,f,d,V+m,o):(Z=h.negate(Z,Z),f=xg(I,Z,d,f,r,V+m,K,M)),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=Y$(hc,g+m,V+m,a),v=oo.generateArc({positions:hc,granularity:a,ellipsoid:r}),f=w$(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?HSe(C,E,A,c,te,r,f,d,V+m,o):f=xg(I,Z,d,f,r,V+m,K,M),F=h.clone(A,F)),S=h.negate(_,S)}else f=xg(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=Y$(hc,g+m,V+m,a),v=oo.generateArc({positions:hc,granularity:a,ellipsoid:r}),f=w$(v,L,d,f,r,G,1),o&&(y=xg(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=PN;var U$={},mV=new h,qSe=new h,Qht=new h,KSe=new h,sd=[new h,new h],$Se=new h,eZe=new h,tZe=new h,qht=new h,$ht=new h,eft=new h,tft=new h,nft=new h,ift=new h,oft=new h,JSe=new Ne,jSe=new q;function n3(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,mV),h.subtract(n,e,qSe)),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,mV),r/s,JSe),jSe):d=q.fromQuaternion(Ne.fromAxisAngle(e,r/s,JSe),jSe);let u=0;t=h.clone(t,mV);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 rft(e){let t=$Se,n=eZe,i=tZe,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=n3(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=n3(t,n,i,ro.ROUNDED,!1);return[r,c]}function QSe(e,t,n,i){let o=mV;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 k$(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,mV),a=h.negate(s,qSe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,Qht),p=h.add(m,a,KSe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let b=h.add(m,s,KSe);r[d--]=b.z,r[d--]=b.y,r[d--]=b.x}return i.push(o,r),i}U$.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 sft=new h,aft=new h;U$.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=$Se,c=eZe,d=tZe,u=qht,m=$ht,p=eft,b=tft,f=nft,y=ift,_=oft,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),sft);h.subtract(c,g,g),h.normalize(g,g);let V=h.multiplyByScalar(a,h.dot(d,a),aft);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,mV))),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),sd[0]=h.clone(b,sd[0]),sd[1]=h.clone(_,sd[1]),A=oo.generateArc({positions:sd,granularity:t,ellipsoid:i}),S=k$(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:n3(f,p,y,r,X)}):L.push({leftPositions:QSe(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),sd[0]=h.clone(b,sd[0]),sd[1]=h.clone(_,sd[1]),A=oo.generateArc({positions:sd,granularity:t,ellipsoid:i}),S=k$(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:n3(y,p,f,r,X)}):L.push({rightPositions:QSe(C,m,f,X)})),d=h.negate(c,d)}C=E}a=i.geodeticSurfaceNormal(C,a),sd[0]=h.clone(b,sd[0]),sd[1]=h.clone(C,sd[1]),A=oo.generateArc({positions:sd,granularity:t,ellipsoid:i}),S=k$(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=rft(S)),{positions:S,corners:L,lefts:Z,normals:R,endPositions:N}};var bo=U$;var oZe=new h,rZe=new h,i3=new h,o3=new h,cft=new h,sZe=new h,wx=new h,hV=new h;function aZe(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,wx),wx);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 cZe(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=oZe,G=rZe,v,X,Y=y/2,D=Oe.createTypedArray(_/3,p),M=0;if(f){X=i3,v=o3;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[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3}let O=0,w=0,z=i[O++],K=i[O++];S.set(z,A),S.set(K,L-K.length+1),G=h.fromArray(s,w,G);let te,H;for(b=K.length-3,m=0;m<b;m+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,m,wx),wx),H=n.geodeticSurfaceNormal(h.fromArray(K,b-m,hV),hV),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[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3;for(te=n.geodeticSurfaceNormal(h.fromArray(z,b,wx),wx),H=n.geodeticSurfaceNormal(h.fromArray(K,b,hV),hV),V=h.normalize(h.add(te,H,V),V),w+=3,m=0;m<o.length;m++){let $,ee=o[m],le=ee.leftPositions,_e=ee.rightPositions,he,Ze,ye=sZe,Ge=i3,Ae=o3;if(V=h.fromArray(a,w,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[M++]=he,D[M++]=Ze-$-1,D[M++]=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[M++]=he,D[M++]=Ze+$,D[M++]=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,w+=3,G=h.fromArray(s,w,G),$=0;$<K.length;$+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,$,wx),wx),H=n.geodeticSurfaceNormal(h.fromArray(K,b-$,hV),hV),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[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=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=i3,v=o3;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[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=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 lft(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=oZe,f=rZe,y=i3,_=o3,S=cft,Z=sZe,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 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 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 dft(e,t){let n=new Me({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=cZe(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=hi.scaleToGeodeticHeight(u,s,i),f=D$(u,0,f),b=hi.scaleToGeodeticHeight(b,a,i),f=D$(b,m*2,f),p.set(u),p.set(b,m),p.set(f,m*2),c.position.values=p,c=lft(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=D$(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 nZe=new h,XN=new h,th=new pe;function iZe(e,t,n,i,o,r){let s=h.subtract(t,e,nZe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,XN),c=h.cross(s,a,nZe);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,XN),n.cartesianToCartographic(XN,th);let b=th.latitude,f=th.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,XN),n.cartesianToCartographic(XN,th),b=th.latitude,f=th.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 eh=new h,NN=new h,Hd=new pe,Kd=new pe;function lZe(e,t,n,i,o){e=aZe(e,t);let r=Yo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new re;let a=n*.5;Hd.latitude=Number.POSITIVE_INFINITY,Hd.longitude=Number.POSITIVE_INFINITY,Kd.latitude=Number.NEGATIVE_INFINITY,Kd.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===ro.ROUNDED){let p=r[0];h.subtract(p,r[1],eh),h.normalize(eh,eh),h.multiplyByScalar(eh,a,eh),h.add(p,eh,NN),t.cartesianToCartographic(NN,th),c=th.latitude,d=th.longitude,Hd.latitude=Math.min(Hd.latitude,c),Hd.longitude=Math.min(Hd.longitude,d),Kd.latitude=Math.max(Kd.latitude,c),Kd.longitude=Math.max(Kd.longitude,d)}for(let p=0;p<s-1;++p)iZe(r[p],r[p+1],t,a,Hd,Kd);let u=r[s-1];h.subtract(u,r[s-2],eh),h.normalize(eh,eh),h.multiplyByScalar(eh,a,eh),h.add(u,eh,NN),iZe(u,NN,t,a,Hd,Kd),i===ro.ROUNDED&&(t.cartesianToCartographic(NN,th),c=th.latitude,d=th.longitude,Hd.latitude=Math.min(Hd.latitude,c),Hd.longitude=Math.min(Hd.longitude,d),Kd.latitude=Math.max(Kd.latitude,c),Kd.longitude=Math.max(Kd.longitude,d));let m=l(o)?o:new re;return m.north=Kd.latitude,m.south=Hd.latitude,m.east=Kd.longitude,m.west=Hd.longitude,m}function _g(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=Me.clone(e.vertexFormat??Me.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+Me.packedLength+7}_g.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 dZe=ne.clone(ne.UNIT_SPHERE),uZe=new Me,Tg={positions:void 0,ellipsoid:dZe,vertexFormat:uZe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};_g.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,dZe);t+=ne.packedLength;let s=Me.unpack(e,t,uZe);t+=Me.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=Me.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):(Tg.positions=o,Tg.width=a,Tg.height=c,Tg.extrudedHeight=d,Tg.cornerType=u,Tg.granularity=m,Tg.shadowVolume=p,Tg.offsetAttribute=b===-1?void 0:b,new _g(Tg))};_g.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 lZe(n,o,i,r,t)};_g.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=aZe(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=dft(d,c);else{let b=bo.computePositions(d);if(u=cZe(b,c,i),u.attributes.position.values=hi.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=me.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})};_g.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new _g({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(_g.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=lZe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var HS=_g;var DVi=x(T(),1);var mZe=new h,hZe=new h,uft=new h;function mft(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function fZe(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=mZe,L=hZe;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,M,O=uft;if(l(Y)){for(Z-=3,M=E,n.push(A),X=0;X<Y.length/3;X++)O=h.fromArray(Y,X*3,O),N[g++]=M-X-1,N[g++]=M-X,bo.addAttribute(_,O,void 0,Z),Z-=3;n.push(M-Math.floor(Y.length/6)),t===ro.BEVELED&&n.push((Z-2)/3+1),S+=3}else{for(S+=3,M=A,n.push(E),X=0;X<D.length/3;X++)O=h.fromArray(D,X*3,O),N[g++]=M+X,N[g++]=M+X+1,bo.addAttribute(_,O,S),S+=3;n.push(M+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=mZe,L=hZe;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 hft(e){let t=e.ellipsoid,n=bo.computePositions(e),i=fZe(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=hi.scaleToGeodeticHeight(d,r,t),m=hi.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 YN(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}YN.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 pZe=ne.clone(ne.UNIT_SPHERE),kx={positions:void 0,ellipsoid:pZe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};YN.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,pZe);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):(kx.positions=o,kx.width=s,kx.height=a,kx.extrudedHeight=c,kx.cornerType=d,kx.granularity=u,kx.offsetAttribute=m===-1?void 0:m,new YN(kx))};YN.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=mft(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=hft(c);else{let p=bo.computePositions(c);if(d=fZe(p,c.cornerType),d.attributes.position.values=hi.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=me.fromVertices(u.position.values,void 0,3);return new At({attributes:u,indices:d.indices,primitiveType:Ie.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var MN=YN;var tEi=x(T(),1);var fft=new ui(0);function ad(e){Wi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(ad.prototype=Object.create(Wi.prototype),ad.prototype.constructor=ad);Object.defineProperties(ad.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ad.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Yl.isSupported(this._scene)};ad.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};ad.prototype._computeCenter=ge.throwInstantiationError;ad.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??fft,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 P_(this._scene,a,r,s)}};ad.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Wi.prototype.destroy.call(this)};ad.getGeometryHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryHeightReference);return}return fs(t)?0:e};ad.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryExtrudedHeightReference);return}return fs(t)?ad.CLAMP_TO_GROUND:e};ad.CLAMP_TO_GROUND="clamp";ad.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=ad;var bZe=new U,gZe=h.ZERO,yZe=new h,xZe=new re;function pft(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 pft(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,bZe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,gZe,yZe))),new Yt({id:t,geometry:new HS(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,bZe),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,gZe,yZe))),new Yt({id:t,geometry:new MN(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(HS.computeRectangle(s,xZe)).minimumTerrainHeight),s.extrudedHeight=o};Ef.DynamicGeometryUpdater=fV;function fV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(fV.prototype=Object.create(Li.prototype),fV.prototype.constructor=fV);fV.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)};fV.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(HS.computeRectangle(i,xZe)).minimumTerrainHeight),i.extrudedHeight=s};var wN=Ef;var $Ai=x(T(),1);var EEi=x(T(),1);function r3(){ge.throwInstantiationError()}Object.defineProperties(r3.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}});r3.prototype.update=function(e){ge.throwInstantiationError()};r3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Es=r3;var HAi=x(T(),1);var IEi=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 TZe=new h;t0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,TZe);return B$(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};t0.prototype.isScaledSpacePointVisible=function(e){return B$(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var bft=new h;t0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=bft,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),B$(e,o,i)};t0.prototype.computeHorizonCullingPoint=function(e,t,n){return ZZe(this._ellipsoid,e,t,n)};var _Ze=ne.clone(ne.UNIT_SPHERE);t0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=SZe(this._ellipsoid,n,_Ze);return ZZe(o,e,t,i)};t0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return RZe(this._ellipsoid,e,t,n,i,o)};t0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=SZe(this._ellipsoid,o,_Ze);return RZe(s,e,t,n,i,r)};var gft=[];t0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=re.subsample(e,t,0,gft),o=me.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var yft=new h;function SZe(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,yft);e=ne.fromCartesian3(i,n)}return e}function ZZe(e,t,n,i){l(i)||(i=new h);let o=EZe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=CZe(e,c,o);if(d<0)return;r=Math.max(r,d)}return VZe(o,r,i)}var s3=new h;function RZe(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let s=EZe(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){s3.x=n[c]+o.x,s3.y=n[c+1]+o.y,s3.z=n[c+2]+o.z;let u=CZe(e,s3,s);if(u<0)return;a=Math.max(a,u)}return VZe(s,a,r)}function B$(e,t,n){let i=t,o=n,r=h.subtract(e,i,TZe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var xft=new h,Tft=new h;function CZe(e,t,n){let i=e.transformPositionToScaledSpace(t,xft),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,Tft);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 VZe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var O$=new h;function EZe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,O$),h.normalize(O$,O$))}var Af=t0;var JEi=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??wr.NONE}var AZe=ss.SHOW_INDEX=0,WZe=ss.POSITION_INDEX=1,_ft=ss.COLOR_INDEX=2,Sft=ss.OUTLINE_COLOR_INDEX=3,Zft=ss.OUTLINE_WIDTH_INDEX=4,Rft=ss.PIXEL_SIZE_INDEX=5,Cft=ss.SCALE_BY_DISTANCE_INDEX=6,Vft=ss.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Eft=ss.DISTANCE_DISPLAY_CONDITION_INDEX=8,Aft=ss.DISABLE_DEPTH_DISTANCE_INDEX=9,Gft=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,AZe))}},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,WZe))}},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,Cft))}},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,Vft))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Du(this,Rft))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Du(this,_ft))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Du(this,Sft))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Du(this,Zft))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ot.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ot.clone(e,this._distanceDisplayCondition),Du(this,Eft))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Du(this,Aft))}},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,AZe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Du(this,Gft))}}});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,WZe)};var GZe=new ce;ss._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(P.multiplyByPoint(n,e,GZe),fo.computeActualEllipsoidPosition(t,GZe))};var LZe=new ce;ss._computeScreenSpacePosition=function(e,t,n,i){let o=P.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,LZe),LZe);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 EAi=x(T(),1);var QEi=x(T(),1),Ux=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; +in float v_splitDirection; +void main() { -#ifdef HAS_CLEARCOAT_TEXTURE -vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; -#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM -clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); -#endif -float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; -#ifdef HAS_CLEARCOAT_FACTOR -clearcoatFactor *= u_clearcoatFactor; -#endif -#else -#ifdef HAS_CLEARCOAT_FACTOR -float clearcoatFactor = u_clearcoatFactor; -#else -float clearcoatFactor = 0.0; -#endif -#endif -#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE -vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; -#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM -clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); -#endif -float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; -#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR -clearcoatRoughness *= u_clearcoatRoughnessFactor; -#endif -#else -#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR -float clearcoatRoughness = u_clearcoatRoughnessFactor; -#else -float clearcoatRoughness = 0.0; -#endif -#endif -material.clearcoatFactor = clearcoatFactor; -material.clearcoatRoughness = clearcoatRoughness; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); +if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; +if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +float maxDistance = max(0.0, 0.5 - v_pixelDistance); +float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); +float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); +vec4 color = mix(v_outlineColor, v_color, innerAlpha); +color.a *= wholeAlpha; +#if !defined(OPAQUE) && !defined(TRANSLUCENT) +if (color.a < 0.005) +{ +discard; +} #else -material.clearcoatNormal = attributes.normalEC; -#endif +#ifdef OPAQUE +if (color.a < 0.995) +{ +discard; } -#endif -#endif -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +#else +if (color.a >= 0.995) { -#ifdef USE_ANISOTROPY -NormalInfo normalInfo = getNormalInfo(attributes); -material.normalEC = normalInfo.normal; -#elif defined(HAS_NORMALS) -material.normalEC = computeNormal(attributes); -#endif -vec4 baseColorWithAlpha = vec4(1.0); -#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) -vec4 color = attributes.color_0; -#ifdef HAS_SRGB_COLOR -color = czm_srgbToLinear(color); -#endif -baseColorWithAlpha *= color; -#endif -#ifdef USE_CPU_STYLING -baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); +discard; +} #endif -material.baseColor = baseColorWithAlpha; -material.diffuse = baseColorWithAlpha.rgb; -material.alpha = baseColorWithAlpha.a; -#ifdef HAS_OCCLUSION_TEXTURE -vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; -#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM -occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif -material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); +} +`;var $Ei=x(T(),1),kN=`uniform float u_maxTotalPointSize; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; +in vec4 compressedAttribute1; +in vec4 scaleByDistance; +in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; +out float v_splitDirection; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +void main() +{ +vec3 positionHigh = positionHighAndSize.xyz; +vec3 positionLow = positionLowAndOutline.xyz; +float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; +float totalSize = positionHighAndSize.w + outlineWidthBothSides; +float outlinePercent = outlineWidthBothSides / totalSize; +totalSize *= czm_pixelRatio; +float temp = compressedAttribute1.x * SHIFT_RIGHT8; +float show = floor(temp); +#ifdef EYE_DISTANCE_TRANSLUCENCY +vec4 translucencyByDistance; +translucencyByDistance.x = compressedAttribute1.z; +translucencyByDistance.z = compressedAttribute1.w; +translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +temp = compressedAttribute1.y * SHIFT_RIGHT8; +translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -#ifdef HAS_EMISSIVE_TEXTURE -material.emissive = getEmissiveFromTexture(); -#elif defined(HAS_EMISSIVE_FACTOR) -material.emissive = u_emissiveFactor; +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) +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) +{ +lengthSq = czm_eyeHeight2D.y; +} +else +{ +lengthSq = dot(positionEC.xyz, positionEC.xyz); +} #endif -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -setSpecularGlossiness(material); -#elif defined(LIGHTING_PBR) -float metalness = setMetallicRoughness(material); -#ifdef USE_SPECULAR -setSpecular(material, metalness); +#ifdef EYE_DISTANCE_SCALING +totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); #endif -#ifdef USE_ANISOTROPY -setAnisotropy(material, normalInfo); +if (totalSize > 0.0) { +totalSize += 3.0; +} +totalSize = min(totalSize, u_maxTotalPointSize); +if (totalSize < 1.0) +{ +positionEC.xyz = vec3(0.0); +totalSize = 1.0; +} +float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY +translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); +if (translucency < 0.004) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef USE_CLEARCOAT -setClearcoat(material, attributes); +#ifdef DISTANCE_DISPLAY_CONDITION +float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; +float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; +if (lengthSq < nearSq || lengthSq > farSq) { +positionEC.xyz = vec3(0.0, 0.0, 1.0); +} #endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +#ifdef DISABLE_DEPTH_DISTANCE +float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; +if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistance = czm_minimumDisableDepthTestDistance; +} +if (disableDepthTestDistance != 0.0) +{ +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))) +{ +gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH +czm_vertexLogDepth(vec4(czm_currentFrustum.x)); #endif } -`;var OQn=x(T(),1),aP=`#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 zQn=x(T(),1),cP=`#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); +v_color = color; +v_color.a *= translucency * show; +v_outlineColor = outlineColor; +v_outlineColor.a *= translucency * show; +v_innerPercent = 1.0 - outlinePercent; +v_pixelDistance = 2.0 / totalSize; +gl_PointSize = totalSize * show; +gl_Position *= show; +v_pickColor = pickColor; +v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -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); +`;var Lft=Ea.SHOW_INDEX,K$=Ea.POSITION_INDEX,vZe=Ea.COLOR_INDEX,Wft=Ea.OUTLINE_COLOR_INDEX,vft=Ea.OUTLINE_WIDTH_INDEX,Fft=Ea.PIXEL_SIZE_INDEX,FZe=Ea.SCALE_BY_DISTANCE_INDEX,IZe=Ea.TRANSLUCENCY_BY_DISTANCE_INDEX,PZe=Ea.DISTANCE_DISPLAY_CONDITION_INDEX,Ift=Ea.DISABLE_DEPTH_DISTANCE_INDEX,Pft=Ea.SPLIT_DIRECTION_INDEX,J$=Ea.NUMBER_OF_PROPERTIES,bl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function nh(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(J$),this._maxPixelSize=1,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,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(nh.prototype,{length:{get:function(){return j$(this),this._pointPrimitives.length}}});function XZe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}nh.prototype.add=function(e){let t=new Ea(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};nh.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};nh.prototype.removeAll=function(){XZe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function j$(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}}nh.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};nh.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};nh.prototype.get=function(e){return j$(this),this._pointPrimitives[e]};nh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<J$;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Xft(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[vZe]},{index:bl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[IZe]},{index:bl.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[FZe]},{index:bl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[PZe]}],t)}var z$=new An,a3=new U;function NZe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(me.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),An.fromCartesian(r,z$);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[bl.positionHighAndSize],d=z$.high;c(o,d.x,d.y,d.z,s);let u=n[bl.positionLowAndOutline],m=z$.low;u(o,m.x,m.y,m.z,a)}var Nft=256;function YZe(e,t,n,i){let o=i._index,r=i.color,s=i.outlineColor,a=i.getPickId(t).color;a3.red=r.alpha,a3.green=s.alpha,a3.blue=a.alpha;let c=n[bl.compressedAttribute0];c(o,dn.encodeRGB8(r),dn.encodeRGB8(s),dn.encodeRGB8(a),dn.encodeRGB8(a3))}function MZe(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)*Nft+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 wZe(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 kZe(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 Yft(e,t,n,i){NZe(e,t,n,i),YZe(e,t,n,i),MZe(e,t,n,i),wZe(e,t,n,i),kZe(e,t,n,i)}function H$(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):me.expand(s,m,s))}r&&me.fromPoints(a,s)}function Mft(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)&&H$(e,i,i.length,t,r,!0)):n===se.MORPHING?H$(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&H$(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function wft(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var kft=[];nh.prototype.update=function(e){if(j$(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,Mft(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<J$;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Xft(c,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let A=this._pointPrimitives[E];A._dirty=!1,Yft(this,c,a,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=kft;E.length=0,(r[K$]||r[vft]||r[Fft])&&E.push(NZe),(r[vZe]||r[Wft])&&E.push(YZe),(r[Lft]||r[IZe])&&E.push(MZe),r[FZe]&&E.push(wZe),(r[PZe]||r[Ift]||r[Pft])&&E.push(kZe);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,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=P.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,m=me.clone(this._baseVolumeWC,this._boundingVolume)):m=me.clone(this._baseVolume2D,this._boundingVolume),wft(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:[kN]}),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:[Ux]}),this._sp=nn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl}),y=new Je({defines:["TRANSLUCENT"],sources:[Ux]}),this._spTranslucent=nn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._blendOption===Yi.OPAQUE&&(y=new Je({sources:[Ux]}),this._sp=nn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._blendOption===Yi.TRANSLUCENT&&(y=new Je({sources:[Ux]}),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)}}};nh.prototype.isDestroyed=function(){return!1};nh.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(),XZe(this._pointPrimitives),ue(this)};var pV=nh;var GAi=x(T(),1),UZe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Q$=1,UN=8,as=new Uint32Array(96),ON=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!==Q$)throw new Error(`Got v${o} data when expected v${Q$}.`);let r=UZe[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=UZe.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,UN,t),this.coords=new i(r,UN+c+d,t*2),this._pos=t*2,this._finished=!0;else{let u=this.data=new o(UN+a+c+d);this.ids=new this.IndexArrayType(u,UN,t),this.coords=new i(u,UN+c+d,t*2),this._pos=0,this._finished=!1,new Uint8Array(u,0,2).set([219,(Q$<<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 $$(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++)DZe(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];DZe(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 $$(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;OZe(e,t,s,i,o,r),$$(e,t,n,i,s-1,1-r),$$(e,t,n,s+1,o,1-r)}function OZe(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));OZe(e,t,n,f,y,r)}let s=t[2*n+r],a=i,c=o;for(DN(e,t,i,n),t[2*o+r]>s&&DN(e,t,i,o);a<c;){for(DN(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?DN(e,t,i,c):(c++,DN(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function DN(e,t,n,i){q$(e,n,i),q$(t,2*n,2*i),q$(t,2*n+1,2*i+1)}function q$(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function DZe(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 BZe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Uft=new nt;function zZe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Rx.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=Mo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ea.getScreenSpaceBoundingBox(e,t,o)),BZe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&KZe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Rx.getScreenSpaceBoundingBox(s,t,Uft);BZe(a,n),o=nt.union(o,a,o)}return o}function Dft(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&KZe(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 HZe(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 KZe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function eee(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 Oft=new nt,Bft=new nt,zft=new nt;function Hft(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 Mu({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new pV;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&&eee(i,Z,n,S,e),e._clusterBillboards&&eee(o,Z,n,S,e),e._clusterPoints&&eee(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 ON(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=Mo._computeScreenSpacePosition(P.IDENTITY,Y.position,h.ZERO,k.ZERO,n);if(!l(D))continue;let M=1-f/b,O=Y.width=Y.width*M,w=Y.height=Y.height*M;O=Math.max(O,Y.minimumWidth),w=Math.max(w,Y.minimumHeight);let z=D.x-O*.5,K=D.y-w*.5,te=D.x+O,H=D.y+w;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(HZe(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=zZe(D,Y.coord,d,e,Oft);let M=nt.clone(A,Bft);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 w=N.collection.get(N.index),z=zZe(w,N.coord,d,e,zft);h.add(w.position,O,O),nt.union(M,z,M),++V,g.push(w.id)}if(V>=u){let w=h.multiplyByScalar(O,1/V,O);for(HZe(w,V,g,e),p.push({position:w,width:M.width,height:M.height,minimumWidth:A.width,minimumHeight:A.height}),C=0;C<F;++C)Z[L[C]].clustered=!0}else Dft(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=Hft(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 nee(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 iee(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Gf.prototype.getLabel=nee("_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,iee(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=nee("_billboardCollection",Mu,"_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,iee(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=nee("_pointCollection",pV,"_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,iee(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function tee(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Kft(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,tee(e._labelCollection),tee(e._billboardCollection),tee(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,Kft(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 oee(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(oee.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}}});oee.prototype.update=function(e){return!0};var BN=oee;var nLi=x(T(),1);var xGi=x(T(),1);var nGi=x(T(),1);var JZe={};JZe.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 KS=JZe;var ree=new k,Jft=new h,jft=new h,Qft=new h,qft=new h;function Sg(e){e=e??B.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Me.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Me.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Sg.packedLength=Me.packedLength+5;Sg.pack=function(e,t,n){return n=n??0,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var jZe=new Me,bV={vertexFormat:jZe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Sg.unpack=function(e,t,n){t=t??0;let i=Me.unpack(e,t,jZe);t+=Me.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(bV.length=o,bV.topRadius=r,bV.bottomRadius=s,bV.slices=a,bV.offsetAttribute=c===-1?void 0:c,new Sg(bV))};Sg.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=KS.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=Jft;V.z=Math.sin(g);let G=Math.cos(g),v=Qft,X=jft;for(f=0;f<r;f++){let Y=f/r*W.TWO_PI,D=G*Math.cos(Y),M=G*Math.sin(Y);y&&(V.x=D,V.y=M,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,qft);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})),ree.x=t*.5,ree.y=Math.max(i,n);let A=new me(h.ZERO,k.magnitude(ree));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 see;Sg.getUnitCylinder=function(){return l(see)||(see=Sg.createGeometry(new Sg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Me.POSITION_ONLY}))),see};var zN=Sg;var IGi=x(T(),1);var aee=new k;function gV(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"}gV.packedLength=6;gV.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 JS={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};gV.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):(JS.length=i,JS.topRadius=o,JS.bottomRadius=r,JS.slices=s,JS.numberOfVerticalLines=a,JS.offsetAttribute=c===-1?void 0:c,new gV(JS))};gV.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=KS.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}),aee.x=t*.5,aee.y=Math.max(i,n);let f=new me(h.ZERO,k.magnitude(aee));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 HN=gV;var QZe=h.ZERO,qZe=new h,$ft=new h,$Ze=new U;function ept(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 ept(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,$Ze)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,QZe,qZe))),new Yt({id:t,geometry:new zN(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,$Ze),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,QZe,qZe))),new Yt({id:t,geometry:new HN(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=_b;Bu.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){let i=this._options,o=j.getValueOrUndefined(e.position,n,$ft);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Li.prototype._isHidden.call(this,e,t,n)};yV.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 KN=Bu;var rIi=x(T(),1);var oLi=x(T(),1),eRe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(eRe);var As=eRe;var sLi=x(T(),1),tRe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(tRe);var Oo=tRe;var cLi=x(T(),1),nRe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(nRe);var cd=nRe;var dLi=x(T(),1),iRe=x(bu(),1);function tpt(e){let t=new iRe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Zg=tpt;var fLi=x(T(),1);var npt=W.factorial;function cee(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+=cee(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 ipt=[],lee=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/npt(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=cee(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=ipt,f=opt(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=cee(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 opt(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 JN=lee;var gLi=x(T(),1);var dee=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}},jN=dee;var TLi=x(T(),1);var uee=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}},Dx=uee;var ZLi=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 QN=gl;var nY=x(bu(),1);var kLi=x(T(),1);var ILi=x(T(),1);var CLi=x(T(),1),mee;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?mee=function(){return performance.now()}:mee=function(){return Date.now()};var Zn=mee;function hee(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(hee.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)}}});hee.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=hee;function jS(){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(jS.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Ul("startTime"),stopTime:Ul("stopTime"),currentTime:Ul("currentTime"),clockRange:Ul("clockRange"),clockStep:Ul("clockStep"),multiplier:Ul("multiplier")});jS.prototype.clone=function(e){return l(e)||(e=new jS),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};jS.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};jS.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};jS.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=jS;var QLi=x(T(),1);var rpt=U.WHITE,spt=.1,apt=new k(8,8),cpt=new k(0,0),lpt=new k(1,1);function xV(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(xV.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")});xV.prototype.getType=function(e){return"Grid"};var dpt=new Q;xV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(dpt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,rpt,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,spt),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,apt,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,lpt,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,cpt,t.lineOffset),t};xV.prototype.equals=function(e){return this===e||e instanceof xV&&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 TV=xV;var $Li=x(T(),1),oRe={WHOLE:0,PORTIONS:1};Object.freeze(oRe);var n0=oRe;var aWi=x(T(),1);function _V(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(_V.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});_V.prototype.getType=function(e){return"PolylineArrow"};var upt=new Q;_V.prototype.getValue=function(e,t){return l(e)||(e=Q.now(upt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};_V.prototype.equals=function(e){return this===e||e instanceof _V&&j.equals(this._color,e._color)};var SV=_V;var bWi=x(T(),1);var mpt=U.WHITE,hpt=U.TRANSPARENT,fpt=16,ppt=255;function ZV(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(ZV.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")});ZV.prototype.getType=function(e){return"PolylineDash"};var bpt=new Q;ZV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(bpt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,mpt,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,hpt,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,fpt,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,ppt,t.dashPattern),t};ZV.prototype.equals=function(e){return this===e||e instanceof ZV&&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 RV=ZV;var CWi=x(T(),1);var gpt=U.WHITE,ypt=.25,xpt=1;function CV(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(CV.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")});CV.prototype.getType=function(e){return"PolylineGlow"};var Tpt=new Q;CV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Tpt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,gpt,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,ypt,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,xpt,t.taperPower),t};CV.prototype.equals=function(e){return this===e||e instanceof CV&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var VV=CV;var IWi=x(T(),1);var _pt=U.WHITE,Spt=U.BLACK,Zpt=1;function EV(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(EV.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")});EV.prototype.getType=function(e){return"PolylineOutline"};var Rpt=new Q;EV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Rpt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,_pt,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,Spt,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,Zpt),t};EV.prototype.equals=function(e){return this===e||e instanceof EV&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var Ox=EV;var UWi=x(T(),1);function Rg(e,t){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Hr,this._referenceFrame=t??Oi.FIXED,this.setValue(e)}Object.defineProperties(Rg.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 Cpt=new Q;Rg.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Cpt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Rg.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};Rg.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,Rg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Rg.prototype.equals=function(e){return this===e||e instanceof Rg&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};Rg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Cg=Rg;var JWi=x(T(),1);function Bx(e){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Hr,this.setValue(e)}Object.defineProperties(Bx.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 Vpt=new Q;Bx.prototype.getValue=function(e,t){l(e)||(e=Q.now(Vpt));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};Bx.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,Bx.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Bx.prototype.equals=function(e){return this===e||e instanceof Bx&&j.arrayEquals(this._value,e._value)};Bx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var AV=Bx;var tvi=x(T(),1);function rRe(e,t,n){let i=new WeakRef(t),o=e.addEventListener(function(){let r=i.deref();l(r)?n.apply(r,arguments):o()});return o}function QS(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}e._removeTargetListener=rRe(n.definitionChanged,e,ih.prototype._onTargetEntityDefinitionChanged),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 ih(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Se,this._removeTargetListener=void 0,rRe(e.collectionChanged,this,ih.prototype._onCollectionChanged)}Object.defineProperties(ih.prototype,{isConstant:{get:function(){return j.isConstant(QS(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=QS(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 QS(this)}}});ih.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 ih(e,n,i)};var Ept=new Q;ih.prototype.getValue=function(e,t){let n=QS(this);return l(e)||(e=Q.now(Ept)),l(n)?n.getValue(e,t):void 0};ih.prototype.getValueInReferenceFrame=function(e,t,n){let i=QS(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};ih.prototype.getType=function(e){let t=QS(this);return l(t)?t.getType(e):void 0};ih.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};ih.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};ih.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=QS(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Vg=ih;var rvi=x(T(),1);var Apt={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=Apt;var Zvi=x(T(),1);var hvi=x(T(),1);var sRe={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 aRe(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 cRe(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var fee=[],pee=[];function c3(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=cRe(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=cRe(i[r],e),!(l(a)&&Q.compare(a,u)>=0||l(m)&&Q.compare(u,m)>=0));){for(fee[p++]=u,r=r+1,s=0;s<o;s++)pee[b++]=i[r],r=r+1;a=u}p>0&&(pee.length=b,aRe(n,d,pee),fee.length=p,aRe(t,c,fee))}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=sRe);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=sRe);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=Dx,this._lastInterpolationAlgorithm=Dx,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=cd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=cd.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 Gpt=new Q;rh.prototype.getValue=function(e,t){l(e)||(e=Q.now(Gpt));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===cd.NONE||o!==0&&Q.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===cd.HOLD)return r.unpack(s,0,t);c=this._backwardExtrapolationType===cd.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===cd.NONE||o!==0&&Q.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===cd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);c=this._forwardExtrapolationType===cd.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)}c3(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)}c3(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){c3(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:(lRe(this,t,1),!0)};function lRe(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,lRe(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=c3;var zu=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 zu(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 Lpt=new Q;sh.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Lpt)),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 Pvi=x(T(),1);var Cvi=x(T(),1),dRe={HORIZONTAL:0,VERTICAL:1};Object.freeze(dRe);var vf=dRe;var Wpt=vf.HORIZONTAL,vpt=U.WHITE,Fpt=U.BLACK,Ipt=0,Ppt=1;function GV(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(GV.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")});GV.prototype.getType=function(e){return"Stripe"};var Xpt=new Q;GV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Xpt)),l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,Wpt)===vf.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,vpt,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,Fpt,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,Ipt),t.repeat=j.getValueOrDefault(this._repeat,e,Ppt),t};GV.prototype.equals=function(e){return this===e||e instanceof GV&&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 LV=GV;var Ovi=x(T(),1);function zx(e){this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(zx.prototype._intervalsChanged,this),this._referenceFrame=e??Oi.FIXED}Object.defineProperties(zx.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 Npt=new Q;zx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Npt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};zx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Bh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};zx.prototype.equals=function(e){return this===e||e instanceof zx&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};zx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Eg=zx;var Qvi=x(T(),1);function qS(){this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(qS.prototype._intervalsChanged,this)}Object.defineProperties(qS.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Ypt=new Q;qS.prototype.getValue=function(e,t){l(e)||(e=Q.now(Ypt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};qS.prototype.equals=function(e){return this===e||e instanceof qS&&this._intervals.equals(e._intervals,j.equals)};qS.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ag=qS;var b2i=x(T(),1);var o2i=x(T(),1);function WV(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Se,this._normalize=t??!0,this.position=e}Object.defineProperties(WV.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 Mpt=new h,uRe=new h,mRe=new Q,wpt=new Q,bee=1/60;WV.prototype.getValue=function(e,t){return this._getValue(e,t)};WV.prototype._getValue=function(e,t,n){l(e)||(e=Q.now(wpt)),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,Mpt),r=i.getValue(Q.addSeconds(e,bee,mRe),uRe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-bee,mRe),uRe),!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,bee,t)};WV.prototype.equals=function(e){return this===e||e instanceof WV&&j.equals(this._position,e._position)};var Gg=WV;function qN(e,t){this._velocityVectorProperty=new Gg(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(qN.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 hRe=new h,kpt=new h,fRe=new q,Upt=new Q;qN.prototype.getValue=function(e,t){l(e)||(e=Q.now(Upt));let n=this._velocityVectorProperty._getValue(e,kpt,hRe);if(l(n))return _t.rotationMatrixFromPositionVelocity(hRe,n,this._ellipsoid,fRe),Ne.fromRotationMatrix(fRe,t)};qN.prototype.equals=function(e){return this===e||e instanceof qN&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var $N=qN;var x2i=x(T(),1);var Lg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Lg.validate=function(e){return e===Lg.COMPLETE||e===Lg.BELOW_ELLIPSOID_HORIZON||e===Lg.ABOVE_ELLIPSOID_HORIZON};Lg.toString=function(e){switch(e){case Lg.COMPLETE:return"COMPLETE";case Lg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Lg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new ge("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var vV=Lg;function Hx(){}Hx.packedLength=h.packedLength;Hx.unpack=h.unpack;Hx.pack=h.pack;var gee;function eY(e,t){return t[0]==="#"&&(t=gee+t),Vg.fromString(e,t)}function pRe(e,t,n){if(l(n.reference))return eY(t,n.reference);if(l(n.velocityReference)){let i=eY(t,n.velocityReference);switch(e){case h:case Hx:return new Gg(i,e===Hx);case Ne:return new $N(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function Dpt(e,t){return new Jh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var go=new h,ld=new QN,yl=new pe,$S=new Cn,l3=new Ne;function Opt(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 bRe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function Bpt(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(ld.magnitude=1,t===2)return ld.clock=e[0],ld.cone=e[1],h.fromSpherical(ld,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],ld.clock=e[i+1],ld.cone=e[i+2],h.fromSpherical(ld,go),n[o+1]=go.x,n[o+2]=go.y,n[o+3]=go.z;return n}function Hpt(e){let t=e.length;if(t===3)return ld.clock=e[0],ld.cone=e[1],ld.magnitude=e[2],h.fromSpherical(ld,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ld.clock=e[i+1],ld.cone=e[i+2],ld.magnitude=e[i+3],h.fromSpherical(ld,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function Kpt(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 Jpt(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 yee(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 Hpt(r);let s=e.cartographicRadians;if(l(s))return Kpt(s);let a=e.cartographicDegrees;if(l(a))return Jpt(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function gRe(e,t){h.unpack(e,t,go),h.normalize(go,go),h.pack(go,e,t)}function jpt(e){let t=yee(e);if(t.length===3)return gRe(t,0),t;for(let n=1;n<t.length;n+=4)gRe(t,n);return t}function yRe(e,t){Ne.unpack(e,t,l3),Ne.normalize(l3,l3),Ne.pack(l3,e,t)}function Qpt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return yRe(t,0),t;for(let n=1;n<t.length;n+=5)yRe(t,n)}return t}function xRe(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")?Hx: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")?nY.default:e.hasOwnProperty("verticalOrigin")?Bn:Object}function qpt(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 yee(t);case Hx:return jpt(t);case U:return Opt(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 bRe(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 Qpt(t);case oh:return t.number??t;case vV:return vV[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 Bpt(t);case nY.default:return bRe(t,n);case Bn:return Bn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var $pt={HERMITE:JN,LAGRANGE:jN,LINEAR:Dx};function d3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:$pt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=cd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=cd[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 xee(e){let t=it.MAXIMUM_INTERVAL.clone();return t.data=e,t}function _Re(e){let t=new pl;return t.intervals.addInterval(xee(e)),t}function SRe(e){let t=new mc(e.referenceFrame);return t.intervals.addInterval(xee(e)),t}function u3(e,t,n,i,o,r,s){let a=Kr(i.interval);l(o)&&(l(a)?a=Cn.intersect(a,o,$S):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=qpt(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 ui(f?e.unpack(d,0):d):t[n]=pRe(e,s,i);return}let y=t[n],_,S=i.epoch;if(l(S)&&(_=Q.fromIso8601(S)),b&&!p){y instanceof zu||(t[n]=y=new zu(e)),y.addSamplesPackedArray(d,_),d3(i,y);return}let Z;if(!b&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=pRe(e,s,i),l(y)||(t[n]=y=m?new Ag:new pl),m&&y instanceof Ag?y.intervals.addInterval(a):y instanceof pl?(m&&(a.data=new ui(a.data)),y.intervals.addInterval(a)):(t[n]=y=_Re(y),m&&(a.data=new ui(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new pl),y instanceof pl||(t[n]=y=_Re(y));let R=y.intervals;Z=R.findInterval(a),(!l(Z)||!(Z.data instanceof zu))&&(Z=a.clone(),Z.data=new zu(e),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),d3(i,Z.data)}function FRe(e,t){if(e instanceof zu){e.removeSamples(t);return}else if(e instanceof Ag){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,$S);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)u3(e,t,n,i[a],o,r,s);else u3(e,t,n,i,o,r,s)}function ZRe(e,t,n,i,o,r){let s=Kr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,$S):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 IRe(e[t],s)}let b,f=!1;if(m&&(l(n.referenceFrame)&&(b=Oi[n.referenceFrame]),b=b??Oi.FIXED,d=yee(n),u=d.length??1,f=u>c),!f&&!p){m?e[t]=new kl(h.unpack(d),b):e[t]=eY(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,_),d3(n,y);return}let Z;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=eY(r,n.reference),l(y)||(m?y=new Eg(b):y=new mc(b),e[t]=y),m&&y instanceof Eg&&l(b)&&y.referenceFrame===b?y.intervals.addInterval(s):y instanceof mc?(m&&(s.data=new kl(s.data,b)),y.intervals.addInterval(s)):(e[t]=y=SRe(y),m&&(s.data=new kl(s.data,b)),y.intervals.addInterval(s));return}l(y)?y instanceof mc||(e[t]=y=SRe(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,_),d3(n,Z.data)}function IRe(e,t){if(e instanceof fc){e.removeSamples(t);return}else if(e instanceof Eg){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,$S);o.isEmpty||IRe(o.data,t)}n.removeInterval(t);return}}function PRe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)ZRe(e,t,n[s],i,o,r);else ZRe(e,t,n,i,o,r)}function RRe(e,t,n,i){l(n.references)?m3(e,t,n.references,n.interval,i,AV,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 CRe(e,t,n,i,o,r){let s=Kr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,$S):s=i);let a=e[t],c,d;if(l(s)){a instanceof dV||(a=new dV,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 TV||(c=new TV),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 My||(c=new My),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 LV||(c=new LV),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 Ox||(c=new Ox),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 VV||(c=new VV),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 SV||(c=new SV),u=n.polylineArrow,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof RV||(c=new RV),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 cV||(c=new cV),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 Hu(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)CRe(e,t,n[s],i,o,r);else CRe(e,t,n,i,o,r)}function e0t(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function t0t(e,t,n,i){let o=t.description;l(o)&&Ce(String,e,"description",o,void 0,i,n)}function n0t(e,t,n,i){let o=t.position;l(o)&&PRe(e,"position",o,void 0,i,n)}function i0t(e,t,n,i){let o=t.viewFrom;l(o)&&Ce(h,e,"viewFrom",o,void 0,i,n)}function o0t(e,t,n,i){let o=t.orientation;l(o)&&Ce(Ne,e,"orientation",o,void 0,i,n)}function r0t(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Dl);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)u3(xRe(s[a]),e.properties,r,s[a],void 0,i,n);else u3(xRe(s),e.properties,r,s,void 0,i,n)}}}function m3(e,t,n,i,o,r,s){let a=n.map(function(c){return eY(o,c)});if(l(i)){i=Kr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(xee(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function VRe(e,t,n,i){let o=n.references;l(o)?m3(e,t,o,n.interval,i,AV,pl):Ce(Array,e,t,n,void 0,void 0,i)}function ERe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)VRe(e,t,n[o],i);else VRe(e,t,n,i)}function ARe(e,t,n,i){let o=n.references;l(o)?m3(e,t,o,n.interval,i,Cg,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 iY(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 s0t(e){return h.unpackArray(e)}function a0t(e){return h.fromRadiansArrayHeights(e,ne.default)}function c0t(e){return h.fromDegreesArrayHeights(e,ne.default)}function GRe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return m3(a,"positions",s,n.interval,i,Cg,mc),a.positions});e[t]=new Cg(r)}else l(n.cartesian)?n.array=n.cartesian.map(s0t):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(a0t):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(c0t)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i)}function l0t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)GRe(e,t,n[o],i);else GRe(e,t,n,i)}function d0t(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 u0t(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 m0t(e,t,n,i,o){l(t)&&Ce(Hx,e,"alignedAxis",t,n,i,o)}function h0t(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),m0t(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 f0t(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 C_),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),Hu(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 p0t(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 E_),Ce(Boolean,s,"show",o.show,r,i,n),iY(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),Hu(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 b0t(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 A_),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),Hu(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 g0t(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 y0t(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 G_),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),Hu(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 x0t(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 L_),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),Hu(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 T0t(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 _0t(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 yb),Ce(Boolean,s,"show",o.show,r,i,n),Ce(nY.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)LRe(s,d[a],r,i,n);else LRe(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)WRe(s,u[a],r,i,n);else WRe(s,u,r,i,n)}function LRe(e,t,n,i,o){let r=Kr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,$S):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 Dl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new W_),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 WRe(e,t,n,i,o){let r=Kr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,$S):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 Dl),s.hasProperty(u)||s.addProperty(u),Ce(Number,s,u,m,r,i,o))}}function S0t(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 xb),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),Hu(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 Z0t(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 F_),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 tY(e){this.polygon=e,this._definitionChanged=new Se}Object.defineProperties(tY.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}}});tY.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)};tY.prototype.equals=function(e){return this===e||e instanceof tY&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function R0t(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),iY(s,"_positions",o.positions,n),l0t(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new tY(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),Hu(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 C0t(e){return e?un.GEODESIC:un.NONE}function V0t(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),iY(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Hu(s,"material",o.material,r,i,n),Hu(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=Dpt(a.followSurface,C0t)}}function E0t(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 I_),iY(s,"positions",o.positions,n),d0t(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),Hu(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 A0t(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),Hu(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 G0t(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 v_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(nY.default,s,"uri",o.uri,r,i,n),Ce(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function L0t(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 Tb),Ce(Boolean,s,"show",o.show,r,i,n),iY(s,"positions",o.positions,n),ERe(s,"minimumHeights",o.minimumHeights,n),ERe(s,"maximumHeights",o.maximumHeights,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Hu(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 vRe(e,t,n,i,o){let r=e.id;if(l(r)||(r=qn()),gee=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")g0t(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)}gee=void 0}function W0t(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 XRe(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 v0t(e,a,r,i)}).catch(function(a){return Es.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function v0t(e,t,n,i){Es.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new NRe,o.removeAll()),oa._processCzml(t,o,n,void 0,e);let r=W0t(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=Zg(n.getUrlComponent()),r=!0),Es.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function NRe(){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 NRe,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=[h0t,f0t,p0t,b0t,y0t,x0t,T0t,_0t,e0t,t0t,S0t,Z0t,R0t,V0t,E0t,r0t,A0t,n0t,G0t,i0t,L0t,o0t,u0t];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 XRe(this,e,t,!1)};oa.prototype.load=function(e,t){return XRe(this,e,t,!0)};oa.prototype.update=function(e){return!0};oa.processPacketData=Ce;oa.processPositionPacketData=PRe;oa.processMaterialPacketData=Hu;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)vRe(e[r],t,i,n,o);else vRe(e,t,i,n,o)};var oY=oa;var dIi=x(T(),1);function dd(){this._dataSources=[],this._dataSourceAdded=new Se,this._dataSourceRemoved=new Se,this._dataSourceMoved=new Se}Object.defineProperties(dd.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}}});dd.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})};dd.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};dd.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=[]};dd.prototype.contains=function(e){return this.indexOf(e)!==-1};dd.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};dd.prototype.get=function(e){return this._dataSources[e]};dd.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function h3(e,t){return e.indexOf(t)}function YRe(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)}dd.prototype.raise=function(e){let t=h3(this._dataSources,e);YRe(this,t,t+1)};dd.prototype.lower=function(e){let t=h3(this._dataSources,e);YRe(this,t,t-1)};dd.prototype.raiseToTop=function(e){let t=h3(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))};dd.prototype.lowerToBottom=function(e){let t=h3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};dd.prototype.isDestroyed=function(){return!1};dd.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var rY=dd;var UBi=x(T(),1);var SIi=x(T(),1);var gIi=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 f3(e,t){return e._primitives.indexOf(t)}pc.prototype.raise=function(e){if(l(e)){let t=f3(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=f3(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=f3(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=f3(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(),ue(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(),ue(this)};var sY=i0;var s5i=x(T(),1);var EIi=x(T(),1);function FV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new wt}FV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};FV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};FV.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};FV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};FV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Wt.FAILED};var eZ=FV;var mki=x(T(),1);var DPi=x(T(),1);var oPi=x(T(),1);var FIi=x(T(),1);var _ee={},p3=new h,MRe=new h,wRe=new Ne,kRe=new q;function IV(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),p3),h.multiplyByScalar(n,Math.sin(u),MRe),h.add(p3,MRe,p3);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(p3,f,wRe),q.fromQuaternion(wRe,kRe),q.multiplyByVector(kRe,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var URe=new h,DRe=new h,Tee=new h,F0t=new h;_ee.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,URe);i.scaleToGeodeticSurface(b,b);let f=h.clone(b,DRe),y=i.geodeticSurfaceNormal(b,F0t),_=h.multiplyByScalar(y,o,Tee);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 I0t=new h,P0t=new h,X0t=new h;_ee.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,I0t),b=h.cross(h.UNIT_Z,s,P0t);b=h.normalize(b,b);let f=h.cross(p,b,X0t),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=URe,A=DRe,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=IV(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=IV(S,r,f,b,c,u,d,m,p,E),A=IV(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,Tee),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=IV(-S,r,f,b,c,u,d,m,p,E),A=IV(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,Tee),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=IV(-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 Jd=_ee;var PV=new h,See=new h,Zee=new h,ORe=new h,Aa=new k,BRe=new q,N0t=new q,Ree=new Ne,zRe=new h,HRe=new h,KRe=new h,y3=new pe,JRe=new h,jRe=new k,QRe=new k;function qRe(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=zRe,Z=HRe,R=KRe,C=new ki(a),E=C.project(a.cartesianToCartographic(o,y3),JRe),A=a.scaleToGeodeticSurface(o,PV);a.geodeticSurfaceNormal(A,A);let L=BRe,F=N0t;if(c!==0){let X=Ne.fromAxisAngle(A,c,Ree);L=q.fromQuaternion(X,L),X=Ne.fromAxisAngle(A,-c,Ree),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,jRe),N=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,QRe),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,M=h.fromArray(e,X,PV);if(i.st){let O=q.multiplyByVector(L,M,See),w=C.project(a.cartesianToCartographic(O,y3),Zee);h.subtract(w,E,w),Aa.x=(w.x+r)/(2*r),Aa.y=(w.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(M,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=Jd.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 $Re(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 tZ=new h;function Y0t(e){let t=e.center;tZ=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,tZ),e.height,tZ),tZ=h.add(t,tZ,tZ);let n=new me(tZ,e.semiMajorAxis),i=Jd.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=qRe(o,e,!1),a=$Re(r);return a=Oe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function M0t(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=zRe,C=HRe,E=KRe,A=new ki(s),L=A.project(s.cartesianToCartographic(i,y3),JRe),F=s.scaleToGeodeticSurface(i,PV);s.geodeticSurfaceNormal(F,F);let I=Ne.fromAxisAngle(F,d,Ree),N=q.fromQuaternion(I,BRe),g=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jRe),V=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,QRe),G=e.length,v=G/3*2;for(let Y=0;Y<G;Y+=3){let D=Y+1,M=Y+2,O=h.fromArray(e,Y,PV),w;if(n.st){let K=q.multiplyByVector(N,O,See),te=A.project(s.cartesianToCartographic(K,y3),Zee);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),w=h.clone(O,See),R=s.geodeticSurfaceNormal(O,R),_&&(S[Y+G]=-R.x,S[D+G]=-R.y,S[M+G]=-R.z);let z=h.multiplyByScalar(R,a,ORe);if(O=h.add(O,z,O),z=h.multiplyByScalar(R,c,z),w=h.add(w,z,w),n.position&&(m[Y+G]=w.x,m[D+G]=w.y,m[M+G]=w.z,m[Y]=O.x,m[D]=O.y,m[M]=O.z),n.normal||n.tangent||n.bitangent){E=h.clone(R,E);let K=h.fromArray(e,(Y+3)%G,ORe);h.subtract(K,O,K);let te=h.subtract(w,O,Zee);R=h.normalize(h.cross(te,K,R),R),n.normal&&(b[Y]=R.x,b[D]=R.y,b[M]=R.z,b[Y+G]=R.x,b[D+G]=R.y,b[M+G]=R.z),n.tangent&&(C=h.normalize(h.cross(E,R,C),C),f[Y]=C.x,f[D]=C.y,f[M]=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[M]=E.z,y[Y+G]=E.x,y[D+G]=E.y,y[M+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 w0t(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 b3=new me,g3=new me;function k0t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,PV),e.height,PV);b3.center=h.add(t,o,b3.center),b3.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),g3.center=h.add(t,o,g3.center),g3.radius=i;let r=Jd.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=me.union(b3,g3),u=qRe(s,e,!0),m=$Re(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}),_=M0t(c,e);m=w0t(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 e1e(e,t,n,i,o,r,s){let c=Jd.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??Me.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=Me.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+Me.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 t1e=new h,n1e=new ne,i1e=new Me,o0={center:t1e,ellipsoid:n1e,vertexFormat:i1e,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,t1e);t+=h.packedLength;let o=ne.unpack(e,t,n1e);t+=ne.packedLength;let r=Me.unpack(e,t,i1e);t+=Me.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=Me.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 e1e(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=k0t(o);else if(r=Y0t(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:Me.POSITION_ONLY,shadowVolume:!0})};function U0t(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Jd.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=e1e(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=U0t(this)),this._textureCoordinateRotationPoints}}});var ud=r0;var TPi=x(T(),1);var o1e=new h,nZ=new h;function D0t(e){let t=e.center;nZ=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,nZ),e.height,nZ),nZ=h.add(t,nZ,nZ);let n=new me(nZ,e.semiMajorAxis),i=Jd.computeEllipsePositions(e,!1,!0).outerPositions,o=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:Jd.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 x3=new me,T3=new me;function O0t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o1e),e.height,o1e);x3.center=h.add(t,o,x3.center),x3.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),T3.center=h.add(t,o,T3.center),T3.radius=i;let r=Jd.computeEllipsePositions(e,!1,!0).outerPositions,s=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:Jd.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=me.union(x3,T3),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 XV(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"}XV.packedLength=h.packedLength+ne.packedLength+8;XV.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 r1e=new h,s1e=new ne,Wg={center:r1e,ellipsoid:s1e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};XV.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,r1e);t+=h.packedLength;let o=ne.unpack(e,t,s1e);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):(Wg.height=c,Wg.extrudedHeight=u,Wg.granularity=d,Wg.rotation=a,Wg.semiMajorAxis=r,Wg.semiMinorAxis=s,Wg.numberOfVerticalLines=m,Wg.offsetAttribute=p===-1?void 0:p,new XV(Wg))};XV.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=O0t(o);else if(r=D0t(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 Ku=XV;var a1e=new U,c1e=h.ZERO,l1e=new h,d1e=new re;function B0t(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 B0t(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,a1e)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,c1e,l1e))),new Yt({id:t,geometry:new ud(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,a1e),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,c1e,l1e))),new Yt({id:t,geometry:new Ku(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(ud.computeRectangle(s,d1e)).minimumTerrainHeight),s.extrudedHeight=o};Ff.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;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Li.prototype._isHidden.call(this,e,t,n)};NV.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(ud.computeRectangle(i,d1e)).minimumTerrainHeight),i.extrudedHeight=s};var aY=Ff;var FXi=x(T(),1);var sXi=x(T(),1);var z0t=new h,H0t=new h,K0t=new h,J0t=new h,j0t=new h,Q0t=new h(1,1,1),u1e=Math.cos,m1e=Math.sin;function vg(e){e=e??B.EMPTY_OBJECT;let t=e.radii??Q0t,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??Me.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=Me.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}vg.packedLength=2*h.packedLength+Me.packedLength+7;vg.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 h1e=new h,f1e=new h,p1e=new Me,Kx={radii:h1e,innerRadii:f1e,vertexFormat:p1e,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};vg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,h1e);t+=h.packedLength;let o=h.unpack(e,t,f1e);t+=h.packedLength;let r=Me.unpack(e,t,p1e);t+=Me.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=Me.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):(Kx.minimumClock=s,Kx.maximumClock=a,Kx.minimumCone=c,Kx.maximumCone=d,Kx.stackPartitions=u,Kx.slicePartitions=m,Kx.offsetAttribute=p===-1?void 0:p,new vg(Kx))};vg.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,M=new Array(y),O=new Array(y);for(u=0;u<y;u++)M[u]=m1e(b[u]),O[u]=u1e(b[u]);let w=new Array(_),z=new Array(_);for(m=0;m<_;m++)z[m]=u1e(f[m]),w[m]=m1e(f[m]);for(u=0;u<y;u++)for(m=0;m<_;m++)F[p++]=t.x*M[u]*z[m],F[p++]=t.y*M[u]*w[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*M[u]*z[m],F[p++]=n.y*M[u]*w[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,H0t);if(N[u]&&h.negate(je,je),a.st){let qe=k.negate(je,j0t);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=K0t,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,J0t);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:me.fromEllipsoid(Fe),offsetAttribute:e._offsetAttribute})};var Cee;vg.getUnitEllipsoid=function(){return l(Cee)||(Cee=vg.createGeometry(new vg({radii:new h(1,1,1),vertexFormat:Me.POSITION_ONLY}))),Cee};var Ha=vg;var q0t=new Qt(U.WHITE),Vee=h.ZERO,Eee=new h,$0t=new h,ebt=new h,Aee=new U,tbt=new h(1,1,1);function nbt(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 nbt(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,Aee)),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,Vee,Eee))),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,Aee),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,Vee,Eee))),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=_b;Ju.DynamicGeometryUpdater=cY;function cY(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)&&(cY.prototype=Object.create(Li.prototype),cY.prototype.constructor=cY);cY.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,$0t),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,Aee),c=yr.getValue(e,n.material??q0t,this._material),d=j.getValueOrUndefined(n.innerRadii,e,ebt),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,Vee,Eee);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?tbt: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 lY=Ju;var SNi=x(T(),1);var BXi=x(T(),1);function YV(e){e=e??B.EMPTY_OBJECT;let t=e.vertexFormat??Me.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}YV.packedLength=Me.packedLength;YV.pack=function(e,t,n){return n=n??0,Me.pack(e._vertexFormat,t,n),t};var b1e=new Me,ibt={vertexFormat:b1e};YV.unpack=function(e,t,n){t=t??0;let i=Me.unpack(e,t,b1e);return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n):new YV(ibt)};var _3=new h(-.5,-.5,0),S3=new h(.5,.5,0);YV.createGeometry=function(e){let t=e._vertexFormat,n=new Rn,i,o;if(t.position){if(o=new Float64Array(12),o[0]=_3.x,o[1]=_3.y,o[2]=0,o[3]=S3.x,o[4]=_3.y,o[5]=0,o[6]=S3.x,o[7]=S3.y,o[8]=0,o[9]=_3.x,o[10]=S3.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 me(h.ZERO,Math.sqrt(2))})};var dY=YV;var tNi=x(T(),1);function MV(){this._workerName="createPlaneOutlineGeometry"}MV.packedLength=0;MV.pack=function(e,t){return t};MV.unpack=function(e,t,n){return l(n)?n:new MV};var Jx=new h(-.5,-.5,0),Z3=new h(.5,.5,0);MV.createGeometry=function(){let e=new Rn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=Jx.x,n[1]=Jx.y,n[2]=Jx.z,n[3]=Z3.x,n[4]=Jx.y,n[5]=Jx.z,n[6]=Z3.x,n[7]=Z3.y,n[8]=Jx.z,n[9]=Jx.x,n[10]=Z3.y,n[11]=Jx.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 me(h.ZERO,Math.sqrt(2))})};var uY=MV;var obt=new h,g1e=new U;function rbt(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 rbt(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,g1e)),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=Gee(m,p,u,u),new Yt({id:t,geometry:new dY(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,g1e),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=Gee(c,d,a,a),new Yt({id:t,geometry:new uY,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=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,o=j.getValueOrUndefined(e.position,n,obt);return!l(o)||!l(i.plane)||!l(i.dimensions)||Li.prototype._isHidden.call(this,e,t,n)};wV.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 sbt=new h,abt=new h,cbt=new h,lbt=new h,dbt=new q,ubt=new q,mbt=new P;function Gee(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,cbt),a=h.clone(h.UNIT_Z,abt);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,sbt);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=dbt;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,lbt),m=q.multiplyByScale(d,u,ubt),p=P.fromRotationTranslation(m,s,mbt);return P.multiplyTransformation(n,p,i)}ah.createPrimitiveMatrix=Gee;var mY=ah;var OYi=x(T(),1);var HNi=x(T(),1);var hbt=new h,fbt=new nt,pbt=new k,bbt=new k,gbt=new h,ybt=new h,xbt=new h,hY=new h,Tbt=new h,_bt=new h,y1e=new Ne,Sbt=new q,Zbt=new q,Rbt=new h;function Cbt(e,t,n,i,o,r,s,a,c){let d=e.positions,u=hi.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=Sbt;if(i!==0){let g=Ne.fromAxisAngle(s,i,y1e);if(p=q.fromQuaternion(g,p),t.tangent||t.bitangent){g=Ne.fromAxisAngle(s,-i,y1e);let V=q.fromQuaternion(g,Zbt);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=bbt;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,hbt),v=r(G,pbt);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 iZ(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Me.DEFAULT;this._vertexFormat=Me.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)+Me.packedLength+ne.packedLength+(l(n)?oi.computeHierarchyPackedLength(n,k):1)+2}iZ.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 iZ(t)};iZ.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 Vbt=ne.clone(ne.UNIT_SPHERE),Ebt=new Me,Abt={polygonHierarchy:{}};iZ.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,Vbt);t+=ne.packedLength;let r=Me.unpack(e,t,Ebt);t+=Me.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 iZ(Abt)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};iZ.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=gbt,c=ybt,d=xbt,u=Tbt,m=_bt;if(!ug.computeProjectTo2DArguments(s,hY,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(hY,h.ZERO,W.EPSILON6)){let I=e._ellipsoid.geodeticSurfaceNormal(hY,Rbt);h.dot(a,I)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let b=ug.createProjectPointsTo2DFunction(hY,u,m),f=ug.createProjectPointTo2DFunction(hY,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=me.fromPoints(s),E=oi.computeBoundingRectangle(a,f,s,i,fbt),A=[];for(let I=0;I<S.length;I++){let N=new Yt({geometry:Cbt(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 fY=iZ;var pYi=x(T(),1);var x1e=[],R3=[];function Gbt(e,t,n,i,o){let s=Ms.fromPoints(t,e).projectPointsOntoPlane(t,x1e);hi.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,R3):o===un.RHUMB&&(y=oi.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,R3));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 Lbt(e,t,n,i,o){let s=Ms.fromPoints(t,e).projectPointsOntoPlane(t,x1e);hi.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,R3):o===un.RHUMB&&(S=oi.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,R3));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 oZ(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}oZ.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 Wbt=ne.clone(ne.UNIT_SPHERE),vbt={polygonHierarchy:{}};oZ.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,Wbt);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 oZ(vbt)),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};oZ.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 oZ(t)};oZ.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=Lbt(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=Gbt(t,s[f],d,o,r),a.geometry.attributes.position.values=hi.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],_=me.fromVertices(y.attributes.position.values);return new At({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var pY=oZ;var T1e="Entity polygons cannot have both height and perPositionHeight. height will be ignored",_1e="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",S1e=new U,Z1e=h.ZERO,R1e=new h,C1e=new re,Fbt=[],Ibt=new k;function Pbt(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){ri.call(this,{entity:e,scene:t,geometryOptions:new Pbt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(ju.prototype=Object.create(ri.prototype),ju.prototype.constructor=ju);ju.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,S1e)),l(s)||(s=U.WHITE),o.color=$t.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Z1e,R1e)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new fY(i):r=new kp(i),new Yt({id:t,geometry:r,attributes:o})};ju.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,S1e),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,Z1e,R1e)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new qm(i):a=new pY(i),new Yt({id:t,geometry:a,attributes:s})};ju.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=Ms.fromPoints(i,o),s=r.projectPointsOntoPlane(i,Fbt),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,Ibt);_=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)};ju.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Wi.prototype._isHidden.call(this,e,t)};ju.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};ju.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)};ju.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(_1e))):(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,C1e);a=Pi.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};ju.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)};ju.DynamicGeometryUpdater=kV;function kV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(kV.prototype=Object.create(Li.prototype),kV.prototype.constructor=kV);kV.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Li.prototype._isHidden.call(this,e,t,n)};kV.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(_1e))):(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,C1e);a=Pi.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var bY=ju;var qMi=x(T(),1);var fMi=x(T(),1);function Xbt(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=hi.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:me.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 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._vertexFormat=Me.clone(e.vertexFormat??Me.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+Me.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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var V1e=ne.clone(ne.UNIT_SPHERE),E1e=new Me,gY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:V1e,vertexFormat:E1e,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,V1e);t+=ne.packedLength;let c=Me.unpack(e,t,E1e);t+=Me.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=Me.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(gY.polylinePositions=r,gY.shapePositions=s,gY.cornerType=d,gY.granularity=u,new yY(gY))};var Nbt=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;hi.computeWindingOrder2D(i)===qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,Nbt),r=Cf.computePositions(n,i,o,e,!0);return Xbt(r,i,o,e._vertexFormat)};var xY=yY;var PMi=x(T(),1);function Ybt(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:me.fromVertices(e),primitiveType:Ie.LINES})}function _Y(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}_Y.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 A1e=ne.clone(ne.UNIT_SPHERE),TY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:A1e,height:void 0,cornerType:void 0,granularity:void 0};_Y.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=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):(TY.polylinePositions=r,TY.shapePositions=s,TY.cornerType=c,TY.granularity=d,new _Y(TY))};var Mbt=new nt;_Y.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;hi.computeWindingOrder2D(i)===qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,Mbt),r=Cf.computePositions(n,i,o,e,!1);return Ybt(r,i)};var SY=_Y;var G1e=new U;function wbt(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 wbt(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,G1e)),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 xY(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,G1e),o=this._distanceDisplayConditionProperty.getValue(e);return new Yt({id:t,geometry:new SY(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=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.polylinePositions)||!l(i.shapePositions)||Li.prototype._isHidden.call(this,e,t,n)};UV.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 ZY=s0;var Jwi=x(T(),1);var Rwi=x(T(),1);var Lee=new h,v1e=new h,F1e=new h,I1e=new h,P1e=new re,kbt=new k,Ubt=new me,Dbt=new me;function X1e(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 Obt(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=I1e,u=F1e,m=v1e;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let b=h.fromArray(e,p,Lee),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 X1e(t,{positions:e,normals:r,tangents:s,bitangents:a})}var Wee=new h,N1e=new h;function Bbt(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=I1e,p=F1e,b=v1e;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let y=h.fromArray(e,f,Lee),_=h.fromArray(e,(f+6)%i,Wee);if(u){let S=h.fromArray(e,(f+3)%i,N1e);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 X1e(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Y1e(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,_=Lee,S=kbt,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=Obt(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 DV(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 OV(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 vee=new Me;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=Me.clone(o,vee);We.normal=!0,e._vertexFormat=We}let m=Y1e(e,t);n&&(e._vertexFormat=o);let p=hi.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 _=hi.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,M=4,O=4;G&&(Y-=1,X-=1,D+=1,M-=2,O-=1),v&&(Y-=1,X-=1,D+=1,M-=2,O-=1),D+=Y*d+2*X-M;let w=(D+O)*2,z=new Float64Array(w*3),K=n?new Float32Array(w*3):void 0,te=F?new Uint8Array(w):void 0,H=o.st?new Float32Array(w*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=DV(z,ee,ye,p,_),ee+=6,o.st&&(H=OV(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=DV(z,ee,ye,p,_),ee+=6,o.st&&(H=OV(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=DV(z,ee,ye,p,_),ee+=6,o.st&&(H=OV(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=DV(z,ee,ye,p,_),ee+=6,o.st&&(H=OV(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=DV(z,ee,ye,p,_),ee+=6,o.st&&(H=OV(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=DV(z,ee,ye,p,_),ee+=6,o.st&&(H=OV(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=Bbt(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(w,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,Wee),Ke=h.fromArray(z,je*3,N1e);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 Hbt=[new h,new h,new h,new h],M1e=new pe,Kbt=new pe;function Fee(e,t,n,i,o){if(n===0)return re.clone(e,o);let r=Ca.computeOptions(e,t,n,0,P1e,M1e),s=r.height,a=r.width,c=Hbt;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=Me.clone(e.vertexFormat??Me.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+Me.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 w1e=new re,k1e=ne.clone(ne.UNIT_SPHERE),jx={rectangle:w1e,ellipsoid:k1e,vertexFormat:vee,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,w1e);t+=re.packedLength;let o=ne.unpack(e,t,k1e);t+=ne.packedLength;let r=Me.unpack(e,t,vee);t+=Me.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=Me.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):(jx.granularity=s,jx.height=a,jx.rotation=c,jx.stRotation=d,jx.extrudedHeight=u,jx.shadowVolume=m,jx.offsetAttribute=p===-1?void 0:p,new a0(jx))};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 Fee(n,i,r,o,t)};var Jbt=new q,L1e=new Ne,jbt=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,P1e,M1e,Kbt),a=Jbt;if(o!==0||i!==0){let b=re.center(t,jbt),f=n.geodeticSurfaceNormalCartographic(b,Wee);Ne.fromAxisAngle(f,-o,L1e),q.fromQuaternion(L1e,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=me.fromRectangle3D(t,n,c,Dbt),f=me.fromRectangle3D(t,n,d,Ubt);p=me.union(b,f)}else{if(m=Y1e(e,s),m.attributes.position.values=hi.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=me.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:Me.POSITION_ONLY,shadowVolume:!0})};var W1e=new re,Qbt=[new k,new k,new k],qbt=new Ji,$bt=new pe;function egt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=re.clone(e._rectangle,W1e),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=Fee(t,n,o,i,W1e),s=Qbt;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,qbt),d=re.center(a,$bt);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=Fee(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=egt(this)),this._textureCoordinateRotationPoints}}});var rZ=a0;var U1e=new U,D1e=h.ZERO,O1e=new h,B1e=new re,tgt=new re,ngt=new pe;function igt(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 igt(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,U1e)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Zo.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,D1e,O1e))),new Yt({id:t,geometry:new rZ(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,U1e),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,D1e,O1e))),new Yt({id:t,geometry:new XS(this._options),attributes:r})};If.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.rectangle.coordinates,e,tgt);if(!l(n))return;let i=re.center(n,ngt);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(rZ.computeRectangle(a,B1e)).minimumTerrainHeight),a.extrudedHeight=r};If.DynamicGeometryUpdater=BV;function BV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(BV.prototype=Object.create(Li.prototype),BV.prototype.constructor=BV);BV.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Li.prototype._isHidden.call(this,e,t,n)};BV.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(rZ.computeRectangle(i,B1e)).minimumTerrainHeight),i.extrudedHeight=s};var RY=If;var Q9i=x(T(),1);var x9i=x(T(),1);var i9i=x(T(),1);var z1e={};function ogt(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var rgt=new pe,sgt=new pe;function agt(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,rgt);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,sgt);s&&(Z.height=n[_]),f=f&&Z.height===0,ogt(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 cgt=new Array(2),lgt=new Array(2),dgt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};z1e.computePositions=function(e,t,n,i,o,r){let s=agt(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=dgt;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=cgt,_=lgt;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 sZ=z1e;var Iee=new h,C3=new h,ugt=new h,H1e=new h,mgt=new h,hgt=new h,fgt=new h;function aZ(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??Me.DEFAULT,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Me.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+Me.packedLength+1}aZ.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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._granularity,t};var K1e=ne.clone(ne.UNIT_SPHERE),J1e=new Me,CY={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:K1e,vertexFormat:J1e,granularity:void 0};aZ.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,K1e);t+=ne.packedLength;let d=Me.unpack(e,t,J1e);t+=Me.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=Me.clone(d,n._vertexFormat),n._granularity=u,n):(CY.positions=r,CY.minimumHeights=s,CY.maximumHeights=a,CY.granularity=u,new aZ(CY))};aZ.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 aZ(c)};aZ.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=sZ.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=fgt,F=hgt,I=mgt,N=!0;m/=3;let g,V=0,G=1/(m-u-1);for(g=0;g<m;++g){let M=g*3,O=h.fromArray(d,M,Iee),w=h.fromArray(c,M,C3);if(o.position&&(b[Z++]=w.x,b[Z++]=w.y,b[Z++]=w.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,H1e),K=h.subtract(O,s.geodeticSurfaceNormal(O,C3),C3);if(g+1<m&&(z=h.fromArray(d,M+3,H1e)),N){let te=h.subtract(z,O,ugt),H=h.subtract(K,O,Iee);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 M=g,O=g+2,w=h.fromArray(b,M*3,Iee),z=h.fromArray(b,O*3,C3);if(h.equalsEpsilon(w,z,W.EPSILON10))continue;let K=g+1,te=g+3;Y[D++]=K,Y[D++]=M,Y[D++]=te,Y[D++]=te,Y[D++]=M,Y[D++]=O}return new At({attributes:v,indices:Y,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromVertices(b)})};var VY=aZ;var I9i=x(T(),1);var j1e=new h,Q1e=new h;function cZ(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}cZ.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 q1e=ne.clone(ne.UNIT_SPHERE),EY={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:q1e,granularity:void 0};cZ.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,q1e);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):(EY.positions=r,EY.minimumHeights=s,EY.maximumHeights=a,EY.granularity=d,new cZ(EY))};cZ.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 cZ(c)};cZ.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=sZ.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,j1e),C=h.fromArray(a,Z,Q1e);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,j1e),E=h.fromArray(m,R*3,Q1e);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:me.fromVertices(m)})};var AY=cZ;var $1e=new U;function pgt(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 pgt(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,$1e)),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 VY(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,$1e),o=this._distanceDisplayConditionProperty.getValue(e);return new Yt({id:t,geometry:new AY(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=zV;function zV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(zV.prototype=Object.create(Li.prototype),zV.prototype.constructor=zV);zV.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Li.prototype._isHidden.call(this,e,t,n)};zV.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 GY=Pf;var lZ=[_2,KN,wN,aY,lY,mY,bY,ZY,RY,GY];function dZ(e,t){this.entity=e,this.scene=t;let n=new Array(lZ.length),i=new Se,o=new Hr;for(let r=0;r<n.length;r++){let s=new lZ[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(dZ.prototype._onEntityPropertyChanged,this)}dZ.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)};dZ.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};dZ.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)};dZ.registerUpdater=function(e){lZ.includes(e)||lZ.push(e)};dZ.unregisterUpdater=function(e){if(lZ.includes(e)){let t=lZ.indexOf(e);lZ.splice(t,1)}};var uZ=dZ;var Aki=x(T(),1);var eCe=new U,bgt=new Ot,ggt=new Ot,ygt=h.ZERO,xgt=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 wt,this.updaters=new wt,this.updatersWithAttributes=new wt,this.attributes=new wt,this.subscriptions=new wt,this.showsUpdated=new wt,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,eCe);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,eCe);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,ggt,bgt);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,ygt,xgt);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 HV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}HV.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 tCe(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}HV.prototype.remove=function(e){tCe(this._solidItems,e)||tCe(this._translucentItems,e)};function nCe(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 V3(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}HV.prototype.update=function(e){let t=V3(this,this._solidItems,e,!0);t=V3(this,this._translucentItems,e,t)&&t;let n=nCe(this,this._solidItems,e),i=nCe(this,this._translucentItems,e);return(n||i)&&(t=V3(this,this._solidItems,e,t)&&t,t=V3(this,this._translucentItems,e,t)&&t),t};function iCe(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}HV.prototype.getBoundingSphere=function(e,t){let n=iCe(this._solidItems,e,t);return n===Wt.FAILED?iCe(this._translucentItems,e,t):n};function oCe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}HV.prototype.removeAllPrimitives=function(){oCe(this._solidItems),oCe(this._translucentItems)};var ch=HV;var Oki=x(T(),1);var Tgt=new Ot,_gt=new Ot,Sgt=h.ZERO,Zgt=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 wt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new wt,this.attributes=new wt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Nf.prototype.onMaterialChanged,this),this.subscriptions=new wt,this.showsUpdated=new wt}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 Rgt=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,Rgt);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,_gt,Tgt);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,Sgt,Zgt);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 KV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}KV.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)};KV.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}}};KV.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};KV.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};KV.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=KV;var uUi=x(T(),1);var qki=x(T(),1);var Jki=x(T(),1);var zki=x(T(),1);function E3(e,t,n=0,i=e.length-1,o=Cgt){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));E3(e,t,b,f,o)}let r=e[t],s=n,a=i;for(LY(e,n,t),o(e[i],r)>0&&LY(e,n,i);s<a;){for(LY(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?LY(e,n,a):(a++,LY(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function LY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Cgt(e,t){return e<t?-1:e>t?1:0}var FY=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(!G3(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;G3(t,c)&&(n.leaf?i.push(a):Xee(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!G3(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(G3(t,s)){if(n.leaf||Xee(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=jV([]),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=Vgt(t,i.children,n);if(u!==-1)return i.children.splice(u,1),r.push(i),this._condense(r),this}!d&&!i.leaf&&Xee(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=jV(t.slice(n,i+1)),JV(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=jV([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),d=c*Math.ceil(Math.sqrt(s));rCe(t,n,i,d,this.compareMinX);for(let u=n;u<=i;u+=d){let m=Math.min(u+d-1,i);rCe(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 JV(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=Pee(d),m=Ggt(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),vY(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=jV(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,JV(i,this.toBBox),JV(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=jV([t,n]),this.data.height=t.height+1,this.data.leaf=!1,JV(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=WY(t,0,a,this.toBBox),d=WY(t,a,i,this.toBBox),u=Lgt(c,d),m=Pee(c)+Pee(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:Egt,r=t.leaf?this.compareMinY:Agt,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=WY(t,0,n,r),a=WY(t,i-n,i,r),c=A3(s)+A3(a);for(let d=n;d<i-n;d++){let u=t.children[d];vY(s,t.leaf?r(u):u),c+=A3(s)}for(let d=i-n-1;d>=n;d--){let u=t.children[d];vY(a,t.leaf?r(u):u),c+=A3(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)vY(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():JV(t[n],this.toBBox)}};function Vgt(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 JV(e,t){WY(e,0,e.children.length,t,e)}function WY(e,t,n,i,o){o||(o=jV(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];vY(o,e.leaf?i(s):s)}return o}function vY(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 Egt(e,t){return e.minX-t.minX}function Agt(e,t){return e.minY-t.minY}function Pee(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function A3(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ggt(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 Lgt(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 Xee(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function G3(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function jV(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function rCe(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;E3(e,s,t,n,o),r.push(t,s,s,n)}}function L3(){this._tree=new FY}function mZ(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}mZ.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};L3.prototype.insert=function(e,t){let n=mZ.fromRectangleAndId(e,t,new mZ);this._tree.insert(n)};function Wgt(e,t){return e.id===t.id}var vgt=new mZ;L3.prototype.remove=function(e,t){let n=mZ.fromRectangleAndId(e,t,vgt);this._tree.remove(n,Wgt)};var Fgt=new mZ;L3.prototype.collides=function(e){let t=mZ.fromRectangleAndId("",e,Fgt);return this._tree.collides(t)};var hZ=L3;var Igt=new U,Pgt=new Ot,Xgt=new Ot;function Fg(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 wt,this.updaters=new wt,this.updatersWithAttributes=new wt,this.attributes=new wt,this.subscriptions=new wt,this.showsUpdated=new wt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new hZ}Fg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Fg.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)}))}};Fg.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};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 Yl({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,Igt);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,Xgt,Pgt);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};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.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Wt.DONE):Wt.FAILED};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){this._batches=[],this._primitives=e,this._classificationType=t}QV.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 Fg(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};QV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};QV.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};QV.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};QV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var qV=QV;var CUi=x(T(),1);var Ngt=new Ot,Ygt=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 wt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wt,this.material=void 0,this.updatersWithAttributes=new wt,this.attributes=new wt,this.subscriptions=new wt,this.showsUpdated=new wt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new hZ}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 Yl({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,Ygt,Ngt);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 $V(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}$V.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)};$V.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};$V.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};$V.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};$V.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 IY=$V;var wUi=x(T(),1);var Mgt=new U,wgt=new Ot,kgt=new Ot,Ugt=h.ZERO,Dgt=new h;function Ig(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 wt,this.updaters=new wt,this.updatersWithAttributes=new wt,this.attributes=new wt,this.itemsToRemove=[],this.subscriptions=new wt,this.showsUpdated=new wt}Ig.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)}))}};Ig.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};Ig.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,Mgt);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,kgt,wgt);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,Ugt,Dgt);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};Ig.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()};Ig.prototype.contains=function(e){return this.updaters.contains(e.id)};Ig.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)};Ig.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 eE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new wt,this._translucentBatches=new wt}eE.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 Ig(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 Ig(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};eE.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};eE.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};eE.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};eE.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 tE=eE;var Ogt=[];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 wt,this._removedObjects=new wt,this._changedObjects=new wt;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 tE(n,e,s,!1),this._outlineBatches[o+s]=new tE(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 IY(i,s,Co)),c[s]=new qV(i,s);else for(s=0;s<a;++s)c[s]=new qV(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new eZ(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new wt,this._updaterSets=new wt,this._entityCollection=t,t.collectionChanged.addEventListener(jd.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Ogt)}jd.registerUpdater=function(e){uZ.registerUpdater(e)};jd.unregisterUpdater=function(e){uZ.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 uZ(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 Bgt=[],zgt=new me;jd.prototype.getBoundingSphere=function(e,t){let n=Bgt,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]=me.clone(i,n[o]),o++)}}return o===0?Wt.FAILED:(n.length=o,me.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(),ue(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 PY=jd;var C5i=x(T(),1);var Hgt=1,Kgt="30px sans-serif",Jgt=Tr.FILL,jgt=U.WHITE,Qgt=U.BLACK,qgt=1,$gt=!1,eyt=new U(.165,.165,.165,.8),tyt=new k(7,5),nyt=k.ZERO,iyt=h.ZERO,oyt=He.NONE,ryt=Ui.CENTER,syt=Bn.CENTER,ayt=new h,cyt=new U,lyt=new U,dyt=new U,uyt=new k,myt=new h,hyt=new k,fyt=new Kt,pyt=new Kt,byt=new Kt,gyt=new Ot;function sCe(e){this.entity=e,this.label=void 0,this.index=void 0}function Qx(e,t){t.collectionChanged.addEventListener(Qx.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new wt,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._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,ayt),c=j.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){Nee(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,b=j.getValueOrDefault(a._heightReference,e,oyt);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,Hgt),d.font=j.getValueOrDefault(a._font,e,Kgt),d.style=j.getValueOrDefault(a._style,e,Jgt),d.fillColor=j.getValueOrDefault(a._fillColor,e,jgt,cyt),d.outlineColor=j.getValueOrDefault(a._outlineColor,e,Qgt,lyt),d.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,qgt),d.showBackground=j.getValueOrDefault(a._showBackground,e,$gt),d.backgroundColor=j.getValueOrDefault(a._backgroundColor,e,eyt,dyt),d.backgroundPadding=j.getValueOrDefault(a._backgroundPadding,e,tyt,uyt),d.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,nyt,hyt),d.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,iyt,myt),d.heightReference=b,d.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,ryt),d.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,syt),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,fyt),d.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,pyt),d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,byt),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,gyt),d.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};Qx.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=ib(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.removeLabel(e[t]);return ue(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._label)&&l(r._position)&&s.set(r.id,new sCe(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 sCe(r)):(Nee(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Nee(s.get(r.id),r,a),s.remove(r.id)};function Nee(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var XY=Qx;var H5i=x(T(),1);var yyt=1,xyt=!0,Tyt=0,_yt=!0,Syt=!0,Zyt=vn.ENABLED,Ryt=He.NONE,Cyt=U.RED,Vyt=0,Eyt=U.WHITE,Ayt=al.HIGHLIGHT,Gyt=.5,Lyt=new k(1,1),aCe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Wyt=new P,vyt=new P,cCe=new U,lCe=new Array(4),Fyt=new h;function qx(e,t){t.collectionChanged.addEventListener(qx.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new wt,this._onCollectionChanged(t,t.values,[],[])}function Iyt(e,t){return e instanceof ui?e.valueOf():j.getValueOrUndefined(e,t)}function Pyt(e,t){return t!==e.uri?!1:t instanceof ve?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function dCe(e,t){e.uri=t,t instanceof ve&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function Xyt(e,t){if(!l(t))return P.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function Nyt(e,t,n,i,o){let r=e._primitives,s=e._modelHash,a=s[t.id],c=()=>!e.isDestroyed()&&s[t.id]===a;try{let d=await Nu.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(!c()){d.destroy();return}d.id=t,r.add(d),a.modelPrimitive=d,d.errorEvent.addEventListener(u=>{c()&&(console.log(u),u.name!=="TextureError"&&d.incrementallyLoadTextures&&(a.loadFailed=!0))})}catch(d){if(!c())return;console.log(d),a.loadFailed=!0}}qx.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,p;if(u&&(m=s.computeModelMatrix(e,Wyt),p=Iyt(a._uri,e),u=l(m)&&l(p)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if((!l(d)||!Pyt(d,p))&&(c=ve.createIfNeeded(p),l(d)&&c.url===d.url&&(dCe(d,p),c=void 0)),l(c)){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...aCe}},n[s.id]=d,dCe(d,p);let y=j.getValueOrDefault(a._incrementallyLoadTextures,e,_yt),_=j.getValueOrDefault(a._environmentMapOptions,e,aCe,d.environmentMapOptionsScratch);Nyt(this,s,c,y,_)}let b=d.modelPrimitive;if(!l(b))continue;b.show=!0,b.scale=j.getValueOrDefault(a._scale,e,yyt),b.enableVerticalExaggeration=j.getValueOrDefault(a._enableVerticalExaggeration,e,xyt),b.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,Tyt),b.maximumScale=j.getValueOrUndefined(a._maximumScale,e),b.modelMatrix=Xyt(m,b.modelMatrix),b.shadows=j.getValueOrDefault(a._shadows,e,Zyt),b.heightReference=j.getValueOrDefault(a._heightReference,e,Ryt),b.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),b.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,Cyt,cCe),b.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,Vyt),b.color=j.getValueOrDefault(a._color,e,Eyt,cCe),b.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,Ayt),b.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,Gyt),b.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),b.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,Syt),b.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,Lyt);let f=j.getValueOrUndefined(a._lightColor,e);if(l(f)&&(U.pack(f,lCe,0),f=h.unpack(lCe,0,Fyt)),b.lightColor=f,b.customShader=j.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,b.ready){let y=j.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==y&&(y?b.activeAnimations.addAll({loop:Md.REPEAT}):b.activeAnimations.removeAll(),d.animationsRunning=y);let _=j.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(_)){let R=Object.keys(_);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=_[A];if(!l(L))continue;let F=b.getNode(A);if(!l(F))continue;let I=P.fromTranslationRotationScale(L,vyt);F.matrix=P.multiply(F.originalMatrix,I,I)}}let S=!1,Z=j.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(Z)){let R=Object.keys(Z);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=Z[A];l(L)&&(S=!0,b.setArticulationStage(A,L))}}S&&b.applyArticulations()}}return!0};qx.prototype.isDestroyed=function(){return!1};qx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qx.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Yee(this,e[i],t,n);return ue(this)};var NY=new h,Yyt=new pe;qx.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;NY.x=a[12],NY.y=a[13],NY.z=a[14];let c=r.cartesianToCartographic(NY,Yyt),d=o.getHeight(c,i.heightReference);if(l(d)||(d=i._lastSurfaceHeight),!l(d)){let u=this._modelHash,m=Nh(o,n,NY,[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),me.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Wt.DONE}return me.clone(i.boundingSphere,t),Wt.DONE};qx.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)?(Myt(r,a),s.set(r.id,r)):(Yee(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Yee(this,r,a,c),s.remove(r.id)};function Yee(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Myt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var YY=qx;var GDi=x(T(),1);var tDi=x(T(),1);function $x(e){this._definitionChanged=new Se,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties($x.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 wyt=new Q;$x.prototype.getValue=function(e,t){return l(e)||(e=Q.now(wyt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};$x.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))};$x.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};$x.prototype.equals=function(e){return this===e||e instanceof $x&&this._value===e._value};$x.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var l0=$x;var uCe=new q,mCe=new q,hCe=new q,kyt=new h,fCe=new h,Uyt=new h,Dyt=new h,W3=new Ne,v3=new P,F3=new q;function wY(e,t,n,i,o){if(!(!l(t)||!l(n))){if(h.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,W3)&&(Ne.conjugate(W3,W3),q.fromQuaternion(W3,F3),q.multiplyByVector(F3,o,o));else if(l(kee(e,i.position,v3)))P.inverse(v3,v3),P.getRotation(v3,F3),q.multiplyByVector(F3,o,o);else return;return o}}function kee(e,t,n){let i=t.getValue(e,kyt);if(l(i)){let o=Q.addSeconds(e,.01,new Q),r=t.getValue(o,fCe);if(l(r)&&!h.equalsEpsilon(i,r,W.EPSILON16)){let s=_t.computeFixedToIcrfMatrix(e,uCe),a=_t.computeFixedToIcrfMatrix(o,mCe),c;!l(s)||!l(a)?(c=_t.computeTemeToPseudoFixedMatrix(e,hCe),s=q.transpose(c,uCe),a=_t.computeTemeToPseudoFixedMatrix(o,mCe),q.transpose(a,a)):c=q.transpose(s,hCe);let d=Uyt;h.normalize(i,d),h.normalize(r,r),q.multiplyByVector(s,d,d),q.multiplyByVector(a,r,r);let u=h.cross(d,r,Dyt);if(!h.equalsEpsilon(u,h.ZERO,W.EPSILON16)){let m=h.cross(u,d,fCe);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 pCe=60,_Ce=1,SCe=new Cn,Mee=new Cn,wee=new Cn;function bCe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var I3=new h;function Oyt(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,I3),b=wY(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,I3),l(b)&&l(f)&&(b=wY(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,I3),l(b)&&l(f)&&(b=wY(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,I3),l(b)&&l(f)&&(b=wY(n,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),p}function Byt(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 zyt(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 Hyt(e,t,n,i,o,r,s,a){wee.start=t,wee.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,wee,SCe).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 Kyt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function Jyt(e,t,n,i,o,r,s,a){Mee.start=t,Mee.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,Mee,SCe).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=ZCe(m.data,f,y,i,o,r,c,a)}}return c}function ZCe(e,t,n,i,o,r,s,a){for(;e instanceof Vg;)e=e.resolvedProperty;if(e instanceof fc){let c=e._property._times;s=Oyt(e,t,n,c,i,o,r,s,a)}else e instanceof S2?s=Byt(e,t,n,i,o,r,s,a):e instanceof mc?s=Jyt(e,t,n,i,o,r,s,a):e instanceof Eg?s=Hyt(e,t,n,i,o,r,s,a):e instanceof kl||e instanceof l0&&j.isConstant(e)?s=Kyt(e,t,n,i,o,r,s,a):s=zyt(e,t,n,i,o,r,s,a);return s}function Uee(e,t,n,i,o,r,s){l(s)||(s=[]);let a=ZCe(e,t,n,i,o,r,0,s);return s.length=a,s}var gCe=new q,yCe=new Ne,xCe=new q,MY=new Cn,P3=new Cn,fZ=new Cn;function jyt(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 TCe(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),_=Uee(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,_Ce),m++}return m}function kY(e,t){this._unusedIndexes=[],this._polylineCollection=new xf,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}kY.prototype.update=function(e){let t=this._referenceFrame;if(t===Oi.INERTIAL){let n=_t.computeIcrfToFixedMatrix(e,gCe);l(n)||(n=_t.computeTemeToPseudoFixedMatrix(e,gCe)),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,yCe))&&(q.fromQuaternion(yCe,xCe),P.fromRotationTranslation(xCe,n,this._polylineCollection.modelMatrix)):kee(e,t.position,this._polylineCollection.modelMatrix)}};kY.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,pCe),m=Uee(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:pCe,y=b.intervals,_=0;if(l(y)){MY.start=r,MY.stop=s,MY.isStartIncluded=!0,MY.isStopIncluded=!0;for(let S=0;S<y.length;S++){let Z=y.get(S);if(!Cn.intersect(Z,MY,P3))continue;let R=P3.start,C=P3.stop;if(Q.greaterThanOrEquals(R,C))continue;let E=jyt(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,P3,fZ)&&(Q.greaterThan(fZ.start,R)&&Q.lessThan(fZ.start,C)&&A.push(Q.clone(fZ.start)),Q.greaterThan(fZ.stop,R)&&Q.lessThan(fZ.stop,C)&&A.push(Q.clone(fZ.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)}}_=TCe(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);_=TCe(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,_Ce),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};kY.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};kY.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function d0(e,t){t.collectionChanged.addEventListener(d0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new wt,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 kY(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 ue(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 bCe(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 bCe(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=Uee;d0._computeVvlhTransform=kee;d0._transformToEntityFrame=wY;var UY=d0;var zDi=x(T(),1);var RCe=U.WHITE,CCe=U.BLACK,VCe=0,ECe=1,ACe=0,GCe=wr.NONE,LCe=new U,Qyt=new h,WCe=new U,vCe=new Kt,FCe=new Kt,ICe=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 eT(e,t){t.collectionChanged.addEventListener(eT.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new wt,this._onCollectionChanged(t,t.values,[],[])}eT.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,Qyt),m=l(p)),!m){DY(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let b=!1,f=!1;if(u!==He.NONE&&!l(d)?(l(c)&&(DY(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)&&(DY(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,vCe),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,FCe),c.color=j.getValueOrDefault(a._color,e,RCe,LCe),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,CCe,WCe),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,VCe),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,ECe),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,ICe),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,ACe),c.splitDirection=j.getValueOrDefault(a._splitDirection,e,GCe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,vCe),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,FCe),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,ICe),d.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,ACe),d.splitDirection=j.getValueOrDefault(a._splitDirection,e,GCe),d.heightReference=u;let y=j.getValueOrDefault(a._color,e,RCe,LCe),_=j.getValueOrDefault(a._outlineColor,e,CCe,WCe),S=Math.round(j.getValueOrDefault(a._outlineWidth,e,VCe)),Z=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,ECe)));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,ZS(R,C,E,S,Z))}f&&d._updateClamping()}}return!0};eT.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=ib(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}}return t.radius=0,Wt.DONE};eT.prototype.isDestroyed=function(){return!1};eT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(eT.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};eT.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)):(DY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],DY(s.get(r.id),r,a),s.remove(r.id)};function DY(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 OY=eT;var _Bi=x(T(),1);var UOi=x(T(),1);var mOi=x(T(),1);var wCe=[];function qyt(e,t,n,i,o){let r=wCe;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 BY(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=Me.clone(e.vertexFormat??Me.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+Me.packedLength+4}BY.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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var kCe=ne.clone(ne.UNIT_SPHERE),UCe=new Me,pZ={positions:void 0,colors:void 0,ellipsoid:kCe,vertexFormat:UCe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};BY.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,kCe);t+=ne.packedLength;let c=Me.unpack(e,t,UCe);t+=Me.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=Me.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(pZ.positions=r,pZ.colors=s,pZ.width=d,pZ.colorsPerVertex=u,pZ.arcType=m,pZ.granularity=p,new BY(pZ))};var XCe=new h,NCe=new h,YCe=new h,MCe=new h;BY.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,M){let O;return o?O=M===Y||M===0&&Y===1:O=M+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 M=1;for(c=0;c<b-1;++c)M+=Y(p[c],p[c+1],X);let O=new Array(M),w=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<M){let $=i[c+1],ee=qyt(z,K,te,$,H),le=ee.length;for(d=0;d<le;++d)O[w++]=ee[d]}else for(d=0;d<H;++d)O[w++]=U.clone(te)}O[w]=U.clone(i[i.length-1]),i=O,wCe.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=XCe,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],NCe),d===b-1?(I=XCe,h.subtract(p[b-1],p[b-2],I),h.add(p[b-1],I,I)):I=p[d+1],h.clone(I,MCe);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,M=d===b-1?2:4;for(u=D;u<M;++u){h.pack(NCe,y,E),h.pack(YCe,_,E),h.pack(MCe,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 w=u<2?X:Y;C[F++]=U.floatToByte(w.red),C[F++]=U.floatToByte(w.green),C[F++]=U.floatToByte(w.blue),C[F++]=U.floatToByte(w.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:me.fromPoints(p),geometryType:Sm.POLYLINES})};var Pg=BY;var $yt=new ui(0),X3={},DCe=new U,ext=new Qt(U.WHITE),txt=new ui(!0),nxt=new ui(vn.DISABLED),ixt=new ui(new Ot),oxt=new ui(ti.BOTH);function rxt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function sxt(){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 rxt,this._groundGeometryOptions=new sxt,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,DCe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)),this.clampToGround?new Yt({id:t,geometry:new __(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,DCe)),l(a)||(a=U.WHITE),s.depthFailColor=$t.fromColor(a)),new Yt({id:t,geometry:new Pg(this._geometryOptions),attributes:s}))};Yf.prototype.createOutlineGeometryInstance=function(e){};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){this._entitySubscription(),ue(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??ext,d=c instanceof Qt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??txt,this._shadowsProperty=o.shadows??nxt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??ixt,this._classificationTypeProperty=o.classificationType??oxt,this._fillEnabled=!0,this._zIndex=a??$yt;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)?_=ws.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 zY(e,t,this)};var nE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function zY(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 OCe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=X3[n];!l(i)||i.isDestroyed()?(i=new xf,X3[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}zY.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 ws;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=OCe(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)&&(nE.ellipsoid=u,nE.positions=r,nE.granularity=j.getValueOrUndefined(i._granularity,e),nE.height=oo.extractHeights(r,u),c===un.GEODESIC?r=oo.generateCartesianArc(nE):r=oo.generateCartesianRhumbArc(nE)),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)};zY.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 me.clone(n.boundingSphere,e),Wt.DONE}return l(t)&&!t.ready?Wt.PENDING:Wt.DONE}else{let t=OCe(this);if(t.show&&t.positions.length>0)return me.fromPoints(t.positions,e),Wt.DONE}return Wt.FAILED};zY.prototype.isDestroyed=function(){return!1};zY.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=X3[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete X3[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var HY=Yf;var oBi=x(T(),1);var axt=new U,cxt=new Ot,lxt=new Ot;function Mf(e,t,n,i,o){let r;n instanceof Qt?r=ws:r=sc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new wt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wt,this.material=void 0,this.updatersWithAttributes=new wt,this.attributes=new wt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Mf.prototype.onMaterialChanged,this),this.subscriptions=new wt,this.showsUpdated=new wt,this.zIndex=i,this._asynchronous=o}Mf.prototype.onMaterialChanged=function(){this.invalidated=!0};Mf.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)};Mf.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};Mf.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};Mf.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,axt);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,lxt,cxt);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};Mf.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()};Mf.prototype.contains=function(e){return this.updaters.contains(e.id)};Mf.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)};Mf.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 iE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}iE.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 Mf(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};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 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};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 Wt.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 KY=iE;var dxt=[];function BCe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function zCe(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 wt,this._removedObjects=new wt,this._changedObjects=new wt;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,ws,void 0,!1,o),this._materialBatches[o]=new lh(n,sc,void 0,!1,o),this._colorBatches[o+r]=new ch(n,ws,ws,!1,o),this._materialBatches[o+r]=new lh(n,sc,ws,!1,o),this._colorBatches[o+r*2]=new ch(n,ws,sc,!1,o),this._materialBatches[o+r*2]=new lh(n,sc,sc,!1,o);this._dynamicBatch=new eZ(n,i);let s=ti.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new KY(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new wt,this._updaters=new wt,this._entityCollection=t,t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,dxt)}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?(BCe(this,u),zCe(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),BCe(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 HY(c,this._scene),this._updaters.set(d,u),zCe(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 uxt=[],mxt=new me;u0.prototype.getBoundingSphere=function(e,t){let n=uxt,i=mxt,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]=me.clone(i,n[o]),o++)}return o===0?Wt.FAILED:(n.length=o,me.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(),ue(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 JY=u0;function Qd(e){Yl.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??Qd.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 BN;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 oE=[];Qd.registerVisualizer=function(e){oE.includes(e)||oE.push(e)};Qd.unregisterVisualizer=function(e){if(oE.includes(e)){let t=oE.indexOf(e);oE.splice(t,1)}};Qd.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new lG(t,i),new PY(e,i,n._primitives,n._groundPrimitives),new XY(t,i),new YY(e,i),new WN(e,i),new OY(t,i),new UY(e,i),new JY(e,i,n._primitives,n._groundPrimitives),...oE.map(o=>new o(e,i))]};Object.defineProperties(Qd.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}}});Qd.prototype.isDestroyed=function(){return!1};Qd.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)};Qd.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};Qd.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 hxt=[],fxt=new me;Qd.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=hxt,a=fxt,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]=me.clone(a,s[c]),c++)}}return c===0?Wt.FAILED:(s.length=c,me.fromBoundingSpheres(s,n),Wt.DONE)};Qd.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new xl),s=o.add(new sY);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Qd.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};Qd.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 jY=Qd;var s3i=x(T(),1);var BBi=x(T(),1);function Dee(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}Dee.clone=function(e,t){if(l(e))return l(t)||(t=new Dee),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var dh=Dee;var HCe=new q,KCe=new q,JCe=new q,pxt=new P,N3=new h,jCe=new h,Oee=new h,Bee=new h,QCe=new h,qCe=new h,bxt=new Ne,gxt=new h,yxt=new q,rE=new Q,xxt=1.25;function Txt(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,rE);let L=o.getValue(rE,N3);if(l(L)||(Q.addSeconds(c,-.001,rE),L=o.getValue(rE,N3),b=!0),l(L)){let F=_t.computeFixedToIcrfMatrix(c,HCe),I=_t.computeFixedToIcrfMatrix(rE,KCe),N;!l(F)||!l(I)?(N=_t.computeTemeToPseudoFixedMatrix(c,JCe),F=q.transpose(N,HCe),I=_t.computeTemeToPseudoFixedMatrix(rE,KCe),q.transpose(I,I)):N=q.transpose(F,JCe);let g=q.multiplyByVector(F,m,QCe),V=q.multiplyByVector(I,L,qCe);h.subtract(g,V,Bee);let G=h.magnitude(Bee)*1e3,v=W.GRAVITATIONALPARAMETER,X=-v/(G*G-2*v/h.magnitude(g));X<0||X>xxt*d.maximumRadius?(f=jCe,h.normalize(m,f),h.negate(f,f),_=h.clone(h.UNIT_Z,Oee),y=h.cross(_,f,N3),h.magnitude(y)>W.EPSILON7&&(h.normalize(f,f),h.normalize(y,y),_=h.cross(f,y,Oee),h.normalize(_,_),p=!0)):h.equalsEpsilon(m,L,W.EPSILON7)||(_=jCe,h.normalize(g,_),h.normalize(V,V),y=h.cross(_,V,Oee),b&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,W.EPSILON7)||(f=h.cross(y,_,N3),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,Bee),Z=h.clone(t.direction,QCe),R=h.clone(t.up,qCe));let C=pxt,E;l(s)&&(E=s.getValue(c,bxt));let A=r.getValue(c,gxt);if(a===mb.INERTIAL&&l(E))P.fromTranslationQuaternionRotationScale(m,E,h.ONE,C);else if(a===mb.VELOCITY&&l(A)){let L=_t.rotationMatrixFromPositionVelocity(m,A,d,yxt);P.fromRotationTranslation(L,m,C)}else a===mb.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 QY(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 Gg(e.position,!0),this._offset3D=new h}Object.defineProperties(QY,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});QY.defaultOffset3D=new h(-14e3,3500,3500);var Y3=new dh,_xt=new h;QY.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)){Y3.pitch=-W.PI_OVER_FOUR,Y3.range=0;let S=a.getValue(e,_xt);if(l(S)){let Z=2-1/Math.max(1,h.magnitude(S)/i.maximumRadius);Y3.pitch*=Z}p.viewBoundingSphere(t,Y3),this.boundingSphere=t,b=!1,f=!1}else(!_||!l(y.getValue(e,this._offset3D)))&&h.clone(QY._defaultOffset3D,this._offset3D)}else!m&&this._mode!==se.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Txt(this,p,b,f,a,c,d,s,e,i)};var qY=QY;var WJi=x(T(),1);var qKi=x(T(),1);var pKi=x(T(),1);m0();var sHi=x(T(),1);var Szi=x(T(),1);bc();xZ();pz();pM();var GEe={type:"module"},bte="error",cTt="messageerror",LEe,pte,WEe,gte=!0;try{gte=typeof structuredClone==Yr&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}EEe(lTt);function lTt(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=xz(e.workerURI,n,e)}catch{return hte(e),fte(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await dTt(e,{chunkSize:i,wasmURI:r,baseURI:n,workerStartupTimeout:o})}catch(a){if(a&&a.workerStartupFailed)return hte(e),vEe(e),yz(e,t);if(a&&a.codecImportFailed){if(e.reader)return vEe(e),yz(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function dTt(e,t){if(!e.worker){let{startupError:b}=e;e.startupError=null;let f=b||new Error(ZZ);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}=uTt(e.writable),u;try{u=yte({type:_Ee,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(()=>mTt(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 uTt(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 vEe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function xte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function xz(e,t,n,i,o=!0){let{createWorker:r}=n,s,a,c;if(r)s=r();else if(pte===ke||LEe!==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=GEe);try{s=new Worker(a,c)}catch(p){if(m)try{URL.revokeObjectURL(a)}catch{}if(d&&m)return xz(e,t,n,i,!1);if(i)throw p;return xz(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=GEe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return xz(e,t,n,!1,o);throw p}}LEe=e,pte=a,WEe=c}else s=new Worker(pte,WEe);return s.addEventListener(TEe,d=>{n.workerAlive=!0,IEe(n),hTt(d,n)}),s.addEventListener(bte,d=>FEe(d,n)),s.addEventListener(cTt,d=>FEe(d,n)),s}function mTt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(xte(e),e.worker=null,t){let i=new Error(ZZ);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function IEe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function FEe(e,t){e.preventDefault&&e.preventDefault(),IEe(t);let{workerAlive:n,rejectResult:i,writer:o,onTaskFinished:r}=t;xte(t),n||(t.worker=null);let s=e.error||new Error(e.message||bte);n||(s=Object.assign(new Error(s.message||bte),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),o&&o.releaseLock(),n&&r())}function yte(e,{worker:t,writer:n,transferStreams:i,workerAlive:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(e.value=q3(r),c.push(e.value.buffer)),i&>e&&o?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{gte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function hTt({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==SEe){let{value:y,done:_}=await a.read();b()||yte({type:lte,value:y,done:_,messageId:o},t)}n==lte&&(await c.ready,await c.write(new Uint8Array(i)),b()||yte({type:ZEe,messageId:o},t)),n==REe&&f(null,r)}}catch(y){b()||(xte(t),f(y))}function f(y,_){b()||(y?u(y):d(_),c&&c.releaseLock(),y&&y.codecImportFailed||m())}}wne();var CHi=x(T(),1);var THi=x(T(),1);bc();m0();_Z();pM();Zz();Az();$ee();xZ();pE();Hte();eM();var qne="File already exists",$ne="Zip file comment exceeds 64KB",IAe="Invalid zip file comment (must be a Uint8Array)",PAe="File entry comment exceeds 64KB",XAe="Invalid file entry comment (must be a string)",NAe="Invalid date (must be a valid Date instance)",YAe="File entry name exceeds 64KB",eie="Version exceeds 65535",MAe="The strength must equal 1, 2, or 3",wAe="Encryption is not supported in USDZ files",kAe="Encryption is not supported when the 'passThrough' option is set",UAe="Invalid extra field (must be a Map)",DAe="Invalid extra field type (must be integer 0..65535)",OAe="Invalid extra field data (must be a Uint8Array)",oH="Extra field data exceeds 64KB",v_t="Compression method not supported",BAe=-2147483648,zAe=2147483647,RAe=BigInt(0),CAe=BigInt("0x7fffffffffffffff"),rH="Zip64 is not supported (set the 'zip64' option to 'true')",HAe="Undefined uncompressed size",KAe="Undefined compression method";var JAe="Undefined reader",jAe="Zip file not empty",QAe="Invalid uid (must be integer 0..2^32-1)",qAe="Invalid gid (must be integer 0..2^32-1)",$Ae="Invalid UNIX mode (must be integer 0..65535)",eGe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",tGe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",nGe="Invalid msdosAttributesRaw (must be integer 0..255)",iGe="Invalid msdosAttributes (must be an object with boolean flags)",oGe="Invalid level (must be integer 0..9)",rGe="Signature data exceeds 64KB",VAe=new Uint8Array([7,0,2,0,65,69,3,0,0]),F_t=4,I_t=9,P_t=67,X_t=1,Hne="infozip",Kne="unix",N_t=9,kne=0,EAe=[],WM=class{constructor(t,n={}){t=new VE(t);let{availableSize:i=bZ,maxSize:o=bZ}=t,r=i>0&&i!==bZ&&o>0&&o!==bZ;Object.assign(this,{writer:t,addSplitZipSignature:r,options:n,fileEntries:new Map,filenames:new Set,offset:n[$Y]===ke?t.size||t.writable.size||0:n[$Y],initialOffset:n[$Y]===ke?0:n[$Y]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Une(this,Y_t(this,t))}appendZip(t){return Une(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 $d(await p0(t.readable)),await Xc(t));let{ZipReader:u}=await Promise.resolve().then(()=>(wne(),TAe)),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(qne);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 iSt(t)||(await T0(n.writer,aGe()),n.offset+=4));let y=await oSt(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=sGe(N||yo),_.extraFieldAES&&(I=99);let v=so(N),X=!!F&&F.uncompressedSize!==ke,Y=!!F&&F.compressedSize!==ke,D=mGe(g,V,G,E,I)&-7|g<<1,{headerArray:M,headerView:O}=uGe({version:S,bitFlag:D,compressionMethod:I,uncompressedSize:A,compressedSize:L,rawLastModDate:Z,rawFilename:R,zip64CompressedSize:Y,zip64UncompressedSize:X,extraFieldLength:v}),{crc32:w}=_;w!==ke&&Nc(O,10,w);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:M,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=M_t(o,t,n,i);r.add(s);let a=()=>r.delete(s);return Promise.prototype.then.call(s,a,a),Une(o,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==gZ&&(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(IAe);if(so(t)>65535)throw new Error($ne);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 q_t(i,t,n),!Ez(r)&&Qi(i,n,z3)||await s.getWriter().close(),r.getData?r.getData():s}};var Jne=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Une(e,t){let n=new Jne((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 Y_t(e,t){if(e.filenames.size)throw new Error(jAe);await e.appendZipEntries(t)}async function M_t(e,t,n,i){if(i=Object.assign({},i),Qi(e,i,CZ)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(qne);e.filenames.add(t),kne<Ng().maxWorkers?kne++:await new Promise(o=>EAe.push(o));try{return await w_t(e,t,n,i)}catch(o){throw e.filenames.delete(t),o}finally{let o=EAe.shift();o?o():kne--}}async function w_t(e,t,n,i){let o=k_t(e,t,i);({name:t}=o);let r=U_t(e,t,i),{comment:s}=r,a=i[Fz];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 AEe(Ng())&&(p.level=0);let b=await D_t(e,n,r,i);({reader:n}=b);let f=vM(e.writer),y=Dg(e.writer);i=Object.assign({},i,o.resolvedOptions,r.resolvedOptions,b.resolvedOptions,{signature:i[vz],crc32:i.crc32===ke?i[vz]:i.crc32,offset:e.offset-f,diskNumberStart:y,[aE]:e.options[aE]});let _=H_t(i),S=J_t(i),Z=so(_.localHeaderArray,S.dataDescriptorArray);m=await B_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,[Gz]:m.internalFileAttributes,[Lz]:m.externalFileAttributes}),new sT(m)}function k_t(e,t,n){let i=Qi(e,n,Xte),o=Qi(e,n,Mte,i?20:768),r=Qi(e,n,kte),s=NE(e,n,"uid"),a=NE(e,n,"gid"),c=NE(e,n,Dte),d=Qi(e,n,VVe),u=Qi(e,n,Ote),m=Qi(e,n,Bte),p=Qi(e,n,zte);if(lE(s,4294967295,QAe),lE(a,4294967295,qAe),lE(c,65535,$Ae),d!==ke&&d!==Hne&&d!==Kne)throw new Error(eGe);if(d===Kne&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(tGe);d===ke&&(s!==ke||a!==ke)&&(d=Hne);let b=NE(e,n,Ite),f=Qi(e,n,Pte),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),lE(b,255,nGe),f&&(typeof f!==$Ce||Array.isArray(f)))throw new Error(iGe);if(o>65535)throw new Error(eie);let S=dGe(e,n,Fte,Lz),Z=S!==ke;Z||(S=0),!n[CZ]&&t.endsWith("/")&&(n[CZ]=!0);let R=Qi(e,n,CZ);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}=K_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 U_t(e,t,n){let i=jne(e,n,CVe)||uE,o=i(t,H3);if(o===ke&&(o=uE(t)),so(o)>65535)throw new Error(YAe);let r=n[TM]||"";if(typeof r!=gZ)throw new Error(XAe);let s=i(r,K3);if(s===ke&&(s=uE(r)),so(s)>65535)throw new Error(PAe);let a=Qi(e,n,Yte);if(a!==ke&&a>65535)throw new Error(eie);let c=zne(e,n,EE,new Date),d=Qi(e,n,AE),u=zne(e,n,SM),m=zne(e,n,ZM),p=dGe(e,n,vte,Gz,0),b=Qi(e,n,k3),f=Qi(e,n,M3),y=Qi(e,n,w3);Q3(f,y);let _=NE(e,n,pVe,3),S=Qi(e,n,wte),Z=Qi(e,n,bVe,!0),R=Qi(e,n,gVe),C=Qi(e,n,yVe,!0),E=Qi(e,n,D3),A=Qi(e,n,B3),L=Qi(e,n,TVe),F=jne(e,n,_Ve),I=Qi(e,n,SVe,!0),N=j3(Qi(e,n,U3)),g=Qi(e,n,ZVe,!0),V=Qi(e,n,Ute),G=b||V===ke?ke:az(V);if(!b&&V!==ke&&V!==0&&V!==8&&!G)throw new Error(v_t);let v=NE(e,n,xVe);if(lE(v,N_t,oGe),e.options[aE]){if(f!==ke||y!==ke)throw new Error(wAe);v===ke&&V===ke&&(v=0)}b&&(v=ke);let X=Qi(e,n,O3),Y=Qi(e,n,Hee);L&&Y===ke&&(Y=!1),(Y===ke||S&&!b)&&(Y=!0),v!==ke&&v!=6&&(X=!1);let D=Qi(e,n,Wz);if(!S&&(f!==ke||y!==ke)&&!(Number.isInteger(_)&&_>=1&&_<=3))throw new Error(MAe);let M=Dne(n[Fz]),O=Dne(n[EVe]),w=Dne(n[AVe]);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:M,rawLocalExtraField:O,rawCentralExtraField:w}}}function Dne(e){if(!e)return yo;if(!(e instanceof Map))throw new Error(UAe);let t=0,n=0;e.forEach((r,s)=>{if(jee(s,65535,DAe),!(r instanceof Uint8Array))throw new Error(OAe);if(so(r)>65535)throw new Error(oH);t+=4+so(r)});let i=new Uint8Array(t),o=fi(i);return e.forEach((r,s)=>{x0(o,n,s),x0(o,n+2,so(r)),PM(i,r,n+4),n+=4+so(r)}),i}async function D_t(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Qi(e,i,CZ))throw new Error(JAe);let o;return t&&(t=new wg(t),await Xc(t),{size:o}=t),Object.assign({reader:t},O_t(e,!!t,o,n,i))}function O_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[_M],y===ke)throw new Error(HAe);if(b===ke)throw new Error(KAe)}let _=m===!0,S=Qi(e,o,Nte);if(t&&r&&!S&&so(a,c))throw new Error(kAe);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?FAe(y)+R:n):n===ke?(u=!0,(m||m===ke)&&(m=!0,y=f=4294967296)):(o.uncompressedSize=y=n,f=(Qne(b,p)?FAe(y):y)+R));let C=!Z&&(!t||n===0&&!r)&&!Qne(b,p);C&&!s&&Qi(e,o,Hee)===ke&&(u=!1);let E=_||y>=4294967295,A=_||f>=4294967295;if(E||A){if(m===!1)throw new Error(rH);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 B_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[aE],_=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:bZ}),L.size=0,await Xc(s)):(L=s,await F,await I()),await Xc(L);let g=vM(s);e.addSplitZipSignature&&!S&&await LAe(e,s),y&&!S&&AAe(i,e.offset-g);let{localHeaderArray:V}=m;S||await N();let G=Dg(s),v=FM(e,s);if(_.diskNumberStart=G,S||(C=!0,E=s.size,await T0(L,V)),_=await z_t(n,L,_,i,Ng(),o),S||(C=!1),r.set(t,_),_.filename=t,S){if(await Promise.all([L.writable.getWriter().close(),F]),await I(),e.addSplitZipSignature&&await LAe(e,s),R=!0,E=s.size,await N(),_.diskNumberStart=Dg(s),_.offset=FM(e,s),y){let X=i.metadataSize;AAe(i,e.offset-vM(s)),_.size+=i.metadataSize-X}Q_t(_,m.localHeaderView,o),await T0(s,m.localHeaderArray),await cGe(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(){YE(s,so(m.localHeaderArray))&&await s.closeDisk()}}async function z_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:M,zipCrypto:O,dataDescriptor:w,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:Mi,codecURI:jn}=s,Si={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,pi=0;pt||(Gi=0);let{writable:Zi}=t;if(e){let On=kf(Zte(e)),rn=e.size,Hn={options:{codecType:TE,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:Mi,codecURI:jn,compressionMethod:S},config:r,streamOptions:{signal:Ge,size:rn,onstart:he,onprogress:Ze,onend:ye}};try{let $i=await Sz({readable:On,writable:Zi},Hn);if(pi=$i.outputSize,t.size+=pi,pt||(Gi=$i.inputSize,(!f||O)&&(Hi=$i.crc32)),!M&&pi>=4294967295||!D&&Gi>=4294967295)throw new Error(rH)}catch($i){throw $i.outputSize!==ke&&(t.size+=$i.outputSize),$i}}return j_t({crc32:Hi,compressedSize:pi,uncompressedSize:Gi,headerInfo:a,dataDescriptorInfo:c},s),w&&await T0(t,I),Object.assign(Si,{uncompressedSize:Gi,compressedSize:pi,lastModDate:p,rawLastModDate:b,creationDate:V,lastAccessDate:g,encrypted:!!f,zipCrypto:!!O,size:d+pi,compressionMethod:S,version:_,headerArray:u,headerView:m,signature:Hi,crc32:f&&!O&&!pt?ke:Hi,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:D,zip64CompressedSize:M}),Si}function H_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&&Qne(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=qu(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=qu(so(VAe)+2);Ze.writeUint16(39169),Ze.writeBytes(VAe),v=Ze.array,v[8]=f}else v=yo;let X,Y,D;if(y){let Ze=tH(n),ye=lGe(Ze);if(ye){let Ae=9+(o?4:0)+(r?4:0),Fe=qu(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(WAe(tH(o))),r&&Fe.writeUint32(WAe(tH(r))),Y=Fe.array}else Y=yo;if(_===ke?!ye||!!(o||r):_)try{let Ae=Bne(n),Fe=qu(36);Fe.writeUint16(10),Fe.writeUint16(32),Fe.skip(4),Fe.writeUint16(1),Fe.writeUint16(24),Fe.writeUint64(Ae),Fe.writeUint64(o?Bne(o):Ae),Fe.writeUint64(r?Bne(r):Ae),X=Fe.array}catch{X=yo}else X=yo}else X=Y=yo;let M;try{let{uid:Ze,gid:ye,unixExtraFieldType:Ge}=e;if(Ge==Hne&&(Ze!==ke||ye!==ke)){let Ae=GAe(Ze===ke?0:Ze),Fe=GAe(ye===ke?0:ye),tt=3+Ae.length+Fe.length,Be=qu(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),M=Be.array}else if(Ge==Kne&&(Ze!==ke||ye!==ke)){let Ae=qu(8);Ae.writeUint16(30805),Ae.writeUint16(4),Ae.writeUint16((Ze===ke?0:Ze)&65535),Ae.writeUint16((ye===ke?0:ye)&65535),M=Ae.array}else M=yo}catch{M=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[F_t]=X_t),x0(fi(v),I_t,F),F=99);let w=G?so(N):0,z=w+so(v,Y,X,M,p,b),K=e[aE]?P_t:0;if(z+K>65535)throw new Error(oH);let te=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:H,headerView:$,rawLastModDate:ee}=uGe({version:L,bitFlag:mGe(s,d,u,Z,F),compressionMethod:F,uncompressedSize:E,lastModDate:te<sE?sE:te>zee?zee:te,rawLastModDate:i,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:R,extraFieldLength:z}),le=qu(30+so(t)+z),_e=le.array,he=fi(_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(M),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:w,rawExtraFieldExtendedTimestamp:Y,rawExtraFieldNTFS:X,rawExtraFieldUnix:M,rawExtraFieldAES:v,extraFieldLength:z}}function AAe(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=fi(s);x0(a,0,6534),x0(a,2,r-4);let c=i;n.localHeaderArray=i=new Uint8Array(so(c)+r),PM(i,c),PM(i,s,so(c));let d=fi(i);x0(d,28,o+r),n.localHeaderView=d,e.metadataSize+=r}function GAe(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 K_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 J_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=fi(i),n&&(r=4,Nc(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function j_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&&(IM(m,p+4,BigInt(t)),IM(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 Q_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;IM(d,p,BigInt(s)),IM(d,p+8,BigInt(r))}}async function q_t(e,t,n){let i=$_t(e.fileEntries),{directoryStart:o,directoryEnd:r,directoryArray:s}=await eSt(e,i,n),a=await tSt(e,s,n);await nSt(e,t,n,{directoryStart:o,directoryEnd:r,directoryDataLength:i,signatureLength:a})}function $_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=qu(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=tH(p);if(u&&lGe(E)){let L=qu(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(oH);t+=46+so(i,r)+A}return t}async function eSt(e,t,n){let{fileEntries:i,writer:o}=e,r=new Uint8Array(t);await Xc(o);let s=0,a=0,c=Dg(o),d=vM(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:M}=p,O=so(y,_,S,Z,R,C,E),w=46+so(f,A)+O;YE(o,s+w-a)&&(await T0(o,r.slice(a,s)),a=s,u=0,await o.closeDisk()),m==0&&(c=Dg(o),d=vM(o)),N||Nc(I,18,D),g||Nc(I,14,M),(G||V)&&p.version<45&&x0(I,0,45);let z=qu(w);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),PM(r,z.array,s),s+=w,u++,n.onprogress)try{await n.onprogress(m+1,i.size,new sT(p))}catch{}}return await T0(o,a?r.slice(a):r),{directoryStart:{diskNumber:c,diskOffset:d},directoryEnd:{diskNumber:Dg(o),entriesLength:u},directoryArray:r}}async function tSt(e,t,n){let i=jne(e,n,FVe);if(i){let o=await i(t),r=so(o);if(r>65535)throw new Error(rGe);let s=qu(6+r);s.writeUint32(84233040),s.writeUint16(r),s.writeBytes(o);let{writer:a}=e;return YE(a,so(s.array))&&await a.closeDisk(),await T0(a,s.array),6+r}return 0}async function nSt(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=FM(e,r),p=so(t);if(p>65535)throw new Error($ne);let b=Qi(e,n,Wz),f=Dg(o);if(YE(o,(b?98:22)+p)&&f++,m>=4294967295||c>=4294967295||d>=65535||f>=65535){if(b===!1)throw new Error(rH);b=!0}let y=qu(b?98:22);YE(o,so(y.array)+p)&&await o.closeDisk(),f=Dg(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(FM(e,o))+BigInt(c)+BigInt(a)),y.writeUint32(f+1),Qi(e,n,RVe,!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 qu(e){let t=new Uint8Array(e),n=fi(t),i=0;return{array:t,writeUint8:o=>{aSt(n,i,o),i+=1},writeUint16:o=>{x0(n,i,o),i+=2},writeUint32:o=>{Nc(n,i,o),i+=4},writeUint64:o=>{IM(n,i,BigInt(o)),i+=8},writeBytes:o=>{PM(t,o,i),i+=so(o)},skip:o=>i+=o}}function Dg(e){let{diskNumber:t=0}=e;return t}function vM(e){let{diskOffset:t=0}=e;return t}function YE(e,t){let{availableSize:n=bZ}=e;return t>n}function FM(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function iSt(e){let t=await Mr(e,0,4);return sSt(fi(t),0)==134695760}function sGe(e){let t=fi(e),n=0;for(;n+4<=so(e);){let i=4+iH(t,n+2);if(iH(t,n)==1)return sGe(uh(e.subarray(0,n),e.subarray(Math.min(n+i,so(e)))));n+=i}return e}async function oSt(e,t,n,i){let{writer:o}=e,r=new Map;if(o.closeDisk){let s=Array.from(n).sort((c,d)=>eH(t,c)-eH(t,d)),a=0;for(let c of s){let d=eH(t,c);await One(e,t,a,d-a),YE(o,await rSt(t,d))&&await o.closeDisk(),r.set(c,{offset:FM(e,o),diskNumberStart:Dg(o)}),a=d}await One(e,t,a,i-a)}else{let s=e.offset;await One(e,t,0,i),n.forEach(a=>r.set(a,{offset:s+eH(t,a),diskNumberStart:0}))}return r}async function One(e,t,n,i){if(i>0){let{writer:o}=e,r=0;try{await cGe(Zte(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 rSt(e,t){let n=await Mr(e,t,30);if(so(n)<30)return 30;let i=fi(n);return 30+iH(i,26)+iH(i,28)}function eH(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function aGe(){let e=new Uint8Array(4);return Nc(fi(e),0,134695760),e}async function LAe(e,t){delete e.addSplitZipSignature,await T0(t,aGe()),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 cGe(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 Bne(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<RAe?RAe:t>CAe?CAe:t}}function tH(e){return Math.floor(e.getTime()/1e3)}function lGe(e){return e>=BAe&&e<=zAe}function WAe(e){return Math.min(zAe,Math.max(BAe,e))}function Qi(e,t,n,i){let o=t[n]===ke?e.options[n]:t[n];return o===ke?i:o}function zne(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(NAe);return o}function jne(e,t,n){return cE(Qi(e,t,n))}function dGe(e,t,n,i,o){let r=vAe(t,n,i),s=r===ke?vAe(e.options,n,i):r;return s===ke?o:s}function vAe(e,t,n){return e[t]===ke?e[n]:e[t]}function NE(e,t,n,i){return yZ(Qi(e,t,n,i))}function FAe(e){return e+5*(Math.floor(e/16383)+1)}function Qne(e,t){return e===ke?t===ke||t>0:e!==0}function iH(e,t){return e.getUint16(t,!0)}function sSt(e,t){return e.getUint32(t,!0)}function aSt(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 IM(e,t,n){e.setBigUint64(t,n,!0)}function PM(e,t,n){e.set(t,n)}function so(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function uGe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:d,extraFieldLength:u}){let m=qu(26),p=m.array,b=fi(p);if(m.writeUint16(e),m.writeUint16(t),m.writeUint16(n),s===ke){let f=new Uint32Array(1),y=fi(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 mGe(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}Az();eM();var AHi=x(T(),1);m0();_Z();var IHi=x(T(),1);bc();m0();_Z();cte();var XHi=x(T(),1);var MHi=x(T(),1);var NHi=1024*1024;var DHi=x(T(),1);pE();var kHi=1024*1024;var HHi=x(T(),1);var OHi=1024*1024;var BHi=512*1024;var lSt={};try{dE({baseURI:lSt.url})}catch{}var JKi=x(T(),1);m0();var GKi=x(T(),1),dSt=[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],uSt=[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],mSt=[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],hSt=[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],fSt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],NM=new Uint8Array(288);NM.fill(8,0,144),NM.fill(9,144,256),NM.fill(7,256,280),NM.fill(8,280,288);var pSt=new Uint8Array(30).fill(5);function XM(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 $u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function hGe(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+=$u[a>>18&63]+$u[a>>12&63]+$u[a>>6&63]+$u[63&a]}let s=o-r;if(s===1){let a=n[r]<<16;i+=$u[a>>18&63]+$u[a>>12&63]+"=="}else if(s===2){let a=n[r]<<16|n[r+1]<<8;i+=$u[a>>18&63]+$u[a>>12&63]+$u[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(XM(NM),XM(pSt));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=dSt[R]+u(uSt[R]),E=f(S),A=mSt[E]+u(hSt[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[fSt[L]]=u(3);let C=XM(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[XM(E.subarray(0,_)),XM(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=$u.indexOf(n[r])<<18|$u.indexOf(n[r+1])<<12|(63&$u.indexOf(n[r+2]))<<6|63&$u.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+6p9rF6PqxrQtnNre3VT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6p/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 BKi=x(T(),1);bc();m0();pM();Zz();var PKi=x(T(),1);var WKi=x(T(),1),cH="deflate",sH="deflate-raw",fGe="deflate64-raw",aH="gzip",Ls,ME,Og,YM,pGe;function bGe(e){if(Ls=e,{malloc:ME,free:Og,memory:YM}=Ls,typeof ME!="function"||typeof Og!="function"||!YM)throw Ls=ME=Og=YM=null,new Error("Invalid WASM module")}function gGe(e){pGe=e}function yGe(e,t,n={}){if(!Ls){let a=new Error("WASM module not loaded");throw a.cause=pGe,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=ME(o),this.in=ME(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===aH?a=Ls.deflate_init_gzip(this.streamHandle,i):t===sH?a=Ls.deflate_init_raw(this.streamHandle,i):a=Ls.deflate_init(this.streamHandle,i)):t===fGe?(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===sH?a=Ls.inflate_init_raw(this.streamHandle):t===aH?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(YM.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&&Og&&(Og(this.in),this.in=0),this.in=ME(_),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(YM.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&&Og&&Og(a.in),a.in=0,a.out&&Og&&Og(a.out),a.out=0,c}}var vZ=class{constructor(t=cH,n){return yGe(!0,t,n)}},FZ=class{constructor(t=cH,n){return yGe(!1,t,n)}};vZ.requiresModule=!0;FZ.requiresModule=!0;vZ.supportedFormats=[cH,sH,aH];FZ.supportedFormats=[cH,sH,aH,fGe];var xGe=!1;async function TGe(e,{baseURI:t}){if(!xGe)try{await bSt(e,t),xGe=!0}catch(n){throw gGe(n),n}}async function bSt(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=gSt(e);else throw r}let o=await WebAssembly.instantiate(n);bGe(o.instance.exports)}function gSt(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 lH;VEe({initModule:e=>{if(!lH){let{wasmURI:t}=e;typeof t==Yr&&(t=t()),lH=TGe(t,e).catch(n=>{throw lH=null,n})}return lH}});dE({CompressionStreamFallback:vZ,DecompressionStreamFallback:FZ});hGe(dE);var tie=32,ySt="http://www.opengis.net/kml/2.2",Of="http://www.google.com/kml/ext/2.2",xSt="http://www.w3.org/2000/xmlns/";function dH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var TSt=/^data:image\/([^,;]+)/;dH.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(TSt);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 _St(e,t){return function(n){e._files[t]=n}}dH.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(_St(this,r))}return o};Object.defineProperties(dH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function uH(e){this._time=e}uH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};uH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return PZ(n)};uH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function nie(){this._ids={},this._styles={},this._count=0}nie.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};nie.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 ZGe(){this._ids={}}ZGe.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 iie(e){e=e??B.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=iie._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(xSt,"xmlns:gx",Of);let a=r.createElement("Document");s.appendChild(a),CGe(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?SSt(u,c.files):{kml:u,externalFiles:c.files}})}async function SSt(e,t){let n=en("ThirdParty/Workers/zip-web-worker.js"),i=en("ThirdParty/zip-module.wasm");nM({workerURI:n,wasmURI:i});let o=new CE("application/vnd.google-earth.kmz"),r=new WM(o);await r.add("doc.kml",new yM(e));let s=Object.keys(t);return await RGe(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function RGe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new $d(n[o])),RGe(e,t,n,i+1)}iie._createState=function(e){let t=e.entities,n=new nie,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 dH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(ySt,"kml"),ellipsoid:e.ellipsoid??ne.default,idManager:new ZGe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new uH(o),sampleDuration:s,defaultAvailability:new Vs([r])}};function CGe(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=[],ZSt(e,p,d,u),RSt(e,p.polyline,d,u),SGe(e,p.rectangle,d,u,c),SGe(e,p.polygon,d,u,c),ASt(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),CGe(e,S,_)}}}var tu=new h,hd=new pe,Df=new Q;function ZSt(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){VGe(e,t,a,n,i);return}s.get(c,void 0,tu);let d=En(o,"coordinates",IZ(tu,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(XZ(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof Oc?AGe(e,a):EGe(e,a);i.push(p)}function VGe(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 yb,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(XZ(e,He.CLAMP_TO_GROUND))):l(n)?R.appendChild(XZ(e,n.heightReference)):R.appendChild(XZ(e,He.NONE));let C=[],E=[];if(Z.isConstant){a.get(Z,void 0,tu);let L=En(r,"coordinates",IZ(tu,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,tu),E.push(IZ(tu,s));else if(Z instanceof zu){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,tu),E.push(IZ(tu,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,tu),C.push(Q.toIso8601(Df)),E.push(IZ(tu,s)),Q.addSeconds(Df,L,Df);S.isStopIncluded&&Q.equals(Df,F)&&(Z.getValue(Df,tu),C.push(Q.toIso8601(Df)),E.push(IZ(tu,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(GGe(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?AGe(e,n):EGe(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)),oie(e,Z,R),o.push(R)}}}function EGe(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/tie)),o}function AGe(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,tie),b=i.get(t.height,tie),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 RSt(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",IZ(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",_)),oie(e,t.material,y),i.push(y)}function CSt(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,hd),c.push(`${W.toDegrees(hd.longitude)},${W.toDegrees(hd.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 _Ge(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,hd),s.push(`${W.toDegrees(hd.longitude)},${W.toDegrees(hd.latitude)},${i?hd.height:n}`);let c=En(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function VSt(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(_Ge(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(_Ge(e,p[f].positions,r,s)),a.push(y)}}return a}function SGe(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"){ESt(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?CSt(e,t,d):VSt(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(XZ(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)),oie(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 ESt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(XZ(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",PZ(m.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(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 ASt(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){VGe(e,t,n,i,o);return}let d=GGe(e,n),u=r.createElement("altitudeMode");u.appendChild(XZ(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,tu),pe.fromCartesian(tu,s,hd);let m=r.createElement("Location");m.appendChild(En(r,"longitude",W.toDegrees(hd.longitude))),m.appendChild(En(r,"latitude",W.toDegrees(hd.latitude))),m.appendChild(En(r,"altitude",hd.height)),d.appendChild(m),i.push(d)}function oie(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=PZ(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=PZ(r.color);break;case"PolylineOutline":s=PZ(r.color),c=PZ(r.outlineColor),d=r.outlineWidth,n.appendChild(En(i,"outerColor",c,Of)),n.appendChild(En(i,"outerWidth",d,Of));break;case"Stripe":s=PZ(r.oddColor);break}l(s)&&(n.appendChild(En(i,"color",s)),n.appendChild(En(i,"colorMode","normal")))}function XZ(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 IZ(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,hd),i.push(`${W.toDegrees(hd.longitude)},${W.toDegrees(hd.latitude)},${hd.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 PZ(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 rie=iie;var l4i=x(T(),1);var YJi=x(T(),1);function wM(){this._cache={}}wM.prototype.fromColor=function(e,t){return mH(void 0,void 0,e,t,this._cache)};wM.prototype.fromUrl=function(e,t,n){return mH(e,void 0,t,n,this._cache)};wM.prototype.fromMakiIconId=function(e,t,n){return mH(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};wM.prototype.fromText=function(e,t,n){return mH(void 0,e,t,n,this._cache)};var GSt=new U;function LSt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,GSt).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 LGe(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 MM=new Array(4);function mH(e,t,n,i,o){MM[0]=e,MM[1]=t,MM[2]=n,MM[3]=i;let r=JSON.stringify(MM),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(LSt(c,n,i),l(e)){let u=ve.createIfNeeded(e).fetchImage().then(function(m){return LGe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=CS(t,{font:`bold ${i}px sans-serif`});LGe(c,d,i)}return o[r]=a,a}var Bg=wM;var Aji=x(T());var zJi=x(T());var DJi=x(T());var wJi=x(T());function sie(e){return e}function hH(e){if(e==null)return sie;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 qJi=x(T());var KJi=x(T());function WGe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function aie(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return vGe(e,n)})}:vGe(e,t)}function vGe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=cie(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 cie(e,t){var n=hH(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&&WGe(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 oji=x(T());var eji=x(T());var cji=x(T());var fji=x(T());var dji=x(T());var _ji=x(T());var gji=x(T());function fH(e){return h.fromDegrees(e[0],e[1],e[2])}var lie={"urn:ogc:def:crs:OGC:1.3:CRS84":fH,"EPSG:4326":fH,"urn:ogc:def:crs:EPSG::4326":fH},FGe={},IGe={},die=48,uie,mie=U.ROYALBLUE,hie=U.YELLOW,fie=2,pie=U.fromBytes(255,255,0,100),bie=!1,PSt={small:24,medium:48,large:64},XSt=["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||XSt.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 NSt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function YSt(e,t){return new Jh(NSt(PGe,e,t),!0)}function pH(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 ui(c):n(r,s))}return o}function gie(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var XGe={Feature:YGe,FeatureCollection:MSt,GeometryCollection:MGe,LineString:OGe,MultiLineString:BGe,MultiPoint:UGe,MultiPolygon:KGe,Point:kGe,Polygon:HGe,Topology:JGe},NGe={GeometryCollection:MGe,LineString:OGe,MultiLineString:BGe,MultiPoint:UGe,MultiPolygon:KGe,Point:kGe,Polygon:HGe,Topology:JGe};function YGe(e,t,n,i,o){if(t.geometry===null){pH(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=NGe[r];if(!l(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function MSt(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 MGe(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=NGe[d];if(!l(u))throw new ae(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function wGe(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=PSt[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 ui(Bn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=He.CLAMP_TO_GROUND);let m=pH(t,e._entityCollection,o.describe);m.billboard=u,m.position=new kl(n(i));let p=Promise.resolve(d).then(function(b){u.image=new ui(b)}).catch(function(){u.image=new ui(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function kGe(e,t,n,i,o){wGe(e,t,i,n.coordinates,o)}function UGe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)wGe(e,t,i,r[s],o)}function DGe(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 ui(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=pH(t,e._entityCollection,o.describe),d=new qc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new ui(gie(i,n)),d.arcType=un.RHUMB}function OGe(e,t,n,i,o){DGe(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++)DGe(e,t,i,r[s],o)}function zGe(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 ui(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 ui(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 ui(!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(gie(i[b],n)));let m=i[0];d.hierarchy=new ui(new Gc(gie(m,n),u)),m[0].length>2?d.perPositionHeight=new ui(!0):o.clampToGround||(d.height=0);let p=pH(t,e._entityCollection,o.describe);p.polygon=d}function HGe(e,t,n,i,o){zGe(e,t,i,n.coordinates,o)}function KGe(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 JGe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=aie(n,n.objects[r]),a=XGe[s.type];a(e,s,s,i,o)}}function lT(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 Bg,this._entityCluster=new Ou,this._credit=void 0,this._resourceCredits=[]}lT.load=function(e,t){return new lT().load(e,t)};Object.defineProperties(lT,{markerSize:{get:function(){return die},set:function(e){die=e}},markerSymbol:{get:function(){return uie},set:function(e){uie=e}},markerColor:{get:function(){return mie},set:function(e){mie=e}},stroke:{get:function(){return hie},set:function(e){hie=e}},strokeWidth:{get:function(){return fie},set:function(e){fie=e}},fill:{get:function(){return pie},set:function(e){pie=e}},clampToGround:{get:function(){return bie},set:function(e){bie=e}},crsNames:{get:function(){return lie}},crsLinkHrefs:{get:function(){return FGe}},crsLinkTypes:{get:function(){return IGe}}});Object.defineProperties(lT.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}}});lT.prototype.load=function(e,t){return jGe(this,e,t,!0)};lT.prototype.process=function(e,t){return jGe(this,e,t,!1)};function jGe(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??YSt,markerSize:n.markerSize??die,markerSymbol:n.markerSymbol??uie,markerColor:n.markerColor??mie,strokeWidthProperty:new ui(n.strokeWidth??fie),strokeMaterialProperty:new Qt(n.stroke??hie),fillMaterialProperty:new Qt(n.fill??pie),clampToGround:n.clampToGround??bie},Promise.resolve(r).then(function(a){return wSt(e,a,n,s,i)}).catch(function(a){throw Es.setLoading(e,!1),e._error.raiseEvent(e,a),a})}lT.prototype.update=function(e){return!0};function wSt(e,t,n,i,o){let r;l(i)&&(r=Zg(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=XGe[t.type];if(!l(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?fH: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=lie[d.name],!l(c))throw new ae(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=FGe[d.href];if(l(u)||(u=IGe[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=lie[`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 dT=lT;var u4i=x(T(),1);function kSt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Nn=kSt;var n6i=x(T(),1);var b8i=x(T());var e8i=x(T());var h4i=x(T(),1),yie=function(e,t){return yie=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])},yie(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");yie(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 QGe(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 qGe(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 p4i=x(T()),$Ge="4.1.5";var g4i=x(T()),eLe=Object.prototype.hasOwnProperty;function em(e){return typeof e=="boolean"}function tLe(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 uT(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 F4i=x(T());var T4i=x(T());var bH=/\s+/,gH=(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(bH):[],o=t.split(bH),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(bH):[],o=t.split(bH),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)eLe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();var S4i=x(T());function iLe(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=USt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=nLe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=nLe(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):xie(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+xie(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+xie(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 USt(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 nLe(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 xie(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 R4i=x(T());function oLe(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 rLe(e,t,n){return tLe(e,t,n)}var sLe=(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 gH({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"?iLe(t,i):o==="middle"?oLe(t,i):rLe(t,i)},e})();var YQi=x(T());var K4i=x(T());var P4i=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 D4i=x(T());var N4i=x(T());function aLe(e){return e>=0&&e<=31||e==127}function zg(e){return e>=65&&e<=90||e>=97&&e<=122}function sa(e){return e>=48&&e<=57}function yH(e){return e==34||e==39}function mT(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 cLe(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 lLe(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 xH(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function dLe(e){return e<91?e==40:e==91||e==123}function Tie(e){return e<93?e==41:e==93||e==125}var M4i=x(T()),uLe=/^(?: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 _ie=/https?:\/\//i,mLe=new RegExp("^"+_ie.source,"i"),DSt=/^(javascript|vbscript):/i,OSt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,BSt=/^(?:\/\/)?([^/#?:]+)/,wE=zg;function Sie(e){return zg(e)||sa(e)||e===43||e===45||e===46}var Hg=zf;function TH(e){return e===95||Hg(e)}function Zie(e){return zf(e)||lLe(e)||xH(e)}function _H(e){return e===47||e===63||e===35}function Rie(e){return uLe.test(e.toLowerCase())}function hLe(e){if(DSt.test(e))return!1;var t=e.match(OSt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function fLe(e){var t=e.match(BSt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!Rie(o)}var zSt=/^(?:(?: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]?)$/,HSt=/[:/?#]/;function pLe(e){var t=e.split(HSt,1)[0];return zSt.test(t)}var KSt=/^(https?:\/\/)?(?:www\.)?/i,JSt=/^\/\//,bLe=(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=qSt(n)),this.stripPrefix.scheme&&(n=jSt(n)),this.stripPrefix.www&&(n=QSt(n)),this.stripTrailingSlash&&(n=$St(n)),this.decodePercentEncoding&&(n=eZt(n)),n},t})(S0);function jSt(e){return e.replace(mLe,"")}function QSt(e){return e.includes("www.")?e.replace(KSt,"$1"):e}function qSt(e){return e.replace(JSt,"")}function $St(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function eZt(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 q4i=x(T());var gLe=/^mailto:/i,Cie=zf;function SH(e){return Cie(e)||cLe(e)}function yLe(e){var t=e.split(".").pop();return Rie(t)}var nQi=x(T());var xLe=(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 rQi=x(T());function Vie(e){return e===95||zf(e)}function TLe(e){return e.length<=140}var _Le=["twitter","facebook","instagram","tiktok","youtube"];var dQi=x(T());var SLe=(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 hQi=x(T());var tZt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Eie(e){return e===45||e===46||e===95||zg(e)||sa(e)}function ZLe(e,t){var n=tZt[t];return n.test(e)}var RLe=["twitter","instagram","soundcloud","tiktok","youtube"];var yQi=x(T());var CLe=(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 TQi=x(T()),nZt=/[-. ()]/,iZt=/(?:(?:(?:(\+)?\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]+#?)*/,oZt=/(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})/,rZt=new RegExp("^".concat(iZt.source,"|").concat(oZt.source,"$"));function Aie(e){return e===45||e===46||e===32}function ZH(e){return e===44||e===59}function VLe(e){var t=e.charAt(0)==="+"||nZt.test(e);return t&&rZt.test(e)}var RQi=x(T());var ELe=(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 sZt=(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),GLe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),GLe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function LLe(e,t){for(var n=new sZt(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)RH(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:mZt(n,s,o);break;case 12:hZt(n,s,o);break;case 0:aZt(n,s,o);break;case 1:cZt(n,s,o);break;case 2:lZt(n,s,o);break;case 3:dZt(n,s,o);break;case 4:uZt(n,s,i,o);break;case 5:fZt(n,s,o);break;case 6:pZt(n,s,i,o);break;case 7:bZt(n,s,i,o);break;case 13:gZt(n,s,o);break;case 14:yZt(n,s,o);break;case 8:xZt(n,s,o);break;case 9:TZt(n,s,o);break;case 10:_Zt(n,s,o);break;case 15:SZt(n,s,i,o);break;case 16:ZZt(n,s,i,o);break;case 17:RZt(n,s,i,o);break;case 18:CZt(n,s,i,o);break;case 19:VZt(n,s,i,o);break;case 20:EZt(n,s,o);break;case 21:AZt(n,s,o);break;case 22:NZ(n,s,o);break;case 23:GZt(n,s,o);break;case 24:LZt(n,s,o);break;case 25:WZt(n,s,o);break;case 26:vZt(n,s,o);break;case 27:FZt(n,s,o);break;case 28:IZt(n,s,o);break;case 29:PZt(n,s,o);break;case 30:XZt(n,s,o);break;case 31:NZt(n,s,o);break;case 32:MZt(n,s,i,o);break;case 33:wZt(n,s,o);break;case 34:kZt(n,s,o);break;case 35:UZt(n,s,o);break;case 36:DZt(n,s,i,o);break;case 37:YZt(n,s,i,o);break;case 38:OZt(n,s,i,o);break;case 39:BZt(n,s,i,o);break;case 40:zZt(n,s,o);break;case 41:HZt(n,s,o);break;default:Bf(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&wE(o)){var a=n.text.charCodeAt(n.charIdx-1);wE(a)||n.addMachine(CH(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 RH(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(qZt(i,28));else if(n===64)e.addMachine($Zt(i,30));else if(n===47)e.addMachine(Lie(i,11));else if(n===43)e.addMachine(Gie(i,37));else if(n===40)e.addMachine(Gie(i,32));else{if(sa(n)&&(e.addMachine(Gie(i,38)),e.addMachine(jZt(i,13))),Cie(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(QZt(i,o))}wE(n)&&e.addMachine(CH(i,0)),zf(n)&&e.addMachine(Lie(i,5))}}function aZt(e,t,n){n===58?t.state=2:n===45?t.state=1:Sie(n)||e.removeMachine(t)}function cZt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Lie(i,11))):Sie(n)?t.state=0:e.removeMachine(t))}function lZt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):Hg(n)?(t.state=5,wE(n)&&e.addMachine(CH(i,0))):e.removeMachine(t)}function dZt(e,t,n){n===47?t.state=4:Zie(n)?(t.state=10,t.acceptStateReached=!0):Ws(e,t)}function uZt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):Hg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function mZt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function hZt(e,t,n){Hg(n)?t.state=5:e.removeMachine(t)}function fZt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:_H(n)?t.state=10:TH(n)||Ws(e,t)}function pZt(e,t,n,i){i===45||(i===46?Ws(e,t):Hg(i)?t.state=5:Ws(e,t))}function bZt(e,t,n,i){i===46?Ws(e,t):Hg(i)?(t.state=5,t.acceptStateReached=!0):Ws(e,t)}function gZt(e,t,n){n===46?t.state=14:n===58?t.state=8:sa(n)||(_H(n)?t.state=10:zf(n)?e.removeMachine(t):Ws(e,t))}function yZt(e,t,n){sa(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Ws(e,t)}function xZt(e,t,n){sa(n)?t.state=9:Ws(e,t)}function TZt(e,t,n){sa(n)||(_H(n)?t.state=10:Ws(e,t))}function _Zt(e,t,n){Zie(n)||Ws(e,t)}function SZt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:NZ(e,t,i)}function ZZt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:NZ(e,t,i)}function RZt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:NZ(e,t,i)}function CZt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:NZ(e,t,i)}function VZt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:NZ(e,t,i)}function EZt(e,t,n){n===58?t.state=21:NZ(e,t,n)}function AZt(e,t,n){SH(n)?t.state=22:e.removeMachine(t)}function NZ(e,t,n){n===46?t.state=23:n===64?t.state=24:SH(n)?t.state=22:e.removeMachine(t)}function GZt(e,t,n){n===46||n===64?e.removeMachine(t):SH(n)?t.state=22:e.removeMachine(t)}function LZt(e,t,n){Hg(n)?t.state=25:e.removeMachine(t)}function WZt(e,t,n){n===46?t.state=27:n===45?t.state=26:TH(n)||Ws(e,t)}function vZt(e,t,n){n===45||n===46?Ws(e,t):TH(n)?t.state=25:Ws(e,t)}function FZt(e,t,n){n===46||n===45?Ws(e,t):Hg(n)?(t.state=25,t.acceptStateReached=!0):Ws(e,t)}function IZt(e,t,n){Vie(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function PZt(e,t,n){Vie(n)||Ws(e,t)}function XZt(e,t,n){Eie(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function NZt(e,t,n){Eie(n)||(zf(n)?e.removeMachine(t):Ws(e,t))}function YZt(e,t,n,i){sa(i)?t.state=38:(e.removeMachine(t),RH(e,n,i))}function MZt(e,t,n,i){sa(i)?t.state=33:e.removeMachine(t),RH(e,n,i)}function wZt(e,t,n){sa(n)?t.state=34:e.removeMachine(t)}function kZt(e,t,n){sa(n)?t.state=35:e.removeMachine(t)}function UZt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function DZt(e,t,n,i){sa(i)?t.state=38:Aie(i)?t.state=39:e.removeMachine(t)}function OZt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,ZH(i)?t.state=40:i===35?t.state=41:sa(i)||(i===40?t.state=32:Aie(i)?t.state=39:(Ws(e,t),wE(i)&&e.addMachine(CH(o,0))))}function BZt(e,t,n,i){sa(i)?t.state=38:i===40?t.state=32:(Ws(e,t),RH(e,n,i))}function zZt(e,t,n){ZH(n)||(n===35?t.state=41:sa(n)?t.state=38:Ws(e,t))}function HZt(e,t,n){ZH(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=JZt(p),t.type){case 0:{var b=i.charCodeAt(t.startIdx-1);if(b===64)return;switch(t.matchType){case 0:{var f=_ie.exec(p);if(f&&(m=m+f.index,p=p.slice(f.index)),!hLe(p))return;break}case 1:{if(!fLe(p))return;break}case 2:{if(!pLe(p))return;break}default:Bf(t)}n.push(new bLe({tagBuilder:r,matchedText:p,offset:m,urlMatchType:KZt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{yLe(p)&&n.push(new xLe({tagBuilder:r,matchedText:p,offset:m,email:p.replace(gLe,"")}));break}case 2:{TLe(p)&&n.push(new SLe({tagBuilder:r,matchedText:p,offset:m,serviceName:d,hashtag:p.slice(1)}));break}case 3:{ZLe(p,u)&&n.push(new CLe({tagBuilder:r,matchedText:p,offset:m,serviceName:u,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),VLe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new ELe({tagBuilder:r,matchedText:p,offset:m,number:y,plusSign:p.charAt(0)==="+"}))}break}default:Bf(t)}}}function KZt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:Bf(e)}}var ALe={")":"(","}":"{","]":"["};function JZt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);dLe(o)?t[i]++:Tie(o)&&t[ALe[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(Tie(o)){var s=ALe[i];if(t[s]<0)t[s]++,r--;else break}else if(xH(o))r--;else break}return e.slice(0,r+1)}function CH(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Lie(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function jZt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function QZt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function qZt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function $Zt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Gie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function GLe(e){return e.type===0&&e.matchType===0}var DQi=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})(),vie=new Z0,eRt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=vie,this.html=t,this.callbacks=n}return e})();function WLe(e,t){for(var n=new eRt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:tRt(n,o);break;case 1:nRt(n,o,r);break;case 2:oRt(n,o,r);break;case 3:iRt(n,o,r);break;case 4:rRt(n,o,r);break;case 5:sRt(n,o,r);break;case 6:aRt(n,o,r);break;case 7:cRt(n,o,r);break;case 8:lRt(n,o);break;case 9:dRt(n,o);break;case 10:uRt(n,o,r);break;case 11:mRt(n,o,r);break;case 12:hRt(n,o);break;case 13:fRt(n);break;case 14:pRt(n,o);break;case 15:bRt(n,o);break;case 16:gRt(n,o);break;case 17:yRt(n,o);break;case 18:xRt(n,o);break;case 19:TRt(n,o);break;case 20:_Rt(n,o);break;default:Bf(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&SRt(n)}function tRt(e,t){t==="<"&&R0(e)}function nRt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Z0(ra(ra({},e.currentTag),{isClosing:!0}))):t==="<"?R0(e):zg(n)?(e.state=3,e.currentTag=new Z0(ra(ra({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=vie)}function iRt(e,t,n){mT(n)?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Wie(e)})),e.state=4):t==="<"?R0(e):t==="/"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Wie(e)})),e.state=12):t===">"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Wie(e)})),C0(e)):!zg(n)&&!sa(n)&&t!==":"&&ph(e)}function oRt(e,t,n){t===">"?ph(e):zg(n)?e.state=3:ph(e)}function rRt(e,t,n){mT(n)||(t==="/"?e.state=12:t===">"?C0(e):t==="<"?R0(e):t==="="||yH(n)||aLe(n)?ph(e):e.state=5)}function sRt(e,t,n){mT(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?C0(e):t==="<"?R0(e):yH(n)&&ph(e)}function aRt(e,t,n){mT(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?C0(e):t==="<"?R0(e):yH(n)?ph(e):e.state=5)}function cRt(e,t,n){mT(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?ph(e):t==="<"?R0(e):e.state=10)}function lRt(e,t){t==='"'&&(e.state=11)}function dRt(e,t){t==="'"&&(e.state=11)}function uRt(e,t,n){mT(n)?e.state=4:t===">"?C0(e):t==="<"&&R0(e)}function mRt(e,t,n){mT(n)?e.state=4:t==="/"?e.state=12:t===">"?C0(e):t==="<"?R0(e):(e.state=4,ZRt(e))}function hRt(e,t){t===">"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{isClosing:!0})),C0(e)):ph(e)}function fRt(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 pRt(e,t){t==="-"?e.state=15:t===">"?ph(e):e.state=16}function bRt(e,t){t==="-"?e.state=18:t===">"?ph(e):e.state=16}function gRt(e,t){t==="-"&&(e.state=17)}function yRt(e,t){t==="-"?e.state=18:e.state=16}function xRt(e,t){t===">"?C0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function TRt(e,t){t==="-"?e.state=17:t===">"?C0(e):e.state=16}function _Rt(e,t){t===">"?C0(e):t==="<"&&R0(e)}function ph(e){e.state=0,e.currentTag=vie}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 SRt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Wie(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function ZRt(e){e.charIdx--}var RRt=(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=CRt(t.urls),this.email=em(t.email)?t.email:this.email,this.phone=em(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=em(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=VRt(t.stripPrefix),this.stripTrailingSlash=em(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=em(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&RLe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&_Le.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=ERt(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 WLe(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,qGe([],QGe(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(ARt);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||uT(t,function(n){return n.getType()==="hashtag"}),this.email||uT(t,function(n){return n.getType()==="email"}),this.phone||uT(t,function(n){return n.getType()==="phone"}),this.mention||uT(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||uT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||uT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||uT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=LLe(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 gH)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new sLe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=$Ge,e})(),vLe=RRt;function CRt(e){return e==null&&(e=!0),em(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:em(e.schemeMatches)?e.schemeMatches:!0,tldMatches:em(e.tldMatches)?e.tldMatches:!0,ipV4Matches:em(e.ipV4Matches)?e.ipV4Matches:!0}}function VRt(e){return e==null&&(e=!0),em(e)?{scheme:e,www:e}:{scheme:em(e.scheme)?e.scheme:!0,www:em(e.www)?e.www:!0}}function ERt(e){return typeof e=="number"?{length:e,location:"end"}:ra({length:Number.POSITIVE_INFINITY,location:"end"},e)}function ARt(e,t){return e.getOffset()-t.getOffset()}var i8i=x(T());var t8i=x(T());var m8i=x(T());var VH=vLe;var kLe;typeof DOMParser<"u"&&(kLe=new DOMParser);var GRt=new VH({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),EH=32,FLe=2414016,ILe=1,PLe=16093e3,XLe=.1,LRt=[null,void 0,"http://www.topografix.com/GPX/1/1"],nr={gpx:LRt};function WRt(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 Fie(e,t){let n=DM(e,"id");return n=l(n)?n:qn(),t.getOrCreateEntity(n)}function Iie(e){let t=NLe(e,"lon"),n=NLe(e,"lat"),i=kM(e,"ele",nr.gpx);return h.fromDegrees(t,n,i)}function NLe(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 DM(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function hT(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 Pie(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 kM(e,t,n){let i=hT(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function nu(e,t,n){let i=hT(e,t,n);if(l(i))return i.textContent.trim()}function ULe(e){let t=new Oc;return t.width=EH,t.height=EH,t.scaleByDistance=new Kt(FLe,ILe,PLe,XLe),t.pixelOffsetScaleByDistance=new Kt(FLe,ILe,PLe,XLe),t.verticalOrigin=new ui(Bn.BOTTOM),t.image=e,t}function vRt(){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 DLe(e){let t=new qc;return t.width=4,t.material=new Ox,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"}},UM;typeof document<"u"&&(UM=document.createElement("div"));function Xie(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=nu(e,m.tag,nr.gpx)??"",l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=GRt.link(i),UM.innerHTML=i;let s=UM.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+=`${UM.innerHTML}</div>`,UM.innerHTML="",d}function OLe(e,t,n,i){let o=Iie(t),r=Fie(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,EH);r.billboard=ULe(s);let a=nu(t,"name",nr.gpx);r.name=a,r.label=vRt(),r.label.text=a,r.description=Xie(t,r),i.clampToGround&&(r.billboard.heightReference=He.CLAMP_TO_GROUND,r.label.heightReference=He.CLAMP_TO_GROUND)}function FRt(e,t,n,i){let o=Fie(t,n);o.description=Xie(t,o);let r=Pie(t,"rtept",nr.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)OLe(e,r[a],n,i),s[a]=Iie(r[a]);o.polyline=DLe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function IRt(e,t,n,i){let o=Fie(t,n);o.description=Xie(t,o);let r=Pie(t,"trkseg",nr.gpx),s=[],a=[],c,d=!0,u=new fc;for(let m=0;m<r.length;m++)c=PRt(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,EH);o.billboard=ULe(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=DLe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function PRt(e){let t={positions:[],times:[]},n=Pie(e,"trkpt",nr.gpx),i;for(let o=0;o<n.length;o++){let r=Iie(n[o]);t.positions.push(r),i=nu(n[o],"time",nr.gpx),l(i)&&t.times.push(Q.fromIso8601(i))}return t}function XRt(e){let t=hT(e,"metadata",nr.gpx);if(l(t)){let n={name:nu(t,"name",nr.gpx),desc:nu(t,"desc",nr.gpx),author:NRt(t),copyright:MRt(t),link:BLe(t),time:nu(t,"time",nr.gpx),keywords:nu(t,"keywords",nr.gpx),bounds:wRt(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 NRt(e){let t=hT(e,"author",nr.gpx);if(l(t)){let n={name:nu(t,"name",nr.gpx),email:YRt(t),link:BLe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function YRt(e){let t=hT(e,"email",nr.gpx);if(l(t)){let n=nu(t,"id",nr.gpx),i=nu(t,"domain",nr.gpx);return`${n}@${i}`}}function BLe(e){let t=hT(e,"link",nr.gpx);if(l(t)){let n={href:DM(t,"href"),text:nu(t,"text",nr.gpx),mimeType:nu(t,"type",nr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function MRt(e){let t=hT(e,"copyright",nr.gpx);if(l(t)){let n={author:DM(t,"author"),year:nu(t,"year",nr.gpx),license:nu(t,"license",nr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function wRt(e){let t=hT(e,"bounds",nr.gpx);if(l(t)){let n={minLat:kM(t,"minlat",nr.gpx),maxLat:kM(t,"maxlat",nr.gpx),minLon:kM(t,"minlon",nr.gpx),maxLon:kM(t,"maxlon",nr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var MLe={wpt:OLe,rte:FRt,trk:IRt};function kRt(e,t,n,i){let o=Object.keys(MLe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=MLe[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 wLe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=DM(o,"version"),s=DM(o,"creator"),a,c=XRt(o);l(c)&&(a=c.name),o.localName==="gpx"?kRt(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),URt(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 URt(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 DRt(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?WRt(r).then(function(s){let a,c;try{a=kLe.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 wLe(e,a,i)}):wLe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function kE(){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 Bg}kE.load=function(e,t){return new kE().load(e,t)};Object.defineProperties(kE.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}}});kE.prototype.update=function(e){return!0};kE.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 DRt(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 OM=kE;var o6i=x(T(),1);function ORt(e,t){this.position=e,this.headingPitchRoll=t}var BM=ORt;var B7i=x(T(),1);var QM=x(bu(),1);var s6i=x(T(),1);function BRt(e,t){this.position=e,this.headingPitchRange=t}var zM=BRt;var d6i=x(T(),1);function AH(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=[]}AH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};AH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;HLe.call(this,e,t,function(i){n.playlistIndex=0,i||zLe(n._activeEntries),n.tourEnd.raiseEvent(i)})};AH.prototype.stop=function(){zLe(this._activeEntries)};function zLe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function HLe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=zRt.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 zRt(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++,HLe.call(this,e,t,n)}}var HM=AH;var E6i=x(T(),1);var _6i=x(T(),1);var y6i=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}}}}),KM=function(){return performance.now()},HRt=(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=KM()),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})(),UE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=UE.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=UE.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=UE.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=UE.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}}},KLe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Nie=new HRt,JLe=(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=UE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=KLe.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=Nie,Nie.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=KM()),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=KM()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=KM()),!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=UE.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=KM()),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 u6i=KLe.nextId,V0=Nie,m6i=V0.getAll.bind(V0),h6i=V0.removeAll.bind(V0),f6i=V0.add.bind(V0),p6i=V0.remove.bind(V0),b6i=V0.update.bind(V0);var KRt={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(KRt);function GH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}GH.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 me(this.view.position);t.flyToBoundingSphere(o,i)}};GH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};GH.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 JM=GH;var L6i=x(T(),1);function Yie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Yie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Yie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var jM=Yie;var rWe={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),rWe[t]}},Kie;typeof DOMParser<"u"&&(Kie=new DOMParser);var JRt=new VH({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),fT=32,jLe=2414016,QLe=1,qLe=16093e3,$Le=.1,eWe=[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"],tWe=["http://www.google.com/kml/ext/2.2"],jRt=["http://www.w3.org/2005/Atom"],De={kml:eWe,gx:tWe,atom:jRt,kmlgx:eWe.concat(tWe)},Jie={Document:pWe,Folder:p1t,Placemark:b1t,NetworkLink:C1t,GroundOverlay:S1t,PhotoOverlay:yWe,ScreenOverlay:_1t,Tour:y1t},Die=class{constructor(t){this._dataSource=t,this._deferred=Rd(),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=Kg._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=Kg._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=Jie[o.localName];if(l(r)&&(De.kml.indexOf(o.namespaceURI)!==-1||De.gx.indexOf(o.namespaceURI)!==-1)&&(r(n,o,i,this),this._timeoutSet||Kg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}o=this._nextNode()}this._pop()&&t&&this._process(!0)}};function QRt(e){let t=e.slice(0,Math.min(4,e.size)),n=Rd(),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 qRt(e){let t=Rd(),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 sWe(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 aWe(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 $Rt(e,t){let n=await e.getData(new xM);n=sWe(n),n=aWe(n),t.kml=Kie.parseFromString(n,"application/xml")}async function Mie(e,t){let n=rWe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new gM(n));t[e.filename]=i}function tm(e,t,n,i){let o=i.keys,r=new QM.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 QM.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 nm(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=jie(a,i);l(c)&&s.setAttribute(n,c.url)}}function cWe(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 Hie),o}function qM(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function FH(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 LH(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++]=FH(n[s],t);return o}function pT(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 nWe(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 jie(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 QM.default(t.getUrlComponent()),s=new QM.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new ve({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var iu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Oie(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?(iu.maximumRed=r,iu.red=void 0):(iu.maximumRed=void 0,iu.red=0),o>0?(iu.maximumGreen=o,iu.green=void 0):(iu.maximumGreen=void 0,iu.green=0),i>0?(iu.maximumBlue=i,iu.blue=void 0):(iu.maximumBlue=void 0,iu.blue=0),iu.alpha=n,U.fromRandom(iu)):new U(r,o,i,n)}function YZ(e,t,n){let i=Yn(e,t,n);if(l(i))return Oie(i,Yn(e,"colorMode",n)==="random")}function e1t(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 t1t(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 lWe(){let e=new Oc;return e.width=fT,e.height=fT,e.scaleByDistance=new Kt(jLe,QLe,qLe,$Le),e.pixelOffsetScaleByDistance=new Kt(jLe,QLe,qLe,$Le),e}function Qie(){let e=new Hh;return e.outline=!0,e.outlineColor=U.WHITE,e}function dWe(){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 qie(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=jie(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(vH(m))),l(p)&&s.setQueryParameters(gu(vH(p)));let b=t._ellipsoid;return eoe(s,t.camera,t.canvas,d,t._lastCameraView.bbox,b),s}return s}function n1t(e,t,n,i,o){let r=Ai(t,"scale",De.kml),s=Ai(t,"heading",De.kml),a=YZ(t,"color",De.kml),c=co(t,"Icon",De.kml),d=qie(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=pT(f,"x"),_=pT(f,"y"),S=Ga(f,"xunits"),Z=Ga(f,"yunits"),R=n.billboard;l(R)||(R=lWe(),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-fT)*r:S==="fraction"&&(C=-y*fT*r),C+=fT*.5*r),l(_)&&(Z==="pixels"?E=_*r:Z==="insetPixels"?E=(-_+fT)*r:Z==="fraction"&&(E=_*fT*r),E-=fT*.5*r),(l(C)||l(E))&&(R.pixelOffset=new k(C,E))}function WH(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")n1t(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=dWe(),n.label=c),c.scale=Ai(a,"scale",De.kml)??c.scale,c.fillColor=YZ(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=YZ(a,"color",De.kml),l(YZ(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=Qie(),n.polygon=c),c.material=YZ(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=Oie(Yn(a,"bgColor",De.kml))??U.WHITE,d=Oie(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 i1t(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")WH(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);WH(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 o1t(e,t,n){return t.fetchXML().then(function(i){return uWe(e,i,n,t,!0)})}function uWe(e,t,n,i,o,r){let s,a,c,d,u=nWe(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),WH(e,d,c,i,r)))}let m=nWe(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),WH(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(o1t(e,Z,n))}}}return p}function $ie(e,t,n){let i=new Vg(e,t.id,["position"]),o=new l0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new qc,t.polyline.positions=new Cg([i,o])}function mWe(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 r1t(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 s1t(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 IH(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():dWe(),t.label=o),o.text=t.name;let r=t.billboard;if(l(r)||(r=l(n.billboard)?n.billboard.clone():lWe(),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 hWe(e,t){let n=e.path;l(n)||(n=new xb,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function a1t(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=FH(r,d);return i.position=u,IH(e,i,o,mWe(s,a)),c&&qM(s,a)&&$ie(t,i,o),!0}function iWe(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=qM(s,a),m=Ai(n,"drawOrder",De.gx),p=e._ellipsoid,b=LH(r,p),f=o.polyline;if(u&&c){let y=new Tb;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=s1t(b,s,a,p),(!d||u)&&(f.arcType=un.NONE);return!0}function c1t(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=LH(a,c),u=Kf(n,"extrude",De.kml),m=Yn(n,"altitudeMode",De.kml),p=Yn(n,"altitudeMode",De.gx),b=qM(m,p),f=l(o.polygon)?o.polygon.clone():Qie(),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=LH(a,c),l(d)&&_.holes.push(new Gc(d))}f.hierarchy=_}return!0}function l1t(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=qM(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=FH(a[S].textContent,p);f.push(Z),y.push(Q.fromIso8601(d[S].textContent))}let _=new fc;return _.addSamples(y,f),i.position=_,IH(e,i,o,mWe(r,s)),hWe(i,o),i.availability=new Vs,d.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),m&&u&&$ie(t,i,o),!0}function oWe(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:r1t(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 d1t(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 Ag,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=qM(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=FH(R[N].textContent,f);I.push(g),a.push(Q.fromIso8601(Z[N].textContent))}r&&(l(c)&&oWe([c,a[0]],[d,I[0]],b,p,m,!1,"absolute",void 0,!1),c=a[F-1],d=I[I.length-1]),oWe(a,I,b,p,m,A&&L,C,E,!0),u=u||A&&L}return i.availability=p,i.position=b,IH(e,i,o),hWe(i,o),u&&($ie(t,i,o),i.polyline.show=m),!0}var fWe={Point:a1t,LineString:iWe,LinearRing:iWe,Polygon:c1t,Track:l1t,MultiTrack:d1t,MultiGeometry:u1t,Model:m1t};function u1t(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=fWe[u.localName];if(l(m)){let p=cWe(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 m1t(e,t,n,i,o){return xt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function h1t(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 f1t(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=JRt.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&&(tm(Bo,"a","href",i),tm(Bo,"link","href",i),tm(Bo,"area","href",i),tm(Bo,"img","src",i),tm(Bo,"iframe","src",i),tm(Bo,"video","src",i),tm(Bo,"audio","src",i),tm(Bo,"source","src",i),tm(Bo,"track","src",i),tm(Bo,"input","src",i),tm(Bo,"embed","src",i),tm(Bo,"script","src",i),tm(Bo,"video","poster",i)),nm(Bo,"a","href",o),nm(Bo,"link","href",o),nm(Bo,"area","href",o),nm(Bo,"img","src",o),nm(Bo,"iframe","src",o),nm(Bo,"video","src",o),nm(Bo,"audio","src",o),nm(Bo,"source","src",o),nm(Bo,"track","src",o),nm(Bo,"input","src",o),nm(Bo,"embed","src",o),nm(Bo,"script","src",o),nm(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 PH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=cWe(t,i,n.context),c=a.kml,d=i1t(e,t,n.styleCollection,r,s),u=Yn(t,"name",De.kml);a.name=u,a.parent=o;let m=t1t(t);l(m)||(m=e1t(t)),a.availability=m,toe(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),h1t(t,a),f1t(t,a,d,s,r);let Z=e._ellipsoid;return gWe(t,a,Z),bWe(t,a,Z),l(co(t,"Region",De.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function pWe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function p1t(e,t,n,i){let o=PH(e,t,n),r=$e(n);r.parentEntity=o.entity,pWe(e,t,r,i)}function b1t(e,t,n,i){let o=PH(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=fWe[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),IH(e,r,s))}var g1t={FlyTo:T1t,Wait:x1t,SoundCue:wie,AnimatedUpdate:wie,TourControl:wie};function y1t(e,t,n,i){let o=Yn(t,"name",De.kml),r=Ga(t,"id"),s=new HM(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=g1t[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function wie(e,t){xt(`KML Tour unsupported node ${t.localName}`)}function x1t(e,t){let n=Ai(t,"duration",De.gx);e.addPlaylistEntry(new jM(n))}function T1t(e,t,n){let i=Ai(t,"duration",De.gx),o=Yn(t,"flyToMode",De.gx),r={kml:{}};gWe(t,r,n),bWe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new JM(i,o,s);e.addPlaylistEntry(a)}function bWe(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 BM(u,m)}}function gWe(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 zM(m,u)}}function _1t(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=qie(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=pT(b,"x"),y=pT(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=pT(p,"x"),y=pT(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=pT(m,"x"),y=pT(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 S1t(e,t,n,i){let r=PH(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=LH(co(t,"LatLonQuad",De.gx),c),u=Ai(t,"drawOrder",De.kml);if(l(d))s=Qie(),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=qie(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=YZ(t,"color",De.kml),s.material.transparent=!0}else s.material=YZ(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 yWe(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 bT={INTERVAL:0,EXPIRE:1,STOP:2};function vH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Z1t=new re,DE=new pe,kie=new k,R1t=new h;function eoe(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=$T(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??Z1t,l(n)&&(kie.x=n.clientWidth*.5,kie.y=n.clientHeight*.5,d=t.pickEllipsoid(kie,r,R1t)),l(d)?u=r.cartesianToCartographic(d,DE):(u=re.center(o,DE),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,DE),c=c.replace("[cameraLon]",W.toDegrees(DE.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(DE.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(DE.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 C1t(e,t,n,i){let r=PH(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=jie(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(vH(S))),l(Z)&&d.setQueryParameters(gu(vH(Z)));let R=e._ellipsoid;eoe(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=zie(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,toe(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=bT.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=bT.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=bT.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 V1t(e,t,n,i){let o=Jie[t.localName];return l(o)?o(e,t,n,i):yWe(e,t,n,i)}function Bie(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=Zg(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Kg._DeferredLoading(e),m=new za(e);return Promise.all(uWe(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(Jie[_.localName])){p=_;break}}}let b={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),V1t(e,p,b,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}async function E1t(e,t,n,i,o){let r=en("ThirdParty/Workers/zip-web-worker.js"),s=en("ThirdParty/zip-module.wasm");nM({workerURI:r,wasmURI:s});let a=new GZ(new $d(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(Mie(m,u)),m=b):d.push(Mie(b,u)))}if(l(m)&&d.push($Rt(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),Bie(e,t,u.kml,i,u,o)}function zie(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?QRt(d).then(function(u){return u?E1t(e,t,d,o,a):qRt(d).then(function(m){m=sWe(m),m=aWe(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 Bie(e,t,p,o,r,a,s)})}):Bie(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}var Kg=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 Bg,this._networkLinks=new wt,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 zie(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;Uie.removeAll();function r(m){let p=m._children,b=p.length;for(let f=0;f<b;++f){let y=p[f];Uie.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 wt,u=!1;return n.values.forEach(function(m){let p=m.entity;if(!Uie.contains(p.id)){if(!m.updating){let b=!1;if(m.refreshMode===bT.INTERVAL?Q.secondsDifference(i,m.lastUpdated)>m.time&&(b=!0):m.refreshMode===bT.EXPIRE?Q.greaterThan(i,m.time)&&(b=!0):m.refreshMode===bT.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;eoe(y,o.camera,o.canvas,m.viewBoundScale,a.bbox,_),zie(o,f,y,{context:p.id}).then(A1t(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 toe(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 A1t(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===bT.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===bT.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,toe(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 Uie=new wt,Hie=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}};Kg._DeferredLoading=Die;Kg._getTimestamp=Zn;var MZ=Kg;var K7i=x(T(),1);function $M(){ge.throwInstantiationError()}$M.prototype.update=ge.throwInstantiationError;$M.prototype.getBoundingSphere=ge.throwInstantiationError;$M.prototype.isDestroyed=ge.throwInstantiationError;$M.prototype.destroy=ge.throwInstantiationError;var noe=$M;var lqi=x(T(),1);var j7i=x(T(),1),wZ=`in vec4 position; +in vec2 textureCoordinates; +out vec2 v_textureCoordinates; +void main() +{ +gl_Position = position; +v_textureCoordinates = textureCoordinates; +} +`;function XH(e){this._context=e}var ew,G1t=new lt({primitiveType:Ie.TRIANGLES}),L1t=new mi({color:new U(0,0,0,0)});function W1t(e,t){return new ps({context:e,colorTextures:[t],destroyAttachments:!1})}function v1t(e,t){return nn.fromCache({context:e,vertexShaderSource:wZ,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function F1t(e,t){return(!l(ew)||ew.viewport.width!==e||ew.viewport.height!==t)&&(ew=ze.fromCache({viewport:new nt(0,0,e,t)})),ew}XH.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:v1t(o,e.fragmentShaderSource),a=W1t(o,t),c=F1t(n,i),d=e.uniformMap,u=L1t;u.framebuffer=a,u.renderState=c,u.execute(o);let m=G1t;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)};XH.prototype.isDestroyed=function(){return!1};XH.prototype.destroy=function(){return ue(this)};var tw=XH;var P$i=x(T(),1);var uqi=x(T(),1);function I1t(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var gc=I1t;var hqi=x(T(),1),ioe=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)}},nw=ioe;var xqi=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 P1t(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)?P1t(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)){ooe(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 ooe(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];ooe(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];ooe(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 ue(this)};var iw=Jf;var Zqi=x(T(),1);function kZ(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(kZ.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});kZ.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};kZ.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};kZ.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={}};kZ.prototype.isDestroyed=function(){return!1};kZ.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var ow=kZ;var t$i=x(T(),1);var vqi=x(T(),1);var roe={};function X1t(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var N1t=32.184,Y1t=2451545;function NWe(e,t){t=Q.addSeconds(e,N1t,t);let n=Q.totalDays(t)-Y1t;return t=Q.addSeconds(t,X1t(n),t),t}var NH=new Q(2451545,0,ci.TAI),M1t=1e3,bh=W.RADIANS_PER_DEGREE,im=W.RADIANS_PER_ARCSECOND,Yc=14959787e4,xWe=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=k1t(r-i,t),m=w1t(t,0);z1t(c,n,d,xWe);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(xWe,s,s)}function w1t(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function k1t(e,t){let n=O1t(e,t);return B1t(n,t)}var U1t=50,D1t=W.EPSILON8;function O1t(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<U1t&&Math.abs(o-i)>D1t;++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 B1t(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 z1t(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 H1t=1.0000010178*Yc,K1t=100.46645683*bh,J1t=129597742283429e-5*im,TWe=16002,_We=21863,SWe=32004,ZWe=10931,RWe=14529,CWe=16368,VWe=15318,EWe=32794,j1t=64*1e-7*Yc,Q1t=-152*1e-7*Yc,q1t=62*1e-7*Yc,$1t=-8*1e-7*Yc,eCt=32*1e-7*Yc,tCt=-41*1e-7*Yc,nCt=19*1e-7*Yc,iCt=-11*1e-7*Yc,oCt=-150*1e-7*Yc,rCt=-46*1e-7*Yc,sCt=68*1e-7*Yc,aCt=54*1e-7*Yc,cCt=14*1e-7*Yc,lCt=24*1e-7*Yc,dCt=-28*1e-7*Yc,uCt=22*1e-7*Yc,AWe=10,GWe=16002,LWe=21863,WWe=10931,vWe=1473,FWe=32004,IWe=4387,PWe=73,mCt=-325*1e-7,hCt=-322*1e-7,fCt=-79*1e-7,pCt=232*1e-7,bCt=-52*1e-7,gCt=97*1e-7,yCt=55*1e-7,xCt=-41*1e-7,TCt=-105*1e-7,_Ct=-137*1e-7,SCt=258*1e-7,ZCt=35*1e-7,RCt=-116*1e-7,CCt=-88*1e-7,VCt=-112*1e-7,ECt=-80*1e-7,OE=new Q(0,0,ci.TAI);function ACt(e,t){NWe(e,OE);let i=(OE.dayNumber-NH.dayNumber+(OE.secondsOfDay-NH.secondsOfDay)/wn.SECONDS_PER_DAY)/(wn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=H1t+j1t*Math.cos(TWe*o)+oCt*Math.sin(TWe*o)+Q1t*Math.cos(_We*o)+rCt*Math.sin(_We*o)+q1t*Math.cos(SWe*o)+sCt*Math.sin(SWe*o)+$1t*Math.cos(ZWe*o)+aCt*Math.sin(ZWe*o)+eCt*Math.cos(RWe*o)+cCt*Math.sin(RWe*o)+tCt*Math.cos(CWe*o)+lCt*Math.sin(CWe*o)+nCt*Math.cos(VWe*o)+dCt*Math.sin(VWe*o)+iCt*Math.cos(EWe*o)+uCt*Math.sin(EWe*o),s=K1t+J1t*i+mCt*Math.cos(AWe*o)+TCt*Math.sin(AWe*o)+hCt*Math.cos(GWe*o)+_Ct*Math.sin(GWe*o)+fCt*Math.cos(LWe*o)+SCt*Math.sin(LWe*o)+pCt*Math.cos(WWe*o)+ZCt*Math.sin(WWe*o)+bCt*Math.cos(vWe*o)+RCt*Math.sin(vWe*o)+gCt*Math.cos(FWe*o)+CCt*Math.sin(FWe*o)+yCt*Math.cos(IWe*o)+VCt*Math.sin(IWe*o)+xCt*Math.cos(PWe*o)+ECt*Math.sin(PWe*o),a=.0167086342-.0004203654*i,c=102.93734808*bh+11612.3529*im*i,d=469.97289*im*i,u=174.87317577*bh-8679.27034*im*i;return YWe(r,a,d,c,u,s,t)}function MWe(e,t){NWe(e,OE);let i=(OE.dayNumber-NH.dayNumber+(OE.secondsOfDay-NH.secondsOfDay)/wn.SECONDS_PER_DAY)/wn.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+im*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),Z=93.27209062*bh+im*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),R=134.96340251*bh+im*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),C=357.52910918*bh+im*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*bh-im*(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*=M1t;let Y=d+u*im,D=m+p*im,M=y+_*im,O=b+f*im;return YWe(a,c,Y,D,O,M,t)}var XWe=.012300034,GCt=XWe/(XWe+1)*-1;function LCt(e,t){return t=MWe(e,t),h.multiplyByScalar(t,GCt,t)}var wWe=new q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),rw=new h;roe.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),l(t)||(t=new h),rw=ACt(e,rw),t=h.negate(rw,t),LCt(e,rw),h.subtract(t,rw,t),q.multiplyByVector(wWe,t,t),t};roe.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),t=MWe(e,t),q.multiplyByVector(wWe,t,t),t};var gT=roe;var Xqi=x(T(),1);function WCt(e){e=e??B.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var Jg=WCt;function BE(){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(BE.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 DWe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return DWe(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 aoe(this),this._view3D}},viewRotation:{get:function(){return aoe(this),this._viewRotation}},viewRotation3D:{get:function(){return aoe(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return zWe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return zWe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return UCt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return DCt(this),this._modelView}},modelView3D:{get:function(){return OCt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return jCt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return BCt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return zCt(this),this._inverseModelView3D}},viewProjection:{get:function(){return HCt(this),this._viewProjection}},inverseViewProjection:{get:function(){return KCt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return JCt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return QCt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return qCt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return $Ct(this),this._modelViewInfiniteProjection}},normal:{get:function(){return eVt(this),this._normal}},normal3D:{get:function(){return tVt(this),this._normal3D}},inverseNormal:{get:function(){return nVt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return iVt(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 BWe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return BWe(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 vCt(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 FCt(e,t){P.clone(t,e._inverseView),P.getMatrix3(t,e._inverseViewRotation)}function ICt(e,t){P.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function PCt(e,t){P.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var kWe=new h,XCt=new P,UWe=new q;function NCt(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,kWe)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,kWe)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=q.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=_t.eastNorthUpToFixedFrame(i,n,XCt);e._enuToModel=P.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=P.inverseTransformation(e._enuToModel,e._modelToEnu);let s=P.getRotation(r,UWe),a=q.multiply(e._viewRotation,s,UWe);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 soe=new q,YCt=new pe;function MCt(e,t){_t.computeIcrfToCentralBodyFixedMatrix(t.time,soe);let n=gT.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);q.multiplyByVector(soe,n,n),h.normalize(n,e._sunDirectionWC),n=q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=gT.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),q.multiplyByVector(soe,n,n),q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,YCt);i.project(r,e._sunPositionColumbusView)}BE.prototype.updateCamera=function(e){vCt(this,e.viewMatrix),FCt(this,e.inverseViewMatrix),NCt(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};BE.prototype.updateFrustum=function(e){ICt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&PCt(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};BE.prototype.updatePass=function(e){this._pass=e};var wCt=[],kCt=new Jg;BE.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),MCt(this,e);let n=e.light??kCt;n instanceof Jg?(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??wCt,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 DWe(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 UCt(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 DCt(e){e._modelViewDirty&&(e._modelViewDirty=!1,P.multiplyTransformation(e._view,e._model,e._modelView))}function OCt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,P.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function BCt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,P.inverse(e.modelView,e._inverseModelView))}function zCt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,P.inverse(e.modelView3D,e._inverseModelView3D))}function HCt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,P.multiply(e._projection,e._view,e._viewProjection))}function KCt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,P.inverse(e.viewProjection,e._inverseViewProjection))}function JCt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,P.multiply(e._projection,e.modelView,e._modelViewProjection))}function jCt(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 QCt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,P.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function qCt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,P.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function $Ct(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,P.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function eVt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;P.getMatrix3(e.inverseModelView,t),q.transpose(t,t)}}function tVt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;P.getMatrix3(e.inverseModelView3D,t),q.transpose(t,t)}}function nVt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;P.getMatrix3(e.modelView,t),q.transpose(t,t)}}function iVt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;P.getMatrix3(e.modelView3D,t),q.transpose(t,t)}}var OWe=new h;function BWe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,P.multiplyByPoint(e.inverseModel,e._cameraPosition,OWe),An.fromCartesian(OWe,e._encodedCameraPositionMC))}var oVt=new h,rVt=new h,sVt=new h,aVt=new h,cVt=new pe,lVt=new h,dVt=new P;function uVt(e,t,n,i,o,r,s,a){let c=oVt;c.x=e.y,c.y=e.z,c.z=e.x;let d=rVt;d.x=n.y,d.y=n.z,d.z=n.x;let u=sVt;u.x=i.y,u.y=i.z,u.z=i.x;let m=aVt;m.x=t.y,m.y=t.z,m.z=t.x,r===se.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,cVt);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,lVt),y=_t.eastNorthUpToFixedFrame(f,b,dVt);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 aoe(e){e._view3DDirty&&(e._mode===se.SCENE3D?P.clone(e._view,e._view3D):uVt(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 zWe(e){e._inverseView3DDirty&&(P.inverseTransformation(e.view3D,e._inverseView3D),P.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var sw=BE;function ou(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):mVt(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 iw(this),this._textureCache=new ow,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"]),Ad.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,M,O){u.drawElementsInstanced(X,Y,D,M,O)},E=function(X,Y,D,M){u.drawArraysInstanced(X,Y,D,M)},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,M){I.drawElementsInstancedANGLE(v,X,Y,D,M)},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 sw,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 mVt(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 hVt(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 fVt(e,t,n,i){let o=`${hVt(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function pVt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(fVt(e,t,n,i))}function bVt(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 gVt(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,bVt(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 yVt={};Object.defineProperties(ou.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=gVt(this._originalGLContext,e?pVt: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 yVt}}});function HWe(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 coe;typeof WebGLRenderingContext<"u"&&(coe=[ie.BACK]);function YH(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=coe;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var xVt=new mi;ou.prototype.clear=function(e,t){e=e??xVt,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;HWe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;YH(this,c),n.clear(i)};function TVt(e,t,n,i,o){YH(e,t),HWe(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function _Vt(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()}ou.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,TVt(this,o,t,n,r),_Vt(this,e,n,i)};ou.prototype.beginFrame=function(){};ou.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=coe;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)};ou.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 YH(this,s),d._bind(),t.readPixels(n,i,o,r,c,Ue.toWebGLConstant(a,this),0),d._unBind(),d};ou.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 YH(this,s),t.readPixels(n,i,o,r,Qe.RGBA,Ue.toWebGLConstant(a,this),d),d};var KWe={position:0,textureCoordinates:1};ou.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:KWe,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};ou.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:wZ,fragmentShaderSource:e,attributeLocations:KWe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};ou.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};ou.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 nw(this._pickObjects,t,U.fromRgba(t))};ou.prototype.isDestroyed=function(){return!1};ou.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 UZ=ou;var M$i=x(T(),1);function SVt(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 aw=SVt;var O$i=x(T(),1);function MH(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new UZ(this._canvas,$e(e?.contextOptions)),this._canvases=[]}MH.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)}}})};MH.prototype.destroy=function(){this._context.destroy(),ue(this)};MH.prototype.isDestroyed=function(){return!1};var cw=MH;var Q$i=x(T(),1);function DZ(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}DZ.create=function(e){return new DZ(e)};DZ.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ie.SYNC_STATUS)};DZ.prototype.isDestroyed=function(){return!1};DZ.prototype.destroy=function(){return this._gl.deleteSync(this._sync),ue(this)};DZ.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 lw=DZ;var ueo=x(T(),1);function yT(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,QWe(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");JWe(this,n),this._initialized=!0}else jWe(this);f.bindTexture(this._textureTarget,null)}function JWe(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=loe(y),_=loe(_),S=loe(S),i.texSubImage3D(o,Z+1,0,0,0,y,_,S,d,Ue.toWebGLConstant(u,n),t.mipLevels[Z])}}yT.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?(JWe(this,t),m=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),jWe(this)),this._initialized=!0),m||ZVt(this,t.arrayBufferView,n,i,o,c,d,u),s.bindTexture(a,null)};function ZVt(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 loe(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function jWe(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)}yT.create=function(e){return new yT(e)};Object.defineProperties(yT.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){QWe(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 QWe(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)}yT.prototype.generateMipmap=function(e){e=e??Cm.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)};yT.prototype.isDestroyed=function(){return!1};yT.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var dw=yT;var ano=x(T(),1);var heo=x(T(),1),qWe={NONE:0,LERC:1};Object.freeze(qWe);var gh=qWe;var Ito=x(T(),1);var Ueo=x(T(),1);var Veo=x(T(),1);var peo=x(T(),1),$We={NONE:0,BITS12:1};Object.freeze($We);var Ka=$We;var uw=new h,RVt=new h,yh=new k,CVt=new P,VVt=new P,EVt=Math.pow(2,12);function Mc(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,RVt),_=i-n;Math.max(h.maximumComponent(y),_)<EVt-1?u=Ka.BITS12:u=Ka.NONE;let Z=P.fromScale(y,CVt);Z=P.setTranslation(Z,b,Z);let R=P.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,uw),VVt);R=P.multiplyByTranslation(R,h.negate(b,uw),R),p=P.clone(o,new P);let C=P.getTranslation(o,uw);C=h.subtract(C,e,uw),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()}Mc.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,uw),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 AVt=new h,eve=new h;Mc.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,AVt),c=n.geodeticSurfaceNormal(a,eve),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};Mc.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]}};Mc.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)};Mc.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,eve),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};Mc.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)};Mc.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]};Mc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+3],yh).x:e[t+6]};Mc.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)};Mc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return dn.octDecodeFloat(e[i],n)};Mc.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};Mc.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 wH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},kH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Mc.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(wH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(wH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(wH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(kH.compressed0,a?4:3),c&&s(kH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(kH.geodeticSurfaceNormal,3)}return r};Mc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?wH:kH};Mc.clone=function(e,t){if(l(e))return l(t)||(t=new Mc),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=Mc;var E0={};E0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var doe=new h,GVt=new P,LVt=new h,WVt=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,M=G.elementMultiplier??E0.DEFAULT_STRUCTURE.elementMultiplier,O=G.isBigEndian??E0.DEFAULT_STRUCTURE.isBigEndian,w=re.computeWidth(_),z=re.computeHeight(_),K=w/(d-1),te=z/(u-1);b||(w*=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,GVt),Ge,Ae;F&&(Ge=Ti.geodeticLatitudeToMercatorAngle(R),Ae=1/(Ti.geodeticLatitudeToMercatorAngle(E)-Ge));let Fe=LVt;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let tt=WVt;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,yi;F&&(yi=(Ti.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,Mn;if(Y===1)Mn=c[Qr];else{Mn=0;let qo;if(O)for(qo=0;qo<Y;++qo)Mn=Mn*M+c[Qr+qo];else for(qo=Y-1;qo>=0;--qo)Mn=Mn*M+c[Qr+qo]}Mn=Mn*v+X,he=Math.max(he,Mn),_e=Math.min(_e,Mn);let Ki=_.west+K*mo;b?Ki=a(Ki):Ki=Ki*y;let wi=(Ki-Z)/(C-Z);wi=W.clamp(wi,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&&(Mn-=m,qo?(Xo=je+(u-rn-1),Ki-=pt*w):hr?Xo=je+u+(d-mo-1):Gl?(Xo=je+u+d+rn,Ki+=pt*w):Po&&(Xo=je+u+d+u+mo))}let Dc=Is*t(Ki),pm=Is*n(Ki),bp=$*Dc,Lh=ee*pm,gp=1/i(bp*Dc+Lh*pm+or*Hs),Ps=bp*gp,$a=Lh*gp,BT=or*gp,si=new h;si.x=Ps+Dc*Mn,si.y=$a+pm*Mn,si.z=BT+Hs*Mn,P.multiplyByPoint(ye,si,doe),h.minimumByComponent(doe,Fe,Fe),h.maximumByComponent(doe,tt,tt),Be=Math.min(Be,Mn),Ke[Xo]=si,Et[Xo]=new k(wi,$i),ct[Xo]=Mn,F&&(zt[Xo]=yi),V&&(ut[Xo]=f.geodeticSurfaceNormal(si))}}let Mi=me.fromPoints(Ke),jn;l(S)&&(jn=tn.fromRectangle(S,_e,he,f));let Si;L&&(Si=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),pi=new Float32Array(We*Gi.stride),Zi=0;for(let On=0;On<We;++On)Zi=Gi.encode(pi,Zi,Ke[On],Et[On],ct[On],void 0,zt[On],ut[On]);return{vertices:pi,maximumHeight:he,minimumHeight:_e,encoding:Gi,boundingSphere3D:Mi,orientedBoundingBox:jn,occludeePointInScaledSpace:Si}};var zE=E0;var Beo=x(T(),1);function xT(){ge.throwInstantiationError()}Object.defineProperties(xT.prototype,{credits:{get:ge.throwInstantiationError},waterMask:{get:ge.throwInstantiationError}});xT.prototype.interpolateHeight=ge.throwInstantiationError;xT.prototype.isChildAvailable=ge.throwInstantiationError;xT.prototype.createMesh=ge.throwInstantiationError;xT.prototype.upsample=ge.throwInstantiationError;xT.prototype.wasCreatedByUpsampling=ge.throwInstantiationError;xT.maximumAsynchronousTasks=5;var ru=xT;var gto=x(T(),1);var oto=x(T(),1);var vVt=3,moe=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new hoe}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,o,r){this._needsRebuild&&PVt(this,n);let s=this._inverseTransform,a=IVt;a.origin=P.multiplyByPoint(s,t.origin,a.origin),a.direction=P.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return nve(this._rootNode,a,c),wVt(this,c,t,i,o,r)}},FVt=new $n("incrementallyBuildTerrainPicker"),hoe=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=tve(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=tve(n.x,n.y,n.level),this.children[t]=n}},IVt=new gn,UH=[new h,new h,new h];function PVt(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 XVt=new h,NVt=new h;function tve(e,t,n){let i=1/Math.pow(2,n),o=h.fromElements(e*i-.5,t*i-.5,-.5,XVt),r=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,NVt);return Tu.fromCorners(o,r)}function YVt(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 MVt=new Ns;function nve(e,t,n){let i=xi.rayAxisAlignedBoundingBox(t,e.aabb,MVt);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++)nve(e.children[r],t,n)}function wVt(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=kVt(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 kVt(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>=vVt)&&!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=uoe(a,o,r,t,d,c[3*_],UH[0]),Z=uoe(a,o,r,t,d,c[3*_+1],UH[1]),R=uoe(a,o,r,t,d,c[3*_+2],UH[2]),C=xi.rayTriangleParametric(t,S,Z,R,i);l(C)&&C<s&&C>=0&&(s=C),p&&YVt(b,f,UH,_,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);DVt(e._inverseTransform,n,f,b)}return s}var UVt=new pe;function uoe(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,UVt);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 DVt(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=FVt.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 mw=moe;function hw(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 mw(t,n,p)}hw.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===se.SCENE3D?OVt(this,this._transform):QVt(this,t,this._transform))};function OVt(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,foe).z<=W.EPSILON16&&(foe.z=1,P.setScale(t,foe,t)),t}var BVt=new h,zVt=new h,HVt=new pe,KVt=new pe,JVt=new h,jVt=new h,foe=new h;function QVt(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,HVt),BVt),c=t.project(pe.fromRadians(e.rectangle.east,e.rectangle.north,0,KVt),zVt),d=s-r,u=h.fromElements(c.x-a.x,c.y-a.y,d>0?d:1,JVt),m=h.fromElements(a.x+u.x*.5,a.y+u.y*.5,r+u.z*.5,jVt);return P.fromTranslation(m,n),P.setScale(n,u,n),P.multiply(_t.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}hw.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};hw.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};hw.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var yc=hw;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=zE.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 ive="createVerticesFromHeightmap",qVt=new $n(ive),$Vt=new $n(ive,ru.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?$Vt:qVt).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,me.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=zE.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=ove(_,S,u,m,e,i,o,t,n)}else y=eEt(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=ove(b,f,S,Z,y,c,d,N,F);g=g<u.lowestEncodedHeight?u.lowestEncodedHeight:g,g=g>u.highestEncodedHeight?u.highestEncodedHeight:g,tEt(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 eEt(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=DH(e,t,n,i,o,f*s+p),R=DH(e,t,n,i,o,f*s+b),C=DH(e,t,n,i,o,y*s+p),E=DH(e,t,n,i,o,y*s+b);return rve(_,S,Z,R,C,E)}function ove(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 rve(y,_,S,Z,R,C)}function rve(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 tEt(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 wc=jg;var wto=x(T(),1);function JE(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var OZ=new re;function nEt(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}JE.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)nEt(e,b,p,s)||s.push(new HE(r,void 0,0,b,p));r.tileXYToRectangle(t,n,e,OZ);let a=OZ.west,c=OZ.north;r.tileXYToRectangle(i,o,e,OZ);let d=OZ.east,u=OZ.south,m=new aEt(e,a,u,d,c);for(let p=0;p<s.length;++p){let b=s[p];poe(b.extent,m)&&cEt(this._maximumLevel,b,m)}};JE.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)?fw(void 0,t,e):-1};var iEt=[],oEt=[],rEt=new re,sEt=new re;JE.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=iEt;t.length=0,e.east<e.west?(t.push(re.fromRadians(-Math.PI,e.south,e.east,e.north,rEt)),t.push(re.fromRadians(e.west,e.south,Math.PI,e.north,sEt))):t.push(e);let n=oEt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)pw(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 sve=new pe;JE.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,OZ);return re.center(i,sve),this.computeMaximumLevelAtPosition(sve)>=e};JE.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 HE(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(HE.prototype,{nw:{get:function(){return this._nw||(this._nw=new HE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new HE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new HE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new HE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function aEt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function poe(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 cEt(e,t,n){for(;t.level<e;)if(OH(t.nw.extent,n))t=t.nw;else if(OH(t.ne.extent,n))t=t.ne;else if(OH(t.sw.extent,n))t=t.sw;else if(OH(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,lEt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function lEt(e,t){return e.level-t}function OH(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 fw(e,t,n){let i=0,o=!1;for(;!o;){let r=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(r+s+a+c>1){r&&(i=Math.max(i,fw(t,t._nw,n))),s&&(i=Math.max(i,fw(t,t._ne,n))),a&&(i=Math.max(i,fw(t,t._sw,n))),c&&(i=Math.max(i,fw(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];KE(a,n)&&(i=a.level)}t=t.parent}return i}function pw(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||poe(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]=dEt(e[s.level],s)}pw(e,t._nw,n),pw(e,t._ne,n),pw(e,t._sw,n),pw(e,t._se,n)}function dEt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];poe(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=JE;var uEt=15;function ave(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}ave.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 mEt(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 hEt(e,t,n){try{let i=await t.fetchJson();mEt(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 TT(){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(TT.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}}});TT.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 ave(t);await hEt(o,i);let r=new TT(t);return o.build(r),r._resource=n,r};TT.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(boe(this,n+1,e*2,t*2))){let m=cve(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 wc({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):uEt,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 boe(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}TT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};TT.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=boe(this,n,e,t);if(l(i))return i;cve(this,n,e,t)};TT.prototype.loadTileDataAvailability=function(e,t,n){};function fEt(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 pEt(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=fEt(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 cve(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=pEt(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 boe(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 goe=TT;var fno=x(T(),1);var lve="https://dev.virtualearth.net/REST/v1/Locations";function yoe(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:lve,queryParameters:n}),this._credit=new Lt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(yoe.prototype,{url:{get:function(){return lve}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});yoe.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 xoe=yoe;var gno=x(T(),1);function Toe(){}Object.defineProperties(Toe.prototype,{credit:{get:function(){}}});Toe.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 _oe=Toe;var Vno=x(T(),1);var bEt=new ce,dve=new h,jE=new h;function gEt(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=bEt;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,dve),h.multiplyByScalar(m,.5,m),p=P.multiplyByVector(fx.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],dve),h.multiplyByScalar(u,.5,u),p=P.multiplyByVector(fx.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=P.multiplyByVector(_T.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,jE),h.add(o,jE,o),h.multiplyByScalar(u,p.z,jE),h.add(o,jE,o),h.multiplyByScalar(m,p.w,jE),h.add(o,jE,o)}}var yEt=new h,xEt=new h;function _T(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=yEt,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=xEt,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=gEt(this),this._lastTimeIndex=0}Object.defineProperties(_T.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}}});_T.catmullRomCoefficientMatrix=new P(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);_T.prototype.findTimeInterval=vo.prototype.findTimeInterval;_T.prototype.wrapTime=vo.prototype.wrapTime;_T.prototype.clampTime=vo.prototype.clampTime;_T.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Soe=_T;var yio=x(T(),1);var jno=x(T(),1);var Zoe={},TEt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},_Et=new pe,SEt=new h,ZEt=new P,REt=new P,CEt=new P,VEt=new h,EEt=new h,AEt=new h,GEt=new h,LEt=new pe,WEt=new k,bw=new h,vEt=new k,FEt=new h,IEt=new h,BH=function(e,t){return e-t};Zoe.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=me.clone(e.boundingSphere,new me),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?qy.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,_Et);L.height=.5*(s+a);let F=pe.toCartesian(L,f,SEt),I=_t.eastNorthUpToFixedFrame(F,f,ZEt),N=P.inverseTransformation(I,REt),g=P.unpack(r.nodes[0].matrix,0,CEt);g=P.multiply(Bi.Y_UP_TO_Z_UP,g,g);let V=hAt(r,i,TEt),G=Qo.getSkirtVertexCount(V.edgeIndicesWest,V.edgeIndicesSouth,V.edgeIndicesEast,V.edgeIndicesNorth),v=V.positions,X=V.normals,Y=V.indices,D=v.length/3,M=D+G,O=Y.length,w=Qo.getSkirtIndexCountWithFilledCorners(G),z=M<=65535?Uint16Array:Uint32Array,K=new z(O+w);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=Ti.geodeticLatitudeToMercatorAngle(R),Ae=1/(Ti.geodeticLatitudeToMercatorAngle(C)-ye),Fe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,VEt),tt=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,EEt),Be=new Cr(m.center,void 0,void 0,void 0,void 0,i,o,u,t,n),je=Be.stride,qe=new Float32Array(M*je),We=0;for(let ct=0;ct<D;ct++){let Et=h.unpack(v,ct*3,AEt),zt=P.multiplyByPoint(g,Et,GEt),ut=pe.fromCartesian(zt,f,LEt),{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,BH)>=0?st=0:Eo(he,ct,BH)>=0&&(st=1),Eo(_e,ct,BH)>=0?pt=0:Eo(Ze,ct,BH)>=0&&(pt=1);let Mi=k.fromElements(st,pt,WEt),jn;if(i){let pi=h.unpack(X,ct*3,bw);pi=P.multiplyByPointAsVector(g,pi,bw),pi=h.normalize(pi,bw),jn=dn.octEncode(pi,vEt)}let Si;o&&(Si=(Ti.geodeticLatitudeToMercatorAngle(ht)-ye)*Ae);let Hi;u&&(Hi=f.geodeticSurfaceNormal(zt,FEt)),We=Be.encode(qe,We,zt,Mi,jt,jn,Si,Hi);let Gi=P.multiplyByPoint(N,zt,IEt);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,me.clone(m,new me),h.clone(b,new h),je,tn.clone(p,new tn),Be,te,H,$,ee);return gve(Ke,y,f,Fe,tt,I,N,c),Promise.resolve(Ke)};var PEt=new k,XEt=new k,NEt=new Array(6),YEt=new k,MEt=new k,wEt=new k,kEt=new h,UEt=new h,DEt=new h,OEt=new pe,BEt=new h,zEt=new pe,HEt=new pe,uve=new h,KEt=new h,JEt=new h,jEt=new h,QEt=new h,qEt=new h,$Et=new h,eAt=new h,tAt=new P,nAt=new P,mve=new k,iAt=new k,oAt=new h,rAt=new me,sAt=new tn,aAt=new Tu,hve=new h,fve=new k,cAt=new k,pve=new h,lAt=new h;function dAt(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);qy.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 uAt(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);qy.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=bw;y.x=p,y.y=b,y.z=f,y=h.normalize(y,bw),u[m*3+0]=y.x,u[m*3+1]=y.y,u[m*3+2]=y.z}return u}function mAt(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 qy.decodeIndexBuffer(new Uint8Array(d.buffer),o,s.byteStride,c),d}function zH(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 qy.decodeIndexSequence(new Uint8Array(u.buffer),r,m,d),u}function hAt(e,t,n){return n.positions=dAt(e),n.normals=t?uAt(e):void 0,n.indices=mAt(e),n.edgeIndicesWest=zH(e,"left"),n.edgeIndicesSouth=zH(e,"bottom"),n.edgeIndicesEast=zH(e,"right"),n.edgeIndicesNorth=zH(e,"top"),n}Zoe.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=[];VAt(t,n,s,a,c,d,u,A,L,F,I,N,R,E,C);let g=re.center(S,OEt);g.height=.5*(i+o);let V=pe.toCartesian(g,Z,BEt),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,M=A.length,O=Qo.getSkirtIndexCountWithFilledCorners(Y),w=M+O,z=D<=65535?Uint16Array:Uint32Array,K=new z(w);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,tAt),Ze=P.inverseTransformation(he,nAt),ye=S.west,Ge=S.east,Ae=S.south,Fe=S.north,tt=Ti.geodeticLatitudeToMercatorAngle(Ae),je=1/(Ti.geodeticLatitudeToMercatorAngle(Fe)-tt),qe=Number.POSITIVE_INFINITY,We=Number.NEGATIVE_INFINITY,Ke=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,$Et),ct=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,eAt);for(let jt=0;jt<G;jt++){let st=R[jt],pt=a[st*3+0],Mi=a[st*3+1],jn=a[st*3+2],Si=iAt;Si.x=C[jt*2+0],Si.y=C[jt*2+1];let Hi=Si.x,Gi=Si.y,pi=E[jt*2+0],Zi=E[jt*2+1],On=1-pi-Zi,rn=u.decodeHeight(d,pt),Hn=u.decodeHeight(d,Mi),$i=u.decodeHeight(d,jn),Po=rn*pi+Hn*Zi+$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,HEt),or=pe.toCartesian(Hs,Z,KEt),yi=P.multiplyByPoint(Ze,or,jEt);Ke=h.minimumByComponent(yi,Ke,Ke),ct=h.maximumByComponent(yi,ct,ct);let fr;if(m){let Mn=u.decodeNormal(d,pt,kEt),Ki=u.decodeNormal(d,Mi,UEt),wi=u.decodeNormal(d,jn,DEt),Xo=h.fromElements(Mn.x*pi+Ki.x*Zi+wi.x*On,Mn.y*pi+Ki.y*Zi+wi.y*On,Mn.z*pi+Ki.z*Zi+wi.z*On,hve);Xo=h.normalize(Xo,hve),fr=dn.octEncode(Xo,cAt)}let mo;p&&(mo=(Ti.geodeticLatitudeToMercatorAngle(Is)-tt)*je);let Qr;_&&(Qr=Z.geodeticSurfaceNormal(or,lAt)),_e=v.encode(le,_e,or,Si,Po,fr,mo,Qr)}let Et=tn.fromRectangle(S,qe,We,Z,sAt),zt=me.fromVertices(le,v.center,X,rAt),bt=new Af(Z).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(v.center,le,X,v.center,qe,oAt),ht=new yc(h.clone(v.center,new h),le,K,M,G,qe,We,S,me.clone(zt),h.clone(bt),X,tn.clone(Et),v,te,H,$,ee);return gve(ht,S,Z,Ke,ct,he,Ze,r),ht};function gve(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],M=[0,-1,0,1],O=h.clone(i,QEt),w=h.clone(o,qEt),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,mve),he=1e-4,Ze=_e.x+D[ee]*he,ye=_e.y+M[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,zEt),je=pe.toCartesian(Be,n,uve),qe;m&&(qe=c.getOctEncodedNormal(u,le,fve));let We;p&&(We=c.decodeWebMercatorT(u,le));let Ke;_&&(Ke=n.geodeticSurfaceNormal(je,pve)),Z=c.encode(u,Z,je,_e,tt,qe,We,Ke);let ct=P.multiplyByPoint(s,je,JEt);h.minimumByComponent(ct,O,O),h.maximumByComponent(ct,w,w)}let te=Tu.fromCorners(O,w,aAt),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,uve),c.decodeTextureCoordinates(u,he,mve),c.decodeHeight(u,he),c.hasVertexNormals?c.getOctEncodedNormal(u,he,fve):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(u,he):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(u,he,pve):void 0);e.vertices=le,e.stride=ee,e.encoding=$}return e}var Roe=0,fAt=1,Coe=2,Voe=3,pAt=4,bAt=new h,gAt=[new h,new h,new h,new h,new h,new h],yAt=[new k,new k,new k,new k,new k,new k],xAt=[new h,new h,new h,new h,new h,new h],TAt=[new k,new k,new k,new k,new k,new k];function bve(e,t,n,i){switch(n){case Roe:return W.sign(i.x-e.x);case Coe:return W.sign(t.x-i.x);case Voe:return W.sign(i.y-e.y);default:return W.sign(t.y-i.y)}}function _At(e,t,n,i,o,r){let s,a,c;switch(n){case Roe:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case Coe:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case Voe: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 SAt={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 ZAt(e,t,n,i,o,r,s,a){let c,d=yAt,u=gAt,m=3,p=TAt;k.clone(o,p[0]),k.clone(r,p[1]),k.clone(s,p[2]);let b=xAt;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)%pAt,_=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=bve(n,i,y,R);for(let A=0;A<c;A++){let L=d[A],F=u[A],I=bve(n,i,y,L);if(E*I===-1){let N=_At(n,i,y,R,L,bAt),{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 RAt(e,t,n,i,o,r,s,a){return ZAt(e?t?Voe:Roe:t?Coe:fAt,2,n,i,o,r,s,a)}var CAt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function VAt(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=PEt;C.x=_,C.y=Z;let E=XEt;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,YEt),V=s.decodeTextureCoordinates(r,I,MEt),G=s.decodeTextureCoordinates(r,N,wEt),v=RAt(e,t,C,E,g,V,G,SAt),X=v.length;if(X<3)continue;let Y=NEt;for(let w=0;w<X;w++){let z=v.barycentricCoordinates[w],K=z.x,te=z.y,H=z.z,$=Math.ceil(K)|Math.ceil(te)<<1|Math.ceil(H)<<2,ee=CAt[$],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[(w+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[w]=le,_e){let he=L/3;p.push(he);let Ze=v.coordinates[w],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],M=Y[1],O=Y[2];a.push(D,M,O);for(let w=3;w<X;w++)M=O,O=Y[w],a.push(D,M,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 QE=Zoe;var tio=x(T(),1);var HH={};HH.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};HH.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)};HH.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=HH;function qg(e){e=e??B.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=me.clone(e.boundingSphere,new me),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:xve(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 yve="createVerticesFromCesium3DTilesTerrain",EAt=new $n(yve),AAt=new $n(yve,ru.maximumAsynchronousTasks);qg.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let n=e.throttle??!0?AAt:EAt,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=me.clone(m._boundingSphere,new me),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=QE.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 Qg(e){e=e??B.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}Qg.prototype.createMesh=function(e){return e=e??B.EMPTY_OBJECT,Promise.resolve(this._mesh)};Qg.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)};Qg.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)};Qg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return xve(i,e,t,n)};Qg.prototype.wasCreatedByUpsampling=function(){return!0};Qg.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(Qg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var GAt=new $n("upsampleVerticesFromCesium3DTilesTerrain",ru.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=QE.upsampleMesh(S),C=new Qg({terrainMesh:R,skirtHeight:p,credits:i});return Promise.resolve(C)}let Z=GAt.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,M=h.clone(C.center,new h),O=me.clone(R.boundingSphere,new me),w=h.clone(R.horizonOcclusionPoint,new h),z=tn.clone(R.orientedBoundingBox,new tn),K=new yc(M,A,N,X,F,Y,D,y,O,w,E,z,C,g,G,V,v),te=new Qg({terrainMesh:K,skirtHeight:p,credits:i});return Promise.resolve(te)})}var LAt=new k,WAt=new k,vAt=new k,FAt=new h;function xve(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,LAt),f=a.decodeTextureCoordinates(s,m,WAt),y=a.decodeTextureCoordinates(s,p,vAt),_=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,FAt);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 gw=qg;var jio=x(T(),1);var Sio=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++)Tve(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++,Tve(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],_ve(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=Eoe(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&_ve(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[Eoe(this,1,2)?1:2]};function JH(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function yw(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Eoe(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Tve(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=yw(e,t,i);for(o!==n&&(JH(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(yw(e,t,r)!==o)break;JH(e,t,r),t=r}}function _ve(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){yw(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;yw(e,u,r)===i&&(r=u)}}if(yw(e,r,t)===i&&(JH(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);Eoe(e,r,a)===i&&JH(e,r,a)}t=r}}var $g=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 BZ({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=Hl.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 IAt=new Array(3);A0.prototype.requestTileGeometry=async function(e,t,n,i){let o=Zve(n,e),r=o===0?this._tileset0:this._tileset1,s=Rve(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 Wb.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=>$_(new Uint8Array(Z))),S=IAt;S[0]=p,S[1]=_,S[2]=u?_.then(Z=>PAt(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(Pm.TILE_MINIMUM_HEIGHT),F=A.getPropertyBySemantic(Pm.TILE_MAXIMUM_HEIGHT),I=A.getPropertyBySemantic(Pm.TILE_BOUNDING_SPHERE),N=me.unpack(I,0,new me),g=A.getPropertyBySemantic(Pm.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=jH(r,R,s,0,0),M=jH(r,R,s,1,0),O=jH(r,R,s,0,1),w=jH(r,R,s,1,1),z=(D?1:0)|(M?2:0)|(O?4:0)|(w?8:0),K=new gw({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=Zve(n,e),r=o===0?this._tileset0:this._tileset1,s=Rve(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 Zve(e,t){let n=1<<e;return t/n|0}function Rve(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 PAt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new ix({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 Gb({uint8Array:new Uint8Array(m.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function jH(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=Aoe(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function Aoe(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 XAt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function BZ(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new $g({comparator:BZ.comparator}),this._provider=e.provider}BZ.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};BZ.prototype.addSubtree=function(e,t){let n=new XAt(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()};BZ.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}};BZ.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=Aoe(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=Sve(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=Sve(r,d,R,C,L);if(c.tileIsAvailableAtCoordinates(F))A=F;else break}return A};function Sve(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=Aoe(e,o,s,a);return t.getDescendantCoordinates(c)}BZ.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Goe=A0;var Xoo=x(T(),1);var uoo=x(T(),1);function ST(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=qH(e.westIndices,o,t),this._southIndices=qH(e.southIndices,r,t),this._eastIndices=qH(e.eastIndices,o,t),this._northIndices=qH(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(ST.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 QH=[];function qH(e,t,n){QH.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)QH[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(QH.sort(t),Oe.createTypedArray(n,QH)):e}var Cve="createVerticesFromQuantizedTerrainMesh",NAt=new $n(Cve),YAt=new $n(Cve,ru.maximumAsynchronousTasks);ST.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?YAt:NAt).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 MAt=new $n("upsampleQuantizedTerrainMesh",ru.maximumAsynchronousTasks);ST.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=MAt.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 ST({quantizedVertices:C,indices:E,encodedNormals:A,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:me.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 Loe=32767,Vve=new h;ST.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Loe;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Loe,l(this._mesh)?DAt(this,i,o):OAt(this,i,o)};function Eve(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 wAt=new k,kAt=new k,UAt=new k;function DAt(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,wAt),b=r.decodeTextureCoordinates(o,u,kAt),f=r.decodeTextureCoordinates(o,m,UAt);if(Eve(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,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}}}}function OAt(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(Eve(t,n,p,y,b,_,f,S)){let Z=Qf.computeBarycentricCoordinates(t,n,p,y,b,_,f,S,Vve);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/Loe)}}}}ST.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};ST.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var zZ=ST;function BAt(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 Gve(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=[]}Gve.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 Lve(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 BAt({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 Foe(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function zAt(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 Foe(e,n);throw new ae(i)}async function HAt(e,t,n){await Lve(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 Foe(e,t){try{let n=await e.layerJsonResource.fetchJson();return HAt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Lve(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):zAt(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 Woe={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Ave(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 KAt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new wc({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 JAt(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 me(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 M=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Oe.createTypedArrayFromArrayBuffer(L,t,a,M);a+=M*y;let w=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Oe.createTypedArrayFromArrayBuffer(L,t,a,w);a+=w*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===Woe.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,L*2);else if(he===Woe.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,Ze);else if(he===Woe.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 zZ({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=Ioe(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)})):Wve(this,e,t,n,r,i)};function Wve(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=Ave(void 0)):d=Ave(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)?KAt(e,f,i,t,n):JAt(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 Gve(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Foe(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(Ioe(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=Ioe(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function voe(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 Ioe(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=voe(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=Wve(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=voe(o,u.x,u.y,u.level)}return{result:!1}}$f._getAvailabilityTile=voe;var HZ=$f;var Ooo=x(T(),1);function ey(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 ud(n),this._workerName="createCircleGeometry"}ey.packedLength=ud.packedLength;ey.pack=function(e,t,n){return ud.pack(e._ellipseGeometry,t,n)};var vve=new ud({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 Me,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};ey.unpack=function(e,t,n){let i=ud.unpack(e,t,vve);return kc.center=h.clone(i._center,kc.center),kc.ellipsoid=ne.clone(i._ellipsoid,kc.ellipsoid),kc.ellipsoid=ne.clone(i._ellipsoid,vve._ellipsoid),kc.height=i._height,kc.extrudedHeight=i._extrudedHeight,kc.granularity=i._granularity,kc.vertexFormat=Me.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 ud(kc),n):(kc.radius=i._semiMajorAxis,new ey(kc))};ey.createGeometry=function(e){return ud.createGeometry(e._ellipseGeometry)};ey.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new ey({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(ey.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Poe=ey;var Qoo=x(T(),1);function qE(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 Ku(n),this._workerName="createCircleOutlineGeometry"}qE.packedLength=Ku.packedLength;qE.pack=function(e,t,n){return Ku.pack(e._ellipseGeometry,t,n)};var jAt=new Ku({center:new h,semiMajorAxis:1,semiMinorAxis:1}),om={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};qE.unpack=function(e,t,n){let i=Ku.unpack(e,t,jAt);return om.center=h.clone(i._center,om.center),om.ellipsoid=ne.clone(i._ellipsoid,om.ellipsoid),om.height=i._height,om.extrudedHeight=i._extrudedHeight,om.granularity=i._granularity,om.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(om.semiMajorAxis=i._semiMajorAxis,om.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Ku(om),n):(om.radius=i._semiMajorAxis,new qE(om))};qE.createGeometry=function(e){return Ku.createGeometry(e._ellipseGeometry)};var Xoe=qE;var $oo=x(T(),1);function QAt(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 xw=QAt;var iro=x(T(),1);function qAt(e){return e=e??B.EMPTY_OBJECT,HZ.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Tw=qAt;var cro=x(T(),1);function $At(e){return e=e??B.EMPTY_OBJECT,HZ.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ne.WGS84})}var KZ=$At;var yro=x(T(),1);function $E(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($E.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}}});$E.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 wc({buffer:c,width:r,height:s})})};$E.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};$E.prototype.getTileDataAvailable=function(e,t,n){};$E.prototype.loadTileDataAvailability=function(e,t,n){};var Noe=$E;var _ro=x(T(),1);var eGt=1953029805,tGt=2917034100;function Yoe(e,t){if(Yoe.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===eGt||o===tGt)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++}Yoe.passThroughDataForTesting=!1;var _w=Yoe;var Zro=x(T(),1);function Fve(e){this.proxy=e}Fve.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Moe=Fve;var vro=x(T(),1);function eA(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(eA.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(){}}});eA.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new wc({buffer:new Uint8Array(256),width:16,height:16}))};eA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};eA.prototype.getTileDataAvailable=function(e,t,n){};eA.prototype.loadTileDataAvailability=function(e,t,n){};var G0=eA;var dso=x(T(),1);var Hro=x(T(),1);var kro=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 woe(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 woe(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return woe(this),this._infinitePerspective}}});var nGt=new h,iGt=new h,oGt=new h,rGt=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,nGt),m=iGt;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=oGt;h.multiplyByScalar(t,d,p),h.add(e,p,p);let b=rGt;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){woe(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 fd=L0;function su(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new fd,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}su.packedLength=6;su.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};su.unpack=function(e,t,n){return t=t??0,l(n)||(n=new su),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(su.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}}});su.prototype.computeCullingVolume=function(e,t,n){return ep(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};su.prototype.getPixelDimensions=function(e,t,n,i,o){return ep(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};su.prototype.clone=function(e){return l(e)||(e=new su),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};su.prototype.equals=function(e){return!l(e)||!(e instanceof su)?!1:(ep(this),ep(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};su.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof su)?!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=su;var $H=0,sGt=1;function JZ(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Me.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof qi?(s=$H,a=qi.packedLength):t instanceof yn&&(s=sGt,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+Me.packedLength}JZ.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===$H?(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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var aGt=new qi,cGt=new yn,lGt=new Ne,dGt=new h,uGt=new Me;JZ.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===$H?(o=qi.unpack(e,t,aGt),t+=qi.packedLength):(o=yn.unpack(e,t,cGt),t+=yn.packedLength);let r=h.unpack(e,t,dGt);t+=h.packedLength;let s=Ne.unpack(e,t,lGt);t+=Ne.packedLength;let a=Me.unpack(e,t,uGt);t+=Me.packedLength;let c=e[t]===1;if(!l(n))return new JZ({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=Me.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function tA(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 mGt=new q,hGt=new P,koe=new P,Ive=new h,Pve=new h,Xve=new h,fGt=new h,pGt=new h,bGt=new h,ZT=new Array(3),Sw=new Array(4);Sw[0]=new ce(-1,-1,1,1);Sw[1]=new ce(1,-1,1,1);Sw[2]=new ce(1,1,1,1);Sw[3]=new ce(-1,1,1,1);var Nve=new Array(4);for(let e=0;e<4;++e)Nve[e]=new ce;JZ._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=q.fromQuaternion(t,mGt),d=r??Ive,u=s??Pve,m=a??Xve;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,hGt),b,f,y=i.projectionMatrix;if(n===$H){let _=P.multiply(y,p,koe);f=P.inverse(_,koe)}else b=P.inverseTransformation(p,koe);l(f)?(ZT[0]=i.near,ZT[1]=i.far):(ZT[0]=0,ZT[1]=i.near,ZT[2]=i.far);for(let _=0;_<2;++_)for(let S=0;S<4;++S){let Z=ce.clone(Sw[S],Nve[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,ZT[_]/C,Z),h.add(Z,e,Z)}else{let R=i.offCenterFrustum;l(R)&&(i=R);let C=ZT[_],E=ZT[_+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}};JZ.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);JZ._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,_=Ive,S=Pve,Z=Xve,R=h.negate(_,fGt),C=h.negate(S,pGt),E=h.negate(Z,bGt);d=0,r&&(tA(d,p,b,f,y,E,_,S),d+=12),tA(d,p,b,f,y,Z,R,S),d+=12,tA(d,p,b,f,y,R,E,S),d+=12,tA(d,p,b,f,y,C,E,R),d+=12,tA(d,p,b,f,y,_,Z,S),d+=12,tA(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:me.fromVertices(c)})};var jZ=JZ;var Rso=x(T(),1);var Uoe=0,gGt=1;function Zw(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof qi?(r=Uoe,s=qi.packedLength):t instanceof yn&&(r=gGt,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}Zw.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Uoe?(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 yGt=new qi,xGt=new yn,TGt=new Ne,_Gt=new h;Zw.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Uoe?(o=qi.unpack(e,t,yGt),t+=qi.packedLength):(o=yn.unpack(e,t,xGt),t+=yn.packedLength);let r=h.unpack(e,t,_Gt);t+=h.packedLength;let s=Ne.unpack(e,t,TGt);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new Zw({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};Zw.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);jZ._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:me.fromVertices(s)})};var Rw=Zw;var Gso=x(T(),1);function eK(){ge.throwInstantiationError()}Object.defineProperties(eK.prototype,{credit:{get:ge.throwInstantiationError}});eK.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Lt.getIonCredit)};eK.prototype.geocode=ge.throwInstantiationError;var nA=eK;var Wso=x(T(),1),Yve={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(Yve);var RT=Yve;var Iso=x(T(),1);function Mve(){ge.throwInstantiationError()}Mve.createGeometry=function(e){ge.throwInstantiationError()};var Doe=Mve;var Xso=x(T(),1);function SGt(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 Cw=SGt;var iao=x(T(),1),AGt=x(Ooe(),1);var Oso=x(T(),1);var wso=x(T(),1);function ZGt(e,t){return(e&t)!==0}var _l=ZGt;var RGt=[1,2,4,8],wve=15,CGt=16,VGt=64,EGt=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,CGt)};W0.prototype.hasImagery=function(){return _l(this._bits,VGt)};W0.prototype.hasTerrain=function(){return _l(this._bits,EGt)};W0.prototype.hasChildren=function(){return _l(this._bits,wve)};W0.prototype.hasChild=function(e){return _l(this._bits,RGt[e])};W0.prototype.getChildBitmask=function(){return this._bits&wve};var Ew=W0;function GGt(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 LGt=GGt(`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\x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88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\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 rm(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(rm.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});rm.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 rm;i._resource=n;try{await WGt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${Uve(i,"",1).url}: ${o}`;throw new ae(r)}return i};rm.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};rm.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}};rm.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 kve=new $n("decodeGoogleEarthEnterprisePacket");rm.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=Uve(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return kve.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=Ew.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}})})};rm.prototype.populateSubtree=function(e,t,n,i){let o=rm.tileXYToQuadKey(e,t,n);return Hoe(this,o,i)};function Hoe(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}),Hoe(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}),Hoe(e,t,s)}).finally(function(){delete a[o]})}rm.prototype.getTileInformation=function(e,t,n){let i=rm.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};rm.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Uve(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Boe,zoe;function WGt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(zoe)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;zoe=qT(n).then(function(){Boe=window.cesiumGoogleEarthDbRootParser(AGt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return zoe.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Boe.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 kve.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Boe.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=LGt})}var ty=rm;var Tao=x(T(),1);function QZ(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(QZ.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Bve="createVerticesFromGoogleEarthEnterpriseBuffer",vGt=new $n(Bve),FGt=new $n(Bve,ru.maximumAsynchronousTasks),Dve=new re,tK=new re;QZ.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,Dve),t.tileXYToRectangle(n,i,o,tK);let d=c.cartographicToCartesian(re.center(tK)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let b=(a?FGt:vGt).scheduleTask({buffer:this._buffer,nativeRectangle:Dve,rectangle:tK,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,tK,me.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})};QZ.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)?YGt(this,i,o):kGt(this,i,o,e)};var IGt=new $n("upsampleQuantizedTerrainMesh",ru.maximumAsynchronousTasks);QZ.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=IGt.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 zZ({quantizedVertices:y,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:me.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})})};QZ.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};QZ.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var PGt=new k,XGt=new k,NGt=new k,zve=new h;function YGt(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,PGt),b=r.decodeTextureCoordinates(o,u,XGt),f=r.decodeTextureCoordinates(o,m,NGt),y=Qf.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,zve);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 MGt=Uint16Array.BYTES_PER_ELEMENT,Ove=Uint32Array.BYTES_PER_ELEMENT,Koe=Int32Array.BYTES_PER_ELEMENT,wGt=Float32Array.BYTES_PER_ELEMENT,Joe=Float64Array.BYTES_PER_ELEMENT;function kGt(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+=Ove;d+=Ove,d+=2*Joe;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=Joe;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=Joe;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+=wGt;let C=new Array(y);for(R=0;R<y;++R)C[R]=c.getUint16(d,!0),d+=MGt;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,zve);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 iA=QZ;var Yao=x(T(),1);var xh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},nK=new Q;function iK(){this._terrainCache={},this._lastTidy=Q.now()}iK.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};iK.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};iK.prototype.tidy=function(){if(Q.now(nK),Q.secondsDifference(nK,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(nK,r.timestamp)>10&&delete e[o]}Q.clone(nK,this._lastTidy)}};function CT(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 iK,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Se}Object.defineProperties(CT.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(){}}});CT.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new CT(t);return n._metadata=e,n};var UGt=new $n("decodeGoogleEarthEnterprisePacket");function Hve(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}CT.prototype.requestTileGeometry=function(e,t,n,i){let o=ty.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 iA({buffer:d,childTileMask:Hve(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 wc({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=DGt(this,m,p,_).fetchArrayBuffer();if(!l(S))return;y=S.then(function(Z){return l(Z)?UGt.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 iA({buffer:S,childTileMask:Hve(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))})};CT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};CT.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=ty.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};CT.prototype.loadTileDataAvailability=function(e,t,n){};function DGt(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 joe=CT;var Bao=x(T(),1);var OGt="https://maps.googleapis.com/maps/api/geocode/json",Kve='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function Qoe(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._resource=new ve({url:OGt,queryParameters:{key:t}}),this._credit=new Lt(Kve,!0)}Object.defineProperties(Qoe.prototype,{credit:{get:function(){return this._credit}}});Qoe.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:Kve,collapsible:!1}}})};var qoe=Qoe;var eco=x(T(),1);var Hao=x(T(),1);function BGt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Aw=BGt;var c2e={},zGt=32.184,HGt=2451545,Jve=-.0529921,jve=-.1059842,Qve=13.0120009,qve=13.3407154,$ve=.9856003,e2e=26.4057084,t2e=13.064993,n2e=.3287146,i2e=1.7484877,o2e=-.1589763,r2e=.0036096,s2e=.1643573,a2e=12.9590088,$oe=new Q;c2e.ComputeMoon=function(e,t){l(e)||(e=Q.now()),$oe=Q.addSeconds(e,zGt,$oe);let n=Q.totalDays($oe)-HGt,i=n/wn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Jve*n)*W.RADIANS_PER_DEGREE,r=(250.089+jve*n)*W.RADIANS_PER_DEGREE,s=(260.008+Qve*n)*W.RADIANS_PER_DEGREE,a=(176.625+qve*n)*W.RADIANS_PER_DEGREE,c=(357.529+$ve*n)*W.RADIANS_PER_DEGREE,d=(311.589+e2e*n)*W.RADIANS_PER_DEGREE,u=(134.963+t2e*n)*W.RADIANS_PER_DEGREE,m=(276.617+n2e*n)*W.RADIANS_PER_DEGREE,p=(34.226+i2e*n)*W.RADIANS_PER_DEGREE,b=(15.134+o2e*n)*W.RADIANS_PER_DEGREE,f=(119.743+r2e*n)*W.RADIANS_PER_DEGREE,y=(239.961+s2e*n)*W.RADIANS_PER_DEGREE,_=(25.053+a2e*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),M=Math.cos(c),O=Math.cos(d),w=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*w+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*Jve+.1208*X*jve-.0642*Y*Qve+.0158*D*qve+.0252*M*$ve-.0066*O*e2e-.0047*w*t2e-.0046*z*n2e+.0028*K*i2e+.0052*te*o2e+.004*H*r2e+.0019*$*s2e-.0044*ee*a2e)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new Aw),t.rightAscension=le,t.declination=_e,t.rotation=he,t.rotationRate=Ze,t};var Gw=c2e;var lco=x(T(),1);function l2e(e){(!l(e)||typeof e!="function")&&(e=Gw.ComputeMoon),this._computeFunction=e}var KGt=new h,JGt=new h,jGt=new h;function QGt(e,t,n){let i=KGt;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=jGt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,JGt);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 qGt=new q,$Gt=new Ne;l2e.prototype.evaluate=function(e,t){l(e)||(e=Q.now());let n=this._computeFunction(e),i=QGt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Ne.fromAxisAngle(h.UNIT_Z,o,$Gt),s=q.fromQuaternion(Ne.conjugate(r,r),qGt);return q.multiply(s,i,i)};var Lw=l2e;var mco=x(T(),1);var ere=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()}},tre=ere;var pco=x(T(),1),d2e={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(d2e);var ny=d2e;var vco=x(T(),1);var Sco=x(T(),1);function nre(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(nre.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});nre.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===RT.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 Ww=nre;function eLt(e){if(!Object.values(ny).some(t=>t===e))throw new ge(`Invalid geocodeProviderType: "${e}"`)}var u2e=Object.freeze({[ny.GOOGLE]:"google",[ny.BING]:"bing",[ny.DEFAULT]:void 0});function tLt(e){return u2e[e]}function nLt(e){return Object.entries(u2e).find(t=>t[1]===e)[0]}function ire(e){e=e??B.EMPTY_OBJECT;let t=e.geocodeProviderType??ny.DEFAULT,n=e.accessToken??vd.defaultAccessToken,i=ve.createIfNeeded(e.server??vd.defaultServer);i.appendForwardSlash();let o=vd.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 Ww(r),this.geocodeProviderType=t}Object.defineProperties(ire.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return nLt(this._pelias.url.queryParameters.geocoder)},set:function(e){eLt(e);let t={...this._pelias.url.queryParameters,geocoder:tLt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});ire.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var qZ=ire;var Ico=x(T(),1),m2e={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(m2e);var ore=m2e;var Xco=x(T(),1),h2e={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(h2e);var rre=h2e;var Yco=x(T(),1),f2e={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(f2e);var vw=f2e;var wco=x(T(),1),p2e={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(p2e);var sre=p2e;var elo=x(T(),1);function b2e(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function g2e(e){let t=pe.fromCartesian(e);return{longitude:W.toDegrees(t.longitude),latitude:W.toDegrees(t.latitude),height:t.height}}function iLt(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 oLt(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 rLt=new P,sLt=new P,oK=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??vd.defaultAccessToken,o=ve.createIfNeeded(n.server??vd.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=oLt(n,i,rLt);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,sLt),i={testPoint:g2e(t.testPoint),closePoint:g2e(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??vw.NEAREST,worldToView:iLt(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=b2e(o.snapPoint),r.hitPoint=b2e(o.hitPoint),r}};oK.DEFAULT_SNAP_APERTURE=12;var are=oK;var rlo=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 alo=x(T(),1),y2e={SHIFT:0,CTRL:1,ALT:2};Object.freeze(y2e);var ir=y2e;var dlo=x(T(),1);var cre=class{constructor(){mt(this,"ellipsoid")}project(t,n){ge.throwInstantiationError()}unproject(t,n){ge.throwInstantiationError()}},lre=cre;var hlo=x(T(),1);var dre=[],ure=[];function aLt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=dre,d=ure,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 mre(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);mre(e,t,n,i,r),mre(e,t,n,r+1,o),aLt(e,t,n,i,r,o)}function cLt(e,t,n){let i=e.length,o=Math.ceil(i*.5);dre.length=o,ure.length=o,mre(e,t,n,0,i-1),dre.length=0,ure.length=0}var v0=cLt;var ylo=x(T(),1);function oA(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(oA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});oA.prototype.findTimeInterval=vo.prototype.findTimeInterval;oA.prototype.wrapTime=vo.prototype.wrapTime;oA.prototype.clampTime=vo.prototype.clampTime;oA.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 hre=oA;var Glo=x(T(),1);var Tlo=x(T(),1),x2e={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(x2e);var Jr=x2e;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 rK=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,rK),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,rK);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,rK),rK)}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 _2e=new h;Sl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,_2e),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 lLt=new h;Sl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,lLt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,_2e),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 dLt=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,dLt),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 sK=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,sK),sK),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,sK),sK)};var uLt=[];Sl.computeOccludeePointFromRectangle=function(e,t){t=t??ne.default;let n=re.subsample(e,t,0,uLt),i=me.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Sl.computeOccludeePoint(new me(o,t.minimumRadius),i.center,n)};var mLt=new h;Sl._anyRotationVector=function(e,t,n){let i=h.abs(t,mLt),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 hLt=new h;Sl._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,hLt);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 fre=new h,fLt=new h,aK=new h,T2e=new h;Sl._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,fre),s=h.clone(e.center,fLt),a=e.radius,c=h.subtract(s,r,aK),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,_,T2e),T2e),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,fre);C=h.normalize(C,C);let E=h.multiplyByScalar(C,Z,fre);R=h.normalize(h.subtract(h.add(S,E,aK),s,aK),aK);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 Fw=Sl;var Nlo=x(T(),1);function pre(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(pre.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});pre.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 bre=pre;var wlo=x(T(),1);var pLt={packedLength:void 0,pack:ge.throwInstantiationError,unpack:ge.throwInstantiationError},gre=pLt;var Dlo=x(T(),1);var bLt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:ge.throwInstantiationError,unpackInterpolationResult:ge.throwInstantiationError},yre=bLt;var Klo=x(T(),1);var gLt=new h;function yLt(e,t,n,i){let o=r_(e,t,n,i,gLt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var xre=yLt;var Qlo=x(T(),1);function S2e(){ge.throwInstantiationError()}S2e.prototype.getURL=ge.throwInstantiationError;var Tre=S2e;var edo=x(T(),1);async function xLt(e,t,n,i){return l(i)||(i=!1),SLt(e,t,n,i)}function TLt(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(R2e(i)):r=o.then(R2e(i)).catch(ZLt(i)),e.shift(),t.push(r),!0}function _Lt(e){return new Promise(function(t){setTimeout(t,e)})}function _re(e,t,n){return e.length?TLt(e,t,n)?_re(e,t,n):_Lt(100).then(()=>_re(e,t,n)):Promise.resolve()}function SLt(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 _re(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Z2e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function R2e(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(!Z2e(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];Z2e(s,i,n)}}):Promise.resolve()}}function ZLt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var Iw=xLt;var rdo=x(T(),1);var Sre=new k;async function C2e(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,Sre);let p=e.loadTileDataAvailability(Sre.x,Sre.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 Iw(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 C2e(e,a,n),t}var $Z=C2e;var gdo=x(T(),1);var ado=x(T(),1),V2e={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(V2e);var mn=V2e;function VT(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 Are(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function eR(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 sm(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 RLt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(sm(e,"pointerdown",t,LLt),sm(e,"pointerup",t,X2e),sm(e,"pointermove",t,WLt),sm(e,"pointercancel",t,X2e)):(sm(e,"mousedown",t,N2e),sm(e,"mouseup",n,Y2e),sm(e,"mousemove",n,M2e),sm(e,"touchstart",t,ALt),sm(e,"touchend",n,W2e),sm(e,"touchmove",n,GLt),sm(e,"touchcancel",n,W2e)),sm(e,"dblclick",t,VLt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",sm(e,i,t,ELt)}function CLt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var E2e={position:new k};function Gre(e){e._lastSeenTouchEvent=Zn()}function Lre(e){return Zn()-e._lastSeenTouchEvent>tp.mouseEmulationIgnoreMilliseconds}function Ere(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function N2e(e,t){if(!Lre(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=VT(e,t,e._primaryPosition);k.clone(o,e._primaryStartPosition),k.clone(o,e._primaryPreviousPosition);let r=eR(t),s=e.getInputAction(i,r);l(s)&&(k.clone(o,E2e.position),s(E2e),t.preventDefault())}var A2e={position:new k},G2e={position:new k};function Zre(e,t,n,i){let o=eR(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=VT(e,i,e._primaryPosition);if(l(r)&&(k.clone(a,A2e.position),r(A2e)),l(s)){let c=e._primaryStartPosition;Ere(c,a,e._clickPixelTolerance)&&(k.clone(a,G2e.position),s(G2e))}}}function Y2e(e,t){if(!Lre(e))return;let n=t.button;n!==Fs.LEFT&&n!==Fs.MIDDLE&&n!==Fs.RIGHT||(e._buttonDown[Fs.LEFT]&&(Zre(e,mn.LEFT_UP,mn.LEFT_CLICK,t),e._buttonDown[Fs.LEFT]=!1),e._buttonDown[Fs.MIDDLE]&&(Zre(e,mn.MIDDLE_UP,mn.MIDDLE_CLICK,t),e._buttonDown[Fs.MIDDLE]=!1),e._buttonDown[Fs.RIGHT]&&(Zre(e,mn.RIGHT_UP,mn.RIGHT_CLICK,t),e._buttonDown[Fs.RIGHT]=!1))}var Rre={startPosition:new k,endPosition:new k};function M2e(e,t){if(!Lre(e))return;let n=eR(t),i=VT(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(mn.MOUSE_MOVE,n);l(r)&&(k.clone(o,Rre.startPosition),k.clone(i,Rre.endPosition),r(Rre)),k.clone(i,o),(e._buttonDown[Fs.LEFT]||e._buttonDown[Fs.MIDDLE]||e._buttonDown[Fs.RIGHT])&&t.preventDefault()}var L2e={position:new k};function VLt(e,t){let n=t.button,i;if(n===Fs.LEFT)i=mn.LEFT_DOUBLE_CLICK;else return;let o=eR(t),r=e.getInputAction(i,o);l(r)&&(VT(e,t,L2e.position),r(L2e))}function ELt(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=eR(t),o=e.getInputAction(mn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function ALt(e,t){Gre(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,VT(e,r,new k));cK(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 W2e(e,t){Gre(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);cK(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var v2e={position:new k},Cre={position1:new k,position2:new k},F2e={position:new k},I2e={position:new k},P2e={position:new k};function cK(e,t){let n=eR(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,F2e.position),r(F2e)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(mn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Ere(c,d,e._clickPixelTolerance)&&(k.clone(e._primaryPosition,I2e.position),s(I2e))}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,v2e.position),r(v2e)),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];Ere(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],Cre.position1),k.clone(i.values[1],Cre.position2),r(Cre),t.preventDefault()))}function GLt(e,t){Gre(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)&&VT(e,r,d)}w2e(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 Vre={startPosition:new k,endPosition:new k},Pw={distance:{startPosition:new k,endPosition:new k},angleAndHeight:{startPosition:new k,endPosition:new k}};function w2e(e,t){let n=eR(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,Vre.startPosition),k.clone(a,Vre.endPosition),s(Vre)),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,_,Pw.distance.startPosition),k.fromElements(0,b,Pw.distance.endPosition),k.fromElements(C,Z,Pw.angleAndHeight.startPosition),k.fromElements(R,S,Pw.angleAndHeight.endPosition),s(Pw)}}function LLt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,VT(e,t,new k)),cK(e,t),e._previousPositions.set(i,k.clone(n.get(i)))}else N2e(e,t)}function X2e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),cK(e,t),e._previousPositions.remove(i)}else Y2e(e,t)}function WLt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;VT(e,t,o),w2e(e,t);let r=e._previousPositions;k.clone(n.get(i),r.get(i))}else M2e(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 wt,this._previousPositions=new wt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,RLt(this)}tp.prototype.setInputAction=function(e,t,n){let i=Are(t,n);this._inputEvents[i]=e};tp.prototype.getInputAction=function(e,t){let n=Are(e,t);return this._inputEvents[n]};tp.prototype.removeInputAction=function(e,t){let n=Are(e,t);delete this._inputEvents[n]};tp.prototype.isDestroyed=function(){return!1};tp.prototype.destroy=function(){return CLt(this),ue(this)};tp.mouseEmulationIgnoreMilliseconds=800;tp.touchHoldDelayMilliseconds=1500;var la=tp;var Ido=x(T(),1);function vLt(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 Xw(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}Xw.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};Xw.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 Xw({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var lK=new Array(2),dK=new Array(2),FLt={positions:lK,height:dK,ellipsoid:void 0,minDistance:void 0,granularity:void 0};Xw.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=FLt;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=lK,F.height=dK;let N=0;for(d=0;d<u-1;++d){lK[0]=t[d],lK[1]=t[d+1],dK[0]=L[d],dK[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=vLt(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:me.fromPoints(t)})};var Wre=Xw;var Ndo=x(T(),1);var uK=class{constructor(){ge.throwInstantiationError()}async snap(t){ge.throwInstantiationError()}};uK.DEFAULT_SNAP_APERTURE=void 0;var vre=uK;var Ddo=x(T(),1);function rA(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"}rA.packedLength=Ha.packedLength;rA.pack=function(e,t,n){return Ha.pack(e._ellipsoidGeometry,t,n)};var ILt=new Ha,ET={radius:void 0,radii:new h,vertexFormat:new Me,stackPartitions:void 0,slicePartitions:void 0};rA.unpack=function(e,t,n){let i=Ha.unpack(e,t,ILt);return ET.vertexFormat=Me.clone(i._vertexFormat,ET.vertexFormat),ET.stackPartitions=i._stackPartitions,ET.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,ET.radii),n._ellipsoidGeometry=new Ha(ET),n):(ET.radius=i._radii.x,new rA(ET))};rA.createGeometry=function(e){return Ha.createGeometry(e._ellipsoidGeometry)};var Nw=rA;var Bdo=x(T(),1);function PLt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var tR=PLt;var Hdo=x(T(),1),XLt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Gn=XLt;var jdo=x(T(),1);var Fre=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()}},Ire=Fre;var ouo=x(T(),1);function nR(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(nR.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(nR.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=NLt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});nR.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};nR.prototype.isDestroyed=function(){return!1};nR.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};nR.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 NLt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Pre=nR;var Tuo=x(T(),1);function YLt(e,t){this.rectangle=e,this.maxLevel=t}function k2e(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=[]}k2e.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 MLt(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 YLt(new re(a,c,d,u),m))}}function wLt(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 kLt(e,t,n){try{let i=await t.fetchXML();MLt(e,i)}catch(i){wLt(t,i,n)}}function AT(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(AT.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(){}}});AT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=new k2e(t),i=ve.createIfNeeded(e);await kLt(n,i);let o=new AT(t);return n.build(o),o._resource=i,o};AT.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 wc({buffer:Fh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:ULt(a,e,t,n),structure:a._terrainDataStructure})})};AT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var U2e=new re;function ULt(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,U2e);l(m)&&(mK(o,u,t*2,n*2,i+1)&&(a|=4),mK(o,u,t*2+1,n*2,i+1)&&(a|=8),mK(o,u,t*2,n*2+1,i+1)&&(a|=1),mK(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function mK(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(re.intersection(r,t,U2e))}AT.prototype.getTileDataAvailable=function(e,t,n){};AT.prototype.loadTileDataAvailability=function(e,t,n){};var Xre=AT;var Suo=x(T(),1),D2e={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(D2e);var Nre=D2e;var Cuo=x(T(),1);function DLt(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 Yre=DLt;var Euo=x(T(),1);function OLt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var Yw=OLt;var Xuo=x(T(),1);function iR(){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(iR.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 O2e(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 BLt(e,t){O2e(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 B2e(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 zLt(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 HLt(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 KLt(e,t){B2e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(HLt(r,i),{framebuffer:n[r].framebuffer,uniformMap:zLt(e,r)});e._commands=o}iR.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new mi({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)};iR.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,BLt(this,e),KLt(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};iR.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)};iR.prototype.isDestroyed=function(){return!1};iR.prototype.destroy=function(){return O2e(this),B2e(this),ue(this)};var Mw=iR;var wuo=x(T(),1);var JLt=new h(1,1,1);function Mre(e){e=e??JLt,this._dimensions=h.clone(e)}Object.defineProperties(Mre.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var jLt=new h;Mre.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,jLt),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 wre=Mre;var emo=x(T(),1);var Uuo=x(T(),1),ww=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float phi = 2.0 * M_PI * xi.x; +float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); +vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); +vec3 tangentX = normalize(cross(upVector, N)); +vec3 tangentY = cross(N, tangentX); +return tangentX * H.x + tangentY * H.y + N * H.z; +} +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +{ +float alphaRoughnessSq = alphaRoughness * alphaRoughness; +float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); +float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); +float GGX = GGXV + GGXL; +if (GGX > 0.0) +{ +return 0.5 / GGX; +} +return 0.0; +} +vec2 integrateBrdf(float roughness, float NdotV) +{ +vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); +float A = 0.0; +float B = 0.0; +const int NumSamples = 1024; +float alphaRoughness = roughness * roughness; +for (int i = 0; i < NumSamples; i++) +{ +vec2 xi = hammersley2D(i, NumSamples); +vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); +vec3 L = 2.0 * dot(V, H) * H - V; +float NdotL = clamp(L.z, 0.0, 1.0); +float NdotH = clamp(H.z, 0.0, 1.0); +float VdotH = clamp(dot(V, H), 0.0, 1.0); +if (NdotL > 0.0) +{ +float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); +float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; +float Fc = pow(1.0 - VdotH, 5.0); +A += (1.0 - Fc) * G_Vis; +B += Fc * G_Vis; } -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); +return vec2(A, B) / float(NumSamples); } -#endif -`;var{Material:Xit,MetallicRoughness:gq,SpecularGlossiness:yq,Specular:uxe,Clearcoat:mxe}=Rn,hxe={name:"MaterialPipelineStage",_processTexture:Od,_processTextureTransform:fxe};hxe.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;kit(i,r,s,d,u,m,c,e),l(i.specularGlossiness)?Uit(i.specularGlossiness,r,s,d,c,e):(l(i.specular)&&Zt.supportedExtensions.KHR_materials_specular&&Dit(i.specular,r,s,d,c),l(i.anisotropy)&&Zt.supportedExtensions.KHR_materials_anisotropy&&Bit(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Zt.supportedExtensions.KHR_materials_clearcoat&&zit(i.clearcoat,r,s,d,c),Hit(i.metallicRoughness,r,s,d,c,e));let p=Zt.getAttributeBySemantic(t,dt.NORMAL),b=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading;l(i.planarFill)&&Nit(i.planarFill,t,e,n);let f=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||b||f?y.lightingModel=Jp.UNLIT:y.lightingModel=Jp.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let S=e.alphaOptions;i.alphaMode===_p.BLEND?S.pass=Le.TRANSLUCENT:i.alphaMode===_p.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)&&Mit(i.lineStyle,t,n,r,s),s.addFragmentLines(sP),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,fe.BOTH)};function Nit(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 Yit(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(cP);let d=aP.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 Mit(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) +void main() { - float cumDist = attributes.${d}; -#ifdef LINE_CUM_DIST_NORMALIZED - cumDist *= u_cumulativeDistanceMax; -#endif - const float textureCoordinateBase = 8192.0; - v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; +out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } -#endif -`)}else l(s)&&o.addVertexLines(` -#ifdef HAS_LINE_PATTERN -void lineStyleStageVS(in ProcessedAttributes attributes) +`;function kw(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(kw.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function QLt(e,t,n){let i=t.createViewportQuadCommand(ww,{framebuffer:n,renderState:ze.fromCache({viewport:new nt(0,0,256,256)})});e._drawCommand=i}kw.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});QLt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};kw.prototype.isDestroyed=function(){return!1};kw.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var Uw=kw;var hmo=x(T(),1);var kre=0,z2e=new h,hK=new h,qLt=new Xr;function $Lt(e,t,n){let i=t.tileX,o=t.tileY,r=t.tileZ,s=n?.featureIdProperty,a=qLt.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 M=(4-Z%4)%4;M>0&&(S.push(new Uint8Array(M)),Z+=M)}function C(M,O){R();let w=Z;S.push(new Uint8Array(M.buffer,M.byteOffset,M.byteLength)),Z+=M.byteLength;let z=y.length;return y.push({buffer:0,byteOffset:w,byteLength:M.byteLength,target:O}),z}function E(M,O){let w=C(M,O.target),z=St.getComponentCount(O.type),K={bufferView:w,byteOffset:0,componentType:O.componentType,count:M.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(M){let O=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,z=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,te=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY;for(let $=0;$<M.length;$+=3){let ee=M[$],le=M[$+1],_e=M[$+2];ee<O&&(O=ee),le<w&&(w=le),_e<z&&(z=_e),ee>K&&(K=ee),le>te&&(te=le),_e>H&&(H=_e)}return{min:[O,w,z],max:[K,te,H]}}function L(M,O,w){if(w.length===0)return;let z=new Uint32Array(w),K=E(z,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER});M._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(M,O){O=O??4;let w=(O-Z%O)%O;w>0&&(S.push(new Uint8Array(w)),Z+=w);let z=Z;S.push(M),Z+=M.byteLength;let K=y.length;return y.push({buffer:0,byteOffset:z,byteLength:M.byteLength}),K}function I(){if(f.size===0)return;let M=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=M.get(te);l(le)?le!==ee&&M.set(te,"STRING"):M.set(te,ee)}if(M.size===0)return;let O={};for(let[K,te]of M)te==="SCALAR"?O[K]={type:"SCALAR",componentType:"FLOAT64"}:te==="BOOLEAN"?O[K]={type:"BOOLEAN"}:O[K]={type:"STRING"};let w={},z=b.size;for(let[K,te]of M)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);w[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($);w[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));w[K]={values:Ze,stringOffsets:ye,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:O}}},propertyTables:[{class:"mvt_feature",count:z,properties:w}]}}let N=[],g=[],V=[d.x,d.y,d.z];for(let M of e.layers){let O=M.extent,w=[],z=[],K=[],te=[],H=[],$=0,ee=[],le=[],_e=[],he=[],Ze=[],ye=[],Ge=[],Ae=0;for(let Be of M.features){let je=l(s)?tWt(Be,s,b)??m:eWt(Be,b);if(je!==m&&!f.has(je)){let qe=Object.assign({},Be.properties);qe._layer=M.name??"",f.set(je,qe)}if(Be.type==="Point"){let qe=Be.geometry;for(let We of qe)Ure(We,i,o,r,O,kre,d,w),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)Ure(ct,i,o,r,O,kre,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=nWt(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 Mi=ct[pt];pt>0&&ut.push(bt);for(let jn of Mi)Et.push(new k(jn.x,jn.y)),Ure(jn,i,o,r,O,kre,d,zt),bt++}if(Et.length<3)continue;let ht=hi.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(w.length===0&&K.length===0&&ee.length===0)continue;H.length>0&&H[H.length-1]===p&&H.pop();let Fe=[];if(w.length>0){let Be=new Float32Array(w),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,Mi={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(Mi,jn,le),Fe.push({mode:Ie.TRIANGLES,indices:bt,attributes:Mi,extensions:jn})}if(Fe.length===0)continue;let tt=N.length;N.push({primitives:Fe}),g.push({name:M.name,mesh:tt,translation:V})}if(g.length===0)return;let G=I(),v=sWt(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((M,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}),rWt(D,v)}function eWt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function tWt(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 nWt(e){let t=[];for(let n of e){let i=oWt(n);if(i.length<3)continue;iWt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function iWt(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 oWt(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 Ure(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,z2e),h.subtract(z2e,s,hK),a.push(hK.x,hK.y,hK.z)}function rWt(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 sWt(e,t){let n=new Uint8Array(t),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n}var Dw=$Lt;var eho=x(T(),1);var Xmo=x(T(),1);var pmo=x(T(),1),H2e={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(H2e);var F0=H2e;var Vmo=x(T(),1);function sA(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}sA.prototype.getTexture=function(e){return this._textures[e]};function aWt(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})}sA.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):aWt(this,e,t)};function cWt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?fK(o,r,n):lWt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function fK(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?J2e(e,n):new vt({context:n,source:t,sampler:o});return K2e(o)&&r.generateMipmap(),r}function lWt(e,t,n){let{typedArray:i,sampler:o}=e,r=K2e(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=Cw(i,a,c),p=nx(m);return fK({sampler:o},p,n)}}else{let m=nx(t);return fK(e,m,n)}else return fK(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."),J2e(e,n)}function K2e(e){return[Ht.NEAREST_MIPMAP_NEAREST,Ht.NEAREST_MIPMAP_LINEAR,Ht.LINEAR_MIPMAP_NEAREST,Ht.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function J2e(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})}sA.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];cWt(this,o,t)}n.length=0};sA.prototype.isDestroyed=function(){return!1};sA.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 Ow=sA;function Bw(e){e=e??B.EMPTY_OBJECT,this.mode=e.mode??Bb.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??yx.INHERIT,this._textureManager=new Ow,this._defaultTexture=void 0,this.uniformMap=dWt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},hWt(this),fWt(this)}function dWt(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]=uWt(e,i)):n[i]=mWt(e,i)}return n}function uWt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function mWt(e,t){return function(){return e.uniforms[t].value}}function oR(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function hWt(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,oR(r,t,o),o=e.usedVariablesVertex.featureIdSet,oR(r,n,o),o=e.usedVariablesVertex.metadataSet,oR(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,oR(s,t,o),o=e.usedVariablesFragment.featureIdSet,oR(s,n,o),o=e.usedVariablesFragment.metadataSet,oR(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;oR(s,a,c)}}function j2e(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=`${j2e(t)} is not available in the ${i} shader. Did you mean ${j2e(n)} instead?`;throw new ge(o)}}function fWt(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")}Bw.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};Bw.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};Bw.prototype.isDestroyed=function(){return!1};Bw.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var I0=Bw;var Omo=x(T(),1);function pWt(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 zw=pWt;function bWt(e){let{names:t,types:n,componentTypes:i,minimumValues:o,maximumValues:r}=e;for(let s=0;s<t.length;s++){if(!gWt(o?.[s],r?.[s]))continue;let a=yWt(t[s],n[s],i[s],o[s],r[s]);if(l(a))return a}}function gWt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function yWt(e,t,n,i,o){if(t===St.VEC4&&n===Nt.FLOAT32)return xWt(e,i,o);if(t===St.SCALAR&&n===Nt.FLOAT32)return TWt(e,i,o)}function xWt(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) { - vec4 posClip = gl_Position; - vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw; + material.diffuse = fsInput.metadata.${e}.rgb; + material.alpha = fsInput.metadata.${e}.a; +}`})}function TWt(e,t,n){let o=xw([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 zw({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; - const float textureCoordinateBase = 8192.0; - if (czm_viewport.z > czm_viewport.w) { - v_lineCoord = textureCoordinateBase + screenPos.x; - } else { - v_lineCoord = textureCoordinateBase + screenPos.y; - } + 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 aA=bWt;var Ufo=x(T(),1);var rho=x(T(),1);function _Wt(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=pK(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=pK(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=pK(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=pK(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=ZWt(v,Y),M=s[V][Y],O=a[V][Y];!l(M)||!l(O)||n.addFunctionLines(g,[`${p}.${G}.min${D} = ${Q2e(M)};`,`${p}.${G}.max${D} = ${Q2e(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=SWt(G,v);n.addFunctionLines(g,[`properties.${i[V]} = texture(u_megatextureTextures[${V}], texcoord)${X};`])}n.addFunctionLines(g,[`return ${N};`])}}function pK(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 SWt(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 Q2e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function ZWt(e,t){return e===St.SCALAR?"":`[${t}]`}var Hw=_Wt;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?q2e:$2e,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function q2e(e){return e===qt.OUTSIDE}function $2e(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?q2e:$2e)}},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 eFe(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 eFe(this._planes,e)!==-1};np.prototype.remove=function(e){let t=this._planes,n=eFe(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 RWt=new cn(h.fromElements(1,0,0),0);function CWt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:s,distance:a}=EWt(i[r],t,RWt);n[o]=s.x,n[o+1]=s.y,n[o+2]=s.z,n[o+3]=a,o+=4}}var Dre=new ce,VWt=new h;function EWt(e,t,n){let{normal:i,distance:o}=e,r=ce.fromElements(i.x,i.y,i.z,o,Dre),s=P.multiplyByVector(t,r,Dre),a=h.fromCartesian4(s,VWt);return s=ce.divideByScalar(s,h.magnitude(a),Dre),cn.fromCartesian4(s,n)}function tFe(e,t){return t.x=Math.min(e,kt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var AWt=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=tFe(i,AWt);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;CWt(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=tFe(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(),ue(this)};var iy=np;var Efo=x(T(),1);var Cho=x(T(),1),Kw=`struct Ray { +vec3 pos; +vec3 dir; +}; +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); +} +`;var Eho=x(T(),1),Jw=`#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 -`)}function fxe(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 wit(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 Od(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)&&fxe(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&wit(e,t,n,i,o),Yit(e,t,n,i,o,s)}function kit(e,t,n,i,o,r,s,a){let{emissiveFactor:c,emissiveTexture:d,normalTexture:u,occlusionTexture:m}=e;l(c)&&!h.equals(c,Xit.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&&Od(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),Od(n,t,b,"u_normalTexture","NORMAL",o,a)}l(m)&&!s&&Od(n,t,m,"u_occlusionTexture","OCCLUSION",i)}function Uit(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&&Od(n,t,s,"u_diffuseTexture","DIFFUSE",i,r),l(a)&&!ce.equals(a,yq.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&&Od(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(d)&&!h.equals(d,yq.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!==yq.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 Dit(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&&Od(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==uxe.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&&Od(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,uxe.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 Oit=new h;function Bit(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,fe.FRAGMENT),l(a)&&!o&&Od(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,Oit)}}function zit(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!==mxe.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&&Od(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==mxe.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&&Od(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Od(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Hit(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,fe.FRAGMENT);let s=e.baseColorTexture;l(s)&&!o&&Od(n,t,s,"u_baseColorTexture","BASE_COLOR",i,r);let a=e.baseColorFactor;l(a)&&!ce.equals(a,gq.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&&Od(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let d=e.metallicFactor;l(d)&&d!==gq.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!==gq.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 lP=hxe;var f8n=x(T(),1);var ql={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"};ql.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ql.METADATA_PICKING_VALUE_TYPE,"float",fe.FRAGMENT),i.addDefine(ql.METADATA_PICKING_VALUE_STRING,"0.0",fe.FRAGMENT),i.addDefine(ql.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",fe.FRAGMENT),i.addDefine(ql.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",fe.FRAGMENT),i.addDefine(ql.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",fe.FRAGMENT),i.addDefine(ql.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",[`${ql.METADATA_PICKING_VALUE_TYPE} value = ${ql.METADATA_PICKING_VALUE_TYPE}(${ql.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ql.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ql.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ql.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ql.METADATA_PICKING_VALUE_COMPONENT_W};`],fe.FRAGMENT)};var Xu=ql;var R8n=x(T(),1);var b8n=x(T(),1),dP=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ -vec3 positionMC = attributes.positionMC; -attributes.positionMC = getMorphedPosition(positionMC); -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = getMorphedNormal(normalMC); -#endif -#ifdef HAS_TANGENTS -vec3 tangentMC = attributes.tangentMC; -attributes.tangentMC = getMorphedTangent(tangentMC); +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); } -`;var Pc={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)"};Pc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,fe.VERTEX),$it(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||(Jit(e,m,e.attributeIndex,a),e.attributeIndex++)}}eot(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,fe.VERTEX),n.addVertexLines(dP);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=It(s,e.uniformMap)};var Kit={attributeString:void 0,functionId:void 0};function Jit(e,t,n,i){let o=e.shaderBuilder;jit(e,t,n);let r=Qit(t,Kit);qit(o,r,i)}function jit(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 Qit(e,t){switch(e.semantic){case dt.POSITION:t.attributeString="Position",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_POSITION;break;case dt.NORMAL:t.attributeString="Normal",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case dt.TANGENT:t.attributeString="Tangent",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function qit(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 $it(e){e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_POSITION,Pc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,Pc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,Pc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function eot(e){e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var uP=Pc;var I8n=x(T(),1);var pxe={name:"PickingPipelineStage"};function xq(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}pxe.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)tot(e,t,a,i);else if(l(a))not(e,i);else{let c=bxe(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=xq(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function bxe(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 tot(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=xq(e.pickId)}function not(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=bxe(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=it.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=xq(e.pickId)}var mP=pxe;var n6n=x(T(),1);var X8n=x(T(),1),gxe={ADD:0,REPLACE:1};Object.freeze(gxe);var yr=gxe;var Y8n=x(T(),1),hP=`float getPointSizeFromAttenuation(vec3 positionEC) { -float pointSize = model_pointCloudParameters.x; -float geometricError = model_pointCloudParameters.y; -float depthMultiplier = model_pointCloudParameters.z; -float depth = -positionEC.z; -return min((geometricError / depth) * depthMultiplier, pointSize); +#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); } -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); +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; } -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); +float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); +return vec4(entry.xyz, stepSize); } -#endif -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +vec2 packIntToVec2(int value) { +float shifted = float(value) / 255.0; +float lowBits = fract(shifted); +float highBits = floor(shifted) / 255.0; +return vec2(highBits, lowBits); } -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -return getPointSizeFromAttenuation(v_positionEC); +vec2 packFloatToVec2(float value) { +float lowBits = fract(value); +float highBits = floor(value) / 255.0; +return vec2(highBits, lowBits); +} +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); +} +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() +{ +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; } +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 -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { -#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) -return step(-v_normalEC.z, 0.0); +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 -return 1.0; -#endif +shapeIntersection = nextIntersection(ix); +if (shapeIntersection.entry.w == NO_HIT) { +break; +} else { +currentT = shapeIntersection.entry.w; +endT = shapeIntersection.exit.w; } #endif -`;var iot=new ce,xxe={name:"PointCloudStylingPipelineStage"};xxe.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=aot(a),_=cot(r,y);lot(i,_);let Z=dot(_).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===yr.ADD),i.addUniform("vec4","model_pointCloudParameters",fe.VERTEX),i.addVertexLines(hP);let f=e.uniformMap;f.model_pointCloudParameters=function(){let y=iot,_=1;p&&(_=b?5:m.tileset.memoryAdjustedScreenSpaceError),y.x=u.maximumAttenuation??_,y.x*=n.pixelRatio;let S=oot(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 bn?C=Number.POSITIVE_INFINITY:C=Z.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=C,p&&(y.w=m.tileset.timeSinceLoad),y}};var yxe=new h;function oot(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,yxe);a=P.multiplyByPointAsVector(s,a,yxe);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var rot={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},sot={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function aot(e){let t=$e(sot);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 Tq="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function cot(e,t){let n=rot,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Tq})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Tq})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Tq})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function lot(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 _q(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 dot(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&_q(t,o),l(n)&&_q(n,o),l(i)&&_q(i,o),o}var fP=xxe;var h6n=x(T(),1);var o6n=x(T(),1),pP=`void primitiveOutlineStage() { -v_outlineCoordinates = a_outlineCoordinates; } -`;var s6n=x(T(),1),bP=`void primitiveOutlineStage(inout czm_modelMaterial material) { -if (!model_showOutline) { -return; +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); } -float outlineX = -texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; -float outlineY = -texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; -float outlineZ = -texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; -float outlineness = max(outlineX, max(outlineY, outlineZ)); -material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +colorAccum.a /= ALPHA_ACCUM_MAX; +#if defined(PICKING) +if (colorAccum.a == 0.0) { +discard; } -`;var Txe={name:"PrimitiveOutlinePipelineStage"};Txe.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=K_.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(pP),i.addFragmentLines(bP)};var gP=Txe;var x6n=x(T(),1);var _xe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Sxe,_count2DPositions:Zxe,_countMorphTargetAttributes:Rxe,_countMaterialTextures:Cxe,_countFeatureIdTextures:Vxe,_countBinaryMetadata:Exe};_xe.process=function(e,t,n){let i=e.model,o=i.statistics;Sxe(o,t),Zxe(o,e.runtimePrimitive),Rxe(o,t),Cxe(o,t.material),Vxe(o,t.featureIds),Exe(o,i)};function Sxe(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+=uot(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 uot(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 Zxe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Rxe(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 Cxe(e,t){let n=mot(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 mot(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 Vxe(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Rn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Exe(e,t){let n=t.structuralMetadata;l(n)&&(hot(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 hot(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 yP=_xe;var I6n=x(T(),1);var fot=new P,pot=new P,Axe={name:"SceneMode2DPipelineStage"};Axe.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,fot),d=yot(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=_ot(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,pot)}};e.uniformMap=It(f,e.uniformMap)};var bot=new h,got=new h;function yot(e,t,n){let i=P.multiplyByPoint(t,e.positionMin,bot),o=ho.computeActualEllipsoidPosition(n,i,i),r=P.multiplyByPoint(t,e.positionMax,got),s=ho.computeActualEllipsoidPosition(n,r,r);return me.fromCornerPoints(o,s,new me)}var Gxe=new h;function xot(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,Gxe),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 Tot(e,t,n,i){let o;l(e.quantization)?o=xot(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,Gxe);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=P.multiplyByPoint(t,d,d),m=ho.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 _ot(e,t,n,i){let o=$e(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=Tot(e,t,r,o),a=it.createVertexBuffer({context:i.context,typedArray:s,usage:Pe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var xP=Axe;var U6n=x(T(),1);var X6n=x(T(),1),TP=`void skinningStage(inout ProcessedAttributes attributes) -{ -mat4 skinningMatrix = getSkinningMatrix(); -mat3 skinningMatrixMat3 = mat3(skinningMatrix); -vec4 positionMC = vec4(attributes.positionMC, 1.0); -attributes.positionMC = vec3(skinningMatrix * positionMC); -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = skinningMatrixMat3 * normalMC; -#endif -#ifdef HAS_TANGENTS -vec3 tangentMC = attributes.tangentMC; -attributes.tangentMC = skinningMatrixMat3 * tangentMC; -#endif +out_FragColor = u_pickColor; +#elif defined(PICKING_VOXEL) +if (colorAccum.a == 0.0) { +discard; } -`;var oS={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};oS.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,fe.VERTEX),Zot(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,fe.VERTEX),n.addVertexLines(TP);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=It(r,e.uniformMap)};function Sot(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 Zot(e,t){e.addFunction(oS.FUNCTION_ID_GET_SKINNING_MATRIX,oS.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,fe.VERTEX),e.addFunctionLines(oS.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=Sot(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(oS.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(oS.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var _P=oS;var J6n=x(T(),1);var O6n=x(T(),1),SP=`void verticalExaggerationStage( -inout ProcessedAttributes attributes -) { -vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); -vec2 vertexAzimuth = normalize(vertexPositionENU.xy); -float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); -float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; -vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; -vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; -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, vertexEllipsoidNormalEC); -float smallAngleVersine = 0.5 * sinTheta * sinTheta; -float versine = isSmallAngle ? smallAngleVersine : exactVersine; -float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; -float vertexHeight = czm_eyeHeight + dHeight; -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 * exaggerationDirectionScaledMC; +vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex); +vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0])); +out_FragColor = vec4(megatextureId, sampleIndex); +#else +out_FragColor = colorAccum; +#endif } -`;var Lxe={name:"VerticalExaggerationPipelineStage"},Rot=new k;Lxe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(SP),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,Rot)}};var ZP=Lxe;var u7n=x(T(),1);var e7n=x(T(),1);var Sq={};function Cot(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 Vot(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 Eot(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 Aot(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 Got(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 Lot(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}Sq.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ie.TRIANGLES)return i?Vot(t,n):Cot(t);if(e===Ie.TRIANGLE_STRIP)return i?Aot(t,n):Eot(t);if(e===Ie.TRIANGLE_FAN)return i?Lot(t,n):Got(t)};Sq.getWireframeIndicesCount=function(e,t){return e===Ie.TRIANGLES?t*2:e===Ie.TRIANGLE_STRIP||e===Ie.TRIANGLE_FAN?2+(t-2)*4:t};var YC=Sq;var Wxe={name:"WireframePipelineStage"};Wxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,fe.FRAGMENT);let o=e.model,r=Wot(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=YC.getWireframeIndicesCount(a,c)};function Wot(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=YC.createWireframeIndices(a,o,s),d=Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return it.createIndexBuffer({context:n.context,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:d})}var RP=Wxe;function vxe(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=[]}vxe.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!==yb.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=vot(o,i,n),N=l(o.classificationType);d&&t.push(xP),t.push(OI),Z&&t.push(RP),N&&t.push(ZI),m&&t.push(uP),p&&t.push(_P),A&&t.push(fP),S&&t.push(PI),b&&(L?xt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(iP)),_&&t.push(lP),t.push(bx),t.push(Um),t.push(Xu),I.hasPropertyTable&&(t.push(gx),t.push(SI),t.push(VI)),u&&t.push(ZP),f&&t.push(FI),t.push(rP),o.allowPicking&&t.push(mP),L&&t.push(gP),F&&(e.edgeVisibilityRequested=!0,t.push(wI),t.push(NI)),t.push(_I),t.push(yP)};function vot(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 CP=vxe;var J7n=x(T(),1);function Zq(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=[],Fot(this)}Object.defineProperties(Zq.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 Fot(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=Fxe(u,m,new P);a.push(p)}}function Fxe(e,t,n){let i=P.multiplyTransformation(e.transformToRoot,e.transform,n);return n=P.multiplyTransformation(i,t,n),n}Zq.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]=Fxe(i,o,e[n])}};var VP=Zq;var iqn=x(T(),1);var Q7n=x(T(),1);function Iot(){this.pass=void 0,this.alphaCutoff=void 0}var rS=Iot;function Pot(e){this.shaderBuilder=new Tb,this.model=e,this.uniformMap={},this.alphaOptions=new rS,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var EP=Pot;var fqn=x(T(),1);var rqn=x(T(),1),AP=`void silhouetteStage(inout vec4 color) { -if(model_silhouettePass) { -color = czm_gammaCorrect(model_silhouetteColor); +`;var Gho=x(T(),1),jw=`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 Who=x(T(),1),Qw=`#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 aqn=x(T(),1),GP=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { -#ifdef HAS_NORMALS -if(model_silhouettePass) { -vec3 normal = normalize(czm_normal3D * attributes.normalMC); -normal.x *= czm_projection[0][0]; -normal.y *= czm_projection[1][1]; -positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; +return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; } -#endif +vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) +{ +return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; } -`;var SB={name:"ModelSilhouettePipelineStage"};SB.silhouettesLength=0;SB.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++SB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,fe.BOTH),i.addVertexLines(GP),i.addFragmentLines(AP),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 LP=SB;var _qn=x(T(),1);var bqn=x(T(),1),WP=`void modelSplitterStage() +RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) { -#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 +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); } -`;var ZB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};ZB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,fe.FRAGMENT),i.addFragmentLines(WP);let o={};i.addUniform("float",ZB.SPLIT_DIRECTION_UNIFORM_NAME,fe.FRAGMENT),o[ZB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=It(o,e.uniformMap)};var vP=ZB;var Rqn=x(T(),1);function Xot(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 FP=Xot;var Xqn=x(T(),1);var Aqn=x(T(),1);function Not(e){e=e??B.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Jp.UNLIT}var IP=Not;function Yot(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=me.fromCornerPoints(this.positionMin,this.positionMax,new me),this.lightingOptions=new IP,this.pickId=void 0,this.snapId=void 0}var PP=Yot;var M$n=x(T(),1);var Qqn=x(T(),1);function Cq(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!==ni.CESIUM_3D_TILE,this._classifies3DTiles=o!==ni.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Uot(this)}function Mot(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:sc.LESS_OR_EQUAL},depthMask:!1}}var wot={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ei.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},kot={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ei.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},Xxe=[];function Uot(e){let t=e._command,n=Xxe;if(e._useDebugWireframe){t.pass=Le.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=XP(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=Rq(t,r),a=Ixe(t,r);n.length=0,n.push(s,a),e._commandListTerrain=XP(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Pxe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Le.CESIUM_3D_TILE_CLASSIFICATION,s=Rq(t,r),a=Ixe(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=XP(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Pxe(e,n,e._commandList3DTilesPicking))}}function XP(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 Rq(e,t){let n=lt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Le.TERRAIN_CLASSIFICATION?ei.ALWAYS:ei.EQUAL,o=Mot(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(wot),n}var Dot=[];function Pxe(e,t,n){let i=ze.fromCache(kot),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=Dot;return c.length=0,c.push(s,a),XP(e,c,n)}Object.defineProperties(Cq.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=me.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});Cq.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ti(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ti(t,this._commandListTerrain),this._classifies3DTiles&&ti(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=Rq(this._command,o),s=Xxe;s.length=0,s.push(r),this._commandListIgnoreShow=XP(this,s,this._commandListIgnoreShow)}ti(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ti(t,this._commandListTerrainPicking),this._classifies3DTiles&&ti(t,this._commandList3DTilesPicking)),t};var NP=Cq;var x$n=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=me.clone(t.boundingVolume),this._modelMatrix2D=new P,this._boundingVolume2D=new me,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,Oot(this)}function Om(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}Om.clone=function(e){return new Om({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Oot(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 Om({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Om({command:Qot(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Om({command:ort(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Om({command:rrt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Om({command:qot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Om({command:$ot(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 Om({command:Nxe(t,r,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Om({command:Nxe(t,r,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand),o.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Om({command:ert(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}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=me.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,Hot(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Kot(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Jot(this))}}});function Bot(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=me.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function zot(e){let t=e.shadows,n=Wn.castShadows(t),i=Wn.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 Hot(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 Kot(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 Jot(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=RB(this,e);n&&!this._has2DCommands&&(jot(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Bot(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==lf.ALL_OPAQUE&&jp(t,this._translucentCommand,n),i===lf.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||jp(o._backfaceCommands,this._skipLodBackfaceCommand,n),trt(this,r,n),jp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){jp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===km.EDGES_ONLY&&this._needsEdgeCommands||jp(t,this._originalCommand,n),t}};MC.prototype.pushSilhouetteCommands=function(e,t){let n=RB(this,e);return jp(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=RB(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),jp(t,s,o),t}if(i.pick){if(n!==km.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),jp(t,s,o),t}if(n===km.SURFACES_ONLY)return t;let r=n===km.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),jp(t,this._edgeCommand,o),t};MC.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=RB(this,e);return jp(t,this._planarFillIdCommand,n),t};function jp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function RB(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 Db(e,t){if(!l(t))return;let n=Om.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 jot(e){Db(e,e._originalCommand),Db(e,e._translucentCommand),Db(e,e._skipLodBackfaceCommand),Db(e,e._skipLodStencilCommand),Db(e,e._silhouetteModelCommand),Db(e,e._silhouetteColorCommand),Db(e,e._edgeCommand),Db(e,e._edgeSnapCommand),Db(e,e._planarFillIdCommand)}function Qot(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 qot(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 $ot(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 Nxe(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 ert(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 trt(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=nrt(o);if(r!==s){let a=irt(r),c=$e(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function nrt(e){return(e.renderState.stencilTest.reference&Jt.SKIP_LOD_MASK)>>>Jt.SKIP_LOD_BIT_SHIFT}function irt(e){return Jt.CESIUM_3D_TILE_MASK|e<<Jt.SKIP_LOD_BIT_SHIFT}function ort(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0);n.cull.enabled=!0,n.cull.face=ki.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 rrt(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=ei.GREATER_OR_EQUAL,i.frontOperation.zPass=Ft.REPLACE,i.backFunction=ei.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 YP=MC;var _$n=x(T(),1),MP=`precision highp float; -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { -czm_modelVertexOutput vsOutput; -vsOutput.positionMC = positionMC; -vsOutput.pointSize = 1.0; -return vsOutput; +vec4 entry = intersectionMax(intersect0.entry, intersect1.entry); +vec4 exit = intersectionMin(intersect0.exit, intersect1.exit); +return RayShapeIntersection(entry, exit); } -void main() -{ -ProcessedAttributes attributes; -initializeAttributes(attributes); -#ifdef HAS_IMAGERY -initializeImageryAttributes(); -#endif -#ifdef USE_DEQUANTIZATION -dequantizationStage(attributes); -#endif -#ifdef HAS_MORPH_TARGETS -morphTargetsStage(attributes); -#endif -#ifdef HAS_SKINNING -skinningStage(attributes); -#endif -#ifdef HAS_PRIMITIVE_OUTLINE -primitiveOutlineStage(); -#endif -#ifdef HAS_BITANGENTS -attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); -#endif -FeatureIds featureIds; -featureIdStage(featureIds, attributes); -#ifdef HAS_SELECTED_FEATURE_ID -SelectedFeature feature; -selectedFeatureIdStage(feature, featureIds); -cpuStylingStage(attributes.positionMC, feature); -#endif -#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) -mat4 modelView = czm_modelView3D; -mat3 normal = czm_normal3D; -#else -mat4 modelView = czm_modelView; -mat3 normal = czm_normal; -#endif -#ifdef HAS_INSTANCING -#ifdef USE_LEGACY_INSTANCING -mat4 instanceModelView; -mat3 instanceModelViewInverseTranspose; -legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); -modelView = instanceModelView; -normal = instanceModelViewInverseTranspose; -#else -instancingStage(attributes); -#endif -#ifdef USE_PICKING -v_pickColor = a_pickColor; -#endif -#endif -Metadata metadata; -MetadataClass metadataClass; -MetadataStatistics metadataStatistics; -metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); -#ifdef HAS_VERTICAL_EXAGGERATION -verticalExaggerationStage(attributes); -#endif -#ifdef HAS_CUSTOM_VERTEX_SHADER -czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); -customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); -#endif -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 HAS_VECTOR_LOOKUP -modelVectorLookupStage(attributes); -#endif -#ifdef HAS_SILHOUETTE -silhouetteStage(attributes, positionClip); -#endif -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float show = pointCloudShowStylingStage(attributes, metadata); -#else -float show = 1.0; -#endif -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -show *= pointCloudBackFaceCullingStage(); -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); -#endif -#ifdef PRIMITIVE_TYPE_POINTS -#ifdef HAS_CUSTOM_VERTEX_SHADER -gl_PointSize = vsOutput.pointSize; -#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) -gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); -#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; +struct Intersections { +vec4 intersections[INTERSECTION_COUNT * 2]; +float distanceToDepthBuffer; +#if (INTERSECTION_COUNT > 1) +int index; +int surroundCount; +bool surroundIsPositive; #endif -} -`;var Z$n=x(T(),1),wP=`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() +}; +RayShapeIntersection getFirstIntersection(in Intersections ix) { -czm_modelMaterial material; -material.diffuse = vec3(0.0); -material.specular = vec3(1.0); -material.roughness = 1.0; -material.occlusion = 1.0; -material.normalEC = vec3(0.0, 0.0, 1.0); -material.emissive = vec3(0.0); -material.alpha = 1.0; -return material; +return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); } -vec4 handleAlpha(vec3 color, float alpha) +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) { -#ifdef ALPHA_MODE_MASK -if (alpha < u_alphaCutoff) { -discard; +float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; +return vec4(intersection.xyz * scale, intersection.w); } -#endif -return vec4(color, alpha); +#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; } -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; +} +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; } -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; +for (int i = 0; i < passCount; ++i) { +if (i < ix.index) { +continue; } -#endif -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -if (v_pointCloudShow == 0.0) -{ -discard; +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; } -#endif -#ifdef HAS_MODEL_SPLITTER -modelSplitterStage(); -#endif -czm_modelMaterial material = defaultModelMaterial(); -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; +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; } -#endif -Metadata metadata; -MetadataClass metadataClass; -MetadataStatistics metadataStatistics; -metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); -#ifndef METADATA_PICKING_ENABLED -#ifdef HAS_SELECTED_FEATURE_ID -selectedFeatureIdStage(selectedFeature, featureIds); -#endif -#ifndef CUSTOM_SHADER_REPLACE_MATERIAL -materialStage(material, attributes, selectedFeature); -#endif -#ifdef HAS_CUSTOM_FRAGMENT_SHADER -customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); -#endif -lightingStage(material, attributes); -#ifdef HAS_SELECTED_FEATURE_ID -cpuStylingStage(material, selectedFeature); -#endif -#ifdef HAS_MODEL_COLOR -modelColorStage(material); -#endif -#ifdef HAS_PRIMITIVE_OUTLINE -primitiveOutlineStage(material); -#endif -vec4 color = handleAlpha(material.diffuse, material.alpha); -#else -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); -#endif -#ifdef HAS_ATMOSPHERE -atmosphereStage(color, attributes); -#endif -#ifdef HAS_EDGE_VISIBILITY -edgeVisibilityStage(color, featureIds); -edgeDetectionStage(color, featureIds); -if (u_isEdgePass) { -isEdge = true; +break; } -#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; } +return shapeIntersection; } #endif +`;var Fho=x(T(),1),qw=`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; } -`;function Yxe(){}Yxe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=srt(e,n,t),o=art(e,i,t),r=e.model;return l(r.classificationType)?new NP({primitiveRenderResources:e,command:o}):new YP({primitiveRenderResources:e,command:o})};function srt(e,t,n){t.addVertexLines(MP),t.addFragmentLines(wP);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function art(e,t,n){let i=crt(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=me.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:Wn.castShadows(r.shadows),f=p?!1:Wn.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 crt(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var kP=Yxe;function ml(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={},lrt(this)}Object.defineProperties(ml.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 lrt(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Mxe(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 nI({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=wxe(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 VP({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 Mxe(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 drt=new h;function urt(e,t){let n=e._computedModelMatrix,i=P.getTranslation(n,drt);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=me.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function wxe(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=wxe(e,m,p);i.push(b)}let s=new TI({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 CP({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 mI(u,s);u._nodesByName[d]=m}return c}var mrt=new h,hrt=new h,frt=new h,prt=new h;ml.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};ml.prototype.buildRenderResources=function(e){let t=this._model,n=new EP(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 FP(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 PP(a,d);a.primitiveRenderResources[c]=m;for(let p=0;p<u.length;p++)u[p].process(m,d.primitive,e)}}return n};ml.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,mrt),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,hrt);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=me.clone(u.boundingSphere,new me);let m=P.multiplyByPoint(a,u.positionMin,frt),p=P.multiplyByPoint(a,u.positionMax,prt);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=me.fromCornerPoints(n,i,new me),this._boundingSphere=me.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=me.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=me.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};ml.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=kP.buildModelDrawCommand(a,t);s.drawCommand=c}}};ml.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(eI),n.isClippingEnabled()&&t.push(rI);let o=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&o&&t.push(cI),n.hasDrapedVectors()&&t.push(uI),n.hasSilhouette(e)&&t.push(LP),l(n.splitDirection)&&n.splitDirection!==Ur.NONE&&t.push(vP),Or.is3DTiles(n.type)&&t.push(JF),i&&t.push(qF)};ml.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)}}};ml.prototype.updateModelMatrix=function(e,t){Mxe(this,e),t.mode!==se.SCENE3D&&urt(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};ml.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 kxe(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);kxe(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 CB(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];kxe(e,c,t,n,i)}}var brt={backFaceCulling:void 0};ml.prototype.updateBackFaceCulling=function(e){let t=brt;t.backFaceCulling=e,CB(this,!1,grt,t)};function grt(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var yrt={shadowMode:void 0};ml.prototype.updateShadows=function(e){let t=yrt;t.shadowMode=e,CB(this,!1,xrt,t)};function xrt(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var Trt={debugShowBoundingVolume:void 0};ml.prototype.updateShowBoundingVolume=function(e){let t=Trt;t.debugShowBoundingVolume=e,CB(this,!1,_rt,t)};function _rt(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Uxe=[],Dxe=[],Oxe=[],Srt={frameState:void 0,hasSilhouette:void 0};ml.prototype.pushDrawCommands=function(e){let t=Uxe;t.length=0;let n=Dxe;n.length=0;let i=Oxe;i.length=0;let o=Srt;o.hasSilhouette=this._model.hasSilhouette(e),o.frameState=e,CB(this,!0,Zrt,o),ti(e.commandList,t),ti(e.commandList,n),ti(e.commandList,i)};function Zrt(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Uxe,s=Dxe,a=Oxe,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)}ml.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)};ml.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var UP=ml;var xei=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 kt}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 DP=xx;var nti=x(T(),1);var Kxe=x(eD(),1);var vei=x(T(),1);var Bxe={},sS=Uint32Array.BYTES_PER_ELEMENT;Bxe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=sS;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+=sS,t+=sS;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=sS;let s=i.getUint32(t,!0);t+=sS;let a=i.getUint32(t,!0);t+=sS;let c=i.getUint32(t,!0);t+=sS;let d=Wr(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=Wr(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 af(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 _=Crt(b,m);if(_.rtcCenter=y,_.pointsLength=f,!_.hasPositions){let S=Vrt(b);_.positions=S,_.hasPositions=_.hasPositions||l(S)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let S=Art(b);_.normals=S,_.hasNormals=_.hasNormals||l(S)}if(!_.hasColors){let S=Ert(b);_.colors=S,_.hasColors=_.hasColors||l(S),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(S)&&S.isTranslucent}if(!_.hasBatchIds){let S=Grt(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),Rrt(_),_};function Rrt(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 Crt(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 Vrt(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 Ert(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 Art(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 Grt(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 aS=Bxe;var Lrt=Rn.Components,Wrt=Rn.Scene,vrt=Rn.Node,Frt=Rn.Primitive,Irt=Rn.Attribute,zxe=Rn.Quantization,Prt=Rn.FeatureIdAttribute,Xrt=Rn.Material,Nrt=Rn.MetallicRoughness,Vq=class extends to{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=aS.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=Yrt(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 Yrt(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)&&Mrt(e,i,r),jrt(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 Mrt(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:wrt(d.componentsPerAttribute),componentType:krt(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function wrt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function krt(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 OP(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new zxe,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new zxe;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 Irt;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=it.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 Hxe,VB;function Urt(e){if(!l(VB)){Hxe=new Kxe.default(0),VB=new Array(e);for(let t=0;t<e;++t)VB[t]=Hxe.random()}return VB}var Drt=new h,Ort=new h,Brt=new h;function zrt(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=Urt(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Drt),d=h.fromElements(a,a,a,Ort),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,Brt),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var Hrt={name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:!1};function Krt(e,t,n){let i=[],o,r=t.positions;return l(r)&&(zrt(r),o=OP(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=OP(e,t.normals,n),o.count=t.pointsLength,i.push(o)),l(t.colors)?(o=OP(e,t.colors,n),o.count=t.pointsLength,i.push(o)):(o=OP(e,Hrt,n),o.count=t.pointsLength,i.push(o)),l(t.batchIds)&&(o=OP(e,t.batchIds,n),o.count=t.pointsLength,i.push(o)),i}function Jrt(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?Pb({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Ua({schema:{},propertyTables:[]})}function jrt(e,t){let n=e._parsedContent,i=new Nrt;i.metallicFactor=0,i.roughnessFactor=.9;let o=new Xrt;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=_p.BLEND);let s=!l(n.normals);o.unlit=s;let a=new Frt;if(a.attributes=Krt(e,n,t),a.primitiveType=Ie.POINTS,a.material=o,l(n.batchIds)){let b=new Prt;b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0",a.featureIds.push(b)}let c=new vrt;c.index=0,c.primitives=[a];let d=new Wrt;d.nodes=[c],d.upAxis=Di.Z,d.forwardAxis=Di.X;let u=new Lrt;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=Jrt(n,m),m.length>0&&Qrt(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 Qrt(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=it.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 BP=Vq;var Rti=x(T(),1);var ati=x(T(),1);var EB={};EB.getHeight=function(e,t,n){return(e-n)*t+n};var qrt=new pe;EB.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,qrt);if(!l(r))return h.clone(e,o);let s=EB.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var _o=EB;var AB=new h,Jxe=new h,jxe=new h,zP=new h,$rt=new h,est=new h,tst=new pe,nst=new me;function GB(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 ist=32,Eq=new Map,Aq=[];function ost(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 M=v*N+X*g+Y*V;if(M<0||M>G)continue;let O=X*A-Y*E,w=Y*C-v*A,z=v*E-X*C,K=d*O+u*w+m*z;if(K<0||M+K>G)continue;D=(L*O+F*w+I*z)/G}else{if(Math.abs(G)<p)continue;let M=1/G,O=(v*N+X*g+Y*V)*M;if(O<0||O>1)continue;let w=X*A-Y*E,z=Y*C-v*A,K=v*E-X*C,te=(d*w+u*z+m*K)*M;if(te<0||O+te>1)continue;D=(L*w+F*z+I*K)*M}D>=0&&D<r&&(r=D)}return r}function wC(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(Ta.forEachPrimitive(e,{mapProjection:c},function(d,u,m,p){if(l(d.boundingSphere)&&m.length===1){let R=me.transform(d.boundingSphere,p,nst),C=Ti.raySphere(t,R);if(!l(C))return}if(!l(u.indices))return;let b,f,y=Zt.getAttributeBySemantic(u,dt.POSITION),_=Eq.get(u);l(_)||(_={},l(y)&&(_.vertices=Ta.readAttributeAsTypedArray(y)),l(u.indices)&&(_.indices=Ta.readIndicesAsTypedArray(u.indices)),Eq.set(u,_),Aq.push(u),Aq.length>ist&&Eq.delete(Aq.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++)GB(b,I,f,AB),P.multiplyByPoint(R,AB,zP),F[I*3]=zP.x,F[I*3+1]=zP.y,F[I*3+2]=zP.z;_.world=F,_.worldTransform=P.clone(R,_.worldTransform)}let C=_.world,E=e.backFaceCulling??!0,A=ost(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];GB(b,C,f,AB),GB(b,E,f,Jxe),GB(b,A,f,jxe);for(let L of m){let F=P.multiplyByPoint(L.transform,AB,zP),I=P.multiplyByPoint(L.transform,Jxe,$rt),N=P.multiplyByPoint(L.transform,jxe,est);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=Ti.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,tst);u.cartographicToCartesian(m,s)}return s}}var Fti=x(T(),1);var Vti=x(T(),1),Gq=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}},HP=Gq;var Lq=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 iS(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 HP(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},KP=Lq;function Ro(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 zF(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??dl.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 me,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 Hp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?xs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?vc.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 KP(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Q_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Wb(e.environmentMapOptions);Wb.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Wn.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??km.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??Ur.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new DP,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 Wq(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function rst(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 KF({model:e,propertyTable:s});n.push(a)}return n}function sst(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 Iq(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(Ro.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=Bt.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){Iq(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=Iq(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 tTe(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&&(xs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(vc.setOwner(e,this,"_clippingPolygons"),$xe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(vc.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&&(Wb.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}}});Ro.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))};Ro.prototype.getNode=function(e){return this._nodesByName[e]};Ro.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Ro.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Ro.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Ro.prototype.makeStyleDirty=function(){this._styleDirty=!0};Ro.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var ast=new P,cst=new q,lst=new P;Ro.prototype.update=function(e){let t=!1;try{t=dst(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")Wq(this,i);else{let o=Zt.getError("model",this._resource,i);Wq(this,o)}}if(ust(this,e),mst(this,e),hst(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."));Wq(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&rst(this,o);let r=new UP({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(fst(this),pst(this),bst(this,e),gst(this),yst(this,e),xst(this,e),Tst(this,e),_st(this,e),Rst(this,e),Cst(this,e),Vst(this,e),Est(this,e),this._defaultTexture=e.context.defaultTexture,Ast(this,e),Lst(this,e),Fst(this),Ist(this,e),Yst(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)),Xst(this),Mst(this,e),wst(this),Ust(this,e)}};function dst(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function ust(e,t){l(e._customShader)&&e._customShader.update(t)}function mst(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 hst(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function fst(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=sst(t,e),e._styleDirty=!0,e.resetDrawCommands())}function pst(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function bst(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&&qxe(e)}function qxe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=lf.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function gst(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 yst(e,t){e._silhouetteDirty&&(iTe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function xst(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Tst(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 _st(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)&&(vc.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 Sst=new re;function eTe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function Zst(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function Rst(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,Sst);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 eTe(e);let o=Zst(e._vectorData);o!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=o)}function Cst(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Vst(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Est(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 Ast(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Gst(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function Pq(e,t){if(!l(e)||!l(t))return P.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function Lst(e,t){Gst(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=Pq(e.modelMatrix,e._modelMatrix))}var Tx=new h,vq=new pe,Wst=new pe,vst=200,Qxe=30;function Fst(e){let t=e.heightReference!==He.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=Qxe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===He.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ne.default,o=e.modelMatrix;Tx.x=o[12],Tx.y=o[13],Tx.z=o[14];let r=i.cartesianToCartographic(Tx,Wst);l(e._clampedModelMatrix)||(e._clampedModelMatrix=P.clone(o,new P));let s=n.frameState.frameNumber,a=e.heightReference===He.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Qxe,d=a&&l(e._lastSurfaceHeight)&&r.height>e._lastSurfaceHeight+vst,u=d&&c,m=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||d)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=pe.clone(r),_=Kst(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,S=>{let Z=n.getHeight(y,e.heightReference);l(Z)&&(S.height=Z,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=S.height,_(S)},e.heightReference)}let f;u||m?f=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,f=n.getHeight(r,e.heightReference),e._lastSurfaceQueryMissed=!l(f),l(f)?e._lastSurfaceHeight=f:f=e._lastSurfaceHeight),l(f)?(pe.clone(r,vq),vq.height=f,nTe(e,i,r,vq)):Pq(o,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function Ist(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;tTe(e,n),Pst(e,n,t)}function tTe(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=me.transform(e._boundingSphere,t,e._boundingSphere)}function Pst(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&&ho.computeActualEllipsoidPosition(n,Tx,Tx);let s=e._boundingSphere.radius,a=Dst(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 Xst(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 Nst=new q(1,0,0,0,0,1,0,-1,0);function Yst(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=cst,s=ast;if(s=P.multiply(o.uniformState.view3D,i,s),r=P.getRotation(s,r),r=q.transpose(r,r),e._iblReferenceFrameMatrix=q.multiply(Nst,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=P.multiply(i,e._clippingPlanes.modelMatrix,lst);e._clippingPlanesMatrix=P.inverseTranspose(a,e._clippingPlanesMatrix)}}function Mst(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 wst(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 kst(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Ust(e,t){let n=jst(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o)&&!kst(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Qst(e,t),e._sceneGraph.pushDrawCommands(t))}var Fq=new me;function Dst(e,t,n){return Fq.center=e,Fq.radius=t,n.camera.getPixelSize(Fq,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var LB=new h,Ost=new h,WB=new h,Bst=new h,zst=new P;function Hst(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,Bst),a=P.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,zst),c=e.scale,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,Ost);h.multiplyByScalar(p,c,p),P.multiplyByPoint(a,p,WB),P.multiplyByPointAsVector(d,WB,WB);let b=h.dot(WB,s);b<u&&(u=b)}return-u}function nTe(e,t,n,i){if(e.heightReference===He.CLIP_TO_GROUND){let r=i.height+Hst(e,t,i);e._heightAboveSurface=Math.max(0,n.height-r),i.height=Math.max(n.height,r)}else Py(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,LB);let o=e._clampedModelMatrix;Pq(e.modelMatrix,o),o[12]=LB.x,o[13]=LB.y,o[14]=LB.z,e._heightDirty=!0}function Kst(e,t,n){return function(i){nTe(e,t,n,i)}}var Jst=new h;function jst(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,Jst);ho.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Qst(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Ro.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Ro.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function iTe(e){return e.context.stencilBuffer}Ro.prototype.hasSilhouette=function(e){return iTe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Ro.prototype.hasSkipLevelOfDetail=function(e){if(!Or.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Ro.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Ro.prototype.pick=function(e,t,n,i,o){return wC(this,e,t,n,i,o)};Ro.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Ro.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Ro.prototype.isDestroyed=function(){return!1};Ro.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(),eTe(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)&&vc.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)};Ro.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};Ro.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Ro.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 Iu(n),a=l(e.content)?Or.TILE_GLTF:Or.GLTF,c=n.gltfResource,d=JP(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 Ro(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};Ro.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 NF(t);try{await n.load();let i=JP(n,Or.TILE_B3DM,e);return new Ro(i)}catch(i){throw n.destroy(),i}};Ro.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new BP(t);try{await n.load();let i=JP(n,Or.TILE_PNTS,e);return new Ro(i)}catch(i){throw n.destroy(),i}};Ro.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 wF(t);try{await n.load();let i=JP(n,Or.TILE_I3DM,e);return new Ro(i)}catch(i){throw n.destroy(),i}};Ro.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new YF(t),i=JP(n,Or.TILE_GEOJSON,e);return new Ro(i)};var qst=new U;Ro.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,qst),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,Iq(t,this._color)&&this.resetDrawCommands()};Ro.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),qxe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function JP(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=Ro;var Xq=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:Md.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=jP(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=jP(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=jP(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=jP(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=jP(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 jP(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=Xq;var Yni=x(T(),1);var Nq=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 ue(this)}},QP=Nq;var Jci=x(T(),1);var Usi=x(T(),1);var Hni=x(T(),1);var wni=x(T(),1);function $st(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 cS=$st;var eat=new pe,mf=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),kC(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),kC(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,kC(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),kC(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,kC(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,eat);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&&kC(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 na.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(mf,"defaultColor",U.WHITE),mt(mf,"defaultPointOutlineColor",U.BLACK),mt(mf,"defaultPointOutlineWidth",0),mt(mf,"defaultPointSize",8);function kC(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??mf.defaultColor,i=e._pointOutlineColor??mf.defaultPointOutlineColor,o=e._pointOutlineWidth??mf.defaultPointOutlineWidth,r=e._pointSize??mf.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,cS(u,m,p,o,r))}var Ob=mf;var kii=x(T(),1);var $ni=x(T(),1);function tat(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 lS;function nat(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(lS)||(l(u.imageSmoothingEnabled)?lS="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?lS="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?lS="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(lS="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[lS]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=tat(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[lS]=!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 dS=nat;var bTe=x(aTe(),1);var xii=x(T(),1);var iii=x(T(),1),cTe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(cTe);var xr=cTe;var lTe={},dTe=0,oat=256,rat=new U(.165,.165,.165,.8),sat=new k(7,5),oa=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function uS(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function $P(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function eX(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function mTe(e){let t=lTe[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(eX(n,"line-height"));isNaN(i)&&(i=void 0),t={family:eX(n,"font-family"),size:eX(n,"font-size").replace("px",""),style:eX(n,"font-style"),weight:eX(n,"font-weight"),lineHeight:i},document.body.removeChild(n),dTe<oat&&(lTe[e._font]=t,dTe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function hf(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=Bt.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??rat),this._backgroundPadding=k.clone(e.backgroundPadding??sat),this._style=e.style??xr.FILL,this._verticalOrigin=e.verticalOrigin??Bn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Oi.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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,mTe(this),this._updateClamping()}Object.defineProperties(hf.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(!W4(t,e)){h_(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),$P(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=hf.filterUnsupportedCharacters(e);this._renderedText=hf.enableRightToLeftDetection?mat(t):t,uS(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,uS(this),mTe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),uS(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),uS(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,uS(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,uS(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),$P(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,uS(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,$P(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),$P(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),$P(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Bt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Bt.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_(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}}});hf.prototype._updateClamping=function(){No._updateClamping(this._labelCollection,this)};hf.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new k);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return No._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};hf.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+=Na.PADDING*a:(e._verticalOrigin===Bn.BOTTOM||e._verticalOrigin===Bn.BASELINE)&&(S-=Na.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};hf.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};hf.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)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};hf.prototype.isDestroyed=function(){return!1};hf.enableRightToLeftDetection=!1;function aat(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=oa.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=oa.RTL:n.test(u)?a=oa.LTR:i.test(u)?a=oa.BRACKETS:a=oa.WEAK,d===0&&(s=a),s===a&&a!==oa.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 lat(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var dat="\u05D0-\u05EA",uat="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",uTe=new RegExp(`[${dat}${uat}]`);function mat(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=uTe.test(o.charAt(0)),s=aat(o,uTe),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===oa.BRACKETS?lat(u.Word):cat(u.Word);r?u.Type===oa.RTL?(c=m+c,a=0):u.Type===oa.LTR?(c=tX(c,a,u.Word),a+=u.Word.length):(u.Type===oa.WEAK||u.Type===oa.BRACKETS)&&(u.Type===oa.WEAK&&s[d-1].Type===oa.BRACKETS?c=m+c:s[d-1].Type===oa.RTL?(c=m+c,a=0):s.length>d+1?s[d+1].Type===oa.RTL?(c=m+c,a=0):(c=tX(c,a,u.Word),a+=u.Word.length):c=tX(c,0,m)):u.Type===oa.RTL?c=tX(c,a,m):u.Type===oa.LTR?(c+=u.Word,a=c.length):(u.Type===oa.WEAK||u.Type===oa.BRACKETS)&&(d>0&&s[d-1].Type===oa.RTL?s.length>d+1?s[d+1].Type===oa.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 _x=hf;var gTe=x(hTe(),1);function fat(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var pat=1.2,fTe="ID_WHITE_PIXEL",Yq=new k(4,4),bat=new nt(1,1,1,1);function gat(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=Yq.x,o.height=Yq.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(fTe,o),n.addImageSubRegion(fTe,bat)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new k,i}var Bb={};function yat(e,t,n,i,o,r){return Bb.font=t,Bb.fillColor=n,Bb.strokeColor=i,Bb.strokeWidth=o,Bb.padding=Na.PADDING,Bb.fill=r===xr.FILL||r===xr.FILL_AND_OUTLINE,Bb.stroke=r===xr.OUTLINE||r===xr.FILL_AND_OUTLINE,Bb.backgroundColor=U.BLACK,dS(e,Bb)}function Mq(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 gTe.default,Tat=/\s/;function _at(e,t){let n=t._renderedText,i=xat.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Na.FONT_SIZE,o<s)for(let p=o;p<s;++p)Mq(e,r[p]);r.length=o;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=gat(c,e),t._backgroundBillboard=a),Sat(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 ub(d),u.set(y,S);let E=`${t._fontStyle} ${t._fontWeight} ${Na.FONT_SIZE}px ${t._fontFamily}`,A=yat(b,E,U.WHITE,U.WHITE,0,xr.FILL);if(_=A.dimensions,m[y]=_,A.width>0&&A.height>0&&!Tat.test(b)){let L=(0,bTe.default)(A,{cutoff:Na.CUTOFF,radius:Na.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 fat,Z.dimensions=_,Z.billboardTexture=S,r[p]=Z),Z.billboardTexture.id!==y&&(Z.billboardTexture=S,Z.dimensions=_),!S.hasImage){Mq(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=Oi.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===xr.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===xr.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===xr.OUTLINE&&(R.color=U.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Sat(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=Oi.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 pTe(e,t,n){return t===Oi.CENTER?-e/2:t===Oi.RIGHT?-(e+n.x):n.x}var Br=new k,Zat=new k;function Rat(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,Zat);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=pTe(S,f,m),R=(l(e._lineHeight)?e._lineHeight:pat*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=pTe(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+=Na.PADDING):y===Bn.CENTER?Br.y=(C+g.height-a)/2:y===Bn.BASELINE?(Br.y=C,Br.y-=Na.PADDING):(Br.y=C+s+m.y,Br.y-=Na.PADDING),Br.y=(Br.y-g.descent-F)*b,L&&(Br.x-=Na.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,bs(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===Oi.CENTER?Z=-o/2-m.x:f===Oi.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 yTe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Mq(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 Qp(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Cu({scene:this._scene,textureAtlas:new p_({initialSize:Yq}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new ub(t),this._glyphBillboardCollection=new Cu({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??Ni.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Qp.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}}});Qp.prototype.add=function(e){let t=new _x(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Qp.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),yTe(this,e),!0}return!1};Qp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)yTe(this,e[t]);e.length=0};Qp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Qp.prototype.get=function(e){return this._labels[e]};Qp.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&&(_at(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(Rat(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Ni.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)};Qp.prototype.isDestroyed=function(){return!1};Qp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var qp=Qp;var Ssi=x(T(),1);var Dii=x(T(),1),mS=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif -in vec2 v_st; -void main() -{ -czm_materialInput materialInput; -vec2 st = v_st; -st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); -materialInput.s = st.s; -materialInput.st = st; -materialInput.str = vec3(st, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE -out_FragColor *= u_highlightColor; +ix.distanceToDepthBuffer = entry; +#if defined(DEPTH_TEST) +setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); #endif -czm_writeLogDepth(); } -`;var Bii=x(T(),1),nX=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; -void main() -{ -float texCoord = texCoordExpandAndBatchIndex.x; -float expandDir = texCoordExpandAndBatchIndex.y; -bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; -float batchTableIndex = texCoordExpandAndBatchIndex.w; -vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); -float width = widthAndShow.x + 0.5; -float show = widthAndShow.y; -if (width < 1.0) -{ -show = 0.0; -} -vec4 pickColor = batchTable_getPickColor(batchTableIndex); -vec4 p, prev, next; -if (czm_morphTime == 1.0) -{ -p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); -prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); -next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); +`;var Pho=x(T(),1),$w=`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); } -else if (czm_morphTime == 0.0) -{ -p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); -next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); +#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; } -else -{ -p = czm_columbusViewMorph( -czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), -czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), -czm_morphTime); -prev = czm_columbusViewMorph( -czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), -czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), -czm_morphTime); -next = czm_columbusViewMorph( -czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), -czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), -czm_morphTime); } -#ifdef DISTANCE_DISPLAY_CONDITION -vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); -vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); -vec3 centerLow = centerLowAndRadius.xyz; -float radius = centerLowAndRadius.w; -vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; +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; } -else -{ -vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); -lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); } -float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; -float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; -if (lengthSq < nearSq || lengthSq > farSq) -{ -show = 0.0; +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 -float polylineAngle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); -gl_Position = czm_viewportOrthographic * positionWC * show; -v_st.s = texCoord; -v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); -v_width = width; -v_pickColor = pickColor; -v_polylineAngle = polylineAngle; } -`;var fri=x(T(),1);var Hii=x(T(),1),iX=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; +#endif +`;var Nho=x(T(),1),cA=`vec4 transformNormalToEC(in vec4 intersection) { +return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } -`;var Jii=x(T(),1),oX=`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; +RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { +return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit)); } -`;var Qii=x(T(),1),rX=`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; +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 $ii=x(T(),1),sX=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) { -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; +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); } -`;var toi=x(T(),1),aX=`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 } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) { -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; +intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false)); +intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true)); } -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; +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; } -int idxMid = (idxBelow + idxAbove) / 2; -float heightTex = getHeight(idxMid, invTexSize); -if (height > heightTex) { -idxBelow = idxMid; -heightBelow = heightTex; +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 { -idxAbove = idxMid; -heightAbove = heightTex; +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; } } -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) +RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) { -color.rgb /= color.a; +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)); } -color.rgb = czm_gammaCorrect(color.rgb); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; } -`;var ioi=x(T(),1),cX=`uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float distanceToContour = mod(materialInput.height, spacing); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float dxc = abs(dFdx(materialInput.height)); -float dyc = abs(dFdy(materialInput.height)); -float dF = max(dxc, dyc) * czm_pixelRatio * width; -float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else -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 Mho=x(T(),1),e9=`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 roi=x(T(),1),lX=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); -vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; } -`;var aoi=x(T(),1),dX=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; -float getTime(float t, float coord) -{ -float scalar = 1.0 / maximumDistance; -float q = distance(t, coord) * scalar; -if (repeat) -{ -float r = distance(t, coord + 1.0) * scalar; -float s = distance(t, coord - 1.0) * scalar; -q = min(min(r, s), q); +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -return clamp(q, 0.0, 1.0); } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) { -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; +RayShapeIntersection intersection = intersectBoundPlanes(rayEC); +setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var loi=x(T(),1),uX=`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)); +`;var kho=x(T(),1),t9=`uniform vec2 u_cylinderRenderRadiusMinMax; +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) +uniform vec2 u_cylinderRenderAngleMinMax; #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; +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 uoi=x(T(),1),mX=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 textureValue = texture(image, fract(repeat * materialInput.st)); -vec3 normalTangentSpace = textureValue.channels; -normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; -normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); -normalTangentSpace = normalize(normalTangentSpace); -vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; -material.normal = normalEC; -return material; } -`;var hoi=x(T(),1),hX=`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; +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -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 -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); } -else -{ -float d1 = czm_infinity; -if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) { -d1 = abs(st.s - base); -} -float d2 = abs(st.t - ptOnUpperLine); -float d3 = abs(st.t - ptOnLowerLine); -dist = min(min(d1, d2), d3); +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); } -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; +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); } -`;var poi=x(T(),1),fX=`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 -); +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); } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { -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; +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 Dho=x(T(),1),n9=`#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); } -fragColor = czm_gammaCorrect(fragColor); -material.emission = fragColor.rgb; -material.alpha = fragColor.a; -return material; } -`;var goi=x(T(),1),pX=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; -czm_material czm_getMaterial(czm_materialInput materialInput) +RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex) { -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 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); } -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; +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)); } -`;var xoi=x(T(),1),bX=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) +vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle) { -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; +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 _oi=x(T(),1),gX=`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; +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 Zoi=x(T(),1),yX=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; +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); } -`;var Coi=x(T(),1),xX=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -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; +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; } -`;var Eoi=x(T(),1),TX=`uniform vec4 waterColor; -uniform vec4 landColor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); -outColor = czm_gammaCorrect(outColor); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; +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; } -`;var Goi=x(T(),1),_X=`uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float time = czm_frameNumber * animationSpeed; -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; +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; } -`;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??qn.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,Cat(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(_Te(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function _Te(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];_Te(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<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};rt.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let d=c.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(y){return y.bufferView}),d=d[0]);let m=new Ot({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new vt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:m}):p=new vt({context:e,source:d,sampler:m});let b=this._textures[n];l(b)&&b!==this._defaultTexture&&b.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let y=this.uniforms[f];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 c=r[t];n=c.id;let d=c.images,u=new ns({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new Ot({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};rt.prototype.isDestroyed=function(){return!1};rt.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 Cat(e,t){e=e??B.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=$e(e.fabric??B.EMPTY_OBJECT),t.fabric=$e(e.fabric??B.EMPTY_OBJECT),t._template.uniforms=$e(t._template.uniforms??B.EMPTY_OBJECT),t._template.materials=$e(t._template.materials??B.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:$n(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=rt._materialCache.getMaterial(t.type);if(l(i)){let r=$e(i.fabric,!0);t._template=It(t._template,r,!0),n=i.translucent}Gat(t),Wat(t),Pat(t),Nat(t),l(i)||rt._materialCache.addMaterial(t.type,t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function wq(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function xTe(e,t){}function Vat(e,t){}var Eat=["type","materials","uniforms","components","source"],Aat=["diffuse","specular","shininess","normal","emission","alpha"];function Gat(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;wq(t,Eat,xTe,!0),wq(o,Aat,xTe,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);wq(n,r,Vat,!1)}function Lat(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 Wat(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&Lat(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 TTe={mat2:Ji,mat3:q,mat4:P},vat=/\.ktx2$/i;function Fat(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 Ot({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}STe(n,e)}}}function STe(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 vat.test(o.url)?a=Ad(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 Iat(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ns){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),ZTe(t,e)}}function ZTe(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 Pat(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&RTe(e,n)}function RTe(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=Xat(o),s;if(r==="channels")s=SX(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;Yat(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},RTe(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=SX(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Fat(t)),e._initializationPromises.push(STe(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Iat(t)),e._initializationPromises.push(ZTe(e,t));else if(r.indexOf("mat")!==-1){let d=new TTe[r];e._uniforms[c]=function(){return TTe[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Xat(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 Nat(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++}`;SX(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=SX(e,i,a)}}function SX(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 Yat(e,t,n){return SX(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:oX},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:mX},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:uX},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:xX},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:rX},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:sX},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:_X},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:gX},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:dX},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:hX},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:fX},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:pX},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:bX},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:cX},translucent:!1});rt.ElevationRampType="ElevationRamp";rt._materialCache.addMaterial(rt.ElevationRampType,{fabric:{type:rt.ElevationRampType,uniforms:{image:rt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:lX},translucent:!1});rt.SlopeRampMaterialType="SlopeRamp";rt._materialCache.addMaterial(rt.SlopeRampMaterialType,{fabric:{type:rt.SlopeRampMaterialType,uniforms:{image:rt.DefaultImageId},source:yX},translucent:!1});rt.AspectRampMaterialType="AspectRamp";rt._materialCache.addMaterial(rt.AspectRampMaterialType,{fabric:{type:rt.AspectRampMaterialType,uniforms:{image:rt.DefaultImageId},source:iX},translucent:!1});rt.ElevationBandType="ElevationBand";rt._materialCache.addMaterial(rt.ElevationBandType,{fabric:{type:rt.ElevationBandType,uniforms:{heights:rt.DefaultImageId,colors:rt.DefaultImageId},source:aX},translucent:!0});rt.WaterMaskType="WaterMask";rt._materialCache.addMaterial(rt.WaterMaskType,{fabric:{type:rt.WaterMaskType,source:TX,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var ro=rt;var Yri=x(T(),1);var Vri=x(T(),1);var $l={};$l.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};$l.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 Mat=new pe;$l.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,Mat).height}return i};var wat=new P,kat=new h,CTe=new h,Uat=new cn(h.UNIT_X,0),VTe=new h,Dat=new cn(h.UNIT_X,0),Oat=new h,Bat=new h,Uq=[];function ATe(e,t,n){let i=Uq;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 IB=new pe,FB=new pe,Sx=new h,Dq=new h,zat=new h,kq=new _b,ZX=new Gc;function Hat(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Dq),d=i.scaleToGeodeticSurface(t,zat),u=$l.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,IB),p=i.cartesianToCartographic(d,FB),b=ATe(u,o,r);kq.setEndPoints(m,p);let f=kq.surfaceDistance/u,y=a;m.height=o;let _=i.cartographicToCartesian(m,Sx);h.pack(_,s,y),y+=3;for(let S=1;S<u;S++){let Z=kq.interpolateUsingSurfaceDistance(S*f,FB);Z.height=b[S],_=i.cartographicToCartesian(Z,Sx),h.pack(_,s,y),y+=3}return y}function Kat(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,IB),d=i.cartesianToCartographic(t,FB),u=$l.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=ATe(u,o,r);ZX.ellipsoid.equals(i)||(ZX=new Gc(void 0,void 0,i)),ZX.setEndPoints(c,d);let p=ZX.surfaceDistance/u,b=a;c.height=o;let f=i.cartographicToCartesian(c,Sx);h.pack(f,s,b),b+=3;for(let y=1;y<u;y++){let _=ZX.interpolateUsingSurfaceDistance(y*p,FB);_.height=m[y],f=i.cartographicToCartesian(_,Sx),h.pack(f,s,b),b+=3}return b}$l.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??P.IDENTITY;let o=P.inverseTransformation(t,wat),r=P.multiplyByPoint(o,h.ZERO,kat),s=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_Y,CTe),CTe),a=cn.fromPointNormal(r,s,Uat),c=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_X,VTe),VTe),d=cn.fromPointNormal(r,c,Dat),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=Ti.lineSegmentPlane(m,f,a,Oat);if(l(y)){let _=h.multiplyByScalar(s,5e-9,Bat);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}};$l.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],Dq);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(y,Sx);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+=$l.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=Hat(y,_,s,i,S,Z,u,m)}Uq.length=0;let p=t[n-1],b=i.cartesianToCartographic(p,IB);b.height=r?o[n-1]:o;let f=i.cartographicToCartesian(b,Sx);return h.pack(f,u,d-3),u};var ETe=new pe,Jat=new pe;$l.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],Dq);if(o=r?o[0]:o,o!==0){let Z=i.geodeticSurfaceNormal(S,Sx);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],ETe),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],Jat),a+=$l.numberOfPointsRhumbLine(d,u,s),d=pe.clone(u,ETe);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=Kat(S,Z,s,i,R,C,p,b)}Uq.length=0;let f=t[n-1],y=i.cartesianToCartographic(f,IB);y.height=r?o[n-1]:o;let _=i.cartographicToCartesian(y,Sx);return h.pack(_,p,m-3),p};$l.generateCartesianArc=function(e){let t=$l.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};$l.generateCartesianRhumbArc=function(e){let t=$l.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 so=$l;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=ro.fromType(ro.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Mo(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=so.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(LTe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=me.fromPoints(this._actualPositions),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new me}var GTe=Mu.POSITION_INDEX=0,jat=Mu.SHOW_INDEX=1,Qat=Mu.WIDTH_INDEX=2,qat=Mu.MATERIAL_INDEX=3,RX=Mu.POSITION_SIZE_INDEX=4,$at=Mu.DISTANCE_DISPLAY_CONDITION=5,LTe=Mu.NUMBER_OF_PROPERTIES=6;function zb(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,zb(this,jat))}},positions:{get:function(){return this._positions},set:function(e){let t=Mo(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)&&zb(this,RX),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=me.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),zb(this,GTe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,zb(this,qat))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,zb(this,Qat))}},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,zb(this,RX)}}},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){Bt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),zb(this,$at))}}});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[GTe]>0||this._propertiesChanged[RX]>0;if((!P.equals(e,this._modelMatrix)||i)&&(this._segments=so.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=me.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=P.clone(e,this._modelMatrix),this._segments.positions.length!==t)zb(this,RX);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){zb(this,RX);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<LTe-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 Bm=Mu;var ect=Bm.SHOW_INDEX,tct=Bm.WIDTH_INDEX,Bq=Bm.POSITION_INDEX,nct=Bm.MATERIAL_INDEX,WTe=Bm.POSITION_SIZE_INDEX,ict=Bm.DISTANCE_DISPLAY_CONDITION,YTe=Bm.NUMBER_OF_PROPERTIES,Bd={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 ff(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(YTe),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(ff.prototype,{length:{get:function(){return zq(this),this._polylines.length}}});ff.prototype.add=function(e){let t=new Bm(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};ff.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};ff.prototype.removeAll=function(){Hq(this),DTe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};ff.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};ff.prototype.get=function(e){return zq(this),this._polylines[e]};function oct(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 l_(t,n,e._polylines.length)}var MTe=new An,wTe=new ce,kTe=new k;ff.prototype.update=function(e){if(zq(this),this._polylines.length===0||!this.show)return;dct(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(wt.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.");oct(this,t),this._createBatchTable=!1}if(this._createVertexArray||sct(this))ITe(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[WTe]||o[nct])ITe(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[Bq]&&p.writeUpdate(b,i,this._positionBuffer,n);break}b+=u[f].lengthOfPositions}if((o[ect]||o[tct])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Bq]||o[WTe]){let f=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=An.fromCartesian(f.center,MTe),_=ce.fromElements(y.low.x,y.low.y,y.low.z,f.radius,wTe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[ict]){let f=kTe;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<YTe;++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;rct(this,e,c,r)}};var CX=new me,vTe=new me;function rct(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=cct(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=me.clone(CX,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 w=Y[O];w.locator===R&&(N+=w.count)}let M;t.mode===se.SCENE3D?M=v._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?M=v._boundingVolume2D:t.mode===se.SCENE2D?l(v._boundingVolume2D)&&(M=me.clone(v._boundingVolume2D,vTe),M.center.x=0):l(v._boundingVolumeWC)&&l(v._boundingVolume2D)&&(M=me.union(v._boundingVolumeWC,v._boundingVolume2D,vTe)),c?(c=!1,me.clone(M,CX)):me.union(M,CX,CX)}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=me.clone(CX,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}ff.prototype.isDestroyed=function(){return!1};ff.prototype.destroy=function(){return UTe(this),Hq(this),DTe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function sct(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Bq]?(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 FTe=[0,0,0];function ITe(e,t,n){e._createVertexArray=!1,Hq(e),UTe(e),lct(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=it.createVertexBuffer({context:t,typedArray:y,usage:E});let L;l(S)&&(L=it.createVertexBuffer({context:t,typedArray:S,usage:E})),e._texCoordExpandAndBatchIndexBuffer=it.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=it.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,M=F+D,O=F+M,w=F+O,z=V*(I*W.SIXTY_FOUR_KILOBYTES)-N*I,K=[{index:Bd.position3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Bd.position3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Bd.position2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Bd.position2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Bd.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Bd.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Bd.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Bd.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Bd.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Bd.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Bd.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Bd.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Bd.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:J.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:z}],te,H,$,ee;f===se.SCENE3D?(H=e._positionBuffer,te="vertexBuffer",$=FTe,ee="value"):f===se.SCENE2D||f===se.COLUMBUS_VIEW?(H=FTe,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 act(e,t){return t instanceof vt?t.id:t}var PB=[];function cct(e){let t=ro._uniformList[e.type],n=t.length;PB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];PB[i]=r,PB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(PB,act)}`}function lct(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 $p(c,t,n)),d.addPolyline(a)}}}function dct(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 zq(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 Hq(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 UTe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}ff.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function DTe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Oq(e,t,n){this.count=e,this.offset=t,this.bucket=n}function $p(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}$p.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};$p.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,mS]}),r=t.getVertexShaderCallback()(nX),s=new Je({defines:i,sources:[kl,r]});this.shaderProgram=tn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Bd})};function OTe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===qt.INTERSECTING}$p.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!OTe(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,zm=new h,Hm=new h,XB=new h,uct=new ce,mct=new k;$p.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=XB,h.subtract(Z[0],Z[1],F),h.add(Z[0],F,F)):F=Z[D-1],h.clone(F,zm),h.clone(Z[D],Sa),D===C-1?b._loop?F=Z[1]:(F=XB,h.subtract(Z[C-1],Z[C-2],F),h.add(Z[C-1],F,F)):F=Z[D+1],h.clone(F,Hm);let M=R[A];D===L+M&&(L+=M,++A);let O=D-L===0,w=D===L+R[A]-1;c===se.SCENE2D&&(zm.z=0,Sa.z=0,Hm.z=0),(c===se.SCENE2D||c===se.MORPHING)&&(O||w)&&d-Math.abs(Sa.x)<1&&((Sa.x<0&&zm.x>0||Sa.x>0&&zm.x<0)&&h.clone(Sa,zm),(Sa.x<0&&Hm.x>0||Sa.x>0&&Hm.x<0)&&h.clone(Sa,Hm));let z=O?2:0,K=w?2:4;for(let te=z;te<K;++te){An.writeElements(Sa,e,n),An.writeElements(zm,e,n+6),An.writeElements(Hm,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=uct;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=mct;N.x=f,N.y=y?1:0;let g=c===se.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,V=An.fromCartesian(g.center,MTe),G=V.high,v=ce.fromElements(V.low.x,V.low.y,V.low.z,g.radius,wTe),X=kTe;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 hct=new h,fct=new h,pct=new h,PTe=new h;$p.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=PTe,h.subtract(a[0],a[1],b),h.add(a[0],b,b)):b=a[p-1],b=P.multiplyByPoint(n,b,fct);let f=P.multiplyByPoint(n,a[p],hct),y;p===d-1?s._loop?y=a[1]:(y=PTe,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,pct);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 bct=new Array(1);$p.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Oq(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=bct;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 Oq(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 Oq(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};$p.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 UC={positions:void 0,lengths:void 0},XTe=new Array(1),gct=new h,yct=new pe;$p.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return XTe[0]=n.length,UC.positions=n,UC.lengths=XTe,UC;OTe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=gct;for(let d=0;d<s;++d)a=n[d],c=P.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,yct)));if(o.length>0){e._boundingVolume2D=me.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return UC.positions=o,UC.lengths=e._segments.lengths,UC};var NTe;$p.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=NTe,c=6*s*3;!l(a)||a.length<c?a=NTe=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=XB,h.subtract(u[0],u[1],y),h.add(u[0],y,y)):y=u[_-1],h.clone(y,zm),h.clone(u[_],Sa),_===s-1?t._loop?y=u[1]:(y=XB,h.subtract(u[s-1],u[s-2],y),h.add(u[s-1],y,y)):y=u[_+1],h.clone(y,Hm);let S=m[b];_===f+S&&(f+=S,++b);let Z=_-f===0,R=_===f+m[b]-1;o===se.SCENE2D&&(zm.z=0,Sa.z=0,Hm.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(Z||R)&&r-Math.abs(Sa.x)<1&&((Sa.x<0&&zm.x>0||Sa.x>0&&zm.x<0)&&h.clone(Sa,zm),(Sa.x<0&&Hm.x>0||Sa.x>0&&Hm.x<0)&&h.clone(Sa,Hm));let C=Z?2:0,E=R?2:4;for(let A=C;A<E;++A)An.writeElements(Sa,a,p),An.writeElements(zm,a,p+6),An.writeElements(Hm,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var pf=ff;function Zx(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 Cu({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new qp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new pf,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Zx.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 xct(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 Tct=new Qn("createVectorTilePoints",5),_ct=new h;function Sct(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=xct(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=Tct.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,_ct),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)})}Zx.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 Ob(e,c,d,u,m)}};Zx.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 Zct(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=Ob.defaultPointSize,s.color=Ob.defaultColor,s.pointOutlineColor=Ob.defaultPointOutlineColor,s.pointOutlineWidth=Ob.defaultPointOutlineWidth,s.labelColor=U.WHITE,s.labelOutlineColor=U.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=xr.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=Oi.CENTER,s.verticalOrigin=Bn.CENTER,s.labelHorizontalOrigin=Oi.RIGHT,s.labelVerticalOrigin=Bn.BASELINE}}var Rct=new U,Cct=new U,Vct=new U,Ect=new U,Act=new U,Gct=new U,VX=new Kt,EX=new Kt,Kq=new Bt;Zx.prototype.applyStyle=function(e,t){if(!l(e)){Zct(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,Rct)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Cct)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Vct)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Ect)),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,Act)),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)?(VX.near=a.x,VX.nearValue=a.y,VX.far=a.z,VX.farValue=a.w,s.scaleByDistance=VX):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(EX.near=a.x,EX.nearValue=a.y,EX.far=a.z,EX.farValue=a.w,s.translucencyByDistance=EX):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Kq.near=a.x,Kq.far=a.y,s.distanceDisplayCondition=Kq):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,Gct)),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))}};Zx.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Sct(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)};Zx.prototype.isDestroyed=function(){return!1};Zx.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 AX=Zx;var nai=x(T(),1);function Hb(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=ni.BOTH}Object.defineProperties(Hb.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 Lct(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 Wct(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=nn.unpack(t,n),n+=nn.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 wp({color:c,offset:d,count:u,batchIds:p})}}var vct=new Qn("createVectorTilePolygons",5),Fct=new U;function Ict(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,Fct);s[y]=_.toRgba()}a=e._packedBuffer=Lct(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=vct.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];Wct(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),Pct(e),e._ready=!0}).catch(b=>{e.isDestroyed()||(e._error=b)})}function Pct(e){l(e._primitive)||(e._primitive=new L_({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)}Hb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Hb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Hb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Hb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Hb.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Ict(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)};Hb.prototype.isDestroyed=function(){return!1};Hb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var GX=Hb;var Aai=x(T(),1);var oai=x(T(),1),LX=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; -void main() -{ -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = u_modifiedModelView * currentPosition; -vec4 prev = u_modifiedModelView * previousPosition; -vec4 next = u_modifiedModelView * nextPosition; -float angle; -vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; +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); +} +float tmin = intersect.x; +float tmax = intersect.y; +vec3 p0 = ray.pos + tmin * ray.dir; +vec3 p1 = ray.pos + tmax * ray.dir; +vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); +vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); +bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); +bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); +if (p0InShadowCone && p1InShadowCone) { +return RayShapeIntersection(miss, miss); +} else if (p0InShadowCone) { +return RayShapeIntersection(intersect1, farSide); +} else if (p1InShadowCone) { +return RayShapeIntersection(-1.0 * farSide, intersect0); +} else { +return RayShapeIntersection(intersect0, intersect1); +} +} +void intersectShape(in Ray ray, 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; } -`;function bf(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(bf.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Xct(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 Nct=new Qn("createVectorTilePolylines",5),DC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Yct(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=Xct(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=Nct.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),Mct(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function Mct(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=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),u=it.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),m=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),p=it.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),b=it.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),f=it.createIndexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),y=[{index:DC.previousPosition,vertexBuffer:d,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:DC.currentPosition,vertexBuffer:u,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:DC.nextPosition,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:DC.expandAndWidth,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:2},{index:DC.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 WX=new P,BTe=new h;function wct(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,WX),P.multiplyByPoint(WX,e._center,BTe),P.setTranslation(WX,BTe,WX),WX},u_highlightColor:function(){return e._highlightColor}})}function kct(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 Uct=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; +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); } -`;function Dct(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(LX),o=n.getFragmentShaderCallback(!1,void 0,!1)(Uct),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[kl,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:DC})}function Oct(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)}bf.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};bf.prototype.getPositions=function(e){return bf.getPolylinePositions(this,e)};bf.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 na(e,r)}};bf.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Bct(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 zct=new U,Hct=U.WHITE,Kct=!0;bf.prototype.applyStyle=function(e,t){if(!l(e)){Bct(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,zct):Hct,s.show=l(e.show)?e.show.evaluate(s):Kct}};bf.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Yct(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}wct(this,t),Dct(this,t),kct(this);let n=e.passes;(n.render||n.pick)&&Oct(this,e)};bf.prototype.isDestroyed=function(){return!1};bf.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var hS=bf;var Rci=x(T(),1);var wai=x(T(),1);var zTe=new h,HTe=new h,KTe=new pe,Jq=new h,Jct=new h,JTe=new me,jct=new eo,vX=[new pe,new pe,new pe,new pe],FX=new k,Ds={};Ds.initialize=function(){let e=Ds._initPromise;return l(e)||(e=ve.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Ds._terrainHeights=t}),Ds._initPromise=e),e};Ds.getMinimumMaximumHeights=function(e,t){t=t??ne.default;let n=jTe(e),i=Ds._defaultMinTerrainHeight,o=Ds._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ds._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(re.northeast(e,KTe),zTe),t.cartographicToCartesian(re.southwest(e,KTe),HTe),h.midpoint(HTe,zTe,Jq);let a=t.scaleToGeodeticSurface(Jq,Jct);if(l(a)){let c=h.distance(Jq,a);i=Math.min(i,-c)}else i=Ds._defaultMinTerrainHeight}return i=Math.max(Ds._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Ds.getBoundingSphere=function(e,t){t=t??ne.default;let n=jTe(e),i=Ds._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ds._terrainHeights[r];l(s)&&(i=s[1])}let o=me.fromRectangle3D(e,t,0);return me.fromRectangle3D(e,t,i,JTe),me.union(o,JTe,o)};function jTe(e){pe.fromRadians(e.east,e.north,0,vX[0]),pe.fromRadians(e.west,e.north,0,vX[1]),pe.fromRadians(e.east,e.south,0,vX[2]),pe.fromRadians(e.west,e.south,0,vX[3]);let t=0,n=0,i=0,o=0,r=Ds._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=vX[c];if(jct.positionToTileXY(d,s,FX),c===0)i=FX.x,o=FX.y;else if(i!==FX.x||o!==FX.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}}Ds._terrainHeightsMaxLevel=6;Ds._defaultMaxTerrainHeight=9e3;Ds._defaultMinTerrainHeight=-1e5;Ds._terrainHeights=void 0;Ds._initPromise=void 0;Object.defineProperties(Ds,{initialized:{get:function(){return l(Ds._terrainHeights)}}});var Xi=Ds;var Uai=x(T(),1),IX=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; -void main() -{ -float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); -float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); -vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; -vec3 right = normalize(cross(forward, startEllipsoidNormal)); -vec4 position = vec4(startPositionAndHeight.xyz, 1.0); -position.xyz += forward * isEnd; -v_volumeUpEC = czm_normal * normalize(cross(right, forward)); -float offset; -vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); -offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); -offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; -position.xyz += offset * ellipsoidNormal; -position = u_modifiedModelView * position; -right = czm_normal * right; -vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); -scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); -vec3 miterPushNormal = czm_normal * normalize(scratchNormal); -offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); -offset = offset / dot(miterPushNormal, right); -position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); -gl_Position = czm_depthClamp(czm_projection * position); -position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); -vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; -v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); -v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); -position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); -vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; -v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); -v_halfWidth = endFaceNormalAndHalfWidth.w; +#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 Oai=x(T(),1),PX=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; -uniform vec4 u_highlightColor; -void main() -{ -float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME +`;var Bho=x(T(),1),rR=`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; } -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -eyeCoordinate /= eyeCoordinate.w; -float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); -halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); -float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); -float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); -float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); -if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME +#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; } -out_FragColor = u_highlightColor; -czm_writeDepthClamp(); } -`;function Kb(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(Xi._defaultMinTerrainHeight,Xi._defaultMaxTerrainHeight),this._boundingVolume=nn.fromRectangle(e.rectangle,Xi._defaultMinTerrainHeight,Xi._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(Kb.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=Xi.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;nn.fromRectangle(c,o,r,n,a)}function qct(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 $ct=new Qn("createVectorTileClampedPolylines"),Rx={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function elt(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=qct(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=$ct.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),tlt(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function tlt(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=it.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),p=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),b=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),f=it.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),y=it.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),_=it.createVertexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW}),S=it.createVertexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW}),Z=it.createIndexBuffer({context:t,typedArray:d,usage:Pe.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),R=[{index:Rx.startEllipsoidNormal,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Rx.endEllipsoidNormal,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Rx.startPositionAndHeight,vertexBuffer:b,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Rx.endPositionAndHeight,vertexBuffer:f,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Rx.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Rx.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Rx.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 XX=new P,QTe=new h;function nlt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,XX),P.multiplyByPoint(XX,e._center,QTe),P.setTranslation(XX,QTe,XX),XX},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function qTe(e){return ze.fromCache({cull:{enabled:!0,face:ki.FRONT},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function ilt(e){l(e._rs)||(e._rs=qTe(!1),e._rs3DTiles=qTe(!0))}function olt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(IX),o=n.getFragmentShaderCallback(!1,void 0,!0)(PX),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[kl,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Rx})}function rlt(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===ni.TERRAIN||i===ni.BOTH)&&t.commandList.push(n),(i===ni.CESIUM_3D_TILE||i===ni.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Kb.prototype.getPositions=function(e){return hS.getPolylinePositions(this,e)};Kb.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 na(e,r)}};Kb.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function slt(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 alt=new U,clt=U.WHITE,llt=!0;Kb.prototype.applyStyle=function(e,t){if(!l(e)){slt(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,alt):clt,s.show=l(e.show)?e.show.evaluate(s):llt}};function dlt(e){return Xi.initialize().then(function(){Qct(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Kb.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=dlt(this).then(elt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}nlt(this,t),olt(this,t),ilt(this);let n=e.passes;(n.render||n.pick)&&rlt(this,e)};Kb.prototype.isDestroyed=function(){return!1};Kb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var NX=Kb;var Lci=x(T(),1);var jq=32767,ult=new pe,mlt=new h;function hlt(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/jq),y=W.lerp(t.south,t.north,p/jq),_=W.lerp(n,i,b/jq),S=pe.fromRadians(f,y,_,ult),Z=o.cartographicToCartesian(S,mlt);h.pack(Z,d,u*3)}return d}var YX=hlt;var qq=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,ylt(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)||Qq(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)||Qq(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)||Qq(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 flt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function plt(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 gf=Uint32Array.BYTES_PER_ELEMENT;function blt(e){return new hS(e)}function glt(e){return new NX(e)}function ylt(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=gf;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=gf;let s=o.getUint32(n,!0);if(n+=gf,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=gf,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=gf;let d=o.getUint32(n,!0);n+=gf;let u=o.getUint32(n,!0);n+=gf;let m=o.getUint32(n,!0);n+=gf;let p=o.getUint32(n,!0);n+=gf;let b=o.getUint32(n,!0);n+=gf,n+=gf;let f=Wr(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let _,S;d>0&&(_=Wr(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 wh(e,E,_,S,flt(e));if(e._batchTable=A,E===0)return;let L=new af(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=plt(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 M=Y.reduce(function(H,$){return H+$*2},0),O=D.reduce(function(H,$){return H+$},0),w=new Uint32Array(t,n,O);n+=m;let z=new Uint16Array(t,n,M);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 GX({positions:z,counts:Y,indexCounts:D,indices:w,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 M=Y.reduce(function(K,te){return K+te*3},0),O=new Uint16Array(t,n,M);n+=b;let w=X.examineVectorLinesFunction;if(l(w)){let K=YX(new Uint16Array(O),I,N,g,ne.WGS84);xlt(K,Y,v.polylines,A,e.url,w)}let z=blt;l(X.classificationType)&&(z=glt),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 AX({positions:Y,batchIds:v.points,minimumHeight:N,maximumHeight:g,rectangle:I,batchTable:A,heightReference:X.heightReference,scene:X.scene})}}function Qq(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 xlt(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 MX=qq;var Sdi=x(T(),1);var dli=x(T(),1);var tli=x(T(),1);function OC(e,t){this._conditionsExpression=$e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,_lt(this,t)}Object.defineProperties(OC.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Tlt(e,t){this.condition=e,this.expression=t}function _lt(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 Tlt(new vm(a,t),new vm(c,t)))}e._runtimeConditions=n}OC.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)}};OC.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)}};OC.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); +#else +intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +return intersection; } -`,r};OC.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];ti(e,o.condition.getVariables()),ti(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var wX=OC;function Cx(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,Slt(this,e)}function Slt(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 Tr(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 wX(t,n)}else return;return t}function _r(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(Cx.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=Tr(this,e),this._style.show=_r(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Tr(this,e),this._style.color=_r(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Tr(this,e),this._style.pointSize=_r(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Tr(this,e),this._style.pointOutlineColor=_r(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Tr(this,e),this._style.pointOutlineWidth=_r(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Tr(this,e),this._style.labelColor=_r(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Tr(this,e),this._style.labelOutlineColor=_r(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Tr(this,e),this._style.labelOutlineWidth=_r(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Tr(this,e),this._style.font=_r(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Tr(this,e),this._style.labelStyle=_r(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Tr(this,e),this._style.labelText=_r(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Tr(this,e),this._style.backgroundColor=_r(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Tr(this,e),this._style.backgroundPadding=_r(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Tr(this,e),this._style.backgroundEnabled=_r(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Tr(this,e),this._style.scaleByDistance=_r(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Tr(this,e),this._style.translucencyByDistance=_r(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Tr(this,e),this._style.distanceDisplayCondition=_r(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Tr(this,e),this._style.heightOffset=_r(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Tr(this,e),this._style.anchorLineEnabled=_r(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Tr(this,e),this._style.anchorLineColor=_r(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Tr(this,e),this._style.image=_r(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Tr(this,e),this._style.disableDepthTestDistance=_r(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Tr(this,e),this._style.horizontalOrigin=_r(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Tr(this,e),this._style.verticalOrigin=_r(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Tr(this,e),this._style.labelHorizontalOrigin=_r(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Tr(this,e),this._style.labelVerticalOrigin=_r(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=Tr(this,e),this._style.lineWidth=_r(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Cx.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new Cx(n)})};Cx.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)};Cx.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)};Cx.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)};Cx.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ti(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ti(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ti(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Jb=Cx;var Tli=x(T(),1);var t_e=new re,$Te=new re,$q=new re,NB=new Map;NB.set(tl,{packCollectionData:Zs.packPolylineCollectionData,packTilePrimitives:Zs.packPolylineSegments});NB.set(Ya,{packCollectionData:Zs.packPolygonCollectionData,packTilePrimitives:Zs.packPolygonRings});var e$=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 NB.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,t_e);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:Zlt(t,o.ellipsoid)};for(let[d,u]of r){if(!e_e(u,i))continue;let m=re.fromBoundingSphere(d.boundingVolume,o.ellipsoid,$Te);if(!!!re.intersection(t,m,$q))continue;let b=NB.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&&(Zs.packPolylineGrid(s),Zs.packPolylineTextures(n,s)),c&&(Zs.packPolygonGrid(s),Zs.packPolygonTextures(n,s)),Zs.packPrimitiveTextures(n,s),s)}releaseTileData(t){Zs.freeResources(t)}updateTileData(t,n,i,o,r,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Rlt(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(!e_e(c,i))continue;let d=re.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,$Te),u=!!re.intersection(n,d,$q),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 e_e(e,t){return e===He.CLAMP_TO_GROUND||e===t}function Zlt(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 Rlt(e,t,n,i,o){if(i.length===0)return!1;let r=o.tileXYToRectangle(e,t,n,t_e);for(let s=0;s<i.length;s++)if(re.intersection(r,i[s],$q))return!0;return!1}var jb=e$;var edi=x(T(),1);var Pli=x(T(),1);var n_e=new Ac,i_e=new ya,o_e=new Fr,Clt=new Oh,Vlt=new Eu,Elt=new Vu,t$=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 na.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(Id,n_e),yield*this._iteratePrimitivesWith(tl,i_e),yield*this._iteratePrimitivesWith(Ya,o_e)}*_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(Id,n_e,Clt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(tl,i_e,Vlt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Ya,o_e,Elt)}*_iterateMaterialsWith(t,n,i){for(let o of this._iteratePrimitivesWith(t,n))o.getMaterial(i),yield i,o.setMaterial(i)}},fS=t$;var r_e=new h,Alt=new Ac,Glt=new ya,a_e=new Fr;function Llt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let o=0;o<n.length;o++)c_e(e,n[o],P.IDENTITY,i);return i}function YB(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?Ta.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:s_e(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=s_e(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 s_e(e){let t=YB(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function vlt(e,t,n,i,o){let r=Zt.getAttributeBySemantic(t,dt.POSITION),s=r.typedArray??(n.positionNormalized?Ta.readAttributeAsRawCompactTypedArray(r):Ta.readAttributeAsTypedArray(r)),a=t.indices?Ta.readIndicesAsTypedArray(t.indices):void 0,c=Flt(e,t,o);n instanceof Id?Ilt(n,i,s,a,c):n instanceof tl?Plt(n,i,s,a,c):n instanceof Ya&&(l(t.vector)?Xlt(n,i,s,a,c,t.vector):Nlt(n,i,s,c,t.polygon))}function Flt(e,t,n){let i=e.tileset.featureIdLabel,o=Zt.getFeatureIdsByLabel(t.featureIds,i);if(!(o instanceof Rn.FeatureIdAttribute))return()=>{};let r=Zt.getAttributeBySemantic(t,dt.FEATURE_ID,o.setIndex),s=r.typedArray??Ta.readAttributeAsTypedArray(r);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let d=new fS(e,c,o.propertyTableId);n.set(c,d)}}return function(c){let d=s[c];if(d!==o.nullFeatureId)return n.get(d)}}function Ilt(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,r_e);let d=o(c);d&&d.addPrimitiveByCollection(t,s),e.add({position:r_e,pickObject:d,featureId:d?.featureId},Alt)}}function Plt(e,t,n,i,o){let r=YB(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=l_e(n,p,3),f=o(i[s]);f&&f.addPrimitiveByCollection(t,c),e.add({positions:b,pickObject:f,featureId:f?.featureId},Glt),s=d+1,a=0,c++}}function Xlt(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},a_e)}}function Nlt(e,t,n,i,o){let r=o.loopIndices.constructor,s=new r(o.loopIndices.length),a=YB(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=l_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},a_e)}}function c_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 Id({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):u===Ie.LINE_STRIP?m=new tl({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),vlt(e,d,m,i.collections.length-1,i.featuresByTableId.get(S))}let a=t.children;for(let c=0;c<a.length;c++)c_e(e,a[c],r,i)}function l_e(e,t,n,i){let o=YB(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=Llt;var MB=new Ac,wB=new ya,kB=new Fr,UX=new Oh,n$=new Eu,d_e=new Vu,u_e=new P,i$=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 Id).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Ya?t+n.triangleCount:n instanceof tl?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 Jb({color:i}))}applyStyle(t){let n=r=>r instanceof Id,i=r=>r instanceof tl,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,MB);let d=this.getFeature(MB.featureId,s);l(t.show)&&(MB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,UX.color),l(t.pointSize)&&(UX.size=t.pointSize.evaluate(d)),l(t.pointOutlineWidth)&&(UX.outlineWidth=t.pointOutlineWidth.evaluate(d)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(d,UX.outlineColor),MB.setMaterial(UX)}}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,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$.color),l(t.lineWidth)&&(n$.width=t.lineWidth.evaluate(d)),wB.setMaterial(n$)}}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,kB);let d=this.getFeature(kB.featureId,s);l(t.show)&&(kB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,d_e.color),kB.setMaterial(d_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&&(Mlt(this),this._ready=!0)}P.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,u_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(u_e,this._collectionLocalMatrices[s],a.modelMatrix),!bs(i._heightReference)||!jb.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,ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),s=Ylt(t,n,r,o),a=await Nu.fromGltfAsync(s);return a.show=!1,r._model=a,r}};function Ylt(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 Mlt(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 Vx=i$;var Uui=x(T(),1);var Lui=x(T(),1);var Adi=x(T(),1);function lc(){}lc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);lc._sorterTaskProcessor=void 0;lc._taskProcessorReady=!1;lc._error=void 0;lc._getSorterTaskProcessor=function(){if(!l(lc._sorterTaskProcessor)){let e=new Qn("gaussianSplatSorter",lc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?lc._taskProcessorReady=!0:lc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{lc._error=t}),lc._sorterTaskProcessor=e}return lc._sorterTaskProcessor};lc.radixSortIndexes=function(e){let t=lc._getSorterTaskProcessor();if(l(lc._error))throw lc._error;if(lc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var pS=lc;var Idi=x(T(),1);function dc(){}dc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);dc._textureTaskProcessor=void 0;dc._taskProcessorReady=!1;dc._error=void 0;dc._getTextureTaskProcessor=function(){if(!l(dc._textureTaskProcessor)){let e=new Qn("gaussianSplatTextureGenerator",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._textureTaskProcessor=e}return dc._textureTaskProcessor};dc.generateFromAttributes=function(e){let t=dc._getTextureTaskProcessor();if(l(dc._error))throw dc._error;if(!dc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var DX=dc;var kdi=x(T(),1);function wlt(e){let t=new Tb;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL}})),this.alphaOptions=new rS,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT)}var OX=wlt;var Ddi=x(T(),1),BX=`#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; +`;var Hho=x(T(),1),i9=`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); } -vec3 halfToVec3(uvec2 packed) { -return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +return shapeUv / u_boxLocalToShapeUvScale; } -vec3 loadAndExpandSHCoeff(uint splatID, int index) { -uvec2 coeff = loadSHCoeff(splatID, index); -return halfToVec3(coeff); +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 dPosition = u_boxEcToXyz * positionEC; +return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w); } -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; +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 Jho=x(T(),1),o9=`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); } +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); } -return result; +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 -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) -); +dy *= u_cylinderLocalToShapeUvScale.y; +float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); } -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; +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); } -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; +#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); } -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; +`;var Qho=x(T(),1),r9=`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 -v_splitDirection = u_splitDirection; +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 Bdi=x(T(),1),zX=`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; +return vec3(v * sign(pos), length(v - evolute)); } -float B = exp(A * 4.) * v_splatColor.a ; -out_FragColor = vec4(v_splatColor.rgb * B , B); +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); } -`;var bS=new P,g_e=new P,HX=new P,Ei=new q,KX=new Ne,klt=new h,Ult=new Ne,Dlt=new h,Olt=1e-12,UB=1e-5,o$=1e-7,Ba={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Os={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Blt=2,zlt=30,Hlt=3,Klt=.008726646259971648,Jlt=1;function jlt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Hlt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Jlt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Klt:!1}function m_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 Qlt(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 h_e(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function r$(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function f_e(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function qlt(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 $lt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function edt(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=$lt(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 tdt(e,t){return e.length===t?e:e.subarray(0,t)}function ndt(e,t,n){if(!l(t.indexes)||t.state!==Os.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&&f_e(e,r,i);let s=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&f_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=Ba.IDLE,e._dirty=!1}async function idt(e,t,n,i){try{let o=await i,r=wt.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=Os.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=b_e(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let b=n.gaussianSplatTexture;n.gaussianSplatTexture=b_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=wt.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=rdt(t.context,{data:R,width:f,height:Z}),l(b)&&b.destroy()}}n.state=Os.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=Os.BUILDING}}async function odt(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===Os.SORTING&&(n.snapshot.state=Os.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=Os.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,ndt(e,c,t),e._pendingSnapshot=void 0,ed.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Os.SORTING&&(n.snapshot.state=Os.TEXTURE_READY),e._sorterState=Ba.ERROR,e._sorterError=o}}async function p_e(e,t,n){try{let i=await n,o=h_e(e,t),r=t?.expectedCount,s=r,a=i?.length;if(!o||(r!==s||a!==r)){o&&(e._sorterPromise=void 0,e._sorterState=Ba.IDLE);return}e._indexes=i,e._sorterState=Ba.SORTED}catch(i){if(!h_e(e,t))return;e._sorterState=Ba.ERROR,e._sorterError=i}}function rdt(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:Ot.NEAREST})}function b_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:Ot.NEAREST})}function ed(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=Ur.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(Di.Y,Di.X,new P),this._shInverseRotation=new q,this._isDestroyed=!1,this._sorterState=Ba.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(ed.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Os.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});ed.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)};ed.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,r$(this._pendingSnapshot),r$(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)};ed.prototype.isDestroyed=function(){return this._isDestroyed};ed.prototype.onTileLoad=function(e){this._dirty=!0};ed.prototype.onTileVisible=function(e){};ed.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,bS);P.multiplyTransformation(r,e.content.worldTransform,r);let s=P.inverse(o,g_e),a=P.multiplyTransformation(s,r,bS),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&P.equalsEpsilon(a,c,Olt))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)<=o$&&Math.abs(b-1)<=o$&&Math.abs(f-1)<=o$,R=Math.abs(y)<=UB&&Math.abs(_)<=UB&&Math.abs(S)<=UB,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)<=UB;Ne.fromRotationMatrix(Ei,KX),Ne.normalize(KX,KX);let A=Zt.getAttributeBySemantic(n,dt.POSITION).typedArray,L=Zt.getAttributeBySemantic(n,dt.ROTATION).typedArray,F=Zt.getAttributeBySemantic(n,dt.SCALE).typedArray,I=klt,N=Ult,g=Dlt;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(KX,N,N),Ne.normalize(N,N)):(P.fromTranslationQuaternionRotationScale(I,N,g,HX),P.multiplyTransformation(a,HX,HX),P.getTranslation(HX,I),P.getScale(HX,g),Ne.multiply(KX,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};ed.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Os.BUILDING)return;n.state=Os.TEXTURE_PENDING;let i=DX.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=Os.BUILDING;return}idt(e,t,n,i)};ed.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new OX(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(BX),o.addFragmentLines(zX);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 Rn.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=_};ed.prototype.update=function(e){let t=this._tileset;if(qlt(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===Ba.IDLE){let o=t._selectedTiles.length!==0&&Qlt(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>=Blt,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>=zlt;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=Ba.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&r$(this._pendingSnapshot);let d=t._selectedTiles;this._rootTransform=_t.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=d[0],E=P.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,g_e);P.multiplyTransformation(E,C.content.worldTransform??P.IDENTITY,E),P.getRotation(P.inverse(E,E),this._shInverseRotation)}for(let C of d)ed.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=edt(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 tdt(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:Os.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===Os.BUILDING){ed.generateSplatTexture(this,e,d);return}if(d.state===Os.TEXTURE_PENDING||d.state===Os.TEXTURE_READY&&!l(d.gaussianSplatTexture)||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,bS),d.state===Os.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=pS.radixSortIndexes({primitive:{positions:new Float32Array(d.positions),modelView:Float32Array.from(bS),count:d.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,d.state=Os.TEXTURE_READY;return}this._pendingSortPromise=p,d.state=Os.SORTING;let b=this._pendingSort;odt(this,e,b,p);return}if(!l(this._pendingSortPromise)){d.state===Os.SORTING&&(d.state=Os.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,bS),!l(this._sorterPromise)){if(!jlt(this,e))return;let d=++this._sortRequestId,u=this._splatDataGeneration,m=this._numSplats;this._activeSort={requestId:d,dataGeneration:u,expectedCount:m};let p=pS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(bS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){m_e(this,e);let b=this._activeSort;this._sorterState=Ba.SORTING,p_e(this,b,p);return}}if(!l(this._sorterPromise)){this._sorterState=Ba.WAITING;return}this._sorterState=Ba.SORTING;return}else if(this._sorterState===Ba.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=pS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(bS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){m_e(this,e);let c=this._activeSort;this._sorterState=Ba.SORTING,p_e(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Ba.WAITING;return}this._sorterState=Ba.SORTING;return}else{if(this._sorterState===Ba.SORTING)return;if(this._sorterState===Ba.SORTED)ed.buildGSplatDrawCommand(this,e),this._sorterState=Ba.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Ba.ERROR)throw this._sorterError}this._dirty=!1}};var JX=ed;var a$=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 JX({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:Di.Y,forwardAxis:Di.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 Iu(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}=adt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=o,this._sphericalHarmonicsCoefficientCount=r,this._packedSphericalHarmonicsData=udt(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 sdt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function adt(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 y_e=new ArrayBuffer(4),cdt=new Float32Array(y_e),ldt=new Uint32Array(y_e);function s$(e){cdt[0]=e;let t=ldt[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 ddt(e){let t=sdt(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 udt(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}=ddt(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]=s$(r[d].typedArray[y])|s$(r[d].typedArray[y+1])<<16,o[f+1]=s$(r[d].typedArray[y+2])}}return o}var Ex=a$;var x_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 L2.fromTileType(e,t,n,i,o,x_e)},externalTileset:function(e,t,n,i){return QP.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new v2(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new MX(e,t,n,i,o)},subt:function(e,t,n,i,o){return iC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return iC.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 Ex.tilesetRequiresGaussianSplattingExt(e)?Ex.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Vx.fromGltf(e,t,n,c):Yu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Ex.tilesetRequiresGaussianSplattingExt(e)?Ex.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Vx.fromGltf(e,t,n,i):Yu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Yu.fromGeoJson(e,t,n,i)}},gS=x_e;var tmi=x(T(),1),T_e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(T_e);var Io=T_e;var imi=x(T(),1),Km={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"};Km.isBinaryFormat=function(e){switch(e){case Km.BATCHED_3D_MODEL:case Km.INSTANCED_3D_MODEL:case Km.COMPOSITE:case Km.POINT_CLOUD:case Km.VECTOR:case Km.GEOMETRY:case Km.IMPLICIT_SUBTREE:case Km.VOXEL_BINARY:case Km.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Km);var Za=Km;var rmi=x(T(),1),__e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(__e);var Jm=__e;var ami=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},Qb=new Array(Ra.NUMBER_OF_PASSES);Qb[Ra.RENDER]=Object.freeze({pass:Ra.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Qb[Ra.PICK]=Object.freeze({pass:Ra.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Qb[Ra.SHADOW]=Object.freeze({pass:Ra.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Qb[Ra.PRELOAD]=Object.freeze({pass:Ra.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qb[Ra.PRELOAD_FLIGHT]=Object.freeze({pass:Ra.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qb[Ra.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ra.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qb[Ra.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ra.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qb[Ra.MOST_DETAILED_PICK]=Object.freeze({pass:Ra.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ra.getPassOptions=function(e){return Qb[e]};Object.freeze(Ra);var cr=Ra;var dmi=x(T(),1);var c$=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)}},e0=c$;var _mi=x(T(),1);var fmi=x(T(),1);function qb(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(qb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});qb.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};qb.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};qb.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};qb.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};qb.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};qb.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};qb.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var jX=qb;function l$(e,t){let n=oo(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){l$._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 jX({content:n,class:o})}}l$._oneTimeWarning=xt;var yS=l$;var Cmi=x(T(),1);function mdt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=oo(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 xS=mdt;var Xmi=x(T(),1);var Gmi=x(T(),1);function $b(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($b.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});$b.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};$b.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};$b.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};$b.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};$b.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};$b.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};$b.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var QX=$b;function d$(e,t){let n=oo(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){d$._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 QX({tile:n,class:o})}}d$._oneTimeWarning=xt;var qX=d$;var ohi=x(T(),1);var Dmi=x(T(),1);function hdt(e){let t=new Uint8Array(e),n=jh(t);if(n==="glTF"&&(n="glb"),Za.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=fdt(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 fdt(e){let t;try{t=Wr(e)}catch{throw new ae("Invalid tile content.")}return t}var eg=hdt;var u$=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(!pdt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;m$(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=bdt(this,i,n,this._tile._contentState);return gdt(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 ue(this)}};function m$(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function S_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 pdt(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 bdt(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){S_e(e,i);return}return m$(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){S_e(e,i);return}m$(e,-1),Z_e(e,t,u)}})}async function gdt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>ydt(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 ydt(e,t,n){if(l(t))try{let i=eg(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=gS[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=yS(o,d));let u=xS(o,d);return l(u)&&(a.group=new E_({metadata:u})),a}catch(i){Z_e(e,n,i)}}function Z_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 $X=u$;var Cpi=x(T(),1);var Fhi=x(T(),1);var fhi=x(T(),1);var R_e=Math.cos,C_e=Math.sin,xdt=Math.sqrt,h$={};h$.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=R_e(u),p=C_e(u),b=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,y=m*R_e(f),_=m*C_e(f),S=a.x*y,Z=a.y*_,R=xdt(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 Tdt=new Ji,jm=new h,_dt=new pe,DB=new h,eN=new Ui;function V_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;eN._ellipsoid=ne.default,jm=eN.project(e,jm),jm=h.subtract(jm,DB,jm);let b=Ji.fromRotation(t,Tdt);jm=Ji.multiplyByVector(b,jm,jm),jm=h.add(jm,DB,jm),e=eN.unproject(jm,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}}h$.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,_dt);(n!==0||i!==0)&&(C.longitude<R.longitude&&(C.longitude+=W.TWO_PI),eN._ellipsoid=ne.default,DB=eN.project(C,DB));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=V_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=V_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=h$;var Sdt=new me,Zdt=new me,Rdt=new h,Cdt=new re;function E_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=Rdt;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 Cn,primitiveType:Ie.LINES});return R.attributes.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m}),R.indices=S,R}function Vdt(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=E_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 zC(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"}zC.packedLength=re.packedLength+ne.packedLength+5;zC.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 A_e=new re,G_e=ne.clone(ne.UNIT_SPHERE),BC={rectangle:A_e,ellipsoid:G_e,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};zC.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,A_e);t+=re.packedLength;let o=ne.unpack(e,t,G_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):(BC.granularity=r,BC.height=s,BC.rotation=a,BC.extrudedHeight=c,BC.offsetAttribute=d===-1?void 0:d,new zC(BC))};var Edt=new pe;zC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ca.computeOptions(t,e._granularity,e._rotation,0,Cdt,Edt),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=Vdt(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,b=new Uint8Array(p);e._offsetAttribute===yn.TOP?b=b.fill(1,0,p/2):(d=e._offsetAttribute===yn.NONE?0:1,b=b.fill(d)),o.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let u=me.fromRectangle3D(t,n,s,Zdt),m=me.fromRectangle3D(t,n,a,Sdt);r=me.union(u,m)}else{if(o=E_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===yn.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=me.fromRectangle3D(t,n,s)}return new At({attributes:o.attributes,indices:o.indices,primitiveType:Ie.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var TS=zC;var jhi=x(T(),1);var Phi=x(T(),1),tN=`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); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float longitude = shapeUv.x * czm_twoPi; +#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +longitude /= u_ellipsoidLocalToShapeUvScale.x; #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); +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 Nhi=x(T(),1),nN=`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; +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); } -`;var Mhi=x(T(),1),_S=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); +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); } -`;var khi=x(T(),1),iN=`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; +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); } -`;function tg(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?iN:nN,r=i?_S:tN,s=i?tg.FLAT_VERTEX_FORMAT:tg.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=Eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(tg.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}}});tg.VERTEX_FORMAT=Me.POSITION_AND_NORMAL;tg.FLAT_VERTEX_FORMAT=Me.POSITION_ONLY;tg.prototype.getFragmentShaderSource=Eo.prototype.getFragmentShaderSource;tg.prototype.isTranslucent=Eo.prototype.isTranslucent;tg.prototype.getRenderState=Eo.prototype.getRenderState;var Tn=tg;var spi=x(T(),1);var qhi=x(T(),1);function Adt(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var oN=Adt;var gfi=x(T(),1);var nfi=x(T(),1);function rN(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(rN.prototype,{componentDatatype:{get:function(){return J.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});rN.fromCartesian3=function(e){return new rN(e.x,e.y,e.z)};rN.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 Co=rN;function Gdt(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(!P.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&zn.transformToWorldCoordinates(e[r]);else P.multiplyTransformation(t,e[0].modelMatrix,t)}function f$(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function Ldt(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?f$(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(f$(i.westHemisphereGeometry,n),f$(i.eastHemisphereGeometry,n))}}function Wdt(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,d,u,m=t.length;for(c=0;c<m;++c)if(l(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(Gdt(t,a,o),!o)for(c=0;c<m;++c)l(t[c].geometry)&&zn.splitLongitude(t[c]);if(Ldt(t),r)for(c=0;c<m;++c){let b=t[c];l(b.geometry)?(zn.reorderForPostVertexCache(b.geometry),zn.reorderForPreVertexCache(b.geometry)):l(b.westHemisphereGeometry)&&l(b.eastHemisphereGeometry)&&(zn.reorderForPostVertexCache(b.westHemisphereGeometry),zn.reorderForPreVertexCache(b.westHemisphereGeometry),zn.reorderForPostVertexCache(b.eastHemisphereGeometry),zn.reorderForPreVertexCache(b.eastHemisphereGeometry))}let p=zn.combineInstances(t);for(m=p.length,c=0;c<m;++c){d=p[c];let b=d.attributes;if(o)for(let f in b)b.hasOwnProperty(f)&&b[f].componentDatatype===J.DOUBLE&&zn.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in b)if(b.hasOwnProperty(f)&&b[f].componentDatatype===J.DOUBLE){let y=`${f}3D`,_=`${f}2D`;zn.projectTo2D(d,f,y,_,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=me.fromVertices(d.attributes.position2D.values)),zn.encodeAttribute(d,y,`${y}High`,`${y}Low`),zn.encodeAttribute(d,_,`${_}High`,`${_}Low`)}s&&zn.compressVertices(d)}if(!i){let b=[];for(m=p.length,c=0;c<m;++c)d=p[c],b=b.concat(zn.fitToUnsignedShortIndices(d));p=b}return p}function p$(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;d<c;++d){let m=e[d][t];if(!l(m))continue;let p=m.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function vdt(e,t){let n=[];return p$(e,"geometry",t,n),p$(e,"westHemisphereGeometry",t,n),p$(e,"eastHemisphereGeometry",t,n),n}var ng={};ng.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=Wdt(e),t.length>0&&(n=zn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=vdt(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let m=i[u],p=m.geometry;l(p)&&(c[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=m.geometry.offsetAttribute));let b=m.eastHemisphereGeometry,f=m.westHemisphereGeometry;l(b)&&l(f)&&(l(b.boundingSphere)&&l(f.boundingSphere)&&(c[u]=me.union(b.boundingSphere,f.boundingSphere)),l(b.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=me.union(b.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function Fdt(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function Idt(e,t){let n=e.length;for(let i=0;i<n;++i)Fdt(e[i],t)}function Pdt(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*me.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}ng.packCreateGeometryResults=function(e,t){let n=new Float64Array(Pdt(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],d=l(c);if(n[s++]=d?1:0,!d)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let u=l(c.boundingSphere)?1:0;n[s++]=u,u&&me.pack(c.boundingSphere,n,s),s+=me.packedLength;let m=l(c.boundingSphereCV)?1:0;n[s++]=m,m&&me.pack(c.boundingSphereCV,n,s),s+=me.packedLength;let p=c.attributes,b=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(b.push(y),l(o[y])||(o[y]=i.length,i.push(y)));n[s++]=b.length;for(let y=0;y<b.length;y++){let _=b[y],S=p[_];n[s++]=o[_],n[s++]=S.componentDatatype,n[s++]=S.componentsPerAttribute,n[s++]=S.normalize?1:0,n[s++]=S.values.length,n.set(S.values,s),s+=S.values.length}let f=l(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};ng.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let m,p;n[s++]===1&&(m=me.unpack(n,s)),s+=me.packedLength,n[s++]===1&&(p=me.unpack(n,s)),s+=me.packedLength;let y,_,S,Z=new Cn,R=n[s++];for(i=0;i<R;i++){let E=t[n[s++]],A=n[s++];S=n[s++];let L=n[s++]!==0;y=n[s++],_=J.createTypedArray(A,y);for(let F=0;F<y;F++)_[F]=n[s++];Z[E]=new Xe({componentDatatype:A,componentsPerAttribute:S,normalize:L,values:_})}let C;if(y=n[s++],y>0){let E=_.length/S;for(C=Oe.createTypedArray(E,y),i=0;i<y;i++)C[i]=n[s++]}o[r++]=new At({primitiveType:c,geometryType:d,boundingSphere:m,boundingSphereCV:p,indices:C,attributes:Z,offsetAttribute:u})}return o};function Xdt(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(P.pack(s.modelMatrix,i,o),o+=P.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function Ndt(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=P.unpack(t,o),s;o+=P.packedLength,l(t[o])&&(s={offset:new Co(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}ng.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:Xdt(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}};ng.unpackCombineGeometryParameters=function(e){let t=Ndt(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=ng.unpackCreateGeometryResults(n[a]),d=c.length;for(let u=0;u<d;u++){let m=c[u],p=t[o];p.geometry=m,++o}}let r=ne.clone(e.ellipsoid),s=e.isGeographic?new Ui(r):new xi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:P.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function L_e(e){let t=e.length,n=1+(me.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,me.pack(e[r],i,o)):i[o++]=0,o+=me.packedLength}return i}function W_e(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=me.unpack(e,i)),++n,i+=me.packedLength;return t}ng.packCombineGeometryResults=function(e,t){l(e.geometries)&&Idt(e.geometries,t);let n=L_e(e.boundingSpheres),i=L_e(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}};ng.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:W_e(e.boundingSpheres),boundingSpheresCV:W_e(e.boundingSpheresCV)}};var SS=ng;var xfi=x(T(),1),v_e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(v_e);var os=v_e;function rs(e){e=e??B.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=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,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??Wn.DISABLED,this._translucent=void 0,this._state=os.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(rs.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 Ydt(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var Mdt=new k,wdt=new h,k_e=new ce;function U_e(e){let t=e.length;if(t===1)return e[0];if(t===2)return k.unpack(e,0,Mdt);if(t===3)return h.unpack(e,0,wdt);if(t===4)return ce.unpack(e,0,k_e)}function kdt(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=Ydt(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,b,f,y;for(b=0;b<s;++b)f=r[b],y=p[f],c[f]=b,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:J.FLOAT,componentsPerAttribute:1}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:J.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let _=a.length,S=new l_(t,a,o);for(b=0;b<o;++b){let Z=i[b];p=Z.attributes;for(let L=0;L<s;++L){f=r[L],y=p[f];let F=U_e(y.value),I=c[f];S.setBatchedAttribute(b,I,F)}let R={primitive:Z.pickPrimitive??e};l(Z.id)&&(R.id=Z.id);let C=t.createPickId(R);e._pickIds.push(C);let E=C.color,A=k_e;A.x=U.floatToByte(E.red),A.y=U.floatToByte(E.green),A.z=U.floatToByte(E.blue),A.w=U.floatToByte(E.alpha),S.setBatchedAttribute(b,_-1,A)}e._batchTable=S,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function Udt(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Xe({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function Ddt(e){let t=e.attributes,n=new Cn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=Udt(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new At({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:me.clone(e.boundingSphere)})}function Odt(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:P.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var Bdt=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;rs._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=Bdt.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c}; -`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView; -`,r+=`in vec4 position; -`,s+=`${c} -{ - return u_modifiedModelView * position; +#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); } - -`,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); +`;var $ho=x(T(),1),s9=`#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 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); } - -`:(r+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} -{ - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; +int normU8x2_toInt(in vec2 value) { +return int(value.x * 255.0) + 256 * int(value.y * 255.0); } - -`)}return[o,r,t,s].join(` -`)};rs._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Je.replaceMain(t,"czm_non_show_main")} -void main() -{ - czm_non_show_main(); - gl_Position *= czm_batchTable_show(batchId); -}`:t};rs._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 F_e(e){return`${Je.replaceMain(e,"czm_non_pick_main")} -out vec4 v_pickColor; -void main() -{ - czm_non_pick_main(); - v_pickColor = czm_batchTable_pickColor(batchId); -}`}function I_e(e){return`in vec4 v_pickColor; -${e}`}rs._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};rs._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; -`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition(); -`;return o+=` if (czm_sceneMode == czm_sceneMode3D) -`,o+=` { -`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` } -`,o+=` else -`,o+=` { -`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` } -`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};rs._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Je.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main() -{ - czm_non_distanceDisplayCondition_main(); - vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId); - vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId); - vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId); - float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId); -`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); -`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId); - vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId); - vec4 centerRTE; - if (czm_morphTime == 1.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${o}`};function P_e(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; -`,m+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(u+=`vec3 normal; -`,m+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""}); -`),o&&(u+=`vec3 tangent; -`,m+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"}); -`),r&&(u+=`vec3 bitangent; -`,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() -{ -${m} czm_non_compressed_main(); -}`;return[d,u,p,b].join(` -`)}function zdt(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 Hdt(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(); - #else - czm_writeDepthClamp(); - #endif +float normU8x2_toFloat(in vec2 value) { +return float(normU8x2_toInt(value)) / 65535.0; } -`,t}function X_e(e,t){let n=e.vertexAttributes}function Kdt(e,t){return function(){return e[t]}}var b$=Math.max(fn.hardwareConcurrency-1,1),OB,Jdt=new Qn("combineGeometry");function jdt(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===os.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),d.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(OB))for(OB=new Array(b$),o=0;o<b$;o++)OB[o]=new Qn("createGeometry");let u;for(d=oN(d,b$),o=0;o<d.length;o++){let m=0,p=d[o],b=p.length;for(r=0;r<b;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=m,m+=i.constructor.packedLength??i.packedLength);let f;if(m>0){let y=new Float64Array(m);for(f=[y.buffer],r=0;r<b;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,u.offset),u.geometry=y)}c.push(OB[o].scheduleTask({subTasks:d[o]},f))}e._state=os.CREATING,Promise.all(c).then(function(m){e._createGeometryResults=m,e._state=os.CREATED}).catch(function(m){aN(e,t,os.FAILED,m)})}else if(e._state===os.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,d=t.mapProjection,u=Jdt.scheduleTask(SS.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=os.COMBINING,Promise.resolve(u).then(function(m){let p=SS.unpackCombineGeometryResults(m);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=P.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=os.COMBINED):aN(e,t,os.FAILED,void 0)}).catch(function(m){aN(e,t,os.FAILED,m)})}}function Qdt(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,b;l(p.attributes)&&l(p.primitiveType)?b=Ddt(p):b=p.constructor.createGeometry(p),o[c++]=Odt(s,b),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,m=SS.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=P.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=os.COMBINED):aN(e,t,os.FAILED,void 0)}function qdt(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new me;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],_=e._batchTable.getBatchedAttribute(i,n,new h);y=r[i].clone(y),z_e(y,_,o[i])}let c=[],d=[],u=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||me.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;i<c.length;i++)m=me.union(m,c[i]);for(i=1;i<u.length;i++)p=me.union(p,u[i]);for(i=1;i<d.length;i++)b=me.union(b,d[i]);let f=[];for(l(m)&&f.push(m),l(p)&&f.push(p),l(b)&&f.push(b),i=0;i<f.length;i++){let y=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=me.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}rs._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var N_e=new An,D_e=new pe,O_e=new h,B_e=new me;function $dt(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,d=t.mapProjection,u=d.ellipsoid,m=e._batchTable,p=e._instanceBoundingSpheres,b=p.length;for(let f=0;f<b;++f){let y=p[f];if(!l(y))continue;let _=e.modelMatrix;l(_)&&(y=me.transform(y,_,B_e));let S=y.center,Z=y.radius,R=An.fromCartesian(S,N_e);if(m.setBatchedAttribute(f,o,R.high),m.setBatchedAttribute(f,r,R.low),!t.scene3DOnly){let C=u.cartesianToCartographic(S,D_e),E=d.project(C,O_e);R=An.fromCartesian(E,N_e),m.setBatchedAttribute(f,s,R.high),m.setBatchedAttribute(f,a,R.low)}m.setBatchedAttribute(f,c,Z)}e._batchTableBoundingSpheresUpdated=!0}var g$=new h,eut=new h;function Y_e(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let d=0;d<c;++d){let u=a[d];if(!l(u))continue;let m=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(h.equals(m,h.ZERO)){s.setBatchedAttribute(d,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(u=me.transform(u,p,B_e));let b=u.center;b=r.scaleToGeodeticSurface(b,eut);let f=r.cartesianToCartographic(b,D_e),y=o.project(f,O_e),_=h.add(m,b,g$);f=r.cartesianToCartographic(_,f);let S=o.project(f,g$),Z=h.subtract(S,y,g$),R=Z.x;Z.x=Z.z,Z.z=Z.y,Z.y=R,s.setBatchedAttribute(d,i,Z)}e._batchTableOffsetsUpdated=!0}function tut(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let d=i[c];if(s.push(Un.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Pe.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(me.clone(d.boundingSphere)),e._boundingSphereWC.push(new me),!o){let u=d.boundingSphereCV.center,m=u.x,p=u.y,b=u.z;u.x=b,u.y=m,u.z=p,e._boundingSphereCV.push(me.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new me),e._boundingSphereMorph.push(new me)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,aN(e,t,os.COMPLETE,void 0)}function nut(e,t,n,i){let o=n.getRenderState(),r;i?(r=$e(o,!1),r.cull={enabled:!0,face:ki.BACK},e._frontFaceRS=ze.fromCache(r),r.cull.face=ki.FRONT,e._backFaceRS=ze.fromCache(r)):(e._frontFaceRS=ze.fromCache(o),e._backFaceRS=e._frontFaceRS),r=$e(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=$e(o,!1),r.depthTest.func=sc.GREATER,i?(r.cull={enabled:!0,face:ki.BACK},e._frontFaceDepthFailRS=ze.fromCache(r),r.cull.face=ki.FRONT,e._backFaceDepthFailRS=ze.fromCache(r)):(e._frontFaceDepthFailRS=ze.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function iut(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=rs._appendOffsetToShader(e,r),r=rs._appendShowToShader(e,r),r=rs._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=F_e(r),r=rs._updateColorAttribute(e,r,!1),r=P_e(e,r),r=rs._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=I_e(s),e._sp=tn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),X_e(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=rs._appendShowToShader(e,r),r=rs._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=F_e(r),r=rs._updateColorAttribute(e,r,!0),r=P_e(e,r),r=rs._modifyShaderPosition(e,r,t.scene3DOnly),r=zdt(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=I_e(s),s=Hdt(s),e._spDepthFail=tn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),X_e(e._spDepthFail,o))}var sN=new P,M_e=new h;function w_e(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=Kdt(s,c));let a=It(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return P.multiply(c,e._modelMatrix,sN),P.multiplyByPoint(sN,e.rtcCenter,M_e),P.setTranslation(sN,M_e,sN),sN}),a}function out(e,t,n,i,o,r,s,a){let c=w_e(e,t,n,a),d;l(e._depthFailAppearance)&&(d=w_e(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Le.TRANSLUCENT:Le.OPAQUE,m=o?2:1;m*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*m;let p=r.length,b=0;for(let f=0;f<p;++f){let y;o&&(y=r[f],l(y)||(y=r[f]=new lt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[b],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=u,++f),y=r[f],l(y)||(y=r[f]=new lt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[b],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=u,l(e._depthFailAppearance)&&(o&&(++f,y=r[f],l(y)||(y=r[f]=new lt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[b],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=d,y.pass=u),++f,y=r[f],l(y)||(y=r[f]=new lt({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[b],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=d,y.pass=u),++b}}rs._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!P.equals(n,e._modelMatrix))for(P.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=me.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=me.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphereMorph[o]=me.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function rut(e,t,n,i,o,r,s,a){rs._updateBoundingVolumes(e,t,o);let c;t.mode===se.SCENE3D?c=e._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===se.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let d=t.commandList,u=t.passes;if(u.render||u.pick){let m=e.allowPicking,p=Wn.castShadows(e.shadows),b=Wn.receiveShadows(e.shadows),f=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let _=0;_<f;++_){let S=Math.floor(_/y),Z=n[_];Z.modelMatrix=o,Z.boundingVolume=c[S],Z.cull=r,Z.debugShowBoundingVolume=s,Z.castShadows=p,Z.receiveShadows=b,m?Z.pickId="v_pickColor":Z.pickId=void 0,d.push(Z)}}}rs.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!==se.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===os.FAILED)return;let t=e.context;if(l(this._batchTable)||kdt(this,t),this._batchTable.attributes.length>0){if(wt.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!==os.COMPLETE&&this._state!==os.COMBINED&&(this.asynchronous?jdt(this,e):Qdt(this,e)),this._state===os.COMBINED&&($dt(this,e),Y_e(this,e),tut(this,e)),!this.show||this._state!==os.COMPLETE)return;this._batchTableOffsetsUpdated||Y_e(this,e),this._recomputeBoundingSpheres&&qdt(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??nut)(this,t,n,d),r&&(this._createShaderProgramFunction??iut)(this,e,n),(o||r)&&(this._createCommandsFunction??out)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??rut)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var sut=new me,aut=new me;function z_e(e,t,n){if(n===yn.TOP){let i=me.clone(e,sut),o=me.clone(e,aut);o.center=h.add(o.center,t,o.center),e=me.union(i,o,e)}else n===yn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function cut(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 lut(e,t,n,i,o){return function(r){let s=U_e(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var dut=new h;function uut(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)&&z_e(i,h.fromArray(r.get(),0,dut),e._offsetInstanceExtend[n]),l(o)&&(i=me.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function mut(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}rs.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];c[d]={get:cut(s,n,u),set:lut(s,n,u,this,d)}}return uut(this,c,n),mut(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};rs.prototype.isDestroyed=function(){return!1};rs.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 aN(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===os.COMPLETE||e._state===os.FAILED,!0})}var Pn=rs;function KC(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;gut(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(KC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});KC.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=nn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)};var H_e=new h,BB=new h,K_e=new h,hut=new h,fut=new h,put=new h,but=new h,Qm=new pe,J_e=new cn(h.UNIT_X,0),HC=new gn;function gut(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,put),o=h.cross(i,h.UNIT_Z,hut);h.normalize(o,e.westNormal),Qm.longitude=t.east;let r=n.cartographicToCartesian(Qm,but),s=h.cross(h.UNIT_Z,r,H_e);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,H_e);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,fut),d=t.south,u;if(d>0){Qm.longitude=(t.west+t.east)*.5,Qm.latitude=d;let y=n.cartographicToCartesian(Qm,HC.origin);h.clone(c,HC.direction);let _=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,J_e);Ti.rayPlane(HC,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(y,BB)}else u=n.geodeticSurfaceNormalCartographic(re.southeast(t),BB);let m=h.cross(u,a,K_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,HC.origin);h.negate(c,HC.direction);let _=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,J_e);Ti.rayPlane(HC,_,e.northeastCornerCartesian),b=n.geodeticSurfaceNormal(y,BB)}else b=n.geodeticSurfaceNormalCartographic(re.northwest(t),BB);let f=h.cross(a,b,K_e);h.normalize(f,e.northNormal)}var yut=new h,xut=new h,Tut=new h(0,-1,0),_ut=new h(0,0,-1),j_e=new h;function Sut(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),yut),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(re.northeast(e.rectangle),xut),u.z=u.y,u.y=u.x,u.x=0,m=Tut,b=h.UNIT_Y,p=_ut,f=h.UNIT_Z);let y=h.subtract(i,d,j_e),_=h.dot(y,m),S=h.dot(y,p),Z=h.subtract(i,u,j_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)}KC.prototype.distanceToCamera=function(e){let t=Sut(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};KC.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};KC.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new TS({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Mt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var wu=KC;var u0i=x(T(),1);var Kpi=x(T(),1);var Wpi=x(T(),1);var cN={},Zut=new h,Q_e=new h,q_e=new h,$_e=new h,eSe=new nn;cN.validOutline=function(e){let n=nn.fromPoints(e,eSe).halfAxes,i=q.getColumn(n,0,Q_e),o=q.getColumn(n,1,q_e),r=q.getColumn(n,2,$_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=nn.fromPoints(e,eSe),r=o.halfAxes,s=q.getColumn(r,0,Q_e),a=q.getColumn(r,1,q_e),c=q.getColumn(r,2,$_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 tSe(e,t,n,i,o){let r=h.subtract(e,t,Zut),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]=tSe(i[r],e,t,n);return o}};cN.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return tSe(i,e,t,n,o)}};var ig=cN;function Rut(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 Cn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:n})});return new At({attributes:s,indices:i,primitiveType:Ie.LINES})}function ZS(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ii.computeHierarchyPackedLength(t,h)+1}ZS.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new ZS(t)};ZS.pack=function(e,t,n){return n=n??0,n=ii.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var Cut={polygonHierarchy:{}};ZS.unpack=function(e,t,n){t=t??0;let i=ii.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new ZS(Cut)),n._polygonHierarchy=i,n.packedLength=o,n};ZS.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Mo(n,h.equalsEpsilon,!0),n.length<3||!ig.validOutline(n))return;let o=ii.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Mt({geometry:Rut(o[c])});r.push(d)}let s=zn.combineInstances(r)[0],a=me.fromPoints(t.positions);return new At({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var qm=ZS;var zB=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=Yut(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=C$(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]=C$(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=C$(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();zB=o.cartesianToCartographic(c,zB),zB.height=(i+n)/2,this.center=o.cartographicToCartesian(zB,c),this._boundingSphere=me.fromPoints(s)}var Vut=new h,Eut=new pe,Aut=new h,Gut=new pe,Lut=new h,Wut=new h,vut=new h,Fut=new h;function Iut(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,Vut),a=i.cartesianToCartographic(r,Eut);a.height=n;let c=i.cartographicToCartesian(a,Aut),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,Gut),f.height=t;let _=cn.getPointDistance(d,i.cartographicToCartesian(f,Lut));_<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,Wut),Z=h.subtract(_,b,Fut),R=h.cross(Z,S,vut);R=h.normalize(R,R),o[2+m]=cn.fromPointNormal(b,R)}return o}var RS=new h,CS=new h,VS=new h,y$=new h,x$=new h,T$=new h,Put=new h,Xut=new h,Nut=new h,_$=new h,S$=new h,Z$=new h,Ax=new h,t0=new q;function nSe(e,t,n){RS=e.normal,CS=t.normal,VS=n.normal,y$=h.multiplyByScalar(e.normal,-e.distance,y$),x$=h.multiplyByScalar(t.normal,-t.distance,x$),T$=h.multiplyByScalar(n.normal,-n.distance,T$),_$=h.multiplyByScalar(h.cross(CS,VS,Put),h.dot(y$,RS),_$),S$=h.multiplyByScalar(h.cross(VS,RS,Xut),h.dot(x$,CS),S$),Z$=h.multiplyByScalar(h.cross(RS,CS,Nut),h.dot(T$,VS),Z$),t0[0]=RS.x,t0[1]=CS.x,t0[2]=VS.x,t0[3]=RS.y,t0[4]=CS.y,t0[5]=VS.y,t0[6]=RS.z,t0[7]=CS.z,t0[8]=VS.z;let i=q.determinant(t0);return Ax=h.add(_$,S$,Ax),Ax=h.add(Ax,Z$,Ax),new h(Ax.x/i,Ax.y/i,Ax.z/i)}function Yut(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=nSe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=nSe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var R$=new h,JC=new h;function C$(e,t){let n=[];for(let i=0;i<4;i++)R$=h.subtract(t[(i+1)%4],t[i],R$),JC=h.cross(e.normal,R$,JC),JC=h.normalize(JC,JC),n[i]=h.clone(JC);return n}Object.defineProperties(lN.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var V$=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=E$(cn.projectPointOntoPlane(c,t,V$),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=iSe(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=E$(cn.projectPointOntoPlane(c,t,V$),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=E$(cn.projectPointOntoPlane(this._boundingPlanes[1],t,V$),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 Mut=new h,wut=new h;function iSe(e,t,n){let i=h.subtract(n,t,Mut),o=h.subtract(e,t,wut),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 kut=new cn(h.UNIT_X,0);function E$(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],kut);cn.getPointDistance(d,e)<0||(a=iSe(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 qm({polygonHierarchy:{positions:this._planeVertices[0]}}),i=qm.createGeometry(n),o=new Mt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),r=new qm({polygonHierarchy:{positions:this._planeVertices[1]}}),s=qm.createGeometry(r),a=new Mt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new qm({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=qm.createGeometry(u);c[d]=new Mt({geometry:m,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}})}return new Pn({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var dN=lN;var U0i=x(T(),1);var W0i=x(T(),1);var V0i=x(T(),1);var Uut=new h(1,1,1),HB=Math.cos,KB=Math.sin;function jC(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"}jC.packedLength=2*h.packedLength+8;jC.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 oSe=new h,rSe=new h,og={radii:oSe,innerRadii:rSe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};jC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,oSe);t+=h.packedLength;let o=h.unpack(e,t,rSe);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):(og.minimumClock=r,og.maximumClock=s,og.minimumCone=a,og.maximumCone=c,og.stackPartitions=d,og.slicePartitions=u,og.subdivisions=m,og.offsetAttribute=p===-1?void 0:p,new jC(og))};jC.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]=KB(L),N[C]=HB(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]=KB(A),V[C]=HB(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]=KB(L),N[C]=HB(L);for(g.length=d,V.length=d,C=0;C<d;C++)A=i+C*(o-i)/(d-1),g[C]=KB(A),V[C]=HB(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 Cn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S})});if(l(e._offsetAttribute)){let X=S.length,Y=e._offsetAttribute===yn.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:me.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var ku=jC;function QC(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 ku(i),this._workerName="createSphereOutlineGeometry"}QC.packedLength=ku.packedLength;QC.pack=function(e,t,n){return ku.pack(e._ellipsoidGeometry,t,n)};var Dut=new ku,ES={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};QC.unpack=function(e,t,n){let i=ku.unpack(e,t,Dut);return ES.stackPartitions=i._stackPartitions,ES.slicePartitions=i._slicePartitions,ES.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,ES.radii),n._ellipsoidGeometry=new ku(ES),n):(ES.radius=i._radii.x,new QC(ES))};QC.createGeometry=function(e){return ku.createGeometry(e._ellipsoidGeometry)};var rg=QC;function qC(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new me(e,t)}Object.defineProperties(qC.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}}});qC.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};qC.prototype.intersectPlane=function(e){return me.intersectPlane(this._boundingSphere,e)};qC.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};qC.prototype.createDebugVolume=function(e){let t=new rg({radius:this.radius}),n=P.fromTranslation(this.center,P.clone(P.IDENTITY)),i=new Mt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var sg=qC;var hbi=x(T(),1);var ebi=x(T(),1);var Out=new h;function n0(e){e=e??B.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"}n0.fromDimensions=function(e){e=e??B.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new n0({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};n0.fromAxisAlignedBoundingBox=function(e){return new n0({minimum:e.minimum,maximum:e.maximum})};n0.packedLength=2*h.packedLength+1;n0.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 aSe=new h,cSe=new h,sSe={minimum:aSe,maximum:cSe,offsetAttribute:void 0};n0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,aSe),o=h.unpack(e,t+h.packedLength,cSe),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(sSe.offsetAttribute=r===-1?void 0:r,new n0(sSe))};n0.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new Cn,o=new Uint16Array(24),r=new Float64Array(24);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 Xe({componentDatatype:J.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=h.subtract(n,t,Out),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===yn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new At({attributes:i,indices:o,primitiveType:Ie.LINES,boundingSphere:new me(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var yf=n0;var But=new h,zut=new h,Hut=new h,Kut=new h;function AS(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function A$(e,t){let n=h.normalize(e,Kut),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return AS(e,i,t)}function lSe(e){let t=q.getColumn(e,0,But),n=q.getColumn(e,1,zut),i=q.getColumn(e,2,Hut),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=AS(n,i,t):!o&&r&&!s?n=AS(t,i,n):!o&&!r&&s?i=AS(n,t,i):o?r?s||(t=A$(i,t),n=AS(i,t,n)):(t=A$(n,t),i=AS(n,t,i)):(n=A$(t,n),i=AS(n,t,i)),q.setColumn(e,0,t,e),q.setColumn(e,1,n,e),q.setColumn(e,2,i,e),e)}function $C(e,t){t=lSe(t),this._orientedBoundingBox=new nn(e,t),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties($C.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});$C.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};$C.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};$C.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=lSe(t),q.clone(t,this._orientedBoundingBox.halfAxes),me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};$C.prototype.createDebugVolume=function(e){let t=new yf({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=P.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Mt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new Pn({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var zd=$C;function lr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||oo(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=qX(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,lr._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")&&lr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?yr.REPLACE:yr.ADD):l(i)?p=i.refine:p=yr.REPLACE,this.refine=p,this.children=[],this.parent=i;let b,f=!1,y,_,S;if(t=ve.createIfNeeded(t),r)y=Io.UNLOADED,_=t.clone();else if(l(s)){let E=s.uri;l(s.url)&&(lr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(lr._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 e0(e,this),f=!0,y=Io.READY):(y=Io.UNLOADED,_=t.getDerivedResource({url:E}),S=Hc.getServerKey(_.getUrlComponent()))}else b=new e0(e,this),f=!0,y=Io.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}lr._deprecationWarning=Jo;Object.defineProperties(lr.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===Io.READY}},contentUnloaded:{get:function(){return this._contentState===Io.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Io.EXPIRED}},contentFailed:{get:function(){return this._contentState===Io.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Gx=new h;function Jut(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Gx),c=h.add(s.positionWC,a,Gx),d=h.subtract(c,r,Gx);if(h.magnitude(d)>o){let C=h.normalize(d,Gx),E=h.multiplyByScalar(C,o,Gx),A=h.add(r,E,Gx),L=h.subtract(A,s.positionWC,Gx),F=h.normalize(L,Gx);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,F))}else e._foveatedFactor=0;let p=e.refine===yr.REPLACE,b=n.isSkippingLevelOfDetail;if(p&&!b||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&b||n._pass===cr.PRELOAD_FLIGHT||n._pass===cr.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 pSe=new Q;lr.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 bn){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 jut(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 Qut(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}lr.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:qs.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!==qs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Qut(n,this),this._priorityProgressiveResolution=jut(n,this),this.priorityDeferred=Jut(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};lr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(pSe);Q.lessThan(this.expireDate,e)&&(this._contentState=Io.EXPIRED,this._expiredContent=this._content)}};function qut(e){if(!l(e.expireDuration))return;let t=Q.now(pSe);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}}lr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?emt(this):nmt(this)};function emt(e){let t=e._content,n=e._tileset;if(!l(t)){let o=oo(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new $X(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Io.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Io.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Io.FAILED,o})}async function tmt(e,t,n,i,o){let r=e._contentState;e._contentState=Io.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(bSe(e,a))return i&&(e.expireDate=void 0),e._content=new e0(t,e),dSe(e),e._contentState=Io.PROCESSING,e._content;throw e._contentState=Io.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 imt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof e0&&dSe(e),e._contentState=Io.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Io.FAILED,a}}function nmt(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 tmt(e,o,i,n,r)}function bSe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function dSe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}lr._isEmptyTile=bSe;async function imt(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=eg(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=gS[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=yS(n,a));let c=xS(n,a);return l(c)&&(r.group=new E_({metadata:c})),r}lr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};lr.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Io.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};lr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Io.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 gSe=new me;function L$(e,t){if(t.mode!==se.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,gSe);e._boundingVolume2D=new sg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function omt(e,t){if(t.mode!==se.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,gSe);e._contentBoundingVolume2D=new sg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}lr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=L$(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 qs.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)};lr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===qs.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=omt(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)};lr.prototype.distanceToTile=function(e){return L$(this,e).distanceToCamera(e)};var rmt=new h;lr.prototype.distanceToTileCenter=function(e){let n=L$(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,rmt);return h.dot(e.camera.directionWC,i)};lr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var ySe=new q,xSe=new h,smt=new q,W$=new h,TSe=new re,_Se=new nn,G$=new P;function amt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],W$),o=q.fromArray(e,3,smt);i=P.multiplyByPoint(t,i,i);let r=P.getMatrix3(t,ySe);return o=q.multiply(r,o,o),l(n)?(n.update(i,o),n):new zd(i,o)}function uSe(e,t,n,i){let o=re.unpack(e,0,TSe),r=e[4],s=e[5],a=nn.fromRectangle(o,r,s,ne.WGS84,_Se),c=a.center,d=a.halfAxes;t=P.multiplyTransformation(t,P.inverseTransformation(n,G$),G$),c=P.multiplyByPoint(t,c,c);let u=P.getMatrix3(t,ySe);return d=q.multiply(u,d,d),l(i)&&i instanceof zd?(i.update(c,d),i):new zd(c,d)}function cmt(e,t,n,i){if(!P.equalsEpsilon(t,n,W.EPSILON8))return i instanceof zd?uSe(e,t,n,i):uSe(e,t,n,void 0);let o=re.unpack(e,0,TSe);return i instanceof wu?(i.rectangle=re.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new wu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function lmt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],W$),o=e[3];i=P.multiplyByPoint(t,i,i);let r=P.getScale(t,xSe),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new sg(i,o)}lr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=wy.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(oo(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=amt(r,t,n);return this._verticalExaggeration!==1&&mSe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=cmt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof zd?mSe(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=lmt(a,t,n);if(this._verticalExaggeration!==1){let d=_o.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,W$),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var dmt=h.unpackArray(new Array(24).fill(0));function mSe(e,t,n){let i=e.boundingVolume.computeCorners(dmt).map(r=>_o.getPosition(r,ne.WGS84,t,n,r)),o=nn.fromPoints(i,_Se);e.update(o.center,o.halfAxes)}lr.prototype.updateTransform=function(e,t){e=e??P.IDENTITY;let n=P.multiplyTransformation(e,this.transform,G$),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()};lr.prototype.updateGeometricErrorScale=function(){let e=P.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 umt(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 mmt(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=Io.FAILED,o}}function hmt(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 fmt(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)}lr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;hmt(this,e),fmt(this,e),umt(this,e,t,n),mmt(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 hSe=[];lr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(qut(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=Io.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=hSe;try{this._content.update(e,t)}catch(i){throw this._contentState=Io.FAILED,i}hSe.length=0,t.commandList=n};function fSe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function JB(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}lr.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=JB(this._depth,n.depth,i.depth);Z=t?1-Z:Z;let C=!e.isSkippingLevelOfDetail&&this.refine===yr.REPLACE?JB(this._priorityHolder._distanceToCamera,n.distance,i.distance):JB(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=fSe(C,a,s),A=this._priorityProgressiveResolution?0:p,L=JB(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),F=fSe(L,d,c),I=this.priorityDeferred?y:0,N=e._pass===cr.PRELOAD_FLIGHT?0:S;this._priority=Z+E+A+F+I+N};lr.prototype.isDestroyed=function(){return!1};lr.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 $m=lr;var lgi=x(T(),1);var v$=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()}},F$=v$;var bgi=x(T(),1);var SSe={},pmt=new h;SSe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof zd||i instanceof wu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Jm.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof zd||a instanceof wu)){e._optimChildrenWithinParent=Jm.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,pmt),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 uN=SSe;var ygi=x(T(),1);function bmt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var eh=bmt;var pTi=x(T(),1);var Tgi=x(T(),1);function i0(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(i0.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}}});i0.prototype.get=function(e){return this._array[e]};i0.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};i0.prototype.peek=function(){return this._array[this._length-1]};i0.prototype.push=function(e){let t=this.length++;this._array[t]=e};i0.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};i0.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};i0.prototype.resize=function(e){this.length=e};i0.prototype.trim=function(e){e=e??this._length,this._array.length=e};var td=i0;var Xgi=x(T(),1);var Cgi=x(T(),1);function ag(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(ag.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}}});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 eV=ag;var Lgi=x(T(),1);function cg(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(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 mN=cg;function ZSe(e){e=e??B.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new mN({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 eV({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 eV({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(ZSe.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 GS=ZSe;var Dgi=x(T(),1);var Mgi=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 gmt(e,t,n){this.item=e,this.previous=t,this.next=n}hN.prototype.add=function(e){let t=new gmt(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 RSe(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)&&(RSe(this,e),--this._length)};hN.prototype.splice=function(e,t){if(e===t)return;RSe(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 Lx(){this._list=new fN,this._sentinel=this._list.add(),this._trimTiles=!1}Lx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Lx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Lx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Lx.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Lx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Lx.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)}};Lx.prototype.trim=function(){this._trimTiles=!0};var pN=Lx;var Jgi=x(T(),1);function jB(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}jB.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=P$(e,n),this._referenceMaximum[n]=P$(t,n)};function ymt(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 I$=[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)];jB.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=ymt(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=I$.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),b=u-m,f=I$[m],y=I$[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=_};jB.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=jB;var $gi=x(T(),1);function tV(){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}tV.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};tV.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])}};tV.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])}};tV.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])}};tV.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 xf=tV;var nyi=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 ryi=x(T(),1);function CSe(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}CSe.maximumFrameNumber=15e6;var Wx=CSe;var hyi=x(T(),1);function xmt(e,t,n){let i=oo(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)&&!oo(o,"3DTILES_bounding_volume_S2")&&!oo(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=Tmt(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=_mt(t),this.subdivisionScheme=ks[i.subdivisionScheme],this.branchingFactor=ks.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Tmt(e){if(oo(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 _mt(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 o0=xmt;var _yi=x(T(),1);var byi=x(T(),1);var xN={};function VSe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function X$(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function ESe(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 N$(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(VSe(e)|VSe(t)<<1)>>>0};xN.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=ESe(e),t[1]=ESe(e>>1),t};xN.encode3D=function(e,t,n){return X$(e)|X$(t)<<1|X$(n)<<2};xN.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=N$(e),t[1]=N$(e>>1),t[2]=N$(e>>2),t};var vx=xN;function Sr(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===ks.OCTREE&&(this.z=e.z)}Object.defineProperties(Sr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===ks.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===ks.OCTREE?vx.encode3D(this.x,this.y,this.z):vx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===ks.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Sr.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===ks.OCTREE){let o=(this.z<<e.level)+e.z;return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Sr.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===ks.OCTREE){let r=Math.floor(this.z/t);return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Sr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===ks.OCTREE){let r=e.z%n;return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Sr.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===ks.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Sr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Sr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Sr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Sr.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===ks.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Sr.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===ks.OCTREE?this.z===e.z:!0)};Sr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Sr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Sr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Sr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===ks.OCTREE&&(e.z=this.z),e};var ASe=[0,0,0];Sr.fromMortonIndex=function(e,t,n,i){let o;return e===ks.OCTREE?(o=vx.decode3D(i,ASe),new Sr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=vx.decode2D(i,ASe),new Sr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Sr.fromTileIndex=function(e,t,n){let i,o,r;return e===ks.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),Sr.fromMortonIndex(e,t,i,r)};var r0=Sr;var Iyi=x(T(),1);var Ayi=x(T(),1);function lg(){}lg.selectTiles=function(e,t){ge.throwInstantiationError()};lg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};lg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};lg.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)};lg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};lg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};lg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Smt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Smt(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}lg.updateTile=function(e,t){GSe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Cmt(e),e._shouldSelect=!1,e._finalResolution=!0};function GSe(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];GSe(r,t),e._visible=r._visible;return}if(Zmt(e,t)){e._visible=!1;return}let i=e.refine===yr.REPLACE,o=e._optimChildrenWithinParent===Jm.USE_OPTIMIZATION;if(i&&o&&n&&!Rmt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Zmt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==yr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Rmt(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 Cmt(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 za=lg;function LSe(){}var TN={stack:new td,stackMaximumLength:0};LSe.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}=za,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===yr.ADD,d=a.refine===yr.REPLACE,u=Vmt(a);u&&Emt(a,s,t),(c||d&&!u)&&(Amt(e,a),o(a,t),Gmt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return TN.stack.trim(TN.stackMaximumLength),n};function Vmt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Emt(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 Amt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Gmt(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var _N=LSe;var wyi=x(T(),1);function WSe(){}var SN={stack:new td,stackMaximumLength:0},ZN={stack:new td,stackMaximumLength:0};WSe.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(za.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Wmt(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&&za.selectTile(e,t)}function Lmt(e,t,n){let i=e.refine===yr.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=za;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(za.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:_=vmt(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 Wmt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=za,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)?Lmt(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===yr.ADD?(Y$(c,t),o(c,t)):c.refine===yr.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 vmt(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=za,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=WSe;var zyi=x(T(),1);function vSe(){}var CN={stack:new td,stackMaximumLength:0},VN={stack:new td,stackMaximumLength:0},dg={stack:new td,stackMaximumLength:0,ancestorStack:new td,ancestorStackMaximumLength:0},Fmt=2;vSe.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(za.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Mmt(n,t),wmt(n,t),CN.stack.trim(CN.stackMaximumLength),VN.stack.trim(VN.stackMaximumLength),dg.stack.trim(dg.stackMaximumLength),dg.ancestorStack.trim(dg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Imt(e,t){let{updateTile:n,touchTile:i,selectTile:o}=za,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<Fmt&&r.push(d))}}}function QB(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Imt(e,t)}function Pmt(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 Xmt(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 Nmt(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=za;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(za.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 Ymt(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 Mmt(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}=za,c=CN.stack;for(c.push(e);c.length>0;){CN.stackMaximumLength=Math.max(CN.stackMaximumLength,c.length);let d=c.pop();Pmt(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?Nmt(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===yr.ADD?(QB(d,t),r(d,t)):d.refine===yr.REPLACE&&(Ymt(d,i)?(r(d,t),p&&QB(d,t)):p?(QB(d,t),r(d,t)):Xmt(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&QB(d,t)),s(d,t),a(d,t)}}function wmt(e,t){let{selectTile:n,canTraverse:i}=za,{stack:o,ancestorStack:r}=dg,s;for(o.push(e);o.length>0||r.length>0;){if(dg.stackMaximumLength=Math.max(dg.stackMaximumLength,o.length),dg.ancestorStackMaximumLength=Math.max(dg.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===yr.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=vSe;var oxi=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 Cs(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 qB(e,t){return e.indexOf(t)}function FSe(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=qB(this._layers,e);FSe(this,t,t+1)};Va.prototype.lower=function(e){let t=qB(this._layers,e);FSe(this,t,t-1)};Va.prototype.raiseToTop=function(e){let t=qB(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=qB(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 ISe=new re;function PSe(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=ISe,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(PSe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};var kmt=new re,Umt=new re,M$=new k,w$=new k,Dmt=new pe,Omt=new pe;function Bmt(e,t,n,i){let o=n.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(e,kmt),s=1/1024,a=Umt;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 Ui)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;M$.x=a.west,M$.y=a.south,w$.x=a.east,w$.y=a.north;let d=c.unproject(M$,Dmt),u=c.unproject(w$,Omt);return i.west=d.longitude,i.south=d.latitude,i.east=u.longitude,i.north=u.latitude,i}function zmt(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=Bmt(_,m.textureCoordinateRectangle,b,ISe);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)&&PSe(t,o,!0,function(c){a(c)}),l(i)&&zmt(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),ue(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 LS=Va;function dr(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 td,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 xf,this._statisticsLast=new xf,this._statisticsPerPass=new Array(cr.NUMBER_OF_PASSES);for(let o=0;o<cr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new xf;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 LS(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??Wn.ENABLED,this.show=e.show??!0,this.colorBlendMode=vd.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Hp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Ib,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)&&xs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(vc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),wSe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Q_,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Wb(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??Ur.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??km.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(dr.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){vc.setOwner(e,this,"_clippingPolygons"),wSe(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,BSe(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}}});dr.fromIonAssetId=async function(e,t){let n=await kr.fromAssetId(e);return dr.fromUrl(n,t)};dr.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 dr.loadJson(n),r=await Hmt(n,o),s=new dr(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,BSe(s);let c=l(o.asset.gltfUpAxis)?Di.fromName(o.asset.gltfUpAxis):Di.Y,d=t.modelUpAxis??c,u=t.modelForwardAxis??Di.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>Xi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=_t.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=P.clone(s._initialClippingPlanesOriginMatrix),s};dr.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};dr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};dr.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)&&dr.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=XSe(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===yr.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=XSe(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&uN.checkChildrenWithinParent(c)}return s};function XSe(e,t,n,i){if(!(l(n.implicitTiling)||oo(n,"3DTILES_implicit_tiling")))return new $m(e,t,n,i);let r=e.schema,s=new o0(t,n,r),a=new r0({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 $m(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function Hmt(e,t){let n=oo(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Yi.getSchemaLoader({resource:e});else if(l(n.schema))i=Yi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new GS({schema:i.schema,metadataJson:n});return Yi.unload(i),o}var NSe=new h,Kmt=new pe,Jmt=new P,jmt=new h,Qmt=new h,qmt=new h,$mt=new h;function eht(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof wu)n=h.normalize(a.positionWC,NSe),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let y=P.inverseTransformation(c.computedTransform,Jmt),_=t.mapProjection.ellipsoid,S=d.boundingVolume,Z=P.multiplyByPoint(y,S.center,jmt);if(h.magnitude(Z)>_.minimumRadius){let R=pe.fromCartesian(Z,_,Kmt);n=h.normalize(a.positionWC,NSe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=R.height*2}else{let R=P.multiplyByPoint(y,a.positionWC,Qmt);if(n=h.UNIT_Z,i=P.multiplyByPointAsVector(y,a.directionWC,qmt),i=h.normalize(i,i),o=R.z,d instanceof zd){let C=q.getColumn(S.halfAxes,2,$mt),E=h.magnitude(C);r=Z.z-E,s=Z.z+E}else if(d instanceof sg){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 tht(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=>{kSe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?DSe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function MSe(e,t){return e._priority-t._priority}dr.prototype.postPassesUpdate=function(e){l(this._root)&&(nht(this,e),Tht(this,e),this._cache.unloadTiles(this,OSe),yht(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function wSe(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)}dr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;lht(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&&eht(this,e),e.newFrame&&this._cache.reset()};function nht(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!==Io.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function iht(e){let t=e._requestedTiles;t.sort(MSe);for(let n=0;n<t.length;++n)tht(e,t[n])}function kSe(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 oht(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Io.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var rht=new pe,sht=new pe,aht=new h;function cht(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,rht),u=pe.fromCartesian(o.center,c,sht);l(u)&&(d.height=u.height);let m=pe.toCartesian(d,c,aht);h.distance(m,o.center)<=o.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function lht(e,t){oht(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,kSe(u,e,d)}}e.totalMemoryUsageInBytes<i?uht(e):a&&n.length>0&&dht(e)}function dht(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(MSe)}function uht(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var $B=new h,mht={maximumFractionDigits:3};function YSe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,mht):Math.round(t).toLocaleString()}function k$(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,$B);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,$B);r=h.multiplyByScalar(r,.75*n,$B),o=h.add(r,i,$B)}return o}function U$(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: ${YSe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${YSe(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 hht(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:k$(e.debugPickedTile),a=U$(e.debugPickedTile,e,s);a.pixelOffset=new k(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];U$(a,e,k$(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&U$(a,e,k$(a))}}e._tileDebugLabels.update(t)}function fht(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),cht(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 qp),hht(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var USe=[],pht=[];function DSe(e,t){let n=t,i=USe;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&&(xht(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function OSe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function e3(e,t){let n=e-t;return n<0?n+Wx.maximumFrameNumber:n}var bht=64;function ght(e,t,n){let i=pht;for(i.length=0,i.push(e);i.length>0;){let o=i.pop(),r=o._contentState;if(r===Io.LOADING||r===Io.PROCESSING||!o.hasEmptyContent&&!o.hasTilesetContent&&r!==Io.UNLOADED&&r!==Io.FAILED||l(o.cacheNode)||Math.min(e3(t,o._visitedFrame),e3(t,o._touchedFrame),e3(t,o._selectedFrame),e3(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 yht(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,o=e._externalTilesetIdleFrames,r=e._externalTilesetSweepCount,s=0,a=0;for(;s<r&&a<bht&&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,!ght(d,i,o)&&(DSe(e,d),d.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function xht(e,t){e._cache.unloadTile(e,t,OSe),t.destroy()}dr.prototype.trimLoadedTiles=function(){this._cache.trim()};function Tht(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;xf.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 _ht(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 Sht(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 Zht(e,t,n,i){if(t.mode===se.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,_ht(e),Sht(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&iht(e),fht(e,t,i),xf.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 BSe(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}dr.prototype.getTraversal=function(e){let{pass:t}=e;return t===cr.MOST_DETAILED_PRELOAD||t===cr.MOST_DETAILED_PICK?_N:this.isSkippingLevelOfDetail?EN:RN};dr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};dr.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===cr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===cr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===cr.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=cr.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=Zht(this,e,u,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};dr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};dr.prototype.isDestroyed=function(){return!1};dr.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=USe;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)};dr.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};dr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!dr.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Rht=new gn,Cht=new h,Vht=new h,Eht=new pe;dr.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=Rht,o=n.cartographicToCartesian(e,Cht),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,Vht,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,Eht)?.height};dr.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 Aht=new h;dr.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,Aht);if(l(R)){let C=h.distanceSquared(R,e.origin);C<_&&(_=C,y=h.clone(R,n))}}return y};dr.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};dr.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=dr;var O_i=x(T(),1);var ZTi=x(T(),1);var xTi=x(T(),1);function Tf(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Tf.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}}});Tf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Tf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Tf.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};Tf.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)zSe(this,t)};Tf.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++,zSe(this,i),t};Tf.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],HSe(this,0)),this._array[e-1]=void 0,t};Tf.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=D$(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&HSe(this,n)}return this._array[e-1]=void 0,t};Tf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Tf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[D$(this,1,2)?1:2]};function t3(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function AN(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function D$(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function zSe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=AN(e,t,i);for(o!==n&&(t3(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(AN(e,t,r)!==o)break;t3(e,t,r),t=r}}function HSe(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){AN(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;AN(e,u,r)===i&&(r=u)}}if(AN(e,r,t)===i&&(t3(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);D$(e,r,a)===i&&t3(e,r,a)}t=r}}var ug=Tf;function GN(e){e=e??B.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new ug({comparator:GN.comparator})}GN.prototype.addSubtree=function(e){let t=new Ght(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()};GN.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}};GN.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 Ght(e,t){this.subtree=e,this.stamp=t}var LN=GN;var WTi=x(T(),1);function mg(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(mg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});mg.fromMetadataArray=function(e){return new mg({metadata:e})};mg.fromGltf=async function(e){let t=new Iu({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new mg({loader:t})};mg.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=Lht(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function Lht(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}mg.prototype.isDestroyed=function(){return!1};mg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var WS=mg;var y_i=x(T(),1);var kTi=x(T(),1);function hl(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=hl.DefaultMinBounds.clone(),this._maxBounds=hl.DefaultMaxBounds.clone(),this._renderMinBounds=hl.DefaultMinBounds.clone(),this._renderMaxBounds=hl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=hl,n=[new ea(h.negate(h.UNIT_X,new h),e.x),new ea(h.negate(h.UNIT_Y,new h),e.y),new ea(h.negate(h.UNIT_Z,new h),e.z),new ea(h.UNIT_X,-t.x),new ea(h.UNIT_Y,-t.y),new ea(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new xb({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(hl.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 Wht=new h,vht=new h,Fht=new q,Iht=new h,Pht=new h;hl.prototype.update=function(e,t,n,i,o){i=i??t.clone(Iht),o=o??n.clone(Pht),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,vht);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=z$(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.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(O$(p.x,b.x),O$(p.y,b.y),O$(p.z,b.z),d.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(f,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=m,!0};function O$(e,t){return W.equalsEpsilon(e,t,W.EPSILON7)?1:1/(t-e)}var Xht=new P;hl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,Xht),i=P.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;q.multiply(i,o,t.boxEcToXyz)};hl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var n3=new h,B$=new h;hl.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),n3),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)),B$);return z$(c,d,this._shapeTransform,o)};var KSe=new h;hl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,KSe),s=h.multiplyByScalar(r,o,KSe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,n3),o,n3),c=h.add(a,s,B$),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),n3),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),B$);return z$(m,p,this._shapeTransform,i)};hl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));hl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var JSe=new h;function z$(e,t,n,i){let o=hl.DefaultMinBounds,r=hl.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,JSe),c=h.midpoint(e,t,Wht);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),JSe);let d=P.getRotation(n,Fht);i.halfAxes=q.setScale(d,a,i.halfAxes)}return i}var vS=hl;var $Ti=x(T(),1);function Uu(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=Uu.DefaultMinBounds.clone(),this._maxBounds=Uu.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Uu,n=[new ea(h.negate(h.UNIT_Z,new h),e.z),new ea(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new xb({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(Uu.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 Nht=new h,Yht=new h,Mht=new h,wht=new h,kht=new h,Uht=new P,Dht=new h,jSe=new k;Uu.prototype.update=function(e,t,n,i,o){i=i??t.clone(Yht),o=o??n.clone(Mht),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=Uu,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,wht),p=h.minimumByComponent(n,o,kht),b=P.getScale(e,Nht);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=J$(m,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.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,M=1-_/a,O=(D+.5*M)%1;L.cylinderShapeUvAngleRangeOrigin=O;let w=0,z=1;if(_>u){w=a/_;let K=Y-O;z=-w*(K-Math.floor(K))}return L.cylinderLocalToShapeUvScale=h.fromElements(g,w,v,L.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(V,z,X,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=I,!0};var Oht=new q,Bht=new q,zht=new P;Uu.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,Uht),i=P.multiplyByPoint(n,e.camera.positionWC,Dht);t.cameraShapePosition=h.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=k.normalize(k.fromCartesian3(i,jSe),jSe),r=q.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],Oht),s=e.context.uniformState.inverseView,a=P.multiplyTransformation(n,s,zht),c=P.getMatrix3(a,Bht);t.cylinderEcToRadialTangentUp=q.multiply(r,c,t.cylinderEcToRadialTangentUp)};Uu.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 i3=new h,K$=new h;Uu.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),i3),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),K$);return J$(c,d,this._shapeTransform,o)};var QSe=new h;Uu.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,QSe),s=h.multiplyByScalar(r,o,QSe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,i3),o,i3),c=h.add(a,s,K$),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),i3),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),K$);return J$(m,p,this._shapeTransform,i)};Uu.DefaultMinBounds=Object.freeze(new h(0,-W.PI,-1));Uu.DefaultMaxBounds=Object.freeze(new h(1,+W.PI,1));var Hht=5,Kht=new Array(Hht),Jht=new h,jht=new q,Qht=new P,qht=new P,$ht=new P,H$=new P,eft=new h,tft=new h,nft=new h,$Se=new Array(8);for(let e=0;e<8;e++)$Se[e]=new h;function qSe(e,t,n){return Math.abs(ce.dot(e,t))<n}function ift(e){let t=P.getColumn(e,0,eft),n=P.getColumn(e,1,tft),i=P.getColumn(e,2,nft),o=W.EPSILON4;return qSe(t,n,o)&&qSe(n,i,o)}function oft(e,t){let n=$Se;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 nn.fromPoints(n,t)}var rft=new h;function J$(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=Kht,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,M=Math.cos(D),O=Math.sin(D),w=M*o,z=O*o,K=M*r,te=O*r;f=Math.min(f,w,K),y=Math.min(y,z,te),_=Math.max(_,w,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,Jht),I=q.fromRotationZ(m,jht),N=h.fromElements(Z,R,C,rft),g=P.fromScale(N,$ht),V=P.fromRotation(I,qht),G=P.fromTranslation(F,Qht),v=P.multiplyTransformation(V,P.multiplyTransformation(G,g,H$),H$),X=P.multiplyTransformation(n,v,H$);return ift(X)?nn.fromTransformation(X,i):oft(X,i)}var FS=Uu;var h_i=x(T(),1);function th(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._rectangle=new re,this._minimumHeight=th.DefaultMinBounds.z,this._maximumHeight=th.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(th.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 sft=new h,aft=new h,cft=new h,lft=new h,dft=new h,uft=new h,mft=new h,hft=new h,eZe=new h,tZe=new h,fft=new re;th.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=th;i=i??r,o=o??s;let a=W.EPSILON10,c=W.EPSILON10,d=W.EPSILON10,u=W.EPSILON3,m=P.getScale(e,hft),p=h.clone(r,sft);p.z=-h.minimumComponent(m);let b=h.clamp(t,p,s,aft),f=h.clamp(n,p,s,cft),y=h.clamp(i,p,s,lft),_=h.clamp(o,p,s,dft),S=h.maximumByComponent(b,y,uft),Z=h.minimumByComponent(f,_,mft),R=h.add(m,h.fromElements(f.z,f.z,f.z,eZe),eZe),C=h.add(m,h.fromElements(Z.z,Z.z,Z.z,tZe),tZe);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,fft);this._orientedBoundingBox=j$(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=me.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,M=X<L-c,O=Y||D||M,w=Z.y<-u,z=Z.y>=-u&&Z.y<=+u,K=Z.y>+u&&Z.y<s.y-d,te=w||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,Si=(f.x-r.x)/A,Hi=1-X/A,Gi=(Si+.5*Hi)%1;if(We.ellipsoidShapeUvLongitudeRangeOrigin=Gi,X>c){jt=A/X;let pi=jn-Gi;st=-jt*(pi-Math.floor(pi))}}_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,w?(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,Mi=1;return qe&&(Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,he>d&&(pt=(s.y-r.y)/he,Mi=(r.y-b.y)/he)),We.ellipsoidLocalToShapeUvScale=h.fromElements(jt,pt,ht,We.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(st,Mi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=ut,!0};var pft=new pe,bft=new h,gft=new P,nZe=new q;th.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,pft);h.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=h.fromRadians(o.longitude,o.latitude,0,n,bft);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=_t.eastNorthUpToFixedFrame(r,n,gft),a=P.getRotation(s,nZe),c=e.context.uniformState.viewRotation,d=q.multiply(c,a,nZe);t.ellipsoidEcToEastNorthUp=q.transpose(d,t.ellipsoidEcToEastNorthUp)};var lZe=new re;th.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,lZe),b=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return j$(p,b,f,this._ellipsoid,this._translation,this._rotation,o)};var yft=new k,xft=new k,WN=new k,iZe=new k,oZe=new k,vN=new k;function Tft(e,t,n,i){let o=k.abs(e,yft),r=k.fromElements(1/t.x,1/t.y,xft),s=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,WN),a=k.multiplyComponents(t,s,iZe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,oZe);for(let d=0;d<3;++d){let u=k.magnitude(k.subtract(a,c,vN)),m=k.normalize(k.subtract(o,c,vN),vN),p=k.multiplyByScalar(m,u,vN);s=k.multiplyComponents(k.add(p,c,WN),r,WN),s=k.normalize(k.clamp(s,k.ZERO,k.ONE,WN),WN),a=k.multiplyComponents(t,s,iZe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,oZe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,k.magnitude(k.subtract(a,c,vN)),i)}var _ft=new k,rZe=new k,Sft=new h,sZe=new k;th.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,rZe),m=Tft(u,k.fromElements(i.x,i.z,_ft),o,Sft),p=k.normalize(k.fromElements(m.x*r.x,m.y*r.z,sZe),sZe),b=Math.atan2(p.y,p.x),f=k.magnitude(u)<k.magnitude(m)?-1:1,y=k.subtract(u,m,rZe),_=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 aZe=new h,cZe=new h,Zft=new h;th.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,aZe),s=h.multiplyByScalar(r,o,aZe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,cZe),o,cZe),c=h.add(a,s,Zft),d=re.subsection(this._rectangle,a.x,a.y,c.x,c.y,lZe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return j$(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function j$(e,t,n,i,o,r,s){return s=nn.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}th.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));th.DefaultMaxBounds=Object.freeze(new h(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var IS=th;var Hd={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Hd.getMinBounds=function(e){switch(e){case Hd.BOX:return vS.DefaultMinBounds;case Hd.ELLIPSOID:return IS.DefaultMinBounds;case Hd.CYLINDER:return FS.DefaultMinBounds}};Hd.getMaxBounds=function(e){switch(e){case Hd.BOX:return vS.DefaultMaxBounds;case Hd.ELLIPSOID:return IS.DefaultMaxBounds;case Hd.CYLINDER:return FS.DefaultMaxBounds}};Hd.getShapeConstructor=function(e){switch(e){case Hd.BOX:return vS;case Hd.ELLIPSOID:return IS;case Hd.CYLINDER:return FS}};Object.freeze(Hd);var uc=Hd;function FN(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===uc.ELLIPSOID?Xp.Z_UP:Xp.Y_UP,this._minimumValues=b,this._maximumValues=f,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new LN}Object.defineProperties(FN.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}}});FN.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();Cft(n);let i=vft(n,t);await i.load();let{root:o}=n,r=oo(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new GS({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=Fft(s,c);Object.assign(d,Vft(o)),l(o.transform)?d.globalTransform=P.unpack(o.transform):d.globalTransform=P.clone(P.IDENTITY),d.dimensions=h.unpack(a.dimensions),d.maximumTileCount=Rft(s),l(a.padding)&&(d.paddingBefore=h.unpack(a.padding.before),d.paddingAfter=h.unpack(a.padding.after));let u=new FN(d),m=new o0(t,o,i.schema);return u._implicitTileset=m,u._availableLevels=m.availableLevels,Yi.unload(i),u};function Rft(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Xm.TILESET_TILE_COUNT)}function Cft(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!oo(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!oo(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!oo(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function Vft(e){let t=e.boundingVolume;if(l(t.box))return Lft(t.box);if(l(t.region))return Eft(t.region);if(oo(t,"3DTILES_bounding_volume_cylinder"))return Wft(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Eft(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:uc.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a}}var Aft=new h,Gft=new q;function Lft(e){let t=nn.unpack(e),n=q.getScale(t.halfAxes,Aft),i=q.getRotation(t.halfAxes,Gft);return{shape:uc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:P.fromRotationTranslation(i,t.center)}}function Wft(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:uc.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,d),shapeTransform:u}}function vft(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Yi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Yi.getSchemaLoader({schema:i})}function Fft(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=dZe(S,R),E=dZe(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 dZe(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=eg(a);return o=await Lb.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}FN.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 r0({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 WS.fromGltf(S)};var Q$=FN;var K_i=x(T(),1);function q$(e){e=e??1,this._radius=e??1}Object.defineProperties(q$.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});q$.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 IN=q$;var DSi=x(T(),1);var j_i=x(T(),1),PN=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -void main() -{ -vec4 position = czm_computePosition(); -#ifdef EXTRUDED_GEOMETRY -float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); -delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; -position = position + vec4(extrudeDirection * delta, 0.0); -#endif -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); -v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D -vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); -vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); -vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); -bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; -planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); -planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); -idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; -idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); -planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); -planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; -vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; -vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; -vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; -vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D -vec3 eastWard = southEastCorner - southWestCorner; -float eastExtent = length(eastWard); -eastWard /= eastExtent; -vec3 northWard = northWestCorner - southWestCorner; -float northExtent = length(northWard); -northWard /= northExtent; -v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); -v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); -v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL -vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); -vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); -v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); -v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); -v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif -gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +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 gSi=x(T(),1);var $_i=x(T(),1);function Pft(e){e=e??B.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var fl=Pft;var tSi=x(T(),1),nV=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { -vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); -return eyeCoordinate.xyz / eyeCoordinate.w; +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); } -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { -vec2 glFragCoordXY = gl_FragCoord.xy; -float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); -float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); -bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); -float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); -float useDownOrLeft = float(useUpOrRight == 0.0); -vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); -vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); -return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +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; } -#endif // NORMAL_EC -void main(void) -{ -#ifdef REQUIRES_EC -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif -#ifdef REQUIRES_WC -vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; -vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +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 -#ifdef TEXTURE_COORDINATES -vec2 uv; -#ifdef SPHERICAL -vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); -sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; -sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); -uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; -uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL -uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; -uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES -#ifdef CULL_FRAGMENTS -if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { -discard; +#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 -#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)); -vec3 normalEC = normalize(cross(leftRight, downUp)); +inputCoordinate.y = height; +inputCoordinate.z = angle; #endif -#ifdef PER_INSTANCE_COLOR -vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT -out_FragColor = color; -#else // FLAT -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = -eyeCoordinate.xyz; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#else // PER_INSTANCE_COLOR -czm_materialInput materialInput; -#ifdef USES_NORMAL_EC -materialInput.normalEC = normalEC; #endif -#ifdef USES_POSITION_TO_EYE_EC -materialInput.positionToEyeEC = -eyeCoordinate.xyz; +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); +} #endif -#ifdef USES_TANGENT_TO_EYE -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +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; +} +return childData; +} +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 +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif -#ifdef USES_ST -materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; -materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +} +bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { +int levelDifference = tileCoordinate.w - octreeCoords.w; +if (levelDifference < 0) { +return false; +} +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +return coordinateAtLevel == octreeCoords.xyz; +} +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]); +} +return; +} +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); +} +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 +} +`;var tfo=x(T(),1),a9=`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); +} +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 -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#endif // PER_INSTANCE_COLOR -czm_writeDepthClamp(); -#endif // PICK } -`;function nh(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new $$;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new $$;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}nh.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,nV]})};nh.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:[nV],pickColorQualifier:"in"})};nh.prototype.createVertexShader=function(e,t,n,i){return yZe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};nh.prototype.createPickVertexShader=function(e,t,n,i){return yZe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var uZe=new h,mZe=new pe,hZe={high:0,low:0};function yZe(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=mZe;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,uZe),m=An.encode(u.x,hZe);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=mZe;p.longitude=-W.PI,p.latitude=0,p.height=0;let b=s.project(p,uZe);m=An.encode(b.x,hZe),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 $$(){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($$.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 fZe(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 Xft=[new k,new k,new k,new k];function xZe(e,t){let n=Xft,i=k.unpack(t,0,n[0]),o=k.unpack(t,2,n[1]),r=k.unpack(t,4,n[2]);e.uMaxVmax=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/fZe(i,o,r),a=1/fZe(i,r,o);e.uvMinAndExtents=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var TZe=new pe,_Ze=new h,Nft=new h,Yft=new h,o3={high:0,low:0};function SZe(e,t,n){let i=TZe;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,_Ze);i.latitude=e.north;let r=t.project(i,Nft);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Yft),a=[0,0,0,0],c=[0,0,0,0],d=An.encode(o.x,o3);a[0]=d.high,c[0]=d.low,d=An.encode(o.y,o3),a[1]=d.high,c[1]=d.low,d=An.encode(r.y,o3),a[2]=d.high,c[2]=d.low,d=An.encode(s.x,o3),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var Mft=new P,wft=new P,pZe=new h,kft=new pe,Uft=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe];function Dft(e,t,n,i,o,r){let s=re.center(e,kft);s.height=n;let a=pe.toCartesian(s,t,pZe),c=_t.eastNorthUpToFixedFrame(a,t,Mft),d=P.inverse(c,wft),u=e.west,m=e.east,p=e.north,b=e.south,f=Uft;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,pZe);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 Oft=new h,Bft=new h,zft=new An;nh.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=_Ze,s=Oft,a=Bft;Dft(e,n,o??0,r,s,a);let c={};xZe(c,t);let d=An.fromCartesian(r,zft);return c.southWest_HIGH=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.high,[0,0,0])}),c.southWest_LOW=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.low,[0,0,0])}),c.eastward=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new fl({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),SZe(e,i,c),c};var Hft=new h;function bZe(e,t,n,i){let o=TZe;o.latitude=e,o.longitude=t,o.height=0;let r=pe.toCartesian(o,n,Hft),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 gZe=new k;nh.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=bZe(e.south,e.west,n,gZe),r=o.x,s=o.y,a=bZe(e.north,e.east,n,gZe),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 fl({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new fl({componentDatatype:J.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return xZe(b,t),SZe(e,i,b),b};nh.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)};nh.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 Kft(e){return Math.max(e.width,e.height)>nh.MAX_WIDTH_FOR_PLANAR_EXTENTS}nh.shouldUseSphericalCoordinates=function(e){return Kft(e)};nh.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var Du=nh;function PS(e){e=e??B.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ni.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(PS.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}}});PS.isSupported=function(e){return e.context.stencilBuffer};function iV(e,t){let n=t?ei.EQUAL:ei.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:sc.LESS_OR_EQUAL},depthMask:!1}}function tee(e){return{stencilTest:{enabled:e,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ei.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 Jft={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ei.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 jft(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(iV(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(iV(o,!0)),e._rsColorPass=ze.fromCache(tee(o,!1)),e._rsPickPass=ze.fromCache(Jft)}function Qft(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=Je.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function qft(e,t){let n=t.context,i=e._primitive,o=PN;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=Qft(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Je({defines:[a],sources:[o]}),d=new Je({sources:[Hy]}),u=e._primitive._attributeLocations,m=new Du(s,r,e.appearance);if(e._spStencil=tn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=Je.createPickVertexShaderSource(o);f=Pn._appendShowToShader(i,f),f=Pn._updatePickColorAttribute(f);let y=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=tn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(S)){let Z=m.createPickFragmentShader(!0),R=m.createPickVertexShader([a],f,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:R,fragmentShaderSource:Z,attributeLocations:u})}e._spPick2D=S}}else e._spPick=tn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=Pn._appendShowToShader(i,o),c=new Je({defines:[a],sources:[o]}),e._sp=tn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),b=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=tn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:b,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let y=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u})}e._spColor2D=f}}function $ft(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let b=n._va[a++];r=t[o],l(r)||(r=t[o]=new lt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=b,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Le.TERRAIN_CLASSIFICATION,s=lt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new lt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=b,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Le.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=It(c,y._uniforms)),r.uniformMap=c,s=lt.shallowClone(r,r.derivedCommands.tileset),s.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let _=lt.shallowClone(r,r.derivedCommands.appearance2D);_.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=_,_=lt.shallowClone(s,s.derivedCommands.appearance2D),_.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=_}}let u=e._commandsIgnoreShow,m=e._spStencil,p=0;i=u.length=i/2;for(let b=0;b<i;++b){let f=u[b]=lt.shallowClone(t[p],u[b]);f.shaderProgram=m,f.pass=Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function ept(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,d,u,m=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),b=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[m++];if(n&&(a=r[s++],f=i._va[a.index]),d=t[c],l(d)||(d=t[c]=new lt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Le.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=lt.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new lt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Le.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=lt.shallowClone(d,d.derivedCommands.tileset),u.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,b){let y=lt.shallowClone(d,d.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=y,y=lt.shallowClone(u,u.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y}}}function tpt(e,t,n,i,o,r,s){$ft(e,r),ept(e,s)}function ZZe(e,t){return Math.floor(e%t/2)}function eee(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function RZe(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function npt(e,t,n,i,o,r,s,a){let c=e._primitive;Pn._updateBoundingVolumes(c,t,o);let d;t.mode===se.SCENE3D?d=c._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===se.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,m=u!==ni.CESIUM_3D_TILE,p=u!==ni.TERRAIN,b=t.passes,f,y,_;if(b.render){let S=n.length;for(f=0;f<S;++f)y=d[ZZe(f,S)],m&&(_=n[f],eee(_,t,o,r,y,s)),p&&(_=n[f].derivedCommands.tileset,eee(_,t,o,r,y,s));if(t.invertClassification){let Z=e._commandsIgnoreShow,R=Z.length;for(f=0;f<R;++f)y=d[f],_=Z[f],eee(_,t,o,r,y,s)}}if(b.pick){let S=i.length,Z=c._pickOffsets;for(f=0;f<S;++f){let R=Z[ZZe(f,S)];y=d[R.index],m&&(_=i[f],RZe(_,t,o,r,y)),p&&(_=i[f].derivedCommands.tileset,RZe(_,t,o,r,y))}}}PS.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,d=!1,u=!0,m,p=!1,b=!1;for(r>0&&(c=o[0].attributes,p=Du.hasAttributesForSphericalExtents(c),b=Du.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;l(y)&&(d=!0),u=u&&l(y)&&$t.equals(m,y)}if(!u&&!p&&!b)throw new ge("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new Tn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!b,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=b,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new Mt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=f,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,_){n._createBoundingVolumeFunction(y,_)}),i._createRenderStatesFunction=function(y,_,S,Z){jft(n,_)},i._createShaderProgramFunction=function(y,_,S){qft(n,_)},i._createCommandsFunction=function(y,_,S,Z,R,C,E){tpt(n,void 0,void 0,!0,!1,C,E)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,_,S,Z,R,C,E,A){n._updateAndQueueCommandsFunction(y,_,S,Z,R,C,E,A)}:i._updateAndQueueCommandsFunction=function(y,_,S,Z,R,C,E,A){npt(n,_,S,Z,R,C,E,A)},this._primitive=new Pn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(iV(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(iV(!1,!0)),this._rsColorPass=ze.fromCache(tee(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(iV(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(iV(!0,!0)),this._rsColorPass=ze.fromCache(tee(!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))})};PS.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};PS.prototype.isDestroyed=function(){return!1};PS.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 oV=PS;var kZi=x(T(),1);var BSi=x(T(),1),r3={CUMULUS:0};r3.validate=function(e){return e===r3.CUMULUS};Object.freeze(r3);var rV=r3;var HSi=x(T(),1),XN=`uniform sampler2D u_noiseTexture; +`;var ifo=x(T(),1),nFe={Z_UP:0,Y_UP:1};Object.freeze(nFe);var P0=nFe;function GWt(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([jw]),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",s9,Kw,a9,Qw,$w,qw]),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([i9,e9,rR]):d==="CYLINDER"?t.addFragmentLines([o9,cA,t9,rR]):d==="ELLIPSOID"&&t.addFragmentLines([r9,cA,n9,rR]),t.addFragmentLines([Jw]);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 c9=GWt;var iFe=new k;function LWt(e,t){let n=new c9(e);Hw(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,iFe),A=oFe(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=iy.getTextureResolution(s,t,iFe),A=oFe(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 oFe(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 l9=LWt;var vpo=x(T(),1);var epo=x(T(),1);var cFe={};function WWt(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 fd)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var vWt=new h,rFe=new h;function lFe(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 Bre(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,vWt),b=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),rFe)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),rFe));r=Math.min(WWt(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 d9(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 dFe=new h;function FWt(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,dFe),u=c.pitch,m=d9(c.heading,i),p=d9(c.roll,r),b=Bre(c,n,d.z,n.z,s),f=lFe(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 IWt(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function PWt(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 XWt=new pe,NWt=new pe;function YWt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,b=pe.clone(u.positionCartographic,XWt),f=u.pitch,y=d9(u.heading,i),_=d9(u.roll,r),S=p.cartesianToCartographic(n,NWt);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?IWt(b,S):PWt(b,S);let R=Bre(u,n,b.height,S.height,s),C=lFe(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 MWt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,dFe),d=d9(a.heading,i),u=a.frustum.right-a.frustum.left,m=Bre(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 sFe=new pe,wWt=new h;function Ore(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function aFe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}cFe.createTween=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===se.MORPHING)return Ore();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,sFe),n=r.project(sFe,wWt));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=aFe(Z,t.complete),C=aFe(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 Ore(R,C);let L=new Array(4);if(L[se.SCENE2D]=MWt,L[se.SCENE3D]=YWt,L[se.COLUMBUS_VIEW]=FWt,f<=0)return Ore(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 u9=cFe;var npo=x(T(),1),uFe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(uFe);var pd=uFe;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,SFe(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,IFe(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 SFe(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 kWt(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(kWt(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 UWt(e){_t.basisTo2D(e._projection,e._transform,e._actualTransform)}var DWt=new pe,OWt=new h,bK=new h,BWt=new ce,zWt=new ce,HWt=new ce,KWt=new ce,JWt=new ce;function jWt(e){let t=e._projection,n=t.ellipsoid,i=P.getColumn(e._transform,3,BWt),o=n.cartesianToCartographic(i,DWt),r=t.project(o,OWt),s=zWt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,JWt),c=ce.add(P.getColumn(e._transform,0,bK),i,bK);n.cartesianToCartographic(c,o),t.project(o,r);let d=HWt;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=KWt;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=ce.add(P.getColumn(e._transform,1,bK),i,bK);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 zre=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?UWt(e):jWt(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=zre;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,zre));if(Math.abs(1-f)>W.EPSILON2){let y=1/h.magnitudeSquared(c),_=h.dot(c,s)*y,S=h.multiplyByScalar(s,_,zre);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)&&SFe(e)}function ZFe(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 RFe(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function CFe(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 xK=new P,TK=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,xK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,TK);this._setTransform(n);let i=ZFe(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,xK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,TK);this._setTransform(n);let i=RFe(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,xK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,TK);this._setTransform(n);let i=CFe(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&&GFe(this,this.position)};var QWt=new h,qWt=new h,$Wt=new h;ln.prototype._setTransform=function(e){let t=h.clone(this.positionWC,QWt),n=h.clone(this.upWC,qWt),i=h.clone(this.directionWC,$Wt);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 evt=new k,tvt=new gn,nvt=new h,ivt=new h;function VFe(e){if(!P.equals(P.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=evt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,tvt);o=n.pickWorldCoordinates(a,t,!0,nvt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,ivt));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=VFe(this)))};var _K=new h,Qre=new P,ovt=new P,qre=new Ne,$re=new q,EFe=new pe;function rvt(e,t,n){let i=P.clone(e.transform,Qre),o=_t.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,ovt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,qre),s=q.fromQuaternion(r,$re);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 svt(e,t,n,i){let o=P.clone(e.transform,Qre);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,EFe);t=a.project(c,_K)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,qre),s=q.fromQuaternion(r,$re);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 avt(e,t,n,i){let o=P.clone(e.transform,Qre);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,EFe);t=c.project(d,_K)}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===pd.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Ne.fromHeadingPitchRoll(n,qre),s=q.fromQuaternion(r,$re);q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var cvt=new h,lvt=new h,dvt=new h;function AFe(e,t,n,i){let o=h.clone(n.direction,cvt),r=h.clone(n.up,lvt);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,c=_t.eastNorthUpToFixedFrame(t,a,xK),d=P.inverseTransformation(c,TK);P.multiplyByPointAsVector(d,o,o),P.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,dvt);return i.heading=ZFe(o,r),i.pitch=RFe(o),i.roll=CFe(o,r,s),i}var jre={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},lA=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,_K);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,_K),i=!1),l(t.direction)&&(t=AFe(this,o,t,jre.orientation)),lA.heading=t.heading??0,lA.pitch=t.pitch??-W.PI_OVER_TWO,lA.roll=t.roll??0,n===se.SCENE3D?rvt(this,o,lA):n===se.SCENE2D?avt(this,o,lA,i):svt(this,o,lA,i)};var uvt=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,uvt).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 GFe(e,t){let n=e._scene.mapMode2D===pd.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 mFe=new h;ln.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,mFe),h.add(n,mFe,n),this._mode===se.SCENE2D&&GFe(this,n),this._adjustOrthographicFrustum(!0)};ln.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?SK(this,e):this.move(this.direction,e)};ln.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?SK(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 mvt=new Ne,hvt=new q;ln.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Ne.fromAxisAngle(e,-n,mvt),o=q.fromQuaternion(i,hvt),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 fvt=new Ne,pvt=new q;ln.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Ne.fromAxisAngle(e,-n,fvt),o=q.fromQuaternion(i,pvt);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,LFe(this,e)};ln.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,LFe(this,-e)};var bvt=new h,gvt=new h,yvt=new h,hFe=new h;function LFe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,bvt),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,hFe),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,gvt),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,hFe)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,yvt);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,WFe(this,-e)};ln.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,WFe(this,e)};function WFe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function SK(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===pd.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===pd.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 vFe(e,t){e.move(e.direction,t)}ln.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?SK(this,e):vFe(this,e)};ln.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?SK(this,-e):vFe(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 xvt=new P;ln.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ne.default,o=_t.eastNorthUpToFixedFrame(e,i,xvt);this.lookAtTransform(o,t)};var Tvt=new h,_vt=new Ne,Svt=new Ne,Zvt=new q;function FFe(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,_vt),r=Ne.fromAxisAngle(h.UNIT_Z,-e,Svt),s=Ne.multiply(r,o,r),a=q.fromQuaternion(s,Zvt),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=FFe(t.heading,t.pitch,t.range,Tvt):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 Rvt=new P,fFe=new h,Cvt=new h,pFe=new h;ln.prototype.lookAtWorldPosition=function(e,t=ne.default){let n=P.clone(this._transform,Rvt);this._setTransform(P.IDENTITY);let i=h.subtract(e,this.positionWC,fFe);h.magnitudeSquared(i)<W.EPSILON8&&(i=h.clone(this.directionWC,fFe)),i=h.normalize(i,this.direction);let o=t.geodeticSurfaceNormal(e,Cvt),r=h.cross(i,o,pFe);h.magnitudeSquared(r)<W.EPSILON8&&(r=h.clone(this.rightWC,pFe)),h.normalize(r,this.right);let s=h.cross(r,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var m9=new pe,Vvt=new pe,Evt=new h,Avt=new h,Gvt=new h,Lvt=new h,Wvt=new h,vvt=new h,Fvt=new h,Hre=new h,Ivt={direction:new h,right:new h,up:new h},bFe;function Rl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function IFe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Ivt,{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=m9;I.longitude=u,I.latitude=s,I.height=0;let N=Vvt;N.longitude=u,N.latitude=a,N.height=0;let g=bFe;(!l(g)||g.ellipsoid!==o)&&(bFe=g=new hb(void 0,void 0,o)),g.setEndPoints(I,N),m=g.interpolateUsingFraction(.5,m9).latitude}let p=m9;p.longitude=u,p.latitude=m,p.height=0;let b=o.cartographicToCartesian(p,Fvt),f=m9;f.longitude=d,f.latitude=s;let y=o.cartographicToCartesian(f,Evt);f.longitude=c;let _=o.cartographicToCartesian(f,Gvt);f.longitude=u;let S=o.cartographicToCartesian(f,Wvt);f.latitude=a;let Z=o.cartographicToCartesian(f,vvt);f.longitude=d;let R=o.cartographicToCartesian(f,Lvt);f.longitude=c;let C=o.cartographicToCartesian(f,Avt);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=m9;g.longitude=c,g.latitude=0,g.height=0;let V=o.cartographicToCartesian(g,Hre);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,Hre),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,Hre),n)}var Pvt=new pe,Xvt=new h,Nvt=new h;function Yvt(e,t,n){let i=e._projection;t.west>t.east&&(t=re.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Pvt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Xvt);P.multiplyByPoint(o,a,a),P.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Nvt);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 Mvt=new pe,wvt=new h,kvt=new h;function Uvt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===pd.INFINITE_SCROLL?o+=W.TWO_PI:(t=re.MAX_VALUE,o=t.east));let r=Mvt;r.longitude=o,r.latitude=t.north;let s=i.project(r,wvt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,kvt),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 IFe(this,e,t);if(n===se.COLUMBUS_VIEW)return Yvt(this,e,t);if(n===se.SCENE2D)return Uvt(this,e,t)};var Dvt=new gn;function Ovt(e,t,n,i){n=n??ne.default;let o=e.getPickRay(t,Dvt),r=xi.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var Bvt=new gn;function zvt(e,t,n,i){let r=e.getPickRay(t,Bvt).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 Hvt=new gn;function Kvt(e,t,n,i){let o=e.getPickRay(t,Hvt),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=Ovt(this,e,t,n);else if(this._mode===se.SCENE2D)n=zvt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=Kvt(this,e,this._projection,n);else return;return n}};var Jvt=new h,jvt=new h,Qvt=new h;function qvt(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,Jvt);h.add(m,p,p);let b=h.multiplyByScalar(e.rightWC,d*c*a,jvt),f=h.multiplyByScalar(e.upWC,u*c*s,Qvt),y=h.add(p,b,n.direction);return h.add(y,f,y),h.subtract(y,m,y),h.normalize(y,y),n}var gK=new h;function $vt(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,gK),h.add(gK,u,u),h.multiplyByScalar(e.upWC,d,gK),h.add(gK,u,u),h.clone(e.directionWC,n.direction),e._mode===se.SCENE2D&&e._scene.mapMode2D===pd.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)?qvt(this,e,t):$vt(this,e,t)};var e2t=new h,t2t=new h;ln.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,e2t),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),t2t);return Math.max(0,h.magnitude(n)-e.radius)};var n2t=new k;ln.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,n2t);return Math.max(o.x,o.y)};function i2t(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 o2t=new h,gFe=new h,r2t=new h,s2t=new h;function a2t(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,o2t),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,gFe),gFe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,r2t);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,s2t)),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 i2t(e,n,s,f,y,t)}}ln.prototype.createCorrectPositionTween=function(e){if(this._mode===se.COLUMBUS_VIEW)return a2t(this,e)};var c2t=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,c2t));let o=e.orientation??B.EMPTY_OBJECT;if(l(o.direction)&&(o=AFe(this,t,o,jre.orientation)),l(e.duration)&&e.duration<=0){let u=jre;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=u9.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 l2t(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function d2t(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 u2t=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=u2t:e.frustum instanceof yn||e._mode===se.SCENE2D?n.range=d2t(e,s):n.range=l2t(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 m2t=new P,yFe=new h,h2t=new h,f2t=new h,p2t=new h,b2t=new ce,g2t=new Ne,y2t=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,yFe):o=FFe(i.heading,i.pitch,i.range,yFe);let s=this._scene.ellipsoid??ne.default,a=_t.eastNorthUpToFixedFrame(e.center,s,m2t);P.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,h2t),h.normalize(c,c),d=P.multiplyByPointAsVector(a,h.UNIT_Z,f2t),1-Math.abs(h.dot(c,d))<W.EPSILON6){let m=Ne.fromAxisAngle(c,i.heading,g2t),p=q.fromQuaternion(m,y2t);h.fromCartesian4(P.getColumn(a,1,b2t),d),q.multiplyByVector(p,d,d)}let u=h.cross(c,d,p2t);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 xFe=new h,TFe=new h,Kre=new h,_Fe=new h,h9=[new h,new h,new h,new h];function x2t(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,xFe),r=h.magnitude(o),s=h.normalize(o,TFe),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,_Fe),_Fe));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,xFe),m=d/r,p=h.multiplyByScalar(a,m,TFe),b=h.multiplyByScalar(c,m,Kre),f=h.add(u,b,h9[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let y=h.subtract(u,b,h9[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let _=h.subtract(u,b,h9[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let S=h.add(u,b,h9[3]);return h.add(S,p,S),h.multiplyComponents(n,S,S),h9}var Jre=new k,T2t=new h,GT=[new pe,new pe,new pe,new pe];function yK(e,t,n,i,o,r){Jre.x=e,Jre.y=t;let s=i.pickEllipsoid(Jre,o,T2t);return l(s)?(GT[n]=o.cartesianToCartographic(s,GT[n]),1):(GT[n]=o.cartesianToCartographic(r[n],GT[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 me(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=x2t(this,e);if(c+=yK(0,0,0,this,e,d),c+=yK(0,a,1,this,e,d),c+=yK(s,a,2,this,e,d),c+=yK(s,0,3,this,e,d),c<2)return re.MAX_VALUE;t=re.fromCartographicArray(GT,t);let u=0,m=GT[3].longitude;for(let p=0;p<4;++p){let b=GT[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,GT[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=VFe(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 Opo=x(T(),1);var Ipo=x(T(),1),XFe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(XFe);var lo=XFe;var kFe=[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 _2t(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 NFe(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]?(_2t(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 dA(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(){ese(ja(n,void 0),e);for(let u of kFe){let m=ja(n,u);ese(m,e)}},d,t)}function ese(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 MFe(e,t){k.clone(e.startPosition,t.startPosition),k.clone(e.endPosition,t.endPosition)}function S2t(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,ese(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 wFe(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);S2t(c,t,e),r[d]&&(n[d]?(MFe(i[d],o[d]),o[d].valid=!0,MFe(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),NFe(this,void 0,e),dA(this,void 0,lo.LEFT_DRAG),dA(this,void 0,lo.RIGHT_DRAG),dA(this,void 0,lo.MIDDLE_DRAG),wFe(this,void 0);for(let t of kFe)YFe(this,t),NFe(this,t,e),dA(this,t,lo.LEFT_DRAG),dA(this,t,lo.RIGHT_DRAG),dA(this,t,lo.MIDDLE_DRAG),wFe(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(),ue(this)};var f9=Th;var Hpo=x(T(),1);var tse=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()}},nse=tse;var jpo=x(T(),1);function Z2t(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var _h=Z2t;var _bo=x(T(),1);var e0o=x(T(),1);function p9(e){e=e??B.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new $g({comparator:p9.comparator})}p9.prototype.addSubtree=function(e){let t=new R2t(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()};p9.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}};p9.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 R2t(e,t){this.subtree=e,this.stamp=t}var b9=p9;var c0o=x(T(),1);function oy(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(oy.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});oy.fromMetadataArray=function(e){return new oy({metadata:e})};oy.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 oy({loader:t})};oy.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=C2t(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function C2t(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}oy.prototype.isDestroyed=function(){return!1};oy.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var sR=oy;var J0o=x(T(),1);var y0o=x(T(),1);function Vl(){this._orientedBoundingBox=new tn,this._boundingSphere=new me,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 iy({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 V2t=new h,E2t=new h,A2t=new q,G2t=new h,L2t=new h;Vl.prototype.update=function(e,t,n,i,o){i=i??t.clone(G2t),o=o??n.clone(L2t),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,E2t);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=rse(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.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(ise(p.x,b.x),ise(p.y,b.y),ise(p.z,b.z),d.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(f,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=m,!0};function ise(e,t){return W.equalsEpsilon(e,t,W.EPSILON7)?1:1/(t-e)}var W2t=new P;Vl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,W2t),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 ZK=new h,ose=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),ZK),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)),ose);return rse(c,d,this._shapeTransform,o)};var UFe=new h;Vl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,UFe),s=h.multiplyByScalar(r,o,UFe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,ZK),o,ZK),c=h.add(a,s,ose),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),ZK),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),ose);return rse(m,p,this._shapeTransform,i)};Vl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Vl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var DFe=new h;function rse(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,DFe),c=h.midpoint(e,t,V2t);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),DFe);let d=P.getRotation(n,A2t);i.halfAxes=q.setScale(d,a,i.halfAxes)}return i}var aR=Vl;var L0o=x(T(),1);function am(){this._orientedBoundingBox=new tn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=am.DefaultMinBounds.clone(),this._maxBounds=am.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=am,n=[new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new iy({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(am.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 v2t=new h,F2t=new h,I2t=new h,P2t=new h,X2t=new h,N2t=new P,Y2t=new h,OFe=new k;am.prototype.update=function(e,t,n,i,o){i=i??t.clone(F2t),o=o??n.clone(I2t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=am,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,P2t),p=h.minimumByComponent(n,o,X2t),b=P.getScale(e,v2t);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=cse(m,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.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,M=1-_/a,O=(D+.5*M)%1;L.cylinderShapeUvAngleRangeOrigin=O;let w=0,z=1;if(_>u){w=a/_;let K=Y-O;z=-w*(K-Math.floor(K))}return L.cylinderLocalToShapeUvScale=h.fromElements(g,w,v,L.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(V,z,X,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=I,!0};var M2t=new q,w2t=new q,k2t=new P;am.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,N2t),i=P.multiplyByPoint(n,e.camera.positionWC,Y2t);t.cameraShapePosition=h.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=k.normalize(k.fromCartesian3(i,OFe),OFe),r=q.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],M2t),s=e.context.uniformState.inverseView,a=P.multiplyTransformation(n,s,k2t),c=P.getMatrix3(a,w2t);t.cylinderEcToRadialTangentUp=q.multiply(r,c,t.cylinderEcToRadialTangentUp)};am.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 RK=new h,ase=new h;am.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),RK),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),ase);return cse(c,d,this._shapeTransform,o)};var BFe=new h;am.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,BFe),s=h.multiplyByScalar(r,o,BFe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,RK),o,RK),c=h.add(a,s,ase),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),RK),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),ase);return cse(m,p,this._shapeTransform,i)};am.DefaultMinBounds=Object.freeze(new h(0,-W.PI,-1));am.DefaultMaxBounds=Object.freeze(new h(1,+W.PI,1));var U2t=5,D2t=new Array(U2t),O2t=new h,B2t=new q,z2t=new P,H2t=new P,K2t=new P,sse=new P,J2t=new h,j2t=new h,Q2t=new h,HFe=new Array(8);for(let e=0;e<8;e++)HFe[e]=new h;function zFe(e,t,n){return Math.abs(ce.dot(e,t))<n}function q2t(e){let t=P.getColumn(e,0,J2t),n=P.getColumn(e,1,j2t),i=P.getColumn(e,2,Q2t),o=W.EPSILON4;return zFe(t,n,o)&&zFe(n,i,o)}function $2t(e,t){let n=HFe;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 eFt=new h;function cse(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=D2t,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,M=Math.cos(D),O=Math.sin(D),w=M*o,z=O*o,K=M*r,te=O*r;f=Math.min(f,w,K),y=Math.min(y,z,te),_=Math.max(_,w,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,O2t),I=q.fromRotationZ(m,B2t),N=h.fromElements(Z,R,C,eFt),g=P.fromScale(N,K2t),V=P.fromRotation(I,H2t),G=P.fromTranslation(F,z2t),v=P.multiplyTransformation(V,P.multiplyTransformation(G,g,sse),sse),X=P.multiplyTransformation(n,v,sse);return q2t(X)?tn.fromTransformation(X,i):$2t(X,i)}var cR=am;var O0o=x(T(),1);function Sh(){this._orientedBoundingBox=new tn,this._boundingSphere=new me,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 tFt=new h,nFt=new h,iFt=new h,oFt=new h,rFt=new h,sFt=new h,aFt=new h,cFt=new h,KFe=new h,JFe=new h,lFt=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,cFt),p=h.clone(r,tFt);p.z=-h.minimumComponent(m);let b=h.clamp(t,p,s,nFt),f=h.clamp(n,p,s,iFt),y=h.clamp(i,p,s,oFt),_=h.clamp(o,p,s,rFt),S=h.maximumByComponent(b,y,sFt),Z=h.minimumByComponent(f,_,aFt),R=h.add(m,h.fromElements(f.z,f.z,f.z,KFe),KFe),C=h.add(m,h.fromElements(Z.z,Z.z,Z.z,JFe),JFe);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,lFt);this._orientedBoundingBox=lse(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=me.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,M=X<L-c,O=Y||D||M,w=Z.y<-u,z=Z.y>=-u&&Z.y<=+u,K=Z.y>+u&&Z.y<s.y-d,te=w||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,Si=(f.x-r.x)/A,Hi=1-X/A,Gi=(Si+.5*Hi)%1;if(We.ellipsoidShapeUvLongitudeRangeOrigin=Gi,X>c){jt=A/X;let pi=jn-Gi;st=-jt*(pi-Math.floor(pi))}}_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,w?(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,Mi=1;return qe&&(Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,he>d&&(pt=(s.y-r.y)/he,Mi=(r.y-b.y)/he)),We.ellipsoidLocalToShapeUvScale=h.fromElements(jt,pt,ht,We.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(st,Mi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=ut,!0};var dFt=new pe,uFt=new h,mFt=new P,jFe=new q;Sh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,dFt);h.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=h.fromRadians(o.longitude,o.latitude,0,n,uFt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=_t.eastNorthUpToFixedFrame(r,n,mFt),a=P.getRotation(s,jFe),c=e.context.uniformState.viewRotation,d=q.multiply(c,a,jFe);t.ellipsoidEcToEastNorthUp=q.transpose(d,t.ellipsoidEcToEastNorthUp)};var iIe=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,iIe),b=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return lse(p,b,f,this._ellipsoid,this._translation,this._rotation,o)};var hFt=new k,fFt=new k,g9=new k,QFe=new k,qFe=new k,y9=new k;function pFt(e,t,n,i){let o=k.abs(e,hFt),r=k.fromElements(1/t.x,1/t.y,fFt),s=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,g9),a=k.multiplyComponents(t,s,QFe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,qFe);for(let d=0;d<3;++d){let u=k.magnitude(k.subtract(a,c,y9)),m=k.normalize(k.subtract(o,c,y9),y9),p=k.multiplyByScalar(m,u,y9);s=k.multiplyComponents(k.add(p,c,g9),r,g9),s=k.normalize(k.clamp(s,k.ZERO,k.ONE,g9),g9),a=k.multiplyComponents(t,s,QFe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,qFe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,k.magnitude(k.subtract(a,c,y9)),i)}var bFt=new k,$Fe=new k,gFt=new h,eIe=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,$Fe),m=pFt(u,k.fromElements(i.x,i.z,bFt),o,gFt),p=k.normalize(k.fromElements(m.x*r.x,m.y*r.z,eIe),eIe),b=Math.atan2(p.y,p.x),f=k.magnitude(u)<k.magnitude(m)?-1:1,y=k.subtract(u,m,$Fe),_=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 tIe=new h,nIe=new h,yFt=new h;Sh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,tIe),s=h.multiplyByScalar(r,o,tIe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,nIe),o,nIe),c=h.add(a,s,yFt),d=re.subsection(this._rectangle,a.x,a.y,c.x,c.y,iIe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return lse(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function lse(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 lR=Sh;var au={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};au.getMinBounds=function(e){switch(e){case au.BOX:return aR.DefaultMinBounds;case au.ELLIPSOID:return lR.DefaultMinBounds;case au.CYLINDER:return cR.DefaultMinBounds}};au.getMaxBounds=function(e){switch(e){case au.BOX:return aR.DefaultMaxBounds;case au.ELLIPSOID:return lR.DefaultMaxBounds;case au.CYLINDER:return cR.DefaultMaxBounds}};au.getShapeConstructor=function(e){switch(e){case au.BOX:return aR;case au.ELLIPSOID:return lR;case au.CYLINDER:return cR}};Object.freeze(au);var xc=au;function x9(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 b9}Object.defineProperties(x9.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}}});x9.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();TFt(n);let i=EFt(n,t);await i.load();let{root:o}=n,r=no(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new DS({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=AFt(s,c);Object.assign(d,_Ft(o)),l(o.transform)?d.globalTransform=P.unpack(o.transform):d.globalTransform=P.clone(P.IDENTITY),d.dimensions=h.unpack(a.dimensions),d.maximumTileCount=xFt(s),l(a.padding)&&(d.paddingBefore=h.unpack(a.padding.before),d.paddingAfter=h.unpack(a.padding.after));let u=new x9(d),m=new $p(t,o,i.schema);return u._implicitTileset=m,u._availableLevels=m.availableLevels,Ni.unload(i),u};function xFt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Pm.TILESET_TILE_COUNT)}function TFt(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 _Ft(e){let t=e.boundingVolume;if(l(t.box))return CFt(t.box);if(l(t.region))return SFt(t.region);if(no(t,"3DTILES_bounding_volume_cylinder"))return VFt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function SFt(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 ZFt=new h,RFt=new q;function CFt(e){let t=tn.unpack(e),n=q.getScale(t.halfAxes,ZFt),i=q.getRotation(t.halfAxes,RFt);return{shape:xc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:P.fromRotationTranslation(i,t.center)}}function VFt(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 EFt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ni.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ni.getSchemaLoader({schema:i})}function AFt(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=oIe(S,R),E=oIe(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 oIe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function GFt(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=dg(a);return o=await Wb.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}x9.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 GFt(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 sR.fromGltf(S)};var dse=x9;var Cbo=x(T(),1);function use(e){e=e??1,this._radius=e??1}Object.defineProperties(use.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});use.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 T9=use;var Zgo=x(T(),1);var Ebo=x(T(),1),CK={CUMULUS:0};CK.validate=function(e){return e===CK.CUMULUS};Object.freeze(CK);var uA=CK;var Gbo=x(T(),1),_9=`uniform sampler2D u_noiseTexture; uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; in vec2 v_offset; @@ -8898,7 +9548,7 @@ out_FragColor = cloud; #endif #endif } -`;var JSi=x(T(),1),NN=`#ifdef INSTANCED +`;var Wbo=x(T(),1),S9=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScaleX; @@ -8938,7 +9588,7 @@ v_color = color; v_slice = slice; v_brightness = brightness; } -`;var QSi=x(T(),1),YN=`uniform vec3 u_noiseTextureDimensions; +`;var Fbo=x(T(),1),Z9=`uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; uniform vec3 u_noiseOffset; in vec2 v_position; @@ -9015,7 +9665,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 $Si=x(T(),1),MN=`uniform vec3 u_noiseTextureDimensions; +`;var Pbo=x(T(),1),R9=`uniform vec3 u_noiseTextureDimensions; in vec2 position; out vec2 v_position; void main() @@ -9030,7 +9680,7 @@ transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; transformedPos.y *= noiseTextureRows; v_position = transformedPos; } -`;var sZi=x(T(),1);function _f(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 ipt=_f.SHOW_INDEX=0,opt=_f.POSITION_INDEX=1,rpt=_f.SCALE_INDEX=2,spt=_f.MAXIMUM_SIZE_INDEX=3,apt=_f.SLICE_INDEX=4,cpt=_f.BRIGHTNESS_INDEX=5,lpt=_f.COLOR_INDEX=6;_f.NUMBER_OF_PROPERTIES=7;function XS(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(_f.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,XS(this,ipt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),XS(this,opt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),XS(this,rpt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),XS(this,spt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),XS(this,lpt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,XS(this,apt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,XS(this,cpt))}}});_f.prototype._destroy=function(){this._cloudCollection=void 0};var Ou=_f;var Bu,s3=new h,dpt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},upt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},mpt=Ou.SHOW_INDEX,hpt=Ou.POSITION_INDEX,fpt=Ou.SCALE_INDEX,ppt=Ou.MAXIMUM_SIZE_INDEX,bpt=Ou.SLICE_INDEX,gpt=Ou.BRIGHTNESS_INDEX,ypt=Ou.NUMBER_OF_PROPERTIES,xpt=Ou.COLOR_INDEX;function Sf(e){e=e??B.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(ypt),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:CZe(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 CZe(e){return function(){return s3.x=e._textureSliceWidth,s3.y=e._noiseTextureRows,s3.z=1/e._noiseTextureRows,s3}}Object.defineProperties(Sf.prototype,{length:{get:function(){return iee(this),this._clouds.length}}});function VZe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Sf.prototype.add=function(e){e=e??B.EMPTY_OBJECT;let t=e.cloudType??rV.CUMULUS,n;return t===rV.CUMULUS&&(n=new Ou(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Sf.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Sf.prototype.removeAll=function(){VZe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function iee(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}}Sf.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Sf.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Sf.prototype.get=function(e){return iee(this),this._clouds[e]};var Tpt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),_pt=new Uint16Array([0,1,2,0,2,3]);function Spt(e){let t=it.createVertexBuffer({context:e,typedArray:Tpt,usage:Pe.STATIC_DRAW}),n=it.createIndexBuffer({context:e,typedArray:_pt,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 oee;function Zpt(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=it.createIndexBuffer({context:e,typedArray:o,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function Rpt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=it.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 Cpt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=it.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 Vpt(e,t,n){let i=[{index:Bu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:Bu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:Bu.packedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:Bu.packedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:Bu.color,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,usage:Pe.STATIC_DRAW}];n&&i.push({index:Bu.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:Cpt(e)});let o=n?t:4*t;return new pb(e,i,o,n)}var nee=new An;function EZe(e,t,n,i){let o,r=n[Bu.positionHighAndScaleX],s=n[Bu.positionLowAndScaleY],a=i.position;An.fromCartesian(a,nee);let c=i.scale,d=nee.high,u=nee.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 AZe(e,t,n,i){let o,r=n[Bu.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 GZe(e,t,n,i){let o,r=n[Bu.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 LZe(e,t,n,i){let o,r=n[Bu.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 Ept(e,t,n,i){EZe(e,t,n,i),AZe(e,t,n,i),GZe(e,t,n,i),LZe(e,t,n,i)}function Apt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=Spt(a),o._spNoise=tn.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 Ot({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:qn.NEAREST})});let u=new vu({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:CZe(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 Gpt(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=Vpt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];Ept(e,t,s,c)}n._vaf.commit(oee(i))}}var Lpt=[];function Wpt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=Lpt;d.length=0,(c[hpt]||c[fpt])&&d.push(EZe),(c[mpt]||c[gpt])&&d.push(AZe),(c[ppt]||c[bpt])&&d.push(GZe),c[xpt]&&d.push(LZe);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(oee(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 vpt(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=tn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Bu}),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 Fpt(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)}}}Sf.prototype.update=function(e){if(iee(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&Apt(this,e,MN,YN),this._instanced=e.context.instancedArrays,Bu=this._instanced?upt:dpt,oee=this._instanced?Rpt:Zpt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?Gpt(this,e):r>0&&Wpt(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)&&vpt(this,e,NN,XN),Fpt(this,e))};Sf.prototype.isDestroyed=function(){return!1};Sf.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(),VZe(this._clouds),ue(this)};var ree=Sf;var tRi=x(T(),1);var JZi=x(T(),1);var OZi=x(T(),1);async function Ipt(e,t,n,i){return l(i)||(i=!1),Npt(e,t,n,i)}function Ppt(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(vZe(i)):r=o.then(vZe(i)).catch(Ypt(i)),e.shift(),t.push(r),!0}function Xpt(e){return new Promise(function(t){setTimeout(t,e)})}function see(e,t,n){return e.length?Ppt(e,t,n)?see(e,t,n):Xpt(100).then(()=>see(e,t,n)):Promise.resolve()}function Npt(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 see(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function WZe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function vZe(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(!WZe(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];WZe(s,i,n)}}):Promise.resolve()}}function Ypt(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=Ipt;var aee=new k;async function FZe(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,aee);let p=e.loadTileDataAvailability(aee.x,aee.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 wN(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 FZe(e,a,n),t}var NS=FZe;async function cee(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 cee._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}cee._sampleTerrainMostDetailed=NS;var YS=cee;var rRi=x(T(),1);var Mpt=W.toRadians(30);function lee(e){this._angle=e??Mpt}Object.defineProperties(lee.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});lee.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 dee=lee;var ZRi=x(T(),1);var aRi=x(T(),1);var uee=[],mee=[];function wpt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=uee,d=mee,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 hee(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);hee(e,t,n,i,r),hee(e,t,n,r+1,o),wpt(e,t,n,i,r,o)}function kpt(e,t,n){let i=e.length,o=Math.ceil(i*.5);uee.length=o,mee.length=o,hee(e,t,n,0,i-1),uee.length=0,mee.length=0}var s0=kpt;var Upt=new U,Dpt=new U,Opt=new U,Bpt=new U,IZe=new ce,kN=new Uint8Array(4);function PZe(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 a3(e,t){return{height:e,color:U.clone(t)}}function XZe(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 zpt(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,Kd._minimumHeight,Kd._maximumHeight),y=U.clone(b.color,Upt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(a3(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||s0(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,a3(Kd._minimumHeight,c[0].color)),p&&c.splice(c.length,0,a3(Kd._maximumHeight,c[c.length-1].color)),c=XZe(c),i.push(c)}return i}function Hpt(e){let t=zpt(e),n=[],i,o;function r(d,u){n.push(a3(d,u))}function s(d,u,m){let p=U.multiplyByScalar(m,1-u.alpha,Bpt);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=PZe(f.height,Z,S,Opt);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=PZe(S.height,y,f,Dpt);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,Kd._emptyColor),r(S.height,Kd._emptyColor)):(!l(S)&&l(Z)&&!l(y)&&(r(Z.height,Kd._emptyColor),r(f.height,Kd._emptyColor)),r(f.height,f.color)),u++):l(S)&&(!l(f)||S.height<f.height)&&(r(S.height,S.color),m++)}}return XZe(n)}function Kd(e){let{scene:t,layers:n}=e??B.EMPTY_OBJECT,{context:i}=t,o=Hpt(n),r=o.length,s,a,c;if(!Kd._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,IZe),ce.pack(IZe,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 Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:qn.NEAREST})}),m=new Uint8Array(r*4);for(let b=0;b<r;b++)o[b].color.toBytes(kN),m[b*4+0]=kN[0],m[b*4+1]=kN[1],m[b*4+2]=kN[2],m[b*4+3]=kN[3];let p=vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:qn.LINEAR})});return ro.fromType("ElevationBand",{heights:u,colors:p})}Kd._useFloatTexture=function(e){return e.floatingPointTexture};Kd._maximumHeight=5906376425472;Kd._minimumHeight=-5906376425472;Kd._emptyColor=new U(0,0,0,0);var fee=Kd;var vRi=x(T(),1);async function Kpt(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 Jpt(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 NZe={};async function Jpt(e){let i=NZe[2275207];l(i)||(i=kr.fromAssetId(2275207),NZe[2275207]=i);let o=await i;return zr.fromUrl(o,e)}var pee=Kpt;var MRi=x(T(),1);async function jpt(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 Jb({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var bee=jpt;var JRi=x(T(),1);function Qpt(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 Mt({geometry:zn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new $t(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Mt({geometry:zn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new $t(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Mt({geometry:zn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new $t(0,0,1,1)},modelMatrix:o})),t.length>0)return new Pn({asynchronous:!1,geometryInstances:t,appearance:new Tn({flat:!0,translucent:!1})})}var gee=Qpt;var n1i=x(T(),1);var DZe=x(yu(),1),YZe=576,qpt=100,UN="#ffffff",DN="#48b";function OZe(e,t){this.credit=e,this.count=t??1}function $pt(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 e0t(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 BZe="cesium-credit-delimiter";function MZe(e){let t=document.createElement("span");return t.textContent=e,t.className=BZe,t}function wZe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function kZe(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(MZe(n));else{let u=o[d];u.className!==BZe&&e.replaceChild(MZe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(wZe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(wZe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function t0t(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<YZe?(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>=YZe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function UZe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function n0t(e){let t=` +`;var Ubo=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 LFt=ip.SHOW_INDEX=0,WFt=ip.POSITION_INDEX=1,vFt=ip.SCALE_INDEX=2,FFt=ip.MAXIMUM_SIZE_INDEX=3,IFt=ip.SLICE_INDEX=4,PFt=ip.BRIGHTNESS_INDEX=5,XFt=ip.COLOR_INDEX=6;ip.NUMBER_OF_PROPERTIES=7;function dR(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,dR(this,LFt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),dR(this,WFt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),dR(this,vFt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),dR(this,FFt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),dR(this,XFt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,dR(this,IFt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,dR(this,PFt))}}});ip.prototype._destroy=function(){this._cloudCollection=void 0};var cm=ip;var lm,VK=new h,NFt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},YFt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},MFt=cm.SHOW_INDEX,wFt=cm.POSITION_INDEX,kFt=cm.SCALE_INDEX,UFt=cm.MAXIMUM_SIZE_INDEX,DFt=cm.SLICE_INDEX,OFt=cm.BRIGHTNESS_INDEX,BFt=cm.NUMBER_OF_PROPERTIES,zFt=cm.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(BFt),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:rIe(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 rIe(e){return function(){return VK.x=e._textureSliceWidth,VK.y=e._noiseTextureRows,VK.z=1/e._noiseTextureRows,VK}}Object.defineProperties(op.prototype,{length:{get:function(){return hse(this),this._clouds.length}}});function sIe(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??uA.CUMULUS,n;return t===uA.CUMULUS&&(n=new cm(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(){sIe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function hse(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 hse(this),this._clouds[e]};var HFt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),KFt=new Uint16Array([0,1,2,0,2,3]);function JFt(e){let t=ot.createVertexBuffer({context:e,typedArray:HFt,usage:Pe.STATIC_DRAW}),n=ot.createIndexBuffer({context:e,typedArray:KFt,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 fse;function jFt(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 QFt(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 qFt(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 $Ft(e,t,n){let i=[{index:lm.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:lm.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:lm.packedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:lm.packedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:lm.color,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,usage:Pe.STATIC_DRAW}];n&&i.push({index:lm.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:qFt(e)});let o=n?t:4*t;return new qb(e,i,o,n)}var mse=new An;function aIe(e,t,n,i){let o,r=n[lm.positionHighAndScaleX],s=n[lm.positionLowAndScaleY],a=i.position;An.fromCartesian(a,mse);let c=i.scale,d=mse.high,u=mse.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 cIe(e,t,n,i){let o,r=n[lm.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 lIe(e,t,n,i){let o,r=n[lm.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 dIe(e,t,n,i){let o,r=n[lm.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 eIt(e,t,n,i){aIe(e,t,n,i),cIe(e,t,n,i),lIe(e,t,n,i),dIe(e,t,n,i)}function tIt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=JFt(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:rIe(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 nIt(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=$Ft(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];eIt(e,t,s,c)}n._vaf.commit(fse(i))}}var iIt=[];function oIt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=iIt;d.length=0,(c[wFt]||c[kFt])&&d.push(aIe),(c[MFt]||c[OFt])&&d.push(cIe),(c[UFt]||c[DFt])&&d.push(lIe),c[zFt]&&d.push(dIe);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(fse(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 rIt(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:lm}),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 sIt(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(hse(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&tIt(this,e,R9,Z9),this._instanced=e.context.instancedArrays,lm=this._instanced?YFt:NFt,fse=this._instanced?QFt:jFt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?nIt(this,e):r>0&&oIt(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)&&rIt(this,e,S9,_9),sIt(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(),sIe(this._clouds),ue(this)};var pse=op;var Ggo=x(T(),1);async function bse(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 bse._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}bse._sampleTerrainMostDetailed=$Z;var uR=bse;var Fgo=x(T(),1);var aIt=W.toRadians(30);function gse(e){this._angle=e??aIt}Object.defineProperties(gse.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});gse.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 yse=gse;var Jgo=x(T(),1);var cIt=new U,lIt=new U,dIt=new U,uIt=new U,uIe=new ce,C9=new Uint8Array(4);function mIe(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 EK(e,t){return{height:e,color:U.clone(t)}}function hIe(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 mIt(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,cu._minimumHeight,cu._maximumHeight),y=U.clone(b.color,cIt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(EK(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,EK(cu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,EK(cu._maximumHeight,c[c.length-1].color)),c=hIe(c),i.push(c)}return i}function hIt(e){let t=mIt(e),n=[],i,o;function r(d,u){n.push(EK(d,u))}function s(d,u,m){let p=U.multiplyByScalar(m,1-u.alpha,uIt);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=mIe(f.height,Z,S,dIt);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=mIe(S.height,y,f,lIt);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,cu._emptyColor),r(S.height,cu._emptyColor)):(!l(S)&&l(Z)&&!l(y)&&(r(Z.height,cu._emptyColor),r(f.height,cu._emptyColor)),r(f.height,f.color)),u++):l(S)&&(!l(f)||S.height<f.height)&&(r(S.height,S.color),m++)}}return hIe(n)}function cu(e){let{scene:t,layers:n}=e??B.EMPTY_OBJECT,{context:i}=t,o=hIt(n),r=o.length,s,a,c;if(!cu._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,uIe),ce.pack(uIe,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(C9),m[b*4+0]=C9[0],m[b*4+1]=C9[1],m[b*4+2]=C9[2],m[b*4+3]=C9[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})}cu._useFloatTexture=function(e){return e.floatingPointTexture};cu._maximumHeight=5906376425472;cu._minimumHeight=-5906376425472;cu._emptyColor=new U(0,0,0,0);var xse=cu;var oyo=x(T(),1);async function fIt(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 pIt(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 fIe={};async function pIt(e){let i=fIe[2275207];l(i)||(i=Ur.fromAssetId(2275207),fIe[2275207]=i);let o=await i;return zr.fromUrl(o,e)}var Tse=fIt;var uyo=x(T(),1);async function bIt(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 rg({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var _se=bIt;var _yo=x(T(),1);function gIt(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 Sse=gIt;var Ayo=x(T(),1);var TIe=x(bu(),1),pIe=576,yIt=100,V9="#ffffff",E9="#48b";function _Ie(e,t){this.credit=e,this.count=t??1}function xIt(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 TIt(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 SIe="cesium-credit-delimiter";function bIe(e){let t=document.createElement("span");return t.textContent=e,t.className=SIe,t}function gIe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function yIe(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(bIe(n));else{let u=o[d];u.className!==SIe&&e.replaceChild(bIe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(gIe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(gIe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function _It(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<pIe?(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>=pIe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function xIe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function SIt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -9044,19 +9694,19 @@ v_position = transformedPos; .cesium-credit-lightbox { background-color: #303336; - color: ${UN}; + color: ${V9}; position: relative; - min-height: ${qpt}px; + min-height: ${yIt}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: ${UN}; + color: ${V9}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${DN}; + color: ${E9}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -9076,10 +9726,10 @@ v_position = transformedPos; position: absolute; top: 0; right: 6px; - color: ${UN}; + color: ${V9}; } .cesium-credit-lightbox-close:hover { - color: ${DN}; + color: ${E9}; } .cesium-credit-lightbox > ul { margin: 0; @@ -9098,20 +9748,20 @@ v_position = transformedPos; padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${UN}; + color: ${V9}; } .cesium-credit-expand-link:hover { - color: ${DN}; + color: ${E9}; } .cesium-credit-expand-link:focus-visible, .cesium-credit-lightbox-close:focus-visible { - outline: 2px solid ${DN}; + outline: 2px solid ${E9}; outline-offset: 2px; } .cesium-credit-text { - color: ${UN}; + color: ${V9}; } .cesium-credit-delimiter { @@ -9122,1648 +9772,1156 @@ v_position = transformedPos; .cesium-credit-logoContainer * { display: inline; } - -.cesium-credit-textContainer a:hover { - color: ${DN} -} - -.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 Hr(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=UZe(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=UZe(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),n0t(e);let f=Lt.clone(Hr.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 kt,lightboxCredits:new kt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function zZe(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 OZe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Hr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Lt.clone(HZe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,zZe(this,t,e)};Hr.prototype.addStaticCredit=function(e){let t=this._staticCredits;$pt(t,e)||t.push(e)};Hr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Hr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Hr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Hr.prototype.update=function(){this._expanded&&t0t(this)};Hr.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(Hr.cesiumCredit,this._cesiumCredit)||zZe(this,s,r,Number.MAX_VALUE)}Lt.equals(Hr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Lt.clone(Hr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Hr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;kZe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",kZe(this._creditList,t,void 0,"li"),e0t(this)};Hr.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)};Hr.prototype.isDestroyed=function(){return!1};Hr._cesiumCredit=void 0;Hr._cesiumCreditInitialized=!1;var c3;function HZe(){if(!l(c3)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new DZe.default(e).path()),c3=new Lt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Hr._cesiumCreditInitialized||(Hr._cesiumCredit=c3,Hr._cesiumCreditInitialized=!0),c3}Object.defineProperties(Hr,{cesiumCredit:{get:function(){return HZe(),Hr._cesiumCredit},set:function(e){Hr._cesiumCredit=e,Hr._cesiumCreditInitialized=!0}}});Hr.CreditDisplayElement=OZe;var ON=Hr;var X1i=x(T(),1);var s1i=x(T(),1);function i0t(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 ns({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var BN=i0t;var c1i=x(T(),1),zN=`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 d1i=x(T(),1),HN=`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; -} -`;var m1i=x(T(),1),KN=`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; -} -`;function JN(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(JN.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});JN.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"?BN(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 ns({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=Fc.createGeometry(Fc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Me.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:[zN]});a.shaderProgram=tn.fromCache({context:r,vertexShaderSource:l(this._transform)?KN:HN,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)}};JN.prototype.isDestroyed=function(){return!1};JN.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 MS=JN;var k1i=x(T(),1);function jN(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=Eo.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(jN.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}}});jN.prototype.getFragmentShaderSource=Eo.prototype.getFragmentShaderSource;jN.prototype.isTranslucent=Eo.prototype.isTranslucent;jN.prototype.getRenderState=Eo.prototype.getRenderState;var yee=jN;var NCi=x(T(),1);var oCi=x(T(),1);var l3=0,o0t=1;function wS(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Me.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof ji?(s=l3,a=ji.packedLength):t instanceof bn&&(s=o0t,a=bn.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+Me.packedLength}wS.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===l3?(ji.pack(o,t,n),n+=ji.packedLength):(bn.pack(o,t,n),n+=bn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var r0t=new ji,s0t=new bn,a0t=new Ne,c0t=new h,l0t=new Me;wS.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===l3?(o=ji.unpack(e,t,r0t),t+=ji.packedLength):(o=bn.unpack(e,t,s0t),t+=bn.packedLength);let r=h.unpack(e,t,c0t);t+=h.packedLength;let s=Ne.unpack(e,t,a0t);t+=Ne.packedLength;let a=Me.unpack(e,t,l0t);t+=Me.packedLength;let c=e[t]===1;if(!l(n))return new wS({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=Me.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function sV(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 d0t=new q,u0t=new P,xee=new P,KZe=new h,JZe=new h,jZe=new h,m0t=new h,h0t=new h,f0t=new h,Fx=new Array(3),QN=new Array(4);QN[0]=new ce(-1,-1,1,1);QN[1]=new ce(1,-1,1,1);QN[2]=new ce(1,1,1,1);QN[3]=new ce(-1,1,1,1);var QZe=new Array(4);for(let e=0;e<4;++e)QZe[e]=new ce;wS._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=q.fromQuaternion(t,d0t),d=r??KZe,u=s??JZe,m=a??jZe;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,u0t),b,f,y=i.projectionMatrix;if(n===l3){let _=P.multiply(y,p,xee);f=P.inverse(_,xee)}else b=P.inverseTransformation(p,xee);l(f)?(Fx[0]=i.near,Fx[1]=i.far):(Fx[0]=0,Fx[1]=i.near,Fx[2]=i.far);for(let _=0;_<2;++_)for(let S=0;S<4;++S){let Z=ce.clone(QN[S],QZe[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,Fx[_]/C,Z),h.add(Z,e,Z)}else{let R=i.offCenterFrustum;l(R)&&(i=R);let C=Fx[_],E=Fx[_+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}};wS.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);wS._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 Cn({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,_=KZe,S=JZe,Z=jZe,R=h.negate(_,m0t),C=h.negate(S,h0t),E=h.negate(Z,f0t);d=0,r&&(sV(d,p,b,f,y,E,_,S),d+=12),sV(d,p,b,f,y,Z,R,S),d+=12,sV(d,p,b,f,y,R,E,S),d+=12,sV(d,p,b,f,y,C,E,R),d+=12,sV(d,p,b,f,y,_,Z,S),d+=12,sV(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:me.fromVertices(c)})};var kS=wS;var yCi=x(T(),1);var Tee=0,p0t=1;function qN(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof ji?(r=Tee,s=ji.packedLength):t instanceof bn&&(r=p0t,s=bn.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}qN.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Tee?(ji.pack(o,t,n),n+=ji.packedLength):(bn.pack(o,t,n),n+=bn.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 b0t=new ji,g0t=new bn,y0t=new Ne,x0t=new h;qN.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Tee?(o=ji.unpack(e,t,b0t),t+=ji.packedLength):(o=bn.unpack(e,t,g0t),t+=bn.packedLength);let r=h.unpack(e,t,x0t);t+=h.packedLength;let s=Ne.unpack(e,t,y0t);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new qN({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};qN.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);kS._computeNearFarPlanes(i,o,t,n,s);let a=new Cn({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:me.fromVertices(s)})};var $N=qN;function d3(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 T0t=new h,_0t=new q,S0t=new Ne,Z0t=new ji,R0t=new Ol,C0t=new bn,V0t=new gs,E0t=new U,A0t=[1,1e5];d3.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 ji?a=Z0t:s instanceof Ol?a=R0t:s instanceof bn?a=C0t:a=V0t,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=A0t,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,T0t);let f=_0t;q.setColumn(f,0,b,f),q.setColumn(f,1,p,f),q.setColumn(f,2,m,f);let y=Ne.fromRotationMatrix(f,S0t);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new Pn({geometryInstances:new Mt({geometry:new kS({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(U.fromAlpha(this._color,.1,E0t))},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Pn({geometryInstances:new Mt({geometry:new $N({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)};d3.prototype.isDestroyed=function(){return!1};d3.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 a0=d3;var OCi=x(T(),1);function qZe(){this._cachedShowFrustumsShaders={}}function G0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function L0t(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=G0t(i);return tn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var eY=new U;function W0t(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?(eY.red=t.debugOverlappingFrustums&1?1:0,eY.green=t.debugOverlappingFrustums&2?1:0,eY.blue=t.debugOverlappingFrustums&4?1:0,eY.alpha=1,eY):U.WHITE}),n}var v0t=new lt;qZe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=L0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=lt.shallowClone(t,v0t);r.shaderProgram=o,r.uniformMap=W0t(e,t),r.execute(e.context,n)};var tY=qZe;var FVi=x(T(),1);var dVi=x(T(),1);var iRe=[];function F0t(e,t,n,i,o){let r=iRe;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 nY(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=Me.clone(e.vertexFormat??Me.DEFAULT),this._arcType=e.arcType??mn.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+Me.packedLength+4}nY.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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var oRe=ne.clone(ne.UNIT_SPHERE),rRe=new Me,US={positions:void 0,colors:void 0,ellipsoid:oRe,vertexFormat:rRe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};nY.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,oRe);t+=ne.packedLength;let c=Me.unpack(e,t,rRe);t+=Me.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=Me.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(US.positions=r,US.colors=s,US.width=d,US.colorsPerVertex=u,US.arcType=m,US.granularity=p,new nY(US))};var $Ze=new h,eRe=new h,tRe=new h,nRe=new h;nY.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=Mo(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let X=0,Y=m[0];i=i.filter(function(D,M){let O;return o?O=M===Y||M===0&&Y===1:O=M+1===Y,O?(X++,Y=m[X],!1):!0})}let b=p.length;if(b<2||t<=0)return;if(r===mn.GEODESIC||r===mn.RHUMB){let X,Y;r===mn.GEODESIC?(X=W.chordLength(s,a.maximumRadius),Y=so.numberOfPoints):(X=s,Y=so.numberOfPointsRhumbLine);let D=so.extractHeights(p,a);if(l(i)){let M=1;for(c=0;c<b-1;++c)M+=Y(p[c],p[c+1],X);let O=new Array(M),w=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<M){let $=i[c+1],ee=F0t(z,K,te,$,H),le=ee.length;for(d=0;d<le;++d)O[w++]=ee[d]}else for(d=0;d<H;++d)O[w++]=U.clone(te)}O[w]=U.clone(i[i.length-1]),i=O,iRe.length=0}r===mn.GEODESIC?p=so.generateCartesianArc({positions:p,minDistance:X,ellipsoid:a,height:D}):p=so.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=$Ze,h.subtract(p[0],p[1],I),h.add(p[0],I,I)):I=p[d-1],h.clone(I,tRe),h.clone(p[d],eRe),d===b-1?(I=$Ze,h.subtract(p[b-1],p[b-2],I),h.add(p[b-1],I,I)):I=p[d+1],h.clone(I,nRe);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,M=d===b-1?2:4;for(u=D;u<M;++u){h.pack(eRe,y,E),h.pack(tRe,_,E),h.pack(nRe,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 w=u<2?X:Y;C[F++]=U.floatToByte(w.red),C[F++]=U.floatToByte(w.green),C[F++]=U.floatToByte(w.blue),C[F++]=U.floatToByte(w.alpha)}}}let N=new Cn;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:me.fromPoints(p),geometryType:Vm.POLYLINES})};var hg=nY;var TVi=x(T(),1);var mVi=x(T(),1),iY=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_color = color; -} -`;var I0t=`#define CLIP_POLYLINE -${kl} -${iY}`,P0t=_S;function DS(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=DS.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??I0t,this._fragmentShaderSource=e.fragmentShaderSource??P0t,this._renderState=Eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(DS.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}}});DS.VERTEX_FORMAT=Me.POSITION_ONLY;DS.prototype.getFragmentShaderSource=Eo.prototype.getFragmentShaderSource;DS.prototype.isTranslucent=Eo.prototype.isTranslucent;DS.prototype.getRenderState=Eo.prototype.getRenderState;var Bs=DS;function u3(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}u3.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 Mt({geometry:new hg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Bs.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:mn.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),n=new Mt({geometry:new hg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Bs.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:mn.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),i=new Mt({geometry:new hg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Bs.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:mn.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this});this._primitive=new Pn({geometryInstances:[t,n,i],appearance:new Bs,asynchronous:!1})}this._primitive.update(e)}};u3.prototype.isDestroyed=function(){return!1};u3.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var oY=u3;var XVi=x(T(),1);var X0t=new TextDecoder,m3={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},N0t={LAYERS:3},rY={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},_ee={TAGS:2,TYPE:3,GEOMETRY:4},OS={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},Y0t=["Unknown","Point","LineString","Polygon"];function M0t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let o=h3(t,i,t.length),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===N0t.LAYERS&&s===2){let a=fg(t,i,t.length);i=a.newPos;let c=Jd(i,a.value,t.length,"layer");n.push(w0t(t,i,c)),i=c}else i=f3(t,i,s,t.length)}return{layers:n}}function w0t(e,t,n){let i=t,o="",r=4096,s=[],a=[],c=[];for(;i<n;){let u=h3(e,i,n),m=u.fieldNumber,p=u.wireType;if(i=u.newPos,m===rY.NAME&&p===2){let b=fg(e,i,n);i=b.newPos;let f=Jd(i,b.value,n,"layer name");o=Zee(e,i,b.value),i=f}else if(m===rY.FEATURES&&p===2){let b=fg(e,i,n);i=b.newPos;let f=Jd(i,b.value,n,"feature");c.push({start:i,end:f}),i=f}else if(m===rY.KEYS&&p===2){let b=fg(e,i,n);i=b.newPos;let f=Jd(i,b.value,n,"key");s.push(Zee(e,i,b.value)),i=f}else if(m===rY.VALUES&&p===2){let b=fg(e,i,n);i=b.newPos;let f=Jd(i,b.value,n,"value"),y=D0t(e,i,f);a.push(y),i=f}else if(m===rY.EXTENT&&p===0){let b=aV(e,i,n);r=b.value,i=b.newPos}else i=f3(e,i,p,n)}let d=c.map(({start:u,end:m})=>k0t(e,u,m,s,a));return{name:o,extent:r,features:d}}function k0t(e,t,n,i,o){let r=t,s=m3.UNKNOWN,a=[],c=[];for(;r<n;){let m=h3(e,r,n),p=m.fieldNumber,b=m.wireType;if(r=m.newPos,p===_ee.TYPE&&b===0){let f=aV(e,r,n);s=f.value,r=f.newPos}else if(p===_ee.TAGS&&b===2){let f=fg(e,r,n);r=f.newPos;let y=Jd(r,f.value,n,"feature tags");for(;r<y;){let _=aV(e,r,y);a.push(_.value),r=_.newPos}}else if(p===_ee.GEOMETRY&&b===2){let f=fg(e,r,n);r=f.newPos;let y=Jd(r,f.value,n,"feature geometry");for(;r<y;){let _=aV(e,r,y);c.push(_.value),r=_.newPos}}else r=f3(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=U0t(s,c);return{type:Y0t[s]??"Unknown",geometry:u,properties:d}}function U0t(e,t){let n=0,i=0,o=0;if(e===m3.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+=c0(t[n++]),o+=c0(t[n++]),r.push({x:i,y:o})}return r}if(e===m3.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+=c0(t[n++]),o+=c0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=c0(t[n++]),o+=c0(t[n++]),s.push({x:i,y:o})}return s!==null&&r.push(s),r}if(e===m3.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+=c0(t[n++]),o+=c0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=c0(t[n++]),o+=c0(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 D0t(e,t,n){let i=t;for(;i<n;){let o=h3(e,i,n),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===OS.STRING&&s===2){let a=fg(e,i,n);i=a.newPos;let c=Jd(i,a.value,n,"string value");return Zee(e,i,c-i)}else{if(r===OS.FLOAT&&s===5)return Jd(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(r===OS.DOUBLE&&s===1)return Jd(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(r===OS.INT64&&s===0){let a=cV(e,i,n);return See(a.value)}else if(r===OS.UINT64&&s===0){let a=cV(e,i,n);return See(a.value)}else if(r===OS.SINT64&&s===0){let a=cV(e,i,n);return See(O0t(a.value))}else if(r===OS.BOOL&&s===0)return aV(e,i,n).value!==0}i=f3(e,i,s,n)}}function h3(e,t,n){let i=aV(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function aV(e,t,n){let i=cV(e,t,n,5);if(i.value>0xffffffffn)throw new ae("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function fg(e,t,n){let i=cV(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 cV(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 Zee(e,t,n){let i=Jd(t,n,e.length,"string");return X0t.decode(e.subarray(t,i))}function Jd(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 f3(e,t,n,i){if(n===0)return cV(e,t,i).newPos;if(n===1)return Jd(t,8,i,"fixed64 field");if(n===2){let o=fg(e,t,i);return Jd(o.newPos,o.value,i,"length-delimited field")}else if(n===5)return Jd(t,4,i,"fixed32 field");throw new ae(`Unsupported protobuf wire type: ${n}`)}function c0(e){return e>>>1^-(e&1)}function O0t(e){return e>>1n^-(e&1n)}function See(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var sY=M0t;var cEi=x(T(),1);var YVi=x(T(),1),aY=`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); -} -else -{ -position = vec3(0.0); -direction = normalize(positionEC.xyz); -} -czm_ray ray = czm_ray(position, direction); -vec3 ellipsoid_center = czm_view[3].xyz; -czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); -if (!czm_isEmpty(intersection)) -{ -out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); -} -else -{ -discard; -} -czm_writeLogDepth(); -} -`;var wVi=x(T(),1),cY=`in vec4 position; -out vec4 positionEC; -void main() -{ -positionEC = czm_modelView * position; -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -} -`;function dY(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 lY=fn.supportsTypedArrays()?new Float32Array(12):[],sRe=new h,aRe=new h,Ree=new h,cRe=new h,p3=new h;function B0t(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof bn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,sRe),b=h.normalize(p,aRe),f=h.normalize(h.cross(h.UNIT_Z,p,Ree),Ree),y=h.normalize(h.cross(b,f,cRe),cRe),_=h.magnitude(p),S=Math.sqrt(_*_-1);o=h.multiplyByScalar(b,1/_,sRe);let Z=S/_;r=h.multiplyByScalar(f,Z,aRe),s=h.multiplyByScalar(y,Z,Ree)}let a=h.add(o,s,p3);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,lY,0);let c=h.subtract(o,s,p3);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,lY,3);let d=h.add(o,s,p3);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,lY,6);let u=h.subtract(o,s,p3);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,lY,9),lY}dY.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 me(h.ZERO,i.maximumRadius),pass:Le.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Je({sources:[cY]}),a=new Je({sources:[aY]});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=B0t(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}};dY.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};dY.prototype.isDestroyed=function(){return!1};dY.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var uY=dY;var gEi=x(T(),1);function BS(){}var z0t=/\bgl_FragDepth\b/,H0t=/\bdiscard\b/;function K0t(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(z0t.test(r[a])||H0t.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(); -} -`;i=new Je({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function J0t(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}BS.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=K0t(n,t.shaderProgram),i.depthOnlyCommand.renderState=J0t(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var j0t=/\s+czm_writeLogDepth\(/,Q0t=/\s+czm_vertexLogDepth\(/;function q0t(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(Q0t.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)j0t.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(); -} -`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}BS.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=q0t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function $0t(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 Cee(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}BS.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=$0t(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Cee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};var ebt=`uint rgba8UnormToUint32(vec4 c) -{ - uvec4 b = uvec4(c * 255.0 + 0.5); - return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); -} -`;function tbt(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=`${ebt} -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})}BS.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=tbt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Cee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=o,i.snapCommand.renderState=r),i};function lV(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 nbt(e){return e.isArray?e.arrayLength:St.getComponentCount(e.type)}function lRe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function dRe(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function ibt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=lRe(n,i,o)}return e.normalized||(n=dRe(n,e.componentType)),n}function obt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=lRe(o,r,s)}return e.normalized||(o=dRe(o,e.componentType)),o}function rbt(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=nbt(d);if(p===1)m[0]=ibt(d,c);else{let _=["x","y","z","w"];for(let S=0;S<p;S++)m[S]=obt(d,c,_[S])}let b=t.fragmentShaderSource.defines.slice();b.push(Xu.METADATA_PICKING_ENABLED),lV(b,Xu.METADATA_PICKING_VALUE_TYPE,u),lV(b,Xu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),lV(b,Xu.METADATA_PICKING_VALUE_COMPONENT_X,m[0]),lV(b,Xu.METADATA_PICKING_VALUE_COMPONENT_Y,m[1]),lV(b,Xu.METADATA_PICKING_VALUE_COMPONENT_Z,m[2]),lV(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})}BS.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=lt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=rbt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Cee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function sbt(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})}BS.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=sbt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Zf=BS;var REi=x(T(),1);function b3(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 abt=new Ne,uRe=new Ne,cbt=new q;function lbt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Ne.fromAxisAngle(o,n,uRe),c=Ne.fromAxisAngle(r,i,abt),d=Ne.multiply(c,a,c),u=Ne.fromAxisAngle(s,t,uRe);Ne.multiply(u,d,d);let m=q.fromQuaternion(d,cbt);q.multiplyByVector(m,r,r),q.multiplyByVector(m,s,s),q.multiplyByVector(m,o,o)}b3.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;lbt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};b3.prototype.isDestroyed=function(){return!1};b3.prototype.destroy=function(){return this._removeListener(),ue(this)};var mY=b3;var AEi=x(T(),1);function dbt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var Vee=dbt;var NEi=x(T(),1);function Ix(){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(Ix.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}}});Ix.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};Ix.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};Ix.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};Ix.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};Ix.prototype.isDestroyed=function(){return!1};Ix.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var hY=Ix;var uAi=x(T(),1);var MEi=x(T(),1),dV=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; -in vec3 v_positionEC; -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) -{ -vec3 positionEC = czm_pointAlongRay(ray, intersection); -vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; -vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); -vec3 sphericalNormal = normalize(positionMC / u_radii); -vec3 normalMC = geodeticNormal * side; -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 -} -void main() -{ -float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; -vec3 direction = normalize(v_positionEC); -vec3 ellipsoidCenter = czm_modelView[3].xyz; -float t1 = -1.0; -float t2 = -1.0; -float b = -2.0 * dot(direction, ellipsoidCenter); -float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; -float discriminant = b * b - 4.0 * c; -if (discriminant >= 0.0) { -t1 = (-b - sqrt(discriminant)) * 0.5; -t2 = (-b + sqrt(discriminant)) * 0.5; -} -if (t1 < 0.0 && t2 < 0.0) { -discard; -} -float t = min(t1, t2); -if (t < 0.0) { -t = 0.0; -} -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; -} -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 -#endif -} -`;var kEi=x(T(),1),uV=`in vec3 position; -uniform vec3 u_radii; -out vec3 v_positionEC; -void main() -{ -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(); -} -`;var Eee={position:0};function g3(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 me,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??ro.fromType(ro.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 ubt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Fc.createGeometry(Fc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Me.POSITION_ONLY}));return t=Un.fromGeometry({context:e,geometry:n,attributeLocations:Eee,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}g3.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:ki.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?on.ALPHA_BLEND:void 0})),l(this._va)||(this._va=ubt(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),me.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:[uV]}),p=new Je({sources:[this.material.shaderSource,dV]}),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=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:Eee}),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:[uV]}),p=new Je({sources:[this.material.shaderSource,dV],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=tn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:Eee}),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)}};g3.prototype.isDestroyed=function(){return!1};g3.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 fY=g3;var RAi=x(T(),1);var hAi=x(T(),1),pY=`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 + +.cesium-credit-textContainer a:hover { + color: ${E9} } -`;var pAi=x(T(),1),bY=`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; + +.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { + padding-left: 5px; } -`;function zS(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:ro.fromType(ro.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??bY,this._fragmentShaderSource=e.fragmentShaderSource??pY,this._renderState=Eo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(zS.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 zS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});zS.VERTEX_FORMAT=Me.POSITION_AND_ST;zS.prototype.getFragmentShaderSource=Eo.prototype.getFragmentShaderSource;zS.prototype.isTranslucent=Eo.prototype.isTranslucent;zS.prototype.getRenderState=Eo.prototype.getRenderState;var Aee=zS;var vGi=x(T(),1);var HAi=x(T(),1);var kAi=x(T(),1);var mbt=new h,hbt=new h,fbt=new h,pbt=new h,bbt=new h,gbt=new h(1,1,1),mRe=Math.cos,hRe=Math.sin;function pg(e){e=e??B.EMPTY_OBJECT;let t=e.radii??gbt,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??Me.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=Me.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}pg.packedLength=2*h.packedLength+Me.packedLength+7;pg.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 fRe=new h,pRe=new h,bRe=new Me,Px={radii:fRe,innerRadii:pRe,vertexFormat:bRe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};pg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,fRe);t+=h.packedLength;let o=h.unpack(e,t,pRe);t+=h.packedLength;let r=Me.unpack(e,t,bRe);t+=Me.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=Me.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):(Px.minimumClock=s,Px.maximumClock=a,Px.minimumCone=c,Px.maximumCone=d,Px.stackPartitions=u,Px.slicePartitions=m,Px.offsetAttribute=p===-1?void 0:p,new pg(Px))};pg.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,M=new Array(y),O=new Array(y);for(u=0;u<y;u++)M[u]=hRe(b[u]),O[u]=mRe(b[u]);let w=new Array(_),z=new Array(_);for(m=0;m<_;m++)z[m]=mRe(f[m]),w[m]=hRe(f[m]);for(u=0;u<y;u++)for(m=0;m<_;m++)F[p++]=t.x*M[u]*z[m],F[p++]=t.y*M[u]*w[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*M[u]*z[m],F[p++]=n.y*M[u]*w[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 Cn;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,mbt),je=Ae.geodeticSurfaceNormal(Be,hbt);if(N[u]&&h.negate(je,je),a.st){let qe=k.negate(je,bbt);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=fbt,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,pbt);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===yn.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:me.fromEllipsoid(Fe),offsetAttribute:e._offsetAttribute})};var Gee;pg.getUnitEllipsoid=function(){return l(Gee)||(Gee=pg.createGeometry(new pg({radii:new h(1,1,1),vertexFormat:Me.POSITION_ONLY}))),Gee};var Ha=pg;function mV(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"}mV.packedLength=Ha.packedLength;mV.pack=function(e,t,n){return Ha.pack(e._ellipsoidGeometry,t,n)};var ybt=new Ha,Xx={radius:void 0,radii:new h,vertexFormat:new Me,stackPartitions:void 0,slicePartitions:void 0};mV.unpack=function(e,t,n){let i=Ha.unpack(e,t,ybt);return Xx.vertexFormat=Me.clone(i._vertexFormat,Xx.vertexFormat),Xx.stackPartitions=i._stackPartitions,Xx.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Xx.radii),n._ellipsoidGeometry=new Ha(Xx),n):(Xx.radius=i._radii.x,new mV(Xx))};mV.createGeometry=function(e){return Ha.createGeometry(e._ellipsoidGeometry)};var gY=mV;var yGi=x(T(),1);var JAi=x(T(),1),yY=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; +`;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=xIe(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=xIe(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),SIt(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 wt,lightboxCredits:new wt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function ZIe(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 _Ie(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(RIe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,ZIe(this,t,e)};jr.prototype.addStaticCredit=function(e){let t=this._staticCredits;xIt(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&&_It(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)||ZIe(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;yIe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",yIe(this._creditList,t,void 0,"li"),TIt(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),ue(this)};jr.prototype.isDestroyed=function(){return!1};jr._cesiumCredit=void 0;jr._cesiumCreditInitialized=!1;var AK;function RIe(){if(!l(AK)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new TIe.default(e).path()),AK=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=AK,jr._cesiumCreditInitialized=!0),AK}Object.defineProperties(jr,{cesiumCredit:{get:function(){return RIe(),jr._cesiumCredit},set:function(e){jr._cesiumCredit=e,jr._cesiumCreditInitialized=!0}}});jr.CreditDisplayElement=_Ie;var A9=jr;var oxo=x(T(),1);var Lyo=x(T(),1),G9=`uniform samplerCube u_cubeMap; +in vec3 v_texCoord; void main() { -vec3 positionToEyeEC = -v_positionEC; -mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = tangentToEyeMatrix; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); +out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); } -`;var QAi=x(T(),1),xY=`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; +`;var vyo=x(T(),1),L9=`in vec3 position; +out vec3 v_texCoord; void main() { -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; +vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -`;var $Ai=x(T(),1),TY=`in vec3 v_positionEC; -in vec3 v_normalEC; +`;var Iyo=x(T(),1),W9=`uniform mat3 u_cubeMapPanoramaTransform; +in vec3 position; +out vec3 v_texCoord; void main() { -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -`;var tGi=x(T(),1),_Y=`in vec3 position3DHigh; +`;function v9(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(v9.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});v9.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"?aw(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:Me.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:[G9]});a.shaderProgram=nn.fromCache({context:r,vertexShaderSource:l(this._transform)?W9:L9,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)}};v9.prototype.isDestroyed=function(){return!1};v9.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 mR=v9;var lxo=x(T(),1);function F9(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 vec3 normal; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +${n?"":`in ${i} ${t}; +`}out ${i} ${o}; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var iGi=x(T(),1),SY=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; +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() { -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var rGi=x(T(),1),ZY=`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; +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(F9.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});F9.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;F9.prototype.isTranslucent=Go.prototype.isTranslucent;F9.prototype.getRenderState=Go.prototype.getRenderState;var Zse=F9;var Axo=x(T(),1);function GK(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 ZIt=new h,RIt=new q,CIt=new Ne,VIt=new qi,EIt=new fd,AIt=new yn,GIt=new bs,LIt=new U,WIt=[1,1e5];GK.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=VIt:s instanceof fd?a=EIt:s instanceof yn?a=AIt:a=GIt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=WIt,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,ZIt);let f=RIt;q.setColumn(f,0,b,f),q.setColumn(f,1,p,f),q.setColumn(f,2,m,f);let y=Ne.fromRotationMatrix(f,CIt);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 jZ({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(U.fromAlpha(this._color,.1,LIt))},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Yt({geometry:new Rw({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)};GK.prototype.isDestroyed=function(){return!1};GK.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 X0=GK;var Pxo=x(T(),1);function CIe(){this._cachedShowFrustumsShaders={}}function vIt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function FIt(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=vIt(i);return nn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var I9=new U;function IIt(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?(I9.red=t.debugOverlappingFrustums&1?1:0,I9.green=t.debugOverlappingFrustums&2?1:0,I9.blue=t.debugOverlappingFrustums&4?1:0,I9.alpha=1,I9):U.WHITE}),n}var PIt=new lt;CIe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=FIt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=lt.shallowClone(t,PIt);r.shaderProgram=o,r.uniformMap=IIt(e,t),r.execute(e.context,n)};var P9=CIe;var Kxo=x(T(),1);function LK(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}LK.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 Pg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:ws.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 Pg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:ws.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 Pg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:ws.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 ws,asynchronous:!1})}this._primitive.update(e)}};LK.prototype.isDestroyed=function(){return!1};LK.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var X9=LK;var Qxo=x(T(),1);var XIt=new TextDecoder,WK={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},NIt={LAYERS:3},N9={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Rse={TAGS:2,TYPE:3,GEOMETRY:4},hR={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},YIt=["Unknown","Point","LineString","Polygon"];function MIt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let o=vK(t,i,t.length),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===NIt.LAYERS&&s===2){let a=ry(t,i,t.length);i=a.newPos;let c=lu(i,a.value,t.length,"layer");n.push(wIt(t,i,c)),i=c}else i=FK(t,i,s,t.length)}return{layers:n}}function wIt(e,t,n){let i=t,o="",r=4096,s=[],a=[],c=[];for(;i<n;){let u=vK(e,i,n),m=u.fieldNumber,p=u.wireType;if(i=u.newPos,m===N9.NAME&&p===2){let b=ry(e,i,n);i=b.newPos;let f=lu(i,b.value,n,"layer name");o=Vse(e,i,b.value),i=f}else if(m===N9.FEATURES&&p===2){let b=ry(e,i,n);i=b.newPos;let f=lu(i,b.value,n,"feature");c.push({start:i,end:f}),i=f}else if(m===N9.KEYS&&p===2){let b=ry(e,i,n);i=b.newPos;let f=lu(i,b.value,n,"key");s.push(Vse(e,i,b.value)),i=f}else if(m===N9.VALUES&&p===2){let b=ry(e,i,n);i=b.newPos;let f=lu(i,b.value,n,"value"),y=DIt(e,i,f);a.push(y),i=f}else if(m===N9.EXTENT&&p===0){let b=mA(e,i,n);r=b.value,i=b.newPos}else i=FK(e,i,p,n)}let d=c.map(({start:u,end:m})=>kIt(e,u,m,s,a));return{name:o,extent:r,features:d}}function kIt(e,t,n,i,o){let r=t,s=WK.UNKNOWN,a=[],c=[];for(;r<n;){let m=vK(e,r,n),p=m.fieldNumber,b=m.wireType;if(r=m.newPos,p===Rse.TYPE&&b===0){let f=mA(e,r,n);s=f.value,r=f.newPos}else if(p===Rse.TAGS&&b===2){let f=ry(e,r,n);r=f.newPos;let y=lu(r,f.value,n,"feature tags");for(;r<y;){let _=mA(e,r,y);a.push(_.value),r=_.newPos}}else if(p===Rse.GEOMETRY&&b===2){let f=ry(e,r,n);r=f.newPos;let y=lu(r,f.value,n,"feature geometry");for(;r<y;){let _=mA(e,r,y);c.push(_.value),r=_.newPos}}else r=FK(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=UIt(s,c);return{type:YIt[s]??"Unknown",geometry:u,properties:d}}function UIt(e,t){let n=0,i=0,o=0;if(e===WK.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===WK.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===WK.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 DIt(e,t,n){let i=t;for(;i<n;){let o=vK(e,i,n),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===hR.STRING&&s===2){let a=ry(e,i,n);i=a.newPos;let c=lu(i,a.value,n,"string value");return Vse(e,i,c-i)}else{if(r===hR.FLOAT&&s===5)return lu(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(r===hR.DOUBLE&&s===1)return lu(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(r===hR.INT64&&s===0){let a=hA(e,i,n);return Cse(a.value)}else if(r===hR.UINT64&&s===0){let a=hA(e,i,n);return Cse(a.value)}else if(r===hR.SINT64&&s===0){let a=hA(e,i,n);return Cse(OIt(a.value))}else if(r===hR.BOOL&&s===0)return mA(e,i,n).value!==0}i=FK(e,i,s,n)}}function vK(e,t,n){let i=mA(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function mA(e,t,n){let i=hA(e,t,n,5);if(i.value>0xffffffffn)throw new ae("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function ry(e,t,n){let i=hA(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 hA(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 Vse(e,t,n){let i=lu(t,n,e.length,"string");return XIt.decode(e.subarray(t,i))}function lu(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 FK(e,t,n,i){if(n===0)return hA(e,t,i).newPos;if(n===1)return lu(t,8,i,"fixed64 field");if(n===2){let o=ry(e,t,i);return lu(o.newPos,o.value,i,"length-delimited field")}else if(n===5)return lu(t,4,i,"fixed32 field");throw new ae(`Unsupported protobuf wire type: ${n}`)}function N0(e){return e>>>1^-(e&1)}function OIt(e){return e>>1n^-(e&1n)}function Cse(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var Y9=MIt;var ZTo=x(T(),1);var $xo=x(T(),1),M9=`in vec4 positionEC; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function HS(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??HS.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:ro.fromType(ro.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Eo.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(HS.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}}});HS.prototype.getFragmentShaderSource=Eo.prototype.getFragmentShaderSource;HS.prototype.isTranslucent=Eo.prototype.isTranslucent;HS.prototype.getRenderState=Eo.prototype.getRenderState;HS.MaterialSupport={BASIC:Object.freeze({vertexFormat:Me.POSITION_AND_NORMAL,vertexShaderSource:_Y,fragmentShaderSource:TY}),TEXTURED:Object.freeze({vertexFormat:Me.POSITION_NORMAL_AND_ST,vertexShaderSource:ZY,fragmentShaderSource:SY}),ALL:Object.freeze({vertexFormat:Me.ALL,vertexShaderSource:xY,fragmentShaderSource:yY})};var Vo=HS;var xbt=1e5;function RY(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:xbt,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 gY({radius:this._radius,vertexFormat:Me.ALL}),i=new Mt({geometry:n,modelMatrix:this._transform}),o=new ro({fabric:{type:"Image",uniforms:{image:this._image,repeat:new k(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Pn({geometryInstances:i,appearance:new Vo({material:o,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(RY.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)}}});RY.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};RY.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};RY.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var Lee=RY;var YGi=x(T(),1);function Wee(){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(Wee.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var Tbt=new h;Wee.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,Tbt),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 CY=Wee;var BGi=x(T(),1);function jd(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??jd.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??jd.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??jd.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??jd.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??jd.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){_bt(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(){Sbt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}jd.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};jd.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new jd({scene:e})),e._frameRateMonitor};Object.defineProperties(jd.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}}});jd.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};jd.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};jd.prototype.isDestroyed=function(){return!1};jd.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function _bt(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/wn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/wn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/wn.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 Sbt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var VY=jd;var KGi=x(T(),1);function Zbt(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 EY=Zbt;var mLi=x(T(),1);var Fee=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=Rbt(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 Id({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new tl({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:SRe(f.points[S],o,d),pickObject:i?vee(this,Z,this._points,Ac,_):void 0})}for(let S=0;S<f.polylines.length;S++){let Z=m++;this._polylines.add({featureId:y,positions:gRe(f.polylines[S],o,s),pickObject:i?vee(this,Z,this._polylines,ya,_):void 0})}for(let S=0;S<f.polygons.length;S++){let Z=f.polygons[S],R=p++;this._polygons.add({featureId:y,positions:gRe(Z.positions,o,s),holes:Z.holes,triangles:Z.triangles,pickObject:i?vee(this,R,this._polygons,Fr,_):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=bs(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=bs(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 vee(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 Rbt(e){let t=Cbt(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(yRe(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(Xbt(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 Cbt(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(Ibt(e.type))return[{type:"Feature",geometry:e,properties:B.EMPTY_OBJECT,id:void 0}];throw new ae(`Unsupported GeoJSON type: ${e.type}`)}}function yRe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":xRe(e.coordinates,t.points);return;case"MultiPoint":Ebt(e.coordinates,t.points);return;case"LineString":TRe(e.coordinates,t.polylines);return;case"MultiLineString":Abt(e.coordinates,t.polylines);return;case"Polygon":_Re(e.coordinates,t.polygons);return;case"MultiPolygon":Gbt(e.coordinates,t.polygons);return;case"GeometryCollection":Vbt(e.geometries,t);return;default:return}}function Vbt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yRe(e[n],t)}function xRe(e,t){let n=Iee(e);l(n)&&t.push(n)}function Ebt(e,t){for(let n=0;n<e.length;n++)xRe(e[n],t)}function TRe(e,t){let n=Lbt(e);l(n)&&n.length>=2&&t.push(n)}function Abt(e,t){for(let n=0;n<e.length;n++)TRe(e[n],t)}function _Re(e,t){let n=Wbt(e);l(n)&&t.push(n)}function Gbt(e,t){for(let n=0;n<e.length;n++)_Re(e[n],t)}function Lbt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Iee(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function Wbt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=vbt(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 vbt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Iee(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&Fbt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Iee(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 Fbt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ibt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function SRe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var Pbt=new h;function gRe(e,t,n){let i=e.length*3,o=n(i);for(let r=0;r<e.length;r++){let s=SRe(e[r],t,Pbt);o[r*3]=s.x,o[r*3+1]=s.y,o[r*3+2]=s.z}return o.subarray(0,i)}function Xbt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Pee=Fee;var fLi=x(T(),1);function Nbt(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 AY=Nbt;var yLi=x(T(),1);var Ybt=new k;function Mbt(e,t){let n=e.unionClippingRegions,i=e.length,o=xs.useFloatTexture(t),r=xs.getTextureResolution(e,t,Ybt),s=r.x,a=r.y,c=o?Ubt(s,a):Dbt(s,a);return c+=` -`,c+=n?wbt(i):kbt(i),c}function wbt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +vec3 position; +vec3 direction; +if (czm_orthographicIn3D == 1.0) { - 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; +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); } -`}function kbt(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 Ubt(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) +else { - 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); +position = vec3(0.0); +direction = normalize(positionEC.xyz); } -`}function Dbt(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) +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)) { - 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); +out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); +} +else +{ +discard; } -`}var KS=Mbt;var _Li=x(T(),1);function Obt(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 GY=Obt;var RLi=x(T(),1);function Bbt(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 LY=Bbt;var KIi=x(T(),1);var lvi=x(T(),1);var evi=x(T(),1);var VLi=x(T(),1),ZRe={NONE:0,LERC:1};Object.freeze(ZRe);var ih=ZRe;var cWi=x(T(),1);var FLi=x(T(),1);function l0(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(l0.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 RRe=new h;l0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,RRe);return Nee(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};l0.prototype.isScaledSpacePointVisible=function(e){return Nee(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var zbt=new h;l0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=zbt,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),Nee(e,o,i)};l0.prototype.computeHorizonCullingPoint=function(e,t,n){return ERe(this._ellipsoid,e,t,n)};var CRe=ne.clone(ne.UNIT_SPHERE);l0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=VRe(this._ellipsoid,n,CRe);return ERe(o,e,t,i)};l0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return ARe(this._ellipsoid,e,t,n,i,o)};l0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=VRe(this._ellipsoid,o,CRe);return ARe(s,e,t,n,i,r)};var Hbt=[];l0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=re.subsample(e,t,0,Hbt),o=me.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var Kbt=new h;function VRe(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,Kbt);e=ne.fromCartesian3(i,n)}return e}function ERe(e,t,n,i){l(i)||(i=new h);let o=WRe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=GRe(e,c,o);if(d<0)return;r=Math.max(r,d)}return LRe(o,r,i)}var y3=new h;function ARe(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let s=WRe(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){y3.x=n[c]+o.x,y3.y=n[c+1]+o.y,y3.z=n[c+2]+o.z;let u=GRe(e,y3,s);if(u<0)return;a=Math.max(a,u)}return LRe(s,a,r)}function Nee(e,t,n){let i=t,o=n,r=h.subtract(e,i,RRe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var Jbt=new h,jbt=new h;function GRe(e,t,n){let i=e.transformPositionToScaledSpace(t,Jbt),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,jbt);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 LRe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var Xee=new h;function WRe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,Xee),h.normalize(Xee,Xee))}var Rf=l0;var zLi=x(T(),1);var PLi=x(T(),1),vRe={NONE:0,BITS12:1};Object.freeze(vRe);var Ka=vRe;var WY=new h,Qbt=new h,oh=new k,qbt=new P,$bt=new P,egt=Math.pow(2,12);function Xc(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,Qbt),_=i-n;Math.max(h.maximumComponent(y),_)<egt-1?u=Ka.BITS12:u=Ka.NONE;let Z=P.fromScale(y,qbt);Z=P.setTranslation(Z,b,Z);let R=P.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,WY),$bt);R=P.multiplyByTranslation(R,h.negate(b,WY),R),p=P.clone(o,new P);let C=P.getTranslation(o,WY);C=h.subtract(C,e,WY),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()}Xc.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,WY),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,oh);let p=dn.compressTextureCoordinates(oh);k.fromElements(n.z,m,oh);let b=dn.compressTextureCoordinates(oh);k.fromElements(c,d,oh);let f=dn.compressTextureCoordinates(oh);if(e[t++]=p,e[t++]=b,e[t++]=f,this.hasWebMercatorT){k.fromElements(s,0,oh);let y=dn.compressTextureCoordinates(oh);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 tgt=new h,FRe=new h;Xc.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,tgt),c=n.geodeticSurfaceNormal(a,FRe),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};Xc.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]}};Xc.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],oh);n.x=i.x,n.y=i.y;let o=dn.decompressTextureCoordinates(e[t+1],oh);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)};Xc.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,FRe),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};Xc.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)};Xc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+1],oh).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Xc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+3],oh).x:e[t+6]};Xc.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)};Xc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return dn.octDecodeFloat(e[i],n)};Xc.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};Xc.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 x3={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},T3={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Xc.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(x3.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(x3.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(x3.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(T3.compressed0,a?4:3),c&&s(T3.compressed1,1),this.hasGeodeticSurfaceNormals&&s(T3.geodeticSurfaceNormal,3)}return r};Xc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?x3:T3};Xc.clone=function(e,t){if(l(e))return l(t)||(t=new Xc),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 Zr=Xc;var d0={};d0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Yee=new h,ngt=new P,igt=new h,ogt=new h;d0.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??d0.DEFAULT_STRUCTURE,v=G.heightScale??d0.DEFAULT_STRUCTURE.heightScale,X=G.heightOffset??d0.DEFAULT_STRUCTURE.heightOffset,Y=G.elementsPerHeight??d0.DEFAULT_STRUCTURE.elementsPerHeight,D=G.stride??d0.DEFAULT_STRUCTURE.stride,M=G.elementMultiplier??d0.DEFAULT_STRUCTURE.elementMultiplier,O=G.isBigEndian??d0.DEFAULT_STRUCTURE.isBigEndian,w=re.computeWidth(_),z=re.computeHeight(_),K=w/(d-1),te=z/(u-1);b||(w*=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,ngt),Ge,Ae;F&&(Ge=xi.geodeticLatitudeToMercatorAngle(R),Ae=1/(xi.geodeticLatitudeToMercatorAngle(E)-Ge));let Fe=igt;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let tt=ogt;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,yi;F&&(yi=(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,Mn;if(Y===1)Mn=c[Qr];else{Mn=0;let qo;if(O)for(qo=0;qo<Y;++qo)Mn=Mn*M+c[Qr+qo];else for(qo=Y-1;qo>=0;--qo)Mn=Mn*M+c[Qr+qo]}Mn=Mn*v+X,he=Math.max(he,Mn),_e=Math.min(_e,Mn);let Ki=_.west+K*mo;b?Ki=a(Ki):Ki=Ki*y;let wi=(Ki-Z)/(C-Z);wi=W.clamp(wi,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&&(Mn-=m,qo?(Xo=je+(u-rn-1),Ki-=pt*w):hr?Xo=je+u+(d-mo-1):Gl?(Xo=je+u+d+rn,Ki+=pt*w):Po&&(Xo=je+u+d+u+mo))}let Dc=Is*t(Ki),pm=Is*n(Ki),bp=$*Dc,Lh=ee*pm,gp=1/i(bp*Dc+Lh*pm+or*Hs),Ps=bp*gp,$a=Lh*gp,BT=or*gp,si=new h;si.x=Ps+Dc*Mn,si.y=$a+pm*Mn,si.z=BT+Hs*Mn,P.multiplyByPoint(ye,si,Yee),h.minimumByComponent(Yee,Fe,Fe),h.maximumByComponent(Yee,tt,tt),Be=Math.min(Be,Mn),Ke[Xo]=si,Et[Xo]=new k(wi,$i),ct[Xo]=Mn,F&&(zt[Xo]=yi),V&&(ut[Xo]=f.geodeticSurfaceNormal(si))}}let Mi=me.fromPoints(Ke),jn;l(S)&&(jn=nn.fromRectangle(S,_e,he,f));let Si;L&&(Si=new Rf(f).computeHorizonCullingPointPossiblyUnderEllipsoid(A,Ke,_e));let Hi=new Gu(Fe,tt,A),Gi=new Zr(A,Hi,Be,he,Ze,!1,F,V,I,N),pi=new Float32Array(We*Gi.stride),Zi=0;for(let On=0;On<We;++On)Zi=Gi.encode(pi,Zi,Ke[On],Et[On],ct[On],void 0,zt[On],ut[On]);return{vertices:pi,maximumHeight:he,minimumHeight:_e,encoding:Gi,boundingSphere3D:Mi,orientedBoundingBox:jn,occludeePointInScaledSpace:Si}};var hV=d0;var uWi=x(T(),1);function Nx(){ge.throwInstantiationError()}Object.defineProperties(Nx.prototype,{credits:{get:ge.throwInstantiationError},waterMask:{get:ge.throwInstantiationError}});Nx.prototype.interpolateHeight=ge.throwInstantiationError;Nx.prototype.isChildAvailable=ge.throwInstantiationError;Nx.prototype.createMesh=ge.throwInstantiationError;Nx.prototype.upsample=ge.throwInstantiationError;Nx.prototype.wasCreatedByUpsampling=ge.throwInstantiationError;Nx.maximumAsynchronousTasks=5;var Qd=Nx;var NWi=x(T(),1);var RWi=x(T(),1);var rgt=3,wee=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new kee}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,o,r){this._needsRebuild&&cgt(this,n);let s=this._inverseTransform,a=agt;a.origin=P.multiplyByPoint(s,t.origin,a.origin),a.direction=P.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return PRe(this._rootNode,a,c),hgt(this,c,t,i,o,r)}},sgt=new Qn("incrementallyBuildTerrainPicker"),kee=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=IRe(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=IRe(n.x,n.y,n.level),this.children[t]=n}},agt=new gn,_3=[new h,new h,new h];function cgt(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 lgt=new h,dgt=new h;function IRe(e,t,n){let i=1/Math.pow(2,n),o=h.fromElements(e*i-.5,t*i-.5,-.5,lgt),r=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,dgt);return Gu.fromCorners(o,r)}function ugt(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 mgt=new Ys;function PRe(e,t,n){let i=Ti.rayAxisAlignedBoundingBox(t,e.aabb,mgt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Ys(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)PRe(e.children[r],t,n)}function hgt(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=fgt(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 fgt(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>=rgt)&&!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=Mee(a,o,r,t,d,c[3*_],_3[0]),Z=Mee(a,o,r,t,d,c[3*_+1],_3[1]),R=Mee(a,o,r,t,d,c[3*_+2],_3[2]),C=Ti.rayTriangleParametric(t,S,Z,R,i);l(C)&&C<s&&C>=0&&(s=C),p&&ugt(b,f,_3,_,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);bgt(e._inverseTransform,n,f,b)}return s}var pgt=new pe;function Mee(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,pgt);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 bgt(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=sgt.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 vY=wee;function FY(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 vY(t,n,p)}FY.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===se.SCENE3D?ggt(this,this._transform):Rgt(this,t,this._transform))};function ggt(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=nn.fromRectangle(e.rectangle,o,r,ne.default,e.orientedBoundingBox);return nn.computeTransformation(s,t),P.getScale(t,Uee).z<=W.EPSILON16&&(Uee.z=1,P.setScale(t,Uee,t)),t}var ygt=new h,xgt=new h,Tgt=new pe,_gt=new pe,Sgt=new h,Zgt=new h,Uee=new h;function Rgt(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,Tgt),ygt),c=t.project(pe.fromRadians(e.rectangle.east,e.rectangle.north,0,_gt),xgt),d=s-r,u=h.fromElements(c.x-a.x,c.y-a.y,d>0?d:1,Sgt),m=h.fromElements(a.x+u.x*.5,a.y+u.y*.5,r+u.z*.5,Zgt);return P.fromTranslation(m,n),P.setScale(n,u,n),P.multiply(_t.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}FY.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};FY.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};FY.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var mc=FY;function bg(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??ih.NONE;let t=hV.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===ih.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(bg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var XRe="createVerticesFromHeightmap",Cgt=new Qn(XRe),Vgt=new Qn(XRe,Qd.maximumAsynchronousTasks);bg.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?Vgt:Cgt).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 Ui,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 mc(m,new Float32Array(Z.vertices),R.indices,R.indexCountWithoutSkirts,C,Z.minimumHeight,Z.maximumHeight,u,me.clone(Z.boundingSphere3D),h.clone(Z.occludeePointInScaledSpace),Z.numberOfAttributes,nn.clone(Z.orientedBoundingBox),Zr.clone(Z.encoding),R.westIndicesSouthToNorth,R.southIndicesEastToWest,R.eastIndicesNorthToSouth,R.northIndicesWestToEast),S._buffer=void 0,S._mesh})};bg.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=hV.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 Ui,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 mc(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};bg.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===ih.LERC;if(!p&&b)return;let y;if(p){let _=this._mesh.vertices,S=this._mesh.encoding;y=NRe(_,S,u,m,e,i,o,t,n)}else y=Egt(this._buffer,a,c,s,d,e,i,o,t,n),y=y*m+u;return y};bg.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=NRe(b,f,S,Z,y,c,d,N,F);g=g<u.lowestEncodedHeight?u.lowestEncodedHeight:g,g=g>u.highestEncodedHeight?u.highestEncodedHeight:g,Agt(p,R,C,A,m,E,L*c+I,g)}}return Promise.resolve(new bg({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};bg.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};bg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Egt(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=S3(e,t,n,i,o,f*s+p),R=S3(e,t,n,i,o,f*s+b),C=S3(e,t,n,i,o,y*s+p),E=S3(e,t,n,i,o,y*s+b);return YRe(_,S,Z,R,C,E)}function NRe(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 YRe(y,_,S,Z,R,C)}function YRe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function S3(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 Agt(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 Nc=bg;function fV(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new eo({ellipsoid:e.ellipsoid??ne.default})),this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se}Object.defineProperties(fV.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(){}}});fV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Nc({buffer:new Uint8Array(256),width:16,height:16}))};fV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};fV.prototype.getTileDataAvailable=function(e,t,n){};fV.prototype.loadTileDataAvailability=function(e,t,n){};var u0=fV;var uvi=x(T(),1),IY=`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 -#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) +czm_writeLogDepth(); +} +`;var tTo=x(T(),1),w9=`in vec4 position; +out vec4 positionEC; +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); +positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); } -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +`;function U9(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 k9=fn.supportsTypedArrays()?new Float32Array(12):[],VIe=new h,EIe=new h,Ese=new h,AIe=new h,IK=new h;function BIt(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,VIe),b=h.normalize(p,EIe),f=h.normalize(h.cross(h.UNIT_Z,p,Ese),Ese),y=h.normalize(h.cross(b,f,AIe),AIe),_=h.magnitude(p),S=Math.sqrt(_*_-1);o=h.multiplyByScalar(b,1/_,VIe);let Z=S/_;r=h.multiplyByScalar(f,Z,EIe),s=h.multiplyByScalar(y,Z,Ese)}let a=h.add(o,s,IK);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,k9,0);let c=h.subtract(o,s,IK);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,k9,3);let d=h.add(o,s,IK);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,k9,6);let u=h.subtract(o,s,IK);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,k9,9),k9}U9.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 me(h.ZERO,i.maximumRadius),pass:Le.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Je({sources:[w9]}),a=new Je({sources:[M9]});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=BIt(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}};U9.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};U9.prototype.isDestroyed=function(){return!1};U9.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var D9=U9;var vTo=x(T(),1);function fR(){}var zIt=/\bgl_FragDepth\b/,HIt=/\bdiscard\b/;function KIt(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(zIt.test(r[a])||HIt.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() { -return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); + out_FragColor = vec4(1.0); } -#endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() +`;i=new Je({sources:[a]})}else if(!o&&s){let a=`void main() { -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; + out_FragColor = vec4(1.0); + czm_writeLogDepth(); } -#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) +`;i=new Je({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function JIt(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}fR.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=KIt(n,t.shaderProgram),i.depthOnlyCommand.renderState=JIt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var jIt=/\s+czm_writeLogDepth\(/,QIt=/\s+czm_vertexLogDepth\(/;function qIt(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(QIt.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() { -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; + czm_log_depth_main(); + czm_vertexLogDepth(); } -else if (split > 0.0 && gl_FragCoord.x < splitPosition) { -alpha = 0.0; +`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)jIt.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(); } -#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)); +`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}fR.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=qIt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function $It(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 Ase(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}fR.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=$It(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Ase(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};var ePt=`uint rgba8UnormToUint32(vec4 c) +{ + uvec4 b = uvec4(c * 255.0 + 0.5); + return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -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() +`;function tPt(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=`${ePt} +void main () { -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) + 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})}fR.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=tPt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Ase(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=o,i.snapCommand.renderState=r),i};function fA(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 nPt(e){return e.isArray?e.arrayLength:St.getComponentCount(e.type)}function GIe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function LIe(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function iPt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=GIe(n,i,o)}return e.normalized||(n=LIe(n,e.componentType)),n}function oPt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=GIe(o,r,s)}return e.normalized||(o=LIe(o,e.componentType)),o}function rPt(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=nPt(d);if(p===1)m[0]=iPt(d,c);else{let _=["x","y","z","w"];for(let S=0;S<p;S++)m[S]=oPt(d,c,_[S])}let b=t.fragmentShaderSource.defines.slice();b.push(Xu.METADATA_PICKING_ENABLED),fA(b,Xu.METADATA_PICKING_VALUE_TYPE,u),fA(b,Xu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),fA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_X,m[0]),fA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_Y,m[1]),fA(b,Xu.METADATA_PICKING_VALUE_COMPONENT_Z,m[2]),fA(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})}fR.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=lt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=rPt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Ase(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function sPt(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})}fR.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=sPt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var rp=fR;var MTo=x(T(),1);function PK(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 aPt=new Ne,WIe=new Ne,cPt=new q;function lPt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Ne.fromAxisAngle(o,n,WIe),c=Ne.fromAxisAngle(r,i,aPt),d=Ne.multiply(c,a,c),u=Ne.fromAxisAngle(s,t,WIe);Ne.multiply(u,d,d);let m=q.fromQuaternion(d,cPt);q.multiplyByVector(m,r,r),q.multiplyByVector(m,s,s),q.multiplyByVector(m,o,o)}PK.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;lPt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};PK.prototype.isDestroyed=function(){return!1};PK.prototype.destroy=function(){return this._removeListener(),ue(this)};var O9=PK;var DTo=x(T(),1);function dPt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var Gse=dPt;var qTo=x(T(),1);function LT(){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 mi({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(LT.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}}});LT.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};LT.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};LT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};LT.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};LT.prototype.isDestroyed=function(){return!1};LT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var B9=LT;var V_o=x(T(),1);var e_o=x(T(),1),pA=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; +in vec3 v_positionEC; +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) { -direction = vec3(0.0, 0.0, -1.0); +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 } -else +void main() { -direction = normalize(vec3(xy, -czm_currentFrustum.x)); +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; } -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; +if (t1 < 0.0 && t2 < 0.0) { +discard; } -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) +float t = min(t1, t2); +if (t < 0.0) { +t = 0.0; +} +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; } +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 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; +} +`;var n_o=x(T(),1),bA=`in vec3 position; +uniform vec3 u_radii; +out vec3 v_positionEC; +void main() +{ +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(); +} +`;var Lse={position:0};function XK(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 me,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 uPt(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:Me.POSITION_ONLY}));return t=Un.fromGeometry({context:e,geometry:n,attributeLocations:Lse,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}XK.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=uPt(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),me.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:[bA]}),p=new Je({sources:[this.material.shaderSource,pA]}),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:Lse}),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:[bA]}),p=new Je({sources:[this.material.shaderSource,pA],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:Lse}),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)}};XK.prototype.isDestroyed=function(){return!1};XK.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 z9=XK;var M_o=x(T(),1);var A_o=x(T(),1),H9=`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 -#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); +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 -float nightBlend = 0.0; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #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 L_o=x(T(),1),K9=`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() { -cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; +vec4 p = czm_computePosition(); +v_positionMC = position3DHigh + position3DLow; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -else if (czm_sceneMode == czm_sceneModeColumbusView) +`;function pR(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??K9,this._fragmentShaderSource=e.fragmentShaderSource??H9,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(pR.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 pR.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});pR.VERTEX_FORMAT=Me.POSITION_AND_ST;pR.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;pR.prototype.isTranslucent=Go.prototype.isTranslucent;pR.prototype.getRenderState=Go.prototype.getRenderState;var Wse=pR;var $_o=x(T(),1);var mPt=1e5;function J9(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:mPt,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 Nw({radius:this._radius,vertexFormat:Me.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(J9.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)}}});J9.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};J9.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};J9.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var vse=J9;var rSo=x(T(),1);function Fse(){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(Fse.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var hPt=new h;Fse.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,hPt),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 j9=Fse;var mSo=x(T(),1);function du(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??du.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??du.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??du.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??du.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??du.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){fPt(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(){pPt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}du.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};du.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new du({scene:e})),e._frameRateMonitor};Object.defineProperties(du.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}}});du.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};du.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};du.prototype.isDestroyed=function(){return!1};du.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function fPt(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/wn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/wn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/wn.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 pPt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var Q9=du;var pSo=x(T(),1);function bPt(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 q9=bPt;var FSo=x(T(),1);var Pse=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=gPt(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 Bd({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:NIe(f.points[S],o,d),pickObject:i?Ise(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:vIe(f.polylines[S],o,s),pickObject:i?Ise(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:vIe(Z.positions,o,s),holes:Z.holes,triangles:Z.triangles,pickObject:i?Ise(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),ue(this)}isDestroyed(){return!1}};function Ise(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 gPt(e){let t=yPt(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(FIe(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(GPt(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 yPt(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(EPt(e.type))return[{type:"Feature",geometry:e,properties:B.EMPTY_OBJECT,id:void 0}];throw new ae(`Unsupported GeoJSON type: ${e.type}`)}}function FIe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":IIe(e.coordinates,t.points);return;case"MultiPoint":TPt(e.coordinates,t.points);return;case"LineString":PIe(e.coordinates,t.polylines);return;case"MultiLineString":_Pt(e.coordinates,t.polylines);return;case"Polygon":XIe(e.coordinates,t.polygons);return;case"MultiPolygon":SPt(e.coordinates,t.polygons);return;case"GeometryCollection":xPt(e.geometries,t);return;default:return}}function xPt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)FIe(e[n],t)}function IIe(e,t){let n=Xse(e);l(n)&&t.push(n)}function TPt(e,t){for(let n=0;n<e.length;n++)IIe(e[n],t)}function PIe(e,t){let n=ZPt(e);l(n)&&n.length>=2&&t.push(n)}function _Pt(e,t){for(let n=0;n<e.length;n++)PIe(e[n],t)}function XIe(e,t){let n=RPt(e);l(n)&&t.push(n)}function SPt(e,t){for(let n=0;n<e.length;n++)XIe(e[n],t)}function ZPt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Xse(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function RPt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=CPt(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=hi.triangulate(i,r);if(!(!l(s)||s.length<3))return{positions:o,holes:new Uint32Array(r),triangles:new Uint32Array(s)}}function CPt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Xse(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&VPt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Xse(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 VPt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function EPt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function NIe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var APt=new h;function vIe(e,t,n){let i=e.length*3,o=n(i);for(let r=0;r<e.length;r++){let s=NIe(e[r],t,APt);o[r*3]=s.x,o[r*3+1]=s.y,o[r*3+2]=s.z}return o.subarray(0,i)}function GPt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nse=Pse;var PSo=x(T(),1);function LPt(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 $9=LPt;var MSo=x(T(),1);var WPt=new k;function vPt(e,t){let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,WPt),s=r.x,a=r.y,c=o?PPt(s,a):XPt(s,a);return c+=` +`,c+=n?FPt(i):IPt(i),c}function FPt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -cameraDist = -czm_view[3].z; + 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; } -else +`}function IPt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -cameraDist = length(czm_view[3]); -} -float fadeOutDist = u_lightingFadeDistance.x; -float fadeInDist = u_lightingFadeDistance.y; -if (czm_sceneMode != czm_sceneMode3D) { -vec3 radii = czm_ellipsoidRadii; -float maxRadii = max(radii.x, max(radii.y, radii.z)); -fadeOutDist -= maxRadii; -fadeInDist -= maxRadii; + 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 PPt(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}); + // 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); } -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) +`}function XPt(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) { -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); + 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); } +`}var bR=vPt;var USo=x(T(),1);function NPt(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 ek=NPt;var BSo=x(T(),1);function YPt(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 tk=YPt;var VCo=x(T(),1);var HSo=x(T(),1),nk=`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_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; +#ifdef APPLY_SPLIT +uniform float u_dayTextureSplit[TEXTURE_UNITS]; #endif -czm_material material = czm_getMaterial(materialInput); -vec4 materialColor = vec4(material.diffuse, material.alpha); -color = alphaBlend(materialColor, color); +#ifdef APPLY_BRIGHTNESS +uniform float u_dayTextureBrightness[TEXTURE_UNITS]; #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; +#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 ENABLE_CLIPPING_PLANES -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; -if (clipDistance < clippingPlanesEdgeWidth) -{ -finalColor = clippingPlanesEdgeColor; -} +#ifdef APPLY_GAMMA +uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; #endif -#ifdef ENABLE_CLIPPING_POLYGONS -bool insideAny = vectorClip(v_textureCoordinates.xy); -#ifdef CLIPPING_INVERSE -if (!insideAny) { -discard; -} -#else -if (insideAny) { -discard; -} +#ifdef APPLY_IMAGERY_CUTOUT +uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; #endif +#ifdef APPLY_COLOR_TO_ALPHA +uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; #endif -#ifdef HIGHLIGHT_FILL_TILE -finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; #endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) -vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else -vec3 atmosphereLightDirection = czm_lightDirectionWC; +#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 -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -if (!czm_backFacing()) -{ -bool dynamicLighting = false; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) -dynamicLighting = true; +#ifdef SHOW_OCEAN_WAVES +uniform sampler2D u_oceanNormalMap; #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; +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +uniform vec2 u_lightingFadeDistance; #endif -#ifdef COLOR_CORRECT -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels); +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_cartographicLimitRectangle; #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; +#ifdef GROUND_ATMOSPHERE +uniform vec2 u_nightFadeDistance; #endif -#ifndef HDR -fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); +#ifdef ENABLE_CLIPPING_PLANES +uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; #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); +#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) +uniform float u_minimumBrightness; #endif -#ifndef HDR -finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); -#else -finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); +#ifdef COLOR_CORRECT +uniform vec3 u_hsbShift; #endif -finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); +#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 -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); -} +uniform vec4 u_undergroundColor; +uniform vec4 u_undergroundColorAlphaByDistance; #endif -#ifdef HAS_VECTOR_LAYER -finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); -finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); +#ifdef ENABLE_VERTEX_LIGHTING +uniform float u_lambertDiffuseMultiplier; +uniform float u_vertexShadowDarkness; #endif -#ifdef TRANSLUCENT -if (inTranslucencyRectangle()) +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) { -vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; -finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); +float startDistance = nearFarScalar.x; +float startValue = nearFarScalar.y; +float endDistance = nearFarScalar.z; +float endValue = nearFarScalar.w; +float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); +return mix(startValue, endValue, t); } #endif -out_FragColor = finalColor; -} -#ifdef SHOW_REFLECTIVE_OCEAN -float waveFade(float edge0, float edge1, float x) +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { -float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -return pow(1.0 - y, 5.0); +return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } -float linearFade(float edge0, float edge1, float x) +#endif +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() { -return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.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; } -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); +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) +{ +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 -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; +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 -return vec4(color, imageryColor.a); -} -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var hvi=x(T(),1),PY=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; +#if !defined(APPLY_GAMMA) +vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); +color = tempColor.rgb; +alpha = tempColor.a; #else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; +color = pow(color, vec3(textureOneOverGamma)); #endif -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; +#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 EXAGGERATION -uniform vec2 u_verticalExaggerationAndRelativeHeight; +#ifdef APPLY_BRIGHTNESS +color = mix(vec3(0.0), color, textureBrightness); #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; +#ifdef APPLY_CONTRAST +color = mix(vec3(0.5), color, textureContrast); #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; +#ifdef APPLY_HUE +color = czm_hue(color, textureHue); #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; +#ifdef APPLY_SATURATION +color = czm_saturation(color, textureSaturation); #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); +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)); } -float get2DMercatorYPositionFraction(vec2 textureCoordinates) +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() { -const float maxTileWidth = 0.003068; -float positionFraction = textureCoordinates.y; -float southLatitude = u_southAndNorthLatitude.x; -float northLatitude = u_southAndNorthLatitude.y; -if (northLatitude - southLatitude > maxTileWidth) +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 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); +direction = vec3(0.0, 0.0, -1.0); } -return positionFraction; +else +{ +direction = normalize(vec3(xy, -czm_currentFrustum.x)); } -float get2DGeographicYPositionFraction(vec2 textureCoordinates) +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() { -return textureCoordinates.y; +#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; } -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +#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)) { -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; +color = vec4(1.0, 0.0, 0.0, 1.0); } -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +#endif +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +float cameraDist; +if (czm_sceneMode == czm_sceneMode2D) { -return getPositionPlanarEarth(position, 0.0, textureCoordinates); +cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; } -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +else if (czm_sceneMode == czm_sceneModeColumbusView) { -return getPositionPlanarEarth(position, height, textureCoordinates); +cameraDist = -czm_view[3].z; } -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +else { -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; +cameraDist = length(czm_view[3]); } -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; +float fadeOutDist = u_lightingFadeDistance.x; +float fadeInDist = u_lightingFadeDistance.y; +if (czm_sceneMode != czm_sceneMode3D) { +vec3 radii = czm_ellipsoidRadii; +float maxRadii = max(radii.x, max(radii.y, radii.z)); +fadeOutDist -= maxRadii; +fadeInDist -= maxRadii; +} +float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); +#else +float fade = 0.0; #endif -void main() +#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) { -#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; +mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); +vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC); +vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx); +vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); +color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); +} #endif -#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 +#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 -vec3 position3DWC = position + u_center3D; -#ifdef GEODETIC_SURFACE_NORMALS -vec3 ellipsoidNormal = geodeticSurfaceNormal; +#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 -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; +vec4 finalColor = color; #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); +#ifdef ENABLE_CLIPPING_PLANES +vec4 clippingPlanesEdgeColor = vec4(1.0); +clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; +float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; +if (clipDistance < clippingPlanesEdgeWidth) +{ +finalColor = clippingPlanesEdgeColor; +} #endif -v_normalMC = normalMC; -v_normalEC = czm_normal3D * v_normalMC; +#ifdef ENABLE_CLIPPING_POLYGONS +bool insideAny = vectorClip(v_textureCoordinates.xy); +#ifdef CLIPPING_INVERSE +if (!insideAny) { +discard; +} +#else +if (insideAny) { +discard; +} #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 +#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 -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; +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +if (!czm_backFacing()) +{ +bool dynamicLighting = false; +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) +dynamicLighting = true; #endif -} -`;var pvi=x(T(),1),pV=`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), +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, -atmosphereInnerRadius, rayleighColor, mieColor, opacity ); -} -`;var Rvi=x(T(),1);var Dee=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}},Oee=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,M=t.hasExaggeration,O=t.showUndergroundColor,w=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|+M<<29|+O<<30|+w<<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(KS(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")),w&&(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"),M&&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(Mb);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(Ggt(je)),zt.sources.push(Lgt(A));let ht=tn.fromCache({context:n.context,vertexShaderSource:zt,fragmentShaderSource:ut,attributeLocations:ye.getAttributeLocations()});ct=Et[qe]=new Dee(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 ue(this)}};function Ggt(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 Lgt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var XY=Oee;var WFi=x(T(),1);var Vvi=x(T(),1),MRe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(MRe);var Kr=MRe;var i2i=x(T(),1);var Avi=x(T(),1),wRe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(wRe);var Ja=wRe;var Lvi=x(T(),1),kRe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(kRe);var wo=kRe;var m0=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=wo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new me,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===wo.RECEIVING||t===wo.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)&&(Zs.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(vc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=wo.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===Ja.START&&(Wgt(t,n,i,o),t.state=Ja.LOADING)}static processStateMachine(t,n,i,o,r,s,a,c){e.initialize(t,i,o,r);let d=t.data;if(t.state===Ja.LOADING&&vgt(t,n,i,o,r,s,a),c)return;let u=t.renderable;t.renderable=l(d.vertexArray);let m=d.terrainState===wo.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=Ja.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){URe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){URe(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=it.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=it.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 URe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Zr.clone(s);c.hasGeodeticSurfaceNormals=t,c=Zr.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?(m0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=m0._createVertexArrayForMesh(i.context,o)):(m0._freeVertexArray(e.vertexArray),e.vertexArray=m0._createVertexArrayForMesh(i.context,o)),m0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function Wgt(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=wo.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function vgt(e,t,n,i,o,r,s){let a=e.data,c=e.parent;if(a.terrainState===wo.FAILED&&c!==void 0){let d=c.data;d!==void 0&&d.terrainData!==void 0&&d.terrainData.canUpsample!==!1||m0.processStateMachine(c,t,n,i,o,r,s,!0)}if(a.terrainState===wo.FAILED&&Fgt(a,e,t,n,e.x,e.y,e.level),a.terrainState===wo.UNLOADED&&Igt(a,n,e.x,e.y,e.level),a.terrainState===wo.RECEIVED&&Xgt(a,t,n,e.x,e.y,e.level),a.terrainState===wo.TRANSFORMED&&(Ngt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,r)),a.terrainState>=wo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)Mgt(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 Fgt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Ja.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=wo.RECEIVING,Promise.resolve(b).then(function(f){l(f)&&(e.terrainData=f,e.terrainState=wo.RECEIVED)}).catch(function(){e.terrainState=wo.FAILED}))}function Igt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=wo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ri.CANCELLED){e.terrainData=void 0,e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainState=wo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=er.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=wo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=wo.UNLOADED,e.request=void 0)}a()}var Pgt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Xgt(e,t,n,i,o,r){let s=n.tilingScheme,a=Pgt;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=wo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=wo.TRANSFORMED}).catch(function(){e.terrainState=wo.FAILED}))}function Ngt(e,t,n,i,o,r,s){e.vertexArray=m0._createVertexArrayForMesh(t,e.mesh),e.terrainState=wo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Ygt(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 Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:qn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Mgt(e,t){let n=t.terrainData.waterMask,i=Ygt(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 rh=m0;var L2i=x(T(),1);var s2i=x(T(),1),wgt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Gn=wgt;var c2i=x(T(),1),DRe={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>=DRe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=DRe;function gV(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}gV.prototype.update=function(e,t,n){this.changedThisFrame&&(jRe(e,t,this.tile,n),this.changedThisFrame=!1)};gV.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};gV.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):rh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var kgt=new ax;gV.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=kgt;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);Ea(e,n,c,d,s,Gn.EAST,!1,a,i),Ea(e,n,c,u,s,Gn.NORTH,!1,a,i),Ea(e,n,c,m,s,Gn.WEST,!1,a,i),Ea(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);Ea(e,n,c,b,s,Gn.SOUTHEAST,!1,a,i),Ea(e,n,c,y,s,Gn.SOUTHWEST,!1,a,i),Ea(e,n,c,f,s,Gn.NORTHEAST,!1,a,i),Ea(e,n,c,_,s,Gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ea(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||gi.wasKicked(d._lastSelectionResult)||gi.originalResult(d._lastSelectionResult)===gi.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===gi.RENDERED){if(l(d.data.vertexArray))return;Ugt(e,t,n,d,r,o,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.CULLED)switch(r){case Gn.WEST:Ea(e,t,n,i.northwestChild,o,r,!0,a,c),Ea(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.EAST:Ea(e,t,n,i.southeastChild,o,r,!0,a,c),Ea(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTH:Ea(e,t,n,i.southwestChild,o,r,!0,a,c),Ea(e,t,n,i.southeastChild,o,r,!0,a,c);break;case Gn.NORTH:Ea(e,t,n,i.northeastChild,o,r,!0,a,c),Ea(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHWEST:Ea(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHEAST:Ea(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTHWEST:Ea(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.SOUTHEAST:Ea(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new ge("Invalid edge")}}}function Ugt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new gV(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Dgt(e,t,n,i,o,a)}function Dgt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(jRe(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 JS=new pe,Ogt=new pe,bV=new h,Kee=new h,Bee=new k,zee=new k,zu=new k;function G3(){this.height=0,this.encodedNormal=new k}function Z3(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 QRe(e,t,n,i,d,c),c}var Bgt={minimumHeight:0,maximumHeight:0},zgt=new h,ORe=new G3,BRe=new G3,zRe=new G3,HRe=new G3,Hgt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,Kgt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function jRe(e,t,n,i){rh.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=C3(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,zRe),p=C3(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,ORe),b=C3(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,BRe),f=C3(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,HRe);m=Z3(r,u,0,1,m,p,f,b,zRe),p=Z3(r,u,0,0,p,m,b,f,ORe),b=Z3(r,u,1,1,b,p,f,m,BRe),f=Z3(r,u,1,1,f,b,m,p,HRe);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 Nc({width:9,height:9,buffer:Hgt,structure:{heightOffset:C}}),v=Kgt;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,Ogt);v.height=E;let X=u.cartographicToCartesian(v,zgt),Y=new Zr(X,void 0,void 0,void 0,void 0,!0,!0,G,a,c),D=5,M;for(M=r.westMeshes,A=0,L=M.length;A<L;++A)D+=M[A].eastIndicesNorthToSouth.length;for(M=r.southMeshes,A=0,L=M.length;A<L;++A)D+=M[A].northIndicesWestToEast.length;for(M=r.eastMeshes,A=0,L=M.length;A<L;++A)D+=M[A].westIndicesSouthToNorth.length;for(M=r.northMeshes,A=0,L=M.length;A<L;++A)D+=M[A].southIndicesEastToWest.length;let O=Bgt;O.minimumHeight=R,O.maximumHeight=C;let w=Y.stride,z=new Float32Array(D*w),K=0,te=K;K=R3(u,s,Y,z,K,0,1,m.height,m.encodedNormal,1,O),K=E3(r,u,Y,z,K,r.westTiles,r.westMeshes,Gn.EAST,O);let H=K;K=R3(u,s,Y,z,K,0,0,p.height,p.encodedNormal,0,O),K=E3(r,u,Y,z,K,r.southTiles,r.southMeshes,Gn.NORTH,O);let $=K;K=R3(u,s,Y,z,K,1,0,b.height,b.encodedNormal,0,O),K=E3(r,u,Y,z,K,r.eastTiles,r.eastMeshes,Gn.WEST,O);let ee=K;K=R3(u,s,Y,z,K,1,1,f.height,f.encodedNormal,1,O),K=E3(r,u,Y,z,K,r.northTiles,r.northMeshes,Gn.SOUTH,O),R=O.minimumHeight,C=O.maximumHeight;let le=nn.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(JS,Kee),Ge=dn.octEncode(ye,Bee),Ae=K;Y.encode(z,K*w,le.center,k.fromElements(.5,.5,zu),E,Ge,Ze,ye),++K;let Fe=K,tt=Fe<256?1:2,Be=(Fe-1)*3,je=Be*tt,qe=(z.length-Fe*w)*Float32Array.BYTES_PER_ELEMENT,We;if(qe>=je){let bt=Fe*w*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*w);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 mc(Y.center,z,We,Be,Fe,R,C,s,me.fromOrientedBoundingBox(le),tyt(e,le.center,s,R,C),Y.stride,le,Y,ct,Et,zt,ut)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=rh._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 R3(e,t,n,i,o,r,s,a,c,d,u){let m=JS;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,bV),b;n.hasGeodeticSurfaceNormals&&(b=e.geodeticSurfaceNormal(p,Kee));let f=zee;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 A3=new re;function NY(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,A3),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,A3),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 Jgt=new k;function Hee(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 jgt=new k,Qgt=new h;function qgt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=NY(t,n,u.decodeTextureCoordinates(m,o,zu),zu),b=NY(t,n,u.decodeTextureCoordinates(m,r,zee),zee),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;JS.longitude=W.lerp(S.west,S.east,s),JS.latitude=W.lerp(S.south,S.north,a),d.height=JS.height=W.lerp(y,_,f);let Z;if(u.hasVertexNormals){let R=u.getOctEncodedNormal(m,o,Jgt),C=u.getOctEncodedNormal(m,r,jgt),E=dn.octDecode(R.x,R.y,bV),A=dn.octDecode(C.x,C.y,Qgt);Z=h.lerp(E,A,f,bV),h.normalize(Z,Z),dn.octEncode(Z,d.encodedNormal)}else Z=e.geodeticSurfaceNormalCartographic(JS,bV),dn.octEncode(Z,d.encodedNormal)}function QRe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(JS,bV);dn.octEncode(s,r.encodedNormal)}function C3(e,t,n,i,o,r,s,a,c,d,u){if(JRe(e,t,a,s,!1,n,i,u)||JRe(e,t,d,c,!0,n,i,u))return u;let p;if(Jee(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],Hee(r,p,n,i,u),u;let b;if(n===0?i===0?b=V3(e.westMeshes,e.westTiles,Gn.EAST,e.southMeshes,e.southTiles,Gn.NORTH,n,i):b=V3(e.northMeshes,e.northTiles,Gn.SOUTH,e.westMeshes,e.westTiles,Gn.EAST,n,i):i===0?b=V3(e.southMeshes,e.southTiles,Gn.NORTH,e.eastMeshes,e.eastTiles,Gn.WEST,n,i):b=V3(e.eastMeshes,e.eastTiles,Gn.WEST,e.northMeshes,e.northTiles,Gn.SOUTH,n,i),l(b))return QRe(e,t,n,i,b,u),u}function V3(e,t,n,i,o,r,s,a){let c=KRe(e,t,!1,n,s,a),d=KRe(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function E3(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=$gt(e,t,n,i,o,r[d],s[d],a,c);return o}function $gt(e,t,n,i,o,r,s,a,c){let d;a===Gn.EAST&&e.tile.x===0?(d=re.clone(r.rectangle,A3),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===Gn.WEST&&r.x===0&&(d=re.clone(r.rectangle,A3),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,zu),m=zu.x,p=zu.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,zu);NY(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,bV),X=S.decodeHeight(Z,L),Y;S.hasVertexNormals?Y=S.getOctEncodedNormal(Z,L,Bee):(Y=Bee,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 M;n.hasGeodeticSurfaceNormals&&(M=t.geodeticSurfaceNormal(v,Kee)),n.encode(i,o*R,v,F,X,Y,D,M),c.minimumHeight=Math.min(c.minimumHeight,X),c.maximumHeight=Math.max(c.maximumHeight,X),++o}return o}function KRe(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(!Jee(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 Jee(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function JRe(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(Jee(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,zu);let y=NY(b,e.tile,zu,zu);if(y.x===r&&y.y===s)return Hee(f,p,r,s,a),!0;if(m=Go(c,d?r:s,function(_,S){f.encoding.decodeTextureCoordinates(f.vertices,_,zu);let Z=NY(b,e.tile,zu,zu);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 qgt(t,b,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return Hee(f,c[m],r,s,a),!0}return!1}var eyt=[new h,new h,new h,new h];function tyt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=eyt;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 yV=gV;var jee=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=Wn.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){xs.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(vc.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(oyt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=iyt(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(),cyt(this,t);let i=this._vertexArraysToDestroy,o=i.length;for(let r=0;r<o;++r)rh._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:sc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:sc.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&&yV.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&&ryt(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;syt(this,b,f,t);let y=f.tileBoundingRegion;vyt(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),n1e(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===gi.CULLED_BUT_NEEDED,r=i.terrainState),rh.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)!==Kr.NONE&&i.boundingVolumeSourceTile===n&&(o=!1,rh.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=o1e(this,n);if(n.fog.enabled&&!r&&W.fog(o,n.fog.density)>=1)return Kr.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Kr.PARTIAL;let c=n.cullingVolume,d=a.boundingVolume;l(d)||(d=a.boundingSphere),s.clippedByBoundaries=!1;let u=W3(t.rectangle,this.cartographicLimitRectangle),m=re.simpleIntersection(u,t.rectangle,i1e);if(!l(m))return Kr.NONE;if(re.equals(m,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==se.SCENE3D&&(d=lyt,me.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=me.union(a.boundingSphere,d,d))),!l(d))return Kr.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 Kr.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=Kr.NONE:y===qt.INTERSECTING?f=Kr.PARTIAL:y===qt.INSIDE&&(f=Kr.FULL),f===Kr.NONE)return f;let _=n.mode===se.SCENE3D&&n.camera.frustum instanceof bn;if(n.mode===se.SCENE3D&&!_&&l(i)&&!r){let S=s.occludeePointInScaledSpace;return!l(S)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(S,a.minimumHeight)?f:Kr.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=myt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===wo.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=hyt;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:gi.NONE;if(p===gi.RENDERED){let b=m.data;if(!l(b))continue;if(!o&&m.data.terrainState===wo.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===gi.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,fyt),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){Syt(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(),ue(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]=Zyt(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!==o.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==gi.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)}},nyt=new re;function iyt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,nyt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function oyt(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 ryt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(vc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function syt(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 ayt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function cyt(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 n1e(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 lyt=new me,i1e=new re,dyt=new re,uyt=new pe;function W3(e,t){if(t.west<t.east)return t;let n=re.clone(t,dyt);return re.center(e,uyt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function o1e(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 myt=[],hyt=[],fyt=new h,qRe=new P,L3=new P,pyt=new ce,byt=new ce,gyt=new ce,yyt=new h,$Re=new h,xyt=new h,Tyt=new h,_yt=[new h,new h,new h,new h];function e1e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=_yt;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 Syt(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 wu({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=nn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=me.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=e1e(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=e1e(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 Zyt(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 Ryt=new P,Cyt=new P;function t1e(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,$Re);return P.setTranslation(i,o,qRe),qRe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=P.multiplyByPoint(i,this.properties.rtc,$Re);return P.setTranslation(i,r,L3),P.multiply(o,L3,L3),L3},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,Ryt):P.IDENTITY;return P.inverseTranspose(o,Cyt)},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 Vyt(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=Eyt(e,o,i),n.wireframeVertexArray.mesh=i}}function Eyt(e,t,n){let o={indices:n.indices,primitiveType:Ie.TRIANGLES};zn.toWireframe(o);let r=o.indices,s=it.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 r1e,s1e,v3;(function(){let e=new Mt({geometry:yf.fromDimensions({dimensions:new h(2,2,2)})}),t=new Mt({geometry:new rg({radius:1})}),n=new P,i,o;function r(s){return new Pn({geometryInstances:s,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}r1e=function(s,a){return s===i||(v3(),i=s,n=P.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=$t.fromColor(a),o=r(e)),o},s1e=function(s,a){return s===i||(v3(),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},v3=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Ayt=new ce(0,0,0,0),Gyt={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},Lyt=U.TRANSPARENT,Wyt=new Kt;function vyt(e,t,n){let i=t.data;if(ayt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new yV(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=wt.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??Lyt,_=e.undergroundColorAlphaByDistance??Wyt,S=o1e(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=Wn.castShadows(e.shadows)&&!m,G=Wn.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)),M=!1;if(g){let bt=h.magnitude(n.camera.positionWC),ht=e.nightFadeOutDistance;M=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,w=O.center,z=O.encoding,K=i.tileBoundingRegion,te=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,$=te!==1,ee=z.hasGeodeticSurfaceNormals,le=pyt,_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),xyt),jt=bt.project(re.northeast(t.rectangle),Tyt);if(le.x=ht.x,le.y=ht.y,le.z=jt.x,le.w=jt.y,n.mode!==se.MORPHING&&(w=yyt,w.x=0,w.y=(le.z+le.x)*.5,w.z=(le.w+le.y)*.5,le.x-=w.y,le.y-=w.z,le.z-=w.y,le.w-=w.z),n.mode===se.SCENE2D&&z.quantization===Ka.BITS12){let st=1/(Math.pow(2,12)-1)*.5,pt=(le.z-le.x)*st,Mi=(le.w-le.y)*st;le.x-=pt,le.y-=Mi,le.z+=pt,le.w+=Mi}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=Gyt;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=M,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)||v3(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let ht=0;ht<bt;++ht)e._uniformMaps[ht]=t1e(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 me,ht.orientedBoundingBox=void 0,jt=t1e(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)?r1e(Ps,U.RED).update(n):l($a)&&s1e($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,Mi=d?p:b;l(pt)&&(ce.fromElements(pt.near,pt.nearValue,pt.far,pt.farValue,st.frontFaceAlphaByDistance),ce.fromElements(Mi.near,Mi.nearValue,Mi.far,Mi.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(w,st.rtc),ce.clone(le,st.tileRectangle),st.southAndNorthLatitude.x=_e,st.southAndNorthLatitude.y=he,st.southMercatorYAndOneOverHeight.x=Ze,st.southMercatorYAndOneOverHeight.y=ye;let Si=byt,Hi=W3(t.rectangle,e.cartographicLimitRectangle),Gi=gyt,pi=W3(t.rectangle,f);h.fromElements(v,X,Y,st.hsbShift);let Zi=t.rectangle,On=1/Zi.width,rn=1/Zi.height;Si.x=(Hi.west-Zi.west)*On,Si.y=(Hi.south-Zi.south)*rn,Si.z=(Hi.east-Zi.west)*On,Si.w=(Hi.north-Zi.south)*rn,ce.clone(Si,st.localizedCartographicLimitRectangle),Gi.x=(pi.west-Zi.west)*On,Gi.y=(pi.south-Zi.south)*rn,Gi.z=(pi.east-Zi.west)*On,Gi.w=(pi.north-Zi.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,yi=!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 BT=Ps.useWebMercatorT?$a.textureWebMercator:$a.texture,si=$a.imageryLayer;l(Ps.textureTranslationAndScale)||(Ps.textureTranslationAndScale=si._calculateTextureTranslationAndScale(t,Ps)),st.dayTextures[bt]=BT,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,yi=yi||st.dayTextureNightAlpha[bt]!==1,st.dayTextureDayAlpha[bt]=si.dayAlpha,yi=yi||st.dayTextureDayAlpha[bt]!==1,st.dayTextureBrightness[bt]=si.brightness,$i=$i||st.dayTextureBrightness[bt]!==Cs.DEFAULT_BRIGHTNESS,st.dayTextureContrast[bt]=si.contrast,Po=Po||st.dayTextureContrast[bt]!==Cs.DEFAULT_CONTRAST,st.dayTextureHue[bt]=si.hue,hr=hr||st.dayTextureHue[bt]!==Cs.DEFAULT_HUE,st.dayTextureSaturation[bt]=si.saturation,Is=Is||st.dayTextureSaturation[bt]!==Cs.DEFAULT_SATURATION,st.dayTextureOneOverGamma[bt]=1/si.gamma,Hs=Hs||st.dayTextureOneOverGamma[bt]!==1/Cs.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=W3(Zi,si.cutoutRectangle),yp=re.simpleIntersection(va,Zi,i1e);mo=l(yp)||mo,qo.x=(va.west-Zi.west)*On,qo.y=(va.south-Zi.south)*rn,qo.z=(va.east-Zi.west)*On,qo.w=(va.north-Zi.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,Ty=va.length;yp<Ty;++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 Mn=e._clippingPlanes,Ki=l(Mn)&&Mn.enabled&&t.isClipped;Ki&&(st.clippingPlanesEdgeColor=U.clone(Mn.edgeColor,st.clippingPlanesEdgeColor),st.clippingPlanesEdgeWidth=Mn.edgeWidth);let wi=i.vectorData;l(wi)&&(st.vectorSegmentTexture=wi.polylineSegmentTexture,st.vectorWidthTexture=wi.widthTexture,st.vectorColorTexture=wi.colorTexture,st.vectorPickColorTexture=wi.pickColorTexture,st.vectorSegmentPrimitiveIndicesTexture=wi.polylineSegmentPrimitiveIndicesTexture,st.vectorGridCellIndicesTexture=wi.polylineGridCellIndicesTexture,st.vectorPolygonEdgeTexture=wi.polygonEdgeTexture,st.vectorPolygonEdgePrimitiveIndicesTexture=wi.polygonEdgePrimitiveIndicesTexture,st.vectorPolygonGridCellIndicesTexture=wi.polygonGridCellIndicesTexture,k.clone(wi.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,pm=(Xo?.polygonRings.length??0)>0,bp=l(Dc)&&Dc.enabled&&Dc.length>0&&t.isClipped&±Ae.numberOfDayTextures=bt,Ae.applyBrightness=$i,Ae.applyContrast=Po,Ae.applyHue=hr,Ae.applySaturation=Is,Ae.applyGamma=Hs,Ae.applyAlpha=or,Ae.applyDayNightAlpha=yi,Ae.applySplit=fr,Ae.enableFog=Hn,Ae.enableClippingPlanes=Ki,Ae.clippingPlanes=Mn,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&&(Vyt(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?(me.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&&me.union(K.boundingSphere,ua,ua)):(ht.boundingVolume=me.clone(K.boundingSphere,ua),ht.orientedBoundingBox=nn.clone(K.boundingVolume,gp)),ht.dirty=!0,m&&u.updateDerivedCommands(ht,n),n1e(ht,n),ct=Ke,Et=Ayt}while(tt<Be)}var YY=jee;var XFi=x(T(),1);function a1e(){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(a1e.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 MY=a1e;var bIi=x(T(),1);var wFi=x(T(),1);var Qee=class{constructor(t){this._ellipsoid=new Rf(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},wY=Qee;var HFi=x(T(),1);var qee=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()}},Fyt=1e3,$ee=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=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new qee(Fyt),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),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 Pyt(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];if(!l(r))continue;i.add(r);let s=c1e(this,r.positionCartographic);r._pendingAddTile=s,r._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(r)}this._addedCustomData.length=0;for(let o=0;o<n.length;++o){let r=n[o];if(!l(r))continue;i.has(r)&&i.delete(r);let s=c1e(this,r.positionCartographic);if(r._pendingAddTile===s&&s._addedCustomData[r._pendingAddIndex]===r){s._addedCustomData[r._pendingAddIndex]=void 0,r._pendingAddTile=void 0;continue}s._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<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 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=Ja.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),F3(this._southwestChild),this._southwestChild=void 0,F3(this._southeastChild),this._southeastChild=void 0,F3(this._northwestChild),this._northwestChild=void 0,F3(this._northeastChild),this._northeastChild=void 0}},Iyt=256;function Pyt(e,t,n,i){let o=n.width/Iyt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}var Xyt=new pe;function c1e(e,t){let n=e.northwestChild.rectangle,i=re.southeast(n,Xyt),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 F3(e){l(e)&&e.freeResources()}var kY=$ee;var jFi=x(T(),1);function I3(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}I3.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};I3.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(),l1e(this,t)),t=i}};function l1e(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}I3.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))&&l1e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var UY=I3;function sh(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 UY,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 wY({ellipsoid:n}),this._tileLoadProgressEvent=new Se,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(sh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});sh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Nyt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,u1e(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()}sh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ja.START&&e(t),t=t.replacementNext};sh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};sh.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};sh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function u1e(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}sh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Nyt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),u1e(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};sh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),kyt(this,e),Qyt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Yyt(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))}sh.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||(Hyt(this,e),jyt(this,e),Yyt(this,e))};sh.prototype.isDestroyed=function(){return!1};sh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var OY,d1e=new pe;function Myt(e,t){let n=re.center(e.rectangle,d1e),i=n.longitude-OY.longitude,o=n.latitude-OY.latitude;n=re.center(t.rectangle,d1e);let r=n.longitude-OY.longitude,s=n.latitude-OY.latitude;return i*i+o*o-(r*r+s*s)}var wyt=new h,DY=[];function kyt(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=kY.createLevelZeroTiles(p);let b=e._levelZeroTiles.length;if(DY.length<b){DY=new Array(b);for(let f=0;f<b;++f)DY[f]===void 0&&(DY[f]=new BY)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;OY=t.camera.positionCartographic,r.sort(Myt);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,wyt);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?Yc(e,p,o,t,s,!1,DY[m]):(gg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function gg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function BY(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function m1e(){this.southwest=new BY,this.southeast=new BY,this.northwest=new BY,this.northeast=new BY}m1e.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 tte=new Array(31);for(let e=0;e<tte.length;++e)tte[e]=new m1e;function Uyt(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=Byt(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:gi.NONE,b=e.tileProvider;if(s||i){let f=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,_=n.state===Ja.DONE,S=f||y||_;if(S||l(b.canRenderWithoutLosingDetail)&&(S=b.canRenderWithoutLosingDetail(n)),S){s&&gg(e,e._tileLoadQueueMedium,n,t),P3(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&gg(e,e._tileLoadQueueHigh,n,t)}if(b.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){P3(e,n),gg(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===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,_=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,Z=e._tileLoadQueueHigh.length,R=e._tileToUpdateHeights.length;if(Dyt(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!==gi.KICKED&&g!==n;)g._lastSelectionResult=gi.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=R,P3(e,n),n._lastSelectionResult=gi.RENDERED;let I=p===gi.RENDERED;!I&&A>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=Z,gg(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&&gg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,P3(e,n),gg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Dyt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=tte[t.level],p=m.southwest,b=m.southeast,f=m.northwest,y=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Yc(e,t,d,r,u,s,p),Yc(e,n,d,r,u,s,b),Yc(e,i,d,r,u,s,f),Yc(e,o,d,r,u,s,y)):(Yc(e,i,d,r,u,s,f),Yc(e,t,d,r,u,s,p),Yc(e,o,d,r,u,s,y),Yc(e,n,d,r,u,s,b)):c.latitude<t.rectangle.north?(Yc(e,n,d,r,u,s,b),Yc(e,t,d,r,u,s,p),Yc(e,o,d,r,u,s,y),Yc(e,i,d,r,u,s,f)):(Yc(e,o,d,r,u,s,y),Yc(e,i,d,r,u,s,f),Yc(e,n,d,r,u,s,b),Yc(e,t,d,r,u,s,p)),m.combine(a)}function Oyt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&re.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&re.contains(n,e._cameraReferenceFrameOriginCartographic)}function Yc(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Kr.NONE)return Uyt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Oyt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&gg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(gg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Byt(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof bn||t.camera.frustum instanceof gs)return zyt(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 zyt(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 P3(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function Hyt(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=ete(e,t,s,r,n,!1);a=ete(e,t,s,r,i,a),ete(e,t,s,r,o,a)}function Kyt(e,t){return e._loadPriority-t._loadPriority}function ete(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Kyt);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 xV=new gn,X3=new pe,Yx=new h,Jyt=[];function jyt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Jyt;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:gi.NONE;(_===gi.RENDERED||_===gi.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,xV.direction),A=d.getSurfaceNormalIntersectionWithZAxis(_.positionOnEllipsoidSurface,11500,xV.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,Yx);h.subtract(_.positionOnEllipsoidSurface,I,xV.origin)}}else pe.clone(_.positionCartographic,X3),X3.height=-11500,c.project(X3,Yx),h.fromElements(Yx.z,Yx.x,Yx.y,Yx),h.clone(Yx,xV.origin),h.clone(h.UNIT_X,xV.direction);R=m.data.pick(xV,a,c,!1,Yx),l(R)&&m.setPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError,h.clone(R))}if(l(R)){if(l(_.callback)){let E=d.cartesianToCartographic(R,X3);_.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 Qyt(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 zY=sh;function Cf(e){e=e??ne.default;let t=new u0({ellipsoid:e}),n=new LS,i=new jb({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new XY,this._material=void 0,this._surface=new zY({tileProvider:new YY({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 MY,ite(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=Wn.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(Cf.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)&&ite(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,ite(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 ite(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[nf,pV];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(IY),e._surfaceShaderSet.baseVertexShaderSource=new Je({sources:[nf,pV,PY],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Je({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function qyt(e){return function(t,n){let i=me.distanceSquaredTo(t.pickBoundingSphere,e),o=me.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var $yt=[],ext={start:0,stop:0};Cf.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=$yt;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=me.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))me.clone(u.tileBoundingRegion.boundingSphere,m);else continue;let p=Ti.raySphere(e,m,ext);l(p)&&s.push(u)}s.sort(qyt(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 txt=new pe;Cf.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,txt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var nxt=new h,h1e=new h,ixt=new pe,oxt=new gn;function nte(e,t){return l(e)&&re.contains(e.rectangle,t)?e:void 0}Cf.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=nte(n._southwestChild,e)||nte(n._southeastChild,e)||nte(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,nxt),d=oxt,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,h1e);h.subtract(c,y,d.origin)}let p=n.data.pick(d,se.SCENE3D,s,!1,h1e);if(l(p))return a.cartesianToCartographic(p,ixt).height};Cf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Cf.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))};Cf.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Cf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Cf.prototype.isDestroyed=function(){return!1};Cf.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 HY=Cf;var pPi=x(T(),1);var jIi=x(T(),1),qd=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;var qIi=x(T(),1),Mx=`uniform highp sampler2D u_depthTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function h0(){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(h0.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 f1e(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:ei.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ei.NEVER,reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Mx,{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(qd,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Mx,{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(qd,{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}h0.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),f1e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};h0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};h0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};h0.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),f1e(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};h0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};h0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};h0.prototype.isDestroyed=function(){return!1};h0.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 KY=h0;var VPi=x(T(),1);function jS(){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(jS.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 rxt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function sxt(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 axt(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(Mx,{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}jS.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;sxt(this,n,o,r,e),axt(this,n,o,r,i),this._useHdr=e};jS.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};jS.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};jS.prototype.isDestroyed=function(){return!1};jS.prototype.destroy=function(){return rxt(this),ue(this)};var JY=jS;var MPi=x(T(),1);var hc={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},QS=hc.DERIVED_COMMANDS_MAXIMUM_LENGTH,R1e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function qS(){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(QS),this._derivedBlendCommandTypes=new Array(QS),this._derivedPickCommandTypes=new Array(QS),this._derivedCommandTypesToUpdate=new Array(QS),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(qS.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}}});qS.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=p1e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=p1e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=b1e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=b1e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=uxt(this,e,t),this._sunVisibleThroughGlobe=cxt(this,e),this._environmentVisible=lxt(this,e),this._useDepthPlane=dxt(this,e),this._numberOfTextureUniforms=mxt(this),this._rectangle=re.clone(t.translucency.rectangle,this._rectangle),hxt(this,e)};function p1e(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 b1e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function cxt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function lxt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function dxt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function uxt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function mxt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function hxt(e,t){e._derivedCommandsLength=ote(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=ote(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=ote(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<QS;++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=Axt())}function ote(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?hc.PICK_FRONT_FACE:d?hc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:hc.TRANSLUCENT_FRONT_FACE,m=i?hc.PICK_BACK_FACE:d?hc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:hc.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=hc.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=hc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=hc.DEPTH_ONLY_BACK_FACE),o[r++]=hc.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=hc.DEPTH_ONLY_FRONT_FACE),o[r++]=hc.OPAQUE_BACK_FACE,o[r++]=u),r)}function ah(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function g1e(e,t){return e.indexOf(t)>-1}function fxt(e,t){ah(e.defines,"TRANSLUCENT"),ah(t.defines,"TRANSLUCENT")}function pxt(e,t){ah(e.defines,"GROUND_ATMOSPHERE"),ah(t.defines,"GROUND_ATMOSPHERE"),ah(e.defines,"FOG"),ah(t.defines,"FOG"),ah(e.defines,"TRANSLUCENT"),ah(t.defines,"TRANSLUCENT")}function rte(e,t){if(g1e(t.defines,"TILE_LIMIT_RECTANGLE")||g1e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function ste(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 C1e(e,t){ste(e,t),ah(e.defines,"GROUND_ATMOSPHERE"),ah(t.defines,"GROUND_ATMOSPHERE"),ah(e.defines,"FOG"),ah(t.defines,"FOG")}function bxt(e,t){ste(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function gxt(e,t){C1e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function y1e(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 yxt(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 xxt(e){e.cull.face=ki.BACK,e.cull.enabled=!0}function Txt(e){e.cull.face=ki.FRONT,e.cull.enabled=!0}function _xt(e){e.cull.face=ki.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Sxt(e){e.cull.face=ki.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Zxt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function x1e(e){e.cull.face=ki.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function T1e(e){e.cull.face=ki.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function Rxt(e){e.cull.face=ki.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Cxt(e){e.cull.face=ki.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Vxt(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 TV(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Ext(e,t,n,i,o){return l(o)?!i&&l(n)?n:It(t,o(e),!1):t}function Vf(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Axt(){return[new Vf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:fxt,getRenderStateFunction:xxt,getUniformMapFunction:void 0}),new Vf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:pxt,getRenderStateFunction:Txt,getUniformMapFunction:void 0}),new Vf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:rte,getRenderStateFunction:_xt,getUniformMapFunction:void 0}),new Vf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:rte,getRenderStateFunction:Sxt,getUniformMapFunction:void 0}),new Vf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:rte,getRenderStateFunction:Zxt,getUniformMapFunction:void 0}),new Vf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ste,getRenderStateFunction:x1e,getUniformMapFunction:TV}),new Vf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:C1e,getRenderStateFunction:T1e,getUniformMapFunction:TV}),new Vf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:bxt,getRenderStateFunction:x1e,getUniformMapFunction:TV}),new Vf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:gxt,getRenderStateFunction:T1e,getUniformMapFunction:TV}),new Vf({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:y1e,getRenderStateFunction:Rxt,getUniformMapFunction:TV}),new Vf({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:y1e,getRenderStateFunction:Cxt,getUniformMapFunction:TV})]}var _1e=new Array(QS),S1e=new Array(QS);qS.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)S1e[o]=this._derivedCommandPacks[n[o]],_1e[o]=R1e[n[o]];Gxt(this,e,i,n,_1e,S1e,t)}};function Gxt(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=Ext(e,t.uniformMap,E,g,S.getUniformMapFunction),C.shaderProgram=yxt(s.context,t.shaderProgram,A,V,S.getShaderProgramFunction,R),C.renderState=Vxt(t.renderState,L,G,S.getRenderStateFunction,S.renderStateCache)}}}qS.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=R1e[o[a]];n.commandList.push(s[c])}};function V1e(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 Z1e(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Lxt=[hc.OPAQUE_FRONT_FACE,hc.OPAQUE_BACK_FACE],Wxt=[hc.DEPTH_ONLY_FRONT_FACE,hc.DEPTH_ONLY_BACK_FACE,hc.DEPTH_ONLY_FRONT_AND_BACK_FACE];qS.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),V1e(s,a,t,i,o,Lxt))};qS.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)&&Z1e(d,u,t,i,o),!m&&!p)return;this._globeTranslucencyFramebuffer=n;let b=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,V1e(a,c,t,i,o,Wxt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}Z1e(d,u,t,i,o),s.globeDepthTexture=b,o.framebuffer=f};var jY=qS;var ZXi=x(T(),1);var UPi=x(T(),1);var vxt=1953029805,Fxt=2917034100;function ate(e,t){if(ate.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===vxt||o===Fxt)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++}ate.passThroughDataForTesting=!1;var QY=ate;var lXi=x(T(),1),Mxt=x(cte(),1);var jPi=x(T(),1);var zPi=x(T(),1);function Ixt(e,t){return(e&t)!==0}var pl=Ixt;var Pxt=[1,2,4,8],E1e=15,Xxt=16,Nxt=64,Yxt=128;function f0(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}f0.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 f0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};f0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};f0.prototype.hasSubtree=function(){return pl(this._bits,Xxt)};f0.prototype.hasImagery=function(){return pl(this._bits,Nxt)};f0.prototype.hasTerrain=function(){return pl(this._bits,Yxt)};f0.prototype.hasChildren=function(){return pl(this._bits,E1e)};f0.prototype.hasChild=function(e){return pl(this._bits,Pxt[e])};f0.prototype.getChildBitmask=function(){return this._bits&E1e};var $Y=f0;function wxt(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 kxt=wxt(`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_\x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E2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\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 Hu(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(Hu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Hu.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 Hu;i._resource=n;try{await Uxt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${G1e(i,"",1).url}: ${o}`;throw new ae(r)}return i};Hu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;pl(t,r)?pl(e,r)&&(s|=1):(s|=2,pl(e,r)||(s|=1)),i+=s}return i};Hu.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];pl(s,2)?pl(s,1)||(t|=r):(n|=r,pl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Hu.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 A1e=new Qn("decodeGoogleEarthEnterprisePacket");Hu.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=G1e(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return A1e.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=$Y.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}})})};Hu.prototype.populateSubtree=function(e,t,n,i){let o=Hu.tileXYToQuadKey(e,t,n);return ute(this,o,i)};function ute(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}),ute(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}),ute(e,t,s)}).finally(function(){delete a[o]})}Hu.prototype.getTileInformation=function(e,t,n){let i=Hu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Hu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function G1e(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var lte,dte;function Uxt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(dte)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;dte=e_(n).then(function(){lte=window.cesiumGoogleEarthDbRootParser(Mxt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return dte.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=lte.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 A1e.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=lte.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=kxt})}var yg=Hu;var L1e=x(cte(),1);function mte(){this._image=new Image}mte.prototype.isReady=function(){return!0};mte.prototype.shouldDiscardImage=function(e){return e===this._image};function $S(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 eo({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 mte),this._errorEvent=new Se}Object.defineProperties($S.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}}});$S.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new $S(t);return n._metadata=e,n};$S.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]}};$S.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=yg.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=Dxt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){QY(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=Oxt(u)),!l(m)&&(!l(p)||p)){let b=Bxt(u);m=b.imageType,u=b.imageData}return!l(m)||!l(u)?o:Ab({uint8Array:u,format:m,flipY:!0})})};$S.prototype.pickFeatures=function(e,t,n,i,o){};function Dxt(e,t,n,i,o,r){let s=yg.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 Oxt(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 Bxt(e){let t=L1e.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 hte=$S;var YXi=x(T(),1);var zxt=600;function p0(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??zxt}Object.defineProperties(p0.prototype,{});p0.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 MS({sources:{positiveX:d,negativeX:u,positiveY:m,negativeY:p,positiveZ:b,negativeZ:f},transform:_,credit:s})};p0.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}};p0.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};p0.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}`)}};p0.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};p0.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 p0({...e})};p0._parseMetadata=function(e){return{cartographic:pe.fromDegrees(e.location.lng,e.location.lat,0)}};var fte=p0;var BXi=x(T(),1);var Hxt=new U(1,1,1,.4),Kxt=new U(0,1,0,.05),Jxt=new U(0,.5,0,.2);function eZ(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 eo({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??Hxt,this._glowColor=e.glowColor??Kxt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??Jxt,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(eZ.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}}});eZ.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()};eZ.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};eZ.prototype.getTileCredits=function(e,t,n){};eZ.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};eZ.prototype.pickFeatures=function(e,t,n,i,o){};var pte=eZ;var mYi=x(T(),1);var bNi=x(T(),1);var Zte=[Ui,xi],jxt=Zte.length,j1e=Math.cos(W.toRadians(30)),W1e=Math.cos(W.toRadians(150)),Q1e=0,q1e=1e3;function kx(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??mn.GEODESIC,this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(kx.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});kx.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<jxt;i++)if(t instanceof Zte[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var Qxt=new h,v1e=new h,F1e=new h;function Ste(e,t,n,i,o){let r=nd(i,e,0,Qxt),s=nd(i,e,n,v1e),a=nd(i,t,0,F1e),c=xg(s,r,v1e),d=xg(a,r,F1e);return h.cross(d,c,o),h.normalize(o,o)}var qxt=new pe,$xt=new h,eTt=new h,tTt=new h;function bte(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let m;r===mn.GEODESIC?m=new _b(e,t,s):r===mn.RHUMB&&(m=new Gc(e,t,s));let p=m.surfaceDistance;if(p<o)return;let b=Ste(e,t,i,s,tTt),f=Math.ceil(p/o),y=p/f,_=y,S=f-1,Z=a.length;for(let R=0;R<S;R++){let C=m.interpolateUsingSurfaceDistance(_,qxt),E=nd(s,C,n,$xt),A=nd(s,C,i,eTt);h.pack(b,a,Z),h.pack(E,c,Z),h.pack(A,d,Z),u.push(C.latitude),u.push(C.longitude),Z+=3,_+=y}}var gte=new pe;function nd(e,t,n,i){return pe.clone(t,gte),gte.height=n,pe.toCartesian(gte,e,i)}kx.pack=function(e,t,n){let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ne.pack(e._ellipsoid,t,i),i+=ne.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};kx.unpack=function(e,t,n){let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],d=ne.unpack(e,i);i+=ne.packedLength;let u=e[i++],m=e[i]===1;return l(n)||(n=new kx({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=m,n};function xg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function I1e(e,t,n,i){return i=xg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var nTt=new h,iTt=new h,oTt=new h,$1e=new h,rTt=0,sTt=-1;function yte(e,t,n,i,o){let r=xg(n,t,$1e),s=I1e(e,t,r,nTt),a=I1e(i,t,r,iTt);if(W.equalsEpsilon(h.dot(s,a),sTt,W.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,oTt);return h.dot(a,c)<rTt&&(o=h.negate(o,o)),o}var w3=cn.fromPointNormal(h.ZERO,h.UNIT_Y),aTt=new h,cTt=new h,lTt=new h,dTt=new h,uTt=new h,N3=new h,Y3=new pe,P1e=new pe,X1e=new pe;kx.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new Zte[e._projectionIndex](i),a=Q1e,c=q1e,d,u,m=e._positions,p=m.length;p===2&&(n=!1);let b,f,y,_,S=new Gc(void 0,void 0,i),Z,R,C,E=[m[0]];for(u=0;u<p-1;u++)b=m[u],f=m[u+1],Z=Ti.lineSegmentPlane(b,f,w3,N3),l(Z)&&!h.equalsEpsilon(Z,b,W.EPSILON7)&&!h.equalsEpsilon(Z,f,W.EPSILON7)&&(e.arcType===mn.GEODESIC?E.push(h.clone(Z)):e.arcType===mn.RHUMB&&(C=i.cartesianToCartographic(Z,Y3).longitude,y=i.cartesianToCartographic(b,Y3),_=i.cartesianToCartographic(f,P1e),S.setEndPoints(y,_),R=S.findIntersectionWithLongitude(C,X1e),Z=i.cartographicToCartesian(R,N3),l(Z)&&!h.equalsEpsilon(Z,b,W.EPSILON7)&&!h.equalsEpsilon(Z,f,W.EPSILON7)&&E.push(h.clone(Z)))),E.push(f);n&&(b=m[p-1],f=m[0],Z=Ti.lineSegmentPlane(b,f,w3,N3),l(Z)&&!h.equalsEpsilon(Z,b,W.EPSILON7)&&!h.equalsEpsilon(Z,f,W.EPSILON7)&&(e.arcType===mn.GEODESIC?E.push(h.clone(Z)):e.arcType===mn.RHUMB&&(C=i.cartesianToCartographic(Z,Y3).longitude,y=i.cartesianToCartographic(b,Y3),_=i.cartesianToCartographic(f,P1e),S.setEndPoints(y,_),R=S.findIntersectionWithLongitude(C,X1e),Z=i.cartographicToCartesian(R,N3),l(Z)&&!h.equalsEpsilon(Z,b,W.EPSILON7)&&!h.equalsEpsilon(Z,f,W.EPSILON7)&&E.push(h.clone(Z)))));let A=E.length,L=new Array(A);for(u=0;u<A;u++){let K=pe.fromCartesian(E[u],i);K.height=0,L[u]=K}if(L=Mo(L,pe.equalsEpsilon),A=L.length,A<2)return;let F=[],I=[],N=[],g=[],V=aTt,G=cTt,v=lTt,X=dTt,Y=uTt,D=L[0],M=L[1],O=L[A-1];for(V=nd(i,O,a,V),X=nd(i,M,a,X),G=nd(i,D,a,G),v=nd(i,D,c,v),n?Y=yte(V,G,v,X,Y):Y=Ste(D,M,c,i,Y),h.pack(Y,I,0),h.pack(G,N,0),h.pack(v,g,0),F.push(D.latitude),F.push(D.longitude),bte(D,M,a,c,o,r,i,I,N,g,F),u=1;u<A-1;++u){V=h.clone(G,V),G=h.clone(X,G);let K=L[u];nd(i,K,c,v),nd(i,L[u+1],a,X),yte(V,G,v,X,Y),d=I.length,h.pack(Y,I,d),h.pack(G,N,d),h.pack(v,g,d),F.push(K.latitude),F.push(K.longitude),bte(L[u],L[u+1],a,c,o,r,i,I,N,g,F)}let w=L[A-1],z=L[A-2];if(G=nd(i,w,a,G),v=nd(i,w,c,v),n){let K=L[0];V=nd(i,z,a,V),X=nd(i,K,a,X),Y=yte(V,G,v,X,Y)}else Y=Ste(z,w,c,i,Y);if(d=I.length,h.pack(Y,I,d),h.pack(G,N,d),h.pack(v,g,d),F.push(w.latitude),F.push(w.longitude),n){for(bte(w,D,a,c,o,r,i,I,N,g,F),d=I.length,u=0;u<3;++u)I[d+u]=I[u],N[d+u]=N[u],g[d+u]=g[u];F.push(D.latitude),F.push(D.longitude)}return NTt(n,s,N,g,I,F,t)};var mTt=new h,hTt=new q,fTt=new Ne;function N1e(e,t,n,i){let o=xg(n,t,mTt),r=h.dot(o,e);if(r>j1e||r<W1e){let s=xg(i,n,$1e),a=r<W1e?W.PI_OVER_TWO:-W.PI_OVER_TWO,c=Ne.fromAxisAngle(s,a,fTt),d=q.fromQuaternion(c,hTt);return q.multiplyByVector(d,e,e),!0}return!1}var Y1e=new pe,pTt=new h,M1e=new h;function eM(e,t,n,i,o){let r=pe.toCartesian(t,e._ellipsoid,pTt),s=h.add(r,n,M1e),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,Y1e);Math.abs(t.longitude-d.longitude)>W.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,M1e),d=c.cartesianToCartographic(s,Y1e)),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 bTt=new h,w1e=new h;function k1e(e,t,n,i,o,r){let s=h.subtract(t,e,bTt);h.normalize(s,s);let a=n-Q1e,c=h.multiplyByScalar(s,a,w1e);h.add(e,c,o);let d=i-q1e;c=h.multiplyByScalar(s,d,w1e),h.add(t,c,r)}var gTt=new h;function M3(e,t){let n=cn.getPointDistance(w3,e),i=cn.getPointDistance(w3,t),o=gTt;W.equalsEpsilon(n,0,W.EPSILON2)?(o=xg(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=xg(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function yTt(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 eCe=new pe,tCe=new pe,U1e=new h,xte=new h,D1e=new h,O1e=new h,xTt=new h,B1e=new h,TTt=[eCe,tCe],_Tt=new re,STt=new h,ZTt=new h,RTt=new h,CTt=new h,VTt=new h,ETt=new h,Tte=new h,_te=new h,ATt=new h,GTt=new h,LTt=new h,z1e=new h,WTt=new h,vTt=new h,FTt=new An,ITt=new An,H1e=new h,PTt=new h,K1e=new h,XTt=[new me,new me],nCe=[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],J1e=nCe.length;function NTt(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=eCe;g.height=0;let V=tCe;V.height=0;let G=U1e,v=xte;if(s)for(c=0,a=1;a<I;a++)g.latitude=r[c],g.longitude=r[c+1],V.latitude=r[c+2],V.longitude=r[c+3],G=t.project(g,G),v=t.project(V,v),N+=h.distance(G,v),c+=2;let X=i.length/3;v=h.unpack(i,0,v);let Y=0;for(c=3,a=1;a<X;a++)G=h.clone(v,G),v=h.unpack(i,c,v),Y+=h.distance(G,v),c+=3;let D;c=3;let M=0,O=0,w=0,z=0,K=!1,te=h.unpack(n,0,O1e),H=h.unpack(i,0,xte),$=h.unpack(o,0,B1e);if(e){let Ae=h.unpack(n,n.length-6,D1e);N1e($,Ae,te,H)&&($=h.negate($,$))}let ee=0,le=0,_e=0;for(a=0;a<u;a++){let Ae=h.clone(te,D1e),Fe=h.clone(H,U1e),tt=h.clone($,xTt);K&&(tt=h.negate(tt,tt)),te=h.unpack(n,c,O1e),H=h.unpack(i,c,xte),$=h.unpack(o,c,B1e),K=N1e($,Ae,te,H),g.latitude=r[M],g.longitude=r[M+1],V.latitude=r[M+2],V.longitude=r[M+3];let Be,je,qe,We;if(s){let yi=yTt(g,V);Be=t.project(g,VTt),je=t.project(V,ETt);let fr=xg(je,Be,H1e);fr.y=Math.abs(fr.y),qe=Tte,We=_te,yi===0||h.dot(fr,h.UNIT_Y)>j1e?(qe=eM(t,g,tt,Be,Tte),We=eM(t,V,$,je,_te)):yi===1?(We=eM(t,V,$,je,_te),qe.x=0,qe.y=W.sign(g.longitude-Math.abs(V.longitude)),qe.z=0):(qe=eM(t,g,tt,Be,Tte),We.x=0,We.y=W.sign(g.longitude-V.longitude),We.z=0)}let Ke=h.distance(Fe,H),ct=An.fromCartesian(Ae,FTt),Et=h.subtract(te,Ae,ATt),zt=h.normalize(Et,z1e),ut=h.subtract(Fe,Ae,GTt);ut=h.normalize(ut,ut);let bt=h.cross(zt,ut,z1e);bt=h.normalize(bt,bt);let ht=h.cross(ut,tt,WTt);ht=h.normalize(ht,ht);let jt=h.subtract(H,te,LTt);jt=h.normalize(jt,jt);let st=h.cross($,jt,vTt);st=h.normalize(st,st);let pt=Ke/Y,Mi=ee/Y,jn=0,Si,Hi,Gi,pi=0,Zi=0;if(s){jn=h.distance(Be,je),Si=An.fromCartesian(Be,ITt),Hi=h.subtract(je,Be,H1e),Gi=h.normalize(Hi,PTt);let yi=Gi.x;Gi.x=Gi.y,Gi.y=-yi,pi=jn/N,Zi=le/N}for(D=0;D<8;D++){let yi=z+D*4,fr=O+D*2,mo=yi+3,Qr=D<4?1:-1,Mn=D===2||D===3||D===6||D===7?1:-1;h.pack(ct.high,_,yi),_[mo]=Et.x,h.pack(ct.low,S,yi),S[mo]=Et.y,h.pack(ht,Z,yi),Z[mo]=Et.z,h.pack(st,R,yi),R[mo]=pt*Qr,h.pack(bt,C,yi);let Ki=Mi*Mn;Ki===0&&Mn<0&&(Ki=9),C[mo]=Ki,s&&(E[yi]=Si.high.x,E[yi+1]=Si.high.y,E[yi+2]=Si.low.x,E[yi+3]=Si.low.y,L[yi]=-qe.y,L[yi+1]=qe.x,L[yi+2]=We.y,L[yi+3]=-We.x,A[yi]=Hi.x,A[yi+1]=Hi.y,A[yi+2]=Gi.x,A[yi+3]=Gi.y,F[fr]=pi*Qr,Ki=Zi*Mn,Ki===0&&Mn<0&&(Ki=9),F[fr+1]=Ki)}let On=RTt,rn=CTt,Hn=STt,$i=ZTt,Po=re.fromCartographicArray(TTt,_Tt),hr=Xi.getMinimumMaximumHeights(Po,d),Is=hr.minimumTerrainHeight,Hs=hr.maximumTerrainHeight;_e+=Math.abs(Is),_e+=Math.abs(Hs),k1e(Ae,Fe,Is,Hs,On,Hn),k1e(te,H,Is,Hs,rn,$i);let or=h.multiplyByScalar(bt,W.EPSILON5,K1e);h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),M3(On,rn),M3(Hn,$i),h.pack(On,y,w),h.pack(rn,y,w+3),h.pack($i,y,w+6),h.pack(Hn,y,w+9),or=h.multiplyByScalar(bt,-2*W.EPSILON5,K1e),h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),M3(On,rn),M3(Hn,$i),h.pack(On,y,w+12),h.pack(rn,y,w+15),h.pack($i,y,w+18),h.pack(Hn,y,w+21),M+=2,c+=3,O+=16,w+=24,z+=32,ee+=Ke,le+=jn}c=0;let he=0;for(a=0;a<u;a++){for(D=0;D<J1e;D++)f[c+D]=nCe[D]+he;he+=8,c+=J1e}let Ze=XTt;me.fromVertices(n,h.ZERO,3,Ze[0]),me.fromVertices(i,h.ZERO,3,Ze[1]);let ye=me.fromBoundingSpheres(Ze);ye.radius+=_e/(u*2);let Ge={position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:wx(_),startLoAndForwardOffsetY:wx(S),startNormalAndForwardOffsetZ:wx(Z),endNormalAndTextureCoordinateNormalizationX:wx(R),rightNormalAndTextureCoordinateNormalizationY:wx(C)};return s&&(Ge.startHiLo2D=wx(E),Ge.offsetAndRight2D=wx(A),Ge.startEndNormals2D=wx(L),Ge.texcoordNormalization2D=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,normalize:!1,values:F})),new At({attributes:Ge,indices:f,boundingSphere:ye})}function wx(e){return new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}kx._projectNormal=eM;var tZ=kx;var yNi=x(T(),1),tM=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +#else +positionWC = v_positionMC; +lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); +rayleighColor = v_atmosphereRayleighColor; +mieColor = v_atmosphereMieColor; +opacity = v_atmosphereOpacity; #endif -void main(void) -{ -float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); -if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -eyeCoordinate /= eyeCoordinate.w; -float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); -float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); -float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); -float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); -if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec3 alignedPlaneNormal; -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); -s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; -float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, t); -materialInput.str = vec3(s, t, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -out_FragColor.rgb *= out_FragColor.a; -czm_writeDepthClamp(); -} -`;var TNi=x(T(),1),nM=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +#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 -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; +finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); +#endif +finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); #endif -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { -return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -void main(void) +#endif +#ifdef UNDERGROUND_COLOR +if (czm_backFacing()) { -vec4 eyeCoordinate = gl_FragCoord; -eyeCoordinate /= eyeCoordinate.w; -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); -float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); -distanceFromStart = max(0.0, distanceFromStart); -distanceFromEnd = max(0.0, distanceFromEnd); -float s = distanceFromStart / (distanceFromStart + distanceFromEnd); -s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, v_texcoordT); -materialInput.str = vec3(s, v_texcoordT, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR +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 SNi=x(T(),1),iM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -in float batchId; -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; -#ifdef WIDTH_VARYING -out float v_width; #endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; +#ifdef HAS_VECTOR_LAYER +finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); +finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); #endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; +#ifdef TRANSLUCENT +if (inTranslucencyRectangle()) +{ +vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; +finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); +} +#endif +out_FragColor = finalColor; +} +#ifdef SHOW_REFLECTIVE_OCEAN +float waveFade(float edge0, float edge1, float x) +{ +float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +return pow(1.0 - y, 5.0); +} +float linearFade(float edge0, float edge1, float x) +{ +return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +} +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 -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; +vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); #endif -void main() +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); +} +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var JSo=x(T(),1),ik=`#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) { -v_batchId = batchId; -vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); -vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); -vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec4 startPlane2D; -vec4 startPlane3D; -startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); -startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); -vec4 rightPlane2D; -vec4 rightPlane3D; -rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); -rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); -posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); -posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); -posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); -vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); -vec4 endPlane2D; -vec4 endPlane3D; -endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); -endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); -v_forwardDirectionEC = normalize(endEC - startEC); -vec2 cleanTexcoordNormalization2D; -cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); -cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); -vec2 cleanTexcoordNormalization3D; -cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; -cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); -v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR -v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); -v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR -#ifdef WIDTH_VARYING -float width = czm_batchTable_width(batchId); -float halfWidth = width * 0.5; -v_width = width; -v_texcoordNormalizationAndHalfWidth.z = halfWidth; +return u_modifiedModelViewProjection * vec4(position, 1.0); +} +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); +} +return positionFraction; +} +float get2DGeographicYPositionFraction(vec2 textureCoordinates) +{ +return textureCoordinates.y; +} +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +{ +float yPositionFraction = get2DYPositionFraction(textureCoordinates); +vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); +return u_modifiedModelViewProjection * rtcPosition2D; +} +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, 0.0, textureCoordinates); +} +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, height, textureCoordinates); +} +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +{ +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; +} +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; +#endif +void main() +{ +#ifdef QUANTIZATION_BITS12 +vec2 xy = czm_decompressTextureCoordinates(compressed0.x); +vec2 zh = czm_decompressTextureCoordinates(compressed0.y); +vec3 position = vec3(xy, zh.x); +float height = zh.y; +vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); +height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; +position = (u_scaleAndBias * vec4(position, 1.0)).xyz; +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL) +float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; +float encodedNormal = compressed1; +#elif defined(INCLUDE_WEB_MERCATOR_Y) +float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; +float encodedNormal = 0.0; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) +float webMercatorT = textureCoordinates.y; +float encodedNormal = compressed0.w; #else -float halfWidth = 0.5 * czm_batchTable_width(batchId); -v_texcoordNormalizationAndHalfWidth.z = halfWidth; +float webMercatorT = textureCoordinates.y; +float encodedNormal = 0.0; #endif -vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); -float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); -vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); -geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc3D.xyz += geodeticSurfaceNormal; -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; -vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); -absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); -planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); -upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); -normalEC = normalize(cross(planeDirection, upOrDown)); -geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); -geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc2D.xyz += geodeticSurfaceNormal; -normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR -v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.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 -positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; -gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif -} -`;var RNi=x(T(),1),oM=`in vec3 position3DHigh; -in vec3 position3DLow; -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; +vec3 position3DWC = position + u_center3D; +#ifdef GEODETIC_SURFACE_NORMALS +vec3 ellipsoidNormal = geodeticSurfaceNormal; #else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; +vec3 ellipsoidNormal = normalize(position3DWC); #endif -in float batchId; -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef WIDTH_VARYING -out float v_width; +#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 -#ifdef ANGLE_VARYING -out float v_polylineAngle; +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 -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; +v_normalMC = normalMC; +v_normalEC = czm_normal3D * v_normalMC; #endif -void main() -{ -#ifdef COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; -vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); -vec3 ecEnd = forwardDirectionEC + ecStart; -forwardDirectionEC = normalize(forwardDirectionEC); -v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); -v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; -#else // COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; -vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); -vec3 ecEnd = ecStart + offset; -vec3 forwardDirectionEC = normalize(offset); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; -#endif // COLUMBUS_VIEW_2D -v_endEcAndStartEcX.xyz = ecEnd; -v_endEcAndStartEcX.w = ecStart.x; -v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR -vec4 positionRelativeToEye = czm_computePosition(); -vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; -float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); -vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -upOrDown = cross(forwardDirectionEC, normalEC); -upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; -upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; -upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; -positionEC.xyz += upOrDown; -v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); -float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING -v_width = width; +#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 -v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; -v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; -v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; -v_endPlaneNormalEcAndBatchId.w = batchId; -width = width * max(0.0, czm_metersPerPixel(positionEC)); -width = width / dot(normalEC, v_rightPlaneEC.xyz); -#ifdef COLUMBUS_VIEW_2D -normalEC *= sign(texcoordNormalization2D.x); +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; #else -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +vec3 atmosphereLightDirection = czm_lightDirectionWC; #endif -positionEC.xyz += width * normalEC; -gl_Position = czm_depthClamp(czm_projection * positionEC); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); +computeAtmosphereScattering( +position3DWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); +#endif +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); +#endif +#ifdef APPLY_MATERIAL +float northPoleZ = czm_ellipsoidRadii.z; +vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); +vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); +float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); +v_slope = acos(dotProd); +vec3 normalRejected = ellipsoidNormal * dotProd; +vec3 normalProjected = v_normalMC - normalRejected; +vec3 aspectVector = normalize(normalProjected); +v_aspect = acos(dot(aspectVector, vectorEastMC)); +float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); +v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); +v_height = height; #endif } -`;var XNi=x(T(),1);var VNi=x(T(),1),rM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +`;var QSo=x(T(),1),gA=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; +vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); +czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); +float atmosphereInnerRadius = length(positionWC); +computeScattering( +primaryRay, +length(cameraToPositionWC), +lightDirection, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +} +`;var sZo=x(T(),1);var Yse=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}},Mse=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,M=t.hasExaggeration,O=t.showUndergroundColor,w=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|+M<<29|+O<<30|+w<<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(bR(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")),w&&(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"),M&&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(Ob);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(MPt(je)),zt.sources.push(wPt(A));let ht=nn.fromCache({context:n.context,vertexShaderSource:zt,fragmentShaderSource:ut,attributeLocations:ye.getAttributeLocations()});ct=Et[qe]=new Yse(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 ue(this)}};function MPt(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 wPt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var ok=Mse;var l1o=x(T(),1);var NZo=x(T(),1);var cZo=x(T(),1),YIe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(YIe);var Qa=YIe;var dZo=x(T(),1),MIe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(MIe);var wo=MIe;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=wo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new me,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===wo.RECEIVING||t===wo.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=wo.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&&(kPt(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&&UPt(t,n,i,o,r,s,a),c)return;let u=t.renderable;t.renderable=l(d.vertexArray);let m=d.terrainState===wo.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){wIe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){wIe(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 wIe(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 kPt(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=wo.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function UPt(e,t,n,i,o,r,s){let a=e.data,c=e.parent;if(a.terrainState===wo.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===wo.FAILED&&DPt(a,e,t,n,e.x,e.y,e.level),a.terrainState===wo.UNLOADED&&OPt(a,n,e.x,e.y,e.level),a.terrainState===wo.RECEIVED&&zPt(a,t,n,e.x,e.y,e.level),a.terrainState===wo.TRANSFORMED&&(HPt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,r)),a.terrainState>=wo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)JPt(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 DPt(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=wo.RECEIVING,Promise.resolve(b).then(function(f){l(f)&&(e.terrainData=f,e.terrainState=wo.RECEIVED)}).catch(function(){e.terrainState=wo.FAILED}))}function OPt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=wo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ri.CANCELLED){e.terrainData=void 0,e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainState=wo.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=wo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=wo.UNLOADED,e.request=void 0)}a()}var BPt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function zPt(e,t,n,i,o,r){let s=n.tilingScheme,a=BPt;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=wo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=wo.TRANSFORMED}).catch(function(){e.terrainState=wo.FAILED}))}function HPt(e,t,n,i,o,r,s){e.vertexArray=Y0._createVertexArrayForMesh(t,e.mesh),e.terrainState=wo.READY,e.fill=e.fill&&e.fill.destroy(s)}function KPt(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 JPt(e,t){let n=t.terrainData.waterMask,i=KPt(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 cRo=x(T(),1);var wZo=x(T(),1),kIe={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>=kIe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=kIe;function xA(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}xA.prototype.update=function(e,t,n){this.changedThisFrame&&(KIe(e,t,this.tile,n),this.changedThisFrame=!1)};xA.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};xA.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Zh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var jPt=new cx;xA.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=jPt;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||gi.wasKicked(d._lastSelectionResult)||gi.originalResult(d._lastSelectionResult)===gi.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===gi.RENDERED){if(l(d.data.vertexArray))return;QPt(e,t,n,d,r,o,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.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 QPt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new xA(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),qPt(e,t,n,i,o,a)}function qPt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(KIe(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 gR=new pe,$Pt=new pe,yA=new h,Dse=new h,wse=new k,kse=new k,dm=new k;function DK(){this.height=0,this.encodedNormal=new k}function NK(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 JIe(e,t,n,i,d,c),c}var eXt={minimumHeight:0,maximumHeight:0},tXt=new h,UIe=new DK,DIe=new DK,OIe=new DK,BIe=new DK,nXt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,iXt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function KIe(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=MK(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,OIe),p=MK(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,UIe),b=MK(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,DIe),f=MK(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,BIe);m=NK(r,u,0,1,m,p,f,b,OIe),p=NK(r,u,0,0,p,m,b,f,UIe),b=NK(r,u,1,1,b,p,f,m,DIe),f=NK(r,u,1,1,f,b,m,p,BIe);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 wc({width:9,height:9,buffer:nXt,structure:{heightOffset:C}}),v=iXt;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,$Pt);v.height=E;let X=u.cartographicToCartesian(v,tXt),Y=new Cr(X,void 0,void 0,void 0,void 0,!0,!0,G,a,c),D=5,M;for(M=r.westMeshes,A=0,L=M.length;A<L;++A)D+=M[A].eastIndicesNorthToSouth.length;for(M=r.southMeshes,A=0,L=M.length;A<L;++A)D+=M[A].northIndicesWestToEast.length;for(M=r.eastMeshes,A=0,L=M.length;A<L;++A)D+=M[A].westIndicesSouthToNorth.length;for(M=r.northMeshes,A=0,L=M.length;A<L;++A)D+=M[A].southIndicesEastToWest.length;let O=eXt;O.minimumHeight=R,O.maximumHeight=C;let w=Y.stride,z=new Float32Array(D*w),K=0,te=K;K=YK(u,s,Y,z,K,0,1,m.height,m.encodedNormal,1,O),K=kK(r,u,Y,z,K,r.westTiles,r.westMeshes,Gn.EAST,O);let H=K;K=YK(u,s,Y,z,K,0,0,p.height,p.encodedNormal,0,O),K=kK(r,u,Y,z,K,r.southTiles,r.southMeshes,Gn.NORTH,O);let $=K;K=YK(u,s,Y,z,K,1,0,b.height,b.encodedNormal,0,O),K=kK(r,u,Y,z,K,r.eastTiles,r.eastMeshes,Gn.WEST,O);let ee=K;K=YK(u,s,Y,z,K,1,1,f.height,f.encodedNormal,1,O),K=kK(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=Ti.geodeticLatitudeToMercatorAngle(s.south),he=1/(Ti.geodeticLatitudeToMercatorAngle(s.north)-_e),Ze=(Ti.geodeticLatitudeToMercatorAngle(v.latitude)-_e)*he,ye=u.geodeticSurfaceNormalCartographic(gR,Dse),Ge=dn.octEncode(ye,wse),Ae=K;Y.encode(z,K*w,le.center,k.fromElements(.5,.5,dm),E,Ge,Ze,ye),++K;let Fe=K,tt=Fe<256?1:2,Be=(Fe-1)*3,je=Be*tt,qe=(z.length-Fe*w)*Float32Array.BYTES_PER_ELEMENT,We;if(qe>=je){let bt=Fe*w*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*w);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,me.fromOrientedBoundingBox(le),dXt(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 YK(e,t,n,i,o,r,s,a,c,d,u){let m=gR;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,yA),b;n.hasGeodeticSurfaceNormals&&(b=e.geodeticSurfaceNormal(p,Dse));let f=kse;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 UK=new re;function rk(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,UK),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,UK),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 oXt=new k;function Use(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 rXt=new k,sXt=new h;function aXt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=rk(t,n,u.decodeTextureCoordinates(m,o,dm),dm),b=rk(t,n,u.decodeTextureCoordinates(m,r,kse),kse),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;gR.longitude=W.lerp(S.west,S.east,s),gR.latitude=W.lerp(S.south,S.north,a),d.height=gR.height=W.lerp(y,_,f);let Z;if(u.hasVertexNormals){let R=u.getOctEncodedNormal(m,o,oXt),C=u.getOctEncodedNormal(m,r,rXt),E=dn.octDecode(R.x,R.y,yA),A=dn.octDecode(C.x,C.y,sXt);Z=h.lerp(E,A,f,yA),h.normalize(Z,Z),dn.octEncode(Z,d.encodedNormal)}else Z=e.geodeticSurfaceNormalCartographic(gR,yA),dn.octEncode(Z,d.encodedNormal)}function JIe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(gR,yA);dn.octEncode(s,r.encodedNormal)}function MK(e,t,n,i,o,r,s,a,c,d,u){if(HIe(e,t,a,s,!1,n,i,u)||HIe(e,t,d,c,!0,n,i,u))return u;let p;if(Ose(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],Use(r,p,n,i,u),u;let b;if(n===0?i===0?b=wK(e.westMeshes,e.westTiles,Gn.EAST,e.southMeshes,e.southTiles,Gn.NORTH,n,i):b=wK(e.northMeshes,e.northTiles,Gn.SOUTH,e.westMeshes,e.westTiles,Gn.EAST,n,i):i===0?b=wK(e.southMeshes,e.southTiles,Gn.NORTH,e.eastMeshes,e.eastTiles,Gn.WEST,n,i):b=wK(e.eastMeshes,e.eastTiles,Gn.WEST,e.northMeshes,e.northTiles,Gn.SOUTH,n,i),l(b))return JIe(e,t,n,i,b,u),u}function wK(e,t,n,i,o,r,s,a){let c=zIe(e,t,!1,n,s,a),d=zIe(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function kK(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=cXt(e,t,n,i,o,r[d],s[d],a,c);return o}function cXt(e,t,n,i,o,r,s,a,c){let d;a===Gn.EAST&&e.tile.x===0?(d=re.clone(r.rectangle,UK),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===Gn.WEST&&r.x===0&&(d=re.clone(r.rectangle,UK),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,dm),m=dm.x,p=dm.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=Ti.geodeticLatitudeToMercatorAngle(u.south),E=1/(Ti.geodeticLatitudeToMercatorAngle(u.north)-C));for(let A=0;A<b.length;++A){let L=b[A],F=S.decodeTextureCoordinates(Z,L,dm);rk(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,yA),X=S.decodeHeight(Z,L),Y;S.hasVertexNormals?Y=S.getOctEncodedNormal(Z,L,wse):(Y=wse,Y.x=0,Y.y=0);let D=N;if(S.hasWebMercatorT){let O=W.lerp(u.south,u.north,N);D=(Ti.geodeticLatitudeToMercatorAngle(O)-C)*E}let M;n.hasGeodeticSurfaceNormals&&(M=t.geodeticSurfaceNormal(v,Dse)),n.encode(i,o*R,v,F,X,Y,D,M),c.minimumHeight=Math.min(c.minimumHeight,X),c.maximumHeight=Math.max(c.maximumHeight,X),++o}return o}function zIe(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(!Ose(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 Ose(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function HIe(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(Ose(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,dm);let y=rk(b,e.tile,dm,dm);if(y.x===r&&y.y===s)return Use(f,p,r,s,a),!0;if(m=Eo(c,d?r:s,function(_,S){f.encoding.decodeTextureCoordinates(f.vertices,_,dm);let Z=rk(b,e.tile,dm,dm);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 aXt(t,b,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return Use(f,c[m],r,s,a),!0}return!1}var lXt=[new h,new h,new h,new h];function dXt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=lXt;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 TA=xA;var Bse=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(hXt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=mXt(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(),gXt(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&&TA.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&&fXt(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;pXt(this,b,f,t);let y=f.tileBoundingRegion;kXt(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),ePe(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===gi.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=nPe(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=BK(t.rectangle,this.cartographicLimitRectangle),m=re.simpleIntersection(u,t.rectangle,tPe);if(!l(m))return Jr.NONE;if(re.equals(m,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==se.SCENE3D&&(d=yXt,me.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=me.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=_Xt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===wo.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=SXt;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:gi.NONE;if(p===gi.RENDERED){let b=m.data;if(!l(b))continue;if(!o&&m.data.terrainState===wo.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===gi.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,ZXt),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){WXt(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(),ue(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]=vXt(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!==gi.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)}},uXt=new re;function mXt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,uXt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function hXt(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 fXt(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 pXt(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 bXt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function gXt(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 ePe(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 yXt=new me,tPe=new re,xXt=new re,TXt=new pe;function BK(e,t){if(t.west<t.east)return t;let n=re.clone(t,xXt);return re.center(e,TXt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function nPe(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 _Xt=[],SXt=[],ZXt=new h,jIe=new P,OK=new P,RXt=new ce,CXt=new ce,VXt=new ce,EXt=new h,QIe=new h,AXt=new h,GXt=new h,LXt=[new h,new h,new h,new h];function qIe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=LXt;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 WXt(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=me.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=qIe(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=qIe(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 vXt(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 FXt=new P,IXt=new P;function $Ie(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,QIe);return P.setTranslation(i,o,jIe),jIe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=P.multiplyByPoint(i,this.properties.rtc,QIe);return P.setTranslation(i,r,OK),P.multiply(o,OK,OK),OK},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,FXt):P.IDENTITY;return P.inverseTranspose(o,IXt)},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 PXt(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=XXt(e,o,i),n.wireframeVertexArray.mesh=i}}function XXt(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 iPe,oPe,zK;(function(){let e=new Yt({geometry:Yh.fromDimensions({dimensions:new h(2,2,2)})}),t=new Yt({geometry:new hg({radius:1})}),n=new P,i,o;function r(s){return new In({geometryInstances:s,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}iPe=function(s,a){return s===i||(zK(),i=s,n=P.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=$t.fromColor(a),o=r(e)),o},oPe=function(s,a){return s===i||(zK(),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},zK=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var NXt=new ce(0,0,0,0),YXt={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},MXt=U.TRANSPARENT,wXt=new Kt;function kXt(e,t,n){let i=t.data;if(bXt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new TA(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??MXt,_=e.undergroundColorAlphaByDistance??wXt,S=nPe(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)),M=!1;if(g){let bt=h.magnitude(n.camera.positionWC),ht=e.nightFadeOutDistance;M=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,w=O.center,z=O.encoding,K=i.tileBoundingRegion,te=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,$=te!==1,ee=z.hasGeodeticSurfaceNormals,le=RXt,_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),AXt),jt=bt.project(re.northeast(t.rectangle),GXt);if(le.x=ht.x,le.y=ht.y,le.z=jt.x,le.w=jt.y,n.mode!==se.MORPHING&&(w=EXt,w.x=0,w.y=(le.z+le.x)*.5,w.z=(le.w+le.y)*.5,le.x-=w.y,le.y-=w.z,le.z-=w.y,le.w-=w.z),n.mode===se.SCENE2D&&z.quantization===Ka.BITS12){let st=1/(Math.pow(2,12)-1)*.5,pt=(le.z-le.x)*st,Mi=(le.w-le.y)*st;le.x-=pt,le.y-=Mi,le.z+=pt,le.w+=Mi}bt instanceof Ti&&(_e=t.rectangle.south,he=t.rectangle.north,Ze=Ti.geodeticLatitudeToMercatorAngle(_e),ye=1/(Ti.geodeticLatitudeToMercatorAngle(he)-Ze),Ge=!0)}let Ae=YXt;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=M,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)||zK(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let ht=0;ht<bt;++ht)e._uniformMaps[ht]=$Ie(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 me,ht.orientedBoundingBox=void 0,jt=$Ie(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)?iPe(Ps,U.RED).update(n):l($a)&&oPe($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,Mi=d?p:b;l(pt)&&(ce.fromElements(pt.near,pt.nearValue,pt.far,pt.farValue,st.frontFaceAlphaByDistance),ce.fromElements(Mi.near,Mi.nearValue,Mi.far,Mi.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(w,st.rtc),ce.clone(le,st.tileRectangle),st.southAndNorthLatitude.x=_e,st.southAndNorthLatitude.y=he,st.southMercatorYAndOneOverHeight.x=Ze,st.southMercatorYAndOneOverHeight.y=ye;let Si=CXt,Hi=BK(t.rectangle,e.cartographicLimitRectangle),Gi=VXt,pi=BK(t.rectangle,f);h.fromElements(v,X,Y,st.hsbShift);let Zi=t.rectangle,On=1/Zi.width,rn=1/Zi.height;Si.x=(Hi.west-Zi.west)*On,Si.y=(Hi.south-Zi.south)*rn,Si.z=(Hi.east-Zi.west)*On,Si.w=(Hi.north-Zi.south)*rn,ce.clone(Si,st.localizedCartographicLimitRectangle),Gi.x=(pi.west-Zi.west)*On,Gi.y=(pi.south-Zi.south)*rn,Gi.z=(pi.east-Zi.west)*On,Gi.w=(pi.north-Zi.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,yi=!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 BT=Ps.useWebMercatorT?$a.textureWebMercator:$a.texture,si=$a.imageryLayer;l(Ps.textureTranslationAndScale)||(Ps.textureTranslationAndScale=si._calculateTextureTranslationAndScale(t,Ps)),st.dayTextures[bt]=BT,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,yi=yi||st.dayTextureNightAlpha[bt]!==1,st.dayTextureDayAlpha[bt]=si.dayAlpha,yi=yi||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=BK(Zi,si.cutoutRectangle),yp=re.simpleIntersection(va,Zi,tPe);mo=l(yp)||mo,qo.x=(va.west-Zi.west)*On,qo.y=(va.south-Zi.south)*rn,qo.z=(va.east-Zi.west)*On,qo.w=(va.north-Zi.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,Ty=va.length;yp<Ty;++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 Mn=e._clippingPlanes,Ki=l(Mn)&&Mn.enabled&&t.isClipped;Ki&&(st.clippingPlanesEdgeColor=U.clone(Mn.edgeColor,st.clippingPlanesEdgeColor),st.clippingPlanesEdgeWidth=Mn.edgeWidth);let wi=i.vectorData;l(wi)&&(st.vectorSegmentTexture=wi.polylineSegmentTexture,st.vectorWidthTexture=wi.widthTexture,st.vectorColorTexture=wi.colorTexture,st.vectorPickColorTexture=wi.pickColorTexture,st.vectorSegmentPrimitiveIndicesTexture=wi.polylineSegmentPrimitiveIndicesTexture,st.vectorGridCellIndicesTexture=wi.polylineGridCellIndicesTexture,st.vectorPolygonEdgeTexture=wi.polygonEdgeTexture,st.vectorPolygonEdgePrimitiveIndicesTexture=wi.polygonEdgePrimitiveIndicesTexture,st.vectorPolygonGridCellIndicesTexture=wi.polygonGridCellIndicesTexture,k.clone(wi.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,pm=(Xo?.polygonRings.length??0)>0,bp=l(Dc)&&Dc.enabled&&Dc.length>0&&t.isClipped&±Ae.numberOfDayTextures=bt,Ae.applyBrightness=$i,Ae.applyContrast=Po,Ae.applyHue=hr,Ae.applySaturation=Is,Ae.applyGamma=Hs,Ae.applyAlpha=or,Ae.applyDayNightAlpha=yi,Ae.applySplit=fr,Ae.enableFog=Hn,Ae.enableClippingPlanes=Ki,Ae.clippingPlanes=Mn,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&&(PXt(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?(me.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&&me.union(K.boundingSphere,ua,ua)):(ht.boundingVolume=me.clone(K.boundingSphere,ua),ht.orientedBoundingBox=tn.clone(K.boundingVolume,gp)),ht.dirty=!0,m&&u.updateDerivedCommands(ht,n),ePe(ht,n),ct=Ke,Et=NXt}while(tt<Be)}var sk=Bse;var f1o=x(T(),1);function rPe(){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(rPe.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 ak=rPe;var K1o=x(T(),1);var y1o=x(T(),1);var zse=class{constructor(t){this._ellipsoid=new Af(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},ck=zse;var C1o=x(T(),1);var Hse=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()}},UXt=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=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new Hse(UXt),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 OXt(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];if(!l(r))continue;i.add(r);let s=sPe(this,r.positionCartographic);r._pendingAddTile=s,r._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(r)}this._addedCustomData.length=0;for(let o=0;o<n.length;++o){let r=n[o];if(!l(r))continue;i.has(r)&&i.delete(r);let s=sPe(this,r.positionCartographic);if(r._pendingAddTile===s&&s._addedCustomData[r._pendingAddIndex]===r){s._addedCustomData[r._pendingAddIndex]=void 0,r._pendingAddTile=void 0;continue}s._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(),HK(this._southwestChild),this._southwestChild=void 0,HK(this._southeastChild),this._southeastChild=void 0,HK(this._northwestChild),this._northwestChild=void 0,HK(this._northeastChild),this._northeastChild=void 0}},DXt=256;function OXt(e,t,n,i){let o=n.width/DXt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}var BXt=new pe;function sPe(e,t){let n=e.northwestChild.rectangle,i=re.southeast(n,BXt),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 HK(e){l(e)&&e.freeResources()}var lk=Kse;var A1o=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(),aPe(this,t)),t=i}};function aPe(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))&&aPe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var dk=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 dk,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 ck({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 zXt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,lPe(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 lPe(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&&(zXt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),lPe(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),jXt(this,e),sNt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function HXt(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||(nNt(this,e),rNt(this,e),HXt(this,e))};Rh.prototype.isDestroyed=function(){return!1};Rh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var mk,cPe=new pe;function KXt(e,t){let n=re.center(e.rectangle,cPe),i=n.longitude-mk.longitude,o=n.latitude-mk.latitude;n=re.center(t.rectangle,cPe);let r=n.longitude-mk.longitude,s=n.latitude-mk.latitude;return i*i+o*o-(r*r+s*s)}var JXt=new h,uk=[];function jXt(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=lk.createLevelZeroTiles(p);let b=e._levelZeroTiles.length;if(uk.length<b){uk=new Array(b);for(let f=0;f<b;++f)uk[f]===void 0&&(uk[f]=new hk)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;mk=t.camera.positionCartographic,r.sort(KXt);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,JXt);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,uk[m]):(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 hk(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function dPe(){this.southwest=new hk,this.southeast=new hk,this.northwest=new hk,this.northeast=new hk}dPe.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 jse=new Array(31);for(let e=0;e<jse.length;++e)jse[e]=new dPe;function QXt(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=eNt(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:gi.NONE,b=e.tileProvider;if(s||i){let f=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,_=n.state===Qa.DONE,S=f||y||_;if(S||l(b.canRenderWithoutLosingDetail)&&(S=b.canRenderWithoutLosingDetail(n)),S){s&&sy(e,e._tileLoadQueueMedium,n,t),JK(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&sy(e,e._tileLoadQueueHigh,n,t)}if(b.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){JK(e,n),sy(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===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,_=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,Z=e._tileLoadQueueHigh.length,R=e._tileToUpdateHeights.length;if(qXt(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!==gi.KICKED&&g!==n;)g._lastSelectionResult=gi.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=R,JK(e,n),n._lastSelectionResult=gi.RENDERED;let I=p===gi.RENDERED;!I&&A>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=Z,sy(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&&sy(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,JK(e,n),sy(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function qXt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=jse[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 $Xt(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 QXt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,$Xt(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:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(sy(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function eNt(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof yn||t.camera.frustum instanceof bs)return tNt(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 tNt(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 JK(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function nNt(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=Jse(e,t,s,r,n,!1);a=Jse(e,t,s,r,i,a),Jse(e,t,s,r,o,a)}function iNt(e,t){return e._loadPriority-t._loadPriority}function Jse(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(iNt);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 _A=new gn,jK=new pe,WT=new h,oNt=[];function rNt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=oNt;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:gi.NONE;(_===gi.RENDERED||_===gi.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,_A.direction),A=d.getSurfaceNormalIntersectionWithZAxis(_.positionOnEllipsoidSurface,11500,_A.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,WT);h.subtract(_.positionOnEllipsoidSurface,I,_A.origin)}}else pe.clone(_.positionCartographic,jK),jK.height=-11500,c.project(jK,WT),h.fromElements(WT.z,WT.x,WT.y,WT),h.clone(WT,_A.origin),h.clone(h.UNIT_X,_A.direction);R=m.data.pick(_A,a,c,!1,WT),l(R)&&m.setPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError,h.clone(R))}if(l(R)){if(l(_.callback)){let E=d.cartesianToCartographic(R,jK);_.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 sNt(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 fk=Rh;function sp(e){e=e??ne.default;let t=new G0({ellipsoid:e}),n=new OS,i=new sg({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new ok,this._material=void 0,this._surface=new fk({tileProvider:new sk({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 ak,qse(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)&&qse(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,qse(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 qse(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[rf,gA];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(nk),e._surfaceShaderSet.baseVertexShaderSource=new Je({sources:[rf,gA,ik],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Je({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function aNt(e){return function(t,n){let i=me.distanceSquaredTo(t.pickBoundingSphere,e),o=me.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var cNt=[],lNt={start:0,stop:0};sp.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=cNt;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=me.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))me.clone(u.tileBoundingRegion.boundingSphere,m);else continue;let p=xi.raySphere(e,m,lNt);l(p)&&s.push(u)}s.sort(aNt(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 dNt=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,dNt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var uNt=new h,uPe=new h,mNt=new pe,hNt=new gn;function Qse(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=Qse(n._southwestChild,e)||Qse(n._southeastChild,e)||Qse(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,uNt),d=hNt,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,uPe);h.subtract(c,y,d.origin)}let p=n.data.pick(d,se.SCENE3D,s,!1,uPe);if(l(p))return a.cartesianToCartographic(p,mNt).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(),ue(this)};var pk=sp;var HCo=x(T(),1);var ACo=x(T(),1),uu=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_width = width; -v_st.s = st.s; -v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); -v_polylineAngle = angle; +out_FragColor = texture(colorTexture, v_textureCoordinates); +} +`;var LCo=x(T(),1),vT=`uniform highp sampler2D u_depthTexture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;var YTt=`#define CLIP_POLYLINE -${kl} -${rM}`,MTt=mS;function nZ(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=nZ.VERTEX_FORMAT;this.material=l(e.material)?e.material:ro.fromType(ro.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??YTt,this._fragmentShaderSource=e.fragmentShaderSource??MTt,this._renderState=Eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(nZ.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}}});nZ.VERTEX_FORMAT=Me.POSITION_AND_ST;nZ.prototype.getFragmentShaderSource=Eo.prototype.getFragmentShaderSource;nZ.prototype.isTranslucent=Eo.prototype.isTranslucent;nZ.prototype.getRenderState=Eo.prototype.getRenderState;var fc=nZ;function Tg(e){e=e??B.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new fc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ni.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=iCe(!1),this._renderState3DTiles=iCe(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:ki.FRONT},depthTest:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Tg.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}}});Tg.initializeTerrainHeights=function(){return Xi.initialize()};function wTt(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(oM);s=Pn._appendShowToShader(o,s),s=Pn._appendDistanceDisplayConditionToShader(o,s),s=Pn._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(iM);a=Pn._appendShowToShader(o,a),a=Pn._appendDistanceDisplayConditionToShader(o,a),a=Pn._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(tM),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=tn.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 ${Xi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(nM);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 iCe(e){return ze.fromCache({cull:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function kTt(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof Bs?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let m=0;m<a;m++){let p=s._va[m],b=o[m];l(b)||(b=o[m]=new lt({owner:e,primitiveType:s._primitiveType})),b.vertexArray=p,b.renderState=e._renderState,b.shaderProgram=e._sp,b.uniformMap=u,b.pass=Le.TERRAIN_CLASSIFICATION,b.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=lt.shallowClone(b,b.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=f;let y=lt.shallowClone(b,b.derivedCommands.color2D);y.shaderProgram=e._sp2D,b.derivedCommands.color2D=y;let _=lt.shallowClone(f,f.derivedCommands.color2D);_.shaderProgram=e._sp2D,f.derivedCommands.color2D=_;let S=lt.shallowClone(b,b.derivedCommands.colorMorph);S.renderState=e._renderStateMorph,S.shaderProgram=e._spMorph,S.pickId="czm_batchTable_pickColor(v_batchId)",b.derivedCommands.colorMorph=S}}function oCe(e,t,n,i,o,r,s){n.mode===se.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==se.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function UTt(e,t,n,i,o,r,s){let a=e._primitive;Pn._updateBoundingVolumes(a,t,o);let c;t.mode===se.SCENE3D?c=a._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===se.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===se.MORPHING,u=e.classificationType,m=u!==ni.CESIUM_3D_TILE,p=u!==ni.TERRAIN&&!d,b,f=t.passes;if(f.render||f.pick&&a.allowPicking){let y=n.length;for(let _=0;_<y;++_){let S=c[_];m&&(b=n[_],oCe(e,b,t,o,r,S,s)),p&&(b=n[_].derivedCommands.tileset,oCe(e,b,t,o,r,S,s))}}}Tg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Xi.initialized){Tg.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let d=c.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);l(a.width)||(a.width=new fl({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,tZ.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Mt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){wTt(n,d,u)},i._createCommandsFunction=function(c,d,u,m,p,b,f){kTt(n,d,u,m,b,f)},i._updateAndQueueCommandsFunction=function(c,d,u,m,p,b,f,y){UTt(n,d,u,m,p,b,f)},this._primitive=new Pn(i)}if(this.appearance instanceof Bs&&!this._hasPerInstanceColors)throw new ge("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))})};Tg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Tg.isSupported=function(e){return e.frameState.context.depthTexture};Tg.prototype.isDestroyed=function(){return!1};Tg.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 Ef=Tg;var LYi=x(T(),1);var DTt={u_globeMinimumAltitude:function(){return 55e3}};function $d(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<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new Tn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ni.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=Xi._defaultMaxTerrainHeight,this._minTerrainHeight=Xi._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:DTt}}Object.defineProperties($d.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}}});$d.isSupported=oV.isSupported;function rCe(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function sCe(e){return function(t,n){return e._minHeight}}var OTt=new h,BTt=new h,zTt=new h,HTt=new pe,KTt=new re;function k3(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let m=0;m<r;m+=3){let p=h.unpack(i,m,OTt),b=h.unpack(o,m,BTt),f=h.add(p,b,zTt),y=n.cartesianToCartographic(f,HTt),_=y.latitude,S=y.longitude;s=Math.min(s,_),a=Math.min(a,S),c=Math.max(c,_),d=Math.max(d,S)}let u=KTt;return u.north=c,u.south=s,u.east=d,u.west=a,u}function JTt(e,t,n){let i=Xi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function jTt(e,t,n){let i=t.mapProjection.ellipsoid,o=k3(t,n),r=nn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=me.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function Rte(e,t){return Math.floor(e%t/2)}function Cte(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==se.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 aCe(e,t,n,i,o,r){let s=e._primitive;n.mode!==se.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 QTt(e,t,n,i,o,r,s,a){let c;t.mode===se.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==ni.CESIUM_3D_TILE,m=d!==ni.TERRAIN,p=t.passes,b=e._primitive,f,y,_;if(p.render){let S=n.length;for(f=0;f<S;++f)y=c[Rte(f,S)],u&&(_=n[f],Cte(e,_,t,o,r,y,s)),m&&(_=n[f].derivedCommands.tileset,Cte(e,_,t,o,r,y,s));if(t.invertClassification){let Z=b._commandsIgnoreShow,R=Z.length;for(f=0;f<R;++f)y=c[f],_=Z[f],Cte(e,_,t,o,r,y,s)}}if(p.pick){let S=i.length,Z;for(e._useFragmentCulling||(Z=b._primitive._pickOffsets),f=0;f<S;++f){if(y=c[Rte(f,S)],!e._useFragmentCulling){let R=Z[Rte(f,S)];y=c[R.index]}u&&(_=i[f],aCe(e,_,t,o,r,y)),m&&(_=i[f].derivedCommands.tileset,aCe(e,_,t,o,r,y))}}}$d.initializeTerrainHeights=function(){return Xi.initialize()};$d.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Xi.initialized){$d.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,d=new Array(c),u,m;for(u=0;u<c;++u){o=a[u],r=o.geometry;let y=k3(e,r);l(m)?l(y)&&re.union(m,y,m):m=re.clone(y);let _=o.id;if(l(_)&&l(y)){let S=Xi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(S)}s=r.constructor,!l(s)||l(s.createShadowVolume)}JTt(this,m,i);let p=e.verticalExaggeration,b=e.verticalExaggerationRelativeHeight;this._minHeight=_o.getHeight(this._minTerrainHeight,p,b),this._maxHeight=_o.getHeight(this._maxTerrainHeight,p,b);let f=$d._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let y,_=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,m=k3(e,r),Du.shouldUseSphericalCoordinates(m)){_=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let S=k3(e,r),Z=r.textureCoordinateRotationPoints;_?y=Du.getPlanarTextureCoordinateAttributes(S,Z,i,e.mapProjection,this._maxHeight):y=Du.getSphericalExtentGeometryInstanceAttributes(S,Z,i,e.mapProjection);let R=o.attributes;for(let C in R)R.hasOwnProperty(C)&&(y[C]=R[C]);d[u]=new Mt({geometry:s.createShadowVolume(r,sCe(this),rCe(this)),attributes:y,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new Mt({geometry:s.createShadowVolume(r,sCe(this),rCe(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,_){jTt(t,y,_)},n._updateAndQueueCommandsFunction=function(y,_,S,Z,R,C,E,A){QTt(t,_,S,Z,R,C,E,A)},this._primitive=new oV(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))})};$d.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};$d.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};$d.prototype.isDestroyed=function(){return!1};$d.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};$d._supportsMaterials=function(e){return e.depthTexture};$d.supportsMaterials=function(e){return $d._supportsMaterials(e.frameState.context)};var id=$d;var uwi=x(T(),1);var NMi=x(T(),1);var TMi=x(T(),1);var wYi=x(T(),1);function Af(){}Af._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);Af._decodeTaskProcessor=new Qn("decodeI3S",Af._maxDecodingConcurrency);Af._promise=void 0;async function qTt(){if(await Af._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Af._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}Af.decode=async function(e,t,n,i,o){return l(Af._promise)||(Af._promise=qTt()),Af._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 sM=Af;var OYi=x(T(),1);function Vte(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(Vte.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Vte.prototype.load=async function(){return this._data=await Gf.loadJson(this._resource),this._data};var aM=Vte;var KYi=x(T(),1);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 U3(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 $Tt(e){return e==="String"?1:U3(e)}async function e_t(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)}_g.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=e_t(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 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}};_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],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.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],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)}}}};_g.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=U3(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=U3(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+=$Tt(i.valueType)}if(e.byteLength<t)throw new ae(`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 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=U3(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 cM=_g;var iMi=x(T(),1);var jYi=x(T(),1);function t_t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var iZ=t_t;function lM(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(lM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});lM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var n_t=new h,i_t=new h,o_t=new h,r_t=new h,s_t=new h;function Ete(e,t,n,i){let o=h.subtract(i,n,n_t),r=h.cross(o,h.subtract(e,n,i_t),r_t),s=h.cross(o,h.subtract(t,n,o_t),s_t);return h.dot(r,s)>=0}var a_t=new h,c_t=new h,l_t=new h,d_t=new h,u_t=new h,m_t=new h,h_t=new h,f_t=new h,p_t=new h,b_t=new h;lM.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],a_t),S=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],c_t),Z=new h(d[y*3],d[y*3+1],d[y*3+2],l_t);if(!Ete(i,_,S,Z)||!Ete(i,S,_,Z)||!Ete(i,Z,_,S))continue;let R=h.subtract(S,_,d_t),C=h.subtract(Z,_,u_t),E=h.cross(R,C,m_t);if(h.magnitude(E)===0)continue;let A=h.normalize(E,h_t),L=h.subtract(i,_,f_t),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,p_t)),g=h.magnitudeSquared(h.subtract(i,Z,b_t));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 cCe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(iZ(e[i])):t.push(e[i]);return t}lM.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=cCe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=cCe(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 _V=lM;function bl(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(bl.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}}});bl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new $m(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Gf.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 lCe(e,t){let n=new cM(e,t);return e._fields[t.name]=n,n.load()}bl.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(lCe(this,i))}return Promise.all(t)};bl.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 lCe(this,o)}return Promise.resolve()};bl.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)};bl.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};bl.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 bl(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};bl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new _V(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 _V(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};bl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new aM(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};bl.prototype._clearGeometryData=function(){this._geometryData=[]};bl.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+=T_t(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 Vc(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}};bl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};bl.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 sM.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 g_t(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 y_t(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 dCe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await g_t(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(!y_t(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}bl.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=dCe(this,t);e.push(n)}return Promise.all(e)};$m.prototype._hookedRequestContent=$m.prototype.requestContent;$m.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(()=>{dCe(e._i3sNode,n)})),e._isLoading=!1,t})}};function x_t(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 D3(e,t,n,i){let o=e+t*n;return i[o]}function T_t(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=D3(s,a,n.width,n.buffer),m=D3(c,a,n.width,n.buffer),p=D3(s,d,n.width,n.buffer),b=D3(c,d,n.width,n.buffer),f=x_t(o,r,u,m,p,b);return f=f*n.scale+n.offset,f}Object.defineProperties($m.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var SV=bl;var CMi=x(T(),1);function O3(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(O3.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Ate(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(iZ(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function ZV(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=Ate(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=Ate(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=Ate(a.color,a.transparency)))}break}}return n}function __t(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=ZV(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]=ZV(o.symbol,t)}return n}}function S_t(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(ZV(r.symbol,t)))}return i.symbols.push(void 0),i}}O3.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=ZV(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=ZV(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=__t(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=ZV(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=S_t(i,n))}};function uCe(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?uCe(s,t,n,i):s}}function Z_t(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 R_t(e,t,n){let i=t[n],o=Z_t(e.ranges,i);return e.symbols[o]}O3.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=>uCe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>R_t(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 dM=O3;function eu(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(eu.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}}});eu.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 dM(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()};eu.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)}};eu.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]}}};eu.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 SV(this,t,!0)}else this._rootNode=new SV(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};eu.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]})};eu._fetchJson=function(e){return e.fetchJson()};eu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=eu._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]};eu.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]))};eu.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()})};eu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};eu.prototype.filterByAttributes=function(e){this._filters=l(e)?$e(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var oZ=eu;var UMi=x(T(),1);function B3(e,t){this._dataProvider=e,this._resource=new ve({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(B3.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}}});B3.prototype.load=async function(){return this._data=await Gf.loadJson(this._resource),this._data};B3.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 uM=B3;var KMi=x(T(),1);function mM(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(mM.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}}});mM._fromData=async function(e,t,n,i){let o=new mM(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=mM._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 Gf.loadJson(o._resource),c=new oZ(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 hM=mM;var fCe=x(mCe(),1);function ra(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(ra.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}}});ra.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)};ra.prototype.isDestroyed=function(){return!1};ra.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};ra.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};ra.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};ra.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 C_t(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 hCe(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=C_t(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=hM._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 uM(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 oZ(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.`)}ra.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await ra.loadJson(n),o=new ra(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=hCe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await hCe(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};ra._fetchJson=function(e){return e.fetchJson()};ra.loadJson=async function(e){let t=await ra._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};ra.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};ra.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 V_t=new k;function E_t(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,V_t),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===ih.LERC){let Z=fCe.default.decode(y._buffer);S.buffer=Z.pixels[0]}else S.buffer=y._buffer;p.push(S)}return p})}async function A_t(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await E_t(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}ra.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=A_t(this),this._geoidDataPromise)};ra.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};ra.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};ra.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[]};ra.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 Gf=ra;var Lwi=x(T(),1);function b0(){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(b0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});b0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var G_t={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ei.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},L_t={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ei.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},W_t={depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK,blending:on.ALPHA_BLEND},v_t=`uniform sampler2D colorTexture; +`;function M0(){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(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 mPe(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(vT,{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(uu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(vT,{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(uu,{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 mi({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}M0.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),mPe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};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 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),mPe(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)&&(U.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 bk=M0;var oVo=x(T(),1);function yR(){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(yR.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 fNt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function pNt(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 bNt(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(vT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new mi({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}yR.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;pNt(this,n,o,r,e),bNt(this,n,o,r,i),this._useHdr=e};yR.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};yR.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};yR.prototype.isDestroyed=function(){return!1};yR.prototype.destroy=function(){return fNt(this),ue(this)};var gk=yR;var gVo=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},xR=Tc.DERIVED_COMMANDS_MAXIMUM_LENGTH,SPe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function TR(){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(xR),this._derivedBlendCommandTypes=new Array(xR),this._derivedPickCommandTypes=new Array(xR),this._derivedCommandTypesToUpdate=new Array(xR),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(TR.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}}});TR.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=hPe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=hPe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=fPe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=fPe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=TNt(this,e,t),this._sunVisibleThroughGlobe=gNt(this,e),this._environmentVisible=yNt(this,e),this._useDepthPlane=xNt(this,e),this._numberOfTextureUniforms=_Nt(this),this._rectangle=re.clone(t.translucency.rectangle,this._rectangle),SNt(this,e)};function hPe(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 fPe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function gNt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function yNt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function xNt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function TNt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function _Nt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function SNt(e,t){e._derivedCommandsLength=$se(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=$se(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=$se(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<xR;++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=NNt())}function $se(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 pPe(e,t){return e.indexOf(t)>-1}function ZNt(e,t){Ch(e.defines,"TRANSLUCENT"),Ch(t.defines,"TRANSLUCENT")}function RNt(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 eae(e,t){if(pPe(t.defines,"TILE_LIMIT_RECTANGLE")||pPe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function tae(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 ZPe(e,t){tae(e,t),Ch(e.defines,"GROUND_ATMOSPHERE"),Ch(t.defines,"GROUND_ATMOSPHERE"),Ch(e.defines,"FOG"),Ch(t.defines,"FOG")}function CNt(e,t){tae(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function VNt(e,t){ZPe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function bPe(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 ENt(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 ANt(e){e.cull.face=Di.BACK,e.cull.enabled=!0}function GNt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0}function LNt(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function WNt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function vNt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function gPe(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function yPe(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function FNt(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function INt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function PNt(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 SA(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function XNt(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 NNt(){return[new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:ZNt,getRenderStateFunction:ANt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:RNt,getRenderStateFunction:GNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:eae,getRenderStateFunction:LNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:eae,getRenderStateFunction:WNt,getUniformMapFunction:void 0}),new ap({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:eae,getRenderStateFunction:vNt,getUniformMapFunction:void 0}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:tae,getRenderStateFunction:gPe,getUniformMapFunction:SA}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ZPe,getRenderStateFunction:yPe,getUniformMapFunction:SA}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:CNt,getRenderStateFunction:gPe,getUniformMapFunction:SA}),new ap({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:VNt,getRenderStateFunction:yPe,getUniformMapFunction:SA}),new ap({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:bPe,getRenderStateFunction:FNt,getUniformMapFunction:SA}),new ap({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:bPe,getRenderStateFunction:INt,getUniformMapFunction:SA})]}var xPe=new Array(xR),TPe=new Array(xR);TR.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)TPe[o]=this._derivedCommandPacks[n[o]],xPe[o]=SPe[n[o]];YNt(this,e,i,n,xPe,TPe,t)}};function YNt(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=XNt(e,t.uniformMap,E,g,S.getUniformMapFunction),C.shaderProgram=ENt(s.context,t.shaderProgram,A,V,S.getShaderProgramFunction,R),C.renderState=PNt(t.renderState,L,G,S.getRenderStateFunction,S.renderStateCache)}}}TR.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=SPe[o[a]];n.commandList.push(s[c])}};function RPe(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 _Pe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var MNt=[Tc.OPAQUE_FRONT_FACE,Tc.OPAQUE_BACK_FACE],wNt=[Tc.DEPTH_ONLY_FRONT_FACE,Tc.DEPTH_ONLY_BACK_FACE,Tc.DEPTH_ONLY_FRONT_AND_BACK_FACE];TR.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),RPe(s,a,t,i,o,MNt))};TR.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)&&_Pe(d,u,t,i,o),!m&&!p)return;this._globeTranslucencyFramebuffer=n;let b=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,RPe(a,c,t,i,o,wNt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}_Pe(d,u,t,i,o),s.globeDepthTexture=b,o.framebuffer=f};var yk=TR;var WVo=x(T(),1);var CPe=x(Ooe(),1);function nae(){this._image=new Image}nae.prototype.isReady=function(){return!0};nae.prototype.shouldDiscardImage=function(e){return e===this._image};function _R(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 nae),this._errorEvent=new Se}Object.defineProperties(_R.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}}});_R.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new _R(t);return n._metadata=e,n};_R.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]}};_R.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=ty.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=kNt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){_w(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=UNt(u)),!l(m)&&(!l(p)||p)){let b=DNt(u);m=b.imageType,u=b.imageData}return!l(m)||!l(u)?o:Gb({uint8Array:u,format:m,flipY:!0})})};_R.prototype.pickFeatures=function(e,t,n,i,o){};function kNt(e,t,n,i,o,r){let s=ty.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 UNt(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 DNt(e){let t=CPe.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 iae=_R;var zVo=x(T(),1);var ONt=600;function w0(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??ONt}Object.defineProperties(w0.prototype,{});w0.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 mR({sources:{positiveX:d,negativeX:u,positiveY:m,negativeY:p,positiveZ:b,negativeZ:f},transform:_,credit:s})};w0.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}};w0.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};w0.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}`)}};w0.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};w0.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 w0({...e})};w0._parseMetadata=function(e){return{cartographic:pe.fromDegrees(e.location.lng,e.location.lat,0)}};var oae=w0;var $Vo=x(T(),1);var BNt=new U(1,1,1,.4),zNt=new U(0,1,0,.05),HNt=new U(0,.5,0,.2);function SR(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??BNt,this._glowColor=e.glowColor??zNt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??HNt,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(SR.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}}});SR.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()};SR.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};SR.prototype.getTileCredits=function(e,t,n){};SR.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};SR.prototype.pickFeatures=function(e,t,n,i,o){};var rae=SR;var vAo=x(T(),1);var oAo=x(T(),1);var kEo=x(T(),1);var lEo=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 KNt(){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=KNt()),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 xk=cp;var hEo=x(T(),1);function sae(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(sae.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});sae.prototype.load=async function(){return this._data=await lp.loadJson(this._resource),this._data};var Tk=sae;var gEo=x(T(),1);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 QK(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 JNt(e){return e==="String"?1:QK(e)}async function jNt(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)}ay.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=jNt(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 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}};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],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.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],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)}}}};ay.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=QK(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=QK(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+=JNt(i.valueType)}if(e.byteLength<t)throw new ae(`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 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=QK(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 _k=ay;var REo=x(T(),1);function Sk(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(Sk.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});Sk.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var QNt=new h,qNt=new h,$Nt=new h,eYt=new h,tYt=new h;function aae(e,t,n,i){let o=h.subtract(i,n,QNt),r=h.cross(o,h.subtract(e,n,qNt),eYt),s=h.cross(o,h.subtract(t,n,$Nt),tYt);return h.dot(r,s)>=0}var nYt=new h,iYt=new h,oYt=new h,rYt=new h,sYt=new h,aYt=new h,cYt=new h,lYt=new h,dYt=new h,uYt=new h;Sk.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],nYt),S=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],iYt),Z=new h(d[y*3],d[y*3+1],d[y*3+2],oYt);if(!aae(i,_,S,Z)||!aae(i,S,_,Z)||!aae(i,Z,_,S))continue;let R=h.subtract(S,_,rYt),C=h.subtract(Z,_,sYt),E=h.cross(R,C,aYt);if(h.magnitude(E)===0)continue;let A=h.normalize(E,cYt),L=h.subtract(i,_,lYt),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,dYt)),g=h.magnitudeSquared(h.subtract(i,Z,uYt));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 VPe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(tR(e[i])):t.push(e[i]);return t}Sk.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=VPe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=VPe(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 ZA=Sk;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 $m(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 EPe(e,t){let n=new _k(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(EPe(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 EPe(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 ZA(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 ZA(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 Tk(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+=pYt(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 xk.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 mYt(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 hYt(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 APe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await mYt(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(!hYt(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=APe(this,t);e.push(n)}return Promise.all(e)};$m.prototype._hookedRequestContent=$m.prototype.requestContent;$m.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(()=>{APe(e._i3sNode,n)})),e._isLoading=!1,t})}};function fYt(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 qK(e,t,n,i){let o=e+t*n;return i[o]}function pYt(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=qK(s,a,n.width,n.buffer),m=qK(c,a,n.width,n.buffer),p=qK(s,d,n.width,n.buffer),b=qK(c,d,n.width,n.buffer),f=fYt(o,r,u,m,p,b);return f=f*n.scale+n.offset,f}Object.defineProperties($m.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var RA=El;var zEo=x(T(),1);function $K(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties($K.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function cae(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(tR(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function CA(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=cae(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=cae(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=cae(a.color,a.transparency)))}break}}return n}function bYt(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=CA(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]=CA(o.symbol,t)}return n}}function gYt(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(CA(r.symbol,t)))}return i.symbols.push(void 0),i}}$K.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=CA(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=CA(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=bYt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=CA(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=gYt(i,n))}};function GPe(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?GPe(s,t,n,i):s}}function yYt(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 xYt(e,t,n){let i=t[n],o=yYt(e.ranges,i);return e.symbols[o]}$K.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=>GPe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>xYt(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 Zk=$K;function mu(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(mu.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}}});mu.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 Zk(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()};mu.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)}};mu.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]}}};mu.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 RA(this,t,!0)}else this._rootNode=new RA(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};mu.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]})};mu._fetchJson=function(e){return e.fetchJson()};mu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=mu._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]};mu.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]))};mu.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()})};mu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};mu.prototype.filterByAttributes=function(e){this._filters=l(e)?$e(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var ZR=mu;var lAo=x(T(),1);function eJ(e,t){this._dataProvider=e,this._resource=new ve({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(eJ.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}}});eJ.prototype.load=async function(){return this._data=await lp.loadJson(this._resource),this._data};eJ.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 Rk=eJ;var pAo=x(T(),1);function Ck(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(Ck.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}}});Ck._fromData=async function(e,t,n,i){let o=new Ck(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=Ck._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 ZR(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 Vk=Ck;var vPe=x(LPe(),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 ue(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 TYt(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 WPe(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=TYt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=Vk._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 Rk(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 ZR(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=WPe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await WPe(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 _Yt=new k;function SYt(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,_Yt),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 Ti&&(_="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=vPe.default.decode(y._buffer);S.buffer=Z.pixels[0]}else S.buffer=y._buffer;p.push(S)}return p})}async function ZYt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await SYt(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=ZYt(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 QAo=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 mi({color:new U(0,0,0,0),owner:this}),this._clearCommand=new mi({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 RYt={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},CYt={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},VYt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK,blending:on.ALPHA_BLEND},EYt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -10791,7 +10949,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,F_t=`uniform sampler2D colorTexture; +`,AYt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -10806,156 +10964,7 @@ void main() out_FragColor = color; #endif } -`;b0.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 Su({context:e,width:s,height:a,format:Nl.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(G_t),this._rsClassified=ze.fromCache(L_t),this._rsDefault=ze.fromCache(W_t)),!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)?F_t:v_t,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(qd,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};b0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};b0.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))};b0.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)};b0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};b0.prototype.isDestroyed=function(){return!1};b0.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 RV=b0;var a7i=x(T(),1);var Pwi=x(T(),1);var sa={};sa.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});sa.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});sa.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});sa.defaultAccessToken=void 0;sa.defaultShareKey=void 0;sa._getAuthorizationHeader=function(){return l(sa.defaultShareKey)?`Basic ${sa.defaultShareKey}`:`Bearer ${sa.defaultAccessToken}`};sa.apiEndpoint=new ve({url:"https://api.bentley.com"});sa.getExports=async function(e,t){let n=new ve({url:`${sa.apiEndpoint}mesh-export`,headers:{Authorization:sa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:sa.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}`)}};sa.getRealityDataMetadata=async function(e,t){let n=new ve({url:`${sa.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:sa._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}`)}};sa.getRealityDataURL=async function(e,t,n){let i=new ve({url:`${sa.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:sa._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 aa=sa;var S8i=x(T(),1);var Nwi=x(T(),1),pCe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(pCe);var Vs=pCe;var Mwi=x(T(),1),bCe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(bCe);var Oo=bCe;var kwi=x(T(),1),gCe=x(yu(),1);function I_t(e){let t=new gCe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Sg=I_t;var Qwi=x(T(),1);var Hwi=x(T(),1);function Nr(e){e=e??B.EMPTY_OBJECT,this.start=l(e.start)?Q.clone(e.start):new Q,this.stop=l(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Nr.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var CV={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Nr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new ge("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 l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(CV.start=i,CV.stop=o,CV.isStartIncluded=r,CV.isStopIncluded=s,CV.data=a,new Nr(CV))};Nr.toIso8601=function(e,t){return`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};Nr.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 Nr(e)};Nr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equals(e.start,t.start)&&Q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Nr.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&&Q.equalsEpsilon(e.start,t.start,n)&&Q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Nr.intersect=function(e,t,n,i){if(!l(t))return Nr.clone(Nr.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),d=!c&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!c&&!d)return Nr.clone(Nr.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,b=t.isStopIncluded,f=Q.lessThan(r,a);return l(n)||(n=new Nr),n.start=c?s:o,n.isStartIncluded=u&&p||!Q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&b||!Q.equals(a,r)&&b,n.data=l(i)?i(e.data,t.data):e.data,n};Nr.contains=function(e,t){if(e.isEmpty)return!1;let n=Q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Nr.prototype.clone=function(e){return Nr.clone(this,e)};Nr.prototype.equals=function(e,t){return Nr.equals(this,e,t)};Nr.prototype.equalsEpsilon=function(e,t,n){return Nr.equalsEpsilon(this,e,t,n)};Nr.prototype.toString=function(){return Nr.toIso8601(this)};Nr.EMPTY=Object.freeze(new Nr({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var Vn=Nr;var yCe=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),xCe=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),P_t=Object.freeze(new Vn({start:yCe,stop:xCe})),X_t={MINIMUM_VALUE:yCe,MAXIMUM_VALUE:xCe,MAXIMUM_INTERVAL:P_t},ot=X_t;var o9i=x(T(),1);function pM(){this._cache={}}pM.prototype.fromColor=function(e,t){return H3(void 0,void 0,e,t,this._cache)};pM.prototype.fromUrl=function(e,t,n){return H3(e,void 0,t,n,this._cache)};pM.prototype.fromMakiIconId=function(e,t,n){return H3(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};pM.prototype.fromText=function(e,t,n){return H3(void 0,e,t,n,this._cache)};var N_t=new U;function Y_t(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,N_t).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 TCe(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 fM=new Array(4);function H3(e,t,n,i,o){fM[0]=e,fM[1]=t,fM[2]=n,fM[3]=i;let r=JSON.stringify(fM),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(Y_t(c,n,i),l(e)){let u=ve.createIfNeeded(e).fetchImage().then(function(m){return TCe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=dS(t,{font:`bold ${i}px sans-serif`});TCe(c,d,i)}return o[r]=a,a}var Zg=pM;var p9i=x(T(),1);function Wte(e,t){return Q.compare(e.start,t.start)}function Es(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(Es.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}}});Es.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Es))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(!Vn.equals(n[r],i[r],t))return!1;return!0};Es.prototype.get=function(e){return this._intervals[e]};Es.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Es.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Es.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Es.prototype.contains=function(e){return this.indexOf(e)>=0};var Gte=new Vn;Es.prototype.indexOf=function(e){let t=this._intervals;Gte.start=e,Gte.stop=e;let n=Go(t,Gte,Wte);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)};Es.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]}};Es.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=Go(n,e,Wte);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 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):(o=Q.compare(n[i-1].stop,e.stop),(o>0||o===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&&(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 Vn({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 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)};Es.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Go(t,e,Wte);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 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&&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 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&&(Q.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};Es.prototype.intersect=function(e,t,n){let i=new Es,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=Vn.intersect(c,d,new Vn,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};Es.fromJulianDateArray=function(e,t){l(t)||(t=new Es);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 Vn({start:ot.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 Vn({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 Vn({start:n[i-1],stop:ot.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var gl=new Ih,bM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Lte(e,t,n){l(n)||(n=new Q),Q.toGregorianDate(e,gl);let i=gl.millisecond+t.millisecond,o=gl.second+t.second,r=gl.minute+t.minute,s=gl.hour+t.hour,a=gl.day+t.day,c=gl.month+t.month,d=gl.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),bM[2]=Il(d)?29:28;a>bM[c]||c>=13;)a>bM[c]&&(a-=bM[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),bM[2]=Il(d)?29:28;return gl.millisecond=i,gl.second=o,gl.minute=r,gl.hour=s,gl.day=a,gl.month=c,gl.year=d,Q.fromGregorianDate(gl,n)}var M_t=new Q,w_t=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function _Ce(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(w_t);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,M_t),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var gM=new Ih;Es.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!_Ce(n[2],gM))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=Lte(s,gM),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Es.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Es.fromIso8601DateArray=function(e,t){return Es.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)};Es.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)(_Ce(i[d],gM)||d===0)&&(o&&l(a)?s=Lte(a,gM):s=Lte(n,gM),r.push(s),a=s);return Es.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var As=Es;var TUi=x(T());var oUi=x(T());var g9i=x(T(),1),vte=function(e,t){return vte=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])},vte(e,t)};function g0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");vte(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ca=function(){return ca=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},ca.apply(this,arguments)};function SCe(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 ZCe(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 x9i=x(T()),RCe="4.1.5";var _9i=x(T()),CCe=Object.prototype.hasOwnProperty;function Ku(e){return typeof e=="boolean"}function VCe(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 Ux(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Lf(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var N9i=x(T());var R9i=x(T());var K3=/\s+/,J3=(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(K3):[],o=t.split(K3),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(K3):[],o=t.split(K3),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)CCe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();var V9i=x(T());function ACe(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=k_t(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=ECe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=ECe(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):Fte(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+Fte(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+Fte(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 k_t(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 ECe(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 Fte(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 A9i=x(T());function GCe(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 W9i=x(T());function LCe(e,t,n){return VCe(e,t,n)}var WCe=(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 J3({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"?ACe(t,i):o==="middle"?GCe(t,i):LCe(t,i)},e})();var Uki=x(T());var q9i=x(T());var M9i=x(T()),y0=(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 H9i=x(T());var k9i=x(T());function vCe(e){return e>=0&&e<=31||e==127}function Rg(e){return e>=65&&e<=90||e>=97&&e<=122}function la(e){return e>=48&&e<=57}function j3(e){return e==34||e==39}function Dx(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 Wf(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 FCe(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 ICe(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 Q3(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function PCe(e){return e<91?e==40:e==91||e==123}function Ite(e){return e<93?e==41:e==93||e==125}var D9i=x(T()),XCe=/^(?: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 Pte=/https?:\/\//i,NCe=new RegExp("^"+Pte.source,"i"),U_t=/^(javascript|vbscript):/i,D_t=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,O_t=/^(?:\/\/)?([^/#?:]+)/,VV=Rg;function Xte(e){return Rg(e)||la(e)||e===43||e===45||e===46}var Cg=Wf;function q3(e){return e===95||Cg(e)}function Nte(e){return Wf(e)||ICe(e)||Q3(e)}function $3(e){return e===47||e===63||e===35}function Yte(e){return XCe.test(e.toLowerCase())}function YCe(e){if(U_t.test(e))return!1;var t=e.match(D_t);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function MCe(e){var t=e.match(O_t);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!Yte(o)}var B_t=/^(?:(?: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]?)$/,z_t=/[:/?#]/;function wCe(e){var t=e.split(z_t,1)[0];return B_t.test(t)}var H_t=/^(https?:\/\/)?(?:www\.)?/i,K_t=/^\/\//,kCe=(function(e){g0(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=Q_t(n)),this.stripPrefix.scheme&&(n=J_t(n)),this.stripPrefix.www&&(n=j_t(n)),this.stripTrailingSlash&&(n=q_t(n)),this.decodePercentEncoding&&(n=$_t(n)),n},t})(y0);function J_t(e){return e.replace(NCe,"")}function j_t(e){return e.includes("www.")?e.replace(H_t,"$1"):e}function Q_t(e){return e.replace(K_t,"")}function q_t(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function $_t(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 nki=x(T());var UCe=/^mailto:/i,Mte=Wf;function ez(e){return Mte(e)||FCe(e)}function DCe(e){var t=e.split(".").pop();return Yte(t)}var ski=x(T());var OCe=(function(e){g0(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})(y0);var lki=x(T());function wte(e){return e===95||Wf(e)}function BCe(e){return e.length<=140}var zCe=["twitter","facebook","instagram","tiktok","youtube"];var fki=x(T());var HCe=(function(e){g0(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:Lf(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})(y0);var gki=x(T());var eSt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function kte(e){return e===45||e===46||e===95||Rg(e)||la(e)}function KCe(e,t){var n=eSt[t];return n.test(e)}var JCe=["twitter","instagram","soundcloud","tiktok","youtube"];var Ski=x(T());var jCe=(function(e){g0(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:Lf(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})(y0);var Rki=x(T()),tSt=/[-. ()]/,nSt=/(?:(?:(?:(\+)?\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]+#?)*/,iSt=/(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})/,oSt=new RegExp("^".concat(nSt.source,"|").concat(iSt.source,"$"));function Ute(e){return e===45||e===46||e===32}function tz(e){return e===44||e===59}function QCe(e){var t=e.charAt(0)==="+"||tSt.test(e);return t&&oSt.test(e)}var Aki=x(T());var qCe=(function(e){g0(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})(y0);var rSt=(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),eVe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),eVe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function tVe(e,t){for(var n=new rSt(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)nz(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:uSt(n,s,o);break;case 12:mSt(n,s,o);break;case 0:sSt(n,s,o);break;case 1:aSt(n,s,o);break;case 2:cSt(n,s,o);break;case 3:lSt(n,s,o);break;case 4:dSt(n,s,i,o);break;case 5:hSt(n,s,o);break;case 6:fSt(n,s,i,o);break;case 7:pSt(n,s,i,o);break;case 13:bSt(n,s,o);break;case 14:gSt(n,s,o);break;case 8:ySt(n,s,o);break;case 9:xSt(n,s,o);break;case 10:TSt(n,s,o);break;case 15:_St(n,s,i,o);break;case 16:SSt(n,s,i,o);break;case 17:ZSt(n,s,i,o);break;case 18:RSt(n,s,i,o);break;case 19:CSt(n,s,i,o);break;case 20:VSt(n,s,o);break;case 21:ESt(n,s,o);break;case 22:rZ(n,s,o);break;case 23:ASt(n,s,o);break;case 24:GSt(n,s,o);break;case 25:LSt(n,s,o);break;case 26:WSt(n,s,o);break;case 27:vSt(n,s,o);break;case 28:FSt(n,s,o);break;case 29:ISt(n,s,o);break;case 30:PSt(n,s,o);break;case 31:XSt(n,s,o);break;case 32:YSt(n,s,i,o);break;case 33:MSt(n,s,o);break;case 34:wSt(n,s,o);break;case 35:kSt(n,s,o);break;case 36:USt(n,s,i,o);break;case 37:NSt(n,s,i,o);break;case 38:DSt(n,s,i,o);break;case 39:OSt(n,s,i,o);break;case 40:BSt(n,s,o);break;case 41:zSt(n,s,o);break;default:Lf(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&VV(o)){var a=n.text.charCodeAt(n.charIdx-1);VV(a)||n.addMachine(iz(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(d){return Gs(n,d)});return n.matches}function nz(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(QSt(i,28));else if(n===64)e.addMachine(qSt(i,30));else if(n===47)e.addMachine(Ote(i,11));else if(n===43)e.addMachine(Dte(i,37));else if(n===40)e.addMachine(Dte(i,32));else{if(la(n)&&(e.addMachine(Dte(i,38)),e.addMachine(JSt(i,13))),Mte(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(jSt(i,o))}VV(n)&&e.addMachine(iz(i,0)),Wf(n)&&e.addMachine(Ote(i,5))}}function sSt(e,t,n){n===58?t.state=2:n===45?t.state=1:Xte(n)||e.removeMachine(t)}function aSt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Ote(i,11))):Xte(n)?t.state=0:e.removeMachine(t))}function cSt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):Cg(n)?(t.state=5,VV(n)&&e.addMachine(iz(i,0))):e.removeMachine(t)}function lSt(e,t,n){n===47?t.state=4:Nte(n)?(t.state=10,t.acceptStateReached=!0):Gs(e,t)}function dSt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):Cg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function uSt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function mSt(e,t,n){Cg(n)?t.state=5:e.removeMachine(t)}function hSt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:$3(n)?t.state=10:q3(n)||Gs(e,t)}function fSt(e,t,n,i){i===45||(i===46?Gs(e,t):Cg(i)?t.state=5:Gs(e,t))}function pSt(e,t,n,i){i===46?Gs(e,t):Cg(i)?(t.state=5,t.acceptStateReached=!0):Gs(e,t)}function bSt(e,t,n){n===46?t.state=14:n===58?t.state=8:la(n)||($3(n)?t.state=10:Wf(n)?e.removeMachine(t):Gs(e,t))}function gSt(e,t,n){la(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Gs(e,t)}function ySt(e,t,n){la(n)?t.state=9:Gs(e,t)}function xSt(e,t,n){la(n)||($3(n)?t.state=10:Gs(e,t))}function TSt(e,t,n){Nte(n)||Gs(e,t)}function _St(e,t,n,i){n.toLowerCase()==="a"?t.state=16:rZ(e,t,i)}function SSt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:rZ(e,t,i)}function ZSt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:rZ(e,t,i)}function RSt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:rZ(e,t,i)}function CSt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:rZ(e,t,i)}function VSt(e,t,n){n===58?t.state=21:rZ(e,t,n)}function ESt(e,t,n){ez(n)?t.state=22:e.removeMachine(t)}function rZ(e,t,n){n===46?t.state=23:n===64?t.state=24:ez(n)?t.state=22:e.removeMachine(t)}function ASt(e,t,n){n===46||n===64?e.removeMachine(t):ez(n)?t.state=22:e.removeMachine(t)}function GSt(e,t,n){Cg(n)?t.state=25:e.removeMachine(t)}function LSt(e,t,n){n===46?t.state=27:n===45?t.state=26:q3(n)||Gs(e,t)}function WSt(e,t,n){n===45||n===46?Gs(e,t):q3(n)?t.state=25:Gs(e,t)}function vSt(e,t,n){n===46||n===45?Gs(e,t):Cg(n)?(t.state=25,t.acceptStateReached=!0):Gs(e,t)}function FSt(e,t,n){wte(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function ISt(e,t,n){wte(n)||Gs(e,t)}function PSt(e,t,n){kte(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function XSt(e,t,n){kte(n)||(Wf(n)?e.removeMachine(t):Gs(e,t))}function NSt(e,t,n,i){la(i)?t.state=38:(e.removeMachine(t),nz(e,n,i))}function YSt(e,t,n,i){la(i)?t.state=33:e.removeMachine(t),nz(e,n,i)}function MSt(e,t,n){la(n)?t.state=34:e.removeMachine(t)}function wSt(e,t,n){la(n)?t.state=35:e.removeMachine(t)}function kSt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function USt(e,t,n,i){la(i)?t.state=38:Ute(i)?t.state=39:e.removeMachine(t)}function DSt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,tz(i)?t.state=40:i===35?t.state=41:la(i)||(i===40?t.state=32:Ute(i)?t.state=39:(Gs(e,t),VV(i)&&e.addMachine(iz(o,0))))}function OSt(e,t,n,i){la(i)?t.state=38:i===40?t.state=32:(Gs(e,t),nz(e,n,i))}function BSt(e,t,n){tz(n)||(n===35?t.state=41:la(n)?t.state=38:Gs(e,t))}function zSt(e,t,n){tz(n)?t.state=40:la(n)?e.removeMachine(t):Gs(e,t)}function Gs(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=KSt(p),t.type){case 0:{var b=i.charCodeAt(t.startIdx-1);if(b===64)return;switch(t.matchType){case 0:{var f=Pte.exec(p);if(f&&(m=m+f.index,p=p.slice(f.index)),!YCe(p))return;break}case 1:{if(!MCe(p))return;break}case 2:{if(!wCe(p))return;break}default:Lf(t)}n.push(new kCe({tagBuilder:r,matchedText:p,offset:m,urlMatchType:HSt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{DCe(p)&&n.push(new OCe({tagBuilder:r,matchedText:p,offset:m,email:p.replace(UCe,"")}));break}case 2:{BCe(p)&&n.push(new HCe({tagBuilder:r,matchedText:p,offset:m,serviceName:d,hashtag:p.slice(1)}));break}case 3:{KCe(p,u)&&n.push(new jCe({tagBuilder:r,matchedText:p,offset:m,serviceName:u,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),QCe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new qCe({tagBuilder:r,matchedText:p,offset:m,number:y,plusSign:p.charAt(0)==="+"}))}break}default:Lf(t)}}}function HSt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:Lf(e)}}var $Ce={")":"(","}":"{","]":"["};function KSt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);PCe(o)?t[i]++:Ite(o)&&t[$Ce[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(Ite(o)){var s=$Ce[i];if(t[s]<0)t[s]++,r--;else break}else if(Q3(o))r--;else break}return e.slice(0,r+1)}function iz(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Ote(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function JSt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function jSt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function QSt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function qSt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Dte(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function eVe(e){return e.type===0&&e.matchType===0}var Hki=x(T());var x0=(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})(),zte=new x0,$St=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=zte,this.html=t,this.callbacks=n}return e})();function nVe(e,t){for(var n=new $St(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:eZt(n,o);break;case 1:tZt(n,o,r);break;case 2:iZt(n,o,r);break;case 3:nZt(n,o,r);break;case 4:oZt(n,o,r);break;case 5:rZt(n,o,r);break;case 6:sZt(n,o,r);break;case 7:aZt(n,o,r);break;case 8:cZt(n,o);break;case 9:lZt(n,o);break;case 10:dZt(n,o,r);break;case 11:uZt(n,o,r);break;case 12:mZt(n,o);break;case 13:hZt(n);break;case 14:fZt(n,o);break;case 15:pZt(n,o);break;case 16:bZt(n,o);break;case 17:gZt(n,o);break;case 18:yZt(n,o);break;case 19:xZt(n,o);break;case 20:TZt(n,o);break;default:Lf(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&_Zt(n)}function eZt(e,t){t==="<"&&T0(e)}function tZt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new x0(ca(ca({},e.currentTag),{isClosing:!0}))):t==="<"?T0(e):Rg(n)?(e.state=3,e.currentTag=new x0(ca(ca({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=zte)}function nZt(e,t,n){Dx(n)?(e.currentTag=new x0(ca(ca({},e.currentTag),{name:Bte(e)})),e.state=4):t==="<"?T0(e):t==="/"?(e.currentTag=new x0(ca(ca({},e.currentTag),{name:Bte(e)})),e.state=12):t===">"?(e.currentTag=new x0(ca(ca({},e.currentTag),{name:Bte(e)})),_0(e)):!Rg(n)&&!la(n)&&t!==":"&&ch(e)}function iZt(e,t,n){t===">"?ch(e):Rg(n)?e.state=3:ch(e)}function oZt(e,t,n){Dx(n)||(t==="/"?e.state=12:t===">"?_0(e):t==="<"?T0(e):t==="="||j3(n)||vCe(n)?ch(e):e.state=5)}function rZt(e,t,n){Dx(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?_0(e):t==="<"?T0(e):j3(n)&&ch(e)}function sZt(e,t,n){Dx(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?_0(e):t==="<"?T0(e):j3(n)?ch(e):e.state=5)}function aZt(e,t,n){Dx(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?ch(e):t==="<"?T0(e):e.state=10)}function cZt(e,t){t==='"'&&(e.state=11)}function lZt(e,t){t==="'"&&(e.state=11)}function dZt(e,t,n){Dx(n)?e.state=4:t===">"?_0(e):t==="<"&&T0(e)}function uZt(e,t,n){Dx(n)?e.state=4:t==="/"?e.state=12:t===">"?_0(e):t==="<"?T0(e):(e.state=4,SZt(e))}function mZt(e,t){t===">"?(e.currentTag=new x0(ca(ca({},e.currentTag),{isClosing:!0})),_0(e)):ch(e)}function hZt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new x0(ca(ca({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new x0(ca(ca({},e.currentTag),{type:"doctype"})),e.state=20):ch(e)}function fZt(e,t){t==="-"?e.state=15:t===">"?ch(e):e.state=16}function pZt(e,t){t==="-"?e.state=18:t===">"?ch(e):e.state=16}function bZt(e,t){t==="-"&&(e.state=17)}function gZt(e,t){t==="-"?e.state=18:e.state=16}function yZt(e,t){t===">"?_0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function xZt(e,t){t==="-"?e.state=17:t===">"?_0(e):e.state=16}function TZt(e,t){t===">"?_0(e):t==="<"&&T0(e)}function ch(e){e.state=0,e.currentTag=zte}function T0(e){e.state=1,e.currentTag=new x0({idx:e.charIdx})}function _0(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)),ch(e),e.currentDataIdx=e.charIdx+1}function _Zt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Bte(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function SZt(e){e.charIdx--}var ZZt=(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=RZt(t.urls),this.email=Ku(t.email)?t.email:this.email,this.phone=Ku(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Ku(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=CZt(t.stripPrefix),this.stripTrailingSlash=Ku(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Ku(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&JCe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&zCe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=VZt(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 nVe(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,ZCe([],SCe(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(EZt);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||Ux(t,function(n){return n.getType()==="hashtag"}),this.email||Ux(t,function(n){return n.getType()==="email"}),this.phone||Ux(t,function(n){return n.getType()==="phone"}),this.mention||Ux(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Ux(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Ux(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Ux(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=tVe(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 J3)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new WCe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=RCe,e})(),iVe=ZZt;function RZt(e){return e==null&&(e=!0),Ku(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Ku(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Ku(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Ku(e.ipV4Matches)?e.ipV4Matches:!0}}function CZt(e){return e==null&&(e=!0),Ku(e)?{scheme:e,www:e}:{scheme:Ku(e.scheme)?e.scheme:!0,www:Ku(e.www)?e.www:!0}}function VZt(e){return typeof e=="number"?{length:e,location:"end"}:ca({length:Number.POSITIVE_INFINITY,location:"end"},e)}function EZt(e,t){return e.getOffset()-t.getOffset()}var aUi=x(T());var rUi=x(T());var bUi=x(T());var oz=iVe;var Fw=x(yu(),1);var gBi=x(T(),1);var IOi=x(T(),1);S0();var CDi=x(T(),1);var k5i=x(T(),1);pc();lZ();Pz();IM();var IEe={type:"module"},gne="error",fRt="messageerror",PEe,bne,XEe,yne=!0;try{yne=typeof structuredClone==Yr&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}vEe(pRt);function pRt(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 fne(e),pne(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await bRt(e,{chunkSize:i,wasmURI:r,baseURI:n,workerStartupTimeout:o})}catch(a){if(a&&a.workerStartupFailed)return fne(e),NEe(e),Yz(e,t);if(a&&a.codecImportFailed){if(e.reader)return NEe(e),Yz(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function bRt(e,t){if(!e.worker){let{startupError:b}=e;e.startupError=null;let f=b||new Error(hZ);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}=gRt(e.writable),u;try{u=xne({type:VEe,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(()=>yRt(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 gRt(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 NEe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function Tne(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(bne===ke||PEe!==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=IEe);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=IEe);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}}PEe=e,bne=a,XEe=c}else s=new Worker(bne,XEe);return s.addEventListener(CEe,d=>{n.workerAlive=!0,MEe(n),xRt(d,n)}),s.addEventListener(gne,d=>YEe(d,n)),s.addEventListener(fRt,d=>YEe(d,n)),s}function yRt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(Tne(e),e.worker=null,t){let i=new Error(hZ);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function MEe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function YEe(e,t){e.preventDefault&&e.preventDefault(),MEe(t);let{workerAlive:n,rejectResult:i,writer:o,onTaskFinished:r}=t;Tne(t),n||(t.worker=null);let s=e.error||new Error(e.message||gne);n||(s=Object.assign(new Error(s.message||gne),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),o&&o.releaseLock(),n&&r())}function xne(e,{worker:t,writer:n,transferStreams:i,workerAlive:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(e.value=yz(r),c.push(e.value.buffer)),i&&yne&&o?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{yne=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function xRt({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==EEe){let{value:y,done:_}=await a.read();b()||xne({type:dne,value:y,done:_,messageId:o},t)}n==dne&&(await c.ready,await c.write(new Uint8Array(i)),b()||xne({type:AEe,messageId:o},t)),n==GEe&&f(null,r)}}catch(y){b()||(Tne(t),f(y))}function f(y,_){b()||(y?u(y):d(_),c&&c.releaseLock(),y&&y.codecImportFailed||m())}}kie();var ODi=x(T(),1);var MDi=x(T(),1);pc();S0();uZ();IM();Dz();Kz();ene();lZ();XV();Kne();xM();var $ie="File already exists",eoe="Zip file comment exceeds 64KB",MAe="Invalid zip file comment (must be a Uint8Array)",wAe="File entry comment exceeds 64KB",kAe="Invalid file entry comment (must be a string)",UAe="Invalid date (must be a valid Date instance)",DAe="File entry name exceeds 64KB",toe="Version exceeds 65535",OAe="The strength must equal 1, 2, or 3",BAe="Encryption is not supported in USDZ files",zAe="Encryption is not supported when the 'passThrough' option is set",HAe="Invalid extra field (must be a Map)",KAe="Invalid extra field type (must be integer 0..65535)",JAe="Invalid extra field data (must be a Uint8Array)",RH="Extra field data exceeds 64KB",Y1t="Compression method not supported",jAe=-2147483648,QAe=2147483647,GAe=BigInt(0),LAe=BigInt("0x7fffffffffffffff"),CH="Zip64 is not supported (set the 'zip64' option to 'true')",qAe="Undefined uncompressed size",$Ae="Undefined compression method";var eGe="Undefined reader",tGe="Zip file not empty",nGe="Invalid uid (must be integer 0..2^32-1)",iGe="Invalid gid (must be integer 0..2^32-1)",oGe="Invalid UNIX mode (must be integer 0..65535)",rGe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",sGe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",aGe="Invalid msdosAttributesRaw (must be integer 0..255)",cGe="Invalid msdosAttributes (must be an object with boolean flags)",lGe="Invalid level (must be integer 0..9)",dGe="Signature data exceeds 64KB",WAe=new Uint8Array([7,0,2,0,65,69,3,0,0]),M1t=4,w1t=9,k1t=67,U1t=1,Kie="infozip",Jie="unix",D1t=9,Uie=0,vAe=[],jM=class{constructor(t,n={}){t=new HV(t);let{availableSize:i=sZ,maxSize:o=sZ}=t,r=i>0&&i!==sZ&&o>0&&o!==sZ;Object.assign(this,{writer:t,addSplitZipSignature:r,options:n,fileEntries:new Map,filenames:new Set,offset:n[yM]===ke?t.size||t.writable.size||0:n[yM],initialOffset:n[yM]===ke?0:n[yM]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Die(this,O1t(this,t))}appendZip(t){return Die(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 Lg(t),await Mc(t),(t.size===ke||!t.readUint8Array)&&(t=new nu(await C0(t.readable)),await Mc(t));let{ZipReader:u}=await Promise.resolve().then(()=>(kie(),CAe)),m=new u(t),p=await m.getEntries();await m.close(),await Mc(n.writer);let{directoryOffset:b}=m;p.forEach(({filename:_})=>{if(o.has(_))throw new Error($ie);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 lCt(t)||(await L0(n.writer,mGe()),n.offset+=4));let y=await dCt(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=uGe(N||bo),_.extraFieldAES&&(I=99);let v=ao(N),X=!!F&&F.uncompressedSize!==ke,Y=!!F&&F.compressedSize!==ke,D=gGe(g,V,G,E,I)&-7|g<<1,{headerArray:M,headerView:O}=bGe({version:S,bitFlag:D,compressionMethod:I,uncompressedSize:A,compressedSize:L,rawLastModDate:Z,rawFilename:R,zip64CompressedSize:Y,zip64UncompressedSize:X,extraFieldLength:v}),{crc32:w}=_;w!==ke&&wc(O,10,w);let{offset:z,diskNumberStart:K}=y.get(_);Object.assign(_,{zip64UncompressedSize:X,zip64CompressedSize:Y,offset:z,diskNumberStart:K,zip64DiskNumberStart:!1,rawExtraFieldZip64:bo,rawExtraFieldAES:bo,rawExtraFieldExtendedTimestamp:bo,rawExtraFieldNTFS:bo,rawExtraFieldUnix:bo,rawExtraField:N,rawCentralExtraField:bo,extendedTimestamp:!1,headerArray:M,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=B1t(o,t,n,i);r.add(s);let a=()=>r.delete(s);return Promise.prototype.then.call(s,a,a),Die(o,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==aZ&&(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=bo,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;if(!(t instanceof Uint8Array))throw new Error(MAe);if(ao(t)>65535)throw new Error(eoe);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 oCt(i,t,n),!Hz(r)&&qi(i,n,mz)||await s.getWriter().close(),r.getData?r.getData():s}};var jie=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Die(e,t){let n=new jie((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 O1t(e,t){if(e.filenames.size)throw new Error(tGe);await e.appendZipEntries(t)}async function B1t(e,t,n,i){if(i=Object.assign({},i),qi(e,i,pZ)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error($ie);e.filenames.add(t),Uie<Eg().maxWorkers?Uie++:await new Promise(o=>vAe.push(o));try{return await z1t(e,t,n,i)}catch(o){throw e.filenames.delete(t),o}finally{let o=vAe.shift();o?o():Uie--}}async function z1t(e,t,n,i){let o=H1t(e,t,i);({name:t}=o);let r=K1t(e,t,i),{comment:s}=r,a=i[$z];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 FEe(Eg())&&(p.level=0);let b=await J1t(e,n,r,i);({reader:n}=b);let f=QM(e.writer),y=Fg(e.writer);i=Object.assign({},i,o.resolvedOptions,r.resolvedOptions,b.resolvedOptions,{signature:i[qz],crc32:i.crc32===ke?i[qz]:i.crc32,offset:e.offset-f,diskNumberStart:y,[AV]:e.options[AV]});let _=$1t(i),S=tCt(i),Z=ao(_.localHeaderArray,S.dataDescriptorArray);m=await Q1t(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,[Jz]:m.internalFileAttributes,[jz]:m.externalFileAttributes}),new Jx(m)}function H1t(e,t,n){let i=qi(e,n,Nne),o=qi(e,n,wne,i?20:768),r=qi(e,n,Une),s=oE(e,n,"uid"),a=oE(e,n,"gid"),c=oE(e,n,One),d=qi(e,n,WVe),u=qi(e,n,Bne),m=qi(e,n,zne),p=qi(e,n,Hne);if(LV(s,4294967295,nGe),LV(a,4294967295,iGe),LV(c,65535,oGe),d!==ke&&d!==Kie&&d!==Jie)throw new Error(rGe);if(d===Jie&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(sGe);d===ke&&(s!==ke||a!==ke)&&(d=Kie);let b=oE(e,n,Pne),f=qi(e,n,Xne),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),LV(b,255,aGe),f&&(typeof f!==oVe||Array.isArray(f)))throw new Error(cGe);if(o>65535)throw new Error(toe);let S=pGe(e,n,Ine,jz),Z=S!==ke;Z||(S=0),!n[pZ]&&t.endsWith("/")&&(n[pZ]=!0);let R=qi(e,n,pZ);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}=eCt(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 K1t(e,t,n){let i=Qie(e,n,LVe)||vV,o=i(t,hz);if(o===ke&&(o=vV(t)),ao(o)>65535)throw new Error(DAe);let r=n[MM]||"";if(typeof r!=aZ)throw new Error(kAe);let s=i(r,fz);if(s===ke&&(s=vV(r)),ao(s)>65535)throw new Error(wAe);let a=qi(e,n,Mne);if(a!==ke&&a>65535)throw new Error(toe);let c=Hie(e,n,KV,new Date),d=qi(e,n,JV),u=Hie(e,n,kM),m=Hie(e,n,UM),p=pGe(e,n,Fne,Jz,0),b=qi(e,n,az),f=qi(e,n,rz),y=qi(e,n,sz);gz(f,y);let _=oE(e,n,TVe,3),S=qi(e,n,kne),Z=qi(e,n,_Ve,!0),R=qi(e,n,SVe),C=qi(e,n,ZVe,!0),E=qi(e,n,lz),A=qi(e,n,uz),L=qi(e,n,CVe),F=Qie(e,n,VVe),I=qi(e,n,EVe,!0),N=bz(qi(e,n,cz)),g=qi(e,n,AVe,!0),V=qi(e,n,Dne),G=b||V===ke?ke:Ez(V);if(!b&&V!==ke&&V!==0&&V!==8&&!G)throw new Error(Y1t);let v=oE(e,n,RVe);if(LV(v,D1t,lGe),e.options[AV]){if(f!==ke||y!==ke)throw new Error(BAe);v===ke&&V===ke&&(v=0)}b&&(v=ke);let X=qi(e,n,dz),Y=qi(e,n,Kte);L&&Y===ke&&(Y=!1),(Y===ke||S&&!b)&&(Y=!0),v!==ke&&v!=6&&(X=!1);let D=qi(e,n,Qz);if(!S&&(f!==ke||y!==ke)&&!(Number.isInteger(_)&&_>=1&&_<=3))throw new Error(OAe);let M=Oie(n[$z]),O=Oie(n[vVe]),w=Oie(n[FVe]);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:M,rawLocalExtraField:O,rawCentralExtraField:w}}}function Oie(e){if(!e)return bo;if(!(e instanceof Map))throw new Error(HAe);let t=0,n=0;e.forEach((r,s)=>{if(Qte(s,65535,KAe),!(r instanceof Uint8Array))throw new Error(JAe);if(ao(r)>65535)throw new Error(RH);t+=4+ao(r)});let i=new Uint8Array(t),o=hi(i);return e.forEach((r,s)=>{G0(o,n,s),G0(o,n+2,ao(r)),ew(i,r,n+4),n+=4+ao(r)}),i}async function J1t(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!qi(e,i,pZ))throw new Error(eGe);let o;return t&&(t=new Lg(t),await Mc(t),{size:o}=t),Object.assign({reader:t},j1t(e,!!t,o,n,i))}function j1t(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[wM],y===ke)throw new Error(qAe);if(b===ke)throw new Error($Ae)}let _=m===!0,S=qi(e,o,Yne);if(t&&r&&!S&&ao(a,c))throw new Error(zAe);let Z=t&&(!!(a&&ao(a)||c&&ao(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?YAe(y)+R:n):n===ke?(u=!0,(m||m===ke)&&(m=!0,y=f=4294967296)):(o.uncompressedSize=y=n,f=(qie(b,p)?YAe(y):y)+R));let C=!Z&&(!t||n===0&&!r)&&!qie(b,p);C&&!s&&qi(e,o,Kte)===ke&&(u=!1);let E=_||y>=4294967295,A=_||f>=4294967295;if(E||A){if(m===!1)throw new Error(CH);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 Q1t(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[AV],_=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:sZ}),L.size=0,await Mc(s)):(L=s,await F,await I()),await Mc(L);let g=QM(s);e.addSplitZipSignature&&!S&&await PAe(e,s),y&&!S&&FAe(i,e.offset-g);let{localHeaderArray:V}=m;S||await N();let G=Fg(s),v=qM(e,s);if(_.diskNumberStart=G,S||(C=!0,E=s.size,await L0(L,V)),_=await q1t(n,L,_,i,Eg(),o),S||(C=!1),r.set(t,_),_.filename=t,S){if(await Promise.all([L.writable.getWriter().close(),F]),await I(),e.addSplitZipSignature&&await PAe(e,s),R=!0,E=s.size,await N(),_.diskNumberStart=Fg(s),_.offset=qM(e,s),y){let X=i.metadataSize;FAe(i,e.offset-QM(s)),_.size+=i.metadataSize-X}iCt(_,m.localHeaderView,o),await L0(s,m.localHeaderArray),await hGe(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(){rE(s,ao(m.localHeaderArray))&&await s.closeDisk()}}async function q1t(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:M,zipCrypto:O,dataDescriptor:w,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:Mi,codecURI:jn}=s,Si={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,pi=0;pt||(Gi=0);let{writable:Zi}=t;if(e){let On=Ff(Rne(e)),rn=e.size,Hn={options:{codecType:kV,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:Mi,codecURI:jn,compressionMethod:S},config:r,streamOptions:{signal:Ge,size:rn,onstart:he,onprogress:Ze,onend:ye}};try{let $i=await Uz({readable:On,writable:Zi},Hn);if(pi=$i.outputSize,t.size+=pi,pt||(Gi=$i.inputSize,(!f||O)&&(Hi=$i.crc32)),!M&&pi>=4294967295||!D&&Gi>=4294967295)throw new Error(CH)}catch($i){throw $i.outputSize!==ke&&(t.size+=$i.outputSize),$i}}return nCt({crc32:Hi,compressedSize:pi,uncompressedSize:Gi,headerInfo:a,dataDescriptorInfo:c},s),w&&await L0(t,I),Object.assign(Si,{uncompressedSize:Gi,compressedSize:pi,lastModDate:p,rawLastModDate:b,creationDate:V,lastAccessDate:g,encrypted:!!f,zipCrypto:!!O,size:d+pi,compressionMethod:S,version:_,headerArray:u,headerView:m,signature:Hi,crc32:f&&!O&&!pt?ke:Hi,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:D,zip64CompressedSize:M}),Si}function $1t(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&&qie(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=ju(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=bo;let v;if(Z&&!c){let Ze=ju(ao(WAe)+2);Ze.writeUint16(39169),Ze.writeBytes(WAe),v=Ze.array,v[8]=f}else v=bo;let X,Y,D;if(y){let Ze=_H(n),ye=fGe(Ze);if(ye){let Ae=9+(o?4:0)+(r?4:0),Fe=ju(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(XAe(_H(o))),r&&Fe.writeUint32(XAe(_H(r))),Y=Fe.array}else Y=bo;if(_===ke?!ye||!!(o||r):_)try{let Ae=zie(n),Fe=ju(36);Fe.writeUint16(10),Fe.writeUint16(32),Fe.skip(4),Fe.writeUint16(1),Fe.writeUint16(24),Fe.writeUint64(Ae),Fe.writeUint64(o?zie(o):Ae),Fe.writeUint64(r?zie(r):Ae),X=Fe.array}catch{X=bo}else X=bo}else X=Y=bo;let M;try{let{uid:Ze,gid:ye,unixExtraFieldType:Ge}=e;if(Ge==Kie&&(Ze!==ke||ye!==ke)){let Ae=IAe(Ze===ke?0:Ze),Fe=IAe(ye===ke?0:ye),tt=3+Ae.length+Fe.length,Be=ju(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),M=Be.array}else if(Ge==Jie&&(Ze!==ke||ye!==ke)){let Ae=ju(8);Ae.writeUint16(30805),Ae.writeUint16(4),Ae.writeUint16((Ze===ke?0:Ze)&65535),Ae.writeUint16((ye===ke?0:ye)&65535),M=Ae.array}else M=bo}catch{M=bo}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[M1t]=U1t),G0(hi(v),w1t,F),F=99);let w=G?ao(N):0,z=w+ao(v,Y,X,M,p,b),K=e[AV]?k1t:0;if(z+K>65535)throw new Error(RH);let te=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:H,headerView:$,rawLastModDate:ee}=bGe({version:L,bitFlag:gGe(s,d,u,Z,F),compressionMethod:F,uncompressedSize:E,lastModDate:te<EV?EV:te>Hte?Hte:te,rawLastModDate:i,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:R,extraFieldLength:z}),le=ju(30+ao(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(M),le.writeBytes(p),le.writeBytes(b),u&&(C||wc(he,18,0),R||wc(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:bo,localExtraFieldZip64Length:w,rawExtraFieldExtendedTimestamp:Y,rawExtraFieldNTFS:X,rawExtraFieldUnix:M,rawExtraFieldAES:v,extraFieldLength:z}}function FAe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=64-(t+ao(i))%64;r<4&&(r+=64);let s=new Uint8Array(r),a=hi(s);G0(a,0,6534),G0(a,2,r-4);let c=i;n.localHeaderArray=i=new Uint8Array(ao(c)+r),ew(i,c),ew(i,s,ao(c));let d=hi(i);G0(d,28,o+r),n.localHeaderView=d,e.metadataSize+=r}function IAe(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 eCt(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 tCt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=bo,o,r=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),o=hi(i),n&&(r=4,wc(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function nCt({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&&(wc(d,10,e),c&&wc(m,p,e)),r?c&&($M(m,p+4,BigInt(t)),$M(m,p+12,BigInt(n))):(wc(d,14,t),wc(d,18,n),c&&(wc(m,p+4,t),wc(m,p+8,n)))}function iCt({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)&&wc(d,14,o),c||wc(d,18,r),a||wc(d,22,s)),n&&i){let p=30+ao(e)+4;$M(d,p,BigInt(s)),$M(d,p+8,BigInt(r))}}async function oCt(e,t,n){let i=rCt(e.fileEntries),{directoryStart:o,directoryEnd:r,directoryArray:s}=await sCt(e,i,n),a=await aCt(e,s,n);await cCt(e,t,n,{directoryStart:o,directoryEnd:r,directoryDataLength:i,signatureLength:a})}function rCt(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=ju(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=bo;n.rawExtraFieldZip64=R,n.zip64Offset=S,n.zip64DiskNumberStart=Z;let C,E=_H(p);if(u&&fGe(E)){let L=ju(9);L.writeUint16(21589),L.writeUint16(5),L.writeUint8(m),L.writeUint32(E),C=L.array}else C=bo;n.rawExtraFieldExtendedTimestamp=C;let A=ao(R,o,s,a,C,c,d);if(A>65535)throw new Error(RH);t+=46+ao(i,r)+A}return t}async function sCt(e,t,n){let{fileEntries:i,writer:o}=e,r=new Uint8Array(t);await Mc(o);let s=0,a=0,c=Fg(o),d=QM(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:M}=p,O=ao(y,_,S,Z,R,C,E),w=46+ao(f,A)+O;rE(o,s+w-a)&&(await L0(o,r.slice(a,s)),a=s,u=0,await o.closeDisk()),m==0&&(c=Fg(o),d=QM(o)),N||wc(I,18,D),g||wc(I,14,M),(G||V)&&p.version<45&&G0(I,0,45);let z=ju(w);if(z.writeUint32(33639248),z.writeUint16(L),z.writeBytes(F.subarray(0,24)),z.writeUint16(O),z.writeUint16(ao(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),ew(r,z.array,s),s+=w,u++,n.onprogress)try{await n.onprogress(m+1,i.size,new Jx(p))}catch{}}return await L0(o,a?r.slice(a):r),{directoryStart:{diskNumber:c,diskOffset:d},directoryEnd:{diskNumber:Fg(o),entriesLength:u},directoryArray:r}}async function aCt(e,t,n){let i=Qie(e,n,YVe);if(i){let o=await i(t),r=ao(o);if(r>65535)throw new Error(dGe);let s=ju(6+r);s.writeUint32(84233040),s.writeUint16(r),s.writeBytes(o);let{writer:a}=e;return rE(a,ao(s.array))&&await a.closeDisk(),await L0(a,s.array),6+r}return 0}async function cCt(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=qM(e,r),p=ao(t);if(p>65535)throw new Error(eoe);let b=qi(e,n,Qz),f=Fg(o);if(rE(o,(b?98:22)+p)&&f++,m>=4294967295||c>=4294967295||d>=65535||f>=65535){if(b===!1)throw new Error(CH);b=!0}let y=ju(b?98:22);rE(o,ao(y.array)+p)&&await o.closeDisk(),f=Fg(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(qM(e,o))+BigInt(c)+BigInt(a)),y.writeUint32(f+1),qi(e,n,GVe,!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 L0(o,y.array),p&&await L0(o,t)}function ju(e){let t=new Uint8Array(e),n=hi(t),i=0;return{array:t,writeUint8:o=>{hCt(n,i,o),i+=1},writeUint16:o=>{G0(n,i,o),i+=2},writeUint32:o=>{wc(n,i,o),i+=4},writeUint64:o=>{$M(n,i,BigInt(o)),i+=8},writeBytes:o=>{ew(t,o,i),i+=ao(o)},skip:o=>i+=o}}function Fg(e){let{diskNumber:t=0}=e;return t}function QM(e){let{diskOffset:t=0}=e;return t}function rE(e,t){let{availableSize:n=sZ}=e;return t>n}function qM(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function lCt(e){let t=await Mr(e,0,4);return mCt(hi(t),0)==134695760}function uGe(e){let t=hi(e),n=0;for(;n+4<=ao(e);){let i=4+ZH(t,n+2);if(ZH(t,n)==1)return uGe(lh(e.subarray(0,n),e.subarray(Math.min(n+i,ao(e)))));n+=i}return e}async function dCt(e,t,n,i){let{writer:o}=e,r=new Map;if(o.closeDisk){let s=Array.from(n).sort((c,d)=>TH(t,c)-TH(t,d)),a=0;for(let c of s){let d=TH(t,c);await Bie(e,t,a,d-a),rE(o,await uCt(t,d))&&await o.closeDisk(),r.set(c,{offset:qM(e,o),diskNumberStart:Fg(o)}),a=d}await Bie(e,t,a,i-a)}else{let s=e.offset;await Bie(e,t,0,i),n.forEach(a=>r.set(a,{offset:s+TH(t,a),diskNumberStart:0}))}return r}async function Bie(e,t,n,i){if(i>0){let{writer:o}=e,r=0;try{await hGe(Rne(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 uCt(e,t){let n=await Mr(e,t,30);if(ao(n)<30)return 30;let i=hi(n);return 30+ZH(i,26)+ZH(i,28)}function TH(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function mGe(){let e=new Uint8Array(4);return wc(hi(e),0,134695760),e}async function PAe(e,t){delete e.addSplitZipSignature,await L0(t,mGe()),e.offset+=4}async function L0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=ao(t),await i.write(t)}finally{i.releaseLock()}}async function hGe(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(ao(r))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function zie(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<GAe?GAe:t>LAe?LAe:t}}function _H(e){return Math.floor(e.getTime()/1e3)}function fGe(e){return e>=jAe&&e<=QAe}function XAe(e){return Math.min(QAe,Math.max(jAe,e))}function qi(e,t,n,i){let o=t[n]===ke?e.options[n]:t[n];return o===ke?i:o}function Hie(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(UAe);return o}function Qie(e,t,n){return GV(qi(e,t,n))}function pGe(e,t,n,i,o){let r=NAe(t,n,i),s=r===ke?NAe(e.options,n,i):r;return s===ke?o:s}function NAe(e,t,n){return e[t]===ke?e[n]:e[t]}function oE(e,t,n,i){return cZ(qi(e,t,n,i))}function YAe(e){return e+5*(Math.floor(e/16383)+1)}function qie(e,t){return e===ke?t===ke||t>0:e!==0}function ZH(e,t){return e.getUint16(t,!0)}function mCt(e,t){return e.getUint32(t,!0)}function hCt(e,t,n){e.setUint8(t,n)}function G0(e,t,n){e.setUint16(t,n,!0)}function wc(e,t,n){e.setUint32(t,n,!0)}function $M(e,t,n){e.setBigUint64(t,n,!0)}function ew(e,t,n){e.set(t,n)}function ao(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function bGe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:d,extraFieldLength:u}){let m=ju(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);G0(y,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),G0(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(ao(a)),m.writeUint16(u),{headerArray:p,headerView:b,rawLastModDate:s}}function gGe(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}Kz();xM();var HDi=x(T(),1);S0();uZ();var $Di=x(T(),1);pc();S0();uZ();lne();var tOi=x(T(),1);var oOi=x(T(),1);var nOi=1024*1024;var cOi=x(T(),1);XV();var sOi=1024*1024;var mOi=x(T(),1);var lOi=1024*1024;var dOi=512*1024;var pCt={};try{WV({baseURI:pCt.url})}catch{}var fBi=x(T(),1);S0();var KOi=x(T(),1),bCt=[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],gCt=[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],yCt=[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],xCt=[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],TCt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],nw=new Uint8Array(288);nw.fill(8,0,144),nw.fill(9,144,256),nw.fill(7,256,280),nw.fill(8,280,288);var _Ct=new Uint8Array(30).fill(5);function tw(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 Qu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function yGe(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+=Qu[a>>18&63]+Qu[a>>12&63]+Qu[a>>6&63]+Qu[63&a]}let s=o-r;if(s===1){let a=n[r]<<16;i+=Qu[a>>18&63]+Qu[a>>12&63]+"=="}else if(s===2){let a=n[r]<<16|n[r+1]<<8;i+=Qu[a>>18&63]+Qu[a>>12&63]+Qu[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(tw(nw),tw(_Ct));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=bCt[R]+u(gCt[R]),E=f(S),A=yCt[E]+u(xCt[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[TCt[L]]=u(3);let C=tw(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[tw(E.subarray(0,_)),tw(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=Qu.indexOf(n[r])<<18|Qu.indexOf(n[r+1])<<12|(63&Qu.indexOf(n[r+2]))<<6|63&Qu.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+6p9rF6PqxrQtnNre3VTauZfP8Q2rm4Ojy3OntwQNn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z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}var dBi=x(T(),1);pc();S0();IM();Dz();var eBi=x(T(),1);var jOi=x(T(),1),AH="deflate",VH="deflate-raw",xGe="deflate64-raw",EH="gzip",Ws,sE,Ig,iw,TGe;function _Ge(e){if(Ws=e,{malloc:sE,free:Ig,memory:iw}=Ws,typeof sE!="function"||typeof Ig!="function"||!iw)throw Ws=sE=Ig=iw=null,new Error("Invalid WASM module")}function SGe(e){TGe=e}function ZGe(e,t,n={}){if(!Ws){let a=new Error("WASM module not loaded");throw a.cause=TGe,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=sE(o),this.in=sE(r),this.inBufferSize=r,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(o),e?(this._process=Ws.deflate_process,this._last_consumed=Ws.deflate_last_consumed,this._end=Ws.deflate_end,this.streamHandle=Ws.deflate_new(),t===EH?a=Ws.deflate_init_gzip(this.streamHandle,i):t===VH?a=Ws.deflate_init_raw(this.streamHandle,i):a=Ws.deflate_init(this.streamHandle,i)):t===xGe?(this._process=Ws.inflate9_process,this._last_consumed=Ws.inflate9_last_consumed,this._end=Ws.inflate9_end,this.streamHandle=Ws.inflate9_new(),a=Ws.inflate9_init_raw(this.streamHandle)):(this._process=Ws.inflate_process,this._last_consumed=Ws.inflate_last_consumed,this._end=Ws.inflate_end,this.streamHandle=Ws.inflate_new(),t===VH?a=Ws.inflate_init_raw(this.streamHandle):t===EH?a=Ws.inflate_init_gzip(this.streamHandle):a=Ws.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(iw.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&&Ig&&(Ig(this.in),this.in=0),this.in=sE(_),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(iw.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&&Ig&&Ig(a.in),a.in=0,a.out&&Ig&&Ig(a.out),a.out=0,c}}var SZ=class{constructor(t=AH,n){return ZGe(!0,t,n)}},ZZ=class{constructor(t=AH,n){return ZGe(!1,t,n)}};SZ.requiresModule=!0;ZZ.requiresModule=!0;SZ.supportedFormats=[AH,VH,EH];ZZ.supportedFormats=[AH,VH,EH,xGe];var RGe=!1;async function CGe(e,{baseURI:t}){if(!RGe)try{await SCt(e,t),RGe=!0}catch(n){throw SGe(n),n}}async function SCt(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=ZCt(e);else throw r}let o=await WebAssembly.instantiate(n);_Ge(o.instance.exports)}function ZCt(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 GH;WEe({initModule:e=>{if(!GH){let{wasmURI:t}=e;typeof t==Yr&&(t=t()),GH=CGe(t,e).catch(n=>{throw GH=null,n})}return GH}});WV({CompressionStreamFallback:SZ,DecompressionStreamFallback:ZZ});yGe(WV);var _Bi=x(T(),1);function RCt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Nn=RCt;var PBi=x(T(),1);var GBi=x(T(),1);var CBi=x(T(),1);function qx(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Se,this.setValue(e)}Object.defineProperties(qx.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});qx.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};qx.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};qx.prototype.equals=function(e){return this===e||e instanceof qx&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};qx.prototype.valueOf=function(){return this._value};qx.prototype.toString=function(){return String(this._value)};var fi=qx;function CCt(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function VCt(e){return new fi(e)}function ECt(e,t,n){return CCt(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??VCt)}var be=ECt;function ow(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(ow.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),image:be("image"),scale:be("scale"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),color:be("color"),rotation:be("rotation"),alignedAxis:be("alignedAxis"),sizeInMeters:be("sizeInMeters"),width:be("width"),height:be("height"),scaleByDistance:be("scaleByDistance"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),imageSubRegion:be("imageSubRegion"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance"),splitDirection:be("splitDirection")});ow.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 ow(this)};ow.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 xl=ow;var r3i=x(T(),1);var NBi=x(T(),1),VGe={FIXED:0,INERTIAL:1};Object.freeze(VGe);var zi=VGe;var QBi=x(T(),1);var MBi=x(T(),1);function noe(){this._removalFunctions=[]}noe.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)}};noe.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Jr=noe;var DBi=x(T(),1);function Pf(){ge.throwInstantiationError()}Object.defineProperties(Pf.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});Pf.prototype.getValue=ge.throwInstantiationError;Pf.prototype.equals=ge.throwInstantiationError;Pf.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Pf.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(!Pf.equals(e[i],t[i]))return!1;return!0};Pf.isConstant=function(e){return!l(e)||e.isConstant};Pf.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Pf.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Pf.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var j=Pf;function ACt(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 RZ(){this._eventHelper=new Jr,this._definitionChanged=new Se,this._intervals=new As,this._intervals.changedEvent.addEventListener(RZ.prototype._intervalsChanged,this)}Object.defineProperties(RZ.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var GCt=new Q;RZ.prototype.getValue=function(e,t){l(e)||(e=Q.now(GCt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};RZ.prototype.equals=function(e){return this===e||e instanceof RZ&&this._intervals.equals(e._intervals,j.equals)};RZ.prototype._intervalsChanged=function(){ACt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Tl=RZ;function $x(e){this._referenceFrame=e??zi.FIXED,this._definitionChanged=new Se,this._composite=new Tl,this._composite.definitionChanged.addEventListener($x.prototype._raiseDefinitionChanged,this)}Object.defineProperties($x.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 LCt=new Q;$x.prototype.getValue=function(e,t){return l(e)||(e=Q.now(LCt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};$x.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};$x.prototype.equals=function(e){return this===e||e instanceof $x&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};$x.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bc=$x;var c3i=x(T(),1);function LH(){ge.throwInstantiationError()}Object.defineProperties(LH.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}});LH.prototype.update=function(e){ge.throwInstantiationError()};LH.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var vs=LH;var E3i=x(T(),1);var g3i=x(T(),1);function ioe(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??Vs.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(ioe.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)}}});ioe.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===Vs.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===Vs.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 Xf=ioe;var T3i=x(T(),1);function WCt(e){return e}function vCt(e,t){return be(e,t,WCt)}var rd=vCt;function CZ(){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(CZ.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:rd("startTime"),stopTime:rd("stopTime"),currentTime:rd("currentTime"),clockRange:rd("clockRange"),clockStep:rd("clockStep"),multiplier:rd("multiplier")});CZ.prototype.clone=function(e){return l(e)||(e=new CZ),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};CZ.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};CZ.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};CZ.prototype.getValue=function(e){return l(e)||(e=new Xf),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 Nf=CZ;var SJi=x(T(),1);var G3i=x(T(),1),EGe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(EGe);var Pg=EGe;var azi=x(T(),1);var ezi=x(T(),1);var N3i=x(T(),1);function aE(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(aE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});aE.prototype.getType=function(e){return"Color"};var FCt=new Q;aE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(FCt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};aE.prototype.equals=function(e){return this===e||e instanceof aE&&j.equals(this._color,e._color)};var Qt=aE;var H3i=x(T(),1);var ICt=new k(1,1),PCt=!1,XCt=U.WHITE;function cE(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(cE.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")});cE.prototype.getType=function(e){return"Image"};var NCt=new Q;cE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(NCt)),l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,ICt,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,XCt,t.color),j.getValueOrDefault(this._transparent,e,PCt)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};cE.prototype.equals=function(e){return this===e||e instanceof cE&&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 eT=cE;function YCt(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 eT;return t.image=e,t}}function MCt(e,t){return be(e,t,YCt)}var ur=MCt;function rw(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(rw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),dimensions:be("dimensions"),heightReference:be("heightReference"),fill:be("fill"),material:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});rw.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 rw(this)};rw.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 VZ=rw;var Zzi=x(T(),1);var pzi=x(T(),1);function lE(){ge.throwInstantiationError()}Object.defineProperties(lE.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError},referenceFrame:{get:ge.throwInstantiationError}});lE.prototype.getValue=ge.throwInstantiationError;lE.prototype.getValueInReferenceFrame=ge.throwInstantiationError;lE.prototype.equals=ge.throwInstantiationError;var AGe=new q;lE.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,AGe);if(n===zi.INERTIAL)return q.multiplyByVector(r,t,o);if(n===zi.FIXED)return q.multiplyByVector(q.transpose(r,AGe),t,o)};var Yf=lE;function EZ(e,t){this._definitionChanged=new Se,this._value=h.clone(e),this._referenceFrame=t??zi.FIXED}Object.defineProperties(EZ.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===zi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var wCt=new Q;EZ.prototype.getValue=function(e,t){return l(e)||(e=Q.now(wCt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};EZ.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)};EZ.prototype.getValueInReferenceFrame=function(e,t,n){return Yf.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};EZ.prototype.equals=function(e){return this===e||e instanceof EZ&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var sd=EZ;var Lzi=x(T(),1);function sw(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(sw.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:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});sw.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 sw(this)};sw.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 AZ=sw;var Nzi=x(T(),1);function aw(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(aw.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:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),slices:be("slices"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});aw.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 aw(this)};aw.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 GZ=aw;var Ozi=x(T(),1);function cw(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(cw.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:ur("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")});cw.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 cw(this)};cw.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 LZ=cw;var Qzi=x(T(),1);function lw(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(lw.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:ur("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")});lw.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 lw(this)};lw.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 WZ=lw;var iHi=x(T(),1);function dw(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(dw.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")});dw.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 dw(this)};dw.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 Mf=dw;var AHi=x(T(),1);var mHi=x(T(),1);var ooe=new px;function uw(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(uw.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 kCt=new Q;uw.prototype.getValue=function(e,t){return l(e)||(e=Q.now(kCt)),l(t)||(t=new px),t.translation=j.getValueOrClonedDefault(this._translation,e,ooe.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,ooe.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,ooe.scale,t.scale),t};uw.prototype.equals=function(e){return this===e||e instanceof uw&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var vZ=uw;var THi=x(T(),1);function Xg(e,t){this._propertyNames=[],this._definitionChanged=new Se,l(e)&&this.merge(e,t)}Object.defineProperties(Xg.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!j.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Xg.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function UCt(e){return new fi(e)}Xg.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,be(e,!0,n??UCt)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Xg.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var DCt=new Q;Xg.prototype.getValue=function(e,t){l(e)||(e=Q.now(DCt)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=j.getValueOrUndefined(this[r],e,t[r])}return t};Xg.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function OCt(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!j.equals(e[s],t[s]))return!1}return!0}Xg.prototype.equals=function(e){return this===e||e instanceof Xg&&OCt(this,e)};var ad=Xg;function GGe(e){return new vZ(e)}function BCt(e){return new ad(e,GGe)}function zCt(e){return new ad(e)}function HCt(e){return new ad(e)}function mw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),uri:be("uri"),scale:be("scale"),enableVerticalExaggeration:be("enableVerticalExaggeration"),minimumPixelSize:be("minimumPixelSize"),maximumScale:be("maximumScale"),incrementallyLoadTextures:be("incrementallyLoadTextures"),runAnimations:be("runAnimations"),clampAnimations:be("clampAnimations"),shadows:be("shadows"),heightReference:be("heightReference"),silhouetteColor:be("silhouetteColor"),silhouetteSize:be("silhouetteSize"),color:be("color"),colorBlendMode:be("colorBlendMode"),colorBlendAmount:be("colorBlendAmount"),imageBasedLightingFactor:be("imageBasedLightingFactor"),environmentMapOptions:be("environmentMapOptions",void 0,HCt),lightColor:be("lightColor"),distanceDisplayCondition:be("distanceDisplayCondition"),nodeTransformations:be("nodeTransformations",void 0,BCt),articulations:be("articulations",void 0,zCt),clippingPlanes:be("clippingPlanes"),customShader:be("customShader")});mw.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 mw(this)};mw.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 ad(t,GGe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new ad(n)}};var Ng=mw;var IHi=x(T(),1);function hw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(hw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),uri:be("uri"),maximumScreenSpaceError:be("maximumScreenSpaceError")});hw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new hw(this)};hw.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var FZ=hw;var kHi=x(T(),1);function fw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(fw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),leadTime:be("leadTime"),trailTime:be("trailTime"),width:be("width"),resolution:be("resolution"),material:ur("material"),distanceDisplayCondition:be("distanceDisplayCondition"),relativeTo:be("relativeTo"),materialMode:be("materialMode")});fw.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 fw(this)};fw.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 Yg=fw;var KHi=x(T(),1);function pw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(pw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),plane:be("plane"),dimensions:be("dimensions"),fill:be("fill"),material:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});pw.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 pw(this)};pw.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 bw=pw;var eKi=x(T(),1);function gw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(gw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),pixelSize:be("pixelSize"),heightReference:be("heightReference"),color:be("color"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),scaleByDistance:be("scaleByDistance"),translucencyByDistance:be("translucencyByDistance"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance"),splitDirection:be("splitDirection")});gw.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 gw(this)};gw.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 IZ=gw;var lKi=x(T(),1);function KCt(e){return Array.isArray(e)&&(e=new Wc(e)),new fi(e)}function yw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(yw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),hierarchy:be("hierarchy",void 0,KCt),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),stRotation:be("stRotation"),granularity:be("granularity"),fill:be("fill"),material:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),perPositionHeight:be("perPositionHeight"),closeTop:be("closeTop"),closeBottom:be("closeBottom"),arcType:be("arcType"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex"),textureCoordinates:be("textureCoordinates")});yw.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 yw(this)};yw.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 wf=yw;var bKi=x(T(),1);function xw(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._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??B.EMPTY_OBJECT)}Object.defineProperties(xw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),positions:be("positions"),width:be("width"),granularity:be("granularity"),material:ur("material"),depthFailMaterial:ur("depthFailMaterial"),arcType:be("arcType"),clampToGround:be("clampToGround"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});xw.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 xw(this)};xw.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 _l=xw;var ZKi=x(T(),1);function Tw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(Tw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),positions:be("positions"),shape:be("shape"),cornerType:be("cornerType"),granularity:be("granularity"),fill:be("fill"),material:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});Tw.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 Tw(this)};Tw.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 PZ=Tw;var LKi=x(T(),1);function _w(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(_w.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),coordinates:be("coordinates"),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:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});_w.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 _w(this)};_w.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 kf=_w;var NKi=x(T(),1);function Sw(e){this._definitionChanged=new Se,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??B.EMPTY_OBJECT)}Object.defineProperties(Sw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),positions:be("positions"),minimumHeights:be("minimumHeights"),maximumHeights:be("maximumHeights"),granularity:be("granularity"),fill:be("fill"),material:ur("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});Sw.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 Sw(this)};Sw.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 Mg=Sw;var JCt=new pe,roe=[];function jCt(e){return new sd(e)}function QCt(e){return be(e,void 0,jCt)}function ja(e,t){return be(e,void 0,function(n){return n instanceof t?n:new t(n)})}function hh(e){e=e??B.EMPTY_OBJECT;let t=e.id;l(t)||(t=$n()),this._availability=void 0,this._id=t,this._definitionChanged=new Se,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Pg.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",...roe],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 soe(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)&&soe(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(hh.prototype,{availability:rd("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:rd("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&&soe(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:rd("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&soe(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:ja("billboard",xl),box:ja("box",VZ),corridor:ja("corridor",AZ),cylinder:ja("cylinder",GZ),description:be("description"),ellipse:ja("ellipse",LZ),ellipsoid:ja("ellipsoid",WZ),label:ja("label",Mf),model:ja("model",Ng),tileset:ja("tileset",FZ),orientation:be("orientation"),path:ja("path",Yg),plane:ja("plane",bw),point:ja("point",IZ),polygon:ja("polygon",wf),polyline:ja("polyline",_l),polylineVolume:ja("polylineVolume",PZ),properties:ja("properties",ad),position:QCt("position"),rectangle:ja("rectangle",kf),viewFrom:be("viewFrom"),wall:ja("wall",Mg)});hh.registerEntityType=function(e,t){Object.defineProperties(hh.prototype,{[e]:ja(e,t)}),roe.includes(e)||roe.push(e)};hh.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};hh.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,rd(e,!0))};hh.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};hh.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 o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var LGe=new q,WGe=new h,vGe=new Ne;hh.prototype.computeModelMatrix=function(e,t){let n=j.getValueOrUndefined(this._position,e,WGe);if(!l(n))return;let i=j.getValueOrUndefined(this._orientation,e,vGe);return l(i)?t=P.fromRotationTranslation(q.fromQuaternion(i,LGe),n,t):t=_t.eastNorthUpToFixedFrame(n,void 0,t),t};hh.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=j.getValueOrDefault(t,e,He.NONE),s=j.getValueOrUndefined(this._position,e,WGe);if(r===He.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,W.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,JCt);r===He.CLIP_TO_GROUND?a.height<n&&(a.height=n):bs(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=j.getValueOrUndefined(this._orientation,e,vGe);return l(c)?o=P.fromRotationTranslation(q.fromQuaternion(c,LGe),s,o):o=_t.eastNorthUpToFixedFrame(s,void 0,o),o};hh.supportsMaterialsforEntitiesOnTerrain=function(e){return id.supportsMaterials(e)};hh.supportsPolylinesOnTerrain=function(e){return Ef.isSupported(e)};var nr=hh;var Pji=x(T(),1);var NJi=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=Bt.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??Ur.NONE}var FGe=ss.SHOW_INDEX=0,XGe=ss.POSITION_INDEX=1,qCt=ss.COLOR_INDEX=2,$Ct=ss.OUTLINE_COLOR_INDEX=3,eVt=ss.OUTLINE_WIDTH_INDEX=4,tVt=ss.PIXEL_SIZE_INDEX=5,nVt=ss.SCALE_BY_DISTANCE_INDEX=6,iVt=ss.TRANSLUCENCY_BY_DISTANCE_INDEX=7,oVt=ss.DISTANCE_DISPLAY_CONDITION_INDEX=8,rVt=ss.DISABLE_DEPTH_DISTANCE_INDEX=9,sVt=ss.SPLIT_DIRECTION_INDEX=10;ss.NUMBER_OF_PROPERTIES=11;function qu(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,qu(this,FGe))}},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),qu(this,XGe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),qu(this,nVt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),qu(this,iVt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,qu(this,tVt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),qu(this,qCt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),qu(this,$Ct))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,qu(this,eVt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),qu(this,oVt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,qu(this,rVt))}},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,qu(this,FGe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,qu(this,sVt))}}});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),qu(this,XGe)};var IGe=new ce;ss._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(P.multiplyByPoint(n,e,IGe),ho.computeActualEllipsoidPosition(t,IGe))};var PGe=new ce;ss._computeScreenSpacePosition=function(e,t,n,i){let o=P.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,PGe),PGe);return ho.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)&&Bt.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 Aa=ss;var pji=x(T(),1);var MJi=x(T(),1),tT=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -in float v_splitDirection; -void main() -{ -if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; -if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -float distanceToCenter = length(gl_PointCoord - vec2(0.5)); -float maxDistance = max(0.0, 0.5 - v_pixelDistance); -float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); -float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); -vec4 color = mix(v_outlineColor, v_color, innerAlpha); -color.a *= wholeAlpha; -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; -} -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; -} -#else -if (color.a >= 0.995) -{ -discard; -} -#endif -#endif -out_FragColor = czm_gammaCorrect(color); -czm_writeLogDepth(); -} -`;var kJi=x(T(),1),Zw=`uniform float u_maxTotalPointSize; -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 scaleByDistance; -in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -out float v_splitDirection; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -void main() -{ -vec3 positionHigh = positionHighAndSize.xyz; -vec3 positionLow = positionLowAndOutline.xyz; -float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; -float totalSize = positionHighAndSize.w + outlineWidthBothSides; -float outlinePercent = outlineWidthBothSides / totalSize; -totalSize *= czm_pixelRatio; -float temp = compressedAttribute1.x * SHIFT_RIGHT8; -float show = floor(temp); -#ifdef EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -vec4 color = 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) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; -} -else -{ -lengthSq = dot(positionEC.xyz, positionEC.xyz); -} -#endif -#ifdef EYE_DISTANCE_SCALING -totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif -if (totalSize > 0.0) { -totalSize += 3.0; -} -totalSize = min(totalSize, u_maxTotalPointSize); -if (totalSize < 1.0) -{ -positionEC.xyz = vec3(0.0); -totalSize = 1.0; -} -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency < 0.004) -{ -positionEC.xyz = vec3(0.0); -} -#endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; -float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; -if (lengthSq < nearSq || lengthSq > farSq) { -positionEC.xyz = vec3(0.0, 0.0, 1.0); -} -#endif -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) -{ -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))) -{ -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif -} -} -#endif -v_color = color; -v_color.a *= translucency * show; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency * show; -v_innerPercent = 1.0 - outlinePercent; -v_pixelDistance = 2.0 / totalSize; -gl_PointSize = totalSize * show; -gl_Position *= show; -v_pickColor = pickColor; -v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; -} -`;var aVt=Aa.SHOW_INDEX,loe=Aa.POSITION_INDEX,NGe=Aa.COLOR_INDEX,cVt=Aa.OUTLINE_COLOR_INDEX,lVt=Aa.OUTLINE_WIDTH_INDEX,dVt=Aa.PIXEL_SIZE_INDEX,YGe=Aa.SCALE_BY_DISTANCE_INDEX,MGe=Aa.TRANSLUCENCY_BY_DISTANCE_INDEX,wGe=Aa.DISTANCE_DISPLAY_CONDITION_INDEX,uVt=Aa.DISABLE_DEPTH_DISTANCE_INDEX,mVt=Aa.SPLIT_DIRECTION_INDEX,doe=Aa.NUMBER_OF_PROPERTIES,Sl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function fh(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(doe),this._maxPixelSize=1,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,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??Ni.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(fh.prototype,{length:{get:function(){return uoe(this),this._pointPrimitives.length}}});function kGe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}fh.prototype.add=function(e){let t=new Aa(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};fh.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};fh.prototype.removeAll=function(){kGe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function uoe(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}}fh.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};fh.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};fh.prototype.get=function(e){return uoe(this),this._pointPrimitives[e]};fh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<doe;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function hVt(e,t,n){return new pb(e,[{index:Sl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[loe]},{index:Sl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[loe]},{index:Sl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[NGe]},{index:Sl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[MGe]},{index:Sl.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[YGe]},{index:Sl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[wGe]}],t)}var aoe=new An,WH=new U;function UGe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(me.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),An.fromCartesian(r,aoe);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Sl.positionHighAndSize],d=aoe.high;c(o,d.x,d.y,d.z,s);let u=n[Sl.positionLowAndOutline],m=aoe.low;u(o,m.x,m.y,m.z,a)}var fVt=256;function DGe(e,t,n,i){let o=i._index,r=i.color,s=i.outlineColor,a=i.getPickId(t).color;WH.red=r.alpha,WH.green=s.alpha,WH.blue=a.alpha;let c=n[Sl.compressedAttribute0];c(o,dn.encodeRGB8(r),dn.encodeRGB8(s),dn.encodeRGB8(a),dn.encodeRGB8(WH))}function OGe(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)*fVt+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,b=n[Sl.compressedAttribute1];b(o,m,p,r,a)}function BGe(e,t,n,i){let o=i._index,r=n[Sl.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 zGe(e,t,n,i){let o=i._index,r=n[Sl.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 pVt(e,t,n,i){UGe(e,t,n,i),DGe(e,t,n,i),OGe(e,t,n,i),BGe(e,t,n,i),zGe(e,t,n,i)}function coe(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=Aa._computeActualPosition(u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):me.expand(s,m,s))}r&&me.fromPoints(a,s)}function bVt(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)&&coe(e,i,i.length,t,r,!0)):n===se.MORPHING?coe(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&coe(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function gVt(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var yVt=[];fh.prototype.update=function(e){if(uoe(this),!this.show)return;this._maxTotalPointSize=wt.maximumAliasedPointSize,bVt(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<doe;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=hVt(c,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let A=this._pointPrimitives[E];A._dirty=!1,pVt(this,c,a,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=yVt;E.length=0,(r[loe]||r[lVt]||r[dVt])&&E.push(UGe),(r[NGe]||r[cVt])&&E.push(DGe),(r[aVt]||r[MGe])&&E.push(OGe),r[YGe]&&E.push(BGe),(r[wGe]||r[uVt]||r[mVt])&&E.push(zGe);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,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=P.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,m=me.clone(this._baseVolumeWC,this._boundingVolume)):m=me.clone(this._baseVolume2D,this._boundingVolume),gVt(this,e,m);let b=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,b&&(this._blendOption===Ni.OPAQUE||this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ni.TRANSLUCENT||this._blendOption===Ni.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:[Zw]}),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===Ni.OPAQUE_AND_TRANSLUCENT&&(y=new Je({defines:["OPAQUE"],sources:[tT]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Sl}),y=new Je({defines:["TRANSLUCENT"],sources:[tT]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Sl})),this._blendOption===Ni.OPAQUE&&(y=new Je({sources:[tT]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Sl})),this._blendOption===Ni.TRANSLUCENT&&(y=new Je({sources:[tT]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:Sl})),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===Ni.OPAQUE,L=this._blendOption===Ni.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)}}};fh.prototype.isDestroyed=function(){return!1};fh.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(),kGe(this._pointPrimitives),ue(this)};var dE=fh;var gji=x(T(),1),HGe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],moe=1,Rw=8,as=new Uint32Array(96),Vw=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!==moe)throw new Error(`Got v${o} data when expected v${moe}.`);let r=HGe[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=HGe.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,Rw,t),this.coords=new i(r,Rw+c+d,t*2),this._pos=t*2,this._finished=!0;else{let u=this.data=new o(Rw+a+c+d);this.ids=new this.IndexArrayType(u,Rw,t),this.coords=new i(u,Rw+c+d,t*2),this._pos=0,this._finished=!1,new Uint8Array(u,0,2).set([219,(moe<<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 foe(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++)KGe(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];KGe(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 foe(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;JGe(e,t,s,i,o,r),foe(e,t,n,i,s-1,1-r),foe(e,t,n,s+1,o,1-r)}function JGe(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));JGe(e,t,n,f,y,r)}let s=t[2*n+r],a=i,c=o;for(Cw(e,t,i,n),t[2*o+r]>s&&Cw(e,t,i,o);a<c;){for(Cw(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?Cw(e,t,i,c):(c++,Cw(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function Cw(e,t,n,i){hoe(e,n,i),hoe(t,2*n,2*i),hoe(t,2*n+1,2*i+1)}function hoe(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function KGe(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Uf(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 jGe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var xVt=new nt;function QGe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=_x.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=No.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Aa.getScreenSpaceBoundingBox(e,t,o)),jGe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&$Ge(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=_x.getScreenSpaceBoundingBox(s,t,xVt);jGe(a,n),o=nt.union(o,a,o)}return o}function TVt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&$Ge(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 qGe(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 $Ge(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function poe(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 _Vt=new nt,SVt=new nt,ZVt=new nt;function RVt(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 qp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Cu({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new dE;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 Rf(y,_),Z=[];e._clusterLabels&&poe(i,Z,n,S,e),e._clusterBillboards&&poe(o,Z,n,S,e),e._clusterPoints&&poe(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 Vw(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=No._computeScreenSpacePosition(P.IDENTITY,Y.position,h.ZERO,k.ZERO,n);if(!l(D))continue;let M=1-f/b,O=Y.width=Y.width*M,w=Y.height=Y.height*M;O=Math.max(O,Y.minimumWidth),w=Math.max(w,Y.minimumHeight);let z=D.x-O*.5,K=D.y-w*.5,te=D.x+O,H=D.y+w;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(qGe(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=QGe(D,Y.coord,d,e,_Vt);let M=nt.clone(A,SVt);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 w=N.collection.get(N.index),z=QGe(w,N.coord,d,e,ZVt);h.add(w.position,O,O),nt.union(M,z,M),++V,g.push(w.id)}if(V>=u){let w=h.multiplyByScalar(O,1/V,O);for(qGe(w,V,g,e),p.push({position:w,width:M.width,height:M.height,minimumWidth:A.width,minimumHeight:A.height}),C=0;C<F;++C)Z[L[C]].clustered=!0}else TVt(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}}Uf.prototype._initialize=function(e){this._scene=e;let t=RVt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Uf.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 goe(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 yoe(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Uf.prototype.getLabel=goe("_labelCollection",qp,"_unusedLabelIndices","labelIndex");Uf.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,yoe(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};Uf.prototype.getBillboard=goe("_billboardCollection",Cu,"_unusedBillboardIndices","billboardIndex");Uf.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,yoe(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};Uf.prototype.getPoint=goe("_pointCollection",dE,"_unusedPointIndices","pointIndex");Uf.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,yoe(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function boe(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function CVt(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,boe(e._labelCollection),boe(e._billboardCollection),boe(e._pointCollection))}Uf.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,CVt(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)};Uf.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 $u=Uf;var zji=x(T(),1);var eLe={id:void 0};function Ew(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 Zl(e){this._owner=e,this._entities=new kt,this._addedEntities=new kt,this._removedEntities=new kt,this._changedEntities=new kt,this._suspendCount=0,this._collectionChanged=new Se,this._id=$n(),this._show=!0,this._firing=!1,this._refire=!1}Zl.prototype.suspendEvents=function(){this._suspendCount++};Zl.prototype.resumeEvents=function(){this._suspendCount--,Ew(this)};Object.defineProperties(Zl.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}}});Zl.prototype.computeAvailability=function(){let e=ot.MAXIMUM_VALUE,t=ot.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(ot.MINIMUM_VALUE)&&(e=a),Q.greaterThan(c,t)&&!c.equals(ot.MAXIMUM_VALUE)&&(t=c)}}return ot.MAXIMUM_VALUE.equals(e)&&(e=ot.MINIMUM_VALUE),ot.MINIMUM_VALUE.equals(t)&&(t=ot.MAXIMUM_VALUE),new Vn({start:e,stop:t})};Zl.prototype.add=function(e){e instanceof nr||(e=new nr(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(Zl.prototype._onEntityDefinitionChanged,this),Ew(this),e};Zl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Zl.prototype.contains=function(e){return this._entities.get(e.id)===e};Zl.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(Zl.prototype._onEntityDefinitionChanged,this),Ew(this),!0):!1};Zl.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(Zl.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Ew(this)};Zl.prototype.getById=function(e){return this._entities.get(e)};Zl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(eLe.id=e,t=new nr(eLe),this.add(t)),t};Zl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Ew(this)};var Qa=Zl;var Kji=x(T(),1);function VVt(e,t){this.position=e,this.headingPitchRoll=t}var Aw=VVt;var jji=x(T(),1);function EVt(e,t){this.position=e,this.headingPitchRange=t}var Gw=EVt;var e4i=x(T(),1);function vH(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=[]}vH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};vH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;nLe.call(this,e,t,function(i){n.playlistIndex=0,i||tLe(n._activeEntries),n.tourEnd.raiseEvent(i)})};vH.prototype.stop=function(){tLe(this._activeEntries)};function tLe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function nLe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=AVt.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 AVt(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++,nLe.call(this,e,t,n)}}var Lw=vH;var s4i=x(T(),1);function FH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}FH.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 me(this.view.position);t.flyToBoundingSphere(o,i)}};FH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};FH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ts.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 Ww=FH;var l4i=x(T(),1);function xoe(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}xoe.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};xoe.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var vw=xoe;var g4i=x(T(),1);function wg(e,t){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Jr,this._referenceFrame=t??zi.FIXED,this.setValue(e)}Object.defineProperties(wg.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 GVt=new Q;wg.prototype.getValue=function(e,t){return l(e)||(e=Q.now(GVt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};wg.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};wg.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,wg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};wg.prototype.equals=function(e){return this===e||e instanceof wg&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};wg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var kg=wg;var Z4i=x(T(),1);function iLe(e,t,n){let i=new WeakRef(t),o=e.addEventListener(function(){let r=i.deref();l(r)?n.apply(r,arguments):o()});return o}function XZ(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}e._removeTargetListener=iLe(n.definitionChanged,e,ph.prototype._onTargetEntityDefinitionChanged),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 ph(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Se,this._removeTargetListener=void 0,iLe(e.collectionChanged,this,ph.prototype._onCollectionChanged)}Object.defineProperties(ph.prototype,{isConstant:{get:function(){return j.isConstant(XZ(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=XZ(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 XZ(this)}}});ph.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 ph(e,n,i)};var LVt=new Q;ph.prototype.getValue=function(e,t){let n=XZ(this);return l(e)||(e=Q.now(LVt)),l(n)?n.getValue(e,t):void 0};ph.prototype.getValueInReferenceFrame=function(e,t,n){let i=XZ(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};ph.prototype.getType=function(e){let t=XZ(this);return l(t)?t.getType(e):void 0};ph.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};ph.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};ph.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=XZ(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Ug=ph;var z4i=x(T(),1);var X4i=x(T(),1);var C4i=x(T(),1),oLe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(oLe);var cd=oLe;var A4i=x(T(),1);var Toe=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}},nT=Toe;var rLe={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 sLe(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 aLe(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var _oe=[],Soe=[];function IH(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=aLe(i[r],e),c=Go(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=aLe(i[r],e),!(l(a)&&Q.compare(a,u)>=0||l(m)&&Q.compare(u,m)>=0));){for(_oe[p++]=u,r=r+1,s=0;s<o;s++)Soe[b++]=i[r],r=r+1;a=u}p>0&&(Soe.length=b,sLe(n,d,Soe),_oe.length=p,sLe(t,c,_oe))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function bh(e,t){let n=e;n===Number&&(n=rLe);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=rLe);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=nT,this._lastInterpolationAlgorithm=nT,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=cd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=cd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(bh.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 WVt=new Q;bh.prototype.getValue=function(e,t){l(e)||(e=Q.now(WVt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Go(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===cd.NONE||o!==0&&Q.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===cd.HOLD)return r.unpack(s,0,t);c=this._backwardExtrapolationType===cd.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===cd.NONE||o!==0&&Q.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===cd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);c=this._forwardExtrapolationType===cd.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)};bh.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))};bh.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)}IH(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};bh.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)}IH(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};bh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};bh.prototype.addSamplesPackedArray=function(e,t){IH(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};bh.prototype.removeSample=function(e){let t=Go(this._times,e,Q.compare);return t<0?!1:(cLe(this,t,1),!0)};function cLe(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)}bh.prototype.removeSamples=function(e){let t=this._times,n=Go(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Go(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,cLe(this,n,i-n)};bh.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};bh._mergeNewSamples=IH;var em=bh;function gh(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 em(h,n),this._definitionChanged=new Se,this._referenceFrame=e??zi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(gh.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 vVt=new Q;gh.prototype.getValue=function(e,t){return l(e)||(e=Q.now(vVt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};gh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Yf.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};gh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};gh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};gh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};gh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};gh.prototype.removeSample=function(e){return this._property.removeSample(e)};gh.prototype.removeSamples=function(e){this._property.removeSamples(e)};gh.prototype.equals=function(e){return this===e||e instanceof gh&&j.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var gc=gh;var eQi=x(T(),1);function iT(e){this._definitionChanged=new Se,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(iT.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:zi.FIXED}}});var FVt=new Q;iT.prototype.getValue=function(e,t){return l(e)||(e=Q.now(FVt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};iT.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))};iT.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};iT.prototype.equals=function(e){return this===e||e instanceof iT&&this._value===e._value};iT.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var W0=iT;var aQi=x(T(),1);function NZ(){this._definitionChanged=new Se,this._intervals=new As,this._intervals.changedEvent.addEventListener(NZ.prototype._intervalsChanged,this)}Object.defineProperties(NZ.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var IVt=new Q;NZ.prototype.getValue=function(e,t){l(e)||(e=Q.now(IVt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};NZ.prototype.equals=function(e){return this===e||e instanceof NZ&&this._intervals.equals(e._intervals,j.equals)};NZ.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Dg=NZ;var yLe={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),yLe[t]}},voe;typeof DOMParser<"u"&&(voe=new DOMParser);var PVt=new oz({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),oT=32,lLe=2414016,dLe=1,uLe=16093e3,mLe=.1,hLe=[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"],fLe=["http://www.google.com/kml/ext/2.2"],XVt=["http://www.w3.org/2005/Atom"],De={kml:hLe,gx:fLe,atom:XVt,kmlgx:hLe.concat(fLe)},Foe={Document:ALe,Folder:tEt,Placemark:nEt,NetworkLink:uEt,GroundOverlay:cEt,PhotoOverlay:WLe,ScreenOverlay:aEt,Tour:oEt},Eoe=class{constructor(t){this._dataSource=t,this._deferred=Cd(),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=Og._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=Og._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=Foe[o.localName];if(l(r)&&(De.kml.indexOf(o.namespaceURI)!==-1||De.gx.indexOf(o.namespaceURI)!==-1)&&(r(n,o,i,this),this._timeoutSet||Og._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}o=this._nextNode()}this._pop()&&t&&this._process(!0)}};function NVt(e){let t=e.slice(0,Math.min(4,e.size)),n=Cd(),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 YVt(e){let t=Cd(),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 xLe(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 TLe(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 MVt(e,t){let n=await e.getData(new YM);n=xLe(n),n=TLe(n),t.kml=voe.parseFromString(n,"application/xml")}async function Zoe(e,t){let n=yLe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new XM(n));t[e.filename]=i}function tm(e,t,n,i){let o=i.keys,r=new Fw.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 Fw.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 nm(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=Ioe(a,i);l(c)&&s.setAttribute(n,c.url)}}function _Le(e,t,n){let i=Ga(e,"id");i=l(i)&&i.length!==0?i:$n(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=$n(),l(n)&&(i=n+i)),o=t.add(new nr({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Woe),o}function Iw(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function YH(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 PH(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++]=YH(n[s],t);return o}function rT(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 pLe(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 Df(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 Of(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 Ioe(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 Fw.default(t.getUrlComponent()),s=new Fw.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new ve({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var ou={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Aoe(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?(ou.maximumRed=r,ou.red=void 0):(ou.maximumRed=void 0,ou.red=0),o>0?(ou.maximumGreen=o,ou.green=void 0):(ou.maximumGreen=void 0,ou.green=0),i>0?(ou.maximumBlue=i,ou.blue=void 0):(ou.maximumBlue=void 0,ou.blue=0),ou.alpha=n,U.fromRandom(ou)):new U(r,o,i,n)}function YZ(e,t,n){let i=Yn(e,t,n);if(l(i))return Aoe(i,Yn(e,"colorMode",n)==="random")}function wVt(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 As;return o.addInterval(new Vn({start:i,stop:ot.MAXIMUM_VALUE})),o}function kVt(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 As,n.addInterval(new Vn({start:o,stop:s}))}else l(o)?(n=new As,n.addInterval(new Vn({start:o,stop:ot.MAXIMUM_VALUE}))):l(s)&&(n=new As,n.addInterval(new Vn({start:ot.MINIMUM_VALUE,stop:s})));return n}function SLe(){let e=new xl;return e.width=oT,e.height=oT,e.scaleByDistance=new Kt(lLe,dLe,uLe,mLe),e.pixelOffsetScaleByDistance=new Kt(lLe,dLe,uLe,mLe),e}function Poe(){let e=new wf;return e.outline=!0,e.outlineColor=U.WHITE,e}function ZLe(){let e=new Mf;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Oi.LEFT,e.font="16px sans-serif",e.style=xr.FILL_AND_OUTLINE,e}function Xoe(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=Ioe(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(xu(NH(m))),l(p)&&s.setQueryParameters(xu(NH(p)));let b=t._ellipsoid;return Yoe(s,t.camera,t.canvas,d,t._lastCameraView.bbox,b),s}return s}function UVt(e,t,n,i,o){let r=Ai(t,"scale",De.kml),s=Ai(t,"heading",De.kml),a=YZ(t,"color",De.kml),c=co(t,"Icon",De.kml),d=Xoe(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=rT(f,"x"),_=rT(f,"y"),S=Ga(f,"xunits"),Z=Ga(f,"yunits"),R=n.billboard;l(R)||(R=SLe(),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-oT)*r:S==="fraction"&&(C=-y*oT*r),C+=oT*.5*r),l(_)&&(Z==="pixels"?E=_*r:Z==="insetPixels"?E=(-_+oT)*r:Z==="fraction"&&(E=_*oT*r),E-=oT*.5*r),(l(C)||l(E))&&(R.pixelOffset=new k(C,E))}function XH(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")UVt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=ZLe(),n.label=c),c.scale=Ai(a,"scale",De.kml)??c.scale,c.fillColor=YZ(a,"color",De.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new _l,n.polyline=c),c.width=Ai(a,"width",De.kml),c.material=YZ(a,"color",De.kml),l(YZ(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(Of(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=Poe(),n.polygon=c),c.material=YZ(a,"color",De.kml)??c.material,c.fill=Of(a,"fill",De.kml)??c.fill,c.outline=Of(a,"outline",De.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Aoe(Yn(a,"bgColor",De.kml))??U.WHITE,d=Aoe(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 DVt(e,t,n,i,o){let r=new nr,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")XH(e,m,r,i,o);else{let p=Df(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);XH(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 OVt(e,t,n){return t.fetchXML().then(function(i){return RLe(e,i,n,t,!0)})}function RLe(e,t,n,i,o,r){let s,a,c,d,u=pLe(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 nr({id:a}),n.add(c),XH(e,d,c,i,r)))}let m=pLe(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=Df(_,"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),XH(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(OVt(e,Z,n))}}}return p}function Noe(e,t,n){let i=new Ug(e,t.id,["position"]),o=new W0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new _l,t.polyline.positions=new kg([i,o])}function CLe(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 BVt(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 W0(e))}function zVt(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 MH(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():ZLe(),t.label=o),o.text=t.name;let r=t.billboard;if(l(r)||(r=l(n.billboard)?n.billboard.clone():SLe(),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 VLe(e,t){let n=e.path;l(n)||(n=new Yg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function HVt(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=Of(n,"extrude",De.kml),d=e._ellipsoid,u=YH(r,d);return i.position=u,MH(e,i,o,CLe(s,a)),c&&Iw(s,a)&&Noe(t,i,o),!0}function bLe(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=Of(n,"extrude",De.kml),d=Of(n,"tessellate",De.kml),u=Iw(s,a),m=Ai(n,"drawOrder",De.gx),p=e._ellipsoid,b=PH(r,p),f=o.polyline;if(u&&c){let y=new Mg;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 _l;y.clampToGround=!0,i.polyline=y,y.positions=b,l(f)?(y.material=l(f.material)?f.material.color.getValue(ot.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 _l,i.polyline=f,f.positions=zVt(b,s,a,p),(!d||u)&&(f.arcType=mn.NONE);return!0}function KVt(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=PH(a,c),u=Of(n,"extrude",De.kml),m=Yn(n,"altitudeMode",De.kml),p=Yn(n,"altitudeMode",De.gx),b=Iw(m,p),f=l(o.polygon)?o.polygon.clone():Poe(),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 Wc(d),S=Df(n,"innerBoundaryIs",De.kml);for(let Z=0;Z<S.length;Z++){s=Df(S[Z],"LinearRing",De.kml);for(let R=0;R<s.length;R++)a=co(s[R],"coordinates",De.kml),d=PH(a,c),l(d)&&_.holes.push(new Wc(d))}f.hierarchy=_}return!0}function JVt(e,t,n,i,o){let r=Yn(n,"altitudeMode",De.kml),s=Yn(n,"altitudeMode",De.gx),a=Df(n,"coord",De.gx),c=Df(n,"angles",De.gx),d=Df(n,"when",De.kml),u=Of(n,"extrude",De.kml),m=Iw(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=YH(a[S].textContent,p);f.push(Z),y.push(Q.fromIso8601(d[S].textContent))}let _=new gc;return _.addSamples(y,f),i.position=_,MH(e,i,o,CLe(r,s)),VLe(i,o),i.availability=new As,d.length>0&&i.availability.addInterval(new Vn({start:y[0],stop:y[y.length-1]})),m&&u&&Noe(t,i,o),!0}function gLe(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new gc;m.addSamples(e,t),n.intervals.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:BVt(m,s,a)})),i.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function jVt(e,t,n,i,o){let r=Of(n,"interpolate",De.gx),s=Df(n,"Track",De.gx),a,c,d,u=!1,m=new Dg,p=new As,b=new bc,f=e._ellipsoid;for(let y=0,_=s.length;y<_;y++){let S=s[y],Z=Df(S,"when",De.kml),R=Df(S,"coord",De.gx),C=Yn(S,"altitudeMode",De.kml),E=Yn(S,"altitudeMode",De.gx),A=Iw(C,E),L=Of(S,"extrude",De.kml),F=Math.min(R.length,Z.length),I=[];a=[];for(let N=0;N<F;N++){let g=YH(R[N].textContent,f);I.push(g),a.push(Q.fromIso8601(Z[N].textContent))}r&&(l(c)&&gLe([c,a[0]],[d,I[0]],b,p,m,!1,"absolute",void 0,!1),c=a[F-1],d=I[I.length-1]),gLe(a,I,b,p,m,A&&L,C,E,!0),u=u||A&&L}return i.availability=p,i.position=b,MH(e,i,o),VLe(i,o),u&&(Noe(t,i,o),i.polyline.show=m),!0}var ELe={Point:HVt,LineString:bLe,LinearRing:bLe,Polygon:KVt,Track:JVt,MultiTrack:jVt,MultiGeometry:QVt,Model:qVt};function QVt(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=ELe[u.localName];if(l(m)){let p=_Le(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 qVt(e,t,n,i,o){return xt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function $Vt(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=Df(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 eEt(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=PVt.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&&(tm(Bo,"a","href",i),tm(Bo,"link","href",i),tm(Bo,"area","href",i),tm(Bo,"img","src",i),tm(Bo,"iframe","src",i),tm(Bo,"video","src",i),tm(Bo,"audio","src",i),tm(Bo,"source","src",i),tm(Bo,"track","src",i),tm(Bo,"input","src",i),tm(Bo,"embed","src",i),tm(Bo,"script","src",i),tm(Bo,"video","poster",i)),nm(Bo,"a","href",o),nm(Bo,"link","href",o),nm(Bo,"area","href",o),nm(Bo,"img","src",o),nm(Bo,"iframe","src",o),nm(Bo,"video","src",o),nm(Bo,"audio","src",o),nm(Bo,"source","src",o),nm(Bo,"track","src",o),nm(Bo,"input","src",o),nm(Bo,"embed","src",o),nm(Bo,"script","src",o),nm(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 wH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=_Le(t,i,n.context),c=a.kml,d=DVt(e,t,n.styleCollection,r,s),u=Yn(t,"name",De.kml);a.name=u,a.parent=o;let m=kVt(t);l(m)||(m=wVt(t)),a.availability=m,Moe(a);function p(R){return R?R.show&&p(R.parent):!0}let b=Of(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),$Vt(t,a),eEt(t,a,d,s,r);let Z=e._ellipsoid;return LLe(t,a,Z),GLe(t,a,Z),l(co(t,"Region",De.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function ALe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function tEt(e,t,n,i){let o=wH(e,t,n),r=$e(n);r.parentEntity=o.entity,ALe(e,t,r,i)}function nEt(e,t,n,i){let o=wH(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=ELe[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),MH(e,r,s))}var iEt={FlyTo:sEt,Wait:rEt,SoundCue:Roe,AnimatedUpdate:Roe,TourControl:Roe};function oEt(e,t,n,i){let o=Yn(t,"name",De.kml),r=Ga(t,"id"),s=new Lw(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=iEt[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function Roe(e,t){xt(`KML Tour unsupported node ${t.localName}`)}function rEt(e,t){let n=Ai(t,"duration",De.gx);e.addPlaylistEntry(new vw(n))}function sEt(e,t,n){let i=Ai(t,"duration",De.gx),o=Yn(t,"flyToMode",De.gx),r={kml:{}};LLe(t,r,n),GLe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new Ww(i,o,s);e.addPlaylistEntry(a)}function GLe(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=Vc.fromDegrees(a,c-90,d);t.kml.camera=new Aw(u,m)}}function LLe(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 Lm(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new Gw(m,u)}}function aEt(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=Xoe(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=rT(b,"x"),y=rT(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=rT(p,"x"),y=rT(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=rT(m,"x"),y=rT(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 cEt(e,t,n,i){let r=wH(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=PH(co(t,"LatLonQuad",De.gx),c),u=Ai(t,"drawOrder",De.kml);if(l(d))s=Poe(),s.hierarchy=new Wc(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new kf,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=Xoe(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=YZ(t,"color",De.kml),s.material.transparent=!0}else s.material=YZ(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 WLe(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 sT={INTERVAL:0,EXPIRE:1,STOP:2};function NH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var lEt=new re,uE=new pe,Coe=new k,dEt=new h;function Yoe(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=t_(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??lEt,l(n)&&(Coe.x=n.clientWidth*.5,Coe.y=n.clientHeight*.5,d=t.pickEllipsoid(Coe,r,dEt)),l(d)?u=r.cartesianToCartographic(d,uE):(u=re.center(o,uE),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,uE),c=c.replace("[cameraLon]",W.toDegrees(uE.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(uE.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(uE.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(xu(c))}function uEt(e,t,n,i){let r=wH(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=Ioe(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(xu(NH(S))),l(Z)&&d.setQueryParameters(xu(NH(Z)));let R=e._ellipsoid;Yoe(d,e.camera,e.canvas,m,e._lastCameraView.bbox,R)}let b={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new Qa,y=Loe(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,Moe(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:$n(),href:d,cookie:{},lastUpdated:L,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:L},I=0;if(A&&(F.cookie=xu(Yn(E,"cookie",De.kml)??""),I=Ai(E,"minRefreshPeriod",De.kml)??0),R==="onInterval")A&&(C=Math.max(I,C)),F.refreshMode=sT.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=sT.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=sT.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 mEt(e,t,n,i){let o=Foe[t.localName];return l(o)?o(e,t,n,i):WLe(e,t,n,i)}function Goe(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 Og._DeferredLoading(e),m=new Qa(e);return Promise.all(RLe(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(Foe[_.localName])){p=_;break}}}let b={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),mEt(e,p,b,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}async function hEt(e,t,n,i,o){let r=en("ThirdParty/Workers/zip-web-worker.js"),s=en("ThirdParty/zip-module.wasm");_M({workerURI:r,wasmURI:s});let a=new xZ(new nu(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(Zoe(m,u)),m=b):d.push(Zoe(b,u)))}if(l(m)&&d.push(MVt(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),Goe(e,t,u.kml,i,u,o)}function Loe(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?NVt(d).then(function(u){return u?hEt(e,t,d,o,a):YVt(d).then(function(m){m=xLe(m),m=TLe(m);let p,b;try{p=voe.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 Goe(e,t,p,o,r,a,s)})}):Goe(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}var Og=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 Qa(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Zg,this._networkLinks=new kt,this._entityCluster=new $u,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,vs.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let o=this;return Loe(this,this._entityCollection,t,n).then(function(){let r,s=o._entityCollection.computeAvailability(),a=s.start,c=s.stop,d=Q.equals(a,ot.MINIMUM_VALUE),u=Q.equals(c,ot.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 Nf,r.startTime=a,r.stopTime=c,r.currentTime=Q.clone(a),r.clockRange=Vs.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),vs.setLoading(o,!1),o}).catch(function(r){return vs.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;Voe.removeAll();function r(m){let p=m._children,b=p.length;for(let f=0;f<b;++f){let y=p[f];Voe.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 kt,u=!1;return n.values.forEach(function(m){let p=m.entity;if(!Voe.contains(p.id)){if(!m.updating){let b=!1;if(m.refreshMode===sT.INTERVAL?Q.secondsDifference(i,m.lastUpdated)>m.time&&(b=!0):m.refreshMode===sT.EXPIRE?Q.greaterThan(i,m.time)&&(b=!0):m.refreshMode===sT.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 Qa,y=m.href.clone();y.setQueryParameters(m.cookie);let _=o._ellipsoid??ne.default;Yoe(y,o.camera,o.canvas,m.viewBoundScale,a.bbox,_),Loe(o,f,y,{context:p.id}).then(fEt(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 Moe(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 fEt(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=xu(Yn(a,"cookie",De.kml)??""),d=Ai(a,"minRefreshPeriod",De.kml)??0}let u=Q.now(),m=t.refreshMode;if(m===sT.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===sT.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,Moe(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,ot.MINIMUM_VALUE),A=Q.equals(C,ot.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 Voe=new kt,Woe=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}};Og._DeferredLoading=Eoe;Og._getTimestamp=Zn;var MZ=Og;var q6i=x(T(),1);var m6i=x(T());var L8i=x(T());var E8i=x(T());var R8i=x(T());function woe(e){return e}function kH(e){if(e==null)return woe;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 X8i=x(T());var v8i=x(T());function vLe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function koe(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return FLe(e,n)})}:FLe(e,t)}function FLe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=Uoe(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 Uoe(e,t){var n=kH(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&&vLe(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 U8i=x(T());var Y8i=x(T());var z8i=x(T());var q8i=x(T());var K8i=x(T());var r6i=x(T());var t6i=x(T());var C6i=x(T(),1);function mE(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Se,this.setCallback(e,t)}Object.defineProperties(mE.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var xEt=new Q;mE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(xEt)),this._callback(e,t)};mE.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};mE.prototype.equals=function(e){return this===e||e instanceof mE&&this._callback===e._callback&&this._isConstant===e._isConstant};var Bf=mE;function UH(e){return h.fromDegrees(e[0],e[1],e[2])}var Doe={"urn:ogc:def:crs:OGC:1.3:CRS84":UH,"EPSG:4326":UH,"urn:ogc:def:crs:EPSG::4326":UH},ILe={},PLe={},Ooe=48,Boe,zoe=U.ROYALBLUE,Hoe=U.YELLOW,Koe=2,Joe=U.fromBytes(255,255,0,100),joe=!1,TEt={small:24,medium:48,large:64},_Et=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function XLe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||_Et.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${XLe(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 SEt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function ZEt(e,t){return new Bf(SEt(XLe,e,t),!0)}function DH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=$n();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 fi(c):n(r,s))}return o}function Qoe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var NLe={Feature:MLe,FeatureCollection:REt,GeometryCollection:wLe,LineString:BLe,MultiLineString:zLe,MultiPoint:DLe,MultiPolygon:JLe,Point:ULe,Polygon:KLe,Topology:jLe},YLe={GeometryCollection:wLe,LineString:BLe,MultiLineString:zLe,MultiPoint:DLe,MultiPolygon:JLe,Point:ULe,Polygon:KLe,Topology:jLe};function MLe(e,t,n,i,o){if(t.geometry===null){DH(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=YLe[r];if(!l(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function REt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)MLe(e,r[s],void 0,i,o)}function wLe(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=YLe[d];if(!l(u))throw new ae(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function kLe(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=TEt[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 xl;u.verticalOrigin=new fi(Bn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=He.CLAMP_TO_GROUND);let m=DH(t,e._entityCollection,o.describe);m.billboard=u,m.position=new sd(n(i));let p=Promise.resolve(d).then(function(b){u.image=new fi(b)}).catch(function(){u.image=new fi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function ULe(e,t,n,i,o){kLe(e,t,i,n.coordinates,o)}function DLe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)kLe(e,t,i,r[s],o)}function OLe(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 fi(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=DH(t,e._entityCollection,o.describe),d=new _l;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new fi(Qoe(i,n)),d.arcType=mn.RHUMB}function BLe(e,t,n,i,o){OLe(e,t,i,n.coordinates,o)}function zLe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)OLe(e,t,i,r[s],o)}function HLe(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 fi(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 fi(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 wf;d.outline=new fi(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=mn.RHUMB;let u=[];for(let b=1,f=i.length;b<f;b++)u.push(new Wc(Qoe(i[b],n)));let m=i[0];d.hierarchy=new fi(new Wc(Qoe(m,n),u)),m[0].length>2?d.perPositionHeight=new fi(!0):o.clampToGround||(d.height=0);let p=DH(t,e._entityCollection,o.describe);p.polygon=d}function KLe(e,t,n,i,o){HLe(e,t,i,n.coordinates,o)}function JLe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)HLe(e,t,i,r[s],o)}function jLe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=koe(n,n.objects[r]),a=NLe[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 Qa(this),this._promises=[],this._pinBuilder=new Zg,this._entityCluster=new $u,this._credit=void 0,this._resourceCredits=[]}aT.load=function(e,t){return new aT().load(e,t)};Object.defineProperties(aT,{markerSize:{get:function(){return Ooe},set:function(e){Ooe=e}},markerSymbol:{get:function(){return Boe},set:function(e){Boe=e}},markerColor:{get:function(){return zoe},set:function(e){zoe=e}},stroke:{get:function(){return Hoe},set:function(e){Hoe=e}},strokeWidth:{get:function(){return Koe},set:function(e){Koe=e}},fill:{get:function(){return Joe},set:function(e){Joe=e}},clampToGround:{get:function(){return joe},set:function(e){joe=e}},crsNames:{get:function(){return Doe}},crsLinkHrefs:{get:function(){return ILe}},crsLinkTypes:{get:function(){return PLe}}});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 QLe(this,e,t,!0)};aT.prototype.process=function(e,t){return QLe(this,e,t,!1)};function QLe(e,t,n,i){vs.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??ZEt,markerSize:n.markerSize??Ooe,markerSymbol:n.markerSymbol??Boe,markerColor:n.markerColor??zoe,strokeWidthProperty:new fi(n.strokeWidth??Koe),strokeMaterialProperty:new Qt(n.stroke??Hoe),fillMaterialProperty:new Qt(n.fill??Joe),clampToGround:n.clampToGround??joe},Promise.resolve(r).then(function(a){return CEt(e,a,n,s,i)}).catch(function(a){throw vs.setLoading(e,!1),e._error.raiseEvent(e,a),a})}aT.prototype.update=function(e){return!0};function CEt(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=NLe[t.type];if(!l(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?UH: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=Doe[d.name],!l(c))throw new ae(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=ILe[d.href];if(l(u)||(u=PLe[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=Doe[`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,vs.setLoading(e,!1),e})})}var cT=aT;var Pw={};Pw.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await aa.getExports(e,t);if(i.length>0&&i.every(c=>c.status===aa.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===aa.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)};Pw.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await aa.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![aa.RealityDataType.Cesium3DTiles,aa.RealityDataType.PNTS,aa.RealityDataType.RealityMesh3DTiles,aa.RealityDataType.Terrain3DTiles,aa.RealityDataType.GaussianSplat3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let s=await aa.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...o};return zr.fromUrl(s,a)};Pw.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await aa.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![aa.RealityDataType.KML,aa.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await aa.getRealityDataURL(e,t,i);return n===aa.RealityDataType.GeoJSON?cT.load(r):MZ.load(r)};Pw.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${aa.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new ve({url:o,headers:{Authorization:aa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return cT.load(r)};var qoe=Pw;var m7i=x(T(),1);function OH(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(OH.prototype,{total:{get:function(){return this._total}}});function lT(e){let t=new Array(Lc.NUMBER_OF_JOB_TYPES);t[Lc.TEXTURE]=new OH(l(e)?e[Lc.TEXTURE]:10),t[Lc.PROGRAM]=new OH(l(e)?e[Lc.PROGRAM]:10),t[Lc.BUFFER]=new OH(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}lT.getTimestamp=Zn;Object.defineProperties(lT.prototype,{totalBudget:{get:function(){return this._totalBudget}}});lT.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};lT.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};lT.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=lT.getTimestamp();e.execute();let a=lT.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Xw=lT;var f7i=x(T(),1),$oe=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function Nw(e,t){this.spatialNode=e,this.keyframe=t,this.state=$oe.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}Nw.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=$oe.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};Nw.priorityComparator=function(e,t){return e.priority-t.priority};Nw.searchComparator=function(e,t){return e.keyframe-t.keyframe};Nw.LoadState=$oe;var zo=Nw;var g7i=x(T(),1);function qLe(){}Object.defineProperties(qLe.prototype,{color:{get:ge.throwInstantiationError},intensity:{get:ge.throwInstantiationError}});var ere=qLe;var R7i=x(T(),1);var VEt=/\/$/,$Le=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 hE(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();VEt.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=$Le,this._resource=i,this._imageryProvider=new fs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(hE.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}}});hE.prototype.getTileCredits=function(e,t,n){};hE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};hE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};hE._defaultCredit=$Le;var tre=hE;var eqi=x(T(),1);var Y7i=x(T(),1);function dT(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 Ot}=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??$n(),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,nWe(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");eWe(this,n),this._initialized=!0}else tWe(this);f.bindTexture(this._textureTarget,null)}function eWe(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=nre(y),_=nre(_),S=nre(S),i.texSubImage3D(o,Z+1,0,0,0,y,_,S,d,Ue.toWebGLConstant(u,n),t.mipLevels[Z])}}dT.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?(eWe(this,t),m=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),tWe(this)),this._initialized=!0),m||EEt(this,t.arrayBufferView,n,i,o,c,d,u),s.bindTexture(a,null)};function EEt(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 nre(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function tWe(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)}dT.create=function(e){return new dT(e)};Object.defineProperties(dT.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){nWe(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 nWe(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=qn.NEAREST),Qe.isDepthFormat(s)&&(n=Ht.NEAREST,i=qn.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)}dT.prototype.generateMipmap=function(e){e=e??_m.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)};dT.prototype.isDestroyed=function(){return!1};dT.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var Yw=dT;function v0(e,t,n,i,o=134217728,r){let s=AEt(i),a=GEt(n),c=n*Nt.getSizeInBytes(i),d=v0.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 Yw({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d.x,height:d.y,depth:d.z,sampler:new Ot({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:qn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let m=0;m<this.maximumTileCount;m++)this.nodes[m]=new LEt(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(v0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ot.NEAREST:this.texture.sampler=new Ot({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:qn.LINEAR}),this._nearestSampling=e)}}});function AEt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function GEt(e){switch(e){case 1:return Qe.RED;case 2:return Qe.RG;case 3:return Qe.RGB;case 4:return Qe.RGBA}}function LEt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}v0.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};v0.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--};v0.prototype.isFull=function(){return this.emptyList===void 0};v0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=wt;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=iWe(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}iWe(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 iWe(e){return e.reduce((t,n)=>t*n)}v0.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)};v0.prototype.isDestroyed=function(){return!1};v0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var Mw=v0;var hqi=x(T(),1);var yc={};yc.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}`)};yc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=yc.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};yc.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=yc.decodeRawMetadataValueComponent(e,t,p);u[m]=b}return u}let c=n*a;return yc.decodeRawMetadataValueComponent(e,t,c)};yc.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=yc.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return yc.decodeRawMetadataValueElement(e,n,0)};yc.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}`)};yc.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}`)};yc.decodeMetadataValues=function(e,t,n){let i=yc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=yc.convertFromObjectType(e.type,t.offset),s=yc.convertFromObjectType(e.type,t.scale);i=kp.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=yc.convertToObjectType(e.type,c);s[a]=d}return s}return yc.convertToObjectType(e.type,i)};var ww=Object.freeze(yc);var t$i=x(T(),1);var Wqi=x(T(),1);var Sqi=x(T(),1);var pqi=x(T(),1);function WEt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var kw=WEt;var gWe={},vEt=32.184,FEt=2451545,oWe=-.0529921,rWe=-.1059842,sWe=13.0120009,aWe=13.3407154,cWe=.9856003,lWe=26.4057084,dWe=13.064993,uWe=.3287146,mWe=1.7484877,hWe=-.1589763,fWe=.0036096,pWe=.1643573,bWe=12.9590088,ire=new Q;gWe.ComputeMoon=function(e,t){l(e)||(e=Q.now()),ire=Q.addSeconds(e,vEt,ire);let n=Q.totalDays(ire)-FEt,i=n/wn.DAYS_PER_JULIAN_CENTURY,o=(125.045+oWe*n)*W.RADIANS_PER_DEGREE,r=(250.089+rWe*n)*W.RADIANS_PER_DEGREE,s=(260.008+sWe*n)*W.RADIANS_PER_DEGREE,a=(176.625+aWe*n)*W.RADIANS_PER_DEGREE,c=(357.529+cWe*n)*W.RADIANS_PER_DEGREE,d=(311.589+lWe*n)*W.RADIANS_PER_DEGREE,u=(134.963+dWe*n)*W.RADIANS_PER_DEGREE,m=(276.617+uWe*n)*W.RADIANS_PER_DEGREE,p=(34.226+mWe*n)*W.RADIANS_PER_DEGREE,b=(15.134+hWe*n)*W.RADIANS_PER_DEGREE,f=(119.743+fWe*n)*W.RADIANS_PER_DEGREE,y=(239.961+pWe*n)*W.RADIANS_PER_DEGREE,_=(25.053+bWe*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),M=Math.cos(c),O=Math.cos(d),w=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*w+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*oWe+.1208*X*rWe-.0642*Y*sWe+.0158*D*aWe+.0252*M*cWe-.0066*O*lWe-.0047*w*dWe-.0046*z*uWe+.0028*K*mWe+.0052*te*hWe+.004*H*fWe+.0019*$*pWe-.0044*ee*bWe)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new kw),t.rightAscension=le,t.declination=_e,t.rotation=he,t.rotationRate=Ze,t};var Uw=gWe;function yWe(e){(!l(e)||typeof e!="function")&&(e=Uw.ComputeMoon),this._computeFunction=e}var IEt=new h,PEt=new h,XEt=new h;function NEt(e,t,n){let i=IEt;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=XEt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,PEt);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 YEt=new q,MEt=new Ne;yWe.prototype.evaluate=function(e,t){l(e)||(e=Q.now());let n=this._computeFunction(e),i=NEt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Ne.fromAxisAngle(h.UNIT_Z,o,MEt),s=q.fromQuaternion(Ne.conjugate(r,r),YEt);return q.multiply(s,i,i)};var Dw=yWe;var wqi=x(T(),1);var ore={};function wEt(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var kEt=32.184,UEt=2451545;function NWe(e,t){t=Q.addSeconds(e,kEt,t);let n=Q.totalDays(t)-UEt;return t=Q.addSeconds(t,wEt(n),t),t}var BH=new Q(2451545,0,ci.TAI),DEt=1e3,yh=W.RADIANS_PER_DEGREE,im=W.RADIANS_PER_ARCSECOND,kc=14959787e4,xWe=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=BEt(r-i,t),m=OEt(t,0);jEt(c,n,d,xWe);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(xWe,s,s)}function OEt(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function BEt(e,t){let n=KEt(e,t);return JEt(n,t)}var zEt=50,HEt=W.EPSILON8;function KEt(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<zEt&&Math.abs(o-i)>HEt;++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 JEt(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 jEt(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 QEt=1.0000010178*kc,qEt=100.46645683*yh,$Et=129597742283429e-5*im,TWe=16002,_We=21863,SWe=32004,ZWe=10931,RWe=14529,CWe=16368,VWe=15318,EWe=32794,eAt=64*1e-7*kc,tAt=-152*1e-7*kc,nAt=62*1e-7*kc,iAt=-8*1e-7*kc,oAt=32*1e-7*kc,rAt=-41*1e-7*kc,sAt=19*1e-7*kc,aAt=-11*1e-7*kc,cAt=-150*1e-7*kc,lAt=-46*1e-7*kc,dAt=68*1e-7*kc,uAt=54*1e-7*kc,mAt=14*1e-7*kc,hAt=24*1e-7*kc,fAt=-28*1e-7*kc,pAt=22*1e-7*kc,AWe=10,GWe=16002,LWe=21863,WWe=10931,vWe=1473,FWe=32004,IWe=4387,PWe=73,bAt=-325*1e-7,gAt=-322*1e-7,yAt=-79*1e-7,xAt=232*1e-7,TAt=-52*1e-7,_At=97*1e-7,SAt=55*1e-7,ZAt=-41*1e-7,RAt=-105*1e-7,CAt=-137*1e-7,VAt=258*1e-7,EAt=35*1e-7,AAt=-116*1e-7,GAt=-88*1e-7,LAt=-112*1e-7,WAt=-80*1e-7,fE=new Q(0,0,ci.TAI);function vAt(e,t){NWe(e,fE);let i=(fE.dayNumber-BH.dayNumber+(fE.secondsOfDay-BH.secondsOfDay)/wn.SECONDS_PER_DAY)/(wn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=QEt+eAt*Math.cos(TWe*o)+cAt*Math.sin(TWe*o)+tAt*Math.cos(_We*o)+lAt*Math.sin(_We*o)+nAt*Math.cos(SWe*o)+dAt*Math.sin(SWe*o)+iAt*Math.cos(ZWe*o)+uAt*Math.sin(ZWe*o)+oAt*Math.cos(RWe*o)+mAt*Math.sin(RWe*o)+rAt*Math.cos(CWe*o)+hAt*Math.sin(CWe*o)+sAt*Math.cos(VWe*o)+fAt*Math.sin(VWe*o)+aAt*Math.cos(EWe*o)+pAt*Math.sin(EWe*o),s=qEt+$Et*i+bAt*Math.cos(AWe*o)+RAt*Math.sin(AWe*o)+gAt*Math.cos(GWe*o)+CAt*Math.sin(GWe*o)+yAt*Math.cos(LWe*o)+VAt*Math.sin(LWe*o)+xAt*Math.cos(WWe*o)+EAt*Math.sin(WWe*o)+TAt*Math.cos(vWe*o)+AAt*Math.sin(vWe*o)+_At*Math.cos(FWe*o)+GAt*Math.sin(FWe*o)+SAt*Math.cos(IWe*o)+LAt*Math.sin(IWe*o)+ZAt*Math.cos(PWe*o)+WAt*Math.sin(PWe*o),a=.0167086342-.0004203654*i,c=102.93734808*yh+11612.3529*im*i,d=469.97289*im*i,u=174.87317577*yh-8679.27034*im*i;return YWe(r,a,d,c,u,s,t)}function MWe(e,t){NWe(e,fE);let i=(fE.dayNumber-BH.dayNumber+(fE.secondsOfDay-BH.secondsOfDay)/wn.SECONDS_PER_DAY)/wn.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*yh,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*yh,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,b=125.04455501*yh,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*yh,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*yh+im*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),Z=93.27209062*yh+im*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),R=134.96340251*yh+im*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),C=357.52910918*yh+im*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*yh-im*(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*=DEt;let Y=d+u*im,D=m+p*im,M=y+_*im,O=b+f*im;return YWe(a,c,Y,D,O,M,t)}var XWe=.012300034,FAt=XWe/(XWe+1)*-1;function IAt(e,t){return t=MWe(e,t),h.multiplyByScalar(t,FAt,t)}var wWe=new q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),Ow=new h;ore.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),l(t)||(t=new h),Ow=vAt(e,Ow),t=h.negate(Ow,t),IAt(e,Ow),h.subtract(t,Ow,t),q.multiplyByVector(wWe,t,t),t};ore.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),t=MWe(e,t),q.multiplyByVector(wWe,t,t),t};var uT=ore;function Bw(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 fY({radii:this.ellipsoid.radii,material:ro.fromType(ro.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Dw}Object.defineProperties(Bw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var zH=new q,PAt=new q,XAt=new h,HH=[];Bw.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,zH))||_t.computeTemeToPseudoFixedMatrix(n,zH);let i=this._axes.evaluate(n,PAt);q.transpose(i,i),q.multiply(zH,i,i);let o=uT.computeMoonPositionInEarthInertialFrame(n,XAt);q.multiplyByVector(zH,o,o),P.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=HH,HH.length=0,t.update(e),e.commandList=r,HH.length===1?HH[0]:void 0};Bw.prototype.isDestroyed=function(){return!1};Bw.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var zw=Bw;var R$i=x(T(),1);var h$i=x(T(),1);var NAt=0,YAt=14,MAt=-1e3,wAt=1e4,kAt=2*Math.PI*ne.WGS84.maximumRadius,UAt=256,DAt=new re,OAt=new re,rre=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??NAt,this._maxZoom=n.maxZoom??YAt,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=BAt(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,ue(this)}};function BAt(e,t){let n=new Lr,i=l(t.extent)?re.clone(t.extent):re.clone(n.rectangle),o=HAt(n,i,t.minZoom),r={boundingVolume:{region:DWe(i)},geometricError:UWe(0),refine:"REPLACE",children:[]};for(let s=o.minY;s<=o.maxY;s++)for(let a=o.minX;a<=o.maxX;a++){let c=kWe(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 kWe(e,t,n,i,o,r,s){if(!KAt(e,i,r,s,n,DAt,OAt))return;let a=e.tileXYToRectangle(r,s,i,new re),c={boundingVolume:{region:DWe(a)},geometricError:i<o?UWe(i):0,refine:"REPLACE",content:{uri:zAt(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=kWe(e,t,n,d,o,p,m);l(b)&&u.push(b)}return u.length>0?c.children=u:c.geometricError=0,c}function zAt(e,t,n,i){let r=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return ym(r)}function UWe(e){return kAt/((1<<e)*UAt)}function DWe(e){return[e.west,e.south,e.east,e.north,MAt,wAt]}function HAt(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 KAt(e,t,n,i,o,r,s){let a=e.tileXYToRectangle(n,i,t,r);return l(re.intersection(a,o,s))}var Hw=rre;var KH=class extends Hw{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=Di.Z,t._modelForwardAxis=Di.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,o,r)=>{let s=sY(r),a=OWe(o.getUrlComponent(!0)),c=Kv(s,a,{featureIdProperty:t});if(!l(c)){if(!JAt(s))return new e0(n,i);throw new ae("Decoded MVT tile did not produce vector glTF content.")}return Vx.fromGltf(n,i,o,c)}}}};function OWe(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 JAt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}KH._parseTileCoordinates=OWe;var sre=KH;var V$i=x(T(),1);function are(e){}are.prototype.isReady=function(){return!0};are.prototype.shouldDiscardImage=function(e){return!1};var cre=are;var J$i=x(T(),1);var A$i=x(T(),1),pE=`#ifdef MRT +`;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:$l.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(RYt),this._rsClassified=ze.fromCache(CYt),this._rsDefault=ze.fromCache(VYt)),!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)?AYt:EYt,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(uu,{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()),ue(this)};var VA=k0;var sGo=x(T(),1);var Ek={};Ek.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)};Ek.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)};Ek.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?dT.load(r):MZ.load(r)};Ek.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 dT.load(r)};var lae=Ek;var uGo=x(T(),1);function nJ(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(nJ.prototype,{total:{get:function(){return this._total}}});function FT(e){let t=new Array(Lc.NUMBER_OF_JOB_TYPES);t[Lc.TEXTURE]=new nJ(l(e)?e[Lc.TEXTURE]:10),t[Lc.PROGRAM]=new nJ(l(e)?e[Lc.PROGRAM]:10),t[Lc.BUFFER]=new nJ(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}FT.getTimestamp=Zn;Object.defineProperties(FT.prototype,{totalBudget:{get:function(){return this._totalBudget}}});FT.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};FT.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};FT.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=FT.getTimestamp();e.execute();let a=FT.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Ak=FT;var hGo=x(T(),1),dae=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function Gk(e,t){this.spatialNode=e,this.keyframe=t,this.state=dae.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}Gk.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=dae.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};Gk.priorityComparator=function(e,t){return e.priority-t.priority};Gk.searchComparator=function(e,t){return e.keyframe-t.keyframe};Gk.LoadState=dae;var zo=Gk;var bGo=x(T(),1);function FPe(){}Object.defineProperties(FPe.prototype,{color:{get:ge.throwInstantiationError},intensity:{get:ge.throwInstantiationError}});var uae=FPe;var ZGo=x(T(),1);var GYt=/\/$/,IPe=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 EA(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();GYt.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=IPe,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(EA.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}}});EA.prototype.getTileCredits=function(e,t,n){};EA.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};EA.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};EA._defaultCredit=IPe;var mae=EA;var MGo=x(T(),1);function U0(e,t,n,i,o=134217728,r){let s=LYt(i),a=WYt(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 dw({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 vYt(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 LYt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function WYt(e){switch(e){case 1:return Qe.RED;case 2:return Qe.RG;case 3:return Qe.RGB;case 4:return Qe.RGBA}}function vYt(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(),ue(this)};var Lk=U0;var qGo=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 Wk=Object.freeze(_c);var hLo=x(T(),1);function vk(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 z9({radii:this.ellipsoid.radii,material:eo.fromType(eo.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Lw}Object.defineProperties(vk.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var iJ=new q,FYt=new q,IYt=new h,oJ=[];vk.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,iJ))||_t.computeTemeToPseudoFixedMatrix(n,iJ);let i=this._axes.evaluate(n,FYt);q.transpose(i,i),q.multiply(iJ,i,i);let o=gT.computeMoonPositionInEarthInertialFrame(n,IYt);q.multiplyByVector(iJ,o,o),P.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=oJ,oJ.length=0,t.update(e),e.commandList=r,oJ.length===1?oJ[0]:void 0};vk.prototype.isDestroyed=function(){return!1};vk.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var Fk=vk;var XLo=x(T(),1);var CLo=x(T(),1);var PYt=0,XYt=14,NYt=-1e3,YYt=1e4,MYt=2*Math.PI*ne.WGS84.maximumRadius,wYt=256,kYt=new re,UYt=new re,hae=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??PYt,this._maxZoom=n.maxZoom??XYt,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=DYt(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,ue(this)}};function DYt(e,t){let n=new Xr,i=l(t.extent)?re.clone(t.extent):re.clone(n.rectangle),o=BYt(n,i,t.minZoom),r={boundingVolume:{region:YPe(i)},geometricError:NPe(0),refine:"REPLACE",children:[]};for(let s=o.minY;s<=o.maxY;s++)for(let a=o.minX;a<=o.maxX;a++){let c=XPe(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 XPe(e,t,n,i,o,r,s){if(!zYt(e,i,r,s,n,kYt,UYt))return;let a=e.tileXYToRectangle(r,s,i,new re),c={boundingVolume:{region:YPe(a)},geometricError:i<o?NPe(i):0,refine:"REPLACE",content:{uri:OYt(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=XPe(e,t,n,d,o,p,m);l(b)&&u.push(b)}return u.length>0?c.children=u:c.geometricError=0,c}function OYt(e,t,n,i){let r=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return ym(r)}function NPe(e){return MYt/((1<<e)*wYt)}function YPe(e){return[e.west,e.south,e.east,e.north,NYt,YYt]}function BYt(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 zYt(e,t,n,i,o,r,s){let a=e.tileXYToRectangle(n,i,t,r);return l(re.intersection(a,o,s))}var Ik=hae;var rJ=class extends Ik{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=Y9(r),a=MPe(o.getUrlComponent(!0)),c=Dw(s,a,{featureIdProperty:t});if(!l(c)){if(!HYt(s))return new Qp(n,i);throw new ae("Decoded MVT tile did not produce vector glTF content.")}return Gx.fromGltf(n,i,o,c)}}}};function MPe(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 HYt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}rJ._parseTileCoordinates=MPe;var fae=rJ;var YLo=x(T(),1);function pae(e){}pae.prototype.isReady=function(){return!0};pae.prototype.shouldDiscardImage=function(e){return!1};var bae=pae;var aWo=x(T(),1);var wLo=x(T(),1),AA=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -10978,7 +10987,7 @@ return; } discard; } -`;var L$i=x(T(),1),Kw=`uniform sampler2D u_opaque; +`;var ULo=x(T(),1),Pk=`uniform sampler2D u_opaque; uniform sampler2D u_accumulation; uniform sampler2D u_revealage; in vec2 v_textureCoordinates; @@ -10998,18 +11007,18 @@ if (opaque != czm_backgroundColor) out_FragColor.a = 1.0; } } -`;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 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 BWe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function lre(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function zWe(e){BWe(e),lre(e)}function jAt(e,t,n,i){BWe(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 QAt(e,t){lre(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)&&(lre(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)&&(zWe(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,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,jAt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!QAt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Je({sources:[Kw]}),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:[pE]}),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:[pE]}),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 qAt={enabled:!0,color:new U(0,0,0,0),equationRgb:Cc.ADD,equationAlpha:Cc.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA},$At={enabled:!0,color:new U(0,0,0,0),equationRgb:Cc.ADD,equationAlpha:Cc.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ONE,functionDestinationAlpha:$o.ONE},eGt={enabled:!0,color:new U(0,0,0,0),equationRgb:Cc.ADD,equationAlpha:Cc.ADD,functionSourceRgb:$o.ZERO,functionDestinationRgb:$o.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA};function dre(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 tGt(e,t,n){return dre(t,qAt,e._translucentRenderStateCache,n)}function nGt(e,t,n){return dre(t,$At,e._translucentRenderStateCache,n)}function iGt(e,t,n){return dre(t,eGt,e._alphaRenderStateCache,n)}var oGt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;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 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 mi({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new mi({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new mi({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new mi({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 wPe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function gae(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function kPe(e){wPe(e),gae(e)}function KYt(e,t,n,i){wPe(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 JYt(e,t){gae(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)&&(gae(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)&&(kPe(e),e._translucentMultipassSupport=!1,i=!1)}return i}cy.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,KYt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!JYt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Je({sources:[Pk]}),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:[AA]}),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:[AA]}),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 jYt={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},QYt={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},qYt={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 yae(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 $Yt(e,t,n){return yae(t,jYt,e._translucentRenderStateCache,n)}function eMt(e,t,n){return yae(t,QYt,e._translucentRenderStateCache,n)}function tMt(e,t,n){return yae(t,qYt,e._alphaRenderStateCache,n)}var nMt=` 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); -`,rGt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,iMt=` 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; -`,sGt=` float ai = czm_out_FragColor.a; +`,oMt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function ure(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 +`;function xae(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]}; @@ -11021,7 +11030,7 @@ ${d}`}return a.sources.push(d),a.sources.push(`void main() discard; } ${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function aGt(e,t){return ure(e,t,"translucentMRT",oGt)}function cGt(e,t){return ure(e,t,"translucentMultipass",rGt)}function lGt(e,t){return ure(e,t,"alphaMultipass",sGt)}Bg.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=aGt(t,e.shaderProgram),n.translucentCommand.renderState=tGt(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=cGt(t,e.shaderProgram),n.translucentCommand.renderState=nGt(this,t,e.renderState),n.alphaCommand.shaderProgram=lGt(t,e.shaderProgram),n.alphaCommand.renderState=iGt(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 dGt(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 uGt(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}Bg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){uGt(this,e,t,n,i,o);return}dGt(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,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};Bg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Bg.prototype.isDestroyed=function(){return!1};Bg.prototype.destroy=function(){return zWe(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 Jw=Bg;var oeo=x(T(),1);var mGt=new Lt("MapQuest, Open Street Map and contributors, CC-BY-SA");function JH(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 Lr({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??mGt;typeof m=="string"&&(m=new Lt(m)),fs.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(JH.prototype=Object.create(fs.prototype),JH.prototype.constructor=JH);var zg=JH;var beo=x(T(),1);var ueo=x(T(),1);function xc(e){e=e??B.EMPTY_OBJECT,this._primitives=[],this._guid=$n(),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(xc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});xc.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};xc.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};xc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};xc.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=[]};xc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function jH(e,t){return e._primitives.indexOf(t)}xc.prototype.raise=function(e){if(l(e)){let t=jH(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};xc.prototype.raiseToTop=function(e){if(l(e)){let t=jH(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};xc.prototype.lower=function(e){if(l(e)){let t=jH(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};xc.prototype.lowerToBottom=function(e){if(l(e)){let t=jH(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};xc.prototype.get=function(e){return this._primitives[e]};xc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};xc.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)}};xc.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)}};xc.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)}};xc.prototype.isDestroyed=function(){return!1};xc.prototype.destroy=function(){return this.removeAll(),ue(this)};var Rl=xc;function F0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(F0.prototype,{length:{get:function(){return this._length}}});F0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Rl({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};F0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};F0.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};F0.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};F0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};F0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){return this.removeAll(),ue(this)};var jw=F0;var xeo=x(T(),1);function HWe(){ge.throwInstantiationError()}Object.defineProperties(HWe.prototype,{show:{get:ge.throwInstantiationError,set:ge.throwInstantiationError},transform:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError}});var mre=HWe;var Seo=x(T(),1);function QH(){ge.throwInstantiationError()}Object.defineProperties(QH.prototype,{});QH.fromUrl=function(e){ge.throwInstantiationError()};QH.prototype.loadPanorama=function(e){ge.throwInstantiationError()};var hre=QH;var Geo=x(T(),1);var hGt=new k(1,1);function fre(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??hGt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(fre.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var KWe=new h;fre.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,KWe),h.add(this.position,KWe,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 bE=fre;var veo=x(T(),1);function JWe(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(JWe.prototype,{complete:{get:function(){return this._complete}}});var pre=JWe;var Peo=x(T(),1);function jWe(e){}jWe.prototype.emit=function(e){ge.throwInstantiationError()};var bre=jWe;var jeo=x(T(),1);var QWe=new k(1,1);function Qw(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 IN(.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??QWe),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??QWe),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(Qw.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 fGt(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 bE;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function pGt(e){let t=e._particlePool.pop();return l(t)||(t=new bE),t}function bGt(e,t){e._particlePool.push(t)}function gGt(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 yGt(e){l(e._billboard)&&(e._billboard.show=!1)}function qWe(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 xGt(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 TGt(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 qH=new h;Qw.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Cu),this._updateParticlePool&&(fGt(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)?qWe(this,s):(yGt(s),bGt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=TGt(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=pGt(this),this._emitter.emit(s),h.add(s.position,s.velocity,qH),P.multiplyByPoint(d,qH,qH),s.position=P.multiplyByPoint(d,s.position,s.position),h.subtract(qH,s.position,s.velocity),h.normalize(s.velocity,s.velocity),xGt(this,s),qWe(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&&gGt(this)};Qw.prototype.isDestroyed=function(){return!1};Qw.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var gre=Qw;var nto=x(T(),1);function $H(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($H.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});$H.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}};$H.prototype.destroy=function(){return ue(this)};var Hg=$H;var lto=x(T(),1);function wZ(){this._framebuffer=new li,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(wZ.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function _Gt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function SGt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function rMt(e,t){return xae(e,t,"translucentMRT",nMt)}function sMt(e,t){return xae(e,t,"translucentMultipass",iMt)}function aMt(e,t){return xae(e,t,"alphaMultipass",oMt)}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=lt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=rMt(t,e.shaderProgram),n.translucentCommand.renderState=$Yt(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=sMt(t,e.shaderProgram),n.translucentCommand.renderState=eMt(this,t,e.renderState),n.alphaCommand.shaderProgram=aMt(t,e.shaderProgram),n.alphaCommand.renderState=tMt(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 cMt(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 lMt(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}cy.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){lMt(this,e,t,n,i,o);return}cMt(this,e,t,n,i,o)};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,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};cy.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){return kPe(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 Xk=cy;var bWo=x(T(),1);var dMt=new Lt("MapQuest, Open Street Map and contributors, CC-BY-SA");function sJ(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??dMt;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)&&(sJ.prototype=Object.create(Ss.prototype),sJ.prototype.constructor=sJ);var ly=sJ;var xWo=x(T(),1);function UPe(){ge.throwInstantiationError()}Object.defineProperties(UPe.prototype,{show:{get:ge.throwInstantiationError,set:ge.throwInstantiationError},transform:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError}});var Tae=UPe;var SWo=x(T(),1);function aJ(){ge.throwInstantiationError()}Object.defineProperties(aJ.prototype,{});aJ.fromUrl=function(e){ge.throwInstantiationError()};aJ.prototype.loadPanorama=function(e){ge.throwInstantiationError()};var _ae=aJ;var GWo=x(T(),1);var uMt=new k(1,1);function Sae(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??uMt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Sae.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var DPe=new h;Sae.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,DPe),h.add(this.position,DPe,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 GA=Sae;var vWo=x(T(),1);function OPe(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(OPe.prototype,{complete:{get:function(){return this._complete}}});var Zae=OPe;var PWo=x(T(),1);function BPe(e){}BPe.prototype.emit=function(e){ge.throwInstantiationError()};var Rae=BPe;var jWo=x(T(),1);var zPe=new k(1,1);function Nk(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 T9(.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??zPe),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??zPe),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(Nk.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 mMt(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 GA;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function hMt(e){let t=e._particlePool.pop();return l(t)||(t=new GA),t}function fMt(e,t){e._particlePool.push(t)}function pMt(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 bMt(e){l(e._billboard)&&(e._billboard.show=!1)}function HPe(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 gMt(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 yMt(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 cJ=new h;Nk.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Mu),this._updateParticlePool&&(mMt(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)?HPe(this,s):(bMt(s),fMt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=yMt(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=hMt(this),this._emitter.emit(s),h.add(s.position,s.velocity,cJ),P.multiplyByPoint(d,cJ,cJ),s.position=P.multiplyByPoint(d,s.position,s.position),h.subtract(cJ,s.position,s.velocity),h.normalize(s.velocity,s.velocity),gMt(this,s),HPe(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&&pMt(this)};Nk.prototype.isDestroyed=function(){return!1};Nk.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Cae=Nk;var nvo=x(T(),1);function lJ(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(lJ.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});lJ.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}};lJ.prototype.destroy=function(){return ue(this)};var dy=lJ;var lvo=x(T(),1);function RR(){this._framebuffer=new li,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(RR.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function xMt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function TMt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -11033,12 +11042,12 @@ void main() 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}wZ.prototype.update=function(e,t){_Gt(this,e,t),SGt(this,e,t)};var ZGt=new ce,RGt=new ce(1,1/255,1/65025,1/16581375);wZ.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,ZGt);return ce.divideByScalar(o,255,o),ce.dot(o,RGt)};wZ.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};wZ.prototype.isDestroyed=function(){return!1};wZ.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var qw=wZ;var gto=x(T(),1);var uto=x(T(),1);function CGt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Tc=CGt;function $w(){this._framebuffer=new li({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties($w.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function VGt(e){e._framebuffer.destroy()}function EGt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Tc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new nt},o.viewport=new nt,e._passState=o}$w.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&EGt(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};$w.prototype.isDestroyed=function(){return!1};$w.prototype.destroy=function(){return VGt(this),ue(this)};var e9=$w;var xto=x(T(),1);function AGt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var t9=AGt;var Yto=x(T(),1);var Vto=x(T(),1);function kZ(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}kZ.create=function(e){return new kZ(e)};kZ.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ie.SYNC_STATUS)};kZ.prototype.isDestroyed=function(){return!1};kZ.prototype.destroy=function(){return this._gl.deleteSync(this._sync),ue(this)};kZ.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 n9=kZ;function UZ(e){let t=new Tc(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 $We(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]}UZ.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};UZ.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=n9.create({context:r});try{await u.waitForSignal(b=>t.afterRender.push(b));let m=Qe.createTypedArray(c,a,i,o);return d.getBufferData(m),$We(r,m,i,o,n)}catch{throw new ae("Async Picking Request Timeout")}finally{u.destroy(),d.destroy()}};UZ.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 $We(o,r,n,i,t)};UZ.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)};UZ.prototype.isDestroyed=function(){return!1};UZ.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var i9=UZ;var Coo=x(T(),1);var Uto=x(T(),1);function eK(e){e=e??!0,this.value=eK.toValue(e)}Object.defineProperties(eK.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});eK.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var vn=eK;var qio=x(T(),1);var Qto=x(T(),1);function DZ(){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(DZ.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});DZ.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};DZ.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};DZ.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};DZ.prototype.isDestroyed=function(){return!1};DZ.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var o9=DZ;var ono=x(T(),1);function Kg(){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 GGt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Kg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Kg.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)};Kg.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)};Kg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Kg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Kg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Kg.prototype.isDestroyed=function(){return!1};Kg.prototype.destroy=function(){return GGt(this),ue(this)};var OZ=Kg;var tio=x(T(),1);var cno=x(T(),1);function mT(){}var LGt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};mT.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return LGt[n]===!0})};mT.getShadowCastShaderKeyword=function(e,t,n,i,o){return`castShadow ${e} ${t} ${n} ${i} ${o}`};mT.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; +`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}RR.prototype.update=function(e,t){xMt(this,e,t),TMt(this,e,t)};var _Mt=new ce,SMt=new ce(1,1/255,1/65025,1/16581375);RR.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,_Mt);return ce.divideByScalar(o,255,o),ce.dot(o,SMt)};RR.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};RR.prototype.isDestroyed=function(){return!1};RR.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Yk=RR;var pvo=x(T(),1);function Mk(){this._framebuffer=new li({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(Mk.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ZMt(e){e._framebuffer.destroy()}function RMt(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}Mk.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&RMt(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};Mk.prototype.isDestroyed=function(){return!1};Mk.prototype.destroy=function(){return ZMt(this),ue(this)};var wk=Mk;var gvo=x(T(),1);function CMt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var kk=CMt;var Gvo=x(T(),1);function CR(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 KPe(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]}CR.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};CR.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=lw.create({context:r});try{await u.waitForSignal(b=>t.afterRender.push(b));let m=Qe.createTypedArray(c,a,i,o);return d.getBufferData(m),KPe(r,m,i,o,n)}catch{throw new ae("Async Picking Request Timeout")}finally{u.destroy(),d.destroy()}};CR.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 KPe(o,r,n,i,t)};CR.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)};CR.prototype.isDestroyed=function(){return!1};CR.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var Uk=CR;var mIo=x(T(),1);var MFo=x(T(),1);var Yvo=x(T(),1);function VR(){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 mi({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(VR.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});VR.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};VR.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};VR.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};VR.prototype.isDestroyed=function(){return!1};VR.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var Dk=VR;var Bvo=x(T(),1);function uy(){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 mi({color:new U(0,0,0,0),depth:1,owner:this})}function VMt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(uy.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});uy.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)};uy.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)};uy.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};uy.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};uy.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};uy.prototype.isDestroyed=function(){return!1};uy.prototype.destroy=function(){return VMt(this),ue(this)};var ER=uy;var U2o=x(T(),1);var Jvo=x(T(),1);function IT(){}var EMt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};IT.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return EMt[n]===!0})};IT.getShadowCastShaderKeyword=function(e,t,n,i,o){return`castShadow ${e} ${t} ${n} ${i} ${o}`};IT.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})};mT.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; +}`)}return new Je({defines:i,sources:o})};IT.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() { @@ -11062,7 +11071,7 @@ void main() `: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})};mT.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}`};mT.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})};mT.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; +`,s.push(u),new Je({defines:r,sources:s})};IT.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}`};IT.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})};IT.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 @@ -11173,7 +11182,7 @@ ${f?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,C+=` out_FragColor.rgb *= visibility; } -`,Z.push(C),new Je({defines:S,sources:Z})};var zf=mT;function I0(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 tK,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new me,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 gs: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 WGt(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,xre(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new Tc(t),this._size=e.size??2048,this.size=this._size}I0.MAXIMUM_DISTANCE=2e4;function WGt(e){this.camera=new tK,this.passState=new Tc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function yre(e,t){return ze.fromCache({cull:{enabled:!0,face:ki.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 xre(e){let t=!e._usesDepthTexture;e._primitiveRenderState=yre(t,e._primitiveBias),e._terrainRenderState=yre(t,e._terrainBias),e._pointRenderState=yre(t,e._pointBias)}I0.prototype.debugCreateRenderStates=function(){xre(this)};Object.defineProperties(I0.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){NGt(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 Tre(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 vGt(e,t){let n=new Su({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Nl.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST}),o=new hs({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 FGt(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:Ot.NEAREST}),i=new hs({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 IGt(e,t){let n=new Su({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Nl.DEPTH_COMPONENT16}),i=new ns({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new hs({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 nve(e,t){e._isPointLight?IGt(e,t):e._usesDepthTexture?FGt(e,t):vGt(e,t)}function PGt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,xre(e),Tre(e),nve(e,t))}function XGt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Tre(e),nve(e,t),PGt(e,t),ive(e,t))}function ive(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function NGt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=wt.maximumCubeMapSize>=t?t:wt.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=wt.maximumTextureSize>=t?t:wt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new nt(0,0,t,t)):i===4&&(t=wt.maximumTextureSize>=t*2?t:wt.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 YGt=new nt;function MGt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,Z.push(C),new Je({defines:S,sources:Z})};var dp=IT;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 dJ,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new me,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 AMt(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,Eae(this),this._clearCommand=new mi({depth:1,color:new U}),this._clearPassState=new gc(t),this._size=e.size??2048,this.size=this._size}D0.MAXIMUM_DISTANCE=2e4;function AMt(e){this.camera=new dJ,this.passState=new gc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Vae(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 Eae(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Vae(t,e._primitiveBias),e._terrainRenderState=Vae(t,e._terrainBias),e._pointRenderState=Vae(t,e._pointBias)}D0.prototype.debugCreateRenderStates=function(){Eae(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){IMt(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 Aae(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 GMt(e,t){let n=new Wu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:$l.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 LMt(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 WMt(e,t){let n=new Wu({context:t,width:e._textureSize.x,height:e._textureSize.y,format:$l.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 QPe(e,t){e._isPointLight?WMt(e,t):e._usesDepthTexture?LMt(e,t):GMt(e,t)}function vMt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Eae(e),Aae(e),QPe(e,t))}function FMt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Aae(e),QPe(e,t),vMt(e,t),qPe(e,t))}function qPe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function IMt(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 PMt=new nt;function XMt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -11234,7 +11243,7 @@ ${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=Le.OVERLAY,i}function wGt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=YGt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=MGt(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 P0=new Array(8);P0[0]=new ce(-1,-1,-1,1);P0[1]=new ce(1,-1,-1,1);P0[2]=new ce(1,1,-1,1);P0[3]=new ce(-1,1,-1,1);P0[4]=new ce(-1,-1,1,1);P0[5]=new ce(1,-1,1,1);P0[6]=new ce(1,1,1,1);P0[7]=new ce(-1,1,1,1);var hT=new P,_re=new Array(8);for(let e=0;e<8;++e)_re[e]=new ce;function kGt(e,t){let n=new Mt({geometry:new yf({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:$t.fromColor(t)}}),i=new Mt({geometry:new rg({radius:.5}),attributes:{color:$t.fromColor(t)}});return new Pn({geometryInstances:[n,i],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var UGt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],DGt=new h;function OGt(e,t){wGt(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 a0({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 a0({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 a0({camera:e._passes[i].camera,color:UGt[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,DGt),a=P.fromTranslationQuaternionRotationScale(i,o,s,hT);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=kGt(a,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new a0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function tK(){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}tK.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 BGt=new P(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);tK.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return P.multiply(t,e,this.viewProjectionMatrix),P.multiply(BGt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var zGt=new Array(5),HGt=new ji,KGt=new Array(4),ove=new h,rve=new h;function JGt(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=KGt,b=zGt;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(HGt),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,hT),g=P.inverse(N,hT),V=P.multiply(I,g,hT),G=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ove),v=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,rve);for(let O=0;O<8;++O){let w=ce.clone(P0[O],_re[O]);P.multiplyByVector(V,w,w),h.divideByScalar(w,w.w,w),h.minimumByComponent(w,G,G),h.maximumByComponent(w,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 M=e._cascadeMatrices[a];P.multiply(Y.getViewProjection(),i.inverseViewMatrix,M),P.multiply(X.textureOffsets,M,M)}}var jGt=new P,QGt=new h,qGt=new h,eve=new h;function $Gt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=P.multiply(i.frustum.projectionMatrix,i.viewMatrix,hT),r=P.inverse(o,hT),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,QGt);a=h.cross(c,s,qGt),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,eve),u=P.computeView(d,s,a,c,jGt),m=P.multiply(u,r,hT),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ove),b=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,rve);for(let C=0;C<8;++C){let E=ce.clone(P0[C],_re[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=eve;f.x=-(.5*(p.x+b.x)),f.y=-(.5*(p.y+b.y)),f.z=-b.z;let y=P.fromTranslation(f,hT);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 eLt=[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)],tLt=[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)],nLt=[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 iLt(e,t){let n=new ji;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=eLt[i],o.upWC=tLt[i],o.rightWC=nLt[i],P.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),P.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var oLt=new h,rLt=new h,sve=new me,tve=sve.center;function sLt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=sve;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,oLt),s=h.negate(i.directionWC,rLt),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),me.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,tve),tve);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),me.clone(o,e._boundingSphere)}}function aLt(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=Wo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,sLt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}I0.prototype.update=function(e){if(aLt(this,e),this._needsUpdate)if(XGt(this,e.context),this._isPointLight&&iLt(this,e),this._cascadesEnabled&&($Gt(this,e),this._numberOfCascades>1&&JGt(this,e)),this._isPointLight)this._shadowMapCullingVolume=qs.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&&OGt(this,e)};I0.prototype.updatePass=function(e,t){ive(this,e,t)};var cLt=new k;function ave(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=cLt;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 lLt(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&&zf.hasClippingForShadowCast(y),S=zf.getShadowCastShaderKeyword(p,u,b,m,_);if(s=i.shaderCache.getDerivedShaderProgram(d,S),!l(s)){let R=zf.createShadowCastVertexShader(f,p,u),C=zf.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=ave(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}I0.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=zf.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,y),!l(m)){let _=zf.createShadowReceiveVertexShader(a,d,u),S=zf.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=ave(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};I0.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]=lLt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};I0.prototype.isDestroyed=function(){return!1};I0.prototype.destroy=function(){Tre(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 Jg=I0;var Vio=x(T(),1);var iio=x(T(),1),r9=`uniform sampler2D u_opaqueDepthTexture; +`;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 NMt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=PMt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=XMt(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 PT=new P,Gae=new Array(8);for(let e=0;e<8;++e)Gae[e]=new ce;function YMt(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 hg({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 MMt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],wMt=new h;function kMt(e,t){NMt(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:MMt[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,wMt),a=P.fromTranslationQuaternionRotationScale(i,o,s,PT);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=YMt(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 dJ(){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}dJ.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 UMt=new P(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);dJ.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return P.multiply(t,e,this.viewProjectionMatrix),P.multiply(UMt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var DMt=new Array(5),OMt=new qi,BMt=new Array(4),$Pe=new h,eXe=new h;function zMt(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=BMt,b=DMt;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(OMt),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,PT),g=P.inverse(N,PT),V=P.multiply(I,g,PT),G=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,$Pe),v=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,eXe);for(let O=0;O<8;++O){let w=ce.clone(O0[O],Gae[O]);P.multiplyByVector(V,w,w),h.divideByScalar(w,w.w,w),h.minimumByComponent(w,G,G),h.maximumByComponent(w,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 M=e._cascadeMatrices[a];P.multiply(Y.getViewProjection(),i.inverseViewMatrix,M),P.multiply(X.textureOffsets,M,M)}}var HMt=new P,KMt=new h,JMt=new h,JPe=new h;function jMt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=P.multiply(i.frustum.projectionMatrix,i.viewMatrix,PT),r=P.inverse(o,PT),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,KMt);a=h.cross(c,s,JMt),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,JPe),u=P.computeView(d,s,a,c,HMt),m=P.multiply(u,r,PT),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,$Pe),b=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,eXe);for(let C=0;C<8;++C){let E=ce.clone(O0[C],Gae[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=JPe;f.x=-(.5*(p.x+b.x)),f.y=-(.5*(p.y+b.y)),f.z=-b.z;let y=P.fromTranslation(f,PT);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 QMt=[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)],qMt=[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)],$Mt=[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 ewt(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=QMt[i],o.upWC=qMt[i],o.rightWC=$Mt[i],P.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),P.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var twt=new h,nwt=new h,tXe=new me,jPe=tXe.center;function iwt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=tXe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,twt),s=h.negate(i.directionWC,nwt),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),me.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,jPe),jPe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),me.clone(o,e._boundingSphere)}}function owt(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,iwt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}D0.prototype.update=function(e){if(owt(this,e),this._needsUpdate)if(FMt(this,e.context),this._isPointLight&&ewt(this,e),this._cascadesEnabled&&(jMt(this,e),this._numberOfCascades>1&&zMt(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&&kMt(this,e)};D0.prototype.updatePass=function(e,t){qPe(this,e,t)};var rwt=new k;function nXe(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=rwt;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 swt(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=nXe(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=nXe(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]=swt(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(){Aae(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 my=D0;var hFo=x(T(),1);var O2o=x(T(),1),Ok=`uniform sampler2D u_opaqueDepthTexture; uniform sampler2D u_translucentDepthTexture; in vec2 v_textureCoordinates; void main() @@ -11244,7 +11253,7 @@ float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); out_FragColor = czm_packDepth(translucentDepth); } -`;var rio=x(T(),1),BZ=`uniform sampler2D colorTexture; +`;var z2o=x(T(),1),AR=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -11270,7 +11279,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var dLt=!1;function fT(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(fT.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function cve(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function lve(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function uLt(e,t,n,i){cve(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST})}function mLt(e,t,n,i){lve(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 hLt(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)&&(uLt(e,t,o,r),mLt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Je({sources:[r9]}),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:[BZ]}),a={colorTexture:function(){return e._textureToComposite}},dLt&&(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:[BZ]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Je({sources:[BZ]}),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:ei.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)}fT.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){hLt(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}};fT.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)};fT.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),fLt(this,e,t)};function fLt(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}fT.prototype.isSupported=function(){return this._supported};fT.prototype.isDestroyed=function(){return!1};fT.prototype.destroy=function(){return cve(this),lve(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 s9=fT;function pLt(){this.command=void 0,this.near=void 0,this.far=void 0}function nK(e,t,n){let i=e.context,o;i.depthTexture&&(o=new KY);let r;e._useOIT&&i.depthTexture&&(r=new Jw(i));let s=new Tc(i);s.viewport=nt.clone(n),this.camera=t,this._cameraClone=Wo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new i9(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new e9,this.sceneFramebuffer=new OZ,this.edgeFramebuffer=new hY,this.planarFillIdFramebuffer=new o9,this.globeDepth=o,this.globeTranslucencyFramebuffer=new JY,this.oit=r,this.translucentTileClassification=new s9(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Sre=new h,Zre=new h;function bLt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Sre)),h.maximumComponent(h.abs(t.position,Zre))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,Sre),h.multiplyByScalar(t.position,o,Zre),h.equalsEpsilon(Sre,Zre,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)}nK.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return bLt(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(),Wo.clone(t,n),!0)};function gLt(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 EY(b,f)}}function yLt(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 dve=new qs,xLt=new Ys;nK.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=dve.planes;for(let I=0;I<5;++I)A[I]=E.planes[I];E=dve;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,xLt);if(G=Y.start,v=Y.stop,f=Math.min(f,G),y=Math.max(y,v),_&&N.receiveShadows&&G<Jg.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 pLt),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),gLt(this,e,f,y);for(let I=0;I<b;I++)yLt(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}for(let I=0;I<u.length;++I){let{commands:N,indices:g}=u[I];for(let V=0;V<N.length;++V){let G=N[V];for(let v=g[V];v<G.length&&l(G[v]);++v)G[v]=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)};nK.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 zZ=nK;var mve=.1,TLt=new eh({pass:cr.MOST_DETAILED_PRELOAD}),_Lt=new eh({pass:cr.MOST_DETAILED_PICK}),a9=new eh({pass:cr.PICK});function La(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new nt(0,0,1,1),n=new Wo(e);n.frustum=new bn({width:mve,aspectRatio:1,near:.1}),this._pickOffscreenView=new zZ(e,n,t)}La.prototype.update=function(){this._pickPositionCacheDirty=!0};La.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new qw,n[t]=i),i};var SLt=new gs,ZLt=new h,iK=new h,RLt=new k,CLt=new P;function VLt(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,CLt);r._setTransform(P.IDENTITY);let m=h.clone(r.position,ZLt);h.multiplyByScalar(r.right,c,iK),h.add(iK,m,m),h.multiplyByScalar(r.up,d,iK),h.add(iK,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,RLt),b=SLt;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 ELt=new Ol,ALt=new k;function GLt(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,ALt),y=f.x*n*.5,_=f.y*i*.5,S=ELt;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 oK(e,t,n,i,o){let r=e.camera.frustum;return r instanceof bn||r instanceof gs?VLt(e,t,n,i,o):GLt(e,t,n,i,o)}var c9=new nt(0,0,3,3),rK=new k,l9=new U(0,0,0,0);function Rre(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 d9(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=ho.transformWindowToDrawingBuffer(e,t,rK);Rre(s.drawingBufferHeight,b,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=oK(e,b,n.width,n.height,d),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=r?.snap??!1,a.tilesetPassState=a9,s.uniformState.update(a),e.updateEnvironment(),p=m.begin(n,d),e.updateAndExecuteCommands(p,l9),e.resolveFramebuffers(p)}function u9(e){let{context:t}=e;t.endFrame()}La.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,d=c9;d9(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.")),u9(e),u};La.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=c9;d9(e,t,a,n,i);let c=s.end(a,o);return u9(e),c};La.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=ho.transformWindowToDrawingBuffer(e,t,rK),m=Rre(o.drawingBufferHeight,u,n,i,c9);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=oK(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=a9,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,l9),e.resolveFramebuffers(d);let p=c.readCenterPixel(m);return o.endFrame(),p};La.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=ho.transformWindowToDrawingBuffer(e,t,rK),u=Rre(i.drawingBufferHeight,d,1,1,c9);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=oK(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=a9,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,l9);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,ww.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function LLt(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=oK(e,t,1,1,s),o.tilesetPassState=a9,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,l9),e.resolveFramebuffers(c),i.endFrame()}var WLt=new ji,vLt=new Ol,FLt=new bn,ILt=new gs;La.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=ho.transformWindowToDrawingBuffer(e,t,rK);e.pickTranslucentDepth?LLt(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(WLt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(vLt):l(s.frustum.width)?u=s.frustum.clone(FLt):u=s.frustum.clone(ILt);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=ho.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 PLt=new pe;La.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,PLt);o.cartographicToCartesian(r,n)}return n};function XLt(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=vn.toValue(!1,p.show),o.push(p))}a instanceof na&&(m=!0,a.show=!1,r.push(a)),m||(u.show=!1,i.push(u))}}function hve(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!XLt(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=vn.toValue(!0,c.show)}for(let a=0;a<r.length;++a)r[a].show=!0;return n}La.prototype.drillPick=function(e,t,n,i,o){return hve(a=>this.pick(e,t,i,o,a).map(d=>({object:d,position:void 0,exclude:!1})),n).map(a=>a.object)};var uve=new h,NLt=new h;function YLt(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 fve(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,uve),s=h.cross(o,r,uve),a=h.cross(o,s,NLt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??mve,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function MLt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=fve(e,o,r,a),d=TLt;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}La.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)MLt(this,e,t[n])&&t.splice(n--,1)};function pve(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 Rl&&pve(o,t,n))}}function sK(e,t,n,i,o,r){let s=[];if(pve(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new YLt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function wLt(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 kLt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,fve(e,n,o,u.camera);let m=nt.clone(u.viewport,c9),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=_Lt:c.tilesetPassState=a9,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,l9),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||wLt(f,i)}}function Cre(e,t,n,i,o,r,s,a){return hve(function(){let d=kLt(e,t,n,o,r,s,a);return d?[d]:void 0},i)}function gE(e,t,n,i,o,r,s){let a=Cre(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function aK(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)})})}La.prototype.pickFromRay=function(e,t,n,i){return gE(this,e,t,n,i,!1,!1)};La.prototype.drillPickFromRay=function(e,t,n,i,o){return Cre(this,e,t,n,i,o,!1,!1)};La.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,aK(e,sK(o,e,t,n,i,function(){return gE(o,e,t,n,i,!1,!0)}))};La.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,aK(e,sK(r,e,t,i,o,function(){return Cre(r,e,t,n,i,o,!1,!0)}))};var ULt=new h,DLt=new h,OLt=new gn,bve=new pe;function Vre(e,t){let n=e.ellipsoid,i=Xi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,DLt),r=pe.toCartesian(t,n,ULt),s=OLt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function gve(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,bve);return Vre(e,i)}function yve(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,bve).height}function BLt(e,t,n,i,o){let r=Vre(t,n);return sK(e,t,r,i,o,function(){let s=gE(e,t,r,i,o,!0,!0);if(l(s))return yve(t,s.position)})}function zLt(e,t,n,i,o,r){let s=gve(t,n);return sK(e,t,s,i,o,function(){let a=gE(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}La.prototype.sampleHeight=function(e,t,n,i){let o=Vre(e,t),r=gE(this,e,o,n,i,!0,!1);if(l(r))return yve(e,r.position)};La.prototype.clampToHeight=function(e,t,n,i,o){let r=gve(e,t),s=gE(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};La.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]=BLt(this,e,t[s],n,i);return aK(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}))};La.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]=zLt(this,e,t[s],n,i,t[s]);return aK(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};La.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var m9=La;var dro=x(T(),1);var _ve=x(eD(),1);var Aoo=x(T(),1);var HLt={modifyFragmentShader:function(t){return t=Je.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`;var awt=!1;function XT(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 mi({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new mi({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(XT.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function iXe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function oXe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function cwt(e,t,n,i){iXe(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 lwt(e,t,n,i){oXe(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 dwt(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)&&(cwt(e,t,o,r),lwt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Je({sources:[Ok]}),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:[AR]}),a={colorTexture:function(){return e._textureToComposite}},awt&&(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:[AR]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Je({sources:[AR]}),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)}XT.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){dwt(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}};XT.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)};XT.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),uwt(this,e,t)};function uwt(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}XT.prototype.isSupported=function(){return this._supported};XT.prototype.isDestroyed=function(){return!1};XT.prototype.destroy=function(){return iXe(this),oXe(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 Bk=XT;function mwt(){this.command=void 0,this.near=void 0,this.far=void 0}function uJ(e,t,n){let i=e.context,o;i.depthTexture&&(o=new bk);let r;e._useOIT&&i.depthTexture&&(r=new Xk(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 Uk(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new wk,this.sceneFramebuffer=new ER,this.edgeFramebuffer=new B9,this.planarFillIdFramebuffer=new Dk,this.globeDepth=o,this.globeTranslucencyFramebuffer=new gk,this.oit=r,this.translucentTileClassification=new Bk(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Lae=new h,Wae=new h;function hwt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Lae)),h.maximumComponent(h.abs(t.position,Wae))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,Lae),h.multiplyByScalar(t.position,o,Wae),h.equalsEpsilon(Lae,Wae,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)}uJ.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return hwt(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 fwt(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 q9(b,f)}}function pwt(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 rXe=new $s,bwt=new Ns;uJ.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=rXe.planes;for(let I=0;I<5;++I)A[I]=E.planes[I];E=rXe;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,bwt);if(G=Y.start,v=Y.stop,f=Math.min(f,G),y=Math.max(y,v),_&&N.receiveShadows&&G<my.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 mi?(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),fwt(this,e,f,y);for(let I=0;I<b;I++)pwt(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}for(let I=0;I<u.length;++I){let{commands:N,indices:g}=u[I];for(let V=0;V<N.length;++V){let G=N[V];for(let v=g[V];v<G.length&&l(G[v]);++v)G[v]=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)};uJ.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 GR=uJ;var aXe=.1,gwt=new _h({pass:lr.MOST_DETAILED_PRELOAD}),ywt=new _h({pass:lr.MOST_DETAILED_PICK}),zk=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:aXe,aspectRatio:1,near:.1}),this._pickOffscreenView=new GR(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 Yk,n[t]=i),i};var xwt=new bs,Twt=new h,mJ=new h,_wt=new k,Swt=new P;function Zwt(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,Swt);r._setTransform(P.IDENTITY);let m=h.clone(r.position,Twt);h.multiplyByScalar(r.right,c,mJ),h.add(mJ,m,m),h.multiplyByScalar(r.up,d,mJ),h.add(mJ,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,_wt),b=xwt;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 Rwt=new fd,Cwt=new k;function Vwt(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,Cwt),y=f.x*n*.5,_=f.y*i*.5,S=Rwt;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 hJ(e,t,n,i,o){let r=e.camera.frustum;return r instanceof yn||r instanceof bs?Zwt(e,t,n,i,o):Vwt(e,t,n,i,o)}var Hk=new nt(0,0,3,3),fJ=new k,Kk=new U(0,0,0,0);function vae(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 Jk(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,fJ);vae(s.drawingBufferHeight,b,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=hJ(e,b,n.width,n.height,d),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=r?.snap??!1,a.tilesetPassState=zk,s.uniformState.update(a),e.updateEnvironment(),p=m.begin(n,d),e.updateAndExecuteCommands(p,Kk),e.resolveFramebuffers(p)}function jk(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=Hk;Jk(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.")),jk(e),u};Wa.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=Hk;Jk(e,t,a,n,i);let c=s.end(a,o);return jk(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,fJ),m=vae(o.drawingBufferHeight,u,n,i,Hk);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=hJ(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=zk,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,Kk),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,fJ),u=vae(i.drawingBufferHeight,d,1,1,Hk);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=hJ(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=zk,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,Kk);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,Wk.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Ewt(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=hJ(e,t,1,1,s),o.tilesetPassState=zk,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Kk),e.resolveFramebuffers(c),i.endFrame()}var Awt=new qi,Gwt=new fd,Lwt=new yn,Wwt=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,fJ);e.pickTranslucentDepth?Ewt(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(Awt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(Gwt):l(s.frustum.width)?u=s.frustum.clone(Lwt):u=s.frustum.clone(Wwt);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 vwt=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,vwt);o.cartographicToCartesian(r,n)}return n};function Fwt(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 cXe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!Fwt(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 cXe(a=>this.pick(e,t,i,o,a).map(d=>({object:d,position:void 0,exclude:!1})),n).map(a=>a.object)};var sXe=new h,Iwt=new h;function Pwt(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 lXe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,sXe),s=h.cross(o,r,sXe),a=h.cross(o,s,Iwt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??aXe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Xwt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=lXe(e,o,r,a),d=gwt;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)Xwt(this,e,t[n])&&t.splice(n--,1)};function dXe(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&&dXe(o,t,n))}}function pJ(e,t,n,i,o,r){let s=[];if(dXe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Pwt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Nwt(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 Ywt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,lXe(e,n,o,u.camera);let m=nt.clone(u.viewport,Hk),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=ywt:c.tilesetPassState=zk,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,Kk),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||Nwt(f,i)}}function Fae(e,t,n,i,o,r,s,a){return cXe(function(){let d=Ywt(e,t,n,o,r,s,a);return d?[d]:void 0},i)}function LA(e,t,n,i,o,r,s){let a=Fae(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function bJ(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 LA(this,e,t,n,i,!1,!1)};Wa.prototype.drillPickFromRay=function(e,t,n,i,o){return Fae(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,bJ(e,pJ(o,e,t,n,i,function(){return LA(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,bJ(e,pJ(r,e,t,i,o,function(){return Fae(r,e,t,n,i,o,!1,!0)}))};var Mwt=new h,wwt=new h,kwt=new gn,uXe=new pe;function Iae(e,t){let n=e.ellipsoid,i=Pi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,wwt),r=pe.toCartesian(t,n,Mwt),s=kwt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function mXe(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,uXe);return Iae(e,i)}function hXe(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,uXe).height}function Uwt(e,t,n,i,o){let r=Iae(t,n);return pJ(e,t,r,i,o,function(){let s=LA(e,t,r,i,o,!0,!0);if(l(s))return hXe(t,s.position)})}function Dwt(e,t,n,i,o,r){let s=mXe(t,n);return pJ(e,t,s,i,o,function(){let a=LA(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=Iae(e,t),r=LA(this,e,o,n,i,!0,!1);if(l(r))return hXe(e,r.position)};Wa.prototype.clampToHeight=function(e,t,n,i,o){let r=mXe(e,t),s=LA(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]=Uwt(this,e,t[s],n,i);return bJ(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]=Dwt(this,e,t[s],n,i,t[s]);return bJ(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 Qk=Wa;var QIo=x(T(),1);var bXe=x(nD(),1);var pIo=x(T(),1);var Owt={modifyFragmentShader:function(t){return t=Je.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -11279,9 +11288,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},yE=HLt;var HZ={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function h9(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=HZ.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=Wn.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??Ur.NONE,this._splittingEnabled=!1,this._error=void 0,KLt(this,e)}Object.defineProperties(h9.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=me.clone(e,this._boundingSphere)}}});function KLt(e,t){let n=aS.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=wh.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=HZ.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 JLt=new h,jLt=new h,QLt=new h,xve,cK;function qLt(e){if(!l(cK)){xve=new _ve.default(0),cK=new Array(e);for(let t=0;t<e;++t)cK[t]=xve.random()}return cK}function $Lt(e){let n=e.length/3,i=Math.min(n,20),o=qLt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,JLt),c=h.fromElements(s,s,s,jLt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,QLt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=me.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function Tve(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 eWt=new ce,tWt=new ce,nWt=new U,Sve=0,lK=1,Wre=2,Zve=3,iWt=4,Ere=new P,oWt=new P;function rWt(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 M=iWt;for(let O in d)if(d.hasOwnProperty(O)){let w=d[O],z=Tve(w.typedArray,O);A=w.componentCount,L=J.fromTypedArray(z);let K=it.createVertexBuffer({context:n,typedArray:z,usage:Pe.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:M,vertexBuffer:K,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0};F.push(te),I[O]={location:M,componentCount:A},++M}}let N=it.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let g;R&&(g=it.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let V;C&&(V=it.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=V.sizeInBytes);let G;E&&(c.typedArray=Tve(c.typedArray,"batchIds"),G=it.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:Sve,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=me.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=$Lt(r.typedArray)),R)if(S)v.push({index:lK,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:J.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let M=Z?4:3;v.push({index:lK,vertexBuffer:g,componentsPerAttribute:M,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:Wre,vertexBuffer:V,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&v.push({index:Zve,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 me,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 sWt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=eWt;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 bn?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,nWt);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,Ere);let d=P.multiply(Ere,a.modelMatrix,Ere);return P.inverseTranspose(d,oWt)}};yE.addUniforms(e,s),(i||o||r)&&(s=It(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=tWt;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 Are(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 Gre(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 Lre(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 aWt={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 cWt(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(aWt),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=[],M=[];G&&(Are(A,D),Gre(A,M)),v&&(Are(L,D),Gre(L,M)),X&&(Are(F,D),Gre(F,M));let O=M.indexOf("COLOR")>=0,w=M.indexOf("NORMAL")>=0;if(w&&!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=Lre(R,r.location);Ze.enabled=he}let z=f&&(!G||O);if(f){let he=Lre(R,lK);he.enabled=z}let K=y&&(Z||S||w);if(y){let he=Lre(R,Wre);he.enabled=K}let te={a_position:Sve};z&&(te.a_color=lK),K&&(te.a_normal=Wre),_&&(te.a_batchId=Zve);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}sWt(e,t);let ee=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},WA=Owt;var LR={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function qk(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=LR.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??wr.NONE,this._splittingEnabled=!1,this._error=void 0,Bwt(this,e)}Object.defineProperties(qk.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=me.clone(e,this._boundingSphere)}}});function Bwt(e,t){let n=yS.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=LR.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 zwt=new h,Hwt=new h,Kwt=new h,fXe,gJ;function Jwt(e){if(!l(gJ)){fXe=new bXe.default(0),gJ=new Array(e);for(let t=0;t<e;++t)gJ[t]=fXe.random()}return gJ}function jwt(e){let n=e.length/3,i=Math.min(n,20),o=Jwt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,zwt),c=h.fromElements(s,s,s,Hwt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,Kwt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=me.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function pXe(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 Qwt=new ce,qwt=new ce,$wt=new U,gXe=0,yJ=1,Mae=2,yXe=3,e9t=4,Pae=new P,t9t=new P;function n9t(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 M=e9t;for(let O in d)if(d.hasOwnProperty(O)){let w=d[O],z=pXe(w.typedArray,O);A=w.componentCount,L=J.fromTypedArray(z);let K=ot.createVertexBuffer({context:n,typedArray:z,usage:Pe.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:M,vertexBuffer:K,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0};F.push(te),I[O]={location:M,componentCount:A},++M}}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=pXe(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:gXe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=me.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=jwt(r.typedArray)),R)if(S)v.push({index:yJ,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:J.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let M=Z?4:3;v.push({index:yJ,vertexBuffer:g,componentsPerAttribute:M,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:Mae,vertexBuffer:V,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&v.push({index:yXe,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 me,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 i9t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Qwt;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,$wt);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,Pae);let d=P.multiply(Pae,a.modelMatrix,Pae);return P.inverseTranspose(d,t9t)}};WA.addUniforms(e,s),(i||o||r)&&(s=It(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=qwt;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 Xae(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 Nae(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 Yae(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 o9t={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 r9t(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(o9t),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=[],M=[];G&&(Xae(A,D),Nae(A,M)),v&&(Xae(L,D),Nae(L,M)),X&&(Xae(F,D),Nae(F,M));let O=M.indexOf("COLOR")>=0,w=M.indexOf("NORMAL")>=0;if(w&&!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=Yae(R,r.location);Ze.enabled=he}let z=f&&(!G||O);if(f){let he=Yae(R,yJ);he.enabled=z}let K=y&&(Z||S||w);if(y){let he=Yae(R,Mae);he.enabled=K}let te={a_position:gXe};z&&(te.a_color=yJ),K&&(te.a_normal=Mae),_&&(te.a_batchId=yXe);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}i9t(e,t);let ee=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -11352,12 +11361,12 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,le+=` -`,le+=KS(C,s),le+=` +`,le+=bR(C,s),le+=` `),le+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,Y&&(le+=AY("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),le+=`} -`,e.splitDirection!==Ur.NONE&&(le=yE.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=tn.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 lWt(e,t){if(e._decodingState===HZ.READY)return!1;if(e._decodingState===HZ.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Eb.decodePointCloud(i,t);l(o)&&(e._decodingState=HZ.DECODING,o.then(function(r){e._decodingState=HZ.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=HZ.FAILED,e._error=r}))}return!0}var dWt=new ce,uWt=new h;h9.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(lWt(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)||(rWt(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,dWt);ce.equals(p,ce.UNIT_W)||_t.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(me.clone(this._boundingSphere,u),this._cull){let m=u.center;P.multiplyByPoint(d,m,m);let p=P.getScale(d,uWt);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!==Ur.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&cWt(this,e,this._style),this._drawCommand.castShadows=Wn.castShadows(this.shadows),this._drawCommand.receiveShadows=Wn.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)};h9.prototype.isDestroyed=function(){return!1};h9.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 f9=h9;var Pro=x(T(),1);var mro=x(T(),1),mWt={NEAREST:0,LINEAR:1},om=mWt;function jg(e){e=e??B.EMPTY_OBJECT;let{name:t=$n(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=om.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 Tc;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(jg.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 hWt=/uniform\s+sampler2D\s+depthTexture/g;jg.prototype._isSupported=function(e){return!hWt.test(this._fragmentShader)||e.depthTexture};function fWt(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 pWt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function bWt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function gWt(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]=pWt(e,r),n[r]=fWt(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`]=bWt(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 yWt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,Y&&(le+=$9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),le+=`} +`,e.splitDirection!==wr.NONE&&(le=WA.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 s9t(e,t){if(e._decodingState===LR.READY)return!1;if(e._decodingState===LR.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Ab.decodePointCloud(i,t);l(o)&&(e._decodingState=LR.DECODING,o.then(function(r){e._decodingState=LR.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=LR.FAILED,e._error=r}))}return!0}var a9t=new ce,c9t=new h;qk.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(s9t(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)||(n9t(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,a9t);ce.equals(p,ce.UNIT_W)||_t.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(me.clone(this._boundingSphere,u),this._cull){let m=u.center;P.multiplyByPoint(d,m,m);let p=P.getScale(d,c9t);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!==wr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&r9t(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)};qk.prototype.isDestroyed=function(){return!1};qk.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 $k=qk;var SPo=x(T(),1);var $Io=x(T(),1),l9t={NEAREST:0,LINEAR:1},um=l9t;function hy(e){e=e??B.EMPTY_OBJECT;let{name:t=qn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=um.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(hy.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 d9t=/uniform\s+sampler2D\s+depthTexture/g;hy.prototype._isSupported=function(e){return!d9t.test(this._fragmentShader)||e.depthTexture};function u9t(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 m9t(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function h9t(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function f9t(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]=m9t(e,r),n[r]=u9t(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`]=h9t(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 p9t(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; @@ -11381,7 +11390,7 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function xWt(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=yWt(n,o)}let i=new Je({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function TWt(e){let t=e._sampleMode,n,i;t===om.LINEAR?(n=Ht.LINEAR,i=qn.LINEAR):(n=Ht.NEAREST,i=qn.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function _Wt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function SWt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ZWt(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]=SWt(e,d);else if(typeof d=="string"){let m=new ve({url:d});s.push(m.fetchImage().then(_Wt(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 Rve(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 RWt(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 CWt(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=wt.maximumTextureSize;if(i>o&&(jg._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:Ot.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:Ot.NEAREST})}jg.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Rve(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=RWt(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,CWt(this,e),gWt(this),ZWt(this,e),xWt(this,e),TWt(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};jg.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,Ot.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)};jg.prototype.isDestroyed=function(){return!1};jg.prototype.destroy=function(){return Rve(this),ue(this)};jg._oneTimeWarning=xt;var Uo=jg;var Lao=x(T(),1);var oao=x(T(),1);var Nro=x(T(),1),p9=`uniform sampler2D colorTexture; +${e}`}function b9t(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=p9t(n,o)}let i=new Je({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function g9t(e){let t=e._sampleMode,n,i;t===um.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 y9t(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function x9t(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function T9t(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]=x9t(e,d);else if(typeof d=="string"){let m=new ve({url:d});s.push(m.fetchImage().then(y9t(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 xXe(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 _9t(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 S9t(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&&(hy._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})}hy.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&xXe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=_9t(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,S9t(this,e),f9t(this),T9t(this,e),b9t(this,e),g9t(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};hy.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)};hy.prototype.isDestroyed=function(){return!1};hy.prototype.destroy=function(){return xXe(this),ue(this)};hy._oneTimeWarning=xt;var Uo=hy;var gNo=x(T(),1);var BXo=x(T(),1);var RPo=x(T(),1),eU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11401,7 +11410,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var Mro=x(T(),1),b9=`precision highp float; +`;var VPo=x(T(),1),tU=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -11509,7 +11518,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var kro=x(T(),1),g9=`uniform sampler2D colorTexture; +`;var APo=x(T(),1),nU=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -11519,7 +11528,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var Dro=x(T(),1),y9=`uniform sampler2D colorTexture; +`;var LPo=x(T(),1),iU=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -11536,7 +11545,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var Bro=x(T(),1),x9=`uniform sampler2D colorTexture; +`;var vPo=x(T(),1),oU=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -11552,7 +11561,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var Hro=x(T(),1),T9=`uniform sampler2D colorTexture; +`;var IPo=x(T(),1),rU=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -11561,7 +11570,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var Jro=x(T(),1),_9=`uniform sampler2D colorTexture; +`;var XPo=x(T(),1),sU=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -11575,7 +11584,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 Qro=x(T(),1),S9=`uniform sampler2D colorTexture; +`;var YPo=x(T(),1),aU=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -11610,14 +11619,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 $ro=x(T(),1),Z9=`uniform sampler2D depthTexture; +`;var wPo=x(T(),1),cU=`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 tso=x(T(),1),R9=`uniform sampler2D depthTexture; +`;var UPo=x(T(),1),lU=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -11667,7 +11676,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 iso=x(T(),1),C9=`uniform sampler2D colorTexture; +`;var OPo=x(T(),1),dU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11696,7 +11705,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 rso=x(T(),1),V9=`uniform sampler2D colorTexture; +`;var zPo=x(T(),1),uU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11716,7 +11725,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var aso=x(T(),1),E9=`in vec2 v_textureCoordinates; +`;var KPo=x(T(),1),mU=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -11734,7 +11743,7 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var lso=x(T(),1),pT=`#define SAMPLES 8 +`;var jPo=x(T(),1),NT=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; @@ -11768,7 +11777,7 @@ result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } -`;var uso=x(T(),1),A9=`uniform sampler2D colorTexture; +`;var qPo=x(T(),1),hU=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -11883,7 +11892,7 @@ result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } -`;var hso=x(T(),1),G9=`uniform sampler2D colorTexture; +`;var eXo=x(T(),1),fU=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE @@ -11905,7 +11914,7 @@ color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var pso=x(T(),1),L9=`uniform sampler2D colorTexture; +`;var nXo=x(T(),1),pU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { @@ -11918,7 +11927,7 @@ 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 gso=x(T(),1),W9=`uniform sampler2D colorTexture; +`;var oXo=x(T(),1),bU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11939,7 +11948,7 @@ color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var xso=x(T(),1),v9=`uniform sampler2D colorTexture; +`;var sXo=x(T(),1),gU=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) @@ -11948,7 +11957,7 @@ vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;var _so=x(T(),1);/** +`;var cXo=x(T(),1);/** * @license * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * @@ -11975,7 +11984,7 @@ out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); * 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 F9=`#if (FXAA_QUALITY_PRESET == 10) + */var yU=`#if (FXAA_QUALITY_PRESET == 10) #define FXAA_QUALITY_PS 3 #define FXAA_QUALITY_P0 1.5 #define FXAA_QUALITY_P1 3.0 @@ -12445,8 +12454,8 @@ if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); } -`;var Eso=x(T(),1);function KZ(e){e=e??B.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=$n()),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(KZ.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}}});KZ.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};KZ.prototype.get=function(e){return this._stages[e]};function VWt(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}KZ.prototype.update=function(e,t){this._selectedDirty=VWt(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)}};KZ.prototype.isDestroyed=function(){return!1};KZ.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var ru=KZ;var cs={};function vre(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:om.LINEAR}),s=new Uo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:om.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 ru({name:e,stages:[r,s],uniforms:a})}cs.createBlurStage=function(){return vre("czm_blur")};cs.createDepthOfFieldStage=function(){let e=vre("czm_depth_of_field_blur"),t=new Uo({name:"czm_depth_of_field_composite",fragmentShader:S9,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 ru({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};cs.isDepthOfFieldSupported=function(e){return e.context.depthTexture};cs.createEdgeDetectionStage=function(){let e=$n();return new Uo({name:`czm_edge_detection_${e}`,fragmentShader:R9,uniforms:{length:.25,color:U.clone(U.BLACK)}})};cs.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function EWt(e){if(!l(e))return cs.createEdgeDetectionStage();let t=new ru({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}; +`;var fXo=x(T(),1);function WR(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(WR.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}}});WR.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};WR.prototype.get=function(e){return this._stages[e]};function Z9t(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}WR.prototype.update=function(e,t){this._selectedDirty=Z9t(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)}};WR.prototype.isDestroyed=function(){return!1};WR.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var hu=WR;var ls={};function wae(e){let o=`#define USE_STEP_SIZE +${NT}`,r=new Uo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:um.LINEAR}),s=new Uo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:um.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 hu({name:e,stages:[r,s],uniforms:a})}ls.createBlurStage=function(){return wae("czm_blur")};ls.createDepthOfFieldStage=function(){let e=wae("czm_depth_of_field_blur"),t=new Uo({name:"czm_depth_of_field_composite",fragmentShader:aU,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 hu({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:lU,uniforms:{length:.25,color:U.clone(U.BLACK)}})};ls.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function R9t(e){if(!l(e))return ls.createEdgeDetectionStage();let t=new hu({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) { @@ -12461,22 +12470,14 @@ void main() { ${o} } out_FragColor = color; } -`,s=new Uo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new ru({name:"czm_edge_detection_composite",stages:[t,s]})}cs.createSilhouetteStage=function(e){let t=EWt(e),n=new Uo({name:"czm_silhouette_color_edges",fragmentShader:v9,uniforms:{silhouetteTexture:t.name}});return new ru({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};cs.isSilhouetteSupported=function(e){return e.context.depthTexture};cs.createBloomStage=function(){let e=new Uo({name:"czm_bloom_contrast_bias",fragmentShader:_9,uniforms:{contrast:128,brightness:-.3}}),t=vre("czm_bloom_blur"),n=new ru({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Uo({name:"czm_bloom_generate_composite",fragmentShader:x9,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 ru({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};cs.createAmbientOcclusionStage=function(){let e=new Uo({name:"czm_ambient_occlusion_generate",fragmentShader:b9,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Uo({name:"czm_ambient_occlusion_composite",fragmentShader:g9,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 ru({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};cs.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var AWt=`#define FXAA_QUALITY_PRESET 39 -${F9} -${E9}`;cs.createFXAAStage=function(){return new Uo({name:"czm_FXAA",fragmentShader:AWt,sampleMode:om.LINEAR})};cs.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=p9,new Uo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};cs.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=C9,new Uo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};cs.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=V9,new Uo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};cs.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=W9,new Uo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};cs.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=G9,new Uo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};cs.createAutoExposureStage=function(){return new _G};cs.createBlackAndWhiteStage=function(){return new Uo({name:"czm_black_and_white",fragmentShader:y9,uniforms:{gradations:5}})};cs.createBrightnessStage=function(){return new Uo({name:"czm_brightness",fragmentShader:T9,uniforms:{brightness:.5}})};cs.createNightVisionStage=function(){return new Uo({name:"czm_night_vision",fragmentShader:L9})};cs.createDepthViewStage=function(){return new Uo({name:"czm_depth_view",fragmentShader:Z9})};cs.createLensFlareStage=function(){return new Uo({name:"czm_lens_flare",fragmentShader:A9,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 rm=cs;var mao=x(T(),1);function Qg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function P9(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Fre(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[P9(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[P9(m)]=!0)}}}return i.name}function I9(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=I9(e,t,n,p,o):a=Fre(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=P9(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=P9(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[P9(i.get(p))]=!0}return a}function GWt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=I9(e,t,n,i,void 0);a=I9(e,t,n,o,a),a=Fre(e,t,n,r,a),a=I9(e,t,n,e,a),Fre(e,t,n,s,a)}else I9(e,t,n,e,void 0);return n}function LWt(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 WWt(e,t){let n=GWt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=LWt(e,i,n[i]))}function Ire(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function vWt(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})}}Qg.prototype.updateDependencies=function(){this._updateDependencies=!0};Qg.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)&&(Ire(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&WWt(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,Ire(this),vWt(this,e))};Qg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Qg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Qg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Qg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};Qg.prototype.isDestroyed=function(){return!1};Qg.prototype.destroy=function(){return Ire(this),ue(this)};var JZ=Qg;var fao=x(T(),1),Cve={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(Cve);var qg=Cve;var Pre=[];function ld(){let e=rm.createFXAAStage(),t=rm.createAmbientOcclusionStage(),n=rm.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=rm.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=qg.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new JZ(this),r={},s=Pre;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(ld.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 Xre(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 qg.REINHARD:n=rm.createReinhardTonemappingStage(t);break;case qg.MODIFIED_REINHARD:n=rm.createModifiedReinhardTonemappingStage(t);break;case qg.FILMIC:n=rm.createFilmicTonemappingStage(t);break;case qg.PBR_NEUTRAL:n=rm.createPbrNeutralTonemappingStage(t);break;default:n=rm.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 Xre(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}ld.prototype.add=function(e){let t=this._stageNames,n=Pre;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};ld.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Pre;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};ld.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};ld.prototype.get=function(e){return Xre(this),this._stages[e]};ld.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};ld.prototype.getStageByName=function(e){return this._stageNames[e]};ld.prototype.update=function(e,t,n){Xre(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 Ot({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:qn.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)};ld.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function jZ(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}ld.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return jZ(t)};function X0(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){X0(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)X0(e.get(r),t,jZ(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)X0(e.get(r),t,n,i,o)}ld.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&&(X0(a,e,_,n,i),_=jZ(a)),p&&c.ready&&(X0(c,e,_,n,i),_=jZ(c)),b&&d.ready&&X0(d,e,_,n,i),f&&u.ready&&(X0(u,e,_,n,i),_=jZ(u));let S=_;if(r>0){X0(o[0],e,_,n,i);for(let Z=1;Z<r;++Z)X0(o[Z],e,jZ(o[Z-1]),n,i);S=jZ(o[r-1])}y&&s.ready&&X0(s,e,S,n,i)};ld.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(qd,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};ld.prototype.isDestroyed=function(){return!1};ld.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 X9=ld;var Fao=x(T(),1);var Nre=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()}},Yre=Nre;var ofo=x(T(),1);var Dao=x(T(),1);function Cl(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 dK=new h;Object.defineProperties(Cl.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,dK),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,dK);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,dK),dK)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Cl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Cl(e,t)};var Eve=new h;Cl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,Eve),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 FWt=new h;Cl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,FWt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Eve),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 IWt=new h;Cl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Kr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,IWt),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?Kr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Kr.FULL:Kr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Kr.PARTIAL:Kr.FULL))}}return Kr.NONE};var uK=new h;Cl.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,uK),uK),c=-h.dot(a,o),d=Cl._anyRotationVector(o,a,c),u=Cl._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let b=1;b<s;++b){if(m=Cl._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,uK),uK)};var PWt=[];Cl.computeOccludeePointFromRectangle=function(e,t){t=t??ne.default;let n=re.subsample(e,t,0,PWt),i=me.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Cl.computeOccludeePoint(new me(o,t.minimumRadius),i.center,n)};var XWt=new h;Cl._anyRotationVector=function(e,t,n){let i=h.abs(t,XWt),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 NWt=new h;Cl._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,NWt);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 Mre=new h,YWt=new h,mK=new h,Vve=new h;Cl._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,Mre),s=h.clone(e.center,YWt),a=e.radius,c=h.subtract(s,r,mK),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,_,Vve),Vve),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,Mre);C=h.normalize(C,C);let E=h.multiplyByScalar(C,Z,Mre);R=h.normalize(h.subtract(h.add(S,E,mK),s,mK),mK);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 N9=Cl;var oco=x(T(),1);var Bao=x(T(),1),QZ=`in vec4 position; -in vec2 textureCoordinates; -out vec2 v_textureCoordinates; -void main() -{ -gl_Position = position; -v_textureCoordinates = textureCoordinates; -} -`;function hK(e){this._context=e}var Y9,MWt=new lt({primitiveType:Ie.TRIANGLES}),wWt=new ui({color:new U(0,0,0,0)});function kWt(e,t){return new hs({context:e,colorTextures:[t],destroyAttachments:!1})}function UWt(e,t){return tn.fromCache({context:e,vertexShaderSource:QZ,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function DWt(e,t){return(!l(Y9)||Y9.viewport.width!==e||Y9.viewport.height!==t)&&(Y9=ze.fromCache({viewport:new nt(0,0,e,t)})),Y9}hK.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:UWt(o,e.fragmentShaderSource),a=kWt(o,t),c=DWt(n,i),d=e.uniformMap,u=wWt;u.framebuffer=a,u.renderState=c,u.execute(o);let m=MWt;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)};hK.prototype.isDestroyed=function(){return!1};hK.prototype.destroy=function(){return ue(this)};var M9=hK;var xlo=x(T(),1);var sco=x(T(),1),wre=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)}},w9=wre;var mco=x(T(),1);function Hf(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Hf.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Hf.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function OWt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Hf.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)?OWt(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 tn({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};Hf.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){kre(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Hf.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Hf.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 tn({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 kre(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];kre(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Hf.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];kre(this,n),--this._numberOfShaders}this._shadersToRelease={}};Hf.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Hf.prototype.isDestroyed=function(){return!1};Hf.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var k9=Hf;var bco=x(T(),1);function qZ(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(qZ.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});qZ.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};qZ.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};qZ.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={}};qZ.prototype.isDestroyed=function(){return!1};qZ.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var U9=qZ;var Mco=x(T(),1);var Tco=x(T(),1);function BWt(e){e=e??B.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var $g=BWt;function xE(){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(xE.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 Lve(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Lve(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 Dre(this),this._view3D}},viewRotation:{get:function(){return Dre(this),this._viewRotation}},viewRotation3D:{get:function(){return Dre(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Fve(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Fve(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return nvt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ivt(this),this._modelView}},modelView3D:{get:function(){return ovt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return dvt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return rvt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return svt(this),this._inverseModelView3D}},viewProjection:{get:function(){return avt(this),this._viewProjection}},inverseViewProjection:{get:function(){return cvt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return lvt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return uvt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return mvt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return hvt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return fvt(this),this._normal}},normal3D:{get:function(){return pvt(this),this._normal3D}},inverseNormal:{get:function(){return bvt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return gvt(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 vve(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return vve(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 zWt(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 HWt(e,t){P.clone(t,e._inverseView),P.getMatrix3(t,e._inverseViewRotation)}function KWt(e,t){P.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function JWt(e,t){P.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Ave=new h,jWt=new P,Gve=new q;function QWt(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,Ave)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Ave)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=q.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=_t.eastNorthUpToFixedFrame(i,n,jWt);e._enuToModel=P.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=P.inverseTransformation(e._enuToModel,e._modelToEnu);let s=P.getRotation(r,Gve),a=q.multiply(e._viewRotation,s,Gve);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 Ure=new q,qWt=new pe;function $Wt(e,t){_t.computeIcrfToCentralBodyFixedMatrix(t.time,Ure);let n=uT.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);q.multiplyByVector(Ure,n,n),h.normalize(n,e._sunDirectionWC),n=q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=uT.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),q.multiplyByVector(Ure,n,n),q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,qWt);i.project(r,e._sunPositionColumbusView)}xE.prototype.updateCamera=function(e){zWt(this,e.viewMatrix),HWt(this,e.inverseViewMatrix),QWt(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 bn};xE.prototype.updateFrustum=function(e){KWt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&JWt(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};xE.prototype.updatePass=function(e){this._pass=e};var evt=[],tvt=new $g;xE.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),$Wt(this,e);let n=e.light??tvt;n instanceof $g?(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??evt,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 Lve(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 nvt(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 ivt(e){e._modelViewDirty&&(e._modelViewDirty=!1,P.multiplyTransformation(e._view,e._model,e._modelView))}function ovt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,P.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function rvt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,P.inverse(e.modelView,e._inverseModelView))}function svt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,P.inverse(e.modelView3D,e._inverseModelView3D))}function avt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,P.multiply(e._projection,e._view,e._viewProjection))}function cvt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,P.inverse(e.viewProjection,e._inverseViewProjection))}function lvt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,P.multiply(e._projection,e.modelView,e._modelViewProjection))}function dvt(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 uvt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,P.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function mvt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,P.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function hvt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,P.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function fvt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;P.getMatrix3(e.inverseModelView,t),q.transpose(t,t)}}function pvt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;P.getMatrix3(e.inverseModelView3D,t),q.transpose(t,t)}}function bvt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;P.getMatrix3(e.modelView,t),q.transpose(t,t)}}function gvt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;P.getMatrix3(e.modelView3D,t),q.transpose(t,t)}}var Wve=new h;function vve(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,P.multiplyByPoint(e.inverseModel,e._cameraPosition,Wve),An.fromCartesian(Wve,e._encodedCameraPositionMC))}var yvt=new h,xvt=new h,Tvt=new h,_vt=new h,Svt=new pe,Zvt=new h,Rvt=new P;function Cvt(e,t,n,i,o,r,s,a){let c=yvt;c.x=e.y,c.y=e.z,c.z=e.x;let d=xvt;d.x=n.y,d.y=n.z,d.z=n.x;let u=Tvt;u.x=i.y,u.y=i.z,u.z=i.x;let m=_vt;m.x=t.y,m.y=t.z,m.z=t.x,r===se.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,Svt);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,Zvt),y=_t.eastNorthUpToFixedFrame(f,b,Rvt);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 Dre(e){e._view3DDirty&&(e._mode===se.SCENE3D?P.clone(e._view,e._view3D):Cvt(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 Fve(e){e._inverseView3DDirty&&(P.inverseTransformation(e.view3D,e._inverseView3D),P.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var D9=xE;function su(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):Vvt(e,o,i),d=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=d,this._id=$n(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new k9(this),this._textureCache=new U9,this._transparentDefaultTexture=s;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),wt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),wt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),wt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),wt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),wt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),wt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),wt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),wt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),wt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),wt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),wt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),wt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let m=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);wt._minimumAliasedLineWidth=m[0],wt._maximumAliasedLineWidth=m[1];let p=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);wt._minimumAliasedPointSize=p[0],wt._maximumAliasedPointSize=p[1];let b=u.getParameter(u.MAX_VIEWPORT_DIMS);wt._maximumViewportWidth=b[0],wt._maximumViewportHeight=b[1];let f=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);wt._highpFloatSupported=f.precision!==0;let y=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);wt._highpIntSupported=y.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!ls(u,["OES_standard_derivatives"]),this._blendMinmax=!!ls(u,["EXT_blend_minmax"]),this._elementIndexUint=!!ls(u,["OES_element_index_uint"]),this._depthTexture=!!ls(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!ls(u,["EXT_frag_depth"]),this._debugShaders=ls(u,["WEBGL_debug_shaders"]),this._textureFloat=!!ls(u,["OES_texture_float"]),this._textureHalfFloat=!!ls(u,["OES_texture_half_float"]),this._textureFloatLinear=!!ls(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!ls(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!ls(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!ls(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!ls(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!ls(u,["EXT_color_buffer_half_float"]),this._s3tc=!!ls(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!ls(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!ls(u,["WEBGL_compressed_texture_astc"]),this._etc=!!ls(u,["WEBG_compressed_texture_etc"]),this._etc1=!!ls(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!ls(u,["EXT_texture_compression_bptc"]),Ad.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?ls(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,wt._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,M,O){u.drawElementsInstanced(X,Y,D,M,O)},E=function(X,Y,D,M){u.drawArraysInstanced(X,Y,D,M)},A=function(X,Y){u.vertexAttribDivisor(X,Y)},L=function(X){u.drawBuffers(X)}}else F=ls(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=ls(u,["ANGLE_instanced_arrays"]),l(I)&&(C=function(v,X,Y,D,M){I.drawElementsInstancedANGLE(v,X,Y,D,M)},E=function(v,X,Y,D){I.drawArraysInstancedANGLE(v,X,Y,D)},A=function(v,X){I.vertexAttribDivisorANGLE(v,X)}),N=ls(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,wt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ie.MAX_DRAW_BUFFERS):1,wt._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 D9,V=new Tc(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<wt._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 Vvt(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 Evt(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 Avt(e,t,n,i){let o=`${Evt(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function Gvt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(Avt(e,t,n,i))}function Lvt(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 Wvt(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,Lvt(e,o,t))}return i}function ls(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var vvt={};Object.defineProperties(su.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=Wvt(this._originalGLContext,e?Gvt: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 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 vvt}}});function Ive(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 Ore;typeof WebGLRenderingContext<"u"&&(Ore=[ie.BACK]);function fK(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Ore;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Fvt=new ui;su.prototype.clear=function(e,t){e=e??Fvt,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;Ive(this,a,t,!0);let c=e.framebuffer??t.framebuffer;fK(this,c),n.clear(i)};function Ivt(e,t,n,i,o){fK(e,t),Ive(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Pvt(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()}su.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,Ivt(this,o,t,n,r),Pvt(this,e,n,i)};su.prototype.beginFrame=function(){};su.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=Ore;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)};su.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=it.createPixelBuffer({context:this,sizeInBytes:Qe.textureSizeInBytes(c,a,o,r),usage:Pe.DYNAMIC_READ});return fK(this,s),d._bind(),t.readPixels(n,i,o,r,c,Ue.toWebGLConstant(a,this),0),d._unBind(),d};su.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 fK(this,s),t.readPixels(n,i,o,r,Qe.RGBA,Ue.toWebGLConstant(a,this),d),d};var Pve={position:0,textureCoordinates:1};su.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:Pve,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};su.prototype.createViewportQuadCommand=function(e,t){return t=t??B.EMPTY_OBJECT,new lt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ie.TRIANGLES,renderState:t.renderState,shaderProgram:tn.fromCache({context:this,vertexShaderSource:QZ,fragmentShaderSource:e,attributeLocations:Pve}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};su.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};su.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 w9(this._pickObjects,t,U.fromRgba(t))};su.prototype.isDestroyed=function(){return!1};su.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 $Z=su;var _lo=x(T(),1),Bre=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))}},O9=Bre;var Mlo=x(T(),1);function eR(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}eR.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};eR.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof bn,!(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?f2t(this,e):_2t(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var Xvt=new h,Nvt=new h,Yvt=new h,Mvt=new h,wvt=new h,kvt=new h,Uvt=new h,Dvt=new pe,Ovt=new P,Bvt=new ji,zvt=new bn,Hvt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};eR.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=Xvt,o=Nvt,r=Yvt;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,Uvt),m=_t.eastNorthUpToFixedFrame(u,t,Ovt);P.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,Dvt),i),P.multiplyByPointAsVector(m,o,o),P.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=zvt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Bvt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=Hvt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Z2t(a);B9(this,c),this._previousMode===se.SCENE2D?S2t(this,e,a,c):(a.position2D=P.multiplyByPoint(Wo.TRANSFORM_2D,i,Mvt),a.direction2D=P.multiplyByPointAsVector(Wo.TRANSFORM_2D,o,wvt),a.up2D=P.multiplyByPointAsVector(Wo.TRANSFORM_2D,r,kvt),n._mode=se.MORPHING,zve(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Kre={position:new h,direction:new h,up:new h,frustum:void 0},Nve=new ji;eR.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)o2t(this,e,t);else{let i;e>0?(i=Kre,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=Yve(this,t);let o,r=n.camera;r.frustum instanceof bn?o=r.frustum.clone():(o=Nve,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=Kve(i);B9(this,s),Hre(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};eR.prototype.isDestroyed=function(){return!1};eR.prototype.destroy=function(){return pK(this),ue(this)};function B9(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ta(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 pK(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 Kvt=new pe,Jvt=new h,jvt=new P;function Yve(e,t){let n=e._scene,i=n.camera,o=Kre,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Kvt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,Jvt),u=_t.eastNorthUpToFixedFrame(d,t,jvt);return P.multiplyByPointAsVector(u,i.direction,s),P.multiplyByPointAsVector(u,i.up,a),o}var Qvt=new h,qvt=new h,$vt=new h,e2t=new h,t2t=new h,n2t=new h;function Hre(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,Qvt),a=h.clone(r.direction,qvt),c=h.clone(r.up,$vt),d=P.multiplyByPoint(Wo.TRANSFORM_2D_INVERSE,n.position,e2t),u=P.multiplyByPointAsVector(Wo.TRANSFORM_2D_INVERSE,n.direction,t2t),m=P.multiplyByPointAsVector(Wo.TRANSFORM_2D_INVERSE,n.up,n2t);function p(f){xh(s,d,f.time,r.position),xh(a,u,f.time,r.direction),xh(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:Ts.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Hve(e,o,0,1,t,i)}});e._currentTweens.push(b)}var i2t=new bn,Mve=new h,wve=new h,kve=new h,Jre=new h,Uve=new h,Dve=new h;function o2t(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=Kre,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=Yve(e,n));let s;e._morphToOrthographic?(s=i2t,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=Nve,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=Kve(r);B9(e,a);let c;e._morphToOrthographic?c=function(){Hre(e,t,r,a)}:c=function(){Bve(e,t,r,function(){Hre(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Jre),complete:function(){i._mode=se.MORPHING,c()}})):c()}function xh(e,t,n,i){return h.lerp(e,t,n,i)}function Ove(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof bn)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:Ts.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var r2t=new h,s2t=new h,a2t=new h,zre=new h,c2t=new h,l2t=new h,d2t=new gs,u2t=new gn,m2t=new h,h2t={position:void 0,direction:void 0,up:void 0,frustum:void 0};function f2t(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,r2t),r=h.clone(i.direction,s2t),s=h.clone(i.up,a2t),a=h.negate(h.UNIT_Z,c2t),c=h.clone(h.UNIT_Y,l2t),d=zre;if(t>0)h.clone(h.ZERO,zre),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,zre);let _=u2t;P.multiplyByPoint(Wo.TRANSFORM_2D,o,_.origin),P.multiplyByPointAsVector(Wo.TRANSFORM_2D,r,_.direction);let S=n.globe;if(l(S)){let Z=S.pickWorldCoordinates(_,n,!0,m2t);l(Z)&&(P.multiplyByPoint(Wo.TRANSFORM_2D_INVERSE,Z,d),d.z+=h.distance(o,d))}}let u=d2t;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=h2t;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=Jve(m);B9(e,p);function b(_){xh(o,d,_.time,i.position),xh(r,a,_.time,i.direction),xh(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:Ts.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){Ove(e,t,m,f,p)}});e._currentTweens.push(y)}var Xve=new pe,p2t={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new gs},b2t={position:new h,direction:new h,up:new h,frustum:void 0},g2t=new h,y2t=new gn,x2t=new P,T2t=new h;function _2t(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=p2t;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,Xve),i.mapProjection.project(Xve,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=y2t;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),b=n.scaleToGeodeticSurface(o.positionWC,T2t),f=_t.eastNorthUpToFixedFrame(b,n,x2t);P.inverseTransformation(f,f),P.multiplyByPointAsVector(f,p,p),P.multiplyByPointAsVector(Wo.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let _=y.pickWorldCoordinates(m,i,!0,g2t);if(l(_)){let S=h.distance(r.position2D,_);_.x+=S,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}P.multiplyByPoint(Wo.TRANSFORM_2D,r.position,r.position2D),P.multiplyByPointAsVector(Wo.TRANSFORM_2D,r.direction,r.direction2D),P.multiplyByPointAsVector(Wo.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=b2t;P.multiplyByPoint(Wo.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=Jve(c);B9(e,d);function u(){Ove(e,t,r,s,d)}zve(e,t,r,u)}function Bve(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:Ts.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function S2t(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,Jre),a=h.clone(n.direction,Uve),c=h.clone(n.up,Dve);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,Mve),m=h.clone(r.direction,wve),p=h.clone(r.up,kve);u.z=s.z;function b(y){xh(u,s,y.time,r.position),xh(m,a,y.time,r.direction),xh(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:Ts.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():Bve(e,0,n,d)}function zve(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,Mve),a=h.clone(r.direction,wve),c=h.clone(r.up,kve),d=h.clone(n.position2D,Jre),u=h.clone(n.direction2D,Uve),m=h.clone(n.up2D,Dve);function p(f){xh(s,d,f.time,r.position),xh(a,u,f.time,r.direction),xh(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:Ts.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Hve(e,o,1,0,t,i)}});e._currentTweens.push(b)}function Hve(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Ts.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function Kve(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),pK(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 Jve(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),pK(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 Z2t(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),pK(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 z9=eR;var _do=x(T(),1);var Klo=x(T(),1);function bK(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(bK.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}}});bK.prototype.cancelTween=function(){this._tweens.remove(this)};function Kf(){this._tweens=[]}Object.defineProperties(Kf.prototype,{length:{get:function(){return this._tweens.length}}});Kf.prototype.add=function(e){if(e=e??B.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new bK(this);let t=e.duration/wn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/wn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Ts.LINEAR_NONE,r=e.startObject,s=new _fe(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 bK(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Kf.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})};Kf.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})};Kf.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})};Kf.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};Kf.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};Kf.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Kf.prototype.get=function(e){return this._tweens[e]};Kf.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/wn.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 tR=Kf;function K9(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=io.LEFT_DRAG,this.zoomEventTypes=[io.RIGHT_DRAG,io.WHEEL,io.PINCH],this.rotateEventTypes=io.LEFT_DRAG,this.tiltEventTypes=[io.MIDDLE_DRAG,io.PINCH,{eventType:io.LEFT_DRAG,modifier:tr.CTRL},{eventType:io.RIGHT_DRAG,modifier:tr.CTRL}],this.lookEventTypes={eventType:io.LEFT_DRAG,modifier:tr.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 A2(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 tR,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 R2t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function C2t(e){return k.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var V2t=.4;function E2t(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<V2t){let b=R2t(p,i),f=e.getLastMovement(t,n);if(!l(f)||C2t(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 A2t(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 jve=[];function dd(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(jve[0]=n,n=jve);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),A2t(e,r)):o<1&&E2t(s,u,m,o,i,e,r))}}var gK=new gn,G2t=new h,L2t=new k,W2t=new h,v2t=new k,F2t=new h,I2t=new h,P2t=new h,X2t=new h,c2e=new h,N2t=new h,Y2t=new h,M2t=new h,w2t=new h,k2t=new h,U2t=new h,D2t=new h,O2t=new h,B2t=new h,z2t=new h,nR=new h,Qve=new h,qve=new h,jre={orientation:new Vc};function ose(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=jre.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,gK).origin,A=h.fromElements(A.y,A.z,A.x)):l(e._globe)&&(A=ey(e,t,G2t)),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,W2t);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,gK).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,c2e);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,F))<.6)L=!0;else{let I=y.canvas,N=v2t;N.x=I.clientWidth/2,N.y=I.clientHeight/2;let g=ey(e,N,F2t);if(!l(g))L=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,F)>=-.5)L=!0;else{let V=Y2t;h.clone(_.position,V);let G=e._zoomWorldPosition,v=N2t;if(v=h.normalize(G,v),h.dot(v,F)<0)return;let X=z2t,Y=k2t;h.clone(_.direction,Y),h.add(V,h.multiplyByScalar(Y,1e3,nR),X);let D=U2t,M=D2t;h.subtract(G,V,D),h.normalize(D,M);let O=h.dot(F,M);if(O>=0){e._zoomMouseStart.x=-1;return}let w=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(w),-1,1)),ee=Math.asin(W.clamp(te/K*Math.sin(w),-1,1)),le=$-ee+w,_e=M2t;h.normalize(V,_e);let he=w2t;he=h.cross(M,_e,he),he=h.normalize(he,he),h.normalize(h.cross(_e,he,nR),Y),h.multiplyByScalar(h.normalize(X,nR),h.magnitude(X)-f,X),h.normalize(V,V),h.multiplyByScalar(V,te,V);let Ze=O2t;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,Qve),h.multiplyByScalar(Y,Math.sin(le),qve),nR),te,Ze),h.add(V,Ze,V),h.normalize(X,_e),h.normalize(h.cross(_e,he,nR),Y);let ye=B2t;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,Qve),h.multiplyByScalar(Y,Math.sin(le),qve),nR),h.magnitude(X),ye),h.add(X,ye,X),h.clone(V,_.position),h.normalize(h.subtract(X,V,nR),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(jre);return}else{let V=h.normalize(g,I2t),G=h.normalize(e._zoomWorldPosition,P2t),v=h.dot(G,V);if(v>0&&v<1){let X=W.acosClamped(v),Y=h.cross(G,V,X2t),D=Math.abs(X)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,M=f/D;_.rotate(Y,X*M)}}}}e._rotatingZoom=!L}if(!R&&L||C){let F,I=ho.worldToWindowCoordinates(y,e._zoomWorldPosition,L2t);S!==se.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(I)?F=_.getPickRay(I,gK):F=_.getPickRay(t,gK);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(jre)}var H2t=new gn,K2t=new gn,J2t=new h;function j2t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,H2t).origin,s=o.getPickRay(n.endPosition,K2t).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,J2t),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function $ve(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;ose(e,t,n,e.zoomFactor,o.getMagnitude())}var Q2t=new k,q2t=new k;function e2e(e,t,n){if(l(n.angleAndHeight)){$2t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=Q2t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=k.normalize(c,c);let d=q2t;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 $2t(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 eFt(e){let t=e._scene.mapMode2D===Bl.ROTATE;P.equals(P.IDENTITY,e._scene.camera.transform)?(dd(e,e.enableTranslate,e.translateEventTypes,j2t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),dd(e,e.enableZoom,e.zoomEventTypes,$ve,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&dd(e,e.enableRotate,e.tiltEventTypes,e2e,e.inertiaSpin,"_lastInertiaTiltMovement")):(dd(e,e.enableZoom,e.zoomEventTypes,$ve,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&dd(e,e.enableRotate,e.translateEventTypes,e2e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var l2e=new gn,tFt=new h,nFt=new h;function ey(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,tFt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,l2e),d=o.pickWorldCoordinates(c,i,a,nFt),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 iFt=new pe;function RK(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,iFt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var oFt=new h;function d2e(e,t){let n=t.origin,i=t.direction,o=RK(e),r=h.normalize(n,oFt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function u2e(e,t,n,i){let o=h.distance(t.origin,n),r=RK(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 m2e(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=RK(e))):o=RK(e),gn.getPoint(t,o,i)}var rFt=new k;function h2e(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,rFt),o=e._strafeEndMousePosition;k.add(o,i,o),t.endPosition=o,rse(e,t,e._strafeStartPosition),t.endPosition=n}var t2e=new gn,sFt=new gn,Qre=new h,aFt=new h,cFt=new h,lFt=new h,dFt=new cn(h.UNIT_X,0),uFt=new k,mFt=new k;function hFt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){am(e,t,n);return}if(e._strafing){h2e(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=k.clone(n.startPosition,uFt),a=k.clone(n.endPosition,mFt),c=o.getPickRay(s,t2e),d=h.clone(h.ZERO,lFt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=ey(e,s,Qre),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let R=m;r&&(R=m2e(e,c,m,Qre)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),h.clone(R,e._strafeStartPosition),e._strafing=!0,rse(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,dFt);c=o.getPickRay(s,t2e);let b=Ti.rayPlane(c,p,Qre),f=o.getPickRay(a,sFt),y=Ti.rayPlane(f,p,aFt);if(!l(b)||!l(y)){e._looking=!0,am(e,t,n),k.clone(t,e._translateMousePosition);return}let _=h.subtract(b,y,cFt),S=_.x;_.x=_.y,_.y=_.z,_.z=S;let Z=h.magnitude(_);Z>W.EPSILON6&&(h.normalize(_,_),o.move(_,Z))}var f2e=new k,TK=new gn,_K=new h,fFt=new h,p2e=new P,pFt=new P,bFt=new h,gFt=new cn(h.UNIT_X,0),qre=new h,tse=new pe,b2e=new P,yFt=new Ne,xFt=new q,SK=new h;function TFt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){am(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,_Ft(e,t,n)):SFt(e,t,n)}function _Ft(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=f2e;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,TK),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,am(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let b=h.multiplyByScalar(u,m,_K);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,tse);y.cartographicToCartesian(_,b);let S=_t.eastNorthUpToFixedFrame(b,y,p2e),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,b2e);o._setTransform(S),sm(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 SFt(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,_K);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=ey(e,t,_K)),!l(s)){a=o.getPickRay(t,TK);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,am(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(V,G,_K),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,TK)),u2e(e,a,s,s)),k.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=f2e;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,TK);let m=h.clone(h.ZERO,bFt);m.x=s.x;let p=cn.fromPointNormal(m,c,gFt),b=Ti.rayPlane(a,p,fFt),f=o._projection,y=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,tse);y.cartographicToCartesian(_,s);let S=_t.eastNorthUpToFixedFrame(s,y,p2e),Z;l(b)?(h.fromElements(b.y,b.z,b.x,b),_=f.unproject(b,tse),y.cartographicToCartesian(_,b),Z=_t.eastNorthUpToFixedFrame(b,y,pFt)):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,b2e);o._setTransform(S);let L=h.cross(h.UNIT_Z,h.normalize(o.position,qre),qre),F=h.dot(o.right,L);if(sm(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,sm(e,t,n,E,!0,!1),o.constrainedAxis=V}else sm(e,t,n,E,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,SK);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,qre);if(e.enableCollisionDetection&&cse(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,yFt),X=q.fromQuaternion(v,xFt);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 g2e=new k,y2e=new gn,x2e=new h;function ZFt(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=g2e,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,y2e),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=ey(e,a,x2e));let b;if(l(p)&&(b=h.distance(d,p)),s){let f=d2e(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)}ose(e,t,n,e.zoomFactor,b)}function RFt(e){let n=e._scene.camera;if(!P.equals(P.IDENTITY,n.transform))dd(e,e.enableRotate,e.rotateEventTypes,sm,e.inertiaSpin,"_lastInertiaSpinMovement"),dd(e,e.enableZoom,e.zoomEventTypes,_2e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),dd(e,e.enableTilt,e.tiltEventTypes,TFt,e.inertiaSpin,"_lastInertiaTiltMovement"),dd(e,e.enableTranslate,e.translateEventTypes,hFt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),dd(e,e.enableZoom,e.zoomEventTypes,ZFt,e.inertiaZoom,"_lastInertiaZoomMovement"),dd(e,e.enableLook,e.lookEventTypes,am),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var CFt=new gn,VFt=new cn(h.UNIT_X,0),EFt=new h,AFt=new h;function rse(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,CFt),s=h.clone(o.direction,AFt);i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,VFt),c=Ti.rayPlane(r,a,EFt);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 n2e=new h,T2e=new pe,nse=new h,ise=new ne,GFt=new h,LFt=new h,WFt=new h;function vFt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!P.equals(o.transform,P.IDENTITY)){sm(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,GFt);if(k.equals(t,e._rotateMousePosition)){if(e._looking)am(e,t,n,d);else if(e._rotating)sm(e,t,n);else if(e._strafing)h2e(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=nse,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,ise),ese(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,T2e).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=ey(e,n.startPosition,WFt);if(l(p)){let b,f=o.getPickRay(n.startPosition,l2e);if(r)b=!0,m2e(e,f,p,p);else{let y=s.geodeticSurfaceNormal(p,LFt);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,rse(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=nse,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,ise),ese(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,am(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,n2e))?(ese(e,t,n,e._ellipsoid),h.clone(n2e,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,sm(e,t,n)):(e._looking=!0,am(e,t,n,d));k.clone(t,e._rotateMousePosition)}function sm(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 $re=ce.clone(ce.UNIT_W),i2e=ce.clone(ce.UNIT_W),yK=new h,TE=new h,xK=new h,o2e=new h,FFt=new k,IFt=new k,PFt=new k,XFt=new k,NFt=new gn;function ese(e,t,n,i){let o=e._scene,r=o.camera,s=k.clone(n.startPosition,FFt),a=k.clone(n.endPosition,IFt),c=i.cartesianToCartographic(r.positionWC,T2e).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,$re),!l(e._globe)&&!k.equalsEpsilon(s,e._panLastMousePosition)&&(d=ey(e,s,$re)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,TE),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),TE),b=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,b,o.pixelRatio,XFt),y=k.subtract(a,s,PFt),_=h.multiplyByScalar(r.rightWC,y.x*f.x,TE),S=h.normalize(r.positionWC,c2e),Z=r.getPickRay(a,NFt).direction,R=h.subtract(Z,h.projectVector(Z,r.rightWC,xK),xK),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,xK);A=Math.abs(h.dot(r.upWC,S));let I=h.multiplyByScalar(r.upWC,-y.y*(1-A)*f.y,o2e);u=h.add(d,_,i2e),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,$re),u=r.pickEllipsoid(a,i,i2e)),!l(d)||!l(u)){e._rotating=!0,sm(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,yK);h.cross(p,m,p),h.normalize(p,p);let b=h.cross(m,p,TE),f=h.magnitude(d),y=h.dot(m,d),_=Math.acos(y/f),S=h.multiplyByScalar(m,y,xK);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,o2e);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,yK);let N=h.cross(m,I,yK),g=h.dot(N,h.subtract(d,m,TE)),V=h.dot(N,h.subtract(u,m,TE)),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,yK);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let b=Math.acos(m);r.rotate(p,b)}}}var YFt=new h,MFt=new pe,r2e=0;function _2e(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=g2e,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,y2e),m,p=o.cartesianToCartographic(s.position,MFt).height,b=Math.abs(r2e)<e.minimumPickingTerrainDistanceWithInertia;(i?b:p<e._minimumPickingTerrainHeight)&&(m=ey(e,d,x2e));let y;if(l(m)&&(y=h.distance(u.origin,m)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(r2e=y),c){let S=d2e(e,u,p);l(y)?y=Math.min(y,S):y=S}l(y)||(y=p);let _=h.normalize(s.position,YFt);ose(e,t,n,e.zoomFactor,y,h.dot(_,s.direction))}var S2e=new k,ZK=new gn,H9=new h,wFt=new h,Z2e=new P,kFt=new P,R2e=new P,UFt=new Ne,DFt=new q,sse=new pe,ase=new h;function OFt(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,ase);am(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,sse);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,zFt(e,t,n)):HFt(e,t,n)}var BFt=new pe;function zFt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,BFt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=S2e;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,ZK),m,p=Ti.rayEllipsoid(u,i);if(l(p))m=gn.getPoint(u,p.start,H9);else if(a>e._minimumTrackBallHeight){let Z=Ti.grazingAltitudeLocation(u,i);if(!l(Z))return;let R=i.cartesianToCartographic(Z,sse);R.height=0,m=i.cartographicToCartesian(R,H9)}else{e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,ase);am(e,t,n,Z),k.clone(t,e._tiltCenterMousePosition);return}let b=_t.eastNorthUpToFixedFrame(m,i,Z2e),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,R2e);r._setTransform(b),sm(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 HFt(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,H9);else{if(a=ey(e,t,H9),!l(a)){if(c=r.getPickRay(t,ZK),d=Ti.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,sse).height<=e._minimumTrackBallHeight){e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,ase);am(e,t,n,V),k.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,d.start,H9)}s&&(l(c)||(c=r.getPickRay(t,ZK)),u2e(e,c,a,a)),k.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=S2e;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,ZK);let p=h.magnitude(a),b=h.fromElements(p,p,p,nse),f=ne.fromCartesian3(b,ise);if(d=Ti.rayEllipsoid(c,f),!l(d))return;let y=h.magnitude(c.origin)>p?d.start:d.stop,_=gn.getPoint(c,y,wFt),S=_t.eastNorthUpToFixedFrame(a,i,Z2e),Z=_t.eastNorthUpToFixedFrame(_,f,kFt),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,R2e);r._setTransform(Z);let L=h.cross(_,r.positionWC,SK);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,sm(e,t,n,E,!0,!1),r.constrainedAxis=V}else sm(e,t,n,E,!0,!1);if(r._setTransform(S),sm(e,t,n,E,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,SK);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,SK);if(e.enableCollisionDetection&&cse(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,UFt),X=q.fromQuaternion(v,DFt);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 KFt=new k,JFt=new k,s2e=new gn,a2e=new gn,jFt=new h,QFt=new h;function am(e,t,n,i){let r=e._scene.camera,s=KFt;s.x=n.startPosition.x,s.y=0;let a=JFt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,s2e),d=r.getPickRay(a,a2e),u=0,m,p;r.frustum instanceof bn?(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,s2e),d=r.getPickRay(a,a2e),u=0,r.frustum instanceof bn?(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,jFt),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,QFt);r.look(C,u)}else(S&&u<0||Z&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function qFt(e){dd(e,e.enableRotate,e.rotateEventTypes,vFt,e.inertiaSpin,"_lastInertiaSpinMovement"),dd(e,e.enableZoom,e.zoomEventTypes,_2e,e.inertiaZoom,"_lastInertiaZoomMovement"),dd(e,e.enableTilt,e.tiltEventTypes,OFt,e.inertiaSpin,"_lastInertiaTiltMovement"),dd(e,e.enableLook,e.lookEventTypes,am)}var $Ft=new P,eIt=new pe;function cse(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,$Ft),c=h.magnitude(o.position),o._setTransform(P.IDENTITY));let d=eIt;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)))}K9.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 tIt=new h,nIt=new h;K9.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,tIt),c=h.clone(t.directionWC,nIt);if(i===se.SCENE2D?eFt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,RFt(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,qFt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);cse(this,d)}this._aggregator.reset()};K9.prototype.isDestroyed=function(){return!1};K9.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var J9=K9;var Vdo=x(T(),1);function CK(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new $Z(this._canvas,$e(e?.contextOptions)),this._canvases=[]}CK.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)}}})};CK.prototype.destroy=function(){this._context.destroy(),ue(this)};CK.prototype.isDestroyed=function(){return!1};var j9=CK;var Bdo=x(T(),1);var Pdo=x(T(),1);function Q9(e){let t=new Tc(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 iIt(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}Q9.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};Q9.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 iIt(i,o,t,n)};Q9.prototype.isDestroyed=function(){return!1};Q9.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var q9=Q9;var $9={},oIt=new nt(0,0,3,3),rIt=new k,sIt=new k,aIt=new gn,cIt=new h,lIt=3,dIt=.1,C2e=9;function lse(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function V2e(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&lse(s)<=lIt&&(t=Math.min(t,s.depth));let n=t*(1+dIt),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)=>lse(a)<lse(s)?a:s)}function E2e(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 dse(e,t,n){let i=rIt;i.x=t.x+n.x,i.y=t.y+n.y;let o=e.camera.getPickRay(i,aIt);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,cIt);return h.add(o.origin,a,new h)}$9.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 q9(r));let a=s.snapFramebuffer,c=oIt;d9(e,t,c,i,o,{framebuffer:a,snap:!0});let d=a.end(c);if(u9(e),d.length===0)return;let u=V2e(d);if(!l(u))return;let m=dse(e,t,u);if(!l(m))return;let p=m;if(u.isEdge){let b=sIt;b.x=t.x+u.x,b.y=t.y+u.y,d9(e,b,c,C2e,C2e,{framebuffer:a,snap:!0});let f=a.end(c);u9(e);let y=E2e(f,u.object);p=l(y)?dse(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)}};$9._selectBestHit=V2e;$9._nearestSurfaceHit=E2e;$9._snapHitToWorld=dse;var ek=$9;var fuo=x(T(),1);var Hdo=x(T(),1),tk=`uniform sampler2D colorTexture; +`,s=new Uo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new hu({name:"czm_edge_detection_composite",stages:[t,s]})}ls.createSilhouetteStage=function(e){let t=R9t(e),n=new Uo({name:"czm_silhouette_color_edges",fragmentShader:gU,uniforms:{silhouetteTexture:t.name}});return new hu({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:sU,uniforms:{contrast:128,brightness:-.3}}),t=wae("czm_bloom_blur"),n=new hu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Uo({name:"czm_bloom_generate_composite",fragmentShader:oU,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 hu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};ls.createAmbientOcclusionStage=function(){let e=new Uo({name:"czm_ambient_occlusion_generate",fragmentShader:tU,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Uo({name:"czm_ambient_occlusion_composite",fragmentShader:nU,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 hu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var C9t=`#define FXAA_QUALITY_PRESET 39 +${yU} +${mU}`;ls.createFXAAStage=function(){return new Uo({name:"czm_FXAA",fragmentShader:C9t,sampleMode:um.LINEAR})};ls.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=eU,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+=dU,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+=uU,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+=bU,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+=fU,new Uo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};ls.createAutoExposureStage=function(){return new Mw};ls.createBlackAndWhiteStage=function(){return new Uo({name:"czm_black_and_white",fragmentShader:iU,uniforms:{gradations:5}})};ls.createBrightnessStage=function(){return new Uo({name:"czm_brightness",fragmentShader:rU,uniforms:{brightness:.5}})};ls.createNightVisionStage=function(){return new Uo({name:"czm_night_vision",fragmentShader:pU})};ls.createDepthViewStage=function(){return new Uo({name:"czm_depth_view",fragmentShader:cU})};ls.createLensFlareStage=function(){return new Uo({name:"czm_lens_flare",fragmentShader:hU,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 mm=ls;var $Xo=x(T(),1);function fy(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function TU(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function kae(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[TU(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[TU(m)]=!0)}}}return i.name}function xU(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=xU(e,t,n,p,o):a=kae(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=TU(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=TU(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[TU(i.get(p))]=!0}return a}function V9t(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=xU(e,t,n,i,void 0);a=xU(e,t,n,o,a),a=kae(e,t,n,r,a),a=xU(e,t,n,e,a),kae(e,t,n,s,a)}else xU(e,t,n,e,void 0);return n}function E9t(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 A9t(e,t){let n=V9t(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=E9t(e,i,n[i]))}function Uae(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function G9t(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 mi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}fy.prototype.updateDependencies=function(){this._updateDependencies=!0};fy.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)&&(Uae(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&A9t(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,Uae(this),G9t(this,e))};fy.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};fy.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};fy.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};fy.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};fy.prototype.isDestroyed=function(){return!1};fy.prototype.destroy=function(){return Uae(this),ue(this)};var vR=fy;var tNo=x(T(),1),TXe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(TXe);var py=TXe;var Dae=[];function bd(){let e=mm.createFXAAStage(),t=mm.createAmbientOcclusionStage(),n=mm.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=mm.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=py.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new vR(this),r={},s=Dae;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(bd.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 Oae(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 py.REINHARD:n=mm.createReinhardTonemappingStage(t);break;case py.MODIFIED_REINHARD:n=mm.createModifiedReinhardTonemappingStage(t);break;case py.FILMIC:n=mm.createFilmicTonemappingStage(t);break;case py.PBR_NEUTRAL:n=mm.createPbrNeutralTonemappingStage(t);break;default:n=mm.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 Oae(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}bd.prototype.add=function(e){let t=this._stageNames,n=Dae;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};bd.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Dae;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};bd.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};bd.prototype.get=function(e){return Oae(this),this._stages[e]};bd.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};bd.prototype.getStageByName=function(e){return this._stageNames[e]};bd.prototype.update=function(e,t,n){Oae(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)};bd.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function FR(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}bd.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return FR(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,FR(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)B0(e.get(r),t,n,i,o)}bd.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),_=FR(a)),p&&c.ready&&(B0(c,e,_,n,i),_=FR(c)),b&&d.ready&&B0(d,e,_,n,i),f&&u.ready&&(B0(u,e,_,n,i),_=FR(u));let S=_;if(r>0){B0(o[0],e,_,n,i);for(let Z=1;Z<r;++Z)B0(o[Z],e,FR(o[Z-1]),n,i);S=FR(o[r-1])}y&&s.ready&&B0(s,e,S,n,i)};bd.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(uu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};bd.prototype.isDestroyed=function(){return!1};bd.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 _U=bd;var TNo=x(T(),1);var Bae=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()}},zae=Bae;var tko=x(T(),1);var ZNo=x(T(),1),Hae=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))}},SU=Hae;var kNo=x(T(),1);function IR(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}IR.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};IR.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?ckt(this,e):pkt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var L9t=new h,W9t=new h,v9t=new h,F9t=new h,I9t=new h,P9t=new h,X9t=new h,N9t=new pe,Y9t=new P,M9t=new qi,w9t=new yn,k9t={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};IR.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=L9t,o=W9t,r=v9t;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,X9t),m=_t.eastNorthUpToFixedFrame(u,t,Y9t);P.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,N9t),i),P.multiplyByPointAsVector(m,o,o),P.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=w9t,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=M9t,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=k9t;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=gkt(a);ZU(this,c),this._previousMode===se.SCENE2D?bkt(this,e,a,c):(a.position2D=P.multiplyByPoint(Io.TRANSFORM_2D,i,F9t),a.direction2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,o,I9t),a.up2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,P9t),n._mode=se.MORPHING,WXe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var jae={position:new h,direction:new h,up:new h,frustum:void 0},SXe=new qi;IR.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)q9t(this,e,t);else{let i;e>0?(i=jae,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=ZXe(this,t);let o,r=n.camera;r.frustum instanceof yn?o=r.frustum.clone():(o=SXe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=FXe(i);ZU(this,s),Jae(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};IR.prototype.isDestroyed=function(){return!1};IR.prototype.destroy=function(){return xJ(this),ue(this)};function ZU(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 xJ(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 U9t=new pe,D9t=new h,O9t=new P;function ZXe(e,t){let n=e._scene,i=n.camera,o=jae,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,U9t);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,D9t),u=_t.eastNorthUpToFixedFrame(d,t,O9t);return P.multiplyByPointAsVector(u,i.direction,s),P.multiplyByPointAsVector(u,i.up,a),o}var B9t=new h,z9t=new h,H9t=new h,K9t=new h,J9t=new h,j9t=new h;function Jae(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,B9t),a=h.clone(r.direction,z9t),c=h.clone(r.up,H9t),d=P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,n.position,K9t),u=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.direction,J9t),m=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.up,j9t);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(){vXe(e,o,0,1,t,i)}});e._currentTweens.push(b)}var Q9t=new yn,RXe=new h,CXe=new h,VXe=new h,Qae=new h,EXe=new h,AXe=new h;function q9t(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=jae,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=ZXe(e,n));let s;e._morphToOrthographic?(s=Q9t,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=SXe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=FXe(r);ZU(e,a);let c;e._morphToOrthographic?c=function(){Jae(e,t,r,a)}:c=function(){LXe(e,t,r,function(){Jae(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Qae),complete:function(){i._mode=se.MORPHING,c()}})):c()}function Vh(e,t,n,i){return h.lerp(e,t,n,i)}function GXe(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 $9t=new h,ekt=new h,tkt=new h,Kae=new h,nkt=new h,ikt=new h,okt=new bs,rkt=new gn,skt=new h,akt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function ckt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,$9t),r=h.clone(i.direction,ekt),s=h.clone(i.up,tkt),a=h.negate(h.UNIT_Z,nkt),c=h.clone(h.UNIT_Y,ikt),d=Kae;if(t>0)h.clone(h.ZERO,Kae),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,Kae);let _=rkt;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,skt);l(Z)&&(P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,Z,d),d.z+=h.distance(o,d))}}let u=okt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=akt;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=IXe(m);ZU(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(){GXe(e,t,m,f,p)}});e._currentTweens.push(y)}var _Xe=new pe,lkt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new bs},dkt={position:new h,direction:new h,up:new h,frustum:void 0},ukt=new h,mkt=new gn,hkt=new P,fkt=new h;function pkt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=lkt;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,_Xe),i.mapProjection.project(_Xe,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,fkt),f=_t.eastNorthUpToFixedFrame(b,n,hkt);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,ukt);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=dkt;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=IXe(c);ZU(e,d);function u(){GXe(e,t,r,s,d)}WXe(e,t,r,u)}function LXe(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 bkt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,Qae),a=h.clone(n.direction,EXe),c=h.clone(n.up,AXe);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,RXe),m=h.clone(r.direction,CXe),p=h.clone(r.up,VXe);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():LXe(e,0,n,d)}function WXe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,RXe),a=h.clone(r.direction,CXe),c=h.clone(r.up,VXe),d=h.clone(n.position2D,Qae),u=h.clone(n.direction2D,EXe),m=h.clone(n.up2D,AXe);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(){vXe(e,o,1,0,t,i)}});e._currentTweens.push(b)}function vXe(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 FXe(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),xJ(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 IXe(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),xJ(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 gkt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),xJ(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 RU=IR;var ZYo=x(T(),1);var jNo=x(T(),1);function TJ(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(TJ.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}}});TJ.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 TJ(this);let t=e.duration/wn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/wn.SECONDS_PER_MILLISECOND,o=e.easingFunction??vs.LINEAR_NONE,r=e.startObject,s=new JLe(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 TJ(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/wn.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 PR=up;function VU(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 f9(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 PR,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 ykt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function xkt(e){return k.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var Tkt=.4;function _kt(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<Tkt){let b=ykt(p,i),f=e.getLastMovement(t,n);if(!l(f)||xkt(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 Skt(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 gd(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),Skt(e,r)):o<1&&_kt(s,u,m,o,i,e,r))}}var _J=new gn,Zkt=new h,Rkt=new k,Ckt=new h,Vkt=new k,Ekt=new h,Akt=new h,Gkt=new h,Lkt=new h,HXe=new h,Wkt=new h,vkt=new h,Fkt=new h,Ikt=new h,Pkt=new h,Xkt=new h,Nkt=new h,Ykt=new h,Mkt=new h,wkt=new h,XR=new h,XXe=new h,NXe=new h,qae={orientation:new Cc};function sce(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=qae.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,_J).origin,A=h.fromElements(A.y,A.z,A.x)):l(e._globe)&&(A=by(e,t,Zkt)),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,Ckt);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,_J).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,HXe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,F))<.6)L=!0;else{let I=y.canvas,N=Vkt;N.x=I.clientWidth/2,N.y=I.clientHeight/2;let g=by(e,N,Ekt);if(!l(g))L=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,F)>=-.5)L=!0;else{let V=vkt;h.clone(_.position,V);let G=e._zoomWorldPosition,v=Wkt;if(v=h.normalize(G,v),h.dot(v,F)<0)return;let X=wkt,Y=Pkt;h.clone(_.direction,Y),h.add(V,h.multiplyByScalar(Y,1e3,XR),X);let D=Xkt,M=Nkt;h.subtract(G,V,D),h.normalize(D,M);let O=h.dot(F,M);if(O>=0){e._zoomMouseStart.x=-1;return}let w=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(w),-1,1)),ee=Math.asin(W.clamp(te/K*Math.sin(w),-1,1)),le=$-ee+w,_e=Fkt;h.normalize(V,_e);let he=Ikt;he=h.cross(M,_e,he),he=h.normalize(he,he),h.normalize(h.cross(_e,he,XR),Y),h.multiplyByScalar(h.normalize(X,XR),h.magnitude(X)-f,X),h.normalize(V,V),h.multiplyByScalar(V,te,V);let Ze=Ykt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,XXe),h.multiplyByScalar(Y,Math.sin(le),NXe),XR),te,Ze),h.add(V,Ze,V),h.normalize(X,_e),h.normalize(h.cross(_e,he,XR),Y);let ye=Mkt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,XXe),h.multiplyByScalar(Y,Math.sin(le),NXe),XR),h.magnitude(X),ye),h.add(X,ye,X),h.clone(V,_.position),h.normalize(h.subtract(X,V,XR),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(qae);return}else{let V=h.normalize(g,Akt),G=h.normalize(e._zoomWorldPosition,Gkt),v=h.dot(G,V);if(v>0&&v<1){let X=W.acosClamped(v),Y=h.cross(G,V,Lkt),D=Math.abs(X)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,M=f/D;_.rotate(Y,X*M)}}}}e._rotatingZoom=!L}if(!R&&L||C){let F,I=fo.worldToWindowCoordinates(y,e._zoomWorldPosition,Rkt);S!==se.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(I)?F=_.getPickRay(I,_J):F=_.getPickRay(t,_J);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(qae)}var kkt=new gn,Ukt=new gn,Dkt=new h;function Okt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,kkt).origin,s=o.getPickRay(n.endPosition,Ukt).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,Dkt),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;sce(e,t,n,e.zoomFactor,o.getMagnitude())}var Bkt=new k,zkt=new k;function MXe(e,t,n){if(l(n.angleAndHeight)){Hkt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=Bkt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=k.normalize(c,c);let d=zkt;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 Hkt(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 Kkt(e){let t=e._scene.mapMode2D===pd.ROTATE;P.equals(P.IDENTITY,e._scene.camera.transform)?(gd(e,e.enableTranslate,e.translateEventTypes,Okt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),gd(e,e.enableZoom,e.zoomEventTypes,YXe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&gd(e,e.enableRotate,e.tiltEventTypes,MXe,e.inertiaSpin,"_lastInertiaTiltMovement")):(gd(e,e.enableZoom,e.zoomEventTypes,YXe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&gd(e,e.enableRotate,e.translateEventTypes,MXe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var KXe=new gn,Jkt=new h,jkt=new h;function by(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Jkt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,KXe),d=o.pickWorldCoordinates(c,i,a,jkt),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 Qkt=new pe;function AJ(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,Qkt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var qkt=new h;function JXe(e,t){let n=t.origin,i=t.direction,o=AJ(e),r=h.normalize(n,qkt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function jXe(e,t,n,i){let o=h.distance(t.origin,n),r=AJ(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 QXe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=AJ(e))):o=AJ(e),gn.getPoint(t,o,i)}var $kt=new k;function qXe(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,$kt),o=e._strafeEndMousePosition;k.add(o,i,o),t.endPosition=o,ace(e,t,e._strafeStartPosition),t.endPosition=n}var wXe=new gn,eUt=new gn,$ae=new h,tUt=new h,nUt=new h,iUt=new h,oUt=new cn(h.UNIT_X,0),rUt=new k,sUt=new k;function aUt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){fm(e,t,n);return}if(e._strafing){qXe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=k.clone(n.startPosition,rUt),a=k.clone(n.endPosition,sUt),c=o.getPickRay(s,wXe),d=h.clone(h.ZERO,iUt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=by(e,s,$ae),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let R=m;r&&(R=QXe(e,c,m,$ae)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),h.clone(R,e._strafeStartPosition),e._strafing=!0,ace(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,oUt);c=o.getPickRay(s,wXe);let b=xi.rayPlane(c,p,$ae),f=o.getPickRay(a,eUt),y=xi.rayPlane(f,p,tUt);if(!l(b)||!l(y)){e._looking=!0,fm(e,t,n),k.clone(t,e._translateMousePosition);return}let _=h.subtract(b,y,nUt),S=_.x;_.x=_.y,_.y=_.z,_.z=S;let Z=h.magnitude(_);Z>W.EPSILON6&&(h.normalize(_,_),o.move(_,Z))}var $Xe=new k,RJ=new gn,CJ=new h,cUt=new h,eNe=new P,lUt=new P,dUt=new h,uUt=new cn(h.UNIT_X,0),ece=new h,ice=new pe,tNe=new P,mUt=new Ne,hUt=new q,VJ=new h;function fUt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){fm(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,pUt(e,t,n)):bUt(e,t,n)}function pUt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=$Xe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,RJ),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,fm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let b=h.multiplyByScalar(u,m,CJ);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,ice);y.cartographicToCartesian(_,b);let S=_t.eastNorthUpToFixedFrame(b,y,eNe),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,tNe);o._setTransform(S),hm(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 bUt(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,CJ);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=by(e,t,CJ)),!l(s)){a=o.getPickRay(t,RJ);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,fm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(V,G,CJ),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,RJ)),jXe(e,a,s,s)),k.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=$Xe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,RJ);let m=h.clone(h.ZERO,dUt);m.x=s.x;let p=cn.fromPointNormal(m,c,uUt),b=xi.rayPlane(a,p,cUt),f=o._projection,y=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,ice);y.cartographicToCartesian(_,s);let S=_t.eastNorthUpToFixedFrame(s,y,eNe),Z;l(b)?(h.fromElements(b.y,b.z,b.x,b),_=f.unproject(b,ice),y.cartographicToCartesian(_,b),Z=_t.eastNorthUpToFixedFrame(b,y,lUt)):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,tNe);o._setTransform(S);let L=h.cross(h.UNIT_Z,h.normalize(o.position,ece),ece),F=h.dot(o.right,L);if(hm(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,hm(e,t,n,E,!0,!1),o.constrainedAxis=V}else hm(e,t,n,E,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,VJ);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,ece);if(e.enableCollisionDetection&&dce(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,mUt),X=q.fromQuaternion(v,hUt);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 nNe=new k,iNe=new gn,oNe=new h;function gUt(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=nNe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,iNe),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=by(e,a,oNe));let b;if(l(p)&&(b=h.distance(d,p)),s){let f=JXe(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)}sce(e,t,n,e.zoomFactor,b)}function yUt(e){let n=e._scene.camera;if(!P.equals(P.IDENTITY,n.transform))gd(e,e.enableRotate,e.rotateEventTypes,hm,e.inertiaSpin,"_lastInertiaSpinMovement"),gd(e,e.enableZoom,e.zoomEventTypes,sNe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),gd(e,e.enableTilt,e.tiltEventTypes,fUt,e.inertiaSpin,"_lastInertiaTiltMovement"),gd(e,e.enableTranslate,e.translateEventTypes,aUt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),gd(e,e.enableZoom,e.zoomEventTypes,gUt,e.inertiaZoom,"_lastInertiaZoomMovement"),gd(e,e.enableLook,e.lookEventTypes,fm),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var xUt=new gn,TUt=new cn(h.UNIT_X,0),_Ut=new h,SUt=new h;function ace(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,xUt),s=h.clone(o.direction,SUt);i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,TUt),c=xi.rayPlane(r,a,_Ut);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 kXe=new h,rNe=new pe,oce=new h,rce=new ne,ZUt=new h,RUt=new h,CUt=new h;function VUt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!P.equals(o.transform,P.IDENTITY)){hm(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,ZUt);if(k.equals(t,e._rotateMousePosition)){if(e._looking)fm(e,t,n,d);else if(e._rotating)hm(e,t,n);else if(e._strafing)qXe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=oce,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,rce),nce(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,rNe).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=by(e,n.startPosition,CUt);if(l(p)){let b,f=o.getPickRay(n.startPosition,KXe);if(r)b=!0,QXe(e,f,p,p);else{let y=s.geodeticSurfaceNormal(p,RUt);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,ace(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=oce,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,rce),nce(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,fm(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,kXe))?(nce(e,t,n,e._ellipsoid),h.clone(kXe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,hm(e,t,n)):(e._looking=!0,fm(e,t,n,d));k.clone(t,e._rotateMousePosition)}function hm(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 tce=ce.clone(ce.UNIT_W),UXe=ce.clone(ce.UNIT_W),SJ=new h,vA=new h,ZJ=new h,DXe=new h,EUt=new k,AUt=new k,GUt=new k,LUt=new k,WUt=new gn;function nce(e,t,n,i){let o=e._scene,r=o.camera,s=k.clone(n.startPosition,EUt),a=k.clone(n.endPosition,AUt),c=i.cartesianToCartographic(r.positionWC,rNe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,tce),!l(e._globe)&&!k.equalsEpsilon(s,e._panLastMousePosition)&&(d=by(e,s,tce)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,vA),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),vA),b=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,b,o.pixelRatio,LUt),y=k.subtract(a,s,GUt),_=h.multiplyByScalar(r.rightWC,y.x*f.x,vA),S=h.normalize(r.positionWC,HXe),Z=r.getPickRay(a,WUt).direction,R=h.subtract(Z,h.projectVector(Z,r.rightWC,ZJ),ZJ),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,ZJ);A=Math.abs(h.dot(r.upWC,S));let I=h.multiplyByScalar(r.upWC,-y.y*(1-A)*f.y,DXe);u=h.add(d,_,UXe),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,tce),u=r.pickEllipsoid(a,i,UXe)),!l(d)||!l(u)){e._rotating=!0,hm(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,SJ);h.cross(p,m,p),h.normalize(p,p);let b=h.cross(m,p,vA),f=h.magnitude(d),y=h.dot(m,d),_=Math.acos(y/f),S=h.multiplyByScalar(m,y,ZJ);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,DXe);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,SJ);let N=h.cross(m,I,SJ),g=h.dot(N,h.subtract(d,m,vA)),V=h.dot(N,h.subtract(u,m,vA)),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,SJ);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let b=Math.acos(m);r.rotate(p,b)}}}var vUt=new h,FUt=new pe,OXe=0;function sNe(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=nNe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,iNe),m,p=o.cartesianToCartographic(s.position,FUt).height,b=Math.abs(OXe)<e.minimumPickingTerrainDistanceWithInertia;(i?b:p<e._minimumPickingTerrainHeight)&&(m=by(e,d,oNe));let y;if(l(m)&&(y=h.distance(u.origin,m)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(OXe=y),c){let S=JXe(e,u,p);l(y)?y=Math.min(y,S):y=S}l(y)||(y=p);let _=h.normalize(s.position,vUt);sce(e,t,n,e.zoomFactor,y,h.dot(_,s.direction))}var aNe=new k,EJ=new gn,CU=new h,IUt=new h,cNe=new P,PUt=new P,lNe=new P,XUt=new Ne,NUt=new q,cce=new pe,lce=new h;function YUt(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,lce);fm(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,cce);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,wUt(e,t,n)):kUt(e,t,n)}var MUt=new pe;function wUt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,MUt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=aNe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,EJ),m,p=xi.rayEllipsoid(u,i);if(l(p))m=gn.getPoint(u,p.start,CU);else if(a>e._minimumTrackBallHeight){let Z=xi.grazingAltitudeLocation(u,i);if(!l(Z))return;let R=i.cartesianToCartographic(Z,cce);R.height=0,m=i.cartographicToCartesian(R,CU)}else{e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,lce);fm(e,t,n,Z),k.clone(t,e._tiltCenterMousePosition);return}let b=_t.eastNorthUpToFixedFrame(m,i,cNe),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,lNe);r._setTransform(b),hm(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 kUt(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,CU);else{if(a=by(e,t,CU),!l(a)){if(c=r.getPickRay(t,EJ),d=xi.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,cce).height<=e._minimumTrackBallHeight){e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,lce);fm(e,t,n,V),k.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,d.start,CU)}s&&(l(c)||(c=r.getPickRay(t,EJ)),jXe(e,c,a,a)),k.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=aNe;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,EJ);let p=h.magnitude(a),b=h.fromElements(p,p,p,oce),f=ne.fromCartesian3(b,rce);if(d=xi.rayEllipsoid(c,f),!l(d))return;let y=h.magnitude(c.origin)>p?d.start:d.stop,_=gn.getPoint(c,y,IUt),S=_t.eastNorthUpToFixedFrame(a,i,cNe),Z=_t.eastNorthUpToFixedFrame(_,f,PUt),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,lNe);r._setTransform(Z);let L=h.cross(_,r.positionWC,VJ);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,hm(e,t,n,E,!0,!1),r.constrainedAxis=V}else hm(e,t,n,E,!0,!1);if(r._setTransform(S),hm(e,t,n,E,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,VJ);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,VJ);if(e.enableCollisionDetection&&dce(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,XUt),X=q.fromQuaternion(v,NUt);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 UUt=new k,DUt=new k,BXe=new gn,zXe=new gn,OUt=new h,BUt=new h;function fm(e,t,n,i){let r=e._scene.camera,s=UUt;s.x=n.startPosition.x,s.y=0;let a=DUt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,BXe),d=r.getPickRay(a,zXe),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,BXe),d=r.getPickRay(a,zXe),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,OUt),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,BUt);r.look(C,u)}else(S&&u<0||Z&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function zUt(e){gd(e,e.enableRotate,e.rotateEventTypes,VUt,e.inertiaSpin,"_lastInertiaSpinMovement"),gd(e,e.enableZoom,e.zoomEventTypes,sNe,e.inertiaZoom,"_lastInertiaZoomMovement"),gd(e,e.enableTilt,e.tiltEventTypes,YUt,e.inertiaSpin,"_lastInertiaTiltMovement"),gd(e,e.enableLook,e.lookEventTypes,fm)}var HUt=new P,KUt=new pe;function dce(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,HUt),c=h.magnitude(o.position),o._setTransform(P.IDENTITY));let d=KUt;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)))}VU.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 JUt=new h,jUt=new h;VU.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,JUt),c=h.clone(t.directionWC,jUt);if(i===se.SCENE2D?Kkt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,yUt(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,zUt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);dce(this,d)}this._aggregator.reset()};VU.prototype.isDestroyed=function(){return!1};VU.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var EU=VU;var UYo=x(T(),1);var vYo=x(T(),1);function AU(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 QUt(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}AU.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};AU.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 QUt(i,o,t,n)};AU.prototype.isDestroyed=function(){return!1};AU.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var GU=AU;var LU={},qUt=new nt(0,0,3,3),$Ut=new k,e5t=new k,t5t=new gn,n5t=new h,i5t=3,o5t=.1,dNe=9;function uce(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function uNe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&uce(s)<=i5t&&(t=Math.min(t,s.depth));let n=t*(1+o5t),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)=>uce(a)<uce(s)?a:s)}function mNe(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 mce(e,t,n){let i=$Ut;i.x=t.x+n.x,i.y=t.y+n.y;let o=e.camera.getPickRay(i,t5t);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,n5t);return h.add(o.origin,a,new h)}LU.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 GU(r));let a=s.snapFramebuffer,c=qUt;Jk(e,t,c,i,o,{framebuffer:a,snap:!0});let d=a.end(c);if(jk(e),d.length===0)return;let u=uNe(d);if(!l(u))return;let m=mce(e,t,u);if(!l(m))return;let p=m;if(u.isEdge){let b=e5t;b.x=t.x+u.x,b.y=t.y+u.y,Jk(e,b,c,dNe,dNe,{framebuffer:a,snap:!0});let f=a.end(c);jk(e);let y=mNe(f,u.object);p=l(y)?mce(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)}};LU._selectBestHit=uNe;LU._nearestSurfaceHit=mNe;LU._snapHitToWorld=mce;var WU=LU;var uMo=x(T(),1);var OYo=x(T(),1),vU=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -12489,7 +12490,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 Jdo=x(T(),1),nk=`uniform sampler2D colorTexture; +`;var zYo=x(T(),1),FU=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -12510,14 +12511,14 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function ty(){this._sceneFramebuffer=new OZ;let e=.125,t=new Array(6);t[0]=new Uo({fragmentShader:qd,textureScale:e,forcePowerOfTwo:!0,sampleMode:om.LINEAR});let n=t[1]=new Uo({fragmentShader:nk,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:qd,sampleMode:om.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new Uo({fragmentShader:tk,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new ru({stages:t});let o=new JZ(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}ty.prototype.get=function(e){return this._stages.get(e)};ty.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 uIt=new ce,A2e=new k,mIt=new k,G2e=new P;function hIt(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,G2e),d=P.multiplyByPoint(r,o,uIt),u=_t.pointToGLWindowCoordinates(s,c,o,A2e);d.x+=W.SOLAR_RADIUS;let m=_t.pointToGLWindowCoordinates(a,c,d,d),p=k.magnitude(k.subtract(m,u,m))*30*2,b=mIt;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,G2e),u=_t.pointToGLWindowCoordinates(s,c,o,A2e),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)}ty.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};ty.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),hIt(this,t,n),o};ty.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)};ty.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(qd,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};ty.prototype.isDestroyed=function(){return!1};ty.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var ik=ty;var Tuo=x(T(),1);function iR(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new nn}iR.fromKeyframeNode=function(e,t,n,i){let o=new iR(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=fIt(e,s,n),o._orientedBoundingBox=bIt(e,r,n,o._orientedBoundingBox),o};function fIt(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 L2e=new h,pIt=new h;function bIt(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,L2e),m=h.divideComponents(h.subtract(u,e._paddingBefore,L2e),e.dimensions,pIt);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 ok=iR;var Vmo=x(T(),1);var Juo=x(T(),1);var Luo=x(T(),1);function Th(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 nn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var gIt=new h;Th.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,gIt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Th.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 Th(b,f,y,_,this,e,this.dimensions))};Th.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Th.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 W2e={keyframe:0};function rk(e,t){return W2e.keyframe=e,Go(t,W2e,zo.searchComparator)}Th.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=yIt(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=v2e(n-t.level,_);S<a&&(a=S,r=b);let Z=y.keyframe-o,R=v2e(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 yIt(e,t){let n=rk(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function v2e(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Th.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Th.prototype.createKeyframeNode=function(e){let t=rk(e,this.keyframeNodes);if(t<0){t=~t;let n=new zo(this,e);this.keyframeNodes.splice(t,0,n)}};Th.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=rk(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=rk(n,this.renderableKeyframeNodes);if(o<0)throw new ge("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Th.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=rk(e.keyframe,i);if(o>=0)throw new ge("Keyframe already renderable");o=~o,i.splice(o,0,e)};Th.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 sk=Th;function bT(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 Mw(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 sk(0,0,0,0,void 0,m,r),this._priorityQueue=new ug({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,use(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 Ot({minificationFilter:Ht.NEAREST,magnificationFilter:qn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new k(1/f,1/_),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new k}bT.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function use(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,use(e,t,o-1,i+1),use(e,o+1,n,i+1)}bT.simultaneousRequestCountMaximum=50;bT.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 Ot({minificationFilter:Ht.NEAREST,magnificationFilter:qn.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&&F2e(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let b=Zn();_It(this,e),SIt(this,e);let f=Zn();EIt(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;VIt(this,e,S,Z,R)}};bT.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};bT.prototype.isDestroyed=function(){return!1};bT.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 F2e(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];F2e(e,i)}}function xIt(e,t){if(e._simultaneousRequestCount>=bT.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 TIt(e){return e/(1+e)}function _It(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),I2e(e.rootNode,qs.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 SIt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(ZIt);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&&xIt(e,u),u.state===zo.LoadState.PROCESSING)){let{content:m}=u;if(m.update(e._primitive,t),!m.ready)continue;if(!RIt(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 ZIt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function RIt(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 I2e(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===qs.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=TIt(R),A=!1;for(let L=0;L<C.length;L++){let F=C[L];F.priority=10*E+CIt(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];I2e(F,t,n,i)}}function CIt(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 VIt(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 VK={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function EIt(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]=VK.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=AIt(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]=VK.LEAF<<16|c}else{let R=b.renderableKeyframeNodePrevious,E=b.level-R.spatialNode.level===0?VK.LEAF:VK.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),GIt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&LIt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function AIt(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 GIt(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 LIt(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 ak=bT;function N0(e){e=e??B.EMPTY_OBJECT;let{provider:t=N0.DefaultProvider,modelMatrix:n=P.IDENTITY,customShader:i=L1(t),clock:o,calculateStatistics:r=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new xf,this._calculateStatistics=r;let{shape:s,minBounds:a=uc.getMinBounds(s),maxBounds:c=uc.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=WIt(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??N0.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 pf,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let f=uc.getShapeConstructor(s);this._shape=new f,X2e(this),this._shapeVisible=N2e(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]}}vIt(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 WIt(e,t,n,i){let o=h.add(e,t,new h);if(h.add(o,n,o),i===Xp.Y_UP){let r=o.y;o.y=o.z,o.z=r}return o}function vIt(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(N0.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){xs.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=L1(this._provider);this._customShader=o??N0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var FIt=new ce,IIt=new ce,PIt=new P,XIt=new P,NIt=new h,YIt=new ce;N0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){BIt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=X2e(this),r=OIt(this,e);if((o||r)&&(this._shapeVisible=N2e(this),tPt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=nPt(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&&dPt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),iPt(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&&(y2(this,i),this._shaderDirty=!1);let m=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,b=sPt(p,m,IIt);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=kIt(this,n.cameraPositionLocal,YIt);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,MIt(this),wIt(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 MIt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function wIt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function kIt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,NIt),o=e._availableLevels,r=2**(o-1);return ce.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var UIt=new h,mse=new h,DIt=new pe;function OIt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function BIt(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 ak(e,n,o),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,ePt(e._traversal,i)}function X2e(e){return ck(e,"_modelMatrix","_modelMatrixOld")+ck(e,"_minBounds","_minBoundsOld")+ck(e,"_maxBounds","_maxBoundsOld")+ck(e,"_minClippingBounds","_minClippingBoundsOld")+ck(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function ck(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var zIt=new h,HIt=new h,KIt=new h,JIt=new h,jIt=new P,QIt=new P;function N2e(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,zIt),o=h.clone(e._maxBounds,HIt),r=h.clone(e._minClippingBounds,KIt),s=h.clone(e._maxClippingBounds,JIt),a=P.clone(e._modelMatrix,jIt);if(e.shape===uc.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,UIt);P.multiplyByScale(a,f,a),P.multiplyByTranslation(a,$It(e),a)}let c=e._provider,d=c.shapeTransform??P.IDENTITY,u=c.globalTransform??P.IDENTITY,m=P.multiplyTransformation(u,a,QIt);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 qIt=new h;function $It(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=P.IDENTITY,globalTransform:o=P.IDENTITY}=e._provider,r=P.getTranslation(i,mse),s=P.multiplyByPoint(e._modelMatrix,r,mse),a=P.multiplyByPoint(o,s,mse),d=ne.WGS84.cartesianToCartographic(a,DIt),u=0;l(d)&&(u=d.height);let m=_o.getHeight(u,t,n);return h.fromElements(0,0,(m-u)/t,qIt)}function ePt(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 tPt(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 nPt(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 iPt(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)}N0.prototype.isDestroyed=function(){return!1};N0.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 P2e=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)),oPt=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),rPt=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function sPt(e,t,n){let i=P.fromRotationTranslation(e.halfAxes,e.center,PIt),o=P.multiply(t,i,XIt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=rPt,m=P2e.length;for(d=0;d<m;d++)P.multiplyByVector(o,P2e[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=oPt[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,FIt),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 hse=3e7,aPt=new h(hse,0,0),cPt=new h(0,hse,0),lPt=new h(0,0,hse);function dPt(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:ro.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,aPt,U.RED,a),o(h.ZERO,cPt,U.LIME,a),o(h.ZERO,lPt,U.BLUE,a),i.update(t)}N0.DefaultCustomShader=new Pp({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function gy(){this._sceneFramebuffer=new ER;let e=.125,t=new Array(6);t[0]=new Uo({fragmentShader:uu,textureScale:e,forcePowerOfTwo:!0,sampleMode:um.LINEAR});let n=t[1]=new Uo({fragmentShader:FU,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:NT,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:NT,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:uu,sampleMode:um.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new Uo({fragmentShader:vU,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new hu({stages:t});let o=new vR(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}gy.prototype.get=function(e){return this._stages.get(e)};gy.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 r5t=new ce,hNe=new k,s5t=new k,fNe=new P;function a5t(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,fNe),d=P.multiplyByPoint(r,o,r5t),u=_t.pointToGLWindowCoordinates(s,c,o,hNe);d.x+=W.SOLAR_RADIUS;let m=_t.pointToGLWindowCoordinates(a,c,d,d),p=k.magnitude(k.subtract(m,u,m))*30*2,b=s5t;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,fNe),u=_t.pointToGLWindowCoordinates(s,c,o,hNe),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)}gy.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};gy.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),a5t(this,t,n),o};gy.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)};gy.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(uu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};gy.prototype.isDestroyed=function(){return!1};gy.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var IU=gy;var gMo=x(T(),1);function NR(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new tn}NR.fromKeyframeNode=function(e,t,n,i){let o=new NR(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=c5t(e,s,n),o._orientedBoundingBox=d5t(e,r,n,o._orientedBoundingBox),o};function c5t(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 pNe=new h,l5t=new h;function d5t(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,pNe),m=h.divideComponents(h.subtract(u,e._paddingBefore,pNe),e.dimensions,l5t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(NR.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()}}});NR.prototype.hasProperty=function(e){return l(this._metadata[e])};NR.prototype.getNames=function(){return Object.keys(this._metadata)};NR.prototype.getProperty=function(e){return this._metadata[e]};var PU=NR;var Zwo=x(T(),1);var zMo=x(T(),1);var EMo=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 u5t=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,u5t),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 bNe={keyframe:0};function XU(e,t){return bNe.keyframe=e,Eo(t,bNe,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=m5t(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=gNe(n-t.level,_);S<a&&(a=S,r=b);let Z=y.keyframe-o,R=gNe(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 m5t(e,t){let n=XU(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function gNe(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=XU(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=XU(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=XU(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=XU(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 NU=Eh;function YT(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 Lk(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 NU(0,0,0,0,void 0,m,r),this._priorityQueue=new $g({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,hce(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}YT.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function hce(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,hce(e,t,o-1,i+1),hce(e,o+1,n,i+1)}YT.simultaneousRequestCountMaximum=50;YT.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&&yNe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let b=Zn();p5t(this,e),b5t(this,e);let f=Zn();_5t(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;T5t(this,e,S,Z,R)}};YT.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};YT.prototype.isDestroyed=function(){return!1};YT.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 yNe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];yNe(e,i)}}function h5t(e,t){if(e._simultaneousRequestCount>=YT.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 f5t(e){return e/(1+e)}function p5t(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),xNe(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 b5t(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(g5t);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&&h5t(e,u),u.state===zo.LoadState.PROCESSING)){let{content:m}=u;if(m.update(e._primitive,t),!m.ready)continue;if(!y5t(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 g5t(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function y5t(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 xNe(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=f5t(R),A=!1;for(let L=0;L<C.length;L++){let F=C[L];F.priority=10*E+x5t(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];xNe(F,t,n,i)}}function x5t(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 T5t(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 GJ={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function _5t(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]=GJ.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=S5t(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]=GJ.LEAF<<16|c}else{let R=b.renderableKeyframeNodePrevious,E=b.level-R.spatialNode.level===0?GJ.LEAF:GJ.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),Z5t(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&R5t(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function S5t(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 Z5t(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 R5t(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 YU=YT;function z0(e){e=e??B.EMPTY_OBJECT;let{provider:t=z0.DefaultProvider,modelMatrix:n=P.IDENTITY,customShader:i=aA(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=C5t(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,_Ne(this),this._shapeVisible=SNe(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]}}V5t(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 C5t(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 V5t(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=aA(this._provider);this._customShader=o??z0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var E5t=new ce,A5t=new ce,G5t=new P,L5t=new P,W5t=new h,v5t=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){M5t(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=_Ne(this),r=Y5t(this,e);if((o||r)&&(this._shapeVisible=SNe(this),J5t(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=j5t(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&&oDt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Q5t(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&&(l9(this,i),this._shaderDirty=!1);let m=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,b=eDt(p,m,A5t);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=P5t(this,n.cameraPositionLocal,v5t);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,F5t(this),I5t(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 F5t(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function I5t(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function P5t(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,W5t),o=e._availableLevels,r=2**(o-1);return ce.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var X5t=new h,fce=new h,N5t=new pe;function Y5t(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function M5t(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 YU(e,n,o),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,K5t(e._traversal,i)}function _Ne(e){return MU(e,"_modelMatrix","_modelMatrixOld")+MU(e,"_minBounds","_minBoundsOld")+MU(e,"_maxBounds","_maxBoundsOld")+MU(e,"_minClippingBounds","_minClippingBoundsOld")+MU(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function MU(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var w5t=new h,k5t=new h,U5t=new h,D5t=new h,O5t=new P,B5t=new P;function SNe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,w5t),o=h.clone(e._maxBounds,k5t),r=h.clone(e._minClippingBounds,U5t),s=h.clone(e._maxClippingBounds,D5t),a=P.clone(e._modelMatrix,O5t);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,X5t);P.multiplyByScale(a,f,a),P.multiplyByTranslation(a,H5t(e),a)}let c=e._provider,d=c.shapeTransform??P.IDENTITY,u=c.globalTransform??P.IDENTITY,m=P.multiplyTransformation(u,a,B5t);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 z5t=new h;function H5t(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=P.IDENTITY,globalTransform:o=P.IDENTITY}=e._provider,r=P.getTranslation(i,fce),s=P.multiplyByPoint(e._modelMatrix,r,fce),a=P.multiplyByPoint(o,s,fce),d=ne.WGS84.cartesianToCartographic(a,N5t),u=0;l(d)&&(u=d.height);let m=_o.getHeight(u,t,n);return h.fromElements(0,0,(m-u)/t,z5t)}function K5t(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 J5t(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 j5t(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 Q5t(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(),ue(this)};var TNe=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)),q5t=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),$5t=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function eDt(e,t,n){let i=P.fromRotationTranslation(e.halfAxes,e.center,G5t),o=P.multiply(t,i,L5t),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=$5t,m=TNe.length;for(d=0;d<m;d++)P.multiplyByVector(o,TNe[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=q5t[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,E5t),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 pce=3e7,tDt=new h(pce,0,0),nDt=new h(0,pce,0),iDt=new h(0,0,pce);function oDt(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,tDt,U.RED,a),o(h.ZERO,nDt,U.LIME,a),o(h.ZERO,iDt,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 Y2e(){this.shape=uc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[St.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}Y2e.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new WS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};N0.DefaultProvider=new Y2e;var gT=N0;var AK=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??B.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof j9;if(o)this._context=e.contextOptions.createSceneContext(t);else{let d=$e(e.contextOptions);this._context=new $Z(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=$n(),this._jobScheduler=new Xw,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Wx(r,new ON(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new M9(r),this._ellipsoid=e.ellipsoid??ne.default,this._globe=void 0,this._globeTranslucencyState=new jY,this._primitives=new Rl({countReferences:o}),this._groundPrimitives=new Rl({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new tR,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new uY(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 z9(this),this._preUpdate=new Se,this._postUpdate=new Se,this._renderError=new Se,this._preRender=new Se,this._postRender=new Se,this._controllerHost=new O9,this._minimumDisableDepthTestDistance=0,this._debugInspector=new tY,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 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 a_,this.fog=new CY,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(Wo.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Wo(this),this.shadowMap=new Jg({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 RV,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new X9,this._brdfLutGenerator=new Vv,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new J9(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Bl.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(AK(this)),this._removeTaskProcessorListenerCallback=Qn.taskCompletedEvent.addEventListener(AK(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new nt(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new Wo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Wo(this),this.preloadFlightCullingVolume=void 0,this._picking=new m9(this),this._defaultView=new zZ(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 $g,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,O2e(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function uPt(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(AK(e))),n.push(t.terrainProviderChanged.addEventListener(AK(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.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 wt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return wt.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 sf.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,uPt(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 Wo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new mY(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,wt.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}}});_i.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 mPt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function M2e(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=Zf.createPickDerivedCommand(e,t,o,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=Zf.createSnapDerivedCommand(e,t,o,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Zf.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=Zf.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Zf.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Jg.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))}_i.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&&mPt(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=Jg.createCastDerivedCommand(Z,e,s,r,t.shadows)),(d||p)&&(t.logDepth=Zf.createLogDepthCommand(e,r,t.logDepth),M2e(this,t.logDepth.command,s)),(m||f)&&M2e(this,e,s)};var hPt=new eh({pass:cr.RENDER}),fse=new eh({pass:cr.PRELOAD}),pse=new eh({pass:cr.PRELOAD_FLIGHT}),fPt=new eh({pass:cr.REQUEST_RENDER_MODE_DEFER_CHECK}),w2e=new me,bse;function pPt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return w2e.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,bse=N9.fromBoundingSphere(w2e,e.camera.positionWC,bse),bse}_i.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 O2e(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}_i.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=pPt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof bn||this.camera.frustum instanceof gs),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),RV.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};_i.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 EK=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);EK=P.inverseTransformation(EK,EK);function bPt(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(EK,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=Fc.createGeometry(Fc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromRotationTranslation(s.halfAxes,a,new P)),t._debugVolume=new Pn({geometryInstances:new Mt({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=Zf.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 ud(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)&&bPt(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 k2e(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 B2e(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var gPt=new h;function U2e(e,t){let n=h.subtract(e,t,gPt),i=Math.max(0,h.magnitude(n));return i*i}function yPt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return U2e(o.center,n)-U2e(i.center,n)}function xPt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function TPt(e,t,n,i,o){s0(i,B2e,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function _Pt(e,t,n,i,o){s0(i,xPt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function SPt(e,t,n){e.context.uniformState.updatePass(Le.VOXELS);let i=n.commands[Le.VOXELS];i.length=n.indices[Le.VOXELS],s0(i,B2e,e.camera.positionWC);for(let o=0;o<i.length;++o)ud(i[o],e,t)}function ZPt(e,t,n){e.context.uniformState.updatePass(Le.GAUSSIAN_SPLATS);let i=n.commands[Le.GAUSSIAN_SPLATS];i.length=n.indices[Le.GAUSSIAN_SPLATS],s0(i,yPt,e.camera.positionWC);for(let o=0;o<i.length;++o)ud(i[o],e,t)}var RPt=new ji,CPt=new Ol,VPt=new bn,EPt=new gs;function APt(e){let{frustum:t}=e;return l(t.fov)?t.clone(RPt):l(t.infiniteProjectionMatrix)?t.clone(CPt):l(t.width)?t.clone(VPt):t.clone(EPt)}function GPt(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?TPt:_Pt}function LPt(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=GPt(e);o.uniformState.updatePass(Le.TRANSLUCENT);let u=n.commands[Le.TRANSLUCENT];u.length=n.indices[Le.TRANSLUCENT],d(e,ud,t,u,c)}function WPt(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,ud,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,ud,t,n)}function vPt(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)ud(o[s],e,t);t.framebuffer=i}function FPt(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)ud(a[m],e,t);t.framebuffer=d}}function IPt(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)ud(i[r],e,t)}function yse(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n),r.planarFillIdTexture=i.defaultTexture;let s=APt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||PPt(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)ud(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)k2e(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,ud,_,e,t)):N(v,Le.GLOBE),p&&y.executeCopyDepth(i,t),u||(C.translucent?(r.updatePass(Le.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(v,ud,_,e,t)):N(v,Le.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),m&&F.execute(i,t));let X;if(vPt(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 M=e._view.edgeFramebuffer.idTexture;l(M)?e.context.uniformState.edgeIdTexture=M: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(FPt(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),SPt(e,t,v),N(v,Le.OPAQUE),IPt(e,t,v),ZPt(e,t,v),G!==0&&e.mode!==se.SCENE2D&&(s.near=v.near,r.updateFrustum(s)),LPt(e,t,v),WPt(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,k2e,_,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 PPt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Le.ENVIRONMENT),l(i.skyBoxCommand)&&ud(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&ud(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)?ud(r[s],e,t):r.splice(s,1)}}function z2e(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 XPt(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 NPt(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 H2e(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;NPt(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];ud(_,e,m.passState)}}}}var YPt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){qPt(this,e,t),this._environmentState.useWebVR?MPt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===Bl.ROTATE?yT(!0,this,e):KPt(this,e)};function MPt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;J2e(e),n.createPotentiallyVisibleSet(e),z2e(e),r||H2e(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Wo.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,YPt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;h.add(a.position,m,i.position),i.frustum.xOffset=p,yse(e,t),s.x=s.width,h.subtract(a.position,m,i.position),i.frustum.xOffset=-p,yse(e,t),Wo.clone(a,i)}var wPt=new pe(Math.PI,W.PI_OVER_TWO),kPt=new h,UPt=new h,DPt=new P,OPt=new P,BPt=new h,zPt=new h,HPt=new nt;function KPt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=nt.clone(r,HPt);t.viewport=s;let a=wPt,c=kPt;e.mapProjection.project(a,c);let u=h.clone(i.position,UPt),m=P.clone(i.transform,OPt),p=i.frustum.clone();i._setTransform(P.IDENTITY);let b=P.computeViewportTransformation(s,0,1,DPt),f=i.frustum.projectionMatrix,y=i.positionWC.y,_=h.fromElements(W.sign(y)*c.x-y,0,-i.positionWC.x,BPt),S=_t.pointToGLWindowCoordinates(f,b,_,zPt);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),J2e(t),i.createPotentiallyVisibleSet(t),e&&(z2e(t),o||H2e(t)),yse(t,n)}var D2e=new qs;function K2e(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 Rl){K2e(r,t,n);continue}r.show&&jb.isSupported(r)&&bs(r.heightReference)&&t.markForFrame(r,n,r.heightReference)}}function JPt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;K2e(e._primitives,n,i)}_i.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 bn||!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(ob.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=D2e.planes;for(let _=0;_<5;++_)b[_]=p.planes[_];p=D2e,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 sf(f)):!l(f)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),JPt(this,e)};function jPt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new a0({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 QPt(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 J2e(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,jPt(e),QPt(e),e._globe&&e._globe.render(t)}function qPt(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 ik: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)}_i.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 $Pt(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 eXt(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function j2e(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Rl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=j2e(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}_i.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=tXt(this,e,t);return this._heightQueryCache.set(i,r===void 0?null:r),r};function tXt(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=j2e(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 gse=new pe;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=b=>{pe.clone(e,gse);let f;l(b)&&(f=b.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(gse.height=f,t(gse))},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 nXt(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}_i.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=eXt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=nXt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function iXt(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 Hg({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 oXt(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 rXt(e){e.primitives.postPassesUpdate(e._frameState),Hc.update()}var sXt=new U;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=hPt;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,sXt),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 $g?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,XPt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function oR(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function cXt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.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,Wx.maximumFrameNumber,1);O2e(this,o,e),t.newFrame=!0}oR(this,oXt),this.primitives.show&&(oR(this,cXt),oR(this,lXt),oR(this,dXt),i||oR(this,uXt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),oR(this,aXt)),iXt(this,i),oR(this,rXt),$Pt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(wt.minimumAliasedLineWidth,Math.min(e,wt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return ek.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof gT))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 ok.fromKeyframeNode(o,s,c,a)};_i.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=GY(s,t,n,i);if(!l(a))return;let c=LY(r,n,i);if(!l(c))return;let d=new t9(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function lXt(e){let t=e._frameState;fse.camera=t.camera,fse.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,fse)}function dXt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;pse.camera=e.preloadFlightCamera,pse.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,pse)}function uXt(e){e.primitives.updateForPass(e._frameState,fPt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return ho.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function mXt(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()})}_i.prototype.setTerrain=function(e){return mXt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.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 lk=_i;var afo=x(T(),1);var ny={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};ny.validate=function(e){return e===ny.COMPLETE||e===ny.BELOW_ELLIPSOID_HORIZON||e===ny.ABOVE_ELLIPSOID_HORIZON};ny.toString=function(e){switch(e){case ny.COMPLETE:return"COMPLETE";case ny.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case ny.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new ge("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var _E=ny;var Yfo=x(T(),1);var lfo=x(T(),1),SE=`float interpolateByDistance(vec4 nearFarScalar, float distance) +}`});function ZNe(){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}ZNe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new sR({metadata:[new Float32Array(1)]});return Promise.resolve(n)};z0.DefaultProvider=new ZNe;var MT=z0;var WJ=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??B.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof cw;if(o)this._context=e.contextOptions.createSceneContext(t);else{let d=$e(e.contextOptions);this._context=new UZ(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 Ak,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Ix(r,new A9(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new tw(r),this._ellipsoid=e.ellipsoid??ne.default,this._globe=void 0,this._globeTranslucencyState=new yk,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=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new PR,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new D9(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new mi({color:new U,stencil:0,owner:this}),this._depthClearCommand=new mi({depth:1,owner:this}),this._stencilClearCommand=new mi({stencil:0}),this._classificationStencilClearCommand=new mi({stencil:0,renderState:ze.fromCache({stencilMask:Jt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new RU(this),this._preUpdate=new Se,this._postUpdate=new Se,this._renderError=new Se,this._preRender=new Se,this._postRender=new Se,this._controllerHost=new SU,this._minimumDisableDepthTestDistance=0,this._debugInspector=new P9,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 oS,this.fog=new j9,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 my({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 VA,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new _U,this._brdfLutGenerator=new Uw,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new EU(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??pd.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(WJ(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(WJ(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 Qk(this),this._defaultView=new GR(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 Jg,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,GNe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function rDt(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(WJ(e))),n.push(t.terrainProviderChanged.addEventListener(WJ(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.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,rDt(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 O9(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}}});_i.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 sDt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function RNe(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=my.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))}_i.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&&sDt(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=my.createCastDerivedCommand(Z,e,s,r,t.shadows)),(d||p)&&(t.logDepth=rp.createLogDepthCommand(e,r,t.logDepth),RNe(this,t.logDepth.command,s)),(m||f)&&RNe(this,e,s)};var aDt=new _h({pass:lr.RENDER}),bce=new _h({pass:lr.PRELOAD}),gce=new _h({pass:lr.PRELOAD_FLIGHT}),cDt=new _h({pass:lr.REQUEST_RENDER_MODE_DEFER_CHECK}),CNe=new me,yce;function lDt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return CNe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,yce=Fw.fromBoundingSphere(CNe,e.camera.positionWC,yce),yce}_i.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 GNe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}_i.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=lDt(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),VA.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};_i.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 LJ=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);LJ=P.inverseTransformation(LJ,LJ);function dDt(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(LJ,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 yd(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof mi){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&dDt(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 VNe(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 LNe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var uDt=new h;function ENe(e,t){let n=h.subtract(e,t,uDt),i=Math.max(0,h.magnitude(n));return i*i}function mDt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return ENe(o.center,n)-ENe(i.center,n)}function hDt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function fDt(e,t,n,i,o){v0(i,LNe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function pDt(e,t,n,i,o){v0(i,hDt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function bDt(e,t,n){e.context.uniformState.updatePass(Le.VOXELS);let i=n.commands[Le.VOXELS];i.length=n.indices[Le.VOXELS],v0(i,LNe,e.camera.positionWC);for(let o=0;o<i.length;++o)yd(i[o],e,t)}function gDt(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,mDt,e.camera.positionWC);for(let o=0;o<i.length;++o)yd(i[o],e,t)}var yDt=new qi,xDt=new fd,TDt=new yn,_Dt=new bs;function SDt(e){let{frustum:t}=e;return l(t.fov)?t.clone(yDt):l(t.infiniteProjectionMatrix)?t.clone(xDt):l(t.width)?t.clone(TDt):t.clone(_Dt)}function ZDt(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?fDt:pDt}function RDt(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=ZDt(e);o.uniformState.updatePass(Le.TRANSLUCENT);let u=n.commands[Le.TRANSLUCENT];u.length=n.indices[Le.TRANSLUCENT],d(e,yd,t,u,c)}function CDt(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,yd,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,yd,t,n)}function VDt(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)yd(o[s],e,t);t.framebuffer=i}function EDt(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)yd(a[m],e,t);t.framebuffer=d}}function ADt(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)yd(i[r],e,t)}function Tce(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n),r.planarFillIdTexture=i.defaultTexture;let s=SDt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||GDt(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)yd(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)VNe(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,yd,_,e,t)):N(v,Le.GLOBE),p&&y.executeCopyDepth(i,t),u||(C.translucent?(r.updatePass(Le.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(v,yd,_,e,t)):N(v,Le.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),m&&F.execute(i,t));let X;if(VDt(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 M=e._view.edgeFramebuffer.idTexture;l(M)?e.context.uniformState.edgeIdTexture=M: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(EDt(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),bDt(e,t,v),N(v,Le.OPAQUE),ADt(e,t,v),gDt(e,t,v),G!==0&&e.mode!==se.SCENE2D&&(s.near=v.near,r.updateFrustum(s)),RDt(e,t,v),CDt(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,VNe,_,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 GDt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Le.ENVIRONMENT),l(i.skyBoxCommand)&&yd(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&yd(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)?yd(r[s],e,t):r.splice(s,1)}}function WNe(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 LDt(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 WDt(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 vNe(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;WDt(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];yd(_,e,m.passState)}}}}var vDt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){zDt(this,e,t),this._environmentState.useWebVR?FDt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===pd.ROTATE?wT(!0,this,e):UDt(this,e)};function FDt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;INe(e),n.createPotentiallyVisibleSet(e),WNe(e),r||vNe(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,vDt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;h.add(a.position,m,i.position),i.frustum.xOffset=p,Tce(e,t),s.x=s.width,h.subtract(a.position,m,i.position),i.frustum.xOffset=-p,Tce(e,t),Io.clone(a,i)}var IDt=new pe(Math.PI,W.PI_OVER_TWO),PDt=new h,XDt=new h,NDt=new P,YDt=new P,MDt=new h,wDt=new h,kDt=new nt;function UDt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=nt.clone(r,kDt);t.viewport=s;let a=IDt,c=PDt;e.mapProjection.project(a,c);let u=h.clone(i.position,XDt),m=P.clone(i.transform,YDt),p=i.frustum.clone();i._setTransform(P.IDENTITY);let b=P.computeViewportTransformation(s,0,1,NDt),f=i.frustum.projectionMatrix,y=i.positionWC.y,_=h.fromElements(W.sign(y)*c.x-y,0,-i.positionWC.x,MDt),S=_t.pointToGLWindowCoordinates(f,b,_,wDt);S.x=Math.floor(S.x);let Z=s.x,R=s.width;if(y===0||S.x<=Z||S.x>=Z+R)wT(!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),wT(!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),wT(!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),wT(!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),wT(!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),wT(!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),wT(!1,e,t)}i._setTransform(m),h.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function wT(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),INe(t),i.createPotentiallyVisibleSet(t),e&&(WNe(t),o||vNe(t)),Tce(t,n)}var ANe=new $s;function FNe(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){FNe(r,t,n);continue}r.show&&sg.isSupported(r)&&fs(r.heightReference)&&t.markForFrame(r,n,r.heightReference)}}function DDt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;FNe(e._primitives,n,i)}_i.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(Fb.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=ANe.planes;for(let _=0;_<5;++_)b[_]=p.planes[_];p=ANe,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),DDt(this,e)};function ODt(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 BDt(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 INe(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,ODt(e),BDt(e),e._globe&&e._globe.render(t)}function zDt(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 IU: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)}_i.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 HDt(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 KDt(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}_i.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=JDt(this,e,t);return this._heightQueryCache.set(i,r===void 0?null:r),r};function JDt(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 xce=new pe;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=b=>{pe.clone(e,xce);let f;l(b)&&(f=b.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(xce.height=f,t(xce))},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 jDt(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}_i.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=KDt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=jDt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function QDt(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 dy({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 qDt(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 $Dt(e){e.primitives.postPassesUpdate(e._frameState),Hc.update()}var eOt=new U;function tOt(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=aDt;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,eOt),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 Jg?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,LDt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function YR(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function nOt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.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,Ix.maximumFrameNumber,1);GNe(this,o,e),t.newFrame=!0}YR(this,qDt),this.primitives.show&&(YR(this,nOt),YR(this,iOt),YR(this,oOt),i||YR(this,rOt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),YR(this,tOt)),QDt(this,i),YR(this,$Dt),HDt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return WU.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof MT))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 PU.fromKeyframeNode(o,s,c,a)};_i.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=ek(s,t,n,i);if(!l(a))return;let c=tk(r,n,i);if(!l(c))return;let d=new kk(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function iOt(e){let t=e._frameState;bce.camera=t.camera,bce.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,bce)}function oOt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;gce.camera=e.preloadFlightCamera,gce.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,gce)}function rOt(e){e.primitives.updateForPass(e._frameState,cDt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return fo.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function sOt(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()})}_i.prototype.setTerrain=function(e){return sOt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.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 wU=_i;var vko=x(T(),1);var iko=x(T(),1),FA=`float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; @@ -12570,7 +12571,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 ufo=x(T(),1),dk=`in vec3 v_outerPositionWC; +`;var rko=x(T(),1),kU=`in vec3 v_outerPositionWC; uniform vec3 u_hsbShift; #ifndef PER_FRAGMENT_ATMOSPHERE in vec3 v_mieColor; @@ -12615,7 +12616,7 @@ color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } -`;var hfo=x(T(),1),uk=`in vec4 position; +`;var ako=x(T(),1),UU=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; @@ -12642,14 +12643,14 @@ v_outerPositionWC = positionWC.xyz; vec4 positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; } -`;function ZE(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(ZE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ZE.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var xse=new P;ZE.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,xse),o=P.multiplyTransformation(i,Di.Y_UP_TO_Z_UP,xse),r=P.multiply(this._scaleMatrix,o,xse);P.clone(r,this._modelMatrix);let s=e.context,a=hXt(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:Me.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:ki.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:[nf,SE,uk]}),f=new Je({defines:p,sources:[nf,SE,dk]});this._spSkyAtmosphere=tn.fromCache({context:s,vertexShaderSource:b,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function hXt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}ZE.prototype.isDestroyed=function(){return!1};ZE.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 mk=ZE;var Ofo=x(T(),1);function rR(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new MS({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(rR.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}}});rR.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)};rR.prototype.isDestroyed=function(){return!1};rR.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function RE(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}rR.createEarthSkyBox=function(){return new rR({sources:{positiveX:RE("px"),negativeX:RE("mx"),positiveY:RE("py"),negativeY:RE("my"),positiveZ:RE("pz"),negativeZ:RE("mz")}})};var hk=rR;var Kfo=x(T(),1);function Tse(e){e=e??1,this._radius=e??1}Object.defineProperties(Tse.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Tse.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 _se=Tse;var Qfo=x(T(),1);function fk(){}fk.prototype.evaluate=function(e,t){ge.throwInstantiationError()};fk.prototype.evaluateColor=function(e,t){ge.throwInstantiationError()};fk.prototype.getShaderFunction=function(e,t,n,i){ge.throwInstantiationError()};fk.prototype.getVariables=function(){ge.throwInstantiationError()};var Sse=fk;var vpo=x(T(),1);var $fo=x(T(),1),pk=`uniform sampler2D u_texture; +`;function IA(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(IA.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});IA.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var _ce=new P;IA.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,_ce),o=P.multiplyTransformation(i,Bi.Y_UP_TO_Z_UP,_ce),r=P.multiply(this._scaleMatrix,o,_ce);P.clone(r,this._modelMatrix);let s=e.context,a=aOt(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:Me.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,FA,UU]}),f=new Je({defines:p,sources:[rf,FA,kU]});this._spSkyAtmosphere=nn.fromCache({context:s,vertexShaderSource:b,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function aOt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}IA.prototype.isDestroyed=function(){return!1};IA.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 DU=IA;var Yko=x(T(),1);function MR(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new mR({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(MR.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}}});MR.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)};MR.prototype.isDestroyed=function(){return!1};MR.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function PA(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}MR.createEarthSkyBox=function(){return new MR({sources:{positiveX:PA("px"),negativeX:PA("mx"),positiveY:PA("py"),negativeY:PA("my"),positiveZ:PA("pz"),negativeZ:PA("mz")}})};var OU=MR;var Uko=x(T(),1);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=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 Zce=Sce;var Bko=x(T(),1);function BU(){}BU.prototype.evaluate=function(e,t){ge.throwInstantiationError()};BU.prototype.evaluateColor=function(e,t){ge.throwInstantiationError()};BU.prototype.getShaderFunction=function(e,t,n,i){ge.throwInstantiationError()};BU.prototype.getVariables=function(){ge.throwInstantiationError()};var Rce=BU;var VUo=x(T(),1);var Hko=x(T(),1),zU=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } -`;var tpo=x(T(),1),bk=`uniform float u_radiusTS; +`;var Jko=x(T(),1),HU=`uniform float u_radiusTS; in vec2 v_textureCoordinates; vec2 rotate(vec2 p, vec2 direction) { @@ -12681,7 +12682,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 ipo=x(T(),1),gk=`in vec2 direction; +`;var Qko=x(T(),1),KU=`in vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() @@ -12702,9 +12703,8 @@ halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); v_textureCoordinates = direction; } -`;function xk(){this.show=!0,this._drawCommand=new lt({primitiveType:Ie.TRIANGLES,boundingVolume:new me,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new me,this._boundingVolume2D=new me,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(xk.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var fXt=new k,pXt=new k,bXt=new ce,yk=new ce;xk.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 vu({fragmentShaderSource:bk,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=it.createVertexBuffer({context:o,typedArray:E,usage:Pe.STATIC_DRAW}),L=[{index:C.direction,vertexBuffer:A,componentsPerAttribute:2,normalize:!0,componentDatatype:J.UNSIGNED_BYTE}],F=it.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=tn.fromCache({context:o,vertexShaderSource:gk,fragmentShaderSource:pk,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?me.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&me.clone(m,a.boundingVolume);let p=ho.computeActualEllipsoidPosition(e,c,yk),b=h.magnitude(h.subtract(p,e.camera.position,yk)),f=o.uniformState.projection,y=bXt;y.x=0,y.y=0,y.z=-b,y.w=1;let _=P.multiplyByVector(f,y,yk),S=ho.clipToGLWindowCoordinates(t.viewport,_,fXt);y.x=W.SOLAR_RADIUS;let Z=P.multiplyByVector(f,y,yk),R=ho.clipToGLWindowCoordinates(t.viewport,Z,pXt);return this._size=k.magnitude(k.subtract(R,S,yk)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};xk.prototype.isDestroyed=function(){return!1};xk.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 Tk=xk;var D0o=x(T(),1);var F0o=x(T(),1);var G0o=x(T(),1);var qpo=x(T(),1);var Npo=x(T(),1);var GK={};GK.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};GK.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)};GK.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 Jf=GK;function xT(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=WK(e.westIndices,o,t),this._southIndices=WK(e.southIndices,r,t),this._eastIndices=WK(e.eastIndices,o,t),this._northIndices=WK(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(xT.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 LK=[];function WK(e,t,n){LK.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)LK[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(LK.sort(t),Oe.createTypedArray(n,LK)):e}var Q2e="createVerticesFromQuantizedTerrainMesh",gXt=new Qn(Q2e),yXt=new Qn(Q2e,Qd.maximumAsynchronousTasks);xT.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?yXt:gXt).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=Zr.clone(b.encoding);return p._mesh=new mc(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 xXt=new Qn("upsampleQuantizedTerrainMesh",Qd.maximumAsynchronousTasks);xT.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=xXt.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 xT({quantizedVertices:C,indices:E,encodedNormals:A,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:me.clone(R.boundingSphere),orientedBoundingBox:nn.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 Zse=32767,q2e=new h;xT.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Zse;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Zse,l(this._mesh)?ZXt(this,i,o):RXt(this,i,o)};function $2e(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 TXt=new k,_Xt=new k,SXt=new k;function ZXt(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,TXt),b=r.decodeTextureCoordinates(o,u,_Xt),f=r.decodeTextureCoordinates(o,m,SXt);if($2e(t,n,p.x,p.y,b.x,b.y,f.x,f.y)){let y=Jf.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,q2e);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 RXt(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($2e(t,n,p,y,b,_,f,S)){let Z=Jf.computeBarycentricCoordinates(t,n,p,y,b,_,f,S,q2e);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/Zse)}}}}xT.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};xT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var sR=xT;var o0o=x(T(),1);function EE(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var aR=new re;function CXt(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}EE.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)CXt(e,b,p,s)||s.push(new CE(r,void 0,0,b,p));r.tileXYToRectangle(t,n,e,aR);let a=aR.west,c=aR.north;r.tileXYToRectangle(i,o,e,aR);let d=aR.east,u=aR.south,m=new LXt(e,a,u,d,c);for(let p=0;p<s.length;++p){let b=s[p];Rse(b.extent,m)&&WXt(this._maximumLevel,b,m)}};EE.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(VE(i.extent,e)){t=i;break}}return l(t)?_k(void 0,t,e):-1};var VXt=[],EXt=[],AXt=new re,GXt=new re;EE.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=VXt;t.length=0,e.east<e.west?(t.push(re.fromRadians(-Math.PI,e.south,e.east,e.north,AXt)),t.push(re.fromRadians(e.west,e.south,Math.PI,e.north,GXt))):t.push(e);let n=EXt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)Sk(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 eFe=new pe;EE.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,aR);return re.center(i,eFe),this.computeMaximumLevelAtPosition(eFe)>=e};EE.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 CE(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(CE.prototype,{nw:{get:function(){return this._nw||(this._nw=new CE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new CE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new CE(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new CE(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function LXt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function Rse(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 WXt(e,t,n){for(;t.level<e;)if(vK(t.nw.extent,n))t=t.nw;else if(vK(t.ne.extent,n))t=t.ne;else if(vK(t.sw.extent,n))t=t.sw;else if(vK(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=Go(t.rectangles,n.level,vXt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function vXt(e,t){return e.level-t}function vK(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function VE(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function _k(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&VE(t._nw.extent,n),s=t._ne&&VE(t._ne.extent,n),a=t._sw&&VE(t._sw.extent,n),c=t._se&&VE(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,_k(t,t._nw,n))),s&&(i=Math.max(i,_k(t,t._ne,n))),a&&(i=Math.max(i,_k(t,t._sw,n))),c&&(i=Math.max(i,_k(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];VE(a,n)&&(i=a.level)}t=t.parent}return i}function Sk(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||Rse(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]=FXt(e[s.level],s)}Sk(e,t._nw,n),Sk(e,t._ne,n),Sk(e,t._sw,n),Sk(e,t._se,n)}function FXt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];Rse(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=EE;function IXt(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 nFe(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=[]}nFe.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 iFe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=er.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=er.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=er.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 eo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Lr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=er.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=er.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 IXt({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 Ese(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function PXt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=er.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Ese(e,n);throw new ae(i)}async function XXt(e,t,n){await iFe(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 Ese(e,t){try{let n=await e.layerJsonResource.fetchJson();return XXt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await iFe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):PXt(e,n,t)}}function Qf(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 Cse={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function tFe(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 NXt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Nc({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 YXt(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 me(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 M=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Oe.createTypedArrayFromArrayBuffer(L,t,a,M);a+=M*y;let w=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Oe.createTypedArrayFromArrayBuffer(L,t,a,w);a+=w*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===Cse.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,L*2);else if(he===Cse.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,Ze);else if(he===Cse.METADATA&&e._requestMetadata){let ye=S.getUint32(a,!0);if(ye>0){let Ae=Wr(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=nn.fromRectangle(le,R,C,e._tilingScheme.ellipsoid);return new sR({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})}Qf.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=Ase(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)})):oFe(this,e,t,n,r,i)};function oFe(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=tFe(void 0)):d=tFe(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)?NXt(e,f,i,t,n):YXt(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(Qf.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}}});Qf.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Qf.fromIonAssetId=async function(e,t){let n=await kr.fromAssetId(e);return Qf.fromUrl(n,t)};Qf.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 nFe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Ese(i);let o=new Qf(t);return i.build(o),o};Qf.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(Ase(this,e,t,n,i[r],r===0).result)return;return!1};Qf.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=Ase(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Vse(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 Ase(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=Vse(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=oFe(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=Vse(o,u.x,u.y,u.level)}return{result:!1}}Qf._getAvailabilityTile=Vse;var cR=Qf;function MXt(e){return e=e??B.EMPTY_OBJECT,cR.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Zk=MXt;var Y0o=x(T(),1);function wXt(e){return e=e??B.EMPTY_OBJECT,cR.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ne.WGS84})}var lR=wXt;function AE(e){this._ready=!1,this._provider=void 0,this._errorEvent=new Se,this._readyEvent=new Se,UXt(this,e)}Object.defineProperties(AE.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}}});AE.fromWorldTerrain=function(e){return new AE(lR(e))};AE.fromWorldBathymetry=function(e){return new AE(Zk(e))};function kXt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function UXt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){kXt(e._errorEvent,i)}}var Rk=AE;var z0o=x(T(),1);function GE(){}GE.prototype.boundingVolume=void 0;GE.prototype.boundingSphere=void 0;GE.prototype.distanceToCamera=function(e){ge.throwInstantiationError()};GE.prototype.intersectPlane=function(e){ge.throwInstantiationError()};GE.prototype.createDebugVolume=function(e){ge.throwInstantiationError()};var Gse=GE;var $0o=x(T(),1);function Ck(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new eo({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(Ck.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}}});Ck.prototype.getTileCredits=function(e,t,n){};Ck.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)};Ck.prototype.pickFeatures=function(e,t,n,i,o){};var Vk=Ck;var nbo=x(T(),1);function Lse(e){ge.throwInstantiationError()}Lse.prototype.isReady=ge.throwInstantiationError;Lse.prototype.shouldDiscardImage=ge.throwInstantiationError;var Wse=Lse;var obo=x(T(),1),rFe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(rFe);var vse=rFe;var Sbo=x(T(),1);function uR(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.shadows=e.shadows??Wn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Hp(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 Ib,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(uR.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(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function DXt(e){return`uniform vec4 czm_pickColor; -${e}`}function OXt(e){return function(t){return It(t,{czm_pickColor:function(){return e._pickId.color}})}}function BXt(){return"czm_pickColor"}uR.prototype.makeStyleDirty=function(){this._styleDirty=!0};uR.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var zXt=new Q;function Ise(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function dR(e,t){return e._intervals.indexOf(t.start)}function HXt(e,t){let n=e._intervals,i=e._clock,o=Ise(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,zXt),a=n.indexOf(s),c=dR(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function KXt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function JXt(e,t,n){let i=Ise(e),o=dR(e,t),r=dR(e,n);return i>=0?o>=r:o<=r}function aFe(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 jXt(e,t,n){let i=dR(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 f9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:DXt,uniformMapLoaded:OXt(e),pickIdLoaded:BXt})}).catch(aFe(e,c))}return r}function QXt(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 qXt(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(cFe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Zn()-t.timestamp)/1e3;QXt(e,a)}}t.touchedFrameNumber=i.frameNumber}var $Xt=new P;function eNt(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 tNt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var nNt=new Hp;function cFe(e,t,n,i){let o=e.shading??nNt,r=t.pointCloud,s=t.transform??P.IDENTITY;r.modelMatrix=P.multiplyTransformation(e.modelMatrix,s,$Xt),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=eNt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=tNt(e);try{r.update(i)}catch(a){aFe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Fse(e,t,n,i){let o=jXt(e,t,i);qXt(e,o,n,i)}function iNt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function lFe(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 oNt(e,t){let n=dR(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function sFe(e,t,n,i,o){return l(n)?n.ready?!0:(Fse(e,t,i,o),n.ready):!1}function rNt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=dR(e,n),m=dR(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],sFe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],sFe(e,s,a,i,o))return s;return t}function sNt(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 LE={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};uR.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)&&sNt(this,o,s),LE.timeSinceLoad=t,LE.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,b=KXt(this);if(!l(b))return;let f=!1,y=Ise(this),_=y===0;y!==this._clockMultiplier&&(f=!0,this._clockMultiplier=y),(!l(m)||_)&&(m=b),(!l(p)||f||JXt(this,b,p))&&(p=HXt(this,b)),m=rNt(this,m,b,LE,e);let S=oNt(this,m);l(S)||(Fse(this,m,LE,e),S=this._lastRenderedFrame),l(S)&&cFe(this,S,LE,e),l(p)&&Fse(this,p,LE,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&&lFe(this,iNt(e));let A=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&A>0&&c.update(e,u,a,this.boundingSphere)};uR.prototype.isDestroyed=function(){return!1};uR.prototype.destroy=function(){return lFe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var WE=uR;var Xbo=x(T(),1);var Rbo=x(T(),1),Ek=`in vec2 v_textureCoordinates; +`;function jU(){this.show=!0,this._drawCommand=new lt({primitiveType:Ie.TRIANGLES,boundingVolume:new me,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new me,this._boundingVolume2D=new me,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(jU.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var cOt=new k,lOt=new k,dOt=new ce,JU=new ce;jU.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:HU,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:KU,fragmentShaderSource:zU,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?me.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&me.clone(m,a.boundingVolume);let p=fo.computeActualEllipsoidPosition(e,c,JU),b=h.magnitude(h.subtract(p,e.camera.position,JU)),f=o.uniformState.projection,y=dOt;y.x=0,y.y=0,y.z=-b,y.w=1;let _=P.multiplyByVector(f,y,JU),S=fo.clipToGLWindowCoordinates(t.viewport,_,cOt);y.x=W.SOLAR_RADIUS;let Z=P.multiplyByVector(f,y,JU),R=fo.clipToGLWindowCoordinates(t.viewport,Z,lOt);return this._size=k.magnitude(k.subtract(R,S,JU)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};jU.prototype.isDestroyed=function(){return!1};jU.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 QU=jU;var WUo=x(T(),1);function XA(e){this._ready=!1,this._provider=void 0,this._errorEvent=new Se,this._readyEvent=new Se,mOt(this,e)}Object.defineProperties(XA.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}}});XA.fromWorldTerrain=function(e){return new XA(KZ(e))};XA.fromWorldBathymetry=function(e){return new XA(Tw(e))};function uOt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function mOt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){uOt(e._errorEvent,i)}}var qU=XA;var IUo=x(T(),1);function NA(){}NA.prototype.boundingVolume=void 0;NA.prototype.boundingSphere=void 0;NA.prototype.distanceToCamera=function(e){ge.throwInstantiationError()};NA.prototype.intersectPlane=function(e){ge.throwInstantiationError()};NA.prototype.createDebugVolume=function(e){ge.throwInstantiationError()};var Cce=NA;var kUo=x(T(),1);function $U(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($U.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}}});$U.prototype.getTileCredits=function(e,t,n){};$U.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)};$U.prototype.pickFeatures=function(e,t,n,i,o){};var e5=$U;var OUo=x(T(),1);function Vce(e){ge.throwInstantiationError()}Vce.prototype.isReady=ge.throwInstantiationError;Vce.prototype.shouldDiscardImage=ge.throwInstantiationError;var Ece=Vce;var zUo=x(T(),1),XNe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(XNe);var Ace=XNe;var d5o=x(T(),1);function kR(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 Nb,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(kR.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 hOt(e){return`uniform vec4 czm_pickColor; +${e}`}function fOt(e){return function(t){return It(t,{czm_pickColor:function(){return e._pickId.color}})}}function pOt(){return"czm_pickColor"}kR.prototype.makeStyleDirty=function(){this._styleDirty=!0};kR.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var bOt=new Q;function Lce(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function wR(e,t){return e._intervals.indexOf(t.start)}function gOt(e,t){let n=e._intervals,i=e._clock,o=Lce(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,bOt),a=n.indexOf(s),c=wR(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function yOt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function xOt(e,t,n){let i=Lce(e),o=wR(e,t),r=wR(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 TOt(e,t,n){let i=wR(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 $k({arrayBuffer:d,cull:!0,fragmentShaderLoaded:hOt,uniformMapLoaded:fOt(e),pickIdLoaded:pOt})}).catch(YNe(e,c))}return r}function _Ot(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 SOt(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(MNe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Zn()-t.timestamp)/1e3;_Ot(e,a)}}t.touchedFrameNumber=i.frameNumber}var ZOt=new P;function ROt(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 COt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var VOt=new Up;function MNe(e,t,n,i){let o=e.shading??VOt,r=t.pointCloud,s=t.transform??P.IDENTITY;r.modelMatrix=P.multiplyTransformation(e.modelMatrix,s,ZOt),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=ROt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=COt(e);try{r.update(i)}catch(a){YNe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Gce(e,t,n,i){let o=TOt(e,t,i);SOt(e,o,n,i)}function EOt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function wNe(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 AOt(e,t){let n=wR(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function NNe(e,t,n,i,o){return l(n)?n.ready?!0:(Gce(e,t,i,o),n.ready):!1}function GOt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=wR(e,n),m=wR(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],NNe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],NNe(e,s,a,i,o))return s;return t}function LOt(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 YA={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};kR.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)&&LOt(this,o,s),YA.timeSinceLoad=t,YA.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,b=yOt(this);if(!l(b))return;let f=!1,y=Lce(this),_=y===0;y!==this._clockMultiplier&&(f=!0,this._clockMultiplier=y),(!l(m)||_)&&(m=b),(!l(p)||f||xOt(this,b,p))&&(p=gOt(this,b)),m=GOt(this,m,b,YA,e);let S=AOt(this,m);l(S)||(Gce(this,m,YA,e),S=this._lastRenderedFrame),l(S)&&MNe(this,S,YA,e),l(p)&&Gce(this,p,YA,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&&wNe(this,EOt(e));let A=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&A>0&&c.update(e,u,a,this.boundingSphere)};kR.prototype.isDestroyed=function(){return!1};kR.prototype.destroy=function(){return wNe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var MA=kR;var R5o=x(T(),1);var m5o=x(T(),1),t5=`in vec2 v_textureCoordinates; void main() { czm_materialInput materialInput; @@ -12715,9 +12715,9 @@ materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } -`;function FK(e,t){this.show=!0,l(e)||(e=new nt),this.rectangle=nt.clone(e),l(t)||(t=ro.fromType(ro.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}FK.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,Ek]});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)}};FK.prototype.isDestroyed=function(){return!1};FK.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var Pse=FK;var Mbo=x(T(),1);var Xse=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()}},Nse=Xse;var Dbo=x(T(),1);function iy(){ge.throwInstantiationError()}Object.defineProperties(iy.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}});iy.prototype.update=ge.throwInstantiationError;iy.prototype.updateViewTransforms=ge.throwInstantiationError;iy.prototype.convertLocalToShapeUvSpace=ge.throwInstantiationError;iy.prototype.computeOrientedBoundingBoxForTile=ge.throwInstantiationError;iy.prototype.computeOrientedBoundingBoxForSample=ge.throwInstantiationError;iy.DefaultMinBounds=ge.throwInstantiationError;iy.DefaultMaxBounds=ge.throwInstantiationError;var Yse=iy;var _go=x(T(),1);var Bbo=x(T(),1),aNt=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Wt=aNt;var Qbo=x(T(),1);var cNt=500;function lNt(e,t,n,i,o){let r=t.mostDetailedHeightPosition;if(l(r)&&h.distance(r,n)>cNt&&(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 qf=lNt;var tgo=x(T(),1);var dNt=new pe;function uNt(e,t,n,i,o){let r=i.cartesianToCartographic(e,dNt);return n===He.CLIP_TO_GROUND?r.height<t&&(r.height=t):bs(n)?r.height=t:Py(n)&&(r.height+=t),i.cartographicToCartesian(r,o)}var oy=uNt;var mNt=U.WHITE,hNt=h.ZERO,fNt=He.NONE,pNt=k.ZERO,bNt=1,gNt=0,yNt=h.ZERO,xNt=Oi.CENTER,TNt=Bn.CENTER,_Nt=!1,SNt=Ur.NONE,ZNt=new h,RNt=new U,CNt=new h,VNt=new k,ENt=new Kt,ANt=new Kt,GNt=new Kt,LNt=new nt,WNt=new Bt;function dFe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function TT(e,t){t.collectionChanged.addEventListener(TT.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}TT.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m;if(u&&(m=j.getValueOrUndefined(s._position,e,ZNt),c=j.getValueOrUndefined(a._image,e),u=l(m)&&l(c)),!u){Mse(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0),l(d)||(d=n.getBillboard(s),d.id=s,r.billboard=d,r.textureValue=void 0),d.show=u,d.position=m,d.color=j.getValueOrDefault(a._color,e,mNt,RNt),d.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,hNt,CNt),d.heightReference=j.getValueOrDefault(a._heightReference,e,fNt),d.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,pNt,VNt),d.scale=j.getValueOrDefault(a._scale,e,bNt),d.rotation=j.getValueOrDefault(a._rotation,e,gNt),d.alignedAxis=j.getValueOrDefault(a._alignedAxis,e,yNt),d.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,xNt),d.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,TNt),d.width=j.getValueOrUndefined(a._width,e),d.height=j.getValueOrUndefined(a._height,e),d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,ENt),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,ANt),d.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,GNt),d.sizeInMeters=j.getValueOrDefault(a._sizeInMeters,e,_Nt),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,WNt),d.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=j.getValueOrDefault(a._splitDirection,e,SNt),r.textureValue!==c&&(d.image=c,r.textureValue=c);let p=j.getValueOrUndefined(a._imageSubRegion,e,LNt);l(p)&&d.setImageSubRegion(d.image,p)}return!0};TT.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Wt.FAILED;let i=n.billboard;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=qf(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=oy(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};TT.prototype.isDestroyed=function(){return!1};TT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(TT.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};TT.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new dFe(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 dFe(r)):(Mse(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Mse(s.get(r.id),r,a),s.remove(r.id)};function Mse(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var Ak=TT;var Kyo=x(T(),1);var Cgo=x(T(),1);function Gk(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(Gk.prototype,{componentDatatype:{get:function(){return J.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});Gk.fromDistanceDisplayCondition=function(e){return new Gk(e.near,e.far)};Gk.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var oi=Gk;var zgo=x(T(),1);var vgo=x(T(),1);function vE(){ge.throwInstantiationError()}Object.defineProperties(vE.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});vE.prototype.getType=ge.throwInstantiationError;vE.prototype.getValue=ge.throwInstantiationError;vE.prototype.equals=ge.throwInstantiationError;var vNt=new Q;vE.getValue=function(e,t,n){let i;return l(e)||(e=Q.now(vNt)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ro.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ro.ColorType)&&(n=ro.fromType(ro.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var Cr=vE;function mR(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}mR.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};mR.prototype._setOptions=ge.throwInstantiationError;mR.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=Cr.getValue(e,d,this._material);this._material=b,m=new Vo({material:b,translucent:b.isTranslucent(),closed:p})}if(n)c.vertexFormat=Tn.VERTEX_FORMAT,this._primitive=o.add(new id({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 Pn({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 Pn({geometryInstances:d,appearance:new Tn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};mR.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))?(me.clone(o.boundingSphere,e),Wt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(me.clone(o.boundingSphere,e),Wt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Wt.PENDING:Wt.FAILED};mR.prototype.isDestroyed=function(){return!1};mR.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 vi=mR;var cyo=x(T(),1);var FNt=new Qt(U.WHITE),INt=new fi(!0),PNt=new fi(!0),XNt=new fi(!1),NNt=new fi(U.BLACK),YNt=new fi(Wn.DISABLED),MNt=new fi(new Bt),wNt=new fi(ni.BOTH);function md(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 Se,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(md.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)&&j.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)&&j.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});md.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};md.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};md.prototype.createFillGeometryInstance=ge.throwInstantiationError;md.prototype.createOutlineGeometryInstance=ge.throwInstantiationError;md.prototype.isDestroyed=function(){return!1};md.prototype.destroy=function(){ue(this)};md.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(ot.MINIMUM_VALUE)};md.prototype._isOnTerrain=function(e,t){return!1};md.prototype._getIsClosed=function(e){return!0};md.prototype._isDynamic=ge.throwInstantiationError;md.prototype._setStaticOptions=ge.throwInstantiationError;md.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(ot.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(ot.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??FNt,this._fillProperty=r??PNt,this._showProperty=d??INt,this._showOutlineProperty=o.outline??XNt,this._outlineColorProperty=c?o.outlineColor??NNt:void 0,this._shadowsProperty=o.shadows??YNt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??MNt,this._classificationTypeProperty=o.classificationType??wNt,this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Qt);if(c&&u&&(xt(xt.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let m=o.outlineWidth;this._outlineWidth=l(m)?m.getValue(ot.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};md.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Fi=md;var Vyo=x(T(),1);var Tyo=x(T(),1);var uFe=new h;function FE(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new pe,this._normal=new h,this._definitionChanged=new Se,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(ot.MINIMUM_VALUE,uFe);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(FE.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});FE.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),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var kNt=new Q;FE.prototype.getValue=function(e,t){l(e)||(e=Q.now(kNt));let n=j.getValueOrDefault(this._heightReference,e,He.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,He.NONE);if(n===He.NONE&&!Py(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,uFe);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)};FE.prototype.isDestroyed=function(){return!1};FE.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var hR=FE;function UNt(e,t,n,i){if(Fi.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 Bf(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new hR(this._scene,s,r)}}var ry=UNt;var mFe=h.ZERO,hFe=new h,DNt=new h,fFe=new U;function ONt(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function cm(e,t){Fi.call(this,{entity:e,scene:t,geometryOptions:new ONt(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(cm.prototype=Object.create(Fi.prototype),cm.prototype.constructor=cm);Object.defineProperties(cm.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});cm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=oi.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,fFe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,mFe,hFe))),new Mt({id:t,geometry:Fc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};cm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,fFe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,mFe,hFe))),new Mt({id:t,geometry:yf.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};cm.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};cm.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Fi.prototype._isHidden.call(this,e,t)};cm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};cm.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(ot.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==He.NONE?yn.ALL:void 0};cm.prototype._onEntityPropertyChanged=ry;cm.DynamicGeometryUpdater=IE;function IE(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(IE.prototype=Object.create(vi.prototype),IE.prototype.constructor=IE);IE.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,DNt),o=this._options.dimensions;return!l(i)||!l(o)||vi.prototype._isHidden.call(this,e,t,n)};IE.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?yn.ALL:void 0};var Lk=cm;var txo=x(T(),1);function fR(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??zi.FIXED,this._definitionChanged=new Se,this.setCallback(e,t)}Object.defineProperties(fR.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var BNt=new Q;fR.prototype.getValue=function(e,t){return l(e)||(e=Q.now(BNt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};fR.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};fR.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Yf.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};fR.prototype.equals=function(e){return this===e||e instanceof fR&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var Wk=fR;var mxo=x(T(),1);var zNt=new P;function _T(e,t){t.collectionChanged.addEventListener(_T.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}_T.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,zNt),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],HNt(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};_T.prototype.isDestroyed=function(){return!1};_T.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_T.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)wse(this,e[i],t,n);return ue(this)};_T.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?(me.clone(i.boundingSphere,t),Wt.DONE):Wt.FAILED:Wt.PENDING};_T.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):(wse(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],wse(this,r,a,c),s.remove(r.id)};function wse(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function HNt(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 vk=_T;var Sxo=x(T(),1);var KNt=U.WHITE,JNt=U.BLACK,jNt=new k(2,2);function PE(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(PE.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")});PE.prototype.getType=function(e){return"Checkerboard"};var QNt=new Q;PE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(QNt)),l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,KNt,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,JNt,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,jNt),t};PE.prototype.equals=function(e){return this===e||e instanceof PE&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var XE=PE;var Gxo=x(T(),1);var IK={id:void 0},NE=new Array(2);function kse(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 pFe(e,t,n,i){NE[0]=n,NE[1]=i.id,t[JSON.stringify(NE)]=i.definitionChanged.addEventListener(Fs.prototype._onDefinitionChanged,e)}function bFe(e,t,n,i){NE[0]=n,NE[1]=i.id;let o=JSON.stringify(NE);t[o](),t[o]=void 0}function ST(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 Qa(e),p=e._eventHash,b;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Fs.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--)s=a[c],bFe(e,p,b,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Fs.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--){s=a[c],pFe(e,p,b,s);let y=m.getById(s.id);l(y)||(y=u.getById(s.id),l(y)?kse(y):(IK.id=s.id,y=new nr(IK)),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 Fs(e,t){this._owner=t,this._composite=new Qa(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=$n(),this._eventHash={},ST(this),this._shouldRecomposite=!1}Object.defineProperties(Fs.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}}});Fs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),ST(this)};Fs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),ST(this),!0):!1};Fs.prototype.removeAllCollections=function(){this._collections.length=0,ST(this)};Fs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Fs.prototype.contains=function(e){return this._composite.contains(e)};Fs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Fs.prototype.getCollection=function(e){return this._collections[e]};Fs.prototype.getCollectionsLength=function(){return this._collections.length};function PK(e,t){return e.indexOf(t)}function gFe(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,ST(e)}Fs.prototype.raiseCollection=function(e){let t=PK(this._collections,e);gFe(this,t,t+1)};Fs.prototype.lowerCollection=function(e){let t=PK(this._collections,e);gFe(this,t,t-1)};Fs.prototype.raiseCollectionToTop=function(e){let t=PK(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),ST(this))};Fs.prototype.lowerCollectionToBottom=function(e){let t=PK(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),ST(this))};Fs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Fs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(ST(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Fs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Fs.prototype.getById=function(e){return this._composite.getById(e)};Fs.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];bFe(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),kse(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];pFe(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)?kse(d):(IK.id=y,d=new nr(IK),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Fs.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 Use=Fs;var Xxo=x(T(),1);function ZT(){this._definitionChanged=new Se,this._composite=new Tl,this._composite.definitionChanged.addEventListener(ZT.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ZT.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});ZT.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var qNt=new Q;ZT.prototype.getValue=function(e,t){l(e)||(e=Q.now(qNt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};ZT.prototype.equals=function(e){return this===e||e instanceof ZT&&this._composite.equals(e._composite,j.equals)};ZT.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var YE=ZT;var W_o=x(T(),1);var WTo=x(T(),1);var Yxo=x(T(),1),yFe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(yFe);var lo=yFe;var lTo=x(T(),1);var $xo=x(T(),1);var _c=[new h,new h],$Nt=new h,eYt=new h,tYt=new h,nYt=new h,iYt=new h,oYt=new h,rYt=new h,sYt=new h,aYt=new h,ME=new h,XK=new h,Fk={},Dse=new pe;function cYt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];Dse=t.cartesianToCartographic(o,Dse),n[i]=Dse.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function Ose(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 NK=new h,YK=new h;function lYt(e,t,n,i){let o=new Ms(n,i),r=o.projectPointOntoPlane(h.add(n,e,NK),NK),s=o.projectPointOntoPlane(h.add(n,t,YK),YK),a=k.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var dYt=new h(-1,0,0),pR=new P,uYt=new P,Bse=new q,mYt=q.IDENTITY.clone(),hYt=new h,fYt=new ce,xFe=new h;function sy(e,t,n,i,o,r,s,a){let c=hYt,d=fYt;pR=_t.eastNorthUpToFixedFrame(e,o,pR),c=P.multiplyByPointAsVector(pR,dYt,c),c=h.normalize(c,c);let u=lYt(c,t,e,o);Bse=q.fromRotationZ(u,Bse),xFe.z=r,pR=P.multiplyTransformation(pR,P.fromRotationTranslation(Bse,xFe,uYt),pR);let m=mYt;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(pR,d,d),i.push(d.x,d.y,d.z);return i}var pYt=new h;function zse(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,pYt);i=sy(c,t,n,i,o,r[a/3],s,1)}return i}function bYt(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 TFe(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 _Fe=new Ne,SFe=new h,ZFe=new q;function RFe(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,ME),h.subtract(n,e,XK)),m=i===lo.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=q.fromQuaternion(Ne.fromAxisAngle(h.negate(e,ME),u/(m+1),_Fe),ZFe):p=q.fromQuaternion(Ne.fromAxisAngle(e,u/(m+1),_Fe),ZFe);let b,f;if(t=h.clone(t,SFe),m>0){let y=d?2:1;for(let _=0;_<m;_++)t=q.multiplyByVector(p,t,t),b=h.subtract(t,e,ME),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,XK),s=sy(f,b,a,s,r,c,1,y)}else b=h.subtract(t,e,ME),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,XK),s=sy(f,b,a,s,r,c,1,1),n=h.clone(n,SFe),b=h.subtract(n,e,ME),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(n,XK),s=sy(f,b,a,s,r,c,1,1);return s}Fk.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};Fk.angleIsGreaterThanPi=function(e,t,n,i){let o=new Ms(n,i),r=o.projectPointOntoPlane(h.add(n,e,NK),NK),s=o.projectPointOntoPlane(h.add(n,t,YK),YK);return s.x*r.y-s.y*r.x>=0};var gYt=new h,yYt=new h;Fk.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=cYt(e,r),a=i._granularity,c=i._cornerType,d=o?bYt(t,n):TFe(t,n),u=o?TFe(t,n):void 0,m=n.height/2,p=n.width/2,b=e.length,f=[],y=o?[]:void 0,_=$Nt,S=eYt,Z=tYt,R=nYt,C=iYt,E=oYt,A=rYt,L=sYt,F=aYt,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=sy(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 M=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),gYt);h.subtract(_,O,O),h.normalize(O,O);let w=h.multiplyByScalar(R,h.dot(S,R),yYt);if(h.subtract(S,w,w),h.normalize(w,w),!W.equalsEpsilon(Math.abs(h.dot(O,w)),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,ME))),te=Fk.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),_c[0]=h.clone(F,_c[0]),_c[1]=h.clone(E,_c[1]),G=Ose(_c,g+m,V+m,a),v=so.generateArc({positions:_c,granularity:a,ellipsoid:r}),f=zse(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===lo.ROUNDED||c===lo.BEVELED?RFe(C,E,A,c,te,r,f,d,V+m,o):(Z=h.negate(Z,Z),f=sy(I,Z,d,f,r,V+m,K,M)),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),_c[0]=h.clone(F,_c[0]),_c[1]=h.clone(E,_c[1]),G=Ose(_c,g+m,V+m,a),v=so.generateArc({positions:_c,granularity:a,ellipsoid:r}),f=zse(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===lo.ROUNDED||c===lo.BEVELED?RFe(C,E,A,c,te,r,f,d,V+m,o):f=sy(I,Z,d,f,r,V+m,K,M),F=h.clone(A,F)),S=h.negate(_,S)}else f=sy(F,L,d,f,r,g+m,1,1),F=I;g=V,V=s[D+1],I=N}_c[0]=h.clone(F,_c[0]),_c[1]=h.clone(I,_c[1]),G=Ose(_c,g+m,V+m,a),v=so.generateArc({positions:_c,granularity:a,ellipsoid:r}),f=zse(v,L,d,f,r,G,1),o&&(y=sy(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 $f=Fk;var Kse={},wE=new h,GFe=new h,xYt=new h,CFe=new h,hd=[new h,new h],LFe=new h,WFe=new h,vFe=new h,TYt=new h,_Yt=new h,SYt=new h,ZYt=new h,RYt=new h,CYt=new h,VYt=new h,VFe=new Ne,EFe=new q;function MK(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,wE),h.subtract(n,e,GFe)),s=i===lo.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,wE),r/s,VFe),EFe):d=q.fromQuaternion(Ne.fromAxisAngle(e,r/s,VFe),EFe);let u=0;t=h.clone(t,wE);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 EYt(e){let t=LFe,n=WFe,i=vFe,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=MK(t,n,i,lo.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=MK(t,n,i,lo.ROUNDED,!1);return[r,c]}function AFe(e,t,n,i){let o=wE;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 Hse(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,wE),a=h.negate(s,GFe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,xYt),p=h.add(m,a,CFe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let b=h.add(m,s,CFe);r[d--]=b.z,r[d--]=b.y,r[d--]=b.x}return i.push(o,r),i}Kse.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 AYt=new h,GYt=new h;Kse.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=LFe,c=WFe,d=vFe,u=TYt,m=_Yt,p=SYt,b=ZYt,f=RYt,y=CYt,_=VYt,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),AYt);h.subtract(c,g,g),h.normalize(g,g);let V=h.multiplyByScalar(a,h.dot(d,a),GYt);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,wE))),X=$f.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),hd[0]=h.clone(b,hd[0]),hd[1]=h.clone(_,hd[1]),A=so.generateArc({positions:hd,granularity:t,ellipsoid:i}),S=Hse(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===lo.ROUNDED||r===lo.BEVELED?L.push({leftPositions:MK(f,p,y,r,X)}):L.push({leftPositions:AFe(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),hd[0]=h.clone(b,hd[0]),hd[1]=h.clone(_,hd[1]),A=so.generateArc({positions:hd,granularity:t,ellipsoid:i}),S=Hse(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===lo.ROUNDED||r===lo.BEVELED?L.push({rightPositions:MK(y,p,f,r,X)}):L.push({rightPositions:AFe(C,m,f,X)})),d=h.negate(c,d)}C=E}a=i.geodeticSurfaceNormal(C,a),hd[0]=h.clone(b,hd[0]),hd[1]=h.clone(C,hd[1]),A=so.generateArc({positions:hd,granularity:t,ellipsoid:i}),S=Hse(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===lo.ROUNDED&&(N=EYt(S)),{positions:S,corners:L,lefts:Z,normals:R,endPositions:N}};var yo=Kse;var PFe=new h,XFe=new h,wK=new h,kK=new h,LYt=new h,NFe=new h,RT=new h,kE=new h;function YFe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function ep(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=h.normalize(h.cross(n,t,RT),RT);r.normal&&yo.addAttribute(s,t,i,o),r.tangent&&yo.addAttribute(a,d,i,o),r.bitangent&&yo.addAttribute(c,n,i,o)}function MFe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new Cn,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=PFe,G=XFe,v,X,Y=y/2,D=Oe.createTypedArray(_/3,p),M=0;if(f){X=wK,v=kK;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),yo.addAttribute(S,v,A),yo.addAttribute(S,X,void 0,L),ep(E,V,G,A,L,t),I=A/3,g=I+1,F=(L-2)/3,N=F-1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3}let O=0,w=0,z=i[O++],K=i[O++];S.set(z,A),S.set(K,L-K.length+1),G=h.fromArray(s,w,G);let te,H;for(b=K.length-3,m=0;m<b;m+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,m,RT),RT),H=n.geodeticSurfaceNormal(h.fromArray(K,b-m,kE),kE),V=h.normalize(h.add(te,H,V),V),ep(E,V,G,A,L,t),I=A/3,g=I+1,F=(L-2)/3,N=F-1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3;for(te=n.geodeticSurfaceNormal(h.fromArray(z,b,RT),RT),H=n.geodeticSurfaceNormal(h.fromArray(K,b,kE),kE),V=h.normalize(h.add(te,H,V),V),w+=3,m=0;m<o.length;m++){let $,ee=o[m],le=ee.leftPositions,_e=ee.rightPositions,he,Ze,ye=NFe,Ge=wK,Ae=kK;if(V=h.fromArray(a,w,V),l(le)){for(ep(E,V,G,void 0,L,t),L-=3,he=g,Ze=N,$=0;$<le.length/3;$++)ye=h.fromArray(le,$*3,ye),D[M++]=he,D[M++]=Ze-$-1,D[M++]=Ze-$,yo.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),ep(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),ep(E,V,G,A,void 0,t),A+=3}else{for(ep(E,V,G,A,void 0,t),A+=3,he=N,Ze=g,$=0;$<_e.length/3;$++)ye=h.fromArray(_e,$*3,ye),D[M++]=he,D[M++]=Ze+$,D[M++]=Ze+$+1,yo.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),ep(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),ep(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,w+=3,G=h.fromArray(s,w,G),$=0;$<K.length;$+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,$,RT),RT),H=n.geodeticSurfaceNormal(h.fromArray(K,b-$,kE),kE),V=h.normalize(h.add(te,H,V),V),ep(E,V,G,A,L,t),g=A/3,I=g-1,N=(L-2)/3,F=N+1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3;A-=3,L+=3}if(V=h.fromArray(a,a.length-3,V),ep(E,V,G,A,L,t),f){A+=3,L-=3,X=wK,v=kK;let $=r[1];for(m=0;m<Y;m++)X=h.fromArray($,(y-m-1)*3,X),v=h.fromArray($,m*3,v),yo.addAttribute(S,X,void 0,L),yo.addAttribute(S,v,A),ep(E,V,G,A,L,t),g=A/3,I=g-1,N=(L-2)/3,F=N+1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=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 WYt(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=PFe,f=XFe,y=wK,_=kK,S=LYt,Z=NFe,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&&(yo.addAttribute(u,_,C),yo.addAttribute(u,_,C+3),yo.addAttribute(u,_,R),yo.addAttribute(u,_,R+3)),(t.tangent||t.bitangent)&&(Z=h.fromArray(i,d,Z),t.bitangent&&(yo.addAttribute(p,Z,C),yo.addAttribute(p,Z,C+3),yo.addAttribute(p,Z,R),yo.addAttribute(p,Z,R+3)),t.tangent&&(S=h.normalize(h.cross(Z,_,S),S),yo.addAttribute(m,S,C),yo.addAttribute(m,S,C+3),yo.addAttribute(m,S,R),yo.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 Jse(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 vYt(e,t){let n=new Me({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=yo.computePositions(e),r=MFe(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=Jse(u,0,f),b=mi.scaleToGeodeticHeight(b,a,i),f=Jse(b,m*2,f),p.set(u),p.set(b,m),p.set(f,m*2),c.position.values=p,c=WYt(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=Jse(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===yn.TOP)I=I.fill(1,0,_).fill(1,_*2,_*4);else{let N=e.offsetAttribute===yn.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 FFe=new h,Ik=new h,Sh=new pe;function IFe(e,t,n,i,o,r){let s=h.subtract(t,e,FFe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,Ik),c=h.cross(s,a,FFe);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,Ik),n.cartesianToCartographic(Ik,Sh);let b=Sh.latitude,f=Sh.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,Ik),n.cartesianToCartographic(Ik,Sh),b=Sh.latitude,f=Sh.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 _h=new h,Pk=new h,au=new pe,cu=new pe;function wFe(e,t,n,i,o){e=YFe(e,t);let r=Mo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new re;let a=n*.5;au.latitude=Number.POSITIVE_INFINITY,au.longitude=Number.POSITIVE_INFINITY,cu.latitude=Number.NEGATIVE_INFINITY,cu.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===lo.ROUNDED){let p=r[0];h.subtract(p,r[1],_h),h.normalize(_h,_h),h.multiplyByScalar(_h,a,_h),h.add(p,_h,Pk),t.cartesianToCartographic(Pk,Sh),c=Sh.latitude,d=Sh.longitude,au.latitude=Math.min(au.latitude,c),au.longitude=Math.min(au.longitude,d),cu.latitude=Math.max(cu.latitude,c),cu.longitude=Math.max(cu.longitude,d)}for(let p=0;p<s-1;++p)IFe(r[p],r[p+1],t,a,au,cu);let u=r[s-1];h.subtract(u,r[s-2],_h),h.normalize(_h,_h),h.multiplyByScalar(_h,a,_h),h.add(u,_h,Pk),IFe(u,Pk,t,a,au,cu),i===lo.ROUNDED&&(t.cartesianToCartographic(Pk,Sh),c=Sh.latitude,d=Sh.longitude,au.latitude=Math.min(au.latitude,c),au.longitude=Math.min(au.longitude,d),cu.latitude=Math.max(cu.latitude,c),cu.longitude=Math.max(cu.longitude,d));let m=l(o)?o:new re;return m.north=cu.latitude,m.south=au.latitude,m.east=cu.longitude,m.west=au.longitude,m}function cy(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=Me.clone(e.vertexFormat??Me.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??lo.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+Me.packedLength+7}cy.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 kFe=ne.clone(ne.UNIT_SPHERE),UFe=new Me,ay={positions:void 0,ellipsoid:kFe,vertexFormat:UFe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};cy.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,kFe);t+=ne.packedLength;let s=Me.unpack(e,t,UFe);t+=Me.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=Me.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):(ay.positions=o,ay.width=a,ay.height=c,ay.extrudedHeight=d,ay.cornerType=u,ay.granularity=m,ay.shadowVolume=p,ay.offsetAttribute=b===-1?void 0:b,new cy(ay))};cy.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??ne.default,r=e.cornerType??lo.ROUNDED;return wFe(n,o,i,r,t)};cy.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=YFe(t,i);let o=Mo(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=vYt(d,c);else{let b=yo.computePositions(d);if(u=MFe(b,c,i),u.attributes.position.values=mi.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===yn.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=me.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})};cy.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new cy({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(cy.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=wFe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var bR=cy;var jTo=x(T(),1);var DFe=new h,OFe=new h,FYt=new h;function IYt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function BFe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new Cn,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=DFe,L=OFe;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),yo.addAttribute(_,L,S),yo.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,M,O=FYt;if(l(Y)){for(Z-=3,M=E,n.push(A),X=0;X<Y.length/3;X++)O=h.fromArray(Y,X*3,O),N[g++]=M-X-1,N[g++]=M-X,yo.addAttribute(_,O,void 0,Z),Z-=3;n.push(M-Math.floor(Y.length/6)),t===lo.BEVELED&&n.push((Z-2)/3+1),S+=3}else{for(S+=3,M=A,n.push(E),X=0;X<D.length/3;X++)O=h.fromArray(D,X*3,O),N[g++]=M+X,N[g++]=M+X+1,yo.addAttribute(_,O,S),S+=3;n.push(M+Math.floor(D.length/6)),t===lo.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=DFe,L=OFe;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),yo.addAttribute(_,F,void 0,Z),yo.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 PYt(e){let t=e.ellipsoid,n=yo.computePositions(e),i=BFe(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===yn.TOP)R=R.fill(1,0,u);else{let C=e.offsetAttribute===yn.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 Xk(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??lo.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}Xk.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 zFe=ne.clone(ne.UNIT_SPHERE),CT={positions:void 0,ellipsoid:zFe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};Xk.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,zFe);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):(CT.positions=o,CT.width=s,CT.height=a,CT.extrudedHeight=c,CT.cornerType=d,CT.granularity=u,CT.offsetAttribute=m===-1?void 0:m,new Xk(CT))};Xk.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=IYt(t,i);let o=Mo(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=PYt(c);else{let p=yo.computePositions(c);if(d=BFe(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===yn.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=me.fromVertices(u.position.values,void 0,3);return new At({attributes:u,indices:d.indices,primitiveType:Ie.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var Nk=Xk;var c_o=x(T(),1);var XYt=new fi(0);function fd(e){Fi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(fd.prototype=Object.create(Fi.prototype),fd.prototype.constructor=fd);Object.defineProperties(fd.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});fd.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&id.isSupported(this._scene)};fd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};fd.prototype._computeCenter=ge.throwInstantiationError;fd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Fi.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??XYt,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 Bf(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new hR(this._scene,a,r,s)}};fd.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Fi.prototype.destroy.call(this)};fd.getGeometryHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryHeightReference);return}return bs(t)?0:e};fd.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryExtrudedHeightReference);return}return bs(t)?fd.CLAMP_TO_GROUND:e};fd.CLAMP_TO_GROUND="clamp";fd.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 yn.ALL;if(o===1)return yn.TOP};var ri=fd;var HFe=new U,KFe=h.ZERO,JFe=new h,jFe=new re;function NYt(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 tp(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new NYt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(tp.prototype=Object.create(ri.prototype),tp.prototype.constructor=tp);tp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:oi.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,HFe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,KFe,JFe))),new Mt({id:t,geometry:new bR(this._options),attributes:i})};tp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,HFe),o={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,KFe,JFe))),new Mt({id:t,geometry:new Nk(this._options),attributes:o})};tp.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)};tp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Fi.prototype._isHidden.call(this,e,t)};tp.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)};tp.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),o=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ot.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(ot.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),s.cornerType=j.getValueOrUndefined(t.cornerType,ot.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=Xi.getMinimumMaximumHeights(bR.computeRectangle(s,jFe)).minimumTerrainHeight),s.extrudedHeight=o};tp.DynamicGeometryUpdater=UE;function UE(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(UE.prototype=Object.create(vi.prototype),UE.prototype.constructor=UE);UE.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||vi.prototype._isHidden.call(this,e,t,n)};UE.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=Xi.getMinimumMaximumHeights(bR.computeRectangle(i,jFe)).minimumTerrainHeight),i.extrudedHeight=s};var Yk=tp;var N_o=x(T(),1);function jse(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 Qa(this),this._entityCluster=new $u}Object.defineProperties(jse.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){vs.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}}});jse.prototype.update=function(e){return!0};var Mk=jse;var wSo=x(T(),1);var iSo=x(T(),1);var w_o=x(T(),1);var QFe={};QFe.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 gR=QFe;var Qse=new k,YYt=new h,MYt=new h,wYt=new h,kYt=new h;function ly(e){e=e??B.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Me.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Me.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}ly.packedLength=Me.packedLength+5;ly.pack=function(e,t,n){return n=n??0,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var qFe=new Me,DE={vertexFormat:qFe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};ly.unpack=function(e,t,n){t=t??0;let i=Me.unpack(e,t,qFe);t+=Me.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(DE.length=o,DE.topRadius=r,DE.bottomRadius=s,DE.slices=a,DE.offsetAttribute=c===-1?void 0:c,new ly(DE))};ly.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=gR.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=YYt;V.z=Math.sin(g);let G=Math.cos(g),v=wYt,X=MYt;for(f=0;f<r;f++){let Y=f/r*W.TWO_PI,D=G*Math.cos(Y),M=G*Math.sin(Y);y&&(V.x=D,V.y=M,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,kYt);u[C++]=(F.x+L)/(2*L),u[C++]=(F.y+L)/(2*L)}}let E=new Cn;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})),Qse.x=t*.5,Qse.y=Math.max(i,n);let A=new me(h.ZERO,k.magnitude(Qse));if(l(e._offsetAttribute)){t=d.length;let L=e._offsetAttribute===yn.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 qse;ly.getUnitCylinder=function(){return l(qse)||(qse=ly.createGeometry(new ly({topRadius:1,bottomRadius:1,length:1,vertexFormat:Me.POSITION_ONLY}))),qse};var wk=ly;var ySo=x(T(),1);var $se=new k;function OE(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"}OE.packedLength=6;OE.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 yR={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};OE.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):(yR.length=i,yR.topRadius=o,yR.bottomRadius=r,yR.slices=s,yR.numberOfVerticalLines=a,yR.offsetAttribute=c===-1?void 0:c,new OE(yR))};OE.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=gR.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 Cn;b.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:a}),$se.x=t*.5,$se.y=Math.max(i,n);let f=new me(h.ZERO,k.magnitude($se));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===yn.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 kk=OE;var $Fe=h.ZERO,eIe=new h,UYt=new h,tIe=new U;function DYt(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 lm(e,t){Fi.call(this,{entity:e,scene:t,geometryOptions:new DYt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(lm.prototype=Object.create(Fi.prototype),lm.prototype.constructor=lm);Object.defineProperties(lm.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});lm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=oi.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,tIe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,$Fe,eIe))),new Mt({id:t,geometry:new wk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};lm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,tIe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,$Fe,eIe))),new Mt({id:t,geometry:new kk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};lm.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};lm.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Fi.prototype._isHidden.call(this,e,t)};lm.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)};lm.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(ot.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(ot.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(ot.MINIMUM_VALUE),i.slices=j.getValueOrUndefined(t.slices,ot.MINIMUM_VALUE),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,ot.MINIMUM_VALUE),i.offsetAttribute=n!==He.NONE?yn.ALL:void 0};lm.prototype._onEntityPropertyChanged=ry;lm.DynamicGeometryUpdater=BE;function BE(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(BE.prototype=Object.create(vi.prototype),BE.prototype.constructor=BE);BE.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,UYt);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||vi.prototype._isHidden.call(this,e,t,n)};BE.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?yn.ALL:void 0};var Uk=lm;var VCo=x(T(),1);var OSo=x(T(),1);var OYt=W.factorial;function eae(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+=eae(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 BYt=[],tae=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/OYt(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=eae(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=BYt,f=zYt(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=eae(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 zYt(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 Dk=tae;var HSo=x(T(),1);var nae=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}},Ok=nae;var jSo=x(T(),1);function Vl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Vl.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new Vl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Vl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Vl(e.clock,e.cone,e.magnitude)};Vl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Vl(e.clock,e.cone,1)};Vl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Vl.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};Vl.prototype.equals=function(e){return Vl.equals(this,e)};Vl.prototype.clone=function(e){return Vl.clone(this,e)};Vl.prototype.equalsEpsilon=function(e,t){return Vl.equalsEpsilon(this,e,t)};Vl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var Bk=Vl;var jk=x(yu(),1);var sZo=x(T(),1);var HYt=U.WHITE,KYt=.1,JYt=new k(8,8),jYt=new k(0,0),QYt=new k(1,1);function zE(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(zE.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")});zE.prototype.getType=function(e){return"Grid"};var qYt=new Q;zE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(qYt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,HYt,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,KYt),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,JYt,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,QYt,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,jYt,t.lineOffset),t};zE.prototype.equals=function(e){return this===e||e instanceof zE&&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 HE=zE;var cZo=x(T(),1),nIe={WHOLE:0,PORTIONS:1};Object.freeze(nIe);var Y0=nIe;var bZo=x(T(),1);function KE(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(KE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});KE.prototype.getType=function(e){return"PolylineArrow"};var $Yt=new Q;KE.prototype.getValue=function(e,t){return l(e)||(e=Q.now($Yt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};KE.prototype.equals=function(e){return this===e||e instanceof KE&&j.equals(this._color,e._color)};var JE=KE;var CZo=x(T(),1);var eMt=U.WHITE,tMt=U.TRANSPARENT,nMt=16,iMt=255;function jE(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(jE.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")});jE.prototype.getType=function(e){return"PolylineDash"};var oMt=new Q;jE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(oMt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,eMt,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,tMt,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,nMt,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,iMt,t.dashPattern),t};jE.prototype.equals=function(e){return this===e||e instanceof jE&&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 QE=jE;var IZo=x(T(),1);var rMt=U.WHITE,sMt=.25,aMt=1;function qE(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(qE.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")});qE.prototype.getType=function(e){return"PolylineGlow"};var cMt=new Q;qE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(cMt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,rMt,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,sMt,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,aMt,t.taperPower),t};qE.prototype.equals=function(e){return this===e||e instanceof qE&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var $E=qE;var DZo=x(T(),1);var lMt=U.WHITE,dMt=U.BLACK,uMt=1;function eA(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(eA.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")});eA.prototype.getType=function(e){return"PolylineOutline"};var mMt=new Q;eA.prototype.getValue=function(e,t){return l(e)||(e=Q.now(mMt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,lMt,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,dMt,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,uMt),t};eA.prototype.equals=function(e){return this===e||e instanceof eA&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var VT=eA;var jZo=x(T(),1);function ET(e){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Jr,this.setValue(e)}Object.defineProperties(ET.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 hMt=new Q;ET.prototype.getValue=function(e,t){l(e)||(e=Q.now(hMt));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};ET.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,ET.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};ET.prototype.equals=function(e){return this===e||e instanceof ET&&j.arrayEquals(this._value,e._value)};ET.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var tA=ET;var eRo=x(T(),1);var fMt={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}},Zh=fMt;var mRo=x(T(),1);var nRo=x(T(),1),iIe={HORIZONTAL:0,VERTICAL:1};Object.freeze(iIe);var np=iIe;var pMt=np.HORIZONTAL,bMt=U.WHITE,gMt=U.BLACK,yMt=0,xMt=1;function nA(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(nA.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")});nA.prototype.getType=function(e){return"Stripe"};var TMt=new Q;nA.prototype.getValue=function(e,t){return l(e)||(e=Q.now(TMt)),l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,pMt)===np.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,bMt,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,gMt,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,yMt),t.repeat=j.getValueOrDefault(this._repeat,e,xMt),t};nA.prototype.equals=function(e){return this===e||e instanceof nA&&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 iA=nA;var _Ro=x(T(),1);function AT(e){this._definitionChanged=new Se,this._intervals=new As,this._intervals.changedEvent.addEventListener(AT.prototype._intervalsChanged,this),this._referenceFrame=e??zi.FIXED}Object.defineProperties(AT.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 _Mt=new Q;AT.prototype.getValue=function(e,t){return l(e)||(e=Q.now(_Mt)),this.getValueInReferenceFrame(e,zi.FIXED,t)};AT.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Yf.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};AT.prototype.equals=function(e){return this===e||e instanceof AT&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};AT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var dy=AT;var wRo=x(T(),1);var ARo=x(T(),1);function oA(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Se,this._normalize=t??!0,this.position=e}Object.defineProperties(oA.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 SMt=new h,oIe=new h,rIe=new Q,ZMt=new Q,iae=1/60;oA.prototype.getValue=function(e,t){return this._getValue(e,t)};oA.prototype._getValue=function(e,t,n){l(e)||(e=Q.now(ZMt)),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,SMt),r=i.getValue(Q.addSeconds(e,iae,rIe),oIe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-iae,rIe),oIe),!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,iae,t)};oA.prototype.equals=function(e){return this===e||e instanceof oA&&j.equals(this._position,e._position)};var uy=oA;function zk(e,t){this._velocityVectorProperty=new uy(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(zk.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 sIe=new h,RMt=new h,aIe=new q,CMt=new Q;zk.prototype.getValue=function(e,t){l(e)||(e=Q.now(CMt));let n=this._velocityVectorProperty._getValue(e,RMt,sIe);if(l(n))return _t.rotationMatrixFromPositionVelocity(sIe,n,this._ellipsoid,aIe),Ne.fromRotationMatrix(aIe,t)};zk.prototype.equals=function(e){return this===e||e instanceof zk&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var Hk=zk;function GT(){}GT.packedLength=h.packedLength;GT.unpack=h.unpack;GT.pack=h.pack;var oae;function Kk(e,t){return t[0]==="#"&&(t=oae+t),Ug.fromString(e,t)}function cIe(e,t,n){if(l(n.reference))return Kk(t,n.reference);if(l(n.velocityReference)){let i=Kk(t,n.velocityReference);switch(e){case h:case GT:return new uy(i,e===GT);case Ne:return new Hk(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function VMt(e,t){return new Bf(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var xo=new h,pd=new Bk,El=new pe,xR=new Vn,UK=new Ne;function EMt(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 lIe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function AMt(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 GMt(e){let t=e.length;if(pd.magnitude=1,t===2)return pd.clock=e[0],pd.cone=e[1],h.fromSpherical(pd,xo),[xo.x,xo.y,xo.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],pd.clock=e[i+1],pd.cone=e[i+2],h.fromSpherical(pd,xo),n[o+1]=xo.x,n[o+2]=xo.y,n[o+3]=xo.z;return n}function LMt(e){let t=e.length;if(t===3)return pd.clock=e[0],pd.cone=e[1],pd.magnitude=e[2],h.fromSpherical(pd,xo),[xo.x,xo.y,xo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],pd.clock=e[i+1],pd.cone=e[i+2],pd.magnitude=e[i+3],h.fromSpherical(pd,xo),n[i+1]=xo.x,n[i+2]=xo.y,n[i+3]=xo.z;return n}function WMt(e){let t=e.length;if(t===3)return El.longitude=e[0],El.latitude=e[1],El.height=e[2],ne.default.cartographicToCartesian(El,xo),[xo.x,xo.y,xo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],El.longitude=e[i+1],El.latitude=e[i+2],El.height=e[i+3],ne.default.cartographicToCartesian(El,xo),n[i+1]=xo.x,n[i+2]=xo.y,n[i+3]=xo.z;return n}function vMt(e){let t=e.length;if(t===3)return El.longitude=W.toRadians(e[0]),El.latitude=W.toRadians(e[1]),El.height=e[2],ne.default.cartographicToCartesian(El,xo),[xo.x,xo.y,xo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],El.longitude=W.toRadians(e[i+1]),El.latitude=W.toRadians(e[i+2]),El.height=e[i+3],ne.default.cartographicToCartesian(El,xo),n[i+1]=xo.x,n[i+2]=xo.y,n[i+3]=xo.z;return n}function rae(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 GMt(o);let r=e.spherical;if(l(r))return LMt(r);let s=e.cartographicRadians;if(l(s))return WMt(s);let a=e.cartographicDegrees;if(l(a))return vMt(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function dIe(e,t){h.unpack(e,t,xo),h.normalize(xo,xo),h.pack(xo,e,t)}function FMt(e){let t=rae(e);if(t.length===3)return dIe(t,0),t;for(let n=1;n<t.length;n+=4)dIe(t,n);return t}function uIe(e,t){Ne.unpack(e,t,UK),Ne.normalize(UK,UK),Ne.pack(UK,e,t)}function IMt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return uIe(t,0),t;for(let n=1;n<t.length;n+=5)uIe(t,n)}return t}function mIe(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")?GT:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?mn:e.hasOwnProperty("classificationType")?ni:e.hasOwnProperty("colorBlendMode")?dl:e.hasOwnProperty("cornerType")?lo:e.hasOwnProperty("heightReference")?He:e.hasOwnProperty("horizontalOrigin")?Oi:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?xr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Kt:e.hasOwnProperty("distanceDisplayCondition")?Bt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ne:e.hasOwnProperty("pathMode")?Y0:e.hasOwnProperty("shadowMode")?Wn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?np:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?re:e.hasOwnProperty("uri")?jk.default:e.hasOwnProperty("verticalOrigin")?Bn:Object}function PMt(e,t,n){switch(e){case mn:return mn[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 rae(t);case GT:return FMt(t);case U:return EMt(t);case ni:return ni[t.classificationType??t];case dl:return dl[t.colorBlendMode??t];case lo:return lo[t.cornerType??t];case He:return He[t.heightReference??t];case Oi:return Oi[t.horizontalOrigin??t];case Image:return lIe(t,n);case Q:return Q.fromIso8601(t.date??t);case xr:return xr[t.labelStyle??t];case Number:return t.number??t;case Kt:return t.nearFarScalar;case Bt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Y0:return Y0[t.pathMode??t];case Ne:return IMt(t);case Zh:return t.number??t;case _E:return _E[t.portionToDisplay??t];case Wn:return Wn[t.shadowMode??t.shadows??t];case String:return t.string??t;case np:return np[t.stripeOrientation??t];case re:return AMt(t);case jk.default:return lIe(t,n);case Bn:return Bn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var XMt={HERMITE:Dk,LAGRANGE:Ok,LINEAR:nT};function DK(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:XMt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=cd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=cd[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var hIe={iso8601:void 0};function jr(e){if(l(e))return hIe.iso8601=e,Vn.fromIso8601(hIe)}function sae(e){let t=ot.MAXIMUM_INTERVAL.clone();return t.data=e,t}function fIe(e){let t=new Tl;return t.intervals.addInterval(sae(e)),t}function pIe(e){let t=new bc(e.referenceFrame);return t.intervals.addInterval(sae(e)),t}function OK(e,t,n,i,o,r,s){let a=jr(i.interval);l(o)&&(l(a)?a=Vn.intersect(a,o,xR):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(ot.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return VIe(t[n],a)}let b=!1;if(m){if(d=PMt(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!==Zh;if(!b&&!p){m?t[n]=new fi(f?e.unpack(d,0):d):t[n]=cIe(e,s,i);return}let y=t[n],_,S=i.epoch;if(l(S)&&(_=Q.fromIso8601(S)),b&&!p){y instanceof em||(t[n]=y=new em(e)),y.addSamplesPackedArray(d,_),DK(i,y);return}let Z;if(!b&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=cIe(e,s,i),l(y)||(t[n]=y=m?new Dg:new Tl),m&&y instanceof Dg?y.intervals.addInterval(a):y instanceof Tl?(m&&(a.data=new fi(a.data)),y.intervals.addInterval(a)):(t[n]=y=fIe(y),m&&(a.data=new fi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Tl),y instanceof Tl||(t[n]=y=fIe(y));let R=y.intervals;Z=R.findInterval(a),(!l(Z)||!(Z.data instanceof em))&&(Z=a.clone(),Z.data=new em(e),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),DK(i,Z.data)}function VIe(e,t){if(e instanceof em){e.removeSamples(t);return}else if(e instanceof Dg){e.intervals.removeInterval(t);return}else if(e instanceof Tl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Vn.intersect(n.get(i),t,xR);o.isEmpty||VIe(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)OK(e,t,n,i[a],o,r,s);else OK(e,t,n,i,o,r,s)}function bIe(e,t,n,i,o,r){let s=jr(n.interval);l(i)&&(l(s)?s=Vn.intersect(s,i,xR):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(ot.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return EIe(e[t],s)}let b,f=!1;if(m&&(l(n.referenceFrame)&&(b=zi[n.referenceFrame]),b=b??zi.FIXED,d=rae(n),u=d.length??1,f=u>c),!f&&!p){m?e[t]=new sd(h.unpack(d),b):e[t]=Kk(r,n.reference);return}let y=e[t],_,S=n.epoch;if(l(S)&&(_=Q.fromIso8601(S)),f&&!p){(!(y instanceof gc)||l(b)&&y.referenceFrame!==b)&&(e[t]=y=new gc(b,a)),y.addSamplesPackedArray(d,_),DK(n,y);return}let Z;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=Kk(r,n.reference),l(y)||(m?y=new dy(b):y=new bc(b),e[t]=y),m&&y instanceof dy&&l(b)&&y.referenceFrame===b?y.intervals.addInterval(s):y instanceof bc?(m&&(s.data=new sd(s.data,b)),y.intervals.addInterval(s)):(e[t]=y=pIe(y),m&&(s.data=new sd(s.data,b)),y.intervals.addInterval(s));return}l(y)?y instanceof bc||(e[t]=y=pIe(y)):e[t]=y=new bc(b);let R=y.intervals;Z=R.findInterval(s),(!l(Z)||!(Z.data instanceof gc)||l(b)&&Z.data.referenceFrame!==b)&&(Z=s.clone(),Z.data=new gc(b,a),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),DK(n,Z.data)}function EIe(e,t){if(e instanceof gc){e.removeSamples(t);return}else if(e instanceof dy){e.intervals.removeInterval(t);return}else if(e instanceof bc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Vn.intersect(n.get(i),t,xR);o.isEmpty||EIe(o.data,t)}n.removeInterval(t);return}}function AIe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)bIe(e,t,n[s],i,o,r);else bIe(e,t,n,i,o,r)}function gIe(e,t,n,i){l(n.references)?BK(e,t,n.references,n.interval,i,tA,Tl):(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 yIe(e,t,n,i,o,r){let s=jr(n.interval);l(i)&&(l(s)?s=Vn.intersect(s,i,xR):s=i);let a=e[t],c,d;if(l(s)){a instanceof YE||(a=new YE,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 HE||(c=new HE),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 eT||(c=new eT),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 iA||(c=new iA),u=n.stripe,Ce(np,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 VT||(c=new VT),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 $E||(c=new $E),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 JE||(c=new JE),u=n.polylineArrow,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof QE||(c=new QE),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 XE||(c=new XE),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 dm(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)yIe(e,t,n[s],i,o,r);else yIe(e,t,n,i,o,r)}function NMt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function YMt(e,t,n,i){let o=t.description;l(o)&&Ce(String,e,"description",o,void 0,i,n)}function MMt(e,t,n,i){let o=t.position;l(o)&&AIe(e,"position",o,void 0,i,n)}function wMt(e,t,n,i){let o=t.viewFrom;l(o)&&Ce(h,e,"viewFrom",o,void 0,i,n)}function kMt(e,t,n,i){let o=t.orientation;l(o)&&Ce(Ne,e,"orientation",o,void 0,i,n)}function UMt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new ad);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)OK(mIe(s[a]),e.properties,r,s[a],void 0,i,n);else OK(mIe(s),e.properties,r,s,void 0,i,n)}}}function BK(e,t,n,i,o,r,s){let a=n.map(function(c){return Kk(o,c)});if(l(i)){i=jr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(sae(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function xIe(e,t,n,i){let o=n.references;l(o)?BK(e,t,o,n.interval,i,tA,Tl):Ce(Array,e,t,n,void 0,void 0,i)}function TIe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)xIe(e,t,n[o],i);else xIe(e,t,n,i)}function _Ie(e,t,n,i){let o=n.references;l(o)?BK(e,t,o,n.interval,i,kg,bc):(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 Qk(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)_Ie(e,t,n[o],i);else _Ie(e,t,n,i)}function DMt(e){return h.unpackArray(e)}function OMt(e){return h.fromRadiansArrayHeights(e,ne.default)}function BMt(e){return h.fromDegreesArrayHeights(e,ne.default)}function SIe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return BK(a,"positions",s,n.interval,i,kg,bc),a.positions});e[t]=new kg(r)}else l(n.cartesian)?n.array=n.cartesian.map(DMt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(OMt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(BMt)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i)}function zMt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)SIe(e,t,n[o],i);else SIe(e,t,n,i)}function HMt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)gIe(e,t,n[o],i);else gIe(e,t,n,i)}function KMt(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 As),r.addInterval(jr(o[s]));else r=new As,r.addInterval(jr(o));e.availability=r}function JMt(e,t,n,i,o){l(t)&&Ce(GT,e,"alignedAxis",t,n,i,o)}function jMt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=jr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new xl),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(Oi,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(Zh,s,"rotation",o.rotation,r,i,n),JMt(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(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function QMt(e,t,n,i){let o=t.box;if(!l(o))return;let r=jr(o.interval),s=e.box;l(s)||(e.box=s=new VZ),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),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function qMt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=jr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new AZ),Ce(Boolean,s,"show",o.show,r,i,n),Qk(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(lo,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),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function $Mt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=jr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new GZ),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),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ewt(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 twt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=jr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new LZ),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(Zh,s,"rotation",o.rotation,r,i,n),Ce(Zh,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),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function nwt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=jr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new WZ),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),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function iwt(e,t,n,i){let o=t.label;if(!l(o))return;let r=jr(o.interval),s=e.label;l(s)||(e.label=s=new Mf),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(xr,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(Oi,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(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function owt(e,t,n,i){let o=t.model;if(!l(o))return;let r=jr(o.interval),s=e.model;l(s)||(e.model=s=new Ng),Ce(Boolean,s,"show",o.show,r,i,n),Ce(jk.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(Wn,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(dl,s,"colorBlendMode",o.colorBlendMode,r,i,n),Ce(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ce(Bt,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)ZIe(s,d[a],r,i,n);else ZIe(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)RIe(s,u[a],r,i,n);else RIe(s,u,r,i,n)}function ZIe(e,t,n,i,o){let r=jr(t.interval);l(n)&&(l(r)?r=Vn.intersect(r,n,xR):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 ad),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new vZ),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 RIe(e,t,n,i,o){let r=jr(t.interval);l(n)&&(l(r)?r=Vn.intersect(r,n,xR):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 ad),s.hasProperty(u)||s.addProperty(u),Ce(Number,s,u,m,r,i,o))}}function rwt(e,t,n,i){let o=t.path;if(!l(o))return;let r=jr(o.interval),s=e.path;l(s)||(e.path=s=new Yg),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),dm(s,"material",o.material,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(String,s,"relativeTo",o.relativeTo,r,i,n),Ce(Y0,s,"materialMode",o.materialMode,r,i,n)}function swt(e,t,n,i){let o=t.point;if(!l(o))return;let r=jr(o.interval),s=e.point;l(s)||(e.point=s=new IZ),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(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Jk(e){this.polygon=e,this._definitionChanged=new Se}Object.defineProperties(Jk.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}}});Jk.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 Wc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Wc(n,i)};Jk.prototype.equals=function(e){return this===e||e instanceof Jk&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function awt(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=jr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new wf),Ce(Boolean,s,"show",o.show,r,i,n),Qk(s,"_positions",o.positions,n),zMt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new Jk(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(Zh,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),dm(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(mn,s,"arcType",o.arcType,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function cwt(e){return e?mn.GEODESIC:mn.NONE}function lwt(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=jr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new _l),Ce(Boolean,s,"show",o.show,r,i,n),Qk(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),dm(s,"material",o.material,r,i,n),dm(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ce(mn,s,"arcType",o.arcType,r,i,n),Ce(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,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=VMt(a.followSurface,cwt)}}function dwt(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=jr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new PZ),Qk(s,"positions",o.positions,n),HMt(s,"shape",o.shape,n),Ce(Boolean,s,"show",o.show,r,i,n),Ce(lo,s,"cornerType",o.cornerType,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function uwt(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=jr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new kf),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(Zh,s,"rotation",o.rotation,r,i,n),Ce(Zh,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),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function mwt(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=jr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new FZ),Ce(Boolean,s,"show",o.show,r,i,n),Ce(jk.default,s,"uri",o.uri,r,i,n),Ce(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function hwt(e,t,n,i){let o=t.wall;if(!l(o))return;let r=jr(o.interval),s=e.wall;l(s)||(e.wall=s=new Mg),Ce(Boolean,s,"show",o.show,r,i,n),Qk(s,"positions",o.positions,n),TIe(s,"minimumHeights",o.minimumHeights,n),TIe(s,"maximumHeights",o.maximumHeights,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),dm(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(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function CIe(e,t,n,i,o){let r=e.id;if(l(r)||(r=$n()),oae=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")ewt(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)}oae=void 0}function fwt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(ot.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),c=Math.round(a/120);return t=new Nf,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=Vs.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 Nf,t.startTime=ot.MINIMUM_VALUE.clone(),t.stopTime=ot.MAXIMUM_VALUE.clone(),t.currentTime=ot.MINIMUM_VALUE.clone(),t.clockRange=Vs.LOOP_STOP,t.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=jr(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=Vs[n.range]??Vs.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 GIe(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),vs.setLoading(e,!0),Promise.resolve(o).then(function(a){return pwt(e,a,r,i)}).catch(function(a){return vs.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function pwt(e,t,n,i){vs.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new LIe,o.removeAll()),da._processCzml(t,o,n,void 0,e);let r=fwt(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),vs.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function LIe(){this.name=void 0,this.clock=void 0}function da(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 LIe,this._version=void 0,this._entityCollection=new Qa(this),this._entityCluster=new $u,this._credit=void 0,this._resourceCredits=[]}da.load=function(e,t){return new da().load(e,t)};Object.defineProperties(da.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}}});da.updaters=[jMt,QMt,qMt,$Mt,twt,nwt,iwt,owt,NMt,YMt,rwt,swt,awt,lwt,dwt,UMt,uwt,MMt,mwt,wMt,hwt,kMt,KMt];da.registerUpdater=function(e){da.updaters.includes(e)||da.updaters.push(e)};da.unregisterUpdater=function(e){if(da.updaters.includes(e)){let t=da.updaters.indexOf(e);da.updaters.splice(t,1)}};da.prototype.process=function(e,t){return GIe(this,e,t,!1)};da.prototype.load=function(e,t){return GIe(this,e,t,!0)};da.prototype.update=function(e){return!0};da.processPacketData=Ce;da.processPositionPacketData=AIe;da.processMaterialPacketData=dm;da._processCzml=function(e,t,n,i,o){if(i=i??da.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)CIe(e[r],t,i,n,o);else CIe(e,t,i,n,o)};var qk=da;var WCo=x(T(),1);function bd(){this._dataSources=[],this._dataSourceAdded=new Se,this._dataSourceRemoved=new Se,this._dataSourceMoved=new Se}Object.defineProperties(bd.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}}});bd.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})};bd.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};bd.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=[]};bd.prototype.contains=function(e){return this.indexOf(e)!==-1};bd.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};bd.prototype.get=function(e){return this._dataSources[e]};bd.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function zK(e,t){return e.indexOf(t)}function WIe(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)}bd.prototype.raise=function(e){let t=zK(this._dataSources,e);WIe(this,t,t+1)};bd.prototype.lower=function(e){let t=zK(this._dataSources,e);WIe(this,t,t-1)};bd.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))};bd.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))};bd.prototype.isDestroyed=function(){return!1};bd.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var $k=bd;var sNo=x(T(),1);var qFo=x(T(),1);var XCo=x(T(),1);function rA(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new kt}rA.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};rA.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};rA.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};rA.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};rA.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Wt.FAILED};var TR=rA;var o2o=x(T(),1);var qVo=x(T(),1);var hVo=x(T(),1);var UCo=x(T(),1);var cae={},HK=new h,vIe=new h,FIe=new Ne,IIe=new q;function sA(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),HK),h.multiplyByScalar(n,Math.sin(u),vIe),h.add(HK,vIe,HK);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(HK,f,FIe),q.fromQuaternion(FIe,IIe),q.multiplyByVector(IIe,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var PIe=new h,XIe=new h,aae=new h,bwt=new h;cae.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,PIe);i.scaleToGeodeticSurface(b,b);let f=h.clone(b,XIe),y=i.geodeticSurfaceNormal(b,bwt),_=h.multiplyByScalar(y,o,aae);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 gwt=new h,ywt=new h,xwt=new h;cae.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,gwt),b=h.cross(h.UNIT_Z,s,ywt);b=h.normalize(b,b);let f=h.cross(p,b,xwt),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=PIe,A=XIe,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=sA(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=sA(S,r,f,b,c,u,d,m,p,E),A=sA(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,aae),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=sA(-S,r,f,b,c,u,d,m,p,E),A=sA(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,aae),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=sA(-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 lu=cae;var aA=new h,lae=new h,dae=new h,NIe=new h,Wa=new k,YIe=new q,Twt=new q,uae=new Ne,MIe=new h,wIe=new h,kIe=new h,jK=new pe,UIe=new h,DIe=new k,OIe=new k;function BIe(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=MIe,Z=wIe,R=kIe,C=new Ui(a),E=C.project(a.cartesianToCartographic(o,jK),UIe),A=a.scaleToGeodeticSurface(o,aA);a.geodeticSurfaceNormal(A,A);let L=YIe,F=Twt;if(c!==0){let X=Ne.fromAxisAngle(A,c,uae);L=q.fromQuaternion(X,L),X=Ne.fromAxisAngle(A,-c,uae),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,DIe),N=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,OIe),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,M=h.fromArray(e,X,aA);if(i.st){let O=q.multiplyByVector(L,M,lae),w=C.project(a.cartesianToCartographic(O,jK),dae);h.subtract(w,E,w),Wa.x=(w.x+r)/(2*r),Wa.y=(w.y+s)/(2*s),I.x=Math.min(Wa.x,I.x),I.y=Math.min(Wa.y,I.y),N.x=Math.max(Wa.x,N.x),N.y=Math.max(Wa.y,N.y),n&&(m[_+G]=Wa.x,m[_+1+G]=Wa.y),m[_++]=Wa.x,m[_++]=Wa.y}(i.normal||i.tangent||i.bitangent||u)&&(S=a.geodeticSurfaceNormal(M,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 Cn;if(i.position){let X=lu.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===yn.TOP)X=X.fill(1,0,d/2);else{let Y=t.offsetAttribute===yn.NONE?0:1;X=X.fill(Y)}v.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:X})}return v}function zIe(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 _R=new h;function _wt(e){let t=e.center;_R=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,_R),e.height,_R),_R=h.add(t,_R,_R);let n=new me(_R,e.semiMajorAxis),i=lu.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=BIe(o,e,!1),a=zIe(r);return a=Oe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function Swt(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=MIe,C=wIe,E=kIe,A=new Ui(s),L=A.project(s.cartesianToCartographic(i,jK),UIe),F=s.scaleToGeodeticSurface(i,aA);s.geodeticSurfaceNormal(F,F);let I=Ne.fromAxisAngle(F,d,uae),N=q.fromQuaternion(I,YIe),g=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,DIe),V=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,OIe),G=e.length,v=G/3*2;for(let Y=0;Y<G;Y+=3){let D=Y+1,M=Y+2,O=h.fromArray(e,Y,aA),w;if(n.st){let K=q.multiplyByVector(N,O,lae),te=A.project(s.cartesianToCartographic(K,jK),dae);h.subtract(te,L,te),Wa.x=(te.x+o)/(2*o),Wa.y=(te.y+r)/(2*r),g.x=Math.min(Wa.x,g.x),g.y=Math.min(Wa.y,g.y),V.x=Math.max(Wa.x,V.x),V.y=Math.max(Wa.y,V.y),p[Z+v]=Wa.x,p[Z+1+v]=Wa.y,p[Z++]=Wa.x,p[Z++]=Wa.y}O=s.scaleToGeodeticSurface(O,O),w=h.clone(O,lae),R=s.geodeticSurfaceNormal(O,R),_&&(S[Y+G]=-R.x,S[D+G]=-R.y,S[M+G]=-R.z);let z=h.multiplyByScalar(R,a,NIe);if(O=h.add(O,z,O),z=h.multiplyByScalar(R,c,z),w=h.add(w,z,w),n.position&&(m[Y+G]=w.x,m[D+G]=w.y,m[M+G]=w.z,m[Y]=O.x,m[D]=O.y,m[M]=O.z),n.normal||n.tangent||n.bitangent){E=h.clone(R,E);let K=h.fromArray(e,(Y+3)%G,NIe);h.subtract(K,O,K);let te=h.subtract(w,O,dae);R=h.normalize(h.cross(te,K,R),R),n.normal&&(b[Y]=R.x,b[D]=R.y,b[M]=R.z,b[Y+G]=R.x,b[D+G]=R.y,b[M+G]=R.z),n.tangent&&(C=h.normalize(h.cross(E,R,C),C),f[Y]=C.x,f[D]=C.y,f[M]=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[M]=E.z,y[Y+G]=E.x,y[D+G]=E.y,y[M+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 Cn;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===yn.TOP)Y=Y.fill(1,0,u/2);else{let D=t.offsetAttribute===yn.NONE?0:1;Y=Y.fill(D)}X.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}return X}function Zwt(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 KK=new me,JK=new me;function Rwt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,aA),e.height,aA);KK.center=h.add(t,o,KK.center),KK.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),JK.center=h.add(t,o,JK.center),JK.radius=i;let r=lu.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=me.union(KK,JK),u=BIe(s,e,!0),m=zIe(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}),_=Swt(c,e);m=Zwt(c);let S=Oe.createTypedArray(c.length*2/3,m),Z=new At({attributes:_,indices:S,primitiveType:Ie.TRIANGLES}),R=zn.combineInstances([new Mt({geometry:y}),new Mt({geometry:Z})]);return{boundingSphere:d,attributes:R[0].attributes,indices:R[0].indices}}function HIe(e,t,n,i,o,r,s){let c=lu.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 w0(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??Me.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=Me.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}w0.packedLength=h.packedLength+ne.packedLength+Me.packedLength+9;w0.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 KIe=new h,JIe=new ne,jIe=new Me,M0={center:KIe,ellipsoid:JIe,vertexFormat:jIe,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};w0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,KIe);t+=h.packedLength;let o=ne.unpack(e,t,JIe);t+=ne.packedLength;let r=Me.unpack(e,t,jIe);t+=Me.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=Me.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):(M0.height=u,M0.extrudedHeight=p,M0.granularity=m,M0.stRotation=d,M0.rotation=c,M0.semiMajorAxis=s,M0.semiMinorAxis=a,M0.shadowVolume=b,M0.offsetAttribute=f===-1?void 0:f,new w0(M0))};w0.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 HIe(n,o,r,a,s,i,t)};w0.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=Rwt(o);else if(r=_wt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===yn.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})};w0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new w0({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};function Cwt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=lu.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(w0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=HIe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Cwt(this)),this._textureCoordinateRotationPoints}}});var gd=w0;var GVo=x(T(),1);var QIe=new h,SR=new h;function Vwt(e){let t=e.center;SR=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,SR),e.height,SR),SR=h.add(t,SR,SR);let n=new me(SR,e.semiMajorAxis),i=lu.computeEllipsePositions(e,!1,!0).outerPositions,o=new Cn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:lu.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 QK=new me,qK=new me;function Ewt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,QIe),e.height,QIe);QK.center=h.add(t,o,QK.center),QK.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),qK.center=h.add(t,o,qK.center),qK.radius=i;let r=lu.computeEllipsePositions(e,!1,!0).outerPositions,s=new Cn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:lu.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=me.union(QK,qK),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===yn.TOP)f=f.fill(1,0,c/2);else{let y=e.offsetAttribute===yn.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 cA(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"}cA.packedLength=h.packedLength+ne.packedLength+8;cA.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 qIe=new h,$Ie=new ne,my={center:qIe,ellipsoid:$Ie,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};cA.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,qIe);t+=h.packedLength;let o=ne.unpack(e,t,$Ie);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):(my.height=c,my.extrudedHeight=u,my.granularity=d,my.rotation=a,my.semiMajorAxis=r,my.semiMinorAxis=s,my.numberOfVerticalLines=m,my.offsetAttribute=p===-1?void 0:p,new cA(my))};cA.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=Ewt(o);else if(r=Vwt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===yn.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 um=cA;var ePe=new U,tPe=h.ZERO,nPe=new h,iPe=new re;function Awt(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 ip(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Awt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(ip.prototype=Object.create(ri.prototype),ip.prototype.constructor=ip);ip.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:oi.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,ePe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,tPe,nPe))),new Mt({id:t,geometry:new gd(this._options),attributes:i})};ip.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,ePe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,tPe,nPe))),new Mt({id:t,geometry:new um(this._options),attributes:r})};ip.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};ip.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Fi.prototype._isHidden.call(this,e,t)};ip.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)};ip.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),o=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(ot.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(ot.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(ot.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=j.getValueOrUndefined(t.rotation,ot.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),s.stRotation=j.getValueOrUndefined(t.stRotation,ot.MINIMUM_VALUE),s.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,ot.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=Xi.getMinimumMaximumHeights(gd.computeRectangle(s,iPe)).minimumTerrainHeight),s.extrudedHeight=o};ip.DynamicGeometryUpdater=lA;function lA(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(lA.prototype=Object.create(vi.prototype),lA.prototype.constructor=lA);lA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||vi.prototype._isHidden.call(this,e,t,n)};lA.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=Xi.getMinimumMaximumHeights(gd.computeRectangle(i,iPe)).minimumTerrainHeight),i.extrudedHeight=s};var eU=ip;var CEo=x(T(),1);var Gwt=new Qt(U.WHITE),mae=h.ZERO,hae=new h,Lwt=new h,Wwt=new h,fae=new U,vwt=new h(1,1,1);function Fwt(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 mm(e,t){Fi.call(this,{entity:e,scene:t,geometryOptions:new Fwt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(mm.prototype=Object.create(Fi.prototype),mm.prototype.constructor=mm);Object.defineProperties(mm.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});mm.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new vn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=oi.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,fae)),l(u)||(u=U.WHITE),r=$t.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,mae,hae))),new Mt({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})};mm.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,fae),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new vn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(r),distanceDisplayCondition:oi.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,mae,hae))),new Mt({id:i,geometry:new ku(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};mm.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};mm.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Fi.prototype._isHidden.call(this,e,t)};mm.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)};mm.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(ot.MINIMUM_VALUE,i.radii),i.innerRadii=j.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=j.getValueOrUndefined(t.minimumClock,ot.MINIMUM_VALUE),i.maximumClock=j.getValueOrUndefined(t.maximumClock,ot.MINIMUM_VALUE),i.minimumCone=j.getValueOrUndefined(t.minimumCone,ot.MINIMUM_VALUE),i.maximumCone=j.getValueOrUndefined(t.maximumCone,ot.MINIMUM_VALUE),i.stackPartitions=j.getValueOrUndefined(t.stackPartitions,ot.MINIMUM_VALUE),i.slicePartitions=j.getValueOrUndefined(t.slicePartitions,ot.MINIMUM_VALUE),i.subdivisions=j.getValueOrUndefined(t.subdivisions,ot.MINIMUM_VALUE),i.offsetAttribute=n!==He.NONE?yn.ALL:void 0};mm.prototype._onEntityPropertyChanged=ry;mm.DynamicGeometryUpdater=tU;function tU(e,t,n){vi.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)&&(tU.prototype=Object.create(vi.prototype),tU.prototype.constructor=tU);tU.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,Lwt),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,fae),c=Cr.getValue(e,n.material??Gwt,this._material),d=j.getValueOrUndefined(n.innerRadii,e,Wwt),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?yn.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,mae,hae);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?vwt: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 Vo({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 Pn({geometryInstances:v,appearance:G,asynchronous:!1,shadows:L}));let X=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=V.add(new Pn({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=vn.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=vn.toValue(s,X.show),this._lastOutlineShow=s),U.equals(a,this._lastOutlineColor)||(X.color=$t.toValue(a,X.color),U.clone(a,this._lastOutlineColor)),Bt.equals(I,this._lastDistanceDisplayCondition)||(v.distanceDisplayCondition=oi.toValue(I,v.distanceDisplayCondition),X.distanceDisplayCondition=oi.toValue(I,X.distanceDisplayCondition),Bt.clone(I,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(v.offset=Co.toValue(N,v.offset),X.offset=Co.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 nU=mm;var fAo=x(T(),1);var NEo=x(T(),1);function dA(e){e=e??B.EMPTY_OBJECT;let t=e.vertexFormat??Me.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}dA.packedLength=Me.packedLength;dA.pack=function(e,t,n){return n=n??0,Me.pack(e._vertexFormat,t,n),t};var oPe=new Me,Iwt={vertexFormat:oPe};dA.unpack=function(e,t,n){t=t??0;let i=Me.unpack(e,t,oPe);return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n):new dA(Iwt)};var $K=new h(-.5,-.5,0),eJ=new h(.5,.5,0);dA.createGeometry=function(e){let t=e._vertexFormat,n=new Cn,i,o;if(t.position){if(o=new Float64Array(12),o[0]=$K.x,o[1]=$K.y,o[2]=0,o[3]=eJ.x,o[4]=$K.y,o[5]=0,o[6]=eJ.x,o[7]=eJ.y,o[8]=0,o[9]=$K.x,o[10]=eJ.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 me(h.ZERO,Math.sqrt(2))})};var iU=dA;var HEo=x(T(),1);function uA(){this._workerName="createPlaneOutlineGeometry"}uA.packedLength=0;uA.pack=function(e,t){return t};uA.unpack=function(e,t,n){return l(n)?n:new uA};var LT=new h(-.5,-.5,0),tJ=new h(.5,.5,0);uA.createGeometry=function(){let e=new Cn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=LT.x,n[1]=LT.y,n[2]=LT.z,n[3]=tJ.x,n[4]=LT.y,n[5]=LT.z,n[6]=tJ.x,n[7]=tJ.y,n[8]=LT.z,n[9]=LT.x,n[10]=tJ.y,n[11]=LT.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 me(h.ZERO,Math.sqrt(2))})};var oU=uA;var Pwt=new h,rPe=new U;function Xwt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Rh(e,t){Fi.call(this,{entity:e,scene:t,geometryOptions:new Xwt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Rh.prototype=Object.create(Fi.prototype),Rh.prototype.constructor=Rh);Rh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=oi.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let b;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(b=this._materialProperty.color.getValue(e,rPe)),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=pae(m,p,u,u),new Mt({id:t,geometry:new iU(this._options),modelMatrix:u,attributes:i})};Rh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,rPe),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=pae(c,d,a,a),new Mt({id:t,geometry:new oU,modelMatrix:a,attributes:{show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o)}})};Rh.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Fi.prototype._isHidden.call(this,e,t)};Rh.prototype._getIsClosed=function(e){return!1};Rh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};Rh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=this._options;i.vertexFormat=n?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(ot.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(ot.MINIMUM_VALUE,i.dimensions)};Rh.DynamicGeometryUpdater=mA;function mA(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(mA.prototype=Object.create(vi.prototype),mA.prototype.constructor=mA);mA.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,Pwt);return!l(o)||!l(i.plane)||!l(i.dimensions)||vi.prototype._isHidden.call(this,e,t,n)};mA.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 Nwt=new h,Ywt=new h,Mwt=new h,wwt=new h,kwt=new q,Uwt=new q,Dwt=new P;function pae(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,Mwt),a=h.clone(h.UNIT_Z,Ywt);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,Nwt);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=kwt;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,wwt),m=q.multiplyByScale(d,u,Uwt),p=P.fromRotationTranslation(m,s,Dwt);return P.multiplyTransformation(n,p,i)}Rh.createPrimitiveMatrix=pae;var rU=Rh;var XGo=x(T(),1);var MAo=x(T(),1);var Owt=new h,Bwt=new nt,zwt=new k,Hwt=new k,Kwt=new h,Jwt=new h,jwt=new h,sU=new h,Qwt=new h,qwt=new h,sPe=new Ne,$wt=new q,e9t=new q,t9t=new h;function n9t(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=$wt;if(i!==0){let g=Ne.fromAxisAngle(s,i,sPe);if(p=q.fromQuaternion(g,p),t.tangent||t.bitangent){g=Ne.fromAxisAngle(s,-i,sPe);let V=q.fromQuaternion(g,e9t);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=Hwt;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,Owt),v=r(G,zwt);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 Cn;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 ZR(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Me.DEFAULT;this._vertexFormat=Me.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=ii.computeHierarchyPackedLength(t,h)+Me.packedLength+ne.packedLength+(l(n)?ii.computeHierarchyPackedLength(n,k):1)+2}ZR.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 ZR(t)};ZR.pack=function(e,t,n){return n=n??0,n=ii.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ii.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n]=e.packedLength,t};var i9t=ne.clone(ne.UNIT_SPHERE),o9t=new Me,r9t={polygonHierarchy:{}};ZR.unpack=function(e,t,n){t=t??0;let i=ii.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,i9t);t+=ne.packedLength;let r=Me.unpack(e,t,o9t);t+=Me.packedLength;let s=e[t++],a=e[t]===-1?void 0:ii.unpackPolygonHierarchy(e,t,k);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new ZR(r9t)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};ZR.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Mo(s,h.equalsEpsilon,!0),s.length<3)return;let a=Kwt,c=Jwt,d=jwt,u=Qwt,m=qwt;if(!ig.computeProjectTo2DArguments(s,sU,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(sU,h.ZERO,W.EPSILON6)){let I=e._ellipsoid.geodeticSurfaceNormal(sU,t9t);h.dot(a,I)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let b=ig.createProjectPointsTo2DFunction(sU,u,m),f=ig.createProjectPointTo2DFunction(sU,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(d=h.clone(m,d));let y=ii.polygonsFromHierarchy(n,r,b,!1),_=y.hierarchy,S=y.polygons,Z=function(I){return I},R=r?ii.polygonsFromHierarchy(o,!0,Z,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let C=me.fromPoints(s),E=ii.computeBoundingRectangle(a,f,s,i,Bwt),A=[];for(let I=0;I<S.length;I++){let N=new Mt({geometry:n9t(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 aU=ZR;var aGo=x(T(),1);var aPe=[],nJ=[];function s9t(e,t,n,i,o){let s=Ms.fromPoints(t,e).projectPointsOntoPlane(t,aPe);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===mn.GEODESIC)for(d=0;d<u;d++)f+=ii.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===mn.RHUMB)for(d=0;d<u;d++)f+=ii.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let y;o===mn.GEODESIC?y=ii.subdivideLine(t[d],t[(d+1)%u],n,nJ):o===mn.RHUMB&&(y=ii.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,nJ));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 Mt({geometry:new At({attributes:new Cn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:b,primitiveType:Ie.LINES})})}function a9t(e,t,n,i,o){let s=Ms.fromPoints(t,e).projectPointsOntoPlane(t,aPe);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===mn.GEODESIC)for(d=0;d<u;d++)_+=ii.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===mn.RHUMB)for(d=0;d<u;d++)_+=ii.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===mn.GEODESIC?S=ii.subdivideLine(t[d],t[(d+1)%u],n,nJ):o===mn.RHUMB&&(S=ii.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,nJ));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 Mt({geometry:new At({attributes:new Cn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Ie.LINES})})}function RR(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??mn.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=ii.computeHierarchyPackedLength(t,h)+ne.packedLength+8}RR.pack=function(e,t,n){return n=n??0,n=ii.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 c9t=ne.clone(ne.UNIT_SPHERE),l9t={polygonHierarchy:{}};RR.unpack=function(e,t,n){t=t??0;let i=ii.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,c9t);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 RR(l9t)),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};RR.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 RR(t)};RR.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=ii.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=a9t(t,s[f],d,o,r),a.geometry=ii.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===yn.TOP?Z=Z.fill(1,0,S/2):(b=e._offsetAttribute===yn.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=s9t(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===yn.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],_=me.fromVertices(y.attributes.position.values);return new At({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var cU=RR;var cPe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",lPe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",dPe=new U,uPe=h.ZERO,mPe=new h,hPe=new re,d9t=[],u9t=new k;function m9t(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 hm(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new m9t(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(hm.prototype=Object.create(ri.prototype),hm.prototype.constructor=hm);hm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:oi.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,dPe)),l(s)||(s=U.WHITE),o.color=$t.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,uPe,mPe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new aU(i):r=new zp(i),new Mt({id:t,geometry:r,attributes:o})};hm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,dPe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(o),distanceDisplayCondition:oi.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,uPe,mPe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new qm(i):a=new cU(i),new Mt({id:t,geometry:a,attributes:s})};hm.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=Ms.fromPoints(i,o),s=r.projectPointsOntoPlane(i,d9t),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,u9t);_=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)};hm.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Fi.prototype._isHidden.call(this,e,t)};hm.prototype._isOnTerrain=function(e,t){let n=ri.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(ot.MINIMUM_VALUE):!0);return n&&!o};hm.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)};hm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=this._options;i.vertexFormat=n?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(ot.MINIMUM_VALUE),r=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),s=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),a=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),c=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE),d=j.getValueOrDefault(t.perPositionHeight,ot.MINIMUM_VALUE,!1);r=ri.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,xt(cPe)),s!==He.NONE&&d&&(r=void 0,xt(lPe))):(l(a)&&!l(r)&&(r=0),u=ri.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),i.stRotation=j.getValueOrUndefined(t.stRotation,ot.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=j.getValueOrDefault(t.closeTop,ot.MINIMUM_VALUE,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,ot.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=j.getValueOrDefault(t.arcType,ot.MINIMUM_VALUE,mn.GEODESIC),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,ot.MINIMUM_VALUE),a=ri.getGeometryExtrudedHeight(a,c),a===ri.CLAMP_TO_GROUND){let m=zp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,hPe);a=Xi.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};hm.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)};hm.DynamicGeometryUpdater=hA;function hA(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(hA.prototype=Object.create(vi.prototype),hA.prototype.constructor=hA);hA.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||vi.prototype._isHidden.call(this,e,t,n)};hA.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(cPe)),r!==He.NONE&&c&&(o=void 0,xt(lPe))):(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,mn.GEODESIC),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND){let u=zp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,hPe);a=Xi.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var lU=hm;var OLo=x(T(),1);var sLo=x(T(),1);function h9t(e,t,n,i){let o=new Cn;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:me.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 uU(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??lo.ROUNDED,this._vertexFormat=Me.clone(e.vertexFormat??Me.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+Me.packedLength+2}uU.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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var fPe=ne.clone(ne.UNIT_SPHERE),pPe=new Me,dU={polylinePositions:void 0,shapePositions:void 0,ellipsoid:fPe,vertexFormat:pPe,cornerType:void 0,granularity:void 0};uU.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,fPe);t+=ne.packedLength;let c=Me.unpack(e,t,pPe);t+=Me.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=Me.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(dU.polylinePositions=r,dU.shapePositions=s,dU.cornerType=d,dU.granularity=u,new uU(dU))};var f9t=new nt;uU.createGeometry=function(e){let t=e._positions,n=Mo(t,h.equalsEpsilon),i=e._shape;if(i=$f.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,f9t),r=$f.computePositions(n,i,o,e,!0);return h9t(r,i,o,e._vertexFormat)};var mU=uU;var ELo=x(T(),1);function p9t(e,t){let n=new Cn;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:me.fromVertices(e),primitiveType:Ie.LINES})}function fU(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??lo.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}fU.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 bPe=ne.clone(ne.UNIT_SPHERE),hU={polylinePositions:void 0,shapePositions:void 0,ellipsoid:bPe,height:void 0,cornerType:void 0,granularity:void 0};fU.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,bPe);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):(hU.polylinePositions=r,hU.shapePositions=s,hU.cornerType=c,hU.granularity=d,new fU(hU))};var b9t=new nt;fU.createGeometry=function(e){let t=e._positions,n=Mo(t,h.equalsEpsilon),i=e._shape;if(i=$f.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,b9t),r=$f.computePositions(n,i,o,e,!1);return p9t(r,i)};var pU=fU;var gPe=new U;function g9t(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 k0(e,t){Fi.call(this,{entity:e,scene:t,geometryOptions:new g9t(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(k0.prototype=Object.create(Fi.prototype),k0.prototype.constructor=k0);k0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=oi.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,gPe)),l(c)||(c=U.WHITE),o=$t.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Mt({id:t,geometry:new mU(this._options),attributes:i})};k0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,gPe),o=this._distanceDisplayConditionProperty.getValue(e);return new Mt({id:t,geometry:new pU(this._options),attributes:{show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o)}})};k0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Fi.prototype._isHidden.call(this,e,t)};k0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!j.isConstant(t.granularity)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)};k0.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:Vo.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(ot.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(ot.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(ot.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(ot.MINIMUM_VALUE):void 0};k0.DynamicGeometryUpdater=fA;function fA(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(fA.prototype=Object.create(vi.prototype),fA.prototype.constructor=fA);fA.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||vi.prototype._isHidden.call(this,e,t,n)};fA.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 bU=k0;var kWo=x(T(),1);var bWo=x(T(),1);var bae=new h,TPe=new h,_Pe=new h,SPe=new h,ZPe=new re,y9t=new k,x9t=new me,T9t=new me;function RPe(e,t){let n=new At({attributes:new Cn,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 _9t(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=SPe,u=_Pe,m=TPe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let b=h.fromArray(e,p,bae),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 RPe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var gae=new h,CPe=new h;function S9t(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=SPe,p=_Pe,b=TPe;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let y=h.fromArray(e,f,bae),_=h.fromArray(e,(f+6)%i,gae);if(u){let S=h.fromArray(e,(f+3)%i,CPe);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 RPe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function VPe(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,_=bae,S=y9t,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=_9t(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 pA(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 bA(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 yae=new Me;function Z9t(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=Me.clone(o,yae);We.normal=!0,e._vertexFormat=We}let m=VPe(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===yn.TOP?Ke=Ke.fill(1,0,We/2):(L=i===yn.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,M=4,O=4;G&&(Y-=1,X-=1,D+=1,M-=2,O-=1),v&&(Y-=1,X-=1,D+=1,M-=2,O-=1),D+=Y*d+2*X-M;let w=(D+O)*2,z=new Float64Array(w*3),K=n?new Float32Array(w*3):void 0,te=F?new Uint8Array(w):void 0,H=o.st?new Float32Array(w*2):void 0,$=i===yn.TOP;F&&!$&&(L=i===yn.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=pA(z,ee,ye,p,_),ee+=6,o.st&&(H=bA(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=pA(z,ee,ye,p,_),ee+=6,o.st&&(H=bA(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=pA(z,ee,ye,p,_),ee+=6,o.st&&(H=bA(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=pA(z,ee,ye,p,_),ee+=6,o.st&&(H=bA(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=pA(z,ee,ye,p,_),ee+=6,o.st&&(H=bA(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=pA(z,ee,ye,p,_),ee+=6,o.st&&(H=bA(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=S9t(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(w,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,gae),Ke=h.fromArray(z,je*3,CPe);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 Mt({geometry:m}),new Mt({geometry:Ge})]),Ge[0]}var R9t=[new h,new h,new h,new h],EPe=new pe,C9t=new pe;function xae(e,t,n,i,o){if(n===0)return re.clone(e,o);let r=Ca.computeOptions(e,t,n,0,ZPe,EPe),s=r.height,a=r.width,c=R9t;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 U0(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=Me.clone(e.vertexFormat??Me.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}U0.packedLength=re.packedLength+ne.packedLength+Me.packedLength+7;U0.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,Me.pack(e._vertexFormat,t,n),n+=Me.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 APe=new re,GPe=ne.clone(ne.UNIT_SPHERE),WT={rectangle:APe,ellipsoid:GPe,vertexFormat:yae,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};U0.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,APe);t+=re.packedLength;let o=ne.unpack(e,t,GPe);t+=ne.packedLength;let r=Me.unpack(e,t,yae);t+=Me.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=Me.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):(WT.granularity=s,WT.height=a,WT.rotation=c,WT.stRotation=d,WT.extrudedHeight=u,WT.shadowVolume=m,WT.offsetAttribute=p===-1?void 0:p,new U0(WT))};U0.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 xae(n,i,r,o,t)};var V9t=new q,yPe=new Ne,E9t=new pe;U0.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,ZPe,EPe,C9t),a=V9t;if(o!==0||i!==0){let b=re.center(t,E9t),f=n.geodeticSurfaceNormalCartographic(b,gae);Ne.fromAxisAngle(f,-o,yPe),q.fromQuaternion(yPe,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=Z9t(e,s);let b=me.fromRectangle3D(t,n,c,T9t),f=me.fromRectangle3D(t,n,d,x9t);p=me.union(b,f)}else{if(m=VPe(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===yn.NONE?0:1,y=new Uint8Array(b/3).fill(f);m.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=me.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})};U0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new U0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};var xPe=new re,A9t=[new k,new k,new k],G9t=new Ji,L9t=new pe;function W9t(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=re.clone(e._rectangle,xPe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=xae(t,n,o,i,xPe),s=A9t;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,G9t),d=re.center(a,L9t);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(U0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=xae(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=W9t(this)),this._textureCoordinateRotationPoints}}});var CR=U0;var LPe=new U,WPe=h.ZERO,vPe=new h,FPe=new re,v9t=new re,F9t=new pe;function I9t(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 op(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new I9t(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(op.prototype=Object.create(ri.prototype),op.prototype.constructor=op);op.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:oi.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,LPe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,WPe,vPe))),new Mt({id:t,geometry:new CR(this._options),attributes:i})};op.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,LPe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Co.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,WPe,vPe))),new Mt({id:t,geometry:new TS(this._options),attributes:r})};op.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.rectangle.coordinates,e,v9t);if(!l(n))return;let i=re.center(n,F9t);return pe.toCartesian(i,ne.default,t)};op.prototype._isHidden=function(e,t){return!l(t.coordinates)||Fi.prototype._isHidden.call(this,e,t)};op.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)};op.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),o=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),r=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),s=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?Tn.VERTEX_FORMAT:Vo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(ot.MINIMUM_VALUE,a.rectangle),a.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),a.stRotation=j.getValueOrUndefined(t.stRotation,ot.MINIMUM_VALUE),a.rotation=j.getValueOrUndefined(t.rotation,ot.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=Xi.getMinimumMaximumHeights(CR.computeRectangle(a,FPe)).minimumTerrainHeight),a.extrudedHeight=r};op.DynamicGeometryUpdater=gA;function gA(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(gA.prototype=Object.create(vi.prototype),gA.prototype.constructor=gA);gA.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||vi.prototype._isHidden.call(this,e,t,n)};gA.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=Xi.getMinimumMaximumHeights(CR.computeRectangle(i,FPe)).minimumTerrainHeight),i.extrudedHeight=s};var gU=op;var Dvo=x(T(),1);var uvo=x(T(),1);var JWo=x(T(),1);var IPe={};function P9t(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var X9t=new pe,N9t=new pe;function Y9t(e,t,n,i){t=Mo(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,X9t);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,N9t);s&&(Z.height=n[_]),f=f&&Z.height===0,P9t(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 M9t=new Array(2),w9t=new Array(2),k9t={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};IPe.computePositions=function(e,t,n,i,o,r){let s=Y9t(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=k9t;if(p.minDistance=m,p.ellipsoid=e,r){let b=0,f;for(f=0;f<a-1;f++)b+=so.numberOfPoints(t[f],t[f+1],m)+1;d=new Float64Array(b*3),u=new Float64Array(b*3);let y=M9t,_=w9t;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=so.generateArc(p);d.set(Z,S),_[0]=i[f],_[1]=i[f+1],u.set(so.generateArc(p),S),S+=Z.length}}else p.positions=t,p.height=n,d=new Float64Array(so.generateArc(p)),p.height=i,u=new Float64Array(so.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var VR=IPe;var Tae=new h,iJ=new h,U9t=new h,PPe=new h,D9t=new h,O9t=new h,B9t=new h;function ER(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??Me.DEFAULT,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Me.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+Me.packedLength+1}ER.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,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._granularity,t};var XPe=ne.clone(ne.UNIT_SPHERE),NPe=new Me,yU={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:XPe,vertexFormat:NPe,granularity:void 0};ER.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,XPe);t+=ne.packedLength;let d=Me.unpack(e,t,NPe);t+=Me.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=Me.clone(d,n._vertexFormat),n._granularity=u,n):(yU.positions=r,yU.minimumHeights=s,yU.maximumHeights=a,yU.granularity=u,new ER(yU))};ER.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 ER(c)};ER.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=VR.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=B9t,F=O9t,I=D9t,N=!0;m/=3;let g,V=0,G=1/(m-u-1);for(g=0;g<m;++g){let M=g*3,O=h.fromArray(d,M,Tae),w=h.fromArray(c,M,iJ);if(o.position&&(b[Z++]=w.x,b[Z++]=w.y,b[Z++]=w.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,PPe),K=h.subtract(O,s.geodeticSurfaceNormal(O,iJ),iJ);if(g+1<m&&(z=h.fromArray(d,M+3,PPe)),N){let te=h.subtract(z,O,U9t),H=h.subtract(K,O,Tae);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 Cn;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 M=g,O=g+2,w=h.fromArray(b,M*3,Tae),z=h.fromArray(b,O*3,iJ);if(h.equalsEpsilon(w,z,W.EPSILON10))continue;let K=g+1,te=g+3;Y[D++]=K,Y[D++]=M,Y[D++]=te,Y[D++]=te,Y[D++]=M,Y[D++]=O}return new At({attributes:v,indices:Y,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromVertices(b)})};var xU=ER;var Vvo=x(T(),1);var YPe=new h,MPe=new h;function AR(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}AR.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 wPe=ne.clone(ne.UNIT_SPHERE),TU={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:wPe,granularity:void 0};AR.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,wPe);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):(TU.positions=r,TU.minimumHeights=s,TU.maximumHeights=a,TU.granularity=d,new AR(TU))};AR.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 AR(c)};AR.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=VR.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,YPe),C=h.fromArray(a,Z,MPe);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 Cn({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,YPe),E=h.fromArray(m,R*3,MPe);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:me.fromVertices(m)})};var _U=AR;var kPe=new U;function z9t(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 rp(e,t){Fi.call(this,{entity:e,scene:t,geometryOptions:new z9t(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(rp.prototype=Object.create(Fi.prototype),rp.prototype.constructor=rp);rp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=oi.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,kPe)),l(c)||(c=U.WHITE),o=$t.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Mt({id:t,geometry:new xU(this._options),attributes:i})};rp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,kPe),o=this._distanceDisplayConditionProperty.getValue(e);return new Mt({id:t,geometry:new _U(this._options),attributes:{show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:oi.fromDistanceDisplayCondition(o)}})};rp.prototype._isHidden=function(e,t){return!l(t.positions)||Fi.prototype._isHidden.call(this,e,t)};rp.prototype._getIsClosed=function(e){return!1};rp.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)};rp.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:Vo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ot.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(ot.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(ot.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(ot.MINIMUM_VALUE):void 0};rp.DynamicGeometryUpdater=yA;function yA(e,t,n){vi.call(this,e,t,n)}l(Object.create)&&(yA.prototype=Object.create(vi.prototype),yA.prototype.constructor=yA);yA.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||vi.prototype._isHidden.call(this,e,t,n)};yA.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 SU=rp;var GR=[Lk,Uk,Yk,eU,nU,rU,lU,bU,gU,SU];function LR(e,t){this.entity=e,this.scene=t;let n=new Array(GR.length),i=new Se,o=new Jr;for(let r=0;r<n.length;r++){let s=new GR[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(LR.prototype._onEntityPropertyChanged,this)}LR.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)};LR.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};LR.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)};LR.registerUpdater=function(e){GR.includes(e)||GR.push(e)};LR.unregisterUpdater=function(e){if(GR.includes(e)){let t=GR.indexOf(e);GR.splice(t,1)}};var WR=LR;var T2o=x(T(),1);var UPe=new U,H9t=new Bt,K9t=new Bt,J9t=h.ZERO,j9t=new h;function sp(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(sp.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}sp.prototype.onMaterialChanged=function(){this.invalidated=!0};sp.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};sp.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)}))}};sp.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};sp.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=Cr.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 Pn({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=Cr.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,UPe);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,UPe);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=vn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,K9t,H9t);Bt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=oi.toValue(_,m.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,J9t,j9t);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Co.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};sp.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=vn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};sp.prototype.contains=function(e){return this.updaters.contains(e.id)};sp.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)};sp.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 xA(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}xA.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 sp(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function DPe(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}xA.prototype.remove=function(e){DPe(this._solidItems,e)||DPe(this._translucentItems,e)};function OPe(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 oJ(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}xA.prototype.update=function(e){let t=oJ(this,this._solidItems,e,!0);t=oJ(this,this._translucentItems,e,t)&&t;let n=OPe(this,this._solidItems,e),i=OPe(this,this._translucentItems,e);return(n||i)&&(t=oJ(this,this._solidItems,e,t)&&t,t=oJ(this,this._translucentItems,e,t)&&t),t};function BPe(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}xA.prototype.getBoundingSphere=function(e,t){let n=BPe(this._solidItems,e,t);return n===Wt.FAILED?BPe(this._translucentItems,e,t):n};function zPe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}xA.prototype.removeAllPrimitives=function(){zPe(this._solidItems),zPe(this._translucentItems)};var Ch=xA;var X2o=x(T(),1);var Q9t=new Bt,q9t=new Bt,$9t=h.ZERO,ekt=new h;function ap(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 kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(ap.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt}ap.prototype.onMaterialChanged=function(){this.invalidated=!0};ap.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};ap.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};ap.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 tkt=new U;ap.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=Cr.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=Cr.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 Pn({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=Cr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Qt)&&(this.depthFailMaterial=Cr.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,tkt);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=vn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,q9t,Q9t);Bt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=oi.toValue(_,m.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,$9t,ekt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Co.toValue(_,m.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};ap.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=vn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};ap.prototype.contains=function(e){return this.updaters.contains(e.id)};ap.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)};ap.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 TA(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}TA.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 ap(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};TA.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}}};TA.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};TA.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};TA.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 Vh=TA;var iFo=x(T(),1);var O2o=x(T(),1);var k2o=x(T(),1);var Y2o=x(T(),1);function rJ(e,t,n=0,i=e.length-1,o=nkt){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));rJ(e,t,b,f,o)}let r=e[t],s=n,a=i;for(ZU(e,n,t),o(e[i],r)>0&&ZU(e,n,i);s<a;){for(ZU(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?ZU(e,n,a):(a++,ZU(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function ZU(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function nkt(e,t){return e<t?-1:e>t?1:0}var VU=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(!aJ(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;aJ(t,c)&&(n.leaf?i.push(a):Sae(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!aJ(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(aJ(t,s)){if(n.leaf||Sae(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=SA([]),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=ikt(t,i.children,n);if(u!==-1)return i.children.splice(u,1),r.push(i),this._condense(r),this}!d&&!i.leaf&&Sae(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=SA(t.slice(n,i+1)),_A(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=SA([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),d=c*Math.ceil(Math.sqrt(s));HPe(t,n,i,d,this.compareMinX);for(let u=n;u<=i;u+=d){let m=Math.min(u+d-1,i);HPe(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 _A(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=_ae(d),m=skt(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),CU(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=SA(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,_A(i,this.toBBox),_A(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=SA([t,n]),this.data.height=t.height+1,this.data.leaf=!1,_A(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=RU(t,0,a,this.toBBox),d=RU(t,a,i,this.toBBox),u=akt(c,d),m=_ae(c)+_ae(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:okt,r=t.leaf?this.compareMinY:rkt,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=RU(t,0,n,r),a=RU(t,i-n,i,r),c=sJ(s)+sJ(a);for(let d=n;d<i-n;d++){let u=t.children[d];CU(s,t.leaf?r(u):u),c+=sJ(s)}for(let d=i-n-1;d>=n;d--){let u=t.children[d];CU(a,t.leaf?r(u):u),c+=sJ(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)CU(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():_A(t[n],this.toBBox)}};function ikt(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 _A(e,t){RU(e,0,e.children.length,t,e)}function RU(e,t,n,i,o){o||(o=SA(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];CU(o,e.leaf?i(s):s)}return o}function CU(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 okt(e,t){return e.minX-t.minX}function rkt(e,t){return e.minY-t.minY}function _ae(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function sJ(e){return e.maxX-e.minX+(e.maxY-e.minY)}function skt(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 akt(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 Sae(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function aJ(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function SA(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function HPe(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;rJ(e,s,t,n,o),r.push(t,s,s,n)}}function cJ(){this._tree=new VU}function vR(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}vR.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};cJ.prototype.insert=function(e,t){let n=vR.fromRectangleAndId(e,t,new vR);this._tree.insert(n)};function ckt(e,t){return e.id===t.id}var lkt=new vR;cJ.prototype.remove=function(e,t){let n=vR.fromRectangleAndId(e,t,lkt);this._tree.remove(n,ckt)};var dkt=new vR;cJ.prototype.collides=function(e){let t=vR.fromRectangleAndId("",e,dkt);return this._tree.collides(t)};var FR=cJ;var ukt=new U,mkt=new Bt,hkt=new Bt;function hy(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new FR}hy.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};hy.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)}))}};hy.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};hy.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 id({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,ukt);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=vn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,hkt,mkt);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=oi.toValue(y,m.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};hy.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=vn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};hy.prototype.contains=function(e){return this.updaters.contains(e.id)};hy.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};hy.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 ZA(e,t){this._batches=[],this._primitives=e,this._classificationType=t}ZA.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 hy(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};ZA.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};ZA.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};ZA.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};ZA.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var RA=ZA;var gFo=x(T(),1);var fkt=new Bt,pkt=new Bt;function D0(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new FR}D0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};D0.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)};D0.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};D0.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};D0.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=Cr.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new id({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=Cr.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=vn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,pkt,fkt);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=oi.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};D0.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=vn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};D0.prototype.contains=function(e){return this.updaters.contains(e.id)};D0.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)};D0.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 CA(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}CA.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Du.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 D0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};CA.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};CA.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};CA.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};CA.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 EU=CA;var vFo=x(T(),1);var bkt=new U,gkt=new Bt,ykt=new Bt,xkt=h.ZERO,Tkt=new h;function fy(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.itemsToRemove=[],this.subscriptions=new kt,this.showsUpdated=new kt}fy.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)}))}};fy.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};fy.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 Pn({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,bkt);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=vn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,ykt,gkt);Bt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=oi.toValue(_,m.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,xkt,Tkt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Co.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};fy.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=vn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};fy.prototype.contains=function(e){return this.updaters.contains(e.id)};fy.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)};fy.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 VA(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new kt,this._translucentBatches=new kt}VA.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 fy(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 fy(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};VA.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};VA.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};VA.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};VA.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 EA=VA;var _kt=[];function du(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;let o=Wn.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 EA(n,e,s,!1),this._outlineBatches[o+s]=new EA(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 Vh(n,Vo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Vh(n,Vo,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 Vh(n,Vo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Vh(n,Vo,void 0,!1,s,!1);let a=ni.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new EU(i,s,Vo)),c[s]=new RA(i,s);else for(s=0;s<a;++s)c[s]=new RA(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new TR(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new kt,this._updaterSets=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(du.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,_kt)}du.registerUpdater=function(e){WR.registerUpdater(e)};du.unregisterUpdater=function(e){WR.unregisterUpdater(e)};du.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 WR(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(y){m._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(du._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 Skt=[],Zkt=new me;du.prototype.getBoundingSphere=function(e,t){let n=Skt,i=Zkt,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]=me.clone(i,n[o]),o++)}}return o===0?Wt.FAILED:(n.length=o,me.fromBoundingSpheres(n,t),Wt.DONE)};du.prototype.isDestroyed=function(){return!1};du.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(du.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(),ue(this)};du.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};du.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=Wn.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)};du._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)};du.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 AU=du;var gIo=x(T(),1);var Rkt=1,Ckt="30px sans-serif",Vkt=xr.FILL,Ekt=U.WHITE,Akt=U.BLACK,Gkt=1,Lkt=!1,Wkt=new U(.165,.165,.165,.8),vkt=new k(7,5),Fkt=k.ZERO,Ikt=h.ZERO,Pkt=He.NONE,Xkt=Oi.CENTER,Nkt=Bn.CENTER,Ykt=new h,Mkt=new U,wkt=new U,kkt=new U,Ukt=new k,Dkt=new h,Okt=new k,Bkt=new Kt,zkt=new Kt,Hkt=new Kt,Kkt=new Bt;function KPe(e){this.entity=e,this.label=void 0,this.index=void 0}function vT(e,t){t.collectionChanged.addEventListener(vT.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}vT.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,Ykt),c=j.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){Zae(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,b=j.getValueOrDefault(a._heightReference,e,Pkt);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,Rkt),d.font=j.getValueOrDefault(a._font,e,Ckt),d.style=j.getValueOrDefault(a._style,e,Vkt),d.fillColor=j.getValueOrDefault(a._fillColor,e,Ekt,Mkt),d.outlineColor=j.getValueOrDefault(a._outlineColor,e,Akt,wkt),d.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,Gkt),d.showBackground=j.getValueOrDefault(a._showBackground,e,Lkt),d.backgroundColor=j.getValueOrDefault(a._backgroundColor,e,Wkt,kkt),d.backgroundPadding=j.getValueOrDefault(a._backgroundPadding,e,vkt,Ukt),d.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,Fkt,Okt),d.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,Ikt,Dkt),d.heightReference=b,d.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,Xkt),d.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,Nkt),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,Bkt),d.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,zkt),d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,Hkt),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,Kkt),d.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};vT.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=qf(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=oy(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};vT.prototype.isDestroyed=function(){return!1};vT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vT.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};vT.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 KPe(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 KPe(r)):(Zae(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Zae(s.get(r.id),r,a),s.remove(r.id)};function Zae(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var GU=vT;var MIo=x(T(),1);var Jkt=1,jkt=!0,Qkt=0,qkt=!0,$kt=!0,eUt=Wn.ENABLED,tUt=He.NONE,nUt=U.RED,iUt=0,oUt=U.WHITE,rUt=dl.HIGHLIGHT,sUt=.5,aUt=new k(1,1),JPe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},cUt=new P,lUt=new P,jPe=new U,QPe=new Array(4),dUt=new h;function FT(e,t){t.collectionChanged.addEventListener(FT.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}function uUt(e,t){return e instanceof fi?e.valueOf():j.getValueOrUndefined(e,t)}function mUt(e,t){return t!==e.uri?!1:t instanceof ve?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function qPe(e,t){e.uri=t,t instanceof ve&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function hUt(e,t){if(!l(t))return P.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function fUt(e,t,n,i,o){let r=e._primitives,s=e._modelHash,a=s[t.id],c=()=>!e.isDestroyed()&&s[t.id]===a;try{let d=await Nu.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(!c()){d.destroy();return}d.id=t,r.add(d),a.modelPrimitive=d,d.errorEvent.addEventListener(u=>{c()&&(console.log(u),u.name!=="TextureError"&&d.incrementallyLoadTextures&&(a.loadFailed=!0))})}catch(d){if(!c())return;console.log(d),a.loadFailed=!0}}FT.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,p;if(u&&(m=s.computeModelMatrix(e,cUt),p=uUt(a._uri,e),u=l(m)&&l(p)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if((!l(d)||!mUt(d,p))&&(c=ve.createIfNeeded(p),l(d)&&c.url===d.url&&(qPe(d,p),c=void 0)),l(c)){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...JPe}},n[s.id]=d,qPe(d,p);let y=j.getValueOrDefault(a._incrementallyLoadTextures,e,qkt),_=j.getValueOrDefault(a._environmentMapOptions,e,JPe,d.environmentMapOptionsScratch);fUt(this,s,c,y,_)}let b=d.modelPrimitive;if(!l(b))continue;b.show=!0,b.scale=j.getValueOrDefault(a._scale,e,Jkt),b.enableVerticalExaggeration=j.getValueOrDefault(a._enableVerticalExaggeration,e,jkt),b.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,Qkt),b.maximumScale=j.getValueOrUndefined(a._maximumScale,e),b.modelMatrix=hUt(m,b.modelMatrix),b.shadows=j.getValueOrDefault(a._shadows,e,eUt),b.heightReference=j.getValueOrDefault(a._heightReference,e,tUt),b.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),b.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,nUt,jPe),b.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,iUt),b.color=j.getValueOrDefault(a._color,e,oUt,jPe),b.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,rUt),b.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,sUt),b.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),b.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,$kt),b.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,aUt);let f=j.getValueOrUndefined(a._lightColor,e);if(l(f)&&(U.pack(f,QPe,0),f=h.unpack(QPe,0,dUt)),b.lightColor=f,b.customShader=j.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,b.ready){let y=j.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==y&&(y?b.activeAnimations.addAll({loop:Md.REPEAT}):b.activeAnimations.removeAll(),d.animationsRunning=y);let _=j.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(_)){let R=Object.keys(_);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=_[A];if(!l(L))continue;let F=b.getNode(A);if(!l(F))continue;let I=P.fromTranslationRotationScale(L,lUt);F.matrix=P.multiply(F.originalMatrix,I,I)}}let S=!1,Z=j.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(Z)){let R=Object.keys(Z);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=Z[A];l(L)&&(S=!0,b.setArticulationStage(A,L))}}S&&b.applyArticulations()}}return!0};FT.prototype.isDestroyed=function(){return!1};FT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(FT.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Rae(this,e[i],t,n);return ue(this)};var LU=new h,pUt=new pe;FT.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;LU.x=a[12],LU.y=a[13],LU.z=a[14];let c=r.cartesianToCartographic(LU,pUt),d=o.getHeight(c,i.heightReference);if(l(d)||(d=i._lastSurfaceHeight),!l(d)){let u=this._modelHash,m=qf(o,n,LU,[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):bs(i.heightReference)?c.height=d:c.height+=d),me.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Wt.DONE}return me.clone(i.boundingSphere,t),Wt.DONE};FT.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)?(bUt(r,a),s.set(r.id,r)):(Rae(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Rae(this,r,a,c),s.remove(r.id)};function Rae(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function bUt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var WU=FT;var hPo=x(T(),1);var $Pe=new q,eXe=new q,tXe=new q,gUt=new h,nXe=new h,yUt=new h,xUt=new h,lJ=new Ne,dJ=new P,uJ=new q;function FU(e,t,n,i,o){if(!(!l(t)||!l(n))){if(h.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,lJ)&&(Ne.conjugate(lJ,lJ),q.fromQuaternion(lJ,uJ),q.multiplyByVector(uJ,o,o));else if(l(Eae(e,i.position,dJ)))P.inverse(dJ,dJ),P.getRotation(dJ,uJ),q.multiplyByVector(uJ,o,o);else return;return o}}function Eae(e,t,n){let i=t.getValue(e,gUt);if(l(i)){let o=Q.addSeconds(e,.01,new Q),r=t.getValue(o,nXe);if(l(r)&&!h.equalsEpsilon(i,r,W.EPSILON16)){let s=_t.computeFixedToIcrfMatrix(e,$Pe),a=_t.computeFixedToIcrfMatrix(o,eXe),c;!l(s)||!l(a)?(c=_t.computeTemeToPseudoFixedMatrix(e,tXe),s=q.transpose(c,$Pe),a=_t.computeTemeToPseudoFixedMatrix(o,eXe),q.transpose(a,a)):c=q.transpose(s,tXe);let d=yUt;h.normalize(i,d),h.normalize(r,r),q.multiplyByVector(s,d,d),q.multiplyByVector(a,r,r);let u=h.cross(d,r,xUt);if(!h.equalsEpsilon(u,h.ZERO,W.EPSILON16)){let m=h.cross(u,d,nXe);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 iXe=60,lXe=1,dXe=new Vn,Cae=new Vn,Vae=new Vn;function oXe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var mJ=new h;function TUt(e,t,n,i,o,r,s,a,c){let d,u,m=!1;r instanceof nr&&(d=r,u=d.position,r=zi.FIXED,m=!0);let p=a,b,f;b=e.getValueInReferenceFrame(t,r,c[p]),m?(f=u.getValueInReferenceFrame(t,r,mJ),b=FU(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,mJ),l(b)&&l(f)&&(b=FU(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,mJ),l(b)&&l(f)&&(b=FU(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,mJ),l(b)&&l(f)&&(b=FU(n,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),p}function _Ut(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 SUt(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 ZUt(e,t,n,i,o,r,s,a){Vae.start=t,Vae.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Vn.intersect(m,Vae,dXe).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 RUt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function CUt(e,t,n,i,o,r,s,a){Cae.start=t,Cae.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Vn.intersect(m,Cae,dXe).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=uXe(m.data,f,y,i,o,r,c,a)}}return c}function uXe(e,t,n,i,o,r,s,a){for(;e instanceof Ug;)e=e.resolvedProperty;if(e instanceof gc){let c=e._property._times;s=TUt(e,t,n,c,i,o,r,s,a)}else e instanceof Wk?s=_Ut(e,t,n,i,o,r,s,a):e instanceof bc?s=CUt(e,t,n,i,o,r,s,a):e instanceof dy?s=ZUt(e,t,n,i,o,r,s,a):e instanceof sd||e instanceof W0&&j.isConstant(e)?s=RUt(e,t,n,i,o,r,s,a):s=SUt(e,t,n,i,o,r,s,a);return s}function Aae(e,t,n,i,o,r,s){l(s)||(s=[]);let a=uXe(e,t,n,i,o,r,0,s);return s.length=a,s}var rXe=new q,sXe=new Ne,aXe=new q,vU=new Vn,hJ=new Vn,IR=new Vn;function VUt(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 cXe(e,t,n,i,o,r,s,a,c,d,u){e.sort(Q.compare),e=Mo(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),_=Aae(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=Cr.getValue(y,d,S.material),S.width=j.getValueOrDefault(i._width,n,lXe),m++}return m}function IU(e,t){this._unusedIndexes=[],this._polylineCollection=new pf,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}IU.prototype.update=function(e){let t=this._referenceFrame;if(t===zi.INERTIAL){let n=_t.computeIcrfToFixedMatrix(e,rXe);l(n)||(n=_t.computeTemeToPseudoFixedMatrix(e,rXe)),P.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof nr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,sXe))&&(q.fromQuaternion(sXe,aXe),P.fromRotationTranslation(aXe,n,this._polylineCollection.modelMatrix)):Eae(e,t.position,this._polylineCollection.modelMatrix)}};IU.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,iXe),m=Aae(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=Cr.getValue(e,i.material,c.material);let p=j.getValueOrUndefined(i.materialMode,e),b=i.material;if(p===Y0.PORTIONS&&!b.isConstant){l(c)&&(c.show=!1);let f=u>0?u:iXe,y=b.intervals,_=0;if(l(y)){vU.start=r,vU.stop=s,vU.isStartIncluded=!0,vU.isStopIncluded=!0;for(let S=0;S<y.length;S++){let Z=y.get(S);if(!Vn.intersect(Z,vU,hJ))continue;let R=hJ.start,C=hJ.stop;if(Q.greaterThanOrEquals(R,C))continue;let E=VUt(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);Vn.intersect(g,hJ,IR)&&(Q.greaterThan(IR.start,R)&&Q.lessThan(IR.start,C)&&A.push(Q.clone(IR.start)),Q.greaterThan(IR.stop,R)&&Q.lessThan(IR.stop,C)&&A.push(Q.clone(IR.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)}}_=cXe(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);_=cXe(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,lXe),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};IU.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};IU.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function O0(e,t){t.collectionChanged.addEventListener(O0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}O0.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=zi.FIXED,p=m.toString();if(this._scene.mode===se.SCENE3D){let f=j.getValueOrUndefined(c.relativeTo,e);l(f)?f==="FIXED"?(m=zi.FIXED,p=m.toString()):f==="INERTIAL"?(m=zi.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 IU(this._scene,m),b.update(e),this._updaters[p]=b),r.updater=b,l(b)&&b.updateObject(e,r))}return!0};O0.prototype.isDestroyed=function(){return!1};O0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(O0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};O0.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 oXe(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 oXe(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))};O0._subSample=Aae;O0._computeVvlhTransform=Eae;O0._transformToEntityFrame=FU;var PU=O0;var LPo=x(T(),1);var mXe=U.WHITE,hXe=U.BLACK,fXe=0,pXe=1,bXe=0,gXe=Ur.NONE,yXe=new U,EUt=new h,xXe=new U,TXe=new Kt,_Xe=new Kt,SXe=new Bt;function ZXe(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 IT(e,t){t.collectionChanged.addEventListener(IT.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}IT.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,EUt),m=l(p)),!m){XU(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let b=!1,f=!1;if(u!==He.NONE&&!l(d)?(l(c)&&(XU(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)&&(XU(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,TXe),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,_Xe),c.color=j.getValueOrDefault(a._color,e,mXe,yXe),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,hXe,xXe),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,fXe),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,pXe),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,SXe),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,bXe),c.splitDirection=j.getValueOrDefault(a._splitDirection,e,gXe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,TXe),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,_Xe),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,SXe),d.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,bXe),d.splitDirection=j.getValueOrDefault(a._splitDirection,e,gXe),d.heightReference=u;let y=j.getValueOrDefault(a._color,e,mXe,yXe),_=j.getValueOrDefault(a._outlineColor,e,hXe,xXe),S=Math.round(j.getValueOrDefault(a._outlineWidth,e,fXe)),Z=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,pXe)));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,cS(R,C,E,S,Z))}f&&d._updateClamping()}}return!0};IT.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=qf(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=oy(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}}return t.radius=0,Wt.DONE};IT.prototype.isDestroyed=function(){return!1};IT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(IT.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};IT.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 ZXe(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 ZXe(r)):(XU(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],XU(s.get(r.id),r,a),s.remove(r.id)};function XU(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 NU=IT;var MXo=x(T(),1);var sXo=x(T(),1);var AUt=new fi(0),fJ={},RXe=new U,GUt=new Qt(U.WHITE),LUt=new fi(!0),WUt=new fi(Wn.DISABLED),vUt=new fi(new Bt),FUt=new fi(ni.BOTH);function IUt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function PUt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function cp(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(cp.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 IUt,this._groundGeometryOptions=new PUt,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(cp.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}}});cp.prototype.isOutlineVisible=function(e){return!1};cp.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};cp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new vn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=oi.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,RXe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)),this.clampToGround?new Mt({id:t,geometry:new tZ(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,RXe)),l(a)||(a=U.WHITE),s.depthFailColor=$t.fromColor(a)),new Mt({id:t,geometry:new hg(this._geometryOptions),attributes:s}))};cp.prototype.createOutlineGeometryInstance=function(e){};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){this._entitySubscription(),ue(this)};cp.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(ot.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??GUt,d=c instanceof Qt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??LUt,this._shadowsProperty=o.shadows??WUt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??vUt,this._classificationTypeProperty=o.classificationType??FUt,this._fillEnabled=!0,this._zIndex=a??AUt;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(ot.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)?_=Bs.VERTEX_FORMAT:_=fc.VERTEX_FORMAT,f.vertexFormat=_,f.positions=y,f.width=l(u)?u.getValue(ot.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(ot.MINIMUM_VALUE):void 0,f.granularity=l(b)?b.getValue(ot.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(ot.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)}};cp.prototype.createDynamicUpdater=function(e,t){return new YU(e,t,this)};var AA={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function YU(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 CXe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=fJ[n];!l(i)||i.isDestroyed()?(i=new pf,fJ[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}YU.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,mn.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 Bs;else{let b=Cr.getValue(e,m,this._material);p=new fc({material:b,translucent:b.isTranslucent()}),this._material=b}this._groundPolylinePrimitive=s.add(new Ef({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=CXe(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=mn.GEODESIC;c=j.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==mn.NONE&&l(d)&&(AA.ellipsoid=u,AA.positions=r,AA.granularity=j.getValueOrUndefined(i._granularity,e),AA.height=so.extractHeights(r,u),c===mn.GEODESIC?r=so.generateCartesianArc(AA):r=so.generateCartesianRhumbArc(AA)),a.show=!0,a.positions=r.slice(),a.material=Cr.getValue(e,t.fillMaterialProperty,a.material),a.width=j.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};YU.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 me.clone(n.boundingSphere,e),Wt.DONE}return l(t)&&!t.ready?Wt.PENDING:Wt.DONE}else{let t=CXe(this);if(t.show&&t.positions.length>0)return me.fromPoints(t.positions,e),Wt.DONE}return Wt.FAILED};YU.prototype.isDestroyed=function(){return!1};YU.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=fJ[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete fJ[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var MU=cp;var SXo=x(T(),1);var XUt=new U,NUt=new Bt,YUt=new Bt;function lp(e,t,n,i,o){let r;n instanceof Qt?r=Bs:r=fc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(lp.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt,this.zIndex=i,this._asynchronous=o}lp.prototype.onMaterialChanged=function(){this.invalidated=!0};lp.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)};lp.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};lp.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};lp.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 Ef({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===fc&&(this.material=Cr.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===fc&&(this.material=Cr.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,XUt);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=vn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,YUt,NUt);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=oi.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};lp.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=vn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};lp.prototype.contains=function(e){return this.updaters.contains(e.id)};lp.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)};lp.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 GA(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}GA.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 lp(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};GA.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}}};GA.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};GA.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};GA.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 wU=GA;var MUt=[];function VXe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function EXe(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*Wn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Qt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function B0(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;let o,r=Wn.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,Bs,void 0,!1,o),this._materialBatches[o]=new Vh(n,fc,void 0,!1,o),this._colorBatches[o+r]=new Ch(n,Bs,Bs,!1,o),this._materialBatches[o+r]=new Vh(n,fc,Bs,!1,o),this._colorBatches[o+r*2]=new Ch(n,Bs,fc,!1,o),this._materialBatches[o+r*2]=new Vh(n,fc,fc,!1,o);this._dynamicBatch=new TR(n,i);let s=ni.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new wU(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new kt,this._updaters=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(B0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,MUt)}B0.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?(VXe(this,u),EXe(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),VXe(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 MU(c,this._scene),this._updaters.set(d,u),EXe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(B0._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 wUt=[],kUt=new me;B0.prototype.getBoundingSphere=function(e,t){let n=wUt,i=kUt,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]=me.clone(i,n[o]),o++)}return o===0?Wt.FAILED:(n.length=o,me.fromBoundingSpheres(n,t),Wt.DONE)};B0.prototype.isDestroyed=function(){return!1};B0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(B0.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)};B0._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)};B0.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 kU=B0;function uu(e){id.initializeTerrainHeights(),Ef.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Jr,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,o=new Rl,r=new Rl;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 Mk;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 LA=[];uu.registerVisualizer=function(e){LA.includes(e)||LA.push(e)};uu.unregisterVisualizer=function(e){if(LA.includes(e)){let t=LA.indexOf(e);LA.splice(t,1)}};uu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new Ak(t,i),new AU(e,i,n._primitives,n._groundPrimitives),new GU(t,i),new WU(e,i),new vk(e,i),new NU(t,i),new PU(e,i),new kU(e,i,n._primitives,n._groundPrimitives),...LA.map(o=>new o(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(!Xi.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};uu.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 UUt=[],DUt=new me;uu.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=UUt,a=DUt,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]=me.clone(a,s[c]),c++)}}return c===0?Wt.FAILED:(s.length=c,me.fromBoundingSpheres(s,n),Wt.DONE)};uu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Rl),s=o.add(new jw);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};uu.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};uu.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 UU=uu;var _No=x(T(),1);var AXe=new q,GXe=new q,LXe=new q,OUt=new P,pJ=new h,WXe=new h,Gae=new h,Lae=new h,vXe=new h,FXe=new h,BUt=new Ne,zUt=new h,HUt=new q,WA=new Q,KUt=1.25;function JUt(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,WA);let L=o.getValue(WA,pJ);if(l(L)||(Q.addSeconds(c,-.001,WA),L=o.getValue(WA,pJ),b=!0),l(L)){let F=_t.computeFixedToIcrfMatrix(c,AXe),I=_t.computeFixedToIcrfMatrix(WA,GXe),N;!l(F)||!l(I)?(N=_t.computeTemeToPseudoFixedMatrix(c,LXe),F=q.transpose(N,AXe),I=_t.computeTemeToPseudoFixedMatrix(WA,GXe),q.transpose(I,I)):N=q.transpose(F,LXe);let g=q.multiplyByVector(F,m,vXe),V=q.multiplyByVector(I,L,FXe);h.subtract(g,V,Lae);let G=h.magnitude(Lae)*1e3,v=W.GRAVITATIONALPARAMETER,X=-v/(G*G-2*v/h.magnitude(g));X<0||X>KUt*d.maximumRadius?(f=WXe,h.normalize(m,f),h.negate(f,f),_=h.clone(h.UNIT_Z,Gae),y=h.cross(_,f,pJ),h.magnitude(y)>W.EPSILON7&&(h.normalize(f,f),h.normalize(y,y),_=h.cross(f,y,Gae),h.normalize(_,_),p=!0)):h.equalsEpsilon(m,L,W.EPSILON7)||(_=WXe,h.normalize(g,_),h.normalize(V,V),y=h.cross(_,V,Gae),b&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,W.EPSILON7)||(f=h.cross(y,_,pJ),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,Lae),Z=h.clone(t.direction,vXe),R=h.clone(t.up,FXe));let C=OUt,E;l(s)&&(E=s.getValue(c,BUt));let A=r.getValue(c,zUt);if(a===Pg.INERTIAL&&l(E))P.fromTranslationQuaternionRotationScale(m,E,h.ONE,C);else if(a===Pg.VELOCITY&&l(A)){let L=_t.rotationMatrixFromPositionVelocity(m,A,d,HUt);P.fromRotationTranslation(L,m,C)}else a===Pg.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 DU(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 uy(e.position,!0),this._offset3D=new h}Object.defineProperties(DU,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});DU.defaultOffset3D=new h(-14e3,3500,3500);var bJ=new Lm,jUt=new h;DU.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)){bJ.pitch=-W.PI_OVER_FOUR,bJ.range=0;let S=a.getValue(e,jUt);if(l(S)){let Z=2-1/Math.max(1,h.magnitude(S)/i.maximumRadius);bJ.pitch*=Z}p.viewBoundingSphere(t,bJ),this.boundingSphere=t,b=!1,f=!1}else(!_||!l(y.getValue(e,this._offset3D)))&&h.clone(DU._defaultOffset3D,this._offset3D)}else!m&&this._mode!==se.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,JUt(this,p,b,f,a,c,d,s,e,i)};var OU=DU;var qNo=x(T(),1);var Wae=32,QUt="http://www.opengis.net/kml/2.2",up="http://www.google.com/kml/ext/2.2",qUt="http://www.w3.org/2000/xmlns/";function gJ(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var $Ut=/^data:image\/([^,;]+)/;gJ.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($Ut);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 e5t(e,t){return function(n){e._files[t]=n}}gJ.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(e5t(this,r))}return o};Object.defineProperties(gJ.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function yJ(e){this._time=e}yJ.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};yJ.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return XR(n)};yJ.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function vae(){this._ids={},this._styles={},this._count=0}vae.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};vae.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 XXe(){this._ids={}}XXe.prototype.get=function(e){if(!l(e))return this.get($n());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Fae(e){e=e??B.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Fae._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(qUt,"xmlns:gx",up);let a=r.createElement("Document");s.appendChild(a),YXe(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?t5t(u,c.files):{kml:u,externalFiles:c.files}})}async function t5t(e,t){let n=en("ThirdParty/Workers/zip-web-worker.js"),i=en("ThirdParty/zip-module.wasm");_M({workerURI:n,wasmURI:i});let o=new zV("application/vnd.google-earth.kmz"),r=new jM(o);await r.add("doc.kml",new NM(e));let s=Object.keys(t);return await NXe(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function NXe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new nu(n[o])),NXe(e,t,n,i+1)}Fae._createState=function(e){let t=e.entities,n=new vae,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===ot.MINIMUM_VALUE?r.stop===ot.MAXIMUM_VALUE?r=new Vn:Q.addSeconds(r.stop,-10*s,r.start):r.stop===ot.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new gJ(e.modelCallback);return{kmlDoc:document.implementation.createDocument(QUt,"kml"),ellipsoid:e.ellipsoid??ne.default,idManager:new XXe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new yJ(o),sampleDuration:s,defaultAvailability:new As([r])}};function YXe(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=[],n5t(e,p,d,u),i5t(e,p.polyline,d,u),PXe(e,p.rectangle,d,u,c),PXe(e,p.polygon,d,u,c),a5t(e,p,p.model,d,u);let b,f=p.availability;l(f)&&(b=i.createElement("TimeSpan"),Q.equals(f.start,ot.MINIMUM_VALUE)||b.appendChild(En(i,"begin",Q.toIso8601(f.start))),Q.equals(f.stop,ot.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),YXe(e,S,_)}}}var mu=new h,yd=new pe,dp=new Q;function n5t(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){MXe(e,t,a,n,i);return}s.get(c,void 0,mu);let d=En(o,"coordinates",PR(mu,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(NR(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof xl?kXe(e,a):wXe(e,a);i.push(p)}function MXe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof bc?(c=d.intervals,u=!1):c=t.availability??e.defaultAvailability;let m=n instanceof Ng,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 W0?(Z=Z._value,R.appendChild(NR(e,He.CLAMP_TO_GROUND))):l(n)?R.appendChild(NR(e,n.heightReference)):R.appendChild(NR(e,He.NONE));let C=[],E=[];if(Z.isConstant){a.get(Z,void 0,mu);let L=En(r,"coordinates",PR(mu,s));C.push(Q.toIso8601(S.start)),E.push(L),C.push(Q.toIso8601(S.stop)),E.push(L)}else if(Z instanceof gc)for(f=Z._property._times,b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),Z.getValueInReferenceFrame(f[b],zi.FIXED,mu),E.push(PR(mu,s));else if(Z instanceof em){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,mu),E.push(PR(mu,s))}else{let L=e.sampleDuration;S.start.clone(dp),S.isStartIncluded||Q.addSeconds(dp,L,dp);let F=S.stop;for(;Q.lessThan(dp,F);)Z.getValue(dp,mu),C.push(Q.toIso8601(dp)),E.push(PR(mu,s)),Q.addSeconds(dp,L,dp);S.isStopIncluded&&Q.equals(dp,F)&&(Z.getValue(dp,mu),C.push(Q.toIso8601(dp)),E.push(PR(mu,s)))}let A=r.createElementNS(up,"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],up);A.appendChild(F),A.appendChild(I)}m&&A.appendChild(UXe(e,n)),y.push(A)}if(y.length===1)i.push(y[0]);else if(y.length>1){let S=r.createElementNS(up,"MultiTrack");for(p=0;p<y.length;++p)S.appendChild(y[p]);i.push(S)}if(l(n)&&!m){let S=n instanceof xl?kXe(e,n):wXe(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)),Iae(e,Z,R),o.push(R)}}}function wXe(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/Wae)),o}function kXe(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,up)),p.appendChild(En(n,"y",b.y,up)),p.appendChild(En(n,"w",b.width,up)),p.appendChild(En(n,"h",b.height,up))),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,Wae),b=i.get(t.height,Wae),f=i.get(t.horizontalOrigin,Oi.CENTER);f===Oi.CENTER?d.x-=p*.5:f===Oi.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 i5t(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",PR(p,r));a.appendChild(b);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(En(o,"drawOrder",f,up)),n.push(a);let y=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&y.appendChild(En(o,"width",_)),Iae(e,t.material,y),i.push(y)}function o5t(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,yd),c.push(`${W.toDegrees(yd.longitude)},${W.toDegrees(yd.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 IXe(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,yd),s.push(`${W.toDegrees(yd.longitude)},${W.toDegrees(yd.latitude)},${i?yd.height:n}`);let c=En(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function r5t(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(IXe(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(IXe(e,p[f].positions,r,s)),a.push(y)}}return a}function PXe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof kf;if(a&&s.getMaterialType(t.material)==="Image"){s5t(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?o5t(e,t,d):r5t(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(NR(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)),Iae(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 s5t(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(NR(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",XR(m.color))),n.push(s)}function UXe(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 a5t(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){MXe(e,t,n,i,o);return}let d=UXe(e,n),u=r.createElement("altitudeMode");u.appendChild(NR(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,mu),pe.fromCartesian(mu,s,yd);let m=r.createElement("Location");m.appendChild(En(r,"longitude",W.toDegrees(yd.longitude))),m.appendChild(En(r,"latitude",W.toDegrees(yd.latitude))),m.appendChild(En(r,"altitude",yd.height)),d.appendChild(m),i.push(d)}function Iae(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=XR(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=XR(r.color);break;case"PolylineOutline":s=XR(r.color),c=XR(r.outlineColor),d=r.outlineWidth,n.appendChild(En(i,"outerColor",c,up)),n.appendChild(En(i,"outerWidth",d,up));break;case"Stripe":s=XR(r.oddColor);break}l(s)&&(n.appendChild(En(i,"color",s)),n.appendChild(En(i,"colorMode","normal")))}function NR(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 PR(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,yd),i.push(`${W.toDegrees(yd.longitude)},${W.toDegrees(yd.latitude)},${yd.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 XR(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 Pae=Fae;var FYo=x(T(),1);var QXe;typeof DOMParser<"u"&&(QXe=new DOMParser);var c5t=new oz({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),xJ=32,DXe=2414016,OXe=1,BXe=16093e3,zXe=.1,l5t=[null,void 0,"http://www.topografix.com/GPX/1/1"],ir={gpx:l5t};function d5t(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 Xae(e,t){let n=HU(e,"id");return n=l(n)?n:$n(),t.getOrCreateEntity(n)}function Nae(e){let t=HXe(e,"lon"),n=HXe(e,"lat"),i=BU(e,"ele",ir.gpx);return h.fromDegrees(t,n,i)}function HXe(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 HU(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function PT(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 Yae(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 BU(e,t,n){let i=PT(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function hu(e,t,n){let i=PT(e,t,n);if(l(i))return i.textContent.trim()}function qXe(e){let t=new xl;return t.width=xJ,t.height=xJ,t.scaleByDistance=new Kt(DXe,OXe,BXe,zXe),t.pixelOffsetScaleByDistance=new Kt(DXe,OXe,BXe,zXe),t.verticalOrigin=new fi(Bn.BOTTOM),t.image=e,t}function u5t(){let e=new Mf;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Oi.LEFT,e.font="16px sans-serif",e.style=xr.FILL_AND_OUTLINE,e}function $Xe(e){let t=new _l;return t.width=4,t.material=new VT,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var KXe={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"}},zU;typeof document<"u"&&(zU=document.createElement("div"));function Mae(e,t){let n,i="",o=Object.keys(KXe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=KXe[u];m.value=hu(e,m.tag,ir.gpx)??"",l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=c5t.link(i),zU.innerHTML=i;let s=zU.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+=`${zU.innerHTML}</div>`,zU.innerHTML="",d}function eNe(e,t,n,i){let o=Nae(t),r=Xae(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,xJ);r.billboard=qXe(s);let a=hu(t,"name",ir.gpx);r.name=a,r.label=u5t(),r.label.text=a,r.description=Mae(t,r),i.clampToGround&&(r.billboard.heightReference=He.CLAMP_TO_GROUND,r.label.heightReference=He.CLAMP_TO_GROUND)}function m5t(e,t,n,i){let o=Xae(t,n);o.description=Mae(t,o);let r=Yae(t,"rtept",ir.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)eNe(e,r[a],n,i),s[a]=Nae(r[a]);o.polyline=$Xe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function h5t(e,t,n,i){let o=Xae(t,n);o.description=Mae(t,o);let r=Yae(t,"trkseg",ir.gpx),s=[],a=[],c,d=!0,u=new gc;for(let m=0;m<r.length;m++)c=f5t(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,xJ);o.billboard=qXe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=He.CLAMP_TO_GROUND),o.availability=new As,o.availability.addInterval(new Vn({start:a[0],stop:a[a.length-1]}))}o.polyline=$Xe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function f5t(e){let t={positions:[],times:[]},n=Yae(e,"trkpt",ir.gpx),i;for(let o=0;o<n.length;o++){let r=Nae(n[o]);t.positions.push(r),i=hu(n[o],"time",ir.gpx),l(i)&&t.times.push(Q.fromIso8601(i))}return t}function p5t(e){let t=PT(e,"metadata",ir.gpx);if(l(t)){let n={name:hu(t,"name",ir.gpx),desc:hu(t,"desc",ir.gpx),author:b5t(t),copyright:y5t(t),link:tNe(t),time:hu(t,"time",ir.gpx),keywords:hu(t,"keywords",ir.gpx),bounds:x5t(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 b5t(e){let t=PT(e,"author",ir.gpx);if(l(t)){let n={name:hu(t,"name",ir.gpx),email:g5t(t),link:tNe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function g5t(e){let t=PT(e,"email",ir.gpx);if(l(t)){let n=hu(t,"id",ir.gpx),i=hu(t,"domain",ir.gpx);return`${n}@${i}`}}function tNe(e){let t=PT(e,"link",ir.gpx);if(l(t)){let n={href:HU(t,"href"),text:hu(t,"text",ir.gpx),mimeType:hu(t,"type",ir.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function y5t(e){let t=PT(e,"copyright",ir.gpx);if(l(t)){let n={author:HU(t,"author"),year:hu(t,"year",ir.gpx),license:hu(t,"license",ir.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function x5t(e){let t=PT(e,"bounds",ir.gpx);if(l(t)){let n={minLat:BU(t,"minlat",ir.gpx),maxLat:BU(t,"maxlat",ir.gpx),minLon:BU(t,"minlon",ir.gpx),maxLon:BU(t,"maxlon",ir.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var JXe={wpt:eNe,rte:m5t,trk:h5t};function T5t(e,t,n,i){let o=Object.keys(JXe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=JXe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&ir.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function jXe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=HU(o,"version"),s=HU(o,"creator"),a,c=p5t(o);l(c)&&(a=c.name),o.localName==="gpx"?T5t(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,ot.MINIMUM_VALUE),f=Q.equals(p,ot.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 Nf,d.startTime=m,d.stopTime=p,d.currentTime=Q.clone(m),d.clockRange=Vs.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),_5t(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),vs.setLoading(e,!1),e}function _5t(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 S5t(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?d5t(r).then(function(s){let a,c;try{a=QXe.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 jXe(e,a,i)}):jXe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function vA(){this._changed=new Se,this._error=new Se,this._loading=new Se,this._clock=void 0,this._entityCollection=new Qa(this),this._entityCluster=new $u,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Zg}vA.load=function(e,t){return new vA().load(e,t)};Object.defineProperties(vA.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}}});vA.prototype.update=function(e){return!0};vA.prototype.load=function(e,t){if(!l(e))throw new ge("data is required.");t=t??B.EMPTY_OBJECT,vs.setLoading(this,!0);let n=this._name,i=this;return S5t(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Q.equals(s,ot.MINIMUM_VALUE),d=Q.equals(a,ot.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 Nf,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=Vs.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),vs.setLoading(i,!1),i}).catch(function(o){return vs.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var KU=vA;var XYo=x(T(),1);function JU(){ge.throwInstantiationError()}JU.prototype.update=ge.throwInstantiationError;JU.prototype.getBoundingSphere=ge.throwInstantiationError;JU.prototype.isDestroyed=ge.throwInstantiationError;JU.prototype.destroy=ge.throwInstantiationError;var wae=JU;var iMo=x(T(),1);var Z5t=15;function nNe(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}nNe.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 R5t(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 eo(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 Lr(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"?ih.LERC:ih.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 C5t(e,t,n){try{let i=await t.fetchJson();R5t(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw er.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function XT(){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(XT.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}}});XT.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 nNe(t);await C5t(o,i);let r=new XT(t);return o.build(r),r._resource=n,r};XT.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(kae(this,n+1,e*2,t*2))){let m=iNe(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 Nc({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):Z5t,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 kae(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}XT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};XT.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=kae(this,n,e,t);if(l(i))return i;iNe(this,n,e,t)};XT.prototype.loadTileDataAvailability=function(e,t,n){};function V5t(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 E5t(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=V5t(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 iNe(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=E5t(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 kae(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 Uae=XT;var dMo=x(T(),1);var oNe="https://dev.virtualearth.net/REST/v1/Locations";function Dae(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:oNe,queryParameters:n}),this._credit=new Lt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(Dae.prototype,{url:{get:function(){return oNe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Dae.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 Oae=Dae;var hMo=x(T(),1);function Bae(){}Object.defineProperties(Bae.prototype,{credit:{get:function(){}}});Bae.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 zae=Bae;var SMo=x(T(),1);var A5t=new ce,rNe=new h,FA=new h;function G5t(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=A5t;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,rNe),h.multiplyByScalar(m,.5,m),p=P.multiplyByVector(hx.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],rNe),h.multiplyByScalar(u,.5,u),p=P.multiplyByVector(hx.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=P.multiplyByVector(NT.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,FA),h.add(o,FA,o),h.multiplyByScalar(u,p.z,FA),h.add(o,FA,o),h.multiplyByScalar(m,p.w,FA),h.add(o,FA,o)}}var L5t=new h,W5t=new h;function NT(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=L5t,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=W5t,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=G5t(this),this._lastTimeIndex=0}Object.defineProperties(NT.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}}});NT.catmullRomCoefficientMatrix=new P(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);NT.prototype.findTimeInterval=Fo.prototype.findTimeInterval;NT.prototype.wrapTime=Fo.prototype.wrapTime;NT.prototype.clampTime=Fo.prototype.clampTime;NT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Hae=NT;var lwo=x(T(),1);var zMo=x(T(),1);var Kae={},v5t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},F5t=new pe,I5t=new h,P5t=new P,X5t=new P,N5t=new P,Y5t=new h,M5t=new h,w5t=new h,k5t=new h,U5t=new pe,D5t=new k,jU=new h,O5t=new k,B5t=new h,z5t=new h,TJ=function(e,t){return e-t};Kae.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=me.clone(e.boundingSphere,new me),p=nn.clone(e.orientedBoundingBox,new nn),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?ex.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,F5t);L.height=.5*(s+a);let F=pe.toCartesian(L,f,I5t),I=_t.eastNorthUpToFixedFrame(F,f,P5t),N=P.inverseTransformation(I,X5t),g=P.unpack(r.nodes[0].matrix,0,N5t);g=P.multiply(Di.Y_UP_TO_Z_UP,g,g);let V=CDt(r,i,v5t),G=Qo.getSkirtVertexCount(V.edgeIndicesWest,V.edgeIndicesSouth,V.edgeIndicesEast,V.edgeIndicesNorth),v=V.positions,X=V.normals,Y=V.indices,D=v.length/3,M=D+G,O=Y.length,w=Qo.getSkirtIndexCountWithFilledCorners(G),z=M<=65535?Uint16Array:Uint32Array,K=new z(O+w);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,Y5t),tt=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,M5t),Be=new Zr(m.center,void 0,void 0,void 0,void 0,i,o,u,t,n),je=Be.stride,qe=new Float32Array(M*je),We=0;for(let ct=0;ct<D;ct++){let Et=h.unpack(v,ct*3,w5t),zt=P.multiplyByPoint(g,Et,k5t),ut=pe.fromCartesian(zt,f,U5t),{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),Go(le,ct,TJ)>=0?st=0:Go(he,ct,TJ)>=0&&(st=1),Go(_e,ct,TJ)>=0?pt=0:Go(Ze,ct,TJ)>=0&&(pt=1);let Mi=k.fromElements(st,pt,D5t),jn;if(i){let pi=h.unpack(X,ct*3,jU);pi=P.multiplyByPointAsVector(g,pi,jU),pi=h.normalize(pi,jU),jn=dn.octEncode(pi,O5t)}let Si;o&&(Si=(xi.geodeticLatitudeToMercatorAngle(ht)-ye)*Ae);let Hi;u&&(Hi=f.geodeticSurfaceNormal(zt,B5t)),We=Be.encode(qe,We,zt,Mi,jt,jn,Si,Hi);let Gi=P.multiplyByPoint(N,zt,z5t);Fe=h.minimumByComponent(Gi,Fe,Fe),tt=h.maximumByComponent(Gi,tt,tt)}let Ke=new mc(h.clone(Be.center,new h),qe,K,O,D,s,a,y,me.clone(m,new me),h.clone(b,new h),je,nn.clone(p,new nn),Be,te,H,$,ee);return mNe(Ke,y,f,Fe,tt,I,N,c),Promise.resolve(Ke)};var H5t=new k,K5t=new k,J5t=new Array(6),j5t=new k,Q5t=new k,q5t=new k,$5t=new h,eDt=new h,tDt=new h,nDt=new pe,iDt=new h,oDt=new pe,rDt=new pe,sNe=new h,sDt=new h,aDt=new h,cDt=new h,lDt=new h,dDt=new h,uDt=new h,mDt=new h,hDt=new P,fDt=new P,aNe=new k,pDt=new k,bDt=new h,gDt=new me,yDt=new nn,xDt=new Gu,cNe=new h,lNe=new k,TDt=new k,dNe=new h,_Dt=new h;function SDt(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);ex.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 ZDt(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);ex.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=jU;y.x=p,y.y=b,y.z=f,y=h.normalize(y,jU),u[m*3+0]=y.x,u[m*3+1]=y.y,u[m*3+2]=y.z}return u}function RDt(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 ex.decodeIndexBuffer(new Uint8Array(d.buffer),o,s.byteStride,c),d}function _J(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 ex.decodeIndexSequence(new Uint8Array(u.buffer),r,m,d),u}function CDt(e,t,n){return n.positions=SDt(e),n.normals=t?ZDt(e):void 0,n.indices=RDt(e),n.edgeIndicesWest=_J(e,"left"),n.edgeIndicesSouth=_J(e,"bottom"),n.edgeIndicesEast=_J(e,"right"),n.edgeIndicesNorth=_J(e,"top"),n}Kae.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=Zr.clone(e.parentEncoding,new Zr),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=[];YDt(t,n,s,a,c,d,u,A,L,F,I,N,R,E,C);let g=re.center(S,nDt);g.height=.5*(i+o);let V=pe.toCartesian(g,Z,iDt),G=R.length,v=new Zr(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,M=A.length,O=Qo.getSkirtIndexCountWithFilledCorners(Y),w=M+O,z=D<=65535?Uint16Array:Uint32Array,K=new z(w);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,hDt),Ze=P.inverseTransformation(he,fDt),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,uDt),ct=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,mDt);for(let jt=0;jt<G;jt++){let st=R[jt],pt=a[st*3+0],Mi=a[st*3+1],jn=a[st*3+2],Si=pDt;Si.x=C[jt*2+0],Si.y=C[jt*2+1];let Hi=Si.x,Gi=Si.y,pi=E[jt*2+0],Zi=E[jt*2+1],On=1-pi-Zi,rn=u.decodeHeight(d,pt),Hn=u.decodeHeight(d,Mi),$i=u.decodeHeight(d,jn),Po=rn*pi+Hn*Zi+$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,rDt),or=pe.toCartesian(Hs,Z,sDt),yi=P.multiplyByPoint(Ze,or,cDt);Ke=h.minimumByComponent(yi,Ke,Ke),ct=h.maximumByComponent(yi,ct,ct);let fr;if(m){let Mn=u.decodeNormal(d,pt,$5t),Ki=u.decodeNormal(d,Mi,eDt),wi=u.decodeNormal(d,jn,tDt),Xo=h.fromElements(Mn.x*pi+Ki.x*Zi+wi.x*On,Mn.y*pi+Ki.y*Zi+wi.y*On,Mn.z*pi+Ki.z*Zi+wi.z*On,cNe);Xo=h.normalize(Xo,cNe),fr=dn.octEncode(Xo,TDt)}let mo;p&&(mo=(xi.geodeticLatitudeToMercatorAngle(Is)-tt)*je);let Qr;_&&(Qr=Z.geodeticSurfaceNormal(or,_Dt)),_e=v.encode(le,_e,or,Si,Po,fr,mo,Qr)}let Et=nn.fromRectangle(S,qe,We,Z,yDt),zt=me.fromVertices(le,v.center,X,gDt),bt=new Rf(Z).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(v.center,le,X,v.center,qe,bDt),ht=new mc(h.clone(v.center,new h),le,K,M,G,qe,We,S,me.clone(zt),h.clone(bt),X,nn.clone(Et),v,te,H,$,ee);return mNe(ht,S,Z,Ke,ct,he,Ze,r),ht};function mNe(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],M=[0,-1,0,1],O=h.clone(i,lDt),w=h.clone(o,dDt),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,aNe),he=1e-4,Ze=_e.x+D[ee]*he,ye=_e.y+M[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,oDt),je=pe.toCartesian(Be,n,sNe),qe;m&&(qe=c.getOctEncodedNormal(u,le,lNe));let We;p&&(We=c.decodeWebMercatorT(u,le));let Ke;_&&(Ke=n.geodeticSurfaceNormal(je,dNe)),Z=c.encode(u,Z,je,_e,tt,qe,We,Ke);let ct=P.multiplyByPoint(s,je,aDt);h.minimumByComponent(ct,O,O),h.maximumByComponent(ct,w,w)}let te=Gu.fromCorners(O,w,xDt),H=new Zr(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,sNe),c.decodeTextureCoordinates(u,he,aNe),c.decodeHeight(u,he),c.hasVertexNormals?c.getOctEncodedNormal(u,he,lNe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(u,he):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(u,he,dNe):void 0);e.vertices=le,e.stride=ee,e.encoding=$}return e}var Jae=0,VDt=1,jae=2,Qae=3,EDt=4,ADt=new h,GDt=[new h,new h,new h,new h,new h,new h],LDt=[new k,new k,new k,new k,new k,new k],WDt=[new h,new h,new h,new h,new h,new h],vDt=[new k,new k,new k,new k,new k,new k];function uNe(e,t,n,i){switch(n){case Jae:return W.sign(i.x-e.x);case jae:return W.sign(t.x-i.x);case Qae:return W.sign(i.y-e.y);default:return W.sign(t.y-i.y)}}function FDt(e,t,n,i,o,r){let s,a,c;switch(n){case Jae:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case jae:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case Qae: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 IDt={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 PDt(e,t,n,i,o,r,s,a){let c,d=LDt,u=GDt,m=3,p=vDt;k.clone(o,p[0]),k.clone(r,p[1]),k.clone(s,p[2]);let b=WDt;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)%EDt,_=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=uNe(n,i,y,R);for(let A=0;A<c;A++){let L=d[A],F=u[A],I=uNe(n,i,y,L);if(E*I===-1){let N=FDt(n,i,y,R,L,ADt),{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 XDt(e,t,n,i,o,r,s,a){return PDt(e?t?Qae:Jae:t?jae:VDt,2,n,i,o,r,s,a)}var NDt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function YDt(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=H5t;C.x=_,C.y=Z;let E=K5t;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,j5t),V=s.decodeTextureCoordinates(r,I,Q5t),G=s.decodeTextureCoordinates(r,N,q5t),v=XDt(e,t,C,E,g,V,G,IDt),X=v.length;if(X<3)continue;let Y=J5t;for(let w=0;w<X;w++){let z=v.barycentricCoordinates[w],K=z.x,te=z.y,H=z.z,$=Math.ceil(K)|Math.ceil(te)<<1|Math.ceil(H)<<2,ee=NDt[$],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[(w+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[w]=le,_e){let he=L/3;p.push(he);let Ze=v.coordinates[w],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],M=Y[1],O=Y[2];a.push(D,M,O);for(let w=3;w<X;w++)M=O,O=Y[w],a.push(D,M,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 IA=Kae;function by(e){e=e??B.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=me.clone(e.boundingSphere,new me),this._orientedBoundingBox=nn.clone(e.orientedBoundingBox,new nn),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(by.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});by.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:fNe(i,e,t,n)};by.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 hNe="createVerticesFromCesium3DTilesTerrain",MDt=new Qn(hNe),wDt=new Qn(hNe,Qd.maximumAsynchronousTasks);by.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let n=e.throttle??!0?wDt:MDt,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=Zr.clone(b.encoding,new Zr),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=me.clone(m._boundingSphere,new me),G=h.clone(m._horizonOcclusionPoint,new h),v=nn.clone(m._orientedBoundingBox,new nn),X=new mc(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)})};by.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=IA.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)})};by.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:SJ(!1,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};by.prototype._upsampleSync=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:SJ(!0,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};by.prototype.wasCreatedByUpsampling=function(){return!1};function py(e){e=e??B.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}py.prototype.createMesh=function(e){return e=e??B.EMPTY_OBJECT,Promise.resolve(this._mesh)};py.prototype.upsample=function(e,t,n,i,o,r,s){return SJ(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};py.prototype._upsampleSync=function(e,t,n,i,o,r,s){return SJ(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};py.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return fNe(i,e,t,n)};py.prototype.wasCreatedByUpsampling=function(){return!0};py.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(py.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var kDt=new Qn("upsampleVerticesFromCesium3DTilesTerrain",Qd.maximumAsynchronousTasks);function SJ(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=IA.upsampleMesh(S),C=new py({terrainMesh:R,skirtHeight:p,credits:i});return Promise.resolve(C)}let Z=kDt.scheduleTask(S);if(Z!==void 0)return Z.then(function(R){let C=Zr.clone(R.encoding,new Zr),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,M=h.clone(C.center,new h),O=me.clone(R.boundingSphere,new me),w=h.clone(R.horizonOcclusionPoint,new h),z=nn.clone(R.orientedBoundingBox,new nn),K=new mc(M,A,N,X,F,Y,D,y,O,w,E,z,C,g,G,V,v),te=new py({terrainMesh:K,skirtHeight:p,credits:i});return Promise.resolve(te)})}var UDt=new k,DDt=new k,ODt=new k,BDt=new h;function fNe(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,UDt),f=a.decodeTextureCoordinates(s,m,DDt),y=a.decodeTextureCoordinates(s,p,ODt),_=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=Jf.computeBarycentricCoordinates(o,r,b.x,b.y,f.x,f.y,y.x,y.y,BDt);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 QU=by;var Nwo=x(T(),1);function z0(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 eo({ellipsoid:this._ellipsoid}),this._subtreeCache=new YR({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}z0.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 z0(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 o0(n,s,d),o._tileset1=new o0(n,a,d),o};z0.fromIonAssetId=async function(e,t){let n=await kr.fromAssetId(e);return z0.fromUrl(n,t)};var zDt=new Array(3);z0.prototype.requestTileGeometry=async function(e,t,n,i){let o=bNe(n,e),r=o===0?this._tileset0:this._tileset1,s=gNe(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=>N_(new Uint8Array(Z))),S=zDt;S[0]=p,S[1]=_,S[2]=u?_.then(Z=>HDt(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=me.unpack(I,0,new me),g=A.getPropertyBySemantic(Xm.TILE_HORIZON_OCCLUSION_POINT),G=m._tilingScheme.tileXYToRectangle(e,t,n,new re),v=m._ellipsoid,X=nn.fromRectangle(G,L,F,v,new nn),Y=m.getLevelMaximumGeometricError(n)*5,D=ZJ(r,R,s,0,0),M=ZJ(r,R,s,1,0),O=ZJ(r,R,s,0,1),w=ZJ(r,R,s,1,1),z=(D?1:0)|(M?2:0)|(O?4:0)|(w?8:0),K=new QU({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}};z0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=bNe(n,e),r=o===0?this._tileset0:this._tileset1,s=gNe(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 bNe(e,t){let n=1<<e;return t/n|0}function gNe(e,t,n,i){let o=1<<t,r=t,s=n%o,a=o-i-1,{subdivisionScheme:c,subtreeLevels:d}=e;return new r0({subdivisionScheme:c,subtreeLevels:d,level:r,x:s,y:a})}async function HDt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new ox({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=Yi.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 ZJ(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=qae(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function qae(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new r0({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}z0.prototype.loadTileDataAvailability=function(e,t,n){};z0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(z0.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 KDt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function YR(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new ug({comparator:YR.comparator}),this._provider=e.provider}YR.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};YR.prototype.addSubtree=function(e,t){let n=new KDt(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()};YR.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}};YR.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=qae(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=pNe(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=pNe(r,d,R,C,L);if(c.tileIsAvailableAtCoordinates(F))A=F;else break}return A};function pNe(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=qae(e,o,s,a);return t.getDescendantCoordinates(c)}YR.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var $ae=z0;var Bwo=x(T(),1);function gy(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 gd(n),this._workerName="createCircleGeometry"}gy.packedLength=gd.packedLength;gy.pack=function(e,t,n){return gd.pack(e._ellipseGeometry,t,n)};var yNe=new gd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Uc={center:new h,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Me,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};gy.unpack=function(e,t,n){let i=gd.unpack(e,t,yNe);return Uc.center=h.clone(i._center,Uc.center),Uc.ellipsoid=ne.clone(i._ellipsoid,Uc.ellipsoid),Uc.ellipsoid=ne.clone(i._ellipsoid,yNe._ellipsoid),Uc.height=i._height,Uc.extrudedHeight=i._extrudedHeight,Uc.granularity=i._granularity,Uc.vertexFormat=Me.clone(i._vertexFormat,Uc.vertexFormat),Uc.stRotation=i._stRotation,Uc.shadowVolume=i._shadowVolume,l(n)?(Uc.semiMajorAxis=i._semiMajorAxis,Uc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new gd(Uc),n):(Uc.radius=i._semiMajorAxis,new gy(Uc))};gy.createGeometry=function(e){return gd.createGeometry(e._ellipseGeometry)};gy.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new gy({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(gy.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var ece=gy;var qwo=x(T(),1);function PA(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 um(n),this._workerName="createCircleOutlineGeometry"}PA.packedLength=um.packedLength;PA.pack=function(e,t,n){return um.pack(e._ellipseGeometry,t,n)};var JDt=new um({center:new h,semiMajorAxis:1,semiMinorAxis:1}),fm={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};PA.unpack=function(e,t,n){let i=um.unpack(e,t,JDt);return fm.center=h.clone(i._center,fm.center),fm.ellipsoid=ne.clone(i._ellipsoid,fm.ellipsoid),fm.height=i._height,fm.extrudedHeight=i._extrudedHeight,fm.granularity=i._granularity,fm.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(fm.semiMajorAxis=i._semiMajorAxis,fm.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new um(fm),n):(fm.radius=i._semiMajorAxis,new PA(fm))};PA.createGeometry=function(e){return um.createGeometry(e._ellipseGeometry)};var tce=PA;var c9o=x(T(),1);function XA(e){e=e??B.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new eo({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(XA.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}}});XA.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 Nc({buffer:c,width:r,height:s})})};XA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};XA.prototype.getTileDataAvailable=function(e,t,n){};XA.prototype.loadTileDataAvailability=function(e,t,n){};var nce=XA;var d9o=x(T(),1);function xNe(e){this.proxy=e}xNe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var ice=xNe;var p9o=x(T(),1);function RJ(){ge.throwInstantiationError()}Object.defineProperties(RJ.prototype,{credit:{get:ge.throwInstantiationError}});RJ.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Lt.getIonCredit)};RJ.prototype.geocode=ge.throwInstantiationError;var NA=RJ;var g9o=x(T(),1),TNe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(TNe);var YT=TNe;var T9o=x(T(),1);function _Ne(){ge.throwInstantiationError()}_Ne.createGeometry=function(e){ge.throwInstantiationError()};var oce=_Ne;var N9o=x(T(),1);function MR(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(MR.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var RNe="createVerticesFromGoogleEarthEnterpriseBuffer",jDt=new Qn(RNe),QDt=new Qn(RNe,Qd.maximumAsynchronousTasks),SNe=new re,CJ=new re;MR.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,SNe),t.tileXYToRectangle(n,i,o,CJ);let d=c.cartographicToCartesian(re.center(CJ)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let b=(a?QDt:jDt).scheduleTask({buffer:this._buffer,nativeRectangle:SNe,rectangle:CJ,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 mc(d,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,CJ,me.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,nn.clone(y.orientedBoundingBox),Zr.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})};MR.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)?nOt(this,i,o):rOt(this,i,o,e)};var qDt=new Qn("upsampleQuantizedTerrainMesh",Qd.maximumAsynchronousTasks);MR.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=qDt.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 sR({quantizedVertices:y,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:me.clone(f.boundingSphere),orientedBoundingBox:nn.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})})};MR.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};MR.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var $Dt=new k,eOt=new k,tOt=new k,CNe=new h;function nOt(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,$Dt),b=r.decodeTextureCoordinates(o,u,eOt),f=r.decodeTextureCoordinates(o,m,tOt),y=Jf.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,CNe);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 iOt=Uint16Array.BYTES_PER_ELEMENT,ZNe=Uint32Array.BYTES_PER_ELEMENT,rce=Int32Array.BYTES_PER_ELEMENT,oOt=Float32Array.BYTES_PER_ELEMENT,sce=Float64Array.BYTES_PER_ELEMENT;function rOt(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+=ZNe;d+=ZNe,d+=2*sce;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=sce;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=sce;let p=i.width/u/2,b=i.height/m/2,f=c.getInt32(d,!0);d+=rce;let y=c.getInt32(d,!0)*3;d+=rce,d+=rce;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+=oOt;let C=new Array(y);for(R=0;R<y;++R)C[R]=c.getUint16(d,!0),d+=iOt;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=Jf.computeBarycentricCoordinates(t,n,F,g,I,V,N,G,CNe);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 YA=MR;var tko=x(T(),1);var Eh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},VJ=new Q;function EJ(){this._terrainCache={},this._lastTidy=Q.now()}EJ.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};EJ.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};EJ.prototype.tidy=function(){if(Q.now(VJ),Q.secondsDifference(VJ,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(VJ,r.timestamp)>10&&delete e[o]}Q.clone(VJ,this._lastTidy)}};function MT(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=new eo({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 EJ,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Se}Object.defineProperties(MT.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(){}}});MT.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new MT(t);return n._metadata=e,n};var sOt=new Qn("decodeGoogleEarthEnterprisePacket");function VNe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Eh.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}MT.prototype.requestTileGeometry=function(e,t,n,i){let o=yg.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=Eh.UNKNOWN);let d=r.get(o);if(l(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new YA({buffer:d,childTileMask:VNe(o,a,s),credits:l(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Eh.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new Nc({buffer:new Uint8Array(256),width:16,height:16}));let u,m=o,p=-1;switch(c){case Eh.SELF:p=a.terrainVersion;break;case Eh.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case Eh.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=aOt(this,m,p,_).fetchArrayBuffer();if(!l(S))return;y=S.then(function(Z){return l(Z)?sOt.scheduleTask({buffer:Z,type:"Terrain",key:s.key},[Z]).then(function(R){let C=s.getTileInformationFromQuadKey(m);C.terrainState=Eh.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=Eh.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 YA({buffer:S,childTileMask:VNe(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=Eh.NONE,Promise.reject(S))})};MT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};MT.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=yg.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===Eh.NONE)return!1;if((!l(s)||s===Eh.UNKNOWN)&&(r.terrainState=Eh.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};MT.prototype.loadTileDataAvailability=function(e,t,n){};function aOt(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 ace=MT;var cko=x(T(),1);var cOt="https://maps.googleapis.com/maps/api/geocode/json",ENe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function cce(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._resource=new ve({url:cOt,queryParameters:{key:t}}),this._credit=new Lt(ENe,!0)}Object.defineProperties(cce.prototype,{credit:{get:function(){return this._credit}}});cce.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:ENe,collapsible:!1}}})};var lce=cce;var uko=x(T(),1);var dce=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()}},uce=dce;var fko=x(T(),1),ANe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(ANe);var yy=ANe;var Wko=x(T(),1);var _ko=x(T(),1);function mce(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(mce.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});mce.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===YT.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 qU=mce;function lOt(e){if(!Object.values(yy).some(t=>t===e))throw new ge(`Invalid geocodeProviderType: "${e}"`)}var GNe=Object.freeze({[yy.GOOGLE]:"google",[yy.BING]:"bing",[yy.DEFAULT]:void 0});function dOt(e){return GNe[e]}function uOt(e){return Object.entries(GNe).find(t=>t[1]===e)[0]}function hce(e){e=e??B.EMPTY_OBJECT;let t=e.geocodeProviderType??yy.DEFAULT,n=e.accessToken??Ld.defaultAccessToken,i=ve.createIfNeeded(e.server??Ld.defaultServer);i.appendForwardSlash();let o=Ld.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 qU(r),this.geocodeProviderType=t}Object.defineProperties(hce.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return uOt(this._pelias.url.queryParameters.geocoder)},set:function(e){lOt(e);let t={...this._pelias.url.queryParameters,geocoder:dOt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});hce.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var wR=hce;var Fko=x(T(),1),LNe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(LNe);var fce=LNe;var Pko=x(T(),1),WNe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(WNe);var pce=WNe;var Nko=x(T(),1),vNe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(vNe);var $U=vNe;var Mko=x(T(),1),FNe={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(FNe);var bce=FNe;var $ko=x(T(),1);function INe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function PNe(e){let t=pe.fromCartesian(e);return{longitude:W.toDegrees(t.longitude),latitude:W.toDegrees(t.latitude),height:t.height}}function mOt(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 hOt(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 fOt=new P,pOt=new P,AJ=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??Ld.defaultAccessToken,o=ve.createIfNeeded(n.server??Ld.defaultServer);o.appendForwardSlash();let r={url:`assets/${t}/`,headers:kr._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=hOt(n,i,fOt);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,pOt),i={testPoint:PNe(t.testPoint),closePoint:PNe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??$U.NEAREST,worldToView:mOt(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=INe(o.snapPoint),r.hitPoint=INe(o.hitPoint),r}};AJ.DEFAULT_SNAP_APERTURE=12;var gce=AJ;var nUo=x(T(),1);var yce=class{constructor(){mt(this,"ellipsoid")}project(t,n){ge.throwInstantiationError()}unproject(t,n){ge.throwInstantiationError()}},xce=yce;var cUo=x(T(),1);function MA(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(MA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});MA.prototype.findTimeInterval=Fo.prototype.findTimeInterval;MA.prototype.wrapTime=Fo.prototype.wrapTime;MA.prototype.clampTime=Fo.prototype.clampTime;MA.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 Tce=MA;var bUo=x(T(),1);function _ce(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(_ce.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});_ce.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 Sce=_ce;var xUo=x(T(),1);var bOt={packedLength:void 0,pack:ge.throwInstantiationError,unpack:ge.throwInstantiationError},Zce=bOt;var SUo=x(T(),1);var gOt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:ge.throwInstantiationError,unpackInterpolationResult:ge.throwInstantiationError},Rce=gOt;var EUo=x(T(),1);var yOt=new h;function xOt(e,t,n,i){let o=w_(e,t,n,i,yOt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var Cce=xOt;var LUo=x(T(),1);function XNe(){ge.throwInstantiationError()}XNe.prototype.getURL=ge.throwInstantiationError;var Vce=XNe;var HUo=x(T(),1);function TOt(e,t,n,i,o,r,s){let a=so.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 e5(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??mn.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}e5.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};e5.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 e5({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var GJ=new Array(2),LJ=new Array(2),_Ot={positions:GJ,height:LJ,ellipsoid:void 0,minDistance:void 0,granularity:void 0};e5.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===mn.GEODESIC||o===mn.RHUMB){let C,E,A;o===mn.GEODESIC?(C=W.chordLength(r,s.maximumRadius),E=so.numberOfPoints,A=so.generateArc):(C=r,E=so.numberOfPointsRhumbLine,A=so.generateRhumbArc);let L=so.extractHeights(t,s),F=_Ot;if(o===mn.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=GJ,F.height=LJ;let N=0;for(d=0;d<u-1;++d){GJ[0]=t[d],GJ[1]=t[d+1],LJ[0]=L[d],LJ[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=TOt(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 Cn;_.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:me.fromPoints(t)})};var Ece=e5;var jUo=x(T(),1);var WJ=class{constructor(){ge.throwInstantiationError()}async snap(t){ge.throwInstantiationError()}};WJ.DEFAULT_SNAP_APERTURE=void 0;var Ace=WJ;var $Uo=x(T(),1);var Gce=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()}},Lce=Gce;var a5o=x(T(),1);function kR(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??ot.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(kR.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(kR.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=SOt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});kR.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};kR.prototype.isDestroyed=function(){return!1};kR.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};kR.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??ot.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 SOt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Wce=kR;var Z5o=x(T(),1);function ZOt(e,t){this.rectangle=e,this.maxLevel=t}function NNe(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=[]}NNe.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 ROt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new eo({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 ZOt(new re(a,c,d,u),m))}}function COt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),er.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function VOt(e,t,n){try{let i=await t.fetchXML();ROt(e,i)}catch(i){COt(t,i,n)}}function wT(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(wT.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(){}}});wT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=new NNe(t),i=ve.createIfNeeded(e);await VOt(n,i);let o=new wT(t);return n.build(o),o._resource=i,o};wT.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 Nc({buffer:Ph(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:EOt(a,e,t,n),structure:a._terrainDataStructure})})};wT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var YNe=new re;function EOt(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,YNe);l(m)&&(vJ(o,u,t*2,n*2,i+1)&&(a|=4),vJ(o,u,t*2+1,n*2,i+1)&&(a|=8),vJ(o,u,t*2,n*2+1,i+1)&&(a|=1),vJ(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function vJ(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(re.intersection(r,t,YNe))}wT.prototype.getTileDataAvailable=function(e,t,n){};wT.prototype.loadTileDataAvailability=function(e,t,n){};var vce=wT;var C5o=x(T(),1),MNe={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(MNe);var Fce=MNe;var A5o=x(T(),1);function AOt(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 Ice=AOt;var L5o=x(T(),1);function GOt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var t5=GOt;var hDo=x(T(),1);function UNe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function LOt(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 DNe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function ONe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=DNe(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 BNe(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 Xf,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),ONe(this);try{let p=t.ellipsoid??ne.default,b=new lk({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,DNe(this),BNe(this);let f=t.globe;l(f)||(f=new HY(p)),f!==!1&&(b.globe=f,b.globe.shadows=t.terrainShadows??Wn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ne.WGS84.equals(p)&&(y=hk.createEarthSkyBox()),y!==!1&&(b.skyBox=y,b.sun=new Tk,ne.WGS84.equals(p)&&(b.moon=new zw));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new mk(p),_.show=t.globe!==!1&&f.show),_!==!1&&(b.skyAtmosphere=_);let S=t.baseLayer;t.globe!==!1&&S!==!1&&(l(S)||(S=Cs.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 ta(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 $k,C=!0);let E=new UU({scene:b,dataSourceCollection:R}),A=new Jr;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&&LOt(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,Pce(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,UNe(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=Fp(n);d||(typeof n=="string"&&(n=new Error(n)),t=Fp({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e} +`;function vJ(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}vJ.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,t5]});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)}};vJ.prototype.isDestroyed=function(){return!1};vJ.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var Wce=vJ;var E5o=x(T(),1);var vce=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()}},Fce=vce;var W5o=x(T(),1);function yy(){ge.throwInstantiationError()}Object.defineProperties(yy.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}});yy.prototype.update=ge.throwInstantiationError;yy.prototype.updateViewTransforms=ge.throwInstantiationError;yy.prototype.convertLocalToShapeUvSpace=ge.throwInstantiationError;yy.prototype.computeOrientedBoundingBoxForTile=ge.throwInstantiationError;yy.prototype.computeOrientedBoundingBoxForSample=ge.throwInstantiationError;yy.DefaultMinBounds=ge.throwInstantiationError;yy.DefaultMaxBounds=ge.throwInstantiationError;var Ice=yy;var fDo=x(T(),1);function DNe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function WOt(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 ONe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function BNe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=ONe(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 zNe(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),BNe(this);try{let p=t.ellipsoid??ne.default,b=new wU({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,ONe(this),zNe(this);let f=t.globe;l(f)||(f=new pk(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=OU.createEarthSkyBox()),y!==!1&&(b.skyBox=y,b.sun=new QU,ne.WGS84.equals(p)&&(b.moon=new Fk));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new DU(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 rY,C=!0);let E=new jY({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&&WOt(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,Pce(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,DNe(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()),ue(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,ONe(this),BNe(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 WOt=new me;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??WOt)===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&&UNe(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 zNe(this,e,{offset:t},!1)};Ho.prototype.flyTo=function(e,t){return zNe(this,e,t,!0)};function zNe(e,t,n,i){Pce(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 Cs){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 YS(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof zr||r instanceof WE||r instanceof gT||r instanceof $s){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 n5(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Pce(e){let t=e._zoomPromise;l(t)&&(n5(e),e._completeZoom(!1))}Ho.prototype._postRender=function(){vOt(this),FOt(this)};var wNe=new me;function vOt(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 Lm(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)),n5(e)}if(t instanceof WE){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 gT){s(t.boundingSphere);return}if(t instanceof $s){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)),n5(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,wNe);if(p===Wt.PENDING)return;p!==Wt.FAILED&&c.push(me.clone(wNe))}if(c.length===0){Pce(e);return}e.trackedEntity=void 0;let d=me.fromBoundingSpheres(c);e._zoomIsFlight?(n5(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),n5(e),e._completeZoom(!0))}var kNe=new me;function FOt(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,kNe);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?kNe:void 0;e._entityView=new OU(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var i5=Ho;var bDo=x(T(),1);var Xce=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()}},Nce=Xce;var RDo=x(T(),1);var HNe=new h,IOt=new cn(h.UNIT_X,0),POt=new gn,XOt=new k(1,1,1);function mp(e,t,n,i=XOt){let{camera:o,ellipsoid:r}=e,s=r.scaleToGeodeticSurface(o.positionWC,HNe);if(!l(s))return;let a=h.magnitude(o.positionWC),c=h.magnitude(s),d=a<=c,u=r.geodeticSurfaceNormal(o.positionWC,HNe),m=h.dot(u,o.directionWC),p=m>0;if(d||p){let b=cn.fromPointNormal(o.positionWC,u,IOt),{clientHeight:f}=e.canvas,y=i.y*f/(2*Math.tan(o.frustum.fovy*.5));b.distance-=m*y;let _=o.getPickRay(t,POt);return Ti.rayPlane(_,b,n)}return o.pickEllipsoid(t,r,n)}var lOo=x(T(),1);var ODo=x(T(),1);var WDo=x(T(),1);var VDo=x(T(),1),KNe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(KNe);var qa=KNe;function NOt(e){if(e===qa.LEFT)return un.LEFT_DOWN;if(e===qa.MIDDLE)return un.MIDDLE_DOWN;if(e===qa.RIGHT)return un.RIGHT_DOWN}function YOt(e){if(e===qa.LEFT)return un.LEFT_UP;if(e===qa.MIDDLE)return un.MIDDLE_UP;if(e===qa.RIGHT)return un.RIGHT_UP}var Yce=class{static registerDragInputBindings(t,n,i){let o=new Set,r={isDragging:!1};for(let s of n){r.isDragging=!1;let a=NOt(s.button),c=YOt(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)},un.MOUSE_MOVE,s);return r}},hp=Yce;var Mce=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 ta(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)*wn.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}},o5=Mce;var iOo=x(T(),1);var wce=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 ta(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)*wn.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}},r5=wce;var kce=class{constructor(){this._elevatorController=new o5,this._mapController=new r5,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)}},Uce=kce;var AOo=x(T(),1);var Dce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT,modifier:tr.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 ta(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)*wn.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}},Oce=Dce;var UOo=x(T(),1);var Bce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.MIDDLE})]}static _getDefaultScrollInputs(){return[un.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 ta(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=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)*wn.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}},zce=Bce;var OOo=x(T(),1),JNe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(JNe);var Hce=JNe;var zOo=x(T(),1),Kce=`uniform sampler2D u_depthTexture; +${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()),ue(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,BNe(this),zNe(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 vOt=new me;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??vOt)===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&&DNe(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 HNe(this,e,{offset:t},!1)};Ho.prototype.flyTo=function(e,t){return HNe(this,e,t,!0)};function HNe(e,t,n,i){Pce(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 uR(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof zr||r instanceof MA||r instanceof MT||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 n5(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Pce(e){let t=e._zoomPromise;l(t)&&(n5(e),e._completeZoom(!1))}Ho.prototype._postRender=function(){FOt(this),IOt(this)};var kNe=new me;function FOt(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)),n5(e)}if(t instanceof MA){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 MT){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)),n5(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,kNe);if(p===Wt.PENDING)return;p!==Wt.FAILED&&c.push(me.clone(kNe))}if(c.length===0){Pce(e);return}e.trackedEntity=void 0;let d=me.fromBoundingSpheres(c);e._zoomIsFlight?(n5(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),n5(e),e._completeZoom(!0))}var UNe=new me;function IOt(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,UNe);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?UNe:void 0;e._entityView=new qY(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var i5=Ho;var gDo=x(T(),1);var Xce=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()}},Nce=Xce;var CDo=x(T(),1);var KNe=new h,POt=new cn(h.UNIT_X,0),XOt=new gn,NOt=new k(1,1,1);function mp(e,t,n,i=NOt){let{camera:o,ellipsoid:r}=e,s=r.scaleToGeodeticSurface(o.positionWC,KNe);if(!l(s))return;let a=h.magnitude(o.positionWC),c=h.magnitude(s),d=a<=c,u=r.geodeticSurfaceNormal(o.positionWC,KNe),m=h.dot(u,o.directionWC),p=m>0;if(d||p){let b=cn.fromPointNormal(o.positionWC,u,POt),{clientHeight:f}=e.canvas,y=i.y*f/(2*Math.tan(o.frustum.fovy*.5));b.distance-=m*y;let _=o.getPickRay(t,XOt);return xi.rayPlane(_,b,n)}return o.pickEllipsoid(t,r,n)}var dOo=x(T(),1);var BDo=x(T(),1);var vDo=x(T(),1);var EDo=x(T(),1),JNe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(JNe);var qa=JNe;function YOt(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 MOt(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 Yce=class{static registerDragInputBindings(t,n,i){let o=new Set,r={isDragging:!1};for(let s of n){r.isDragging=!1;let a=YOt(s.button),c=MOt(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=Yce;var Mce=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)*wn.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}},o5=Mce;var oOo=x(T(),1);var wce=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)*wn.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}},r5=wce;var kce=class{constructor(){this._elevatorController=new o5,this._mapController=new r5,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)}},Uce=kce;var GOo=x(T(),1);var Dce=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)*wn.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}},Oce=Dce;var DOo=x(T(),1);var Bce=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)*wn.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}},zce=Bce;var BOo=x(T(),1),jNe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(jNe);var Hce=jNe;var HOo=x(T(),1),Kce=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -12729,8 +12729,8 @@ 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 KOo=x(T(),1),jNe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(jNe);var Jce=jNe;var QOo=x(T(),1);function MOt(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: ${Fp(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 jce=MOt;globalThis.CESIUM_VERSION="1.145.0";var Upr=x(T(),1);var xdr=x(T(),1);var pdr=x(T(),1);var sdr=x(T(),1),s5;typeof ko<"u"&&(s5=ko);(function(){/*! +`;var JOo=x(T(),1),QNe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(QNe);var Jce=QNe;var qOo=x(T(),1);function wOt(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 jce=wOt;globalThis.CESIUM_VERSION="1.145.0";var Dpr=x(T(),1);var Tdr=x(T(),1);var bdr=x(T(),1);var adr=x(T(),1),s5;typeof ko<"u"&&(s5=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) @@ -12739,39 +12739,39 @@ out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); |/(?:\\\\.|[^/])+/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(M,O){function w(ee,le){var _e;if(!H){var he=f.getBindingHandler(ee);if(he&&he.preprocess&&!(le=he.preprocess(le,ee,w)))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 M=="string"?g(M):M;return f.a.D($,function(ee){w(ee.key||ee.unknown,ee.value)}),K.length&&w("_ko_property_writers","{"+K.join(",")+" }"),z.join(",")},Id:function(M,O){for(var w=0;w<M.length;w++)if(M[w].key==O)return!0;return!1},eb:function(M,O,w,z,K){M&&f.O(M)?!f.Za(M)||K&&M.v()===z||M(z):(M=O.get("_ko_property_writers"))&&M[w]&&M[w](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(w){return w.nodeType==8&&Y.test(X?w.text:w.nodeValue)}function V(w){return w.nodeType==8&&D.test(X?w.text:w.nodeValue)}function G(w,z){for(var K=w,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: "+w.nodeValue);return null}function v(w,z){var K=G(w,z);return K?0<K.length?K[K.length-1].nextSibling:w.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*$/,M={ul:!0,ol:!0},O="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(w){return g(w)?G(w):w.childNodes},Ea:function(w){if(g(w)){w=f.h.childNodes(w);for(var z=0,K=w.length;z<K;z++)f.removeNode(w[z])}else f.a.Tb(w)},va:function(w,z){if(g(w)){f.h.Ea(w);for(var K=w.nextSibling,te=0,H=z.length;te<H;te++)K.parentNode.insertBefore(z[te],K)}else f.a.va(w,z)},Vc:function(w,z){var K;g(w)?(K=w.nextSibling,w=w.parentNode):K=w.firstChild,K?z!==K&&w.insertBefore(z,K):w.appendChild(z)},Wb:function(w,z,K){K?(K=K.nextSibling,g(w)&&(w=w.parentNode),K?z!==K&&w.insertBefore(z,K):w.appendChild(z)):f.h.Vc(w,z)},firstChild:function(w){if(g(w))return!w.nextSibling||V(w.nextSibling)?null:w.nextSibling;if(w.firstChild&&V(w.firstChild))throw Error("Found invalid end comment, as the first child of "+w);return w.firstChild},nextSibling:function(w){if(g(w)&&(w=v(w)),w.nextSibling&&V(w.nextSibling)){var z=w.nextSibling;if(V(z)&&!f.a.g.get(z,O))throw Error("Found end comment without a matching opening comment, as child of "+w);return null}return w.nextSibling},Cd:g,Vd:function(w){return(w=(X?w.text:w.nodeValue).match(Y))?w[1]:null},Sc:function(w){if(M[f.a.R(w)]){var z=w.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?w.insertBefore(K[H],te):w.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 M,O="with($context){with($data||{}){return{"+f.m.vb(g,v)+"}}}";M=new Function("$context","$element",O),D=X[Y]=M}return D(V,G)}catch(w){throw w.message=`Unable to parse bindings. Bindings value: `+g+` Message: `+w.message,w}}}),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 M(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)]&&M(ye,Ze)}function w(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=w(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||M(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,M){var O=Object.prototype.hasOwnProperty.call(X,D)?X[D]:g,w;O?O.subscribe(M):(O=X[D]=new f.T,O.subscribe(M),G(D,function(z,K){var te=!(!K||!K.synchronous);Y[D]={definition:z,Gd:te},delete X[D],w||te?O.notifySubscribers(z):f.na.zb(function(){O.notifySubscribers(z)})}),w=!0)}function G(D,M){v("getConfig",[D],function(O){O?v("loadComponent",[D,O],function(w){M(w,O)}):M(null,null)})}function v(D,M,O,w){w||(w=f.j.loaders.slice(0));var z=w.shift();if(z){var K=z[D];if(K){var te=!1;if(K.apply(z,M.concat(function(H){te?O(null):H!==null?O(H):v(D,M,O,w)}))!==g&&(te=!0,!z.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else v(D,M,O,w)}else O(null)}var X={},Y={};f.j={get:function(D,M){var O=Object.prototype.hasOwnProperty.call(Y,D)?Y[D]:g;O?O.Gd?f.u.G(function(){M(O.definition)}):f.na.zb(function(){M(O.definition)}):V(D,M)},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,w,z,K){function te(){--$===0&&K(H)}var H={},$=2,ee=z.template;z=z.viewModel,ee?X(w,ee,function(le){f.j.oc("loadTemplate",[O,le],function(_e){H.template=_e,te()})}):te(),z?X(w,z,function(le){f.j.oc("loadViewModel",[O,le],function(_e){H[M]=_e,te()})}):te()}function V(O,w,z){if(typeof w=="function")z(function(te){return new w(te)});else if(typeof w[M]=="function")z(w[M]);else if("instance"in w){var K=w.instance;z(function(){return K})}else"viewModel"in w?V(O,w.viewModel,z):O("Unknown viewModel value: "+w)}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,w,z){typeof w.require=="string"?a||t.require?(a||t.require)([w.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(w)}function Y(O){return function(w){throw Error("Component '"+O+"': "+w)}}var D={};f.j.register=function(O,w){if(!w)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");D[O]=w},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,w){w(f.j.tb(O)?D[O]:null)},loadComponent:function(O,w,z){var K=Y(O);X(K,w,function(te){g(O,K,te,z)})},loadTemplate:function(O,w,z){if(O=Y(O),typeof w=="string")z(f.a.ua(w));else if(w instanceof Array)z(w);else if(v(w))z(f.a.la(w.childNodes));else if(w.element)if(w=w.element,t.HTMLElement?w instanceof HTMLElement:w&&w.tagName&&w.nodeType===1)z(G(w));else if(typeof w=="string"){var K=n.getElementById(w);K?z(G(K)):O("Cannot find element with ID "+w)}else O("Unknown element type: "+w);else O("Unknown template value: "+w)},loadViewModel:function(O,w,z){V(Y(O),w,z)}};var M="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(M){return f.o(M,null,{l:G})}),Y=f.a.Ga(X,function(M){var O=M.v();return M.ja()?f.o({read:function(){return f.a.f(M())},write:f.Za(O)&&function(w){M()(w)},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 M={name:D,params:g(v,X)};G.component=Y?function(){return M}:M}}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,M){function O(){var H=w&&w.dispose;typeof H=="function"&&H.call(w),K&&K.s(),z=w=K=null}var w,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,M),_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)),w=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||!M&&!f.S.qa())){var ee=f.u.G(V);if(w){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();w?(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",M=g.type=="radio";if(D||M){var O=V(),w=D&&f.a.f(O)instanceof Array,z=!(w&&O.push&&O.splice),K=M||w,te=w?Y():e;M&&!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(M){var O,w=V()[D];if(w){try{var z=f.a.la(arguments);v=X.$data,z.unshift(v),O=w.apply(v,z)}finally{O!==!0&&(M.preventDefault?M.preventDefault():M.returnValue=!1)}G.get(D+"Bubble")===!1&&(M.cancelBubble=!0,M.stopPropagation&&M.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 M=g.ownerDocument;if("activeElement"in M){var O;try{O=M.activeElement}catch{O=M.body}D=O===g}M=V(),f.m.eb(M,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,M,O){var w,z,K={},te,H,$;if(G){M=D.get("as");var ee=D.get("noChildContext");$=!(M&&ee),K={as:M,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!==w)&&(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)),w=_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&&w)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,M=g.length!=0&&D?g.scrollTop:null,O=f.a.f(V()),w=G.get("valueAllowUnset")&&G.has("value"),z=G.get("optionsIncludeDestroyed");V={};var K,te=[];w||(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=!w&&_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),!w){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"])}(w||f.S.Ya())&&f.i.ma(g,f.i.H),f.a.wd(g),M&&20<Math.abs(M-g.scrollTop)&&(g.scrollTop=M)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(g,V,G){function v(){var D=V(),M=[];f.a.D(g.getElementsByTagName("option"),function(O){O.selected&&M.push(f.w.M(O))}),f.m.eb(D,G,"selectedOptions",M)}function X(){var D=f.a.f(V()),M=g.scrollTop;D&&typeof D.length=="number"&&f.a.D(g.getElementsByTagName("option"),function(O){var w=0<=f.a.A(D,f.w.M(O));O.selected!=w&&f.a.Zc(O,w)}),g.scrollTop=M}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,M){return M.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,M=V();try{D=M.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 M=f.a.g.Z(),O=f.a.g.Z(),w=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,M)||(f.a.g.set(H,M,!0),f.a.B(H,"selectionchange",w)),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"),M=!1,O=null;D&&(typeof D=="string"?Y=[D]:Y=f.a.wc(D),f.a.Pa(Y,"change"));var w=function(){O=null,M=!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(){M=!0}),f.a.B(g,"focus",function(){M=!1}),f.a.B(g,"blur",function(){M&&w()})),f.a.D(Y,function(te){var H=w;f.a.Ud(te,"after")&&(H=function(){O=f.w.M(g),f.a.setTimeout(w,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(w)}: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(w)):f.w.cb(g,te))},v==="select"){var K;f.i.subscribe(g,f.i.H,function(){K?G.get("valueAllowUnset")?z():w():(f.a.B(g,"change",w),K=f.o(z,null,{l:g}))},null,{notifyImmediately:!0})}else f.a.B(g,"change",w),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 M=f.m.Ra,O=0;O<v.length;O++){var w=v[O].key;if(Object.prototype.hasOwnProperty.call(M,w)){var z=M[w];if(typeof z=="function"){if(w=z(v[O].value))throw Error(w)}else if(!z)throw Error("This template engine does not support the '"+w+"' 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,M,O,w){return g(w,D,M,X)}).replace(G,function(Y,D){return g(D,"<!-- ko -->","#comment",X)})},md:function(v,X){return f.aa.Xb(function(Y,D){var M=Y.nextSibling;M&&M.nodeName.toLowerCase()===X&&f.ib(M,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,w,z){var K;for(w=f.h.nextSibling(w);O&&(K=O)!==w;)O=f.h.nextSibling(K),z(K,O)}function V(O,w){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(w,ee)}),g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[w])}),f.a.Ua(O,te)}}function G(O){return O.nodeType?O:0<O.length?O[0]:null}function v(O,w,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,w){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: "+w)}return H&&(V(z,K),te.afterRender&&f.u.G(te.afterRender,null,[z,K[te.as||"$data"]]),w=="replaceChildren"&&f.i.ma(O,f.i.H)),z}function X(O,w,z){return f.O(O)?O():typeof O=="function"?O(w,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,w,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=w&&w instanceof f.fa?w:new f.fa(w,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,w,z,$,"replaceNode")})},f.Qd=function(O,w,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(w))return f.$(function(){var ye=f.a.f(w)||[];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(w.v());var Ze=w.subscribe(function(ye){H(w(),ye)},null,"arrayChange");return Ze.l(K),Ze};var D=f.a.g.Z(),M=f.a.g.Z();f.c.template={init:function(O,w){var z=f.a.f(w());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,M)||(K=f.a.Yb(z),f.a.g.set(K,M,!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,w,z,K,te){var H=w();w=f.a.f(H),z=!0,K=null,typeof w=="string"?w={}:(H="name"in w?w.name:O,"if"in w&&(z=f.a.f(w.if)),z&&"ifnot"in w&&(z=!f.a.f(w.ifnot)),z&&!H&&(z=!1)),"foreach"in w?K=f.Qd(H,z&&w.foreach||[],w,O,te):z?(z=te,"data"in w&&(z=te.createChildContext(w.data,{as:w.as,noChildContext:w.noChildContext,exportDependencies:!0})),K=f.dc(H,z,w,O)):f.h.Ea(O),te=K,(w=f.a.g.get(O,D))&&typeof w.s=="function"&&w.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,M;for(v=X=0;(!G||v<G)&&(D=g[X]);++X){for(Y=0;M=V[Y];++Y)if(D.value===M.value){D.moved=M.index,M.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,M=Math.max,O=[],w,z=V.length,K,te=G.length,H=te-z||1,$=z+te+1,ee,le,_e;for(w=0;w<=z;w++)for(le=ee,O.push(ee=[]),_e=D(te,w+H),K=M(0,w-1);K<=_e;K++)ee[K]=K?w?V[w-1]===G[K-1]?le[K-1]:D(le[K]||$,ee[K-1]||$)+1:K+1:w+1;for(D=[],M=[],H=[],w=z,K=te;w||K;)te=O[w][K]-1,K&&te===O[w][K-1]?M.push(D[D.length]={status:v,value:G[--K],index:K}):w&&te===O[w-1][K]?H.push(D[D.length]={status:X,value:V[--w],index:w}):(--K,--w,Y.sparse||D.push({status:"retained",value:G[K]}));return f.a.Kc(H,M,!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,M){var O=[],w=f.$(function(){var z=X(Y,M,f.a.Ua(O,v))||[];0<O.length&&(f.a.Xc(O,z),D&&f.u.G(D,null,[Y,z,M])),O.length=0,f.a.Nb(O,z)},null,{l:v,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:w.ja()?w:e}}var V=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(v,X,Y,D,M,O){function w(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,w);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)):w(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,M,Ae.pb)),X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We);!Ae.Ed&&M&&(M(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 wOt=ko;typeof window<"u"?(ko=window.ko,typeof s5<"u"?window.ko=s5:delete window.ko):(ko=global.ko,typeof s5<"u"?global.ko=s5:delete global.ko);var UR=wOt;var cdr=x(T(),1);/** +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||M(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,M){var O=Object.prototype.hasOwnProperty.call(X,D)?X[D]:g,w;O?O.subscribe(M):(O=X[D]=new f.T,O.subscribe(M),G(D,function(z,K){var te=!(!K||!K.synchronous);Y[D]={definition:z,Gd:te},delete X[D],w||te?O.notifySubscribers(z):f.na.zb(function(){O.notifySubscribers(z)})}),w=!0)}function G(D,M){v("getConfig",[D],function(O){O?v("loadComponent",[D,O],function(w){M(w,O)}):M(null,null)})}function v(D,M,O,w){w||(w=f.j.loaders.slice(0));var z=w.shift();if(z){var K=z[D];if(K){var te=!1;if(K.apply(z,M.concat(function(H){te?O(null):H!==null?O(H):v(D,M,O,w)}))!==g&&(te=!0,!z.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else v(D,M,O,w)}else O(null)}var X={},Y={};f.j={get:function(D,M){var O=Object.prototype.hasOwnProperty.call(Y,D)?Y[D]:g;O?O.Gd?f.u.G(function(){M(O.definition)}):f.na.zb(function(){M(O.definition)}):V(D,M)},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,w,z,K){function te(){--$===0&&K(H)}var H={},$=2,ee=z.template;z=z.viewModel,ee?X(w,ee,function(le){f.j.oc("loadTemplate",[O,le],function(_e){H.template=_e,te()})}):te(),z?X(w,z,function(le){f.j.oc("loadViewModel",[O,le],function(_e){H[M]=_e,te()})}):te()}function V(O,w,z){if(typeof w=="function")z(function(te){return new w(te)});else if(typeof w[M]=="function")z(w[M]);else if("instance"in w){var K=w.instance;z(function(){return K})}else"viewModel"in w?V(O,w.viewModel,z):O("Unknown viewModel value: "+w)}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,w,z){typeof w.require=="string"?a||t.require?(a||t.require)([w.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(w)}function Y(O){return function(w){throw Error("Component '"+O+"': "+w)}}var D={};f.j.register=function(O,w){if(!w)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");D[O]=w},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,w){w(f.j.tb(O)?D[O]:null)},loadComponent:function(O,w,z){var K=Y(O);X(K,w,function(te){g(O,K,te,z)})},loadTemplate:function(O,w,z){if(O=Y(O),typeof w=="string")z(f.a.ua(w));else if(w instanceof Array)z(w);else if(v(w))z(f.a.la(w.childNodes));else if(w.element)if(w=w.element,t.HTMLElement?w instanceof HTMLElement:w&&w.tagName&&w.nodeType===1)z(G(w));else if(typeof w=="string"){var K=n.getElementById(w);K?z(G(K)):O("Cannot find element with ID "+w)}else O("Unknown element type: "+w);else O("Unknown template value: "+w)},loadViewModel:function(O,w,z){V(Y(O),w,z)}};var M="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(M){return f.o(M,null,{l:G})}),Y=f.a.Ga(X,function(M){var O=M.v();return M.ja()?f.o({read:function(){return f.a.f(M())},write:f.Za(O)&&function(w){M()(w)},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 M={name:D,params:g(v,X)};G.component=Y?function(){return M}:M}}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,M){function O(){var H=w&&w.dispose;typeof H=="function"&&H.call(w),K&&K.s(),z=w=K=null}var w,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,M),_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)),w=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||!M&&!f.S.qa())){var ee=f.u.G(V);if(w){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();w?(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",M=g.type=="radio";if(D||M){var O=V(),w=D&&f.a.f(O)instanceof Array,z=!(w&&O.push&&O.splice),K=M||w,te=w?Y():e;M&&!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(M){var O,w=V()[D];if(w){try{var z=f.a.la(arguments);v=X.$data,z.unshift(v),O=w.apply(v,z)}finally{O!==!0&&(M.preventDefault?M.preventDefault():M.returnValue=!1)}G.get(D+"Bubble")===!1&&(M.cancelBubble=!0,M.stopPropagation&&M.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 M=g.ownerDocument;if("activeElement"in M){var O;try{O=M.activeElement}catch{O=M.body}D=O===g}M=V(),f.m.eb(M,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,M,O){var w,z,K={},te,H,$;if(G){M=D.get("as");var ee=D.get("noChildContext");$=!(M&&ee),K={as:M,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!==w)&&(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)),w=_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&&w)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,M=g.length!=0&&D?g.scrollTop:null,O=f.a.f(V()),w=G.get("valueAllowUnset")&&G.has("value"),z=G.get("optionsIncludeDestroyed");V={};var K,te=[];w||(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=!w&&_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),!w){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"])}(w||f.S.Ya())&&f.i.ma(g,f.i.H),f.a.wd(g),M&&20<Math.abs(M-g.scrollTop)&&(g.scrollTop=M)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(g,V,G){function v(){var D=V(),M=[];f.a.D(g.getElementsByTagName("option"),function(O){O.selected&&M.push(f.w.M(O))}),f.m.eb(D,G,"selectedOptions",M)}function X(){var D=f.a.f(V()),M=g.scrollTop;D&&typeof D.length=="number"&&f.a.D(g.getElementsByTagName("option"),function(O){var w=0<=f.a.A(D,f.w.M(O));O.selected!=w&&f.a.Zc(O,w)}),g.scrollTop=M}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,M){return M.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,M=V();try{D=M.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 M=f.a.g.Z(),O=f.a.g.Z(),w=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,M)||(f.a.g.set(H,M,!0),f.a.B(H,"selectionchange",w)),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"),M=!1,O=null;D&&(typeof D=="string"?Y=[D]:Y=f.a.wc(D),f.a.Pa(Y,"change"));var w=function(){O=null,M=!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(){M=!0}),f.a.B(g,"focus",function(){M=!1}),f.a.B(g,"blur",function(){M&&w()})),f.a.D(Y,function(te){var H=w;f.a.Ud(te,"after")&&(H=function(){O=f.w.M(g),f.a.setTimeout(w,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(w)}: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(w)):f.w.cb(g,te))},v==="select"){var K;f.i.subscribe(g,f.i.H,function(){K?G.get("valueAllowUnset")?z():w():(f.a.B(g,"change",w),K=f.o(z,null,{l:g}))},null,{notifyImmediately:!0})}else f.a.B(g,"change",w),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 M=f.m.Ra,O=0;O<v.length;O++){var w=v[O].key;if(Object.prototype.hasOwnProperty.call(M,w)){var z=M[w];if(typeof z=="function"){if(w=z(v[O].value))throw Error(w)}else if(!z)throw Error("This template engine does not support the '"+w+"' 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,M,O,w){return g(w,D,M,X)}).replace(G,function(Y,D){return g(D,"<!-- ko -->","#comment",X)})},md:function(v,X){return f.aa.Xb(function(Y,D){var M=Y.nextSibling;M&&M.nodeName.toLowerCase()===X&&f.ib(M,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,w,z){var K;for(w=f.h.nextSibling(w);O&&(K=O)!==w;)O=f.h.nextSibling(K),z(K,O)}function V(O,w){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(w,ee)}),g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[w])}),f.a.Ua(O,te)}}function G(O){return O.nodeType?O:0<O.length?O[0]:null}function v(O,w,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,w){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: "+w)}return H&&(V(z,K),te.afterRender&&f.u.G(te.afterRender,null,[z,K[te.as||"$data"]]),w=="replaceChildren"&&f.i.ma(O,f.i.H)),z}function X(O,w,z){return f.O(O)?O():typeof O=="function"?O(w,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,w,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=w&&w instanceof f.fa?w:new f.fa(w,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,w,z,$,"replaceNode")})},f.Qd=function(O,w,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(w))return f.$(function(){var ye=f.a.f(w)||[];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(w.v());var Ze=w.subscribe(function(ye){H(w(),ye)},null,"arrayChange");return Ze.l(K),Ze};var D=f.a.g.Z(),M=f.a.g.Z();f.c.template={init:function(O,w){var z=f.a.f(w());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,M)||(K=f.a.Yb(z),f.a.g.set(K,M,!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,w,z,K,te){var H=w();w=f.a.f(H),z=!0,K=null,typeof w=="string"?w={}:(H="name"in w?w.name:O,"if"in w&&(z=f.a.f(w.if)),z&&"ifnot"in w&&(z=!f.a.f(w.ifnot)),z&&!H&&(z=!1)),"foreach"in w?K=f.Qd(H,z&&w.foreach||[],w,O,te):z?(z=te,"data"in w&&(z=te.createChildContext(w.data,{as:w.as,noChildContext:w.noChildContext,exportDependencies:!0})),K=f.dc(H,z,w,O)):f.h.Ea(O),te=K,(w=f.a.g.get(O,D))&&typeof w.s=="function"&&w.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,M;for(v=X=0;(!G||v<G)&&(D=g[X]);++X){for(Y=0;M=V[Y];++Y)if(D.value===M.value){D.moved=M.index,M.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,M=Math.max,O=[],w,z=V.length,K,te=G.length,H=te-z||1,$=z+te+1,ee,le,_e;for(w=0;w<=z;w++)for(le=ee,O.push(ee=[]),_e=D(te,w+H),K=M(0,w-1);K<=_e;K++)ee[K]=K?w?V[w-1]===G[K-1]?le[K-1]:D(le[K]||$,ee[K-1]||$)+1:K+1:w+1;for(D=[],M=[],H=[],w=z,K=te;w||K;)te=O[w][K]-1,K&&te===O[w][K-1]?M.push(D[D.length]={status:v,value:G[--K],index:K}):w&&te===O[w-1][K]?H.push(D[D.length]={status:X,value:V[--w],index:w}):(--K,--w,Y.sparse||D.push({status:"retained",value:G[K]}));return f.a.Kc(H,M,!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,M){var O=[],w=f.$(function(){var z=X(Y,M,f.a.Ua(O,v))||[];0<O.length&&(f.a.Xc(O,z),D&&f.u.G(D,null,[Y,z,M])),O.length=0,f.a.Nb(O,z)},null,{l:v,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:w.ja()?w:e}}var V=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(v,X,Y,D,M,O){function w(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,w);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)):w(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,M,Ae.pb)),X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We);!Ae.Ed&&M&&(M(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 kOt=ko;typeof window<"u"?(ko=window.ko,typeof s5<"u"?window.ko=s5:delete window.ko):(ko=global.ko,typeof s5<"u"?global.ko=s5:delete global.ko);var UR=kOt;var ldr=x(T(),1);/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Qce="__knockoutObservables",qce="__knockoutSubscribable";function QNe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=qNe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Qce||o===qce)&&!(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&&UOt(n,a)}}),e}function qNe(e,t){var n=e[Qce];return!n&&t&&(n={},Object.defineProperty(e,Qce,{value:n})),n}function kOt(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),QNe.call(i,e,[t]),e}function UOt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=DOt(e,t,i))})}function DOt(e,t,n){var i=OOt(e,n);return i.subscribe(t)}function OOt(e,t){var n=t[qce];if(!n){n=new e.subscribable,Object.defineProperty(t,qce,{value:n});var i={};BOt(t,n,i),zOt(e,t,n,i)}return n}function BOt(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 zOt(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 $Ne(e,t){if(!e)return null;var n=qNe(e,!1);return n&&n[t]||null}function HOt(e,t){var n=$Ne(e,t);n&&n.valueHasMutated()}function KOt(e){e.track=QNe,e.getObservable=$Ne,e.valueHasMutated=HOt,e.defineProperty=kOt}var a5={attachToKo:KOt};var ddr=x(T(),1),eYe="http://www.w3.org/2000/svg",tYe="cesium-svgPath-svg",JOt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(eYe,"svg:svg");i.setAttribute("class",tYe);let o=document.createElementNS(eYe,"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",`${tYe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},c5=JOt;a5.attachToKo(UR);c5.register(UR);var Ee=UR;function l5(e){l(e)||(e=new Xf),this._clock=e,this._eventHelper=new Jr,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(l5.prototype,{clock:{get:function(){return this._clock}}});l5.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};l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var d5=l5;var Sdr=x(T(),1);function jOt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,ge.throwInstantiationError()}var $ce=jOt;var Adr=x(T(),1);function QOt(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=QOt;var vdr=x(T(),1);var wA={};wA.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};wA.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};wA.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};wA.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};wA.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 fu=wA;var Pdr=x(T(),1);function qOt(e,t,n,i,o){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,o)}var Sc=qOt;var kdr=x(T(),1);function nYe(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(nYe.prototype,{command:{get:function(){return this._command}}});var kT=nYe;var tur=x(T(),1);var Hdr=x(T(),1);function $Ot(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 ele(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var eBt=new gn,tBt=new h;function u5(e,t){let n=this,i=e.canvas,o=new ta(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 Hg({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 oY({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=ele(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Fn(function(){let d=n.depthFrustum-1;return n.depthFrustum=ele(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 Vk({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,un.LEFT_CLICK):o.removeInputAction(un.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,eBt),b=r.pick(p,n._scene,tBt);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,un.LEFT_CLICK):o.removeInputAction(un.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(u5.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}}});u5.prototype._update=function(){this.frustums&&(this.frustumStatisticText=$Ot(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=ele(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}`};u5.prototype.isDestroyed=function(){return!1};u5.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 m5=u5;function FJ(e,t){e=Nn(e);let n=document.createElement("div"),i=new m5(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,c=fu.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"),M=document.createElement("tr"),O=document.createElement("tr"),w=document.createElement("td");w.appendChild(N);let z=document.createElement("td");z.appendChild(g);let K=document.createElement("td");K.appendChild(V),M.appendChild(w),M.appendChild(z),M.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(M),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(FJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FJ.prototype.isDestroyed=function(){return!1};FJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var h5=FJ;var fur=x(T(),1);var aur=x(T(),1);function iYe(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=Cs.fromProviderAsync(S[p]);y.add(R,0),this._currentImageryLayers.push(R)}}else{this._currentImageryLayers=[];let Z=Cs.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 u0),this._globe.terrainProvider=p;else if(l(p)){let b=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{b=!0,f()}),_=new Rk(p).readyEvent.addEventListener(S=>{b||(this._globe.depthTestAgainstTerrain=!(S instanceof u0),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(iYe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var f5=iYe;function IJ(e,t){e=Nn(e);let n=new f5(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(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 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),ue(this)};var p5=IJ;var Rur=x(T(),1);var Tur=x(T(),1);function oYe(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(oYe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var mr=oYe;function nBt(){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 Ub({style:kb.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 Ub({style:kb.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 Ub({style:kb.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 ib.fromBasemapType(vh.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 ib.fromBasemapType(vh.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 ib.fromBasemapType(vh.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 zg({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 zg({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var Qce="__knockoutObservables",qce="__knockoutSubscribable";function qNe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=$Ne(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Qce||o===qce)&&!(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&&DOt(n,a)}}),e}function $Ne(e,t){var n=e[Qce];return!n&&t&&(n={},Object.defineProperty(e,Qce,{value:n})),n}function UOt(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),qNe.call(i,e,[t]),e}function DOt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=OOt(e,t,i))})}function OOt(e,t,n){var i=BOt(e,n);return i.subscribe(t)}function BOt(e,t){var n=t[qce];if(!n){n=new e.subscribable,Object.defineProperty(t,qce,{value:n});var i={};zOt(t,n,i),HOt(e,t,n,i)}return n}function zOt(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 HOt(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 eYe(e,t){if(!e)return null;var n=$Ne(e,!1);return n&&n[t]||null}function KOt(e,t){var n=eYe(e,t);n&&n.valueHasMutated()}function JOt(e){e.track=qNe,e.getObservable=eYe,e.valueHasMutated=KOt,e.defineProperty=UOt}var a5={attachToKo:JOt};var udr=x(T(),1),tYe="http://www.w3.org/2000/svg",nYe="cesium-svgPath-svg",jOt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(tYe,"svg:svg");i.setAttribute("class",nYe);let o=document.createElementNS(tYe,"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",`${nYe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},c5=jOt;a5.attachToKo(UR);c5.register(UR);var Ee=UR;function l5(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(l5.prototype,{clock:{get:function(){return this._clock}}});l5.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};l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var d5=l5;var Zdr=x(T(),1);function QOt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,ge.throwInstantiationError()}var $ce=QOt;var Gdr=x(T(),1);function qOt(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=qOt;var Fdr=x(T(),1);var wA={};wA.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};wA.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};wA.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};wA.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};wA.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 fu=wA;var Xdr=x(T(),1);function $Ot(e,t,n,i,o){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,o)}var Sc=$Ot;var Udr=x(T(),1);function iYe(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(iYe.prototype,{command:{get:function(){return this._command}}});var kT=iYe;var tur=x(T(),1);var Kdr=x(T(),1);function oYe(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 qU(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(oYe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var u5=oYe;function FJ(e,t){e=Nn(e);let n=new u5(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(FJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FJ.prototype.isDestroyed=function(){return!1};FJ.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),ue(this)};var m5=FJ;var uur=x(T(),1);var aur=x(T(),1);function rYe(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(rYe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var mr=rYe;function eBt(){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 Jb({style:Kb.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 Jb({style:Kb.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 Jb({style:Kb.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 zb.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 zb.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 zb.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 ly({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 ly({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 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 zg({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> +https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new ly({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 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 zg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> +https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new ly({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 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 zg({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> +https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new ly({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 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 Ql.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 Ql.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 Ql.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 Ql.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 Ql.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 Ql.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 Ql.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 Ql.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 Ql.fromAssetId(3891169)}})),e}var b5=nBt;var Aur=x(T(),1);function iBt(){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 u0({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 lR({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var g5=iBt;var Fur=x(T(),1);var Al="http://www.w3.org/2000/svg",cYe="http://www.w3.org/1999/xlink",PJ,y5=U.fromCssColorString("rgba(247,250,255,0.384)"),XJ=U.fromCssColorString("rgba(143,191,255,0.216)"),tle=U.fromCssColorString("rgba(153,197,255,0.098)"),NJ=U.fromCssColorString("rgba(255,255,255,0.086)"),oBt=U.fromCssColorString("rgba(255,255,255,0.267)"),rBt=U.fromCssColorString("rgba(255,255,255,0)"),rYe=U.fromCssColorString("rgba(66,67,68,0.3)"),sYe=U.fromCssColorString("rgba(0,0,0,0.5)");function UT(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var x5={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(cYe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function ile(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 sBt(e,t){let n=ile(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 aBt(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 cBt(e,t){let n=ile(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 lBt(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 aYe(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 dBt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var YJ=new U;function zs(e,t){let n=t.alpha,i=1-n;return YJ.red=e.red*i+t.red*n,YJ.green=e.green*i+t.green*n,YJ.blue=e.blue*i+t.blue*n,YJ.toCssColorString()}function nle(e,t,n){let i=x5[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 uBt(e,t,n){let i=x5[n],o=x5.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 mBt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&PJ!==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?(PJ=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=b):b<f?n.slower():b>f&&n.faster(),t.preventDefault()}else e===PJ&&(PJ=void 0),n.shuttleRingDragging=!1}function xy(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)]}xy.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)};xy.prototype.isDestroyed=function(){return!1};xy.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")}};xy.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")))};xy.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function kA(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",cYe);let s=document.createElementNS(Al,"g");this._topG=s,this._realtimeSVG=new xy(uBt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new xy(nle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new xy(nle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new xy(nle(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=x5.animation_pathSwooshFX,u=x5.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=sBt(0,-24);this._knobDate=y.element;let _=cBt(0,-7);this._knobTime=_.element,this._knobStatus=ile(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){mBt(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=[],aYe(this,y.parts,function(L,F){t.adjustDate(L,F)}),aYe(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){dBt(R._shuttleRingPointer,R._knobOuter,L)}),Sc(t,"dateLabel",function(L){R._knobDate.textContent!==L&&aBt(y,L)}),Sc(t,"timeLabel",function(L){R._knobTime.textContent!==L&&lBt(_,L)}),Sc(t,"multiplierLabel",function(L){E.textContent!==L&&(E.textContent=L)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(kA.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kA.prototype.isDestroyed=function(){return!1};kA.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 ue(this)};kA.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};kA.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=UT(this._themeNormal),n=UT(this._themeHover),i=UT(this._themeSelect),o=UT(this._themeDisabled),r=UT(this._themeKnob),s=UT(this._themePointer),a=UT(this._themeSwoosh),c=UT(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,y5)},{tagName:"stop",offset:"12%","stop-color":zs(t,XJ)},{tagName:"stop",offset:"46%","stop-color":zs(t,tle)},{tagName:"stop",offset:"81%","stop-color":zs(t,NJ)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(n,y5)},{tagName:"stop",offset:"12%","stop-color":zs(n,XJ)},{tagName:"stop",offset:"46%","stop-color":zs(n,tle)},{tagName:"stop",offset:"81%","stop-color":zs(n,NJ)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(i,y5)},{tagName:"stop",offset:"12%","stop-color":zs(i,XJ)},{tagName:"stop",offset:"46%","stop-color":zs(i,tle)},{tagName:"stop",offset:"81%","stop-color":zs(i,NJ)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(o,oBt)},{tagName:"stop",offset:"75%","stop-color":zs(o,rBt)}]},{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,sYe)},{tagName:"stop",offset:"100%","stop-color":zs(s,sYe)}]},{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,y5)},{tagName:"stop",offset:"60%","stop-color":zs(r,rYe)},{tagName:"stop",offset:"85%","stop-color":zs(r,XJ)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,rYe)},{tagName:"stop",offset:"60%","stop-color":zs(r,y5)},{tagName:"stop",offset:"85%","stop-color":zs(r,NJ)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var T5=kA;var kur=x(T(),1);var hBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DT=15,UA=105,fBt=[31,28,31,30,31,30,31,31,30,31,30,31];function pBt(e,t){return t===2&&Il(e)?29:fBt[t-1]}function lYe(e,t,n){return Q.fromGregorianDate(new Ih(t,n,Math.min(e.day,pBt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function dYe(e,t){return e-t}function ole(e,t){let n=Go(t,e,dYe);return n<0?~n:n}function bBt(e,t){if(Math.abs(e)<=DT)return e/DT;let n=DT,i=UA,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 gBt(e,t,n){if(n.clockStep===Oo.SYSTEM_CLOCK)return DT;if(Math.abs(e)<=1)return e*DT;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=DT,r=UA,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 pu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=pu.defaultDateFormatter,this._timeFormatter=pu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(pu.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 gBt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,UA),-UA);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===UA){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=bBt(s,a);if(t.snapToTicks)d=a[ole(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>DT?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===Vs.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m;if(a===Vs.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===Vs.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 kT(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 kT(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 kT(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 kT(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=ole(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=ole(c,a)+1;d<a.length&&(s.multiplier=a[d])})}pu.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${hBt[n.month-1]} ${n.day} ${n.year}`};pu.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];pu.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`};pu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};pu.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(dYe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);ti(s,r),this._allShuttleRingTicks=s};pu.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=lYe(o,c,d)}else{let s=Math.min(Math.max(o.year+t,1),9999);r=lYe(o,s,o.month)}Q.equals(i,r)||(n.shouldAnimate=!1,n.currentTime=r)};pu.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(pu.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}}});pu._maxShuttleRingAngle=UA;pu._realtimeShuttleRingAngle=DT;var _5=pu;var emr=x(T(),1);var Hur=x(T(),1);function MJ(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(MJ.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});MJ.prototype.isDestroyed=function(){return!1};MJ.prototype.destroy=function(){document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var S5=MJ;var yBt="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",xBt="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 wJ(e,t){e=Nn(e);let n=new S5(t,e);n._exitFullScreenPath=xBt,n._enterFullScreenPath=yBt;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(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 this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Z5=wJ;var mmr=x(T(),1);var rmr=x(T(),1);function TBt(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 mYe(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)},un.MOUSE_MOVE):(e._eventHandler.removeInputAction(un.MOUSE_MOVE),e.picking=e.picking)}var _Bt={maximumFractionDigits:3};function R5(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,_Bt):Math.round(t).toLocaleString()}function C5(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[cr.PICK]:e._statisticsPerPass[cr.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>${R5(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${R5(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${R5(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function hYe(){let e=Yi.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 ed.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 ed.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 ed.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 Tx.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 ed.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 ed.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 ed.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 ed.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 ed.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 ed.fromAssetId(3891169)}})),e}var h5=eBt;var pur=x(T(),1);function tBt(){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 KZ({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var f5=tBt;var Tur=x(T(),1);var Al="http://www.w3.org/2000/svg",lYe="http://www.w3.org/1999/xlink",IJ,p5=U.fromCssColorString("rgba(247,250,255,0.384)"),PJ=U.fromCssColorString("rgba(143,191,255,0.216)"),ele=U.fromCssColorString("rgba(153,197,255,0.098)"),XJ=U.fromCssColorString("rgba(255,255,255,0.086)"),nBt=U.fromCssColorString("rgba(255,255,255,0.267)"),iBt=U.fromCssColorString("rgba(255,255,255,0)"),sYe=U.fromCssColorString("rgba(66,67,68,0.3)"),aYe=U.fromCssColorString("rgba(0,0,0,0.5)");function UT(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var b5={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(lYe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function nle(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 oBt(e,t){let n=nle(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 rBt(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 sBt(e,t){let n=nle(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 aBt(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 cYe(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 cBt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var NJ=new U;function zs(e,t){let n=t.alpha,i=1-n;return NJ.red=e.red*i+t.red*n,NJ.green=e.green*i+t.green*n,NJ.blue=e.blue*i+t.blue*n,NJ.toCssColorString()}function tle(e,t,n){let i=b5[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 lBt(e,t,n){let i=b5[n],o=b5.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 dBt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&IJ!==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?(IJ=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=b):b<f?n.slower():b>f&&n.faster(),t.preventDefault()}else e===IJ&&(IJ=void 0),n.shuttleRingDragging=!1}function xy(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)]}xy.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)};xy.prototype.isDestroyed=function(){return!1};xy.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")}};xy.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")))};xy.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function kA(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",lYe);let s=document.createElementNS(Al,"g");this._topG=s,this._realtimeSVG=new xy(lBt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new xy(tle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new xy(tle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new xy(tle(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=b5.animation_pathSwooshFX,u=b5.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=oBt(0,-24);this._knobDate=y.element;let _=sBt(0,-7);this._knobTime=_.element,this._knobStatus=nle(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){dBt(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=[],cYe(this,y.parts,function(L,F){t.adjustDate(L,F)}),cYe(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){cBt(R._shuttleRingPointer,R._knobOuter,L)}),Sc(t,"dateLabel",function(L){R._knobDate.textContent!==L&&rBt(y,L)}),Sc(t,"timeLabel",function(L){R._knobTime.textContent!==L&&aBt(_,L)}),Sc(t,"multiplierLabel",function(L){E.textContent!==L&&(E.textContent=L)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(kA.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kA.prototype.isDestroyed=function(){return!1};kA.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 ue(this)};kA.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};kA.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=UT(this._themeNormal),n=UT(this._themeHover),i=UT(this._themeSelect),o=UT(this._themeDisabled),r=UT(this._themeKnob),s=UT(this._themePointer),a=UT(this._themeSwoosh),c=UT(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,p5)},{tagName:"stop",offset:"12%","stop-color":zs(t,PJ)},{tagName:"stop",offset:"46%","stop-color":zs(t,ele)},{tagName:"stop",offset:"81%","stop-color":zs(t,XJ)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(n,p5)},{tagName:"stop",offset:"12%","stop-color":zs(n,PJ)},{tagName:"stop",offset:"46%","stop-color":zs(n,ele)},{tagName:"stop",offset:"81%","stop-color":zs(n,XJ)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(i,p5)},{tagName:"stop",offset:"12%","stop-color":zs(i,PJ)},{tagName:"stop",offset:"46%","stop-color":zs(i,ele)},{tagName:"stop",offset:"81%","stop-color":zs(i,XJ)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(o,nBt)},{tagName:"stop",offset:"75%","stop-color":zs(o,iBt)}]},{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,aYe)},{tagName:"stop",offset:"100%","stop-color":zs(s,aYe)}]},{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,p5)},{tagName:"stop",offset:"60%","stop-color":zs(r,sYe)},{tagName:"stop",offset:"85%","stop-color":zs(r,PJ)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,sYe)},{tagName:"stop",offset:"60%","stop-color":zs(r,p5)},{tagName:"stop",offset:"85%","stop-color":zs(r,XJ)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var g5=kA;var Aur=x(T(),1);var uBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DT=15,UA=105,mBt=[31,28,31,30,31,30,31,31,30,31,30,31];function hBt(e,t){return t===2&&Il(e)?29:mBt[t-1]}function dYe(e,t,n){return Q.fromGregorianDate(new vh(t,n,Math.min(e.day,hBt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function uYe(e,t){return e-t}function ile(e,t){let n=Eo(t,e,uYe);return n<0?~n:n}function fBt(e,t){if(Math.abs(e)<=DT)return e/DT;let n=DT,i=UA,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 pBt(e,t,n){if(n.clockStep===Oo.SYSTEM_CLOCK)return DT;if(Math.abs(e)<=1)return e*DT;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=DT,r=UA,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 pu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=pu.defaultDateFormatter,this._timeFormatter=pu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(pu.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 pBt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,UA),-UA);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===UA){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=fBt(s,a);if(t.snapToTicks)d=a[ile(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>DT?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 kT(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 kT(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 kT(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 kT(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=ile(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=ile(c,a)+1;d<a.length&&(s.multiplier=a[d])})}pu.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${uBt[n.month-1]} ${n.day} ${n.year}`};pu.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];pu.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`};pu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};pu.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(uYe);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};pu.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=dYe(o,c,d)}else{let s=Math.min(Math.max(o.year+t,1),9999);r=dYe(o,s,o.month)}Q.equals(i,r)||(n.shouldAnimate=!1,n.currentTime=r)};pu.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(pu.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}}});pu._maxShuttleRingAngle=UA;pu._realtimeShuttleRingAngle=DT;var y5=pu;var wur=x(T(),1);var Fur=x(T(),1);function bBt(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 hYe(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 gBt={maximumFractionDigits:3};function x5(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,gBt):Math.round(t).toLocaleString()}function T5(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>${x5(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${x5(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${x5(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function fYe(){let e=Ni.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${R5(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${R5(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${x5(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${x5(e.texturesByteLength)}</li> </ul> - `}var SBt=[{text:"Highlight",value:vd.HIGHLIGHT},{text:"Replace",value:vd.REPLACE},{text:"Mix",value:vd.MIX}],uYe=new U(1,1,0,.4),ZBt=new U,kJ=new U;function Zc(e,t){let n=this,i=e.canvas;this._eventHandler=new ta(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new Hg({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 w=[],z=n._properties();for(let K in z)z.hasOwnProperty(K)&&w.push(K);return w});let o=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(w){o(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=w)}}),this.dynamicScreenSpaceError=!1;let r=Ee.observable();Ee.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(w){r(w),l(n._tileset)&&(n._tileset.colorBlendMode=w,n._scene.requestRender())}}),this.colorBlendMode=vd.HIGHLIGHT;let s=Ee.observable(),a=Ee.observable();Ee.defineProperty(this,"picking",{get:function(){return a()},set:function(w){a(w),w?n._eventHandler.setInputAction(function(z){let K=e.pick(z.endPosition);if(K instanceof na?(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()}},un.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(un.MOUSE_MOVE))}}),this.picking=!0;let c=Ee.observable();Ee.defineProperty(this,"colorize",{get:function(){return c()},set:function(w){c(w),l(n._tileset)&&(n._tileset.debugColorizeTiles=w,n._scene.requestRender())}}),this.colorize=!1;let d=Ee.observable();Ee.defineProperty(this,"wireframe",{get:function(){return d()},set:function(w){d(w),l(n._tileset)&&(n._tileset.debugWireframe=w,n._scene.requestRender())}}),this.wireframe=!1;let u=Ee.observable();Ee.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(w){u(w),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=w,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ee.observable();Ee.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(w){m(w),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=w,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ee.observable();Ee.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(w){p(w),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=w,n._scene.requestRender())}}),this.showRequestVolumes=!1;let b=Ee.observable();Ee.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(w){b(w),l(n._tileset)&&(n._tileset.debugFreezeFrame=w,n._scene.debugShowFrustumPlanes=w,n._scene.requestRender())}}),this.freezeFrame=!1,Ee.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(w){s(w),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=w,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ee.observable();Ee.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(w){f(w),l(n._tileset)&&(n._tileset.debugShowGeometricError=w,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Ee.observable();Ee.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(w){y(w),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=w,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ee.observable();Ee.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(w){_(w),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=w,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Ee.observable();Ee.defineProperty(this,"showUrl",{get:function(){return S()},set:function(w){S(w),l(n._tileset)&&(n._tileset.debugShowUrl=w,n._scene.requestRender())}}),this.showUrl=!1;let Z=Ee.observable();Ee.defineProperty(this,"maximumScreenSpaceError",{get:function(){return Z()},set:function(w){w=Number(w),isNaN(w)||(Z(w),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=w))}}),this.maximumScreenSpaceError=16;let R=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return R()},set:function(w){w=Number(w),isNaN(w)||(R(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=w))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ee.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(R(),1/6)},set:function(w){let z=Math.pow(w,6);R(z),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=z)}});let C=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(w){w=Number(w),isNaN(w)||(C(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=w))}}),this.dynamicScreenSpaceErrorFactor=24;let E=TBt(this),A=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return A()},set:function(w){A(w),w?n._eventHandler.setInputAction(E,un.LEFT_CLICK):n._eventHandler.removeInputAction(un.LEFT_CLICK)}});let L=Ee.observable();Ee.defineProperty(this,"pointCloudShading",{get:function(){return L()},set:function(w){L(w),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=w)}}),this.pointCloudShading=!1;let F=Ee.observable();Ee.defineProperty(this,"geometricErrorScale",{get:function(){return F()},set:function(w){w=Number(w),isNaN(w)||(F(w),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=w))}}),this.geometricErrorScale=1;let I=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return I()},set:function(w){w=Number(w),isNaN(w)||(I(w),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=w===0?void 0:w))}}),this.maximumAttenuation=0;let N=Ee.observable();Ee.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(w){w=Number(w),isNaN(w)||(N(w),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=w===0?void 0:w))}}),this.baseResolution=0;let g=Ee.observable();Ee.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(w){g(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=w)}}),this.eyeDomeLighting=!1;let V=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return V()},set:function(w){w=Number(w),isNaN(w)||(V(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=w))}}),this.eyeDomeLightingStrength=1;let G=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(w){w=Number(w),isNaN(w)||(G(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=w))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let v=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return v()},set:function(w){v(w),l(n._tileset)&&(n._tileset.skipLevelOfDetail=w)}}),this.skipLevelOfDetail=!0;let X=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return X()},set:function(w){w=Number(w),isNaN(w)||(X(w),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=w))}}),this.skipScreenSpaceErrorFactor=16;let Y=Ee.observable();Ee.defineProperty(this,"baseScreenSpaceError",{get:function(){return Y()},set:function(w){w=Number(w),isNaN(w)||(Y(w),l(n._tileset)&&(n._tileset.baseScreenSpaceError=w))}}),this.baseScreenSpaceError=1024;let D=Ee.observable();Ee.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(w){w=Number(w),isNaN(w)||(D(w),l(n._tileset)&&(n._tileset.skipLevels=w))}}),this.skipLevels=1;let M=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return M()},set:function(w){M(w),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=w)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Ee.observable();Ee.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(w){O(w),l(n._tileset)&&(n._tileset.loadSiblings=w)}}),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)||mYe(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=C5(e,!1),this._pickStatisticsText=C5(e,!0),this._resourceCacheStatisticsText=hYe(),mYe(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,ZBt):U.WHITE:t.color=kJ,this._scene.requestRender()),l(e)&&(U.clone(e.color,kJ),e.color=uYe,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()&&!rle(t.content)&&(t.color=kJ,this._scene.requestRender()),l(e)&&!rle(e.content)&&(U.clone(e.color,kJ),e.color=uYe,this._scene.requestRender()),this._tile=e}}});function rle(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(!rle(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 Jb(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(` + `}var yBt=[{text:"Highlight",value:Pd.HIGHLIGHT},{text:"Replace",value:Pd.REPLACE},{text:"Mix",value:Pd.MIX}],mYe=new U(1,1,0,.4),xBt=new U,YJ=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 dy({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 w=[],z=n._properties();for(let K in z)z.hasOwnProperty(K)&&w.push(K);return w});let o=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(w){o(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=w)}}),this.dynamicScreenSpaceError=!1;let r=Ee.observable();Ee.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(w){r(w),l(n._tileset)&&(n._tileset.colorBlendMode=w,n._scene.requestRender())}}),this.colorBlendMode=Pd.HIGHLIGHT;let s=Ee.observable(),a=Ee.observable();Ee.defineProperty(this,"picking",{get:function(){return a()},set:function(w){a(w),w?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(w){c(w),l(n._tileset)&&(n._tileset.debugColorizeTiles=w,n._scene.requestRender())}}),this.colorize=!1;let d=Ee.observable();Ee.defineProperty(this,"wireframe",{get:function(){return d()},set:function(w){d(w),l(n._tileset)&&(n._tileset.debugWireframe=w,n._scene.requestRender())}}),this.wireframe=!1;let u=Ee.observable();Ee.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(w){u(w),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=w,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ee.observable();Ee.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(w){m(w),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=w,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ee.observable();Ee.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(w){p(w),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=w,n._scene.requestRender())}}),this.showRequestVolumes=!1;let b=Ee.observable();Ee.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(w){b(w),l(n._tileset)&&(n._tileset.debugFreezeFrame=w,n._scene.debugShowFrustumPlanes=w,n._scene.requestRender())}}),this.freezeFrame=!1,Ee.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(w){s(w),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=w,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ee.observable();Ee.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(w){f(w),l(n._tileset)&&(n._tileset.debugShowGeometricError=w,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Ee.observable();Ee.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(w){y(w),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=w,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ee.observable();Ee.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(w){_(w),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=w,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Ee.observable();Ee.defineProperty(this,"showUrl",{get:function(){return S()},set:function(w){S(w),l(n._tileset)&&(n._tileset.debugShowUrl=w,n._scene.requestRender())}}),this.showUrl=!1;let Z=Ee.observable();Ee.defineProperty(this,"maximumScreenSpaceError",{get:function(){return Z()},set:function(w){w=Number(w),isNaN(w)||(Z(w),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=w))}}),this.maximumScreenSpaceError=16;let R=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return R()},set:function(w){w=Number(w),isNaN(w)||(R(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=w))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ee.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(R(),1/6)},set:function(w){let z=Math.pow(w,6);R(z),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=z)}});let C=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(w){w=Number(w),isNaN(w)||(C(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=w))}}),this.dynamicScreenSpaceErrorFactor=24;let E=bBt(this),A=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return A()},set:function(w){A(w),w?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(w){L(w),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=w)}}),this.pointCloudShading=!1;let F=Ee.observable();Ee.defineProperty(this,"geometricErrorScale",{get:function(){return F()},set:function(w){w=Number(w),isNaN(w)||(F(w),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=w))}}),this.geometricErrorScale=1;let I=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return I()},set:function(w){w=Number(w),isNaN(w)||(I(w),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=w===0?void 0:w))}}),this.maximumAttenuation=0;let N=Ee.observable();Ee.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(w){w=Number(w),isNaN(w)||(N(w),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=w===0?void 0:w))}}),this.baseResolution=0;let g=Ee.observable();Ee.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(w){g(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=w)}}),this.eyeDomeLighting=!1;let V=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return V()},set:function(w){w=Number(w),isNaN(w)||(V(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=w))}}),this.eyeDomeLightingStrength=1;let G=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(w){w=Number(w),isNaN(w)||(G(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=w))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let v=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return v()},set:function(w){v(w),l(n._tileset)&&(n._tileset.skipLevelOfDetail=w)}}),this.skipLevelOfDetail=!0;let X=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return X()},set:function(w){w=Number(w),isNaN(w)||(X(w),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=w))}}),this.skipScreenSpaceErrorFactor=16;let Y=Ee.observable();Ee.defineProperty(this,"baseScreenSpaceError",{get:function(){return Y()},set:function(w){w=Number(w),isNaN(w)||(Y(w),l(n._tileset)&&(n._tileset.baseScreenSpaceError=w))}}),this.baseScreenSpaceError=1024;let D=Ee.observable();Ee.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(w){w=Number(w),isNaN(w)||(D(w),l(n._tileset)&&(n._tileset.skipLevels=w))}}),this.skipLevels=1;let M=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return M()},set:function(w){M(w),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=w)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Ee.observable();Ee.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(w){O(w),l(n._tileset)&&(n._tileset.loadSiblings=w)}}),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)||hYe(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 yBt}},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=T5(e,!1),this._pickStatisticsText=T5(e,!0),this._resourceCacheStatisticsText=fYe(),hYe(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,xBt):U.WHITE:t.color=YJ,this._scene.requestRender()),l(e)&&(U.clone(e.color,YJ),e.color=mYe,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()&&!ole(t.content)&&(t.color=YJ,this._scene.requestRender()),l(e)&&!ole(e.content)&&(U.clone(e.color,YJ),e.color=mYe,this._scene.requestRender()),this._tile=e}}});function ole(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(!ole(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 rg(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=C5(e,!1),this._pickStatisticsText=C5(e,!0),this._resourceCacheStatisticsText=hYe())};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()}),ue(this)};Zc.getStatistics=C5;var V5=Zc;function UJ(e,t){e=Nn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new V5(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,c=fu.createCheckbox,d=fu.createRangeInput,u=fu.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 M=document.createElement("div");M.className="cesium-cesiumInspector-error",M.setAttribute("data-bind","text: editorError"),v.appendChild(M),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 w=document.createElement("div");w.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(w);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(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 Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var E5=UJ;var Cmr=x(T(),1);var ymr=x(T(),1);var fYe=1e3;function pp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new wR({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=bYe,this._handleArrowUp=pYe;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??YT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)GBt(t);else return EBt(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?pYe(t):r?bYe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;xYe(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 pYe(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 bYe(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 RBt(e,t){let n=l(t)?t.availability:void 0;return l(n)?NS(t,[e]).then(function(i){return e=i[0],e.height+=fYe,e}):(e.height+=fYe,Promise.resolve(e))}function CBt(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=YS(t,n):t=i.cartesianToCartographic(t),l(a)||(a=RBt(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 VBt(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 EBt(e,t,n){let i=e._searchText;if(yYe(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 VBt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,ale(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=gYe(e,NA.getCreditsFromResult(s[0]));l(a)||sle(e,t[o].credit);return}e._searchText=`${i} (not found)`}function sle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function gYe(e,t){return l(t)&&t.forEach(n=>sle(e,n)),t}function ale(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function ABt(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 GBt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function yYe(e){return/^\s*$/.test(e)}function xYe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function LBt(e){if(!e.autoComplete)return;let t=e._searchText;if(xYe(e),ale(e),!yYe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,YT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=NA.getCreditsFromResult(r);o=o&&!l(s),gYe(e,s)}),o&&sle(e,n.credit)}if(e._suggestions.length>=5)return}}pp.flyToDestination=CBt;pp._updateSearchSuggestions=LBt;pp._adjustSuggestionsScroll=ABt;pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),ale(this),ue(this)};var A5=pp;var WBt="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",vBt="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 DJ(e){let t=Nn(e.container),n=new A5(e);n._startSearchPath=WBt,n._stopSearchPath=vBt;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(DJ.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});DJ.prototype.isDestroyed=function(){return!1};DJ.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),ue(this)};var G5=DJ;var Pmr=x(T(),1);var Gmr=x(T(),1);function FBt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function _Ye(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)_Ye(e.sublayers[n],t)}function OJ(e){return e.modelName==="FullModel"}function SYe(e){return e.modelName==="Overview"}function ZYe(e){return SYe(e)||OJ(e)}function TYe(e,t){if(ZYe(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 IBt(e,t){if(ZYe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");OJ(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function PBt(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 XBt(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:FBt,setOptionDisable:function(i,o){Ee.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){IBt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){_Ye(n[i],this.viewModel);let o=TYe(n[i],this.viewModel);l(o)&&(SYe(o)||!l(this.viewModel.defaultLayer)&&OJ(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=OJ(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return PBt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var L5=XBt;function NBt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` +`);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=T5(e,!1),this._pickStatisticsText=T5(e,!0),this._resourceCacheStatisticsText=fYe())};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()}),ue(this)};Zc.getStatistics=T5;var _5=Zc;function MJ(e,t){e=Nn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new _5(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,c=fu.createCheckbox,d=fu.createRangeInput,u=fu.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 M=document.createElement("div");M.className="cesium-cesiumInspector-error",M.setAttribute("data-bind","text: editorError"),v.appendChild(M),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 w=document.createElement("div");w.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(w);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(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),this.viewModel.destroy(),ue(this)};var S5=MJ;var $ur=x(T(),1);var zur=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),ue(this)};var Z5=wJ;var TBt="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",_Bt="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 kJ(e,t){e=Nn(e);let n=new Z5(t,e);n._exitFullScreenPath=_Bt,n._enterFullScreenPath=TBt;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(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 this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var R5=kJ;var hmr=x(T(),1);var rmr=x(T(),1);function SBt(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 rle(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var ZBt=new gn,RBt=new h;function C5(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 dy({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 X9({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=rle(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Fn(function(){let d=n.depthFrustum-1;return n.depthFrustum=rle(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 e5({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,ZBt),b=r.pick(p,n._scene,RBt);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(C5.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}}});C5.prototype._update=function(){this.frustums&&(this.frustumStatisticText=SBt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=rle(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}`};C5.prototype.isDestroyed=function(){return!1};C5.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 V5=C5;function UJ(e,t){e=Nn(e);let n=document.createElement("div"),i=new V5(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,c=fu.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"),M=document.createElement("tr"),O=document.createElement("tr"),w=document.createElement("td");w.appendChild(N);let z=document.createElement("td");z.appendChild(g);let K=document.createElement("td");K.appendChild(V),M.appendChild(w),M.appendChild(z),M.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(M),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(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 Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var E5=UJ;var Vmr=x(T(),1);var xmr=x(T(),1);var pYe=1e3;function pp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new qZ({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=gYe,this._handleArrowUp=bYe;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??RT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)LBt(t);else return ABt(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?bYe(t):r?gYe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;TYe(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 bYe(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 gYe(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 CBt(e,t){let n=l(t)?t.availability:void 0;return l(n)?$Z(t,[e]).then(function(i){return e=i[0],e.height+=pYe,e}):(e.height+=pYe,Promise.resolve(e))}function VBt(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=uR(t,n):t=i.cartesianToCartographic(t),l(a)||(a=CBt(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 EBt(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 ABt(e,t,n){let i=e._searchText;if(xYe(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 EBt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,ale(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=yYe(e,nA.getCreditsFromResult(s[0]));l(a)||sle(e,t[o].credit);return}e._searchText=`${i} (not found)`}function sle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function yYe(e,t){return l(t)&&t.forEach(n=>sle(e,n)),t}function ale(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function GBt(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 LBt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function xYe(e){return/^\s*$/.test(e)}function TYe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function WBt(e){if(!e.autoComplete)return;let t=e._searchText;if(TYe(e),ale(e),!xYe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,RT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=nA.getCreditsFromResult(r);o=o&&!l(s),yYe(e,s)}),o&&sle(e,n.credit)}if(e._suggestions.length>=5)return}}pp.flyToDestination=VBt;pp._updateSearchSuggestions=WBt;pp._adjustSuggestionsScroll=GBt;pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),ale(this),ue(this)};var A5=pp;var vBt="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",FBt="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 DJ(e){let t=Nn(e.container),n=new A5(e);n._startSearchPath=vBt,n._stopSearchPath=FBt;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(DJ.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});DJ.prototype.isDestroyed=function(){return!1};DJ.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),ue(this)};var G5=DJ;var Nmr=x(T(),1);var Lmr=x(T(),1);function _Ye(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(_Ye.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 L5=_Ye;function OJ(e,t,n){e=Nn(e);let i=new L5(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(OJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OJ.prototype.isDestroyed=function(){return!1};OJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var W5=OJ;var Hmr=x(T(),1);var kmr=x(T(),1);function IBt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function ZYe(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)ZYe(e.sublayers[n],t)}function BJ(e){return e.modelName==="FullModel"}function RYe(e){return e.modelName==="Overview"}function CYe(e){return RYe(e)||BJ(e)}function SYe(e,t){if(CYe(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 PBt(e,t){if(CYe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");BJ(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function XBt(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 NBt(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:IBt,setOptionDisable:function(i,o){Ee.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){PBt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){ZYe(n[i],this.viewModel);let o=SYe(n[i],this.viewModel);l(o)&&(RYe(o)||!l(this.viewModel.defaultLayer)&&BJ(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=SYe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=BJ(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return XBt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var v5=NBt;function YBt(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" @@ -12813,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new L5(t);Ee.track(o),Ee.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var cle=NBt;var zmr=x(T(),1);var Mmr=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 W5=RYe;function BJ(e){let t=Nn(e.container),n=new W5,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(BJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BJ.prototype.isDestroyed=function(){return!1};BJ.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),ue(this)};var v5=BJ;var ihr=x(T(),1);var jmr=x(T(),1);var YBt="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",MBt="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 lle(){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?MBt:YBt}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}lle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(lle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var F5=lle;function zJ(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 F5;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(zJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});zJ.prototype.isDestroyed=function(){return!1};zJ.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(),ue(this)};var I5=zJ;var fhr=x(T(),1);var ahr=x(T(),1);function CYe(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(CYe.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 P5=CYe;function HJ(e,t,n){e=Nn(e);let i=new P5(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(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 Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var X5=HJ;var Ahr=x(T(),1);var _hr=x(T(),1);function dle(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=VY.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(dle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});dle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var N5=dle;function KJ(e){let t=Nn(e.container),n=new N5(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(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 this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Y5=KJ;var Uhr=x(T(),1);var Phr=x(T(),1);function JJ(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Jr,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(JJ.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}}});JJ.prototype.isDestroyed=function(){return!1};JJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var M5=JJ;var wBt="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",kBt="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",UBt="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 jJ(e,t,n){e=Nn(e);let i=new M5(t,n);i._globePath=wBt,i._flatMapPath=kBt,i._columbusViewPath=UBt;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(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(),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),ue(this)};var w5=jJ;var tfr=x(T(),1);var Khr=x(T(),1);function QJ(e){this._scene=e,this._orthographic=e.camera.frustum instanceof bn,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 Jr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof bn}),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(QJ.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}}});QJ.prototype.isDestroyed=function(){return!1};QJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var k5=QJ;var DBt="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",OBt="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 qJ(e,t){e=Nn(e);let n=new k5(t);n._perspectivePath=DBt,n._orthographicPath=OBt;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(qJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});qJ.prototype.isDestroyed=function(){return!1};qJ.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),ue(this)};var U5=qJ;var hfr=x(T(),1);var sfr=x(T(),1);var BBt=new k,$J="-1000px";function D5(e,t,n){this._scene=e,this._screenPositionX=$J,this._screenPositionY=$J,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 ho.worldToWindowCoordinates(e,i,o)}}D5.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,BBt);if(!l(e))this._screenPositionX=$J,this._screenPositionY=$J;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`}}};D5.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ts.EXPONENTIAL_OUT})};D5.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ts.EXPONENTIAL_OUT})};Object.defineProperties(D5.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var O5=D5;function ej(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 O5(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties(ej.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ej.prototype.isDestroyed=function(){return!1};ej.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),ue(this)};var B5=ej;var Cfr=x(T(),1);var bfr=x(T(),1);function DR(e,t,n){this._color=e,this._height=t,this._base=n??0}DR.prototype.getHeight=function(){return this._height};DR.prototype.getBase=function(){return this._base};DR.prototype.getStartTime=function(){return this._start};DR.prototype.getStopTime=function(){return this._stop};DR.prototype.setRange=function(e,t){this._start=e,this._stop=t};DR.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 z5=DR;var xfr=x(T(),1);function VYe(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)}VYe.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 H5=VYe;var ule=1e12,Ah={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},xd={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},OT=[.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],zBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Td(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=xd.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=HBt(this),this._onMouseUp=KBt(this),this._onMouseMove=JBt(this),this._onMouseWheel=jBt(this),this._onTouchStart=QBt(this),this._onTouchMove=$Bt(this),this._onTouchEnd=qBt(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()}Td.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Td.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Td.prototype.isDestroyed=function(){return!1};Td.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)};Td.prototype.addHighlightRange=function(e,t,n){let i=new z5(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Td.prototype.addTrack=function(e,t,n,i){let o=new H5(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Td.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Vs.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)};Td.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 mle(e){return e<10?`0${e.toString()}`:e.toString()}Td.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`${zBt[t.month-1]} ${t.day} ${t.year} ${mle(t.hour)}:${mle(t.minute)}:${mle(t.second)}${i}`};Td.prototype.smallestTicInPixels=7;Td.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(w){return Math.floor(S/w)*w}function C(w,z){return Math.ceil(w/z+.5)*z}function E(w){return(w-S)/m}function A(w,z){return w-z*Math.round(w/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(w){s+=w.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=OT.length,D;for(D=0;D<Y;++D){let w=OT[D];if(++v,N=w,w>G&&w>u)break;X<0&&p*(w/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(X=v)}if(v>0){for(;v>0;)if(--v,Math.abs(A(N,OT[v]))<1e-5){OT[v]>=u&&(g=OT[v]);break}if(X>=0)for(;X<v;){if(Math.abs(A(g,OT[X]))<1e-5&&OT[X]>=u){V=OT[X];break}++X}}u=F,u>d&&V<1e-5&&Math.abs(u-N)>d&&(V=u,u<=N+d&&(g=0));let M=-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 w=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($-w)>.1&&(o+=$-w,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>M?(M=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(w){w.render(r._context,I),I.y+=w.height})};Td.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)))};Td.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 HBt(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 KBt(e){return function(t){e._mouseMode=Ah.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function JBt(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 jBt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;ule=Math.max(Math.min(Math.abs(n),ule),1),n/=ule,e.zoomFrom(Math.pow(1.05,-n))}}function QBt(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=xd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=xd.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=xd.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=xd.ignore}}function qBt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap?(e._touchMode=xd.scrub,e._onTouchMove(t)):e._touchMode===xd.scrub&&e._onTouchMove(t),e._mouseMode=Ah.touchOnly,n!==1?e._touchMode=n>0?xd.ignore:xd.none:e._touchMode===xd.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function $Bt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap&&(e._touchMode=xd.slideZoom),e._mouseMode=Ah.touchOnly,e._touchMode===xd.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===xd.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))}}Td.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 K5=Td;var lpr=x(T(),1);var Ufr=x(T(),1);var Pfr=x(T(),1);var WYe=x(LYe(),1);function n3t(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 vYe(){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 i3t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(vYe(),e._locked=!1),e._noSleep.disable(),qr.exitFullscreen(),n(!1)):(qr.fullscreen||qr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=n3t("landscape")),t.useWebVR=!0,n(!0)))}function tj(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 Jr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof bn)}),this._locked=!1,this._noSleep=new WYe.default,this._command=Fn(function(){i3t(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&&(vYe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(tj.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});tj.prototype.isDestroyed=function(){return!1};tj.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var J5=tj;var o3t="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",r3t="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 nj(e,t,n){e=Nn(e);let i=new J5(t,n);i._exitVRPath=r3t,i._enterVRPath=o3t;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(nj.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nj.prototype.isDestroyed=function(){return!1};nj.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var j5=nj;var FYe=new me;function XYe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function s3t(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 a3t(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 IYe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof nr)return i;if(n instanceof na||n instanceof fS)return new nr({name:a3t(n),description:s3t(n),feature:n})}return u3t(e,t.position)}var c3t=new Q;function ble(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,c3t)),e.updateFromClock(),e.zoomTo(i,o)}}}var l3t=new h;function d3t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof zr)return i}}function u3t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let o=n.imageryLayers;if(!l(o)){let a=d3t(n.primitives);if(!l(a))return;o=a.imageryLayers}let r=o.pickImageryLayerFeatures(i,n);if(!l(r))return;let s=new nr({id:"Loading...",description:"Loading feature information..."});return r.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=PYe();return}let c=a[0],d=new nr({id:c.name,description:c.description});if(l(c.position)){let u=e.scene.ellipsoid.cartographicToCartesian(c.position,l3t);d.position=new sd(u)}e.selectedEntity=d},function(){e.selectedEntity===s&&(e.selectedEntity=PYe())}),s}function PYe(){return new nr({id:"None",description:"No features found."})}function m3t(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 Xf,d=new d5(c),u=!0);let m=new i5(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 Jr;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 B5(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 I5(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 wR({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new G5({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 X5(_,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 w5(_,p));let C;t.projectionPicker&&(C=new U5(_,p));let E,A;if(n){let z=t.imageryProviderViewModels??b5(),K=t.terrainProviderViewModels??g5();E=new p5(_,{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 v5({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 T5(z,new _5(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 K5(z,c),I.addEventListener("settime",XYe,!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 Z5(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){m3t(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 M=Y.length;for(let z=0;z<M;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=IYe(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 w(z){i.selectedEntity=IYe(i,z)}m.screenSpaceEventHandler.setInputAction(w,un.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(O,un.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,ble(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(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",XYe,!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)};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,FYe)!==Wt.FAILED?n=FYe.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&&ble(this.timeline,e)};uo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&ble(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 gle=uo;var mpr=x(T(),1);function h3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new E5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var yle=h3t;var ppr=x(T(),1);function f3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new h5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var xle=f3t;var xpr=x(T(),1);function p3t(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){NYe(s,d),s=u,Tle(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?Tle(s,d):NYe(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){OR(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=b3t(e,f,c,a),y.onerror=g3t(e,f),y.readAsText(f)}}Tle(s,d),e.destroy=t5(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function OR(e){e.stopPropagation(),e.preventDefault()}function NYe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",OR,!1),n.removeEventListener("dragover",OR,!1),n.removeEventListener("dragexit",OR,!1))}function Tle(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",OR,!1),e.addEventListener("dragover",OR,!1),e.addEventListener("dragexit",OR,!1)}function b3t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=qk.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=MZ.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=KU.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 g3t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var _le=p3t;var Cpr=x(T(),1);function y3t(e,t){t=t??B.EMPTY_OBJECT;let n=new Y5({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Sle=y3t;var wpr=x(T(),1);var Npr=x(T(),1);var Lpr=x(T(),1);function YYe(e){let t=e.split(` + </div>`,n.appendChild(i);let o=new v5(t);Ee.track(o),Ee.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var cle=YBt;var ohr=x(T(),1);var Qmr=x(T(),1);var MBt="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",wBt="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 lle(){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?wBt:MBt}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}lle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(lle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var F5=lle;function zJ(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 F5;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(zJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});zJ.prototype.isDestroyed=function(){return!1};zJ.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(),ue(this)};var I5=zJ;var phr=x(T(),1);var chr=x(T(),1);function VYe(){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(VYe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var P5=VYe;function HJ(e){let t=Nn(e.container),n=new P5,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(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 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),ue(this)};var X5=HJ;var Ghr=x(T(),1);var Shr=x(T(),1);function dle(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=Q9.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(dle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});dle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var N5=dle;function KJ(e){let t=Nn(e.container),n=new N5(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(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 this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Y5=KJ;var Uhr=x(T(),1);var Phr=x(T(),1);function JJ(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(JJ.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}}});JJ.prototype.isDestroyed=function(){return!1};JJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var M5=JJ;var kBt="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",UBt="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 jJ(e,t){e=Nn(e);let n=new M5(t);n._perspectivePath=kBt,n._orthographicPath=UBt;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(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(),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),ue(this)};var w5=jJ;var nfr=x(T(),1);var Jhr=x(T(),1);function QJ(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(QJ.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}}});QJ.prototype.isDestroyed=function(){return!1};QJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var k5=QJ;var DBt="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",OBt="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",BBt="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 qJ(e,t,n){e=Nn(e);let i=new k5(t,n);i._globePath=DBt,i._flatMapPath=OBt,i._columbusViewPath=BBt;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(qJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});qJ.prototype.isDestroyed=function(){return!1};qJ.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),ue(this)};var U5=qJ;var ffr=x(T(),1);var afr=x(T(),1);var zBt=new k,$J="-1000px";function D5(e,t,n){this._scene=e,this._screenPositionX=$J,this._screenPositionY=$J,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)}}D5.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,zBt);if(!l(e))this._screenPositionX=$J,this._screenPositionY=$J;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`}}};D5.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:vs.EXPONENTIAL_OUT})};D5.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:vs.EXPONENTIAL_OUT})};Object.defineProperties(D5.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var O5=D5;function ej(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 O5(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties(ej.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ej.prototype.isDestroyed=function(){return!1};ej.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),ue(this)};var B5=ej;var Vfr=x(T(),1);var gfr=x(T(),1);function DR(e,t,n){this._color=e,this._height=t,this._base=n??0}DR.prototype.getHeight=function(){return this._height};DR.prototype.getBase=function(){return this._base};DR.prototype.getStartTime=function(){return this._start};DR.prototype.getStopTime=function(){return this._stop};DR.prototype.setRange=function(e,t){this._start=e,this._stop=t};DR.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 z5=DR;var Tfr=x(T(),1);function EYe(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)}EYe.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 H5=EYe;var ule=1e12,Ah={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},xd={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},OT=[.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],HBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Td(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=xd.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=KBt(this),this._onMouseUp=JBt(this),this._onMouseMove=jBt(this),this._onMouseWheel=QBt(this),this._onTouchStart=qBt(this),this._onTouchMove=e3t(this),this._onTouchEnd=$Bt(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()}Td.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Td.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Td.prototype.isDestroyed=function(){return!1};Td.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)};Td.prototype.addHighlightRange=function(e,t,n){let i=new z5(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Td.prototype.addTrack=function(e,t,n,i){let o=new H5(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Td.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)};Td.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 mle(e){return e<10?`0${e.toString()}`:e.toString()}Td.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`${HBt[t.month-1]} ${t.day} ${t.year} ${mle(t.hour)}:${mle(t.minute)}:${mle(t.second)}${i}`};Td.prototype.smallestTicInPixels=7;Td.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(w){return Math.floor(S/w)*w}function C(w,z){return Math.ceil(w/z+.5)*z}function E(w){return(w-S)/m}function A(w,z){return w-z*Math.round(w/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(w){s+=w.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=OT.length,D;for(D=0;D<Y;++D){let w=OT[D];if(++v,N=w,w>G&&w>u)break;X<0&&p*(w/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(X=v)}if(v>0){for(;v>0;)if(--v,Math.abs(A(N,OT[v]))<1e-5){OT[v]>=u&&(g=OT[v]);break}if(X>=0)for(;X<v;){if(Math.abs(A(g,OT[X]))<1e-5&&OT[X]>=u){V=OT[X];break}++X}}u=F,u>d&&V<1e-5&&Math.abs(u-N)>d&&(V=u,u<=N+d&&(g=0));let M=-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 w=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($-w)>.1&&(o+=$-w,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>M?(M=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(w){w.render(r._context,I),I.y+=w.height})};Td.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)))};Td.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 KBt(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 JBt(e){return function(t){e._mouseMode=Ah.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function jBt(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 QBt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;ule=Math.max(Math.min(Math.abs(n),ule),1),n/=ule,e.zoomFrom(Math.pow(1.05,-n))}}function qBt(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=xd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=xd.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=xd.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=xd.ignore}}function $Bt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap?(e._touchMode=xd.scrub,e._onTouchMove(t)):e._touchMode===xd.scrub&&e._onTouchMove(t),e._mouseMode=Ah.touchOnly,n!==1?e._touchMode=n>0?xd.ignore:xd.none:e._touchMode===xd.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function e3t(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap&&(e._touchMode=xd.slideZoom),e._mouseMode=Ah.touchOnly,e._touchMode===xd.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===xd.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))}}Td.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 K5=Td;var Dfr=x(T(),1);var Xfr=x(T(),1);var vYe=x(WYe(),1);function i3t(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 o3t(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=i3t("landscape")),t.useWebVR=!0,n(!0)))}function tj(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 vYe.default,this._command=Fn(function(){o3t(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(tj.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});tj.prototype.isDestroyed=function(){return!1};tj.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var J5=tj;var r3t="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",s3t="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 nj(e,t,n){e=Nn(e);let i=new J5(t,n);i._exitVRPath=s3t,i._enterVRPath=r3t;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(nj.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nj.prototype.isDestroyed=function(){return!1};nj.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var j5=nj;var tpr=x(T(),1);var Kfr=x(T(),1);function IYe(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=YYe(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===uc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===uc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===uc.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 x3t=new h,T3t=new h,_3t=new Vc,S3t=new q;function H0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,x3t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,T3t),i=_3t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=q.fromHeadingPitchRoll(i,S3t),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=YYe(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 Pp({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(` +`}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=IYe(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 a3t=new h,c3t=new h,l3t=new Cc,d3t=new q;function H0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,a3t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,c3t),i=l3t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=q.fromHeadingPitchRoll(i,d3t),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=IYe(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()}),ue(this)};var Q5=Gh;function ij(e,t){e=Nn(e);let n=document.createElement("div"),i=new Q5(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}=fu,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",-_,+_)),Zle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Zle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Zle("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(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(),ue(this)};function Zle(e,t,n,i,o,r,s,a,c,d,u,m,p,b){let f=fu.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 q5=ij;function Z3t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new q5(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Rle=Z3t;globalThis.CESIUM_VERSION="1.145.0";var R3t="1.145.0";return BYe(C3t);})(); +`);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()}),ue(this)};var Q5=Gh;function ij(e,t){e=Nn(e);let n=document.createElement("div"),i=new Q5(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}=fu,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",-_,+_)),ble("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),ble("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),ble("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(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(),ue(this)};function ble(e,t,n,i,o,r,s,a,c,d,u,m,p,b){let f=fu.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 q5=ij;var Spr=x(T(),1);var PYe=new me;function YYe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function u3t(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 m3t(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 XYe(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 LS)return new er({name:m3t(n),description:u3t(n),feature:n})}return b3t(e,t.position)}var h3t=new Q;function gle(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,h3t)),e.updateFromClock(),e.zoomTo(i,o)}}}var f3t=new h;function p3t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof zr)return i}}function b3t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let o=n.imageryLayers;if(!l(o)){let a=p3t(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=NYe();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,f3t);d.position=new kl(u)}e.selectedEntity=d},function(){e.selectedEntity===s&&(e.selectedEntity=NYe())}),s}function NYe(){return new er({id:"None",description:"No features found."})}function g3t(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 d5(c),u=!0);let m=new i5(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 B5(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 I5(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 qZ({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new G5({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 W5(_,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 U5(_,p));let C;t.projectionPicker&&(C=new w5(_,p));let E,A;if(n){let z=t.imageryProviderViewModels??h5(),K=t.terrainProviderViewModels??f5();E=new m5(_,{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 X5({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 g5(z,new y5(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 K5(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 R5(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){g3t(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 M=Y.length;for(let z=0;z<M;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=XYe(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 w(z){i.selectedEntity=XYe(i,z)}m.screenSpaceEventHandler.setInputAction(w,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,gle(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(),ue(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&&gle(this.timeline,e)};uo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&gle(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 yle=uo;var Cpr=x(T(),1);function y3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new S5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var xle=y3t;var Apr=x(T(),1);function x3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new E5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Tle=x3t;var vpr=x(T(),1);function T3t(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){MYe(s,d),s=u,_le(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?_le(s,d):MYe(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){OR(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=_3t(e,f,c,a),y.onerror=S3t(e,f),y.readAsText(f)}}_le(s,d),e.destroy=Yw(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function OR(e){e.stopPropagation(),e.preventDefault()}function MYe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",OR,!1),n.removeEventListener("dragover",OR,!1),n.removeEventListener("dragexit",OR,!1))}function _le(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",OR,!1),e.addEventListener("dragover",OR,!1),e.addEventListener("dragexit",OR,!1)}function _3t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=oY.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=dT.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=MZ.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=OM.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 S3t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Sle=T3t;var Ypr=x(T(),1);function Z3t(e,t){t=t??B.EMPTY_OBJECT;let n=new Y5({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Zle=Z3t;var kpr=x(T(),1);function R3t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new q5(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Rle=R3t;globalThis.CESIUM_VERSION="1.145.0";var C3t="1.145.0";return zYe(V3t);})(); //# sourceMappingURL=Cesium.js.map diff --git a/plugins/feature/map/Cesium/index.cjs b/plugins/feature/map/Cesium/index.cjs index 5f0ab3845..7681a50a6 100644 --- a/plugins/feature/map/Cesium/index.cjs +++ b/plugins/feature/map/Cesium/index.cjs @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -"use strict";var S3e=Object.create;var iD=Object.defineProperty;var w3e=Object.getOwnPropertyDescriptor;var I3e=Object.getOwnPropertyNames;var P3e=Object.getPrototypeOf,D3e=Object.prototype.hasOwnProperty;var R3e=(e,t,n)=>t in e?iD(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}},Oq=(e,t)=>{for(var n in t)iD(e,n,{get:t[n],enumerable:!0})},tue=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I3e(t))!D3e.call(e,r)&&r!==n&&iD(e,r,{get:()=>t[r],enumerable:!(i=w3e(t,r))||i.enumerable});return e};var Qo=(e,t,n)=>(n=e!=null?S3e(P3e(e)):{},tue(t||!e||!e.__esModule?iD(n,"default",{value:e,enumerable:!0}):n,e)),Fh=e=>tue(iD({},"__esModule",{value:!0}),e);var ut=(e,t,n)=>R3e(e,typeof t!="symbol"?t+"":t,n);var mj=Yi((a7t,fue)=>{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)};fue.exports=eg});var $ue=Yi((cv,lv)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof cv=="object"&&cv&&!cv.nodeType&&cv,n=typeof lv=="object"&&lv&&!lv.nodeType&&lv,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(lv.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(cv)});var Zue=Yi((Jue,wj)=>{/*! +"use strict";var w3e=Object.create;var iD=Object.defineProperty;var I3e=Object.getOwnPropertyDescriptor;var P3e=Object.getOwnPropertyNames;var D3e=Object.getPrototypeOf,R3e=Object.prototype.hasOwnProperty;var O3e=(e,t,n)=>t in e?iD(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}},Oq=(e,t)=>{for(var n in t)iD(e,n,{get:t[n],enumerable:!0})},tue=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of P3e(t))!R3e.call(e,r)&&r!==n&&iD(e,r,{get:()=>t[r],enumerable:!(i=I3e(t,r))||i.enumerable});return e};var Qo=(e,t,n)=>(n=e!=null?w3e(D3e(e)):{},tue(t||!e||!e.__esModule?iD(n,"default",{value:e,enumerable:!0}):n,e)),Fh=e=>tue(iD({},"__esModule",{value:!0}),e);var ut=(e,t,n)=>O3e(e,typeof t!="symbol"?t+"":t,n);var gj=Yi((t7t,nue)=>{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)};nue.exports=eg});var Tue=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 Cue=Yi((Eue,Sj)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof wj=="object"&&wj.exports?wj.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Jue,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 efe=Yi((Que,Ij)=>{/*! + */(function(e,t){"use strict";typeof Sj=="object"&&Sj.exports?Sj.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Eue,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 Sue=Yi((vue,wj)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof Ij=="object"&&Ij.exports?Ij.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Que,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 Ef=Yi((tfe,Pj)=>{/*! + */(function(e,t){"use strict";typeof wj=="object"&&wj.exports?wj.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(vue,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 xf=Yi((wue,Ij)=>{/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,1498 +58,1669 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof Pj=="object"&&Pj.exports?Pj.exports=t($ue(),Zue(),efe()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(tfe,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.+-]*$/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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 Fbe=Yi((SWn,Lbe)=>{"use strict";Lbe.exports=Hat;var fB=1e20;function Hat(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?fB:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?fB:S===0?0:Math.pow(Math.max(0,S-.5),2)}Mbe(A,o,s,x,T,v,E),Mbe(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 Mbe(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(Nbe(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(Nbe(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Nbe(e,t,n,i,r){n[0]=0,i[0]=-fB,i[1]=+fB;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]=+fB}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 jbe=Yi((HWn,qH)=>{function Qat(){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 qH<"u"&&qH.exports&&(qH.exports=Qat)});var Rte=Yi((uTi,f3)=>{/*! + */(function(e,t){"use strict";typeof Ij=="object"&&Ij.exports?Ij.exports=t(Tue(),Cue(),Sue()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(wue,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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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 Jbe=Yi((SJn,$be)=>{"use strict";$be.exports=Pct;var MB=1e20;function Pct(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?MB:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?MB:S===0?0:Math.pow(Math.max(0,S-.5),2)}Xbe(A,o,s,x,T,v,E),Xbe(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 Xbe(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(Kbe(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(Kbe(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Kbe(e,t,n,i,r){n[0]=0,i[0]=-MB,i[1]=+MB;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]=+MB}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 ixe=Yi((HJn,VH)=>{function Uct(){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 VH<"u"&&VH.exports&&(VH.exports=Uct)});var pte,mI,Ue,bE,nf,Bo,Iwe,xE,Pwe,Dwe,gr,yc=hs(()=>{pte=new Date(2107,11,31,23,59,58),mI=new Date(1980,0,1),Ue=void 0,bE=1/0,nf="undefined",Bo="function",Iwe="object",xE="string",Pwe="number",Dwe="boolean",gr=new Uint8Array});function gI(e){if(e&&typeof e!=Bo)throw new Error(lIe);return e}function u5(e){if(e&&(typeof e.addEventListener!=Bo||typeof e.aborted!=Dwe))throw new Error(uIe);return e||Ue}function f5(e,t){if(e&&typeof e!=xE||t&&!(t instanceof Uint8Array))throw new Error(yte)}function Ate(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function _I(e,t,n){e!==Ue&&Ate(e,t,n)}function TE(e){return typeof e==xE&&e.trim()?Number(e):e}var Rwe,Owe,Mwe,Nwe,Lwe,QG,e5,t5,n5,Fwe,Bwe,kwe,Uwe,zwe,Vwe,jwe,Hwe,i5,r5,o5,s5,Gwe,Wwe,qwe,Ywe,Xwe,Kwe,$we,Jwe,Zwe,gte,Qwe,eIe,d3,pI,tIe,nIe,iIe,rIe,oIe,sIe,_te,aIe,cIe,a5,c5,ob,l5,z_,lIe,uIe,yte,h3=hs(()=>{yc();Rwe="filenameEncoding",Owe="commentEncoding",Mwe="decodeText",Nwe="extractPrependedData",Lwe="extractAppendedData",QG="password",e5="rawPassword",t5="passThrough",n5="signal",Fwe="checkPasswordOnly",Bwe="checkOverlappingEntryOnly",kwe="checkOverlappingEntry",Uwe="checkAmbiguity",zwe="checkLocalDirectory",Vwe="checkSignature",jwe="checkCrc32",Hwe="checkAuthenticationCode",i5="useWebWorkers",r5="useCompressionStream",o5="transferStreams",s5="preventClose",Gwe="encryptionStrength",Wwe="extendedTimestamp",qwe="ntfsTimestamp",Ywe="keepOrder",Xwe="level",Kwe="bufferedWrite",$we="createTempStream",Jwe="dataDescriptorSignature",Zwe="useUnicodeFileNames",gte="dataDescriptor",Qwe="supportZip64SplitFile",eIe="encodeText",d3="offset",pI="usdz",tIe="unixExtraFieldType",nIe="localExtraField",iIe="centralExtraField",rIe="strictness",oIe="filenameValidation",sIe="normalizeFilename",_te="maxAppendedDataSize",aIe="decryptCentralDirectory",cIe="signCentralDirectory",a5="filename",c5="comment",ob="strict",l5="balanced",z_="tolerant",lIe="Invalid option (must be a function)",uIe="Invalid signal (must be an AbortSignal instance)",yte="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function V_(){return bte}function m3(e){return xte(e.chunkSize)}function xte(e){return e=TE(e),Number.isInteger(e)&&e>=dIe?Math.max(e,cbt):fIe}function p3(e){Object.assign(bte,AIe(bIe(e)))}function AIe(e){let t={};for(let n of fbt){let i=e[n];i!==Ue&&(t[n]=dbt(n,i))}return t}function dbt(e,t){if(_Ie.includes(e)){if(t=TE(t),e==gIe&&(!Number.isInteger(t)||t<dIe))throw new Error(hIe)}else yIe.includes(e)&&gI(t);return t}function bIe(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 yI(e){let t=AIe(bIe(e));Object.assign(pIe,t),Object.assign(bte,t)}var fIe,cbt,dIe,hIe,mIe,pIe,gIe,lbt,ubt,_Ie,yIe,fbt,bte,_0=hs(()=>{yc();h3();fIe=64*1024,cbt=64,dIe=1,hIe="Invalid maxWorkers (must be an integer greater than 0)",mIe=2;try{typeof navigator!=nf&&navigator.hardwareConcurrency&&(mIe=navigator.hardwareConcurrency)}catch{}pIe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:fIe,maxWorkers:mIe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=nf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=nf&&DecompressionStream},gIe="maxWorkers",lbt=["baseURI","wasmURI","workerURI"],ubt=["useCompressionStream","useWebWorkers","transferStreams"],_Ie=["chunkSize",gIe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],yIe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],fbt=[...lbt,...ubt,..._Ie,...yIe],bte={...pIe}});function ph(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function d5(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function di(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var EE=hs(()=>{});var g3,xIe,hbt,mbt,pbt,gbt,_bt,ybt,Abt,Gm,_3=hs(()=>{g3=[[],[],[],[],[],[],[],[]];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;g3[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=g3[t-1][e];g3[t][e]=n>>>8^g3[0][n&255]}[xIe,hbt,mbt,pbt,gbt,_bt,ybt,Abt]=g3,Gm=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=Abt[a&255]^ybt[a>>>8&255]^_bt[a>>>16&255]^gbt[a>>>24&255]^pbt[c&255]^mbt[c>>>8&255]^hbt[c>>>16&255]^xIe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^xIe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var y3,TIe=hs(()=>{_3();y3=class extends null{constructor(){let t,n=new Gm;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 AI(e){if(typeof TextEncoder==nf){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 Tte=hs(()=>{yc()});var pu,A3,EIe,Ete,Cte,sb,CIe=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}},A3={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}}},EIe={};EIe.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=A3.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}};Ete={};Ete.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}};Cte={};Cte.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)}};sb={importKey(e){return new sb.hmacSha1(A3.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=A3.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)}};sb.hmacSha1=class{constructor(e){let t=this,n=t._hash=EIe.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 h5(e){if(bbt)return crypto.getRandomValues(e);throw new Error(bI)}var bbt,y0,ab,cb,j_,bI,m5=hs(()=>{yc();bbt=typeof crypto!=nf&&typeof crypto.getRandomValues==Bo,y0="Invalid password",ab="Invalid signature",cb=ab,j_="zipjs-abort-check-password",bI="Crypto API not supported"});function PIe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:Nbt(t,n),strength:i-1,pendingInput:gr})}function DIe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=ph(c,t));let u=t.length-r;n=Lbt(n,i+(u-u%xI));let f;for(f=0;f<=u-xI;f+=xI){let d=E3(A0,gh(t,f,f+xI));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(T3(A0,p),f+i)}return e.pendingInput=gh(t,f),n}async function Dbt(e,t,n,i){let r=await RIe(e,t,n,gh(i,0,x3[t])),o=gh(i,x3[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(y0)}async function Rbt(e,t,n){let i=h5(new Uint8Array(x3[t])),r=await RIe(e,t,n,i);return ph(i,r)}async function RIe(e,t,n,i){e.password=null;let r=await Obt(xbt,n,Cbt,!1,vbt),o=await Mbt(Object.assign({salt:i},vte),r,8*(b3[t]*2+2)),s=new Uint8Array(o),a=E3(A0,gh(s,0,b3[t])),c=E3(A0,gh(s,b3[t],b3[t]*2)),u=gh(s,b3[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Ibt(new wbt(a),Array.from(Sbt)),hmac:new Pbt(c)}),u}async function Obt(e,t,n,i,r){if(vIe)try{return await C3.importKey(e,t,n,i,r)}catch{return vIe=!1,sb.importKey(t)}else return sb.importKey(t)}async function Mbt(e,t,n){if(SIe)try{return await C3.deriveBits(e,t,n)}catch{return SIe=!1,sb.pbkdf2(t,e.salt,vte.iterations,n)}else return sb.pbkdf2(t,e.salt,vte.iterations,n)}function Nbt(e,t){return t===Ue?AI(e):t}function Lbt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function gh(e,t,n){return e.subarray(t,n)}function T3(e,t){return e.fromBits(t)}function E3(e,t){return e.toBits(t)}var xI,xbt,wIe,Tbt,Ebt,Cbt,vte,vbt,x3,b3,H_,Sbt,_5,C3,IIe,A0,wbt,Ibt,Pbt,vIe,SIe,p5,g5,OIe=hs(()=>{yc();Tte();EE();CIe();m5();xI=16,xbt="raw",wIe={name:"PBKDF2"},Tbt={name:"HMAC"},Ebt="SHA-1",Cbt=Object.assign({hash:Tbt},wIe),vte=Object.assign({iterations:1e3,hash:{name:Ebt}},wIe),vbt=["deriveBits"],x3=[8,12,16],b3=[16,24,32],H_=10,Sbt=[0,0,0,0],_5=typeof crypto!=nf,C3=_5&&crypto.subtle,IIe=_5&&typeof C3!=nf,A0=A3.bytes,wbt=Ete.aes,Ibt=Cte.ctrGladman,Pbt=sb.hmacSha1,vIe=_5&&IIe&&typeof C3.importKey==Bo,SIe=_5&&IIe&&typeof C3.deriveBits==Bo,p5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){PIe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await Dbt(c,f,u,gh(s,0,x3[f]+2)),s=gh(s,x3[f]+2),r?a.error(new Error(j_)):d()):await p;let g=new Uint8Array(s.length-H_-(s.length-H_)%xI);a.enqueue(DIe(c,s,g,0,H_,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=gh(u,0,u.length-H_),p=gh(u,u.length-H_),g=gr;if(d.length){let A=E3(A0,d);c.update(A);let b=a.update(A);g=T3(A0,b)}let m=gh(T3(A0,c.digest()),0,H_),y=u.length<H_?1:0;for(let A=0;A<H_;A++)y|=m[A]^p[A];if(y&&o)throw new Error(cb);s.enqueue(g)}}})}},g5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){PIe(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 Rbt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%xI);p.set(d,0),o.enqueue(DIe(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(E3(A0,a));s.update(d),u=T3(A0,d)}let f=T3(A0,s.digest()).slice(0,H_);r.enqueue(ph(u,f))}}})}}});function FIe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),Fbt(e,t,n)}function MIe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=BIe(e)^t[i],b5(e,n[i]);return n}function NIe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=BIe(e)^t[i],b5(e,t[i]);return n}function Fbt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new Gm(i[0]),crcKey2:new Gm(i[2])}),n)for(let r=0;r<n.length;r++)b5(e,n[r]);else for(let r=0;r<t.length;r++)b5(e,t.charCodeAt(r))}function b5(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=LIe(Math.imul(LIe(n+kIe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function BIe(e){let t=e.keys[2]|2;return kIe(Math.imul(t,t^1)>>>8)}function kIe(e){return e&255}function LIe(e){return e&4294967295}var TI,y5,A5,UIe=hs(()=>{_3();m5();TI=12,y5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){FIe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=MIe(a,o.subarray(0,TI));if(a.password=a.rawPassword=null,(c[TI-1]^a.passwordVerification)!=0)throw new Error(y0);o=o.subarray(TI)}r?s.error(new Error(j_)):s.enqueue(MIe(a,o))}})}},A5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){FIe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=h5(new Uint8Array(TI));u[TI-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(NIe(s,u),0),c=TI}else a=new Uint8Array(r.length),c=0;a.set(NIe(s,r),c),o.enqueue(a)}})}}});function Wm(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 b0(e,t){e=Wm(e);let n=t?{type:t}:{};if(Bbt())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 Bbt(){return typeof Blob.prototype.stream!=Bo||new Blob([]).stream()instanceof ReadableStream}function zIe(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 EI=hs(()=>{yc()});function x5(e){return kbt.get(e)}function T5(e){return Ste.get(e)}function Ubt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Bo&&typeof i!=Bo)throw new Error(VIe);Ste.set(e,{CompressionStream:n,DecompressionStream:i})}async function jIe(e,t){!Ste.has(e)&&t&&Ubt(e,await import(t))}var VIe,kbt,Ste,vE=hs(()=>{yc();VIe="Invalid codec module",kbt=new Map,Ste=new Map});function Hbt(e,t,n){let i=new Gm,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(WIe);y.set(Vbt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(wte),A=di(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=vI(e,t),qm(e,d);function p(){g(),s=setTimeout(()=>c(new Error(lb)),jbt)}function g(){clearTimeout(s)}}function Pte(e,t){if(!e)return!1;let n=HIe.get(e);n||(n=new Map,HIe.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 S5(e){return Pte(e,Ite)}function Dte(e){return Pte(e,S3)}function qIe(e,t,n){t=qm(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function YIe(e,t,n){if(!e)throw new Error(zbt);return new e(t,n)}function XIe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?GIe:Ite,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return vI(e,a)}function qm(e,t){return Wm(e).pipeThrough(t)}function vI(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 Gbt(n,o),await Wbt(i,o)}}}async function Gbt(e,t){try{await e.abort(t)}catch{}}async function Wbt(e,t){try{await e.cancel(t)}catch{}}function qbt(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(SI);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var lb,SI,wI,zbt,Ite,GIe,S3,WIe,wte,Vbt,jbt,E5,C5,v5,HIe,Rte=hs(()=>{_3();TIe();OIe();UIe();m5();yc();EE();EI();vE();lb="Invalid uncompressed size",SI="Invalid compressed data",wI=ab,zbt="Compression method not supported",Ite="deflate-raw",GIe="deflate64-raw",S3="gzip",WIe=10,wte=8,Vbt=[31,139,8],jbt=5e3,E5=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&&T5(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new y3,T=qm(T,A)),o)if(E)T=vI(T,YIe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new C5,T=vI(T,new r(S3)),T=qm(T,x);else try{T=XIe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(S3)}catch{throw S}T=vI(T,I),T=qm(T,new C5)}s&&(c?T=qm(T,new A5(t)):(b=new g5(t),T=qm(T,b))),qIe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},C5=class extends null{constructor(){let t,n=WIe,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<=wte){i=ph(i,r);return}let a=s-wte,c=Math.min(a,i.length);o.enqueue(ph(i.subarray(0,c),r.subarray(0,a-c))),i=ph(i.subarray(c),r.subarray(a-c))},flush(){let r=di(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};v5=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 y5(t)):(b=new p5(t),x=qm(x,b))),u){let T=p&&T5(p);if(T)x=vI(x,YIe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=XIe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===Ue)throw E;let v;try{v=new r(S3)}catch{throw E}x=Hbt(x,v,y)}x=qbt(x)}a&&(A=new y3,x=qm(x,A)),qIe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(wI)}})}},HIe=new Map});var Ybt,KIe,$Ie,JIe,Ote,ZIe,QIe,II,I5,w5,w3,P5=hs(()=>{yc();Rte();Ybt=64*1024,KIe="message",$Ie="start",JIe="pull",Ote="data",ZIe="ack",QIe="close",II="deflate",I5="inflate",w5=class extends null{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(II)?o=E5:r.startsWith(I5)&&(o=v5),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(lb)},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)}})}},w3=class extends null{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=Ybt),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 tPe({initModule:e}){R5=e}function nPe(e){Nte=e}async function iPe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||S5(t)||Dte(t))return!0;if(n)try{return await R5(e),!0}catch{return!1}return!1}function Fte(e){e.createWorker?ePe=!0:D5=!1}async function Mte(e,...t){try{await e(...t)}catch{}}function Bte(e,t){return{run:()=>O5(e,t)}}async function O5({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(II),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!S5(d))try{await R5(r)}catch{}}else try{await R5(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new w5(e,r),await t.pipeThrough(o).pipeThrough(new w3(m3(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 wE,D5,ePe,Nte,R5,SE,Lte,I3=hs(()=>{yc();_0();P5();wE="Worker startup timeout",R5=()=>{};SE=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 ePe&&(f=Ue),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new w3(m3(o))).pipeThrough(new Lte(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)}}}),D5===Ue&&(D5=typeof Worker!=nf),(a&&Nte&&(D5&&u||f)?Nte:Bte)(t,o)}},Lte=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await Mte(t,i)},async transform(s,a){o+=s.length,n&&await Mte(n,o,i),a.enqueue(s)},async flush(){r&&await Mte(r,o)}})}}});async function F5(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=ext(p,i.baseURI)),await jIe(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=IE.find(v=>!v.busy);if(E)return fPe(E),new SE(E,e,t,T);if(IE.length<y){let v={indexWorker:uPe};return uPe++,IE.push(v),new SE(v,e,t,T)}else return new Promise(v=>{PI.push({resolve:v,stream:e,workerOptions:t}),N5=i.workerStarvationTimeout,L5()})}function T(E){if(dPe(),PI.length){let[{resolve:v,stream:S,workerOptions:I}]=PI.splice(0,1);v(new SE(E,S,I,T)),L5()}else E.worker?(fPe(E),ixt(E,t)):IE=IE.filter(v=>v!=E)}}function ext(e,t){try{return new URL(e,t).toString()}catch{return e}}function L5(){!DI&&PI.length&&Number.isFinite(N5)&&N5>=0&&(DI=setTimeout(txt,N5))}function dPe(){DI&&(clearTimeout(DI),DI=null)}function txt(){if(DI=null,PI.length){let[{resolve:e,stream:t,workerOptions:n}]=PI.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:Ue,createWorker:Ue});e(new SE({},t,i,nxt)),L5()}}function nxt(){dPe(),L5()}function ixt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{IE=IE.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function fPe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var IE,PI,DI,N5,uPe,B5=hs(()=>{yc();P5();vE();I3();IE=[],PI=[],uPe=0});function mPe(e){if(rxt){let t="";for(let n=0;n<e.length;n++)t+=hPe[e[n]];return t}else return new TextDecoder().decode(e)}var hPe,rxt,pPe=hs(()=>{hPe="\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(""),rxt=hPe.length==256});function P3(e,t){return _Pe(e,t,!0)}function gPe(e,t){return _Pe(e,t,!1)}function _Pe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?mPe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var Hte=hs(()=>{pPe()});function sxt(){xPe=(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();Gte=n==1}catch{Gte=!1}})()}function V5(e){return!!(e&&e.getData)}async function kc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function axt(e){return e=new G_(e),await kc(e),(e.size===Ue||!e.readUint8Array)&&(e=new rf(await b0(e.readable)),await kc(e)),e}function Uo(e,t,n){return e.readUint8Array(t,n)}function qte(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?OI.prototype.createReadable.call(e,t):e.readable}var APe,bPe,oxt,CNi,vNi,Wte,yPe,RI,OI,k5,D3,Gte,xPe,rf,MI,R3,O3,U5,z5,G_,NI,j5=hs(()=>{yc();_0();EE();EI();Hte();APe="Writer iterator completed too soon",bPe="Writer not initialized",oxt="text/plain",CNi=256*1024,vNi=16*1024*1024,Wte="writable",yPe=Symbol(),RI=class{constructor(){this.size=0}init(){this.initialized=!0}},OI=class extends RI{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=m3(V_())}={}){let r=this,o=0;return i=xte(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}})}},k5=class extends RI{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(bPe);return t.writeUint8Array(d5(i))}});Object.defineProperty(t,Wte,{get(){return n}})}writeUint8Array(){}},D3=class extends k5{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)}};rf=class extends OI{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),xPe||sxt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?Wm(i.stream()):Gte?Wm(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)}},MI=class extends RI{constructor(t){super();let n=this,i=new null;Object.defineProperty(n,Wte,{get(){return i.writable}}),n.contentType=t,n.blobPromise=b0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},R3=class extends rf{constructor(t){super(new Blob([t],{type:oxt}))}},O3=class extends MI{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)}},U5=class extends OI{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(axt));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=ph(d,p)}}else o=gr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},z5=class extends RI{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===yPe){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(APe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await kc(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,Wte,{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(yPe)}finally{t.releaseLock()}}},G_=class{constructor(t){return Array.isArray(t)&&(t=new U5(t)),(t instanceof ReadableStream||typeof t.getReader==Bo)&&(t={readable:Wm(t)}),t}},NI=class{constructor(t){return t.writable===Ue&&typeof t.next==Bo&&(t=new z5(t)),(t instanceof WritableStream||typeof t.getWriter==Bo)&&(t={writable:zIe(t)}),t.size===Ue&&(t.size=0),t}}});var Yte,Xte,M3,Kte,N3,$te,Jte,Zte,LI,FI,L3,Qte,F3,ene,tne,nne,H5,G5,ine,rne,one,W5,sne,ane,cne,lne,PE,une,cxt,fne,q5,lxt,Y5,uxt,fxt,dxt,hxt,dne,hne,mne,pne,mxt,pxt,gxt,_xt,yxt,Axt,bxt,xxt,Txt,Ext,Cxt,vxt,Sxt,wxt,Ixt,Pxt,ub,gne=hs(()=>{Yte="filename",Xte="rawFilename",M3="comment",Kte="rawComment",N3="uncompressedSize",$te="compressedSize",Jte="offset",Zte="diskNumberStart",LI="lastModDate",FI="rawLastModDate",L3="lastAccessDate",Qte="rawLastAccessDate",F3="creationDate",ene="rawCreationDate",tne="internalFileAttributes",nne="externalFileAttributes",H5="internalFileAttribute",G5="externalFileAttribute",ine="msdosAttributesRaw",rne="msdosAttributes",one="msDosCompatible",W5="zip64",sne="encrypted",ane="version",cne="versionMadeBy",lne="zipCrypto",PE="directory",une="executable",cxt="symlink",fne="compressionMethod",q5="signature",lxt="crc32",Y5="extraField",uxt="extraFieldInfoZip",fxt="extraFieldUnix",dxt="extraFieldUnixType1",hxt="extraFieldPkwareUnix",dne="unixMode",hne="setuid",mne="setgid",pne="sticky",mxt="bitFlag",pxt="rawBitFlag",gxt="filenameLength",_xt="extraFieldLength",yxt="unixExternalUpper",Axt="filenameUTF8",bxt="commentUTF8",xxt="rawExtraField",Txt="extraFieldZip64",Ext="extraFieldUnicodePath",Cxt="extraFieldUnicodeComment",vxt="extraFieldAES",Sxt="extraFieldNTFS",wxt="extraFieldExtendedTimestamp",Ixt="extraFieldUSDZ",Pxt=[Yte,Xte,N3,$te,LI,FI,M3,Kte,L3,Qte,F3,ene,Jte,Zte,tne,nne,H5,G5,ine,rne,one,W5,sne,ane,cne,lne,PE,une,cxt,fne,q5,lxt,Y5,fxt,uxt,dxt,hxt,"uid","gid",dne,yxt,hne,mne,pne,mxt,pxt,gxt,_xt,Axt,bxt,xxt,Txt,Ext,Cxt,vxt,Sxt,wxt,Ixt],ub=class{constructor(t){Pxt.forEach(n=>this[n]=t[n])}}});var KPe={};Oq(KPe,{ERR_AMBIGUOUS_ARCHIVE:()=>Gne,ERR_BAD_FORMAT:()=>BI,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>kne,ERR_ENCRYPTED:()=>Vne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Wne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>Hne,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>Bne,ERR_EOCDR_NOT_FOUND:()=>Fne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>zne,ERR_INVALID_AUTHENTICATION_CODE:()=>cb,ERR_INVALID_COMPRESSED_DATA:()=>SI,ERR_INVALID_CRC32:()=>wI,ERR_INVALID_FILENAME_VALIDATION:()=>Xne,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Kne,ERR_INVALID_PASSWORD:()=>y0,ERR_INVALID_SIGNATURE:()=>ab,ERR_INVALID_STRICTNESS:()=>Yne,ERR_INVALID_UNCOMPRESSED_SIZE:()=>lb,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Une,ERR_OVERLAPPING_ENTRY:()=>jne,ERR_SPLIT_ZIP_FILE:()=>Z5,ERR_UNSAFE_FILENAME:()=>qne,ERR_UNSUPPORTED_COMPRESSION:()=>J5,ERR_UNSUPPORTED_ENCRYPTION:()=>$5,ERR_UNSUPPORTED_UINT64:()=>$ne,ERR_WORKER_STARTUP_TIMEOUT:()=>wE,WARNING_APPENDED_DATA:()=>e9,WARNING_COMPRESSED_PATCHED_DATA:()=>Qne,WARNING_DUPLICATE_FILENAME:()=>iie,WARNING_MALFORMED_EXTRA_FIELD:()=>h9,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>rie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>oie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>sie,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>kI,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>tie,WARNING_PREPENDED_DATA:()=>t9,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>nie,WARNING_UNKNOWN_VERSION:()=>Zne,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>eie,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Jne,WARNING_WRAPPED_ENTRIES_COUNT:()=>Q5,ZipReader:()=>ME,ZipReaderStream:()=>i9,isZipFile:()=>zPe});async function zPe(e,t={}){if(e=new G_(e),await kc(e),(e.size===Ue||!e.readUint8Array)&&(e=new rf(await b0(e.readable)),await kc(e)),e.size<22)return!1;let n=cie(t,{}),i=n!=z_,r=WPe(t[_te],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await qPe(e,i,r);if(!o||n==ob&&s>1)return!1;let a=_r(di(o),20),c=o.offset+22+a;return e.size-c<=r}function _ne(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 DPe(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 yne(e){if(e.length>=6){let t=di(e);if(Ri(t,0)==84233040){let n=_r(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function Hxt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function Gxt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=di(e),i=_r(n,26);Object.assign(t,{compressionMethod:_r(n,0),compressedSize:nd(n,2),uncompressedSize:nd(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 VPe(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:oTt(o),filenameLength:_r(t,n+22),extraFieldLength:_r(t,n+24)})}function jPe(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=di(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&&(Wxt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(RPe(p,Yte,Xte,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(RPe(g,M3,Kte,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(qxt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(OPe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(OPe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(Yxt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=MPe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(MPe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(Xxt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function Wxt(e,t){t.zip64=!0;let n=di(e.data),i=Uxt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+IPe[s].bytes,0);if(e.data.length<r)throw new Error(zne);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=IPe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function RPe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=di(e.data),s=new Gm;s.append(r[n]);let a=di(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ri(o,1),u=db(o,0);Object.assign(e,{version:u,[t]:P3(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Ri(a,0)}),e.valid&&(i[t]=e[t],i[t+kxt]=!0)}function qxt(e,t,n){let i=di(e.data),r=db(i,4);Object.assign(e,{vendorVersion:db(i,0),vendorId:db(i,2),strength:r,originalCompressionMethod:n,compressionMethod:_r(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=UPe&&(t.crc32=Ue)}function Yxt(e,t){let n=di(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=di(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=Ane(s),f=Ane(a),d=Ane(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function OPe(e,t){if(e.data.length<8)return;let n=di(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 MPe(e,t,n){try{let i=di(e.data),r,o;if(n){let s=0,a=db(i,s++),c=db(i,s++);r=NPe(e.data.subarray(s,s+c)),s+=c;let u=db(i,s++);o=NPe(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 NPe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function Xxt(e,t,n){if(!e.data.length)return;let i=di(e.data),r=db(i,0),o=[],s=[];n?((r&1)==1&&(o.push(LI),s.push(FI)),(r&2)==2&&(o.push(L3),s.push(Qte)),(r&4)==4&&(o.push(F3),s.push(ene))):e.data.length>=5&&(o.push(LI),s.push(FI));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 Kxt({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=di(g),y=g.length==d+4&&Ri(m,0)==134695760;if(y){let A=LPe(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=LPe(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(jne);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function LPe(e,t,n){let i=Ri(e,t),r,o;return n?(r=nd(e,t+4),o=nd(e,t+12)):(r=Ri(e,t+4),o=Ri(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function UI(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function $xt(e){return await HPe(e)==134695760}async function Jxt(e){let t=await HPe(e);return t==134695760||t==808471376}async function HPe(e){let t=await Uo(e,0,4);return Ri(di(t))}function GPe(e){return e===ob||e===l5||e===z_}function Zxt(e,t,n){return Math.min(e,n?t*jxt:t)}function cie(e,t){return FPe(e,FPe(t,l5))}function FPe(e,t){let n=e[rIe];if(n!==Ue){if(!GPe(n))throw new Error(Yne);return n}let i=e[Uwe];return i===Ue?t:i?ob:t==z_?z_:l5}function Qxt(e,t){return e===Ue?t!=z_:!!e}function eTt(e,t){return e===Ue?t==ob:!!e}function tTt(e,t){if(e===Ue)return t;if(!GPe(e))throw new Error(Xne);return e}function nTt(e,t){if(t==z_)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||Bxt.test(e)?!0:t==ob&&(n.includes(".")||n.includes(""))}function WPe(e,t){if(e!==Ue){let n=TE(e);if(typeof n!=Pwe||Number.isNaN(n)||n<0)throw new Error(Kne);return n}return t==ob?0:t==z_?1/0:65535}async function qPe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:Vxt},s,a,c=0;for await(let[u,f,d,p,g]of YPe(e,r)){let m=_r(u,p+20);if(g+22+m==i){let y=await XPe(e,u,f,p,g,i,o);if(y==n9){if(s||(s=xne(d,p,g)),c++,!t||c>1)break}else y==aie&&!a&&(a=xne(d,p,g))}}return s||(s=a),s||(s=await iTt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function iTt(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 YPe(e,r)){let p=xne(u,f,d);o||(o=p);let g=await XPe(e,a,c,f,d,i,n);if(g==n9)return p;g==aie&&!s&&(s=p)}return s||o}async function*YPe(e,t){let n=e.size-t,i=await Uo(e,n,t),r=di(i);for(let o=i.length-22;o>=0;o--)Ri(r,o)==101010256&&(yield[r,n,i,o,n+o])}function xne(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function XPe(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 BPe(e,t,n,r-20,o,s)==117853008?n9:PPe;if(!a&&!c)return aie;let f=_r(t,i+6);for(let d of[r-c,UI(e,f)+u])if(await BPe(e,t,n,d,o,s)==33639248)return n9;return PPe}async function BPe(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(di(s),0)}return Ue}function rTt(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]))&&E0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&wPe)!=(e.rawBitFlag&wPe)&&E0(s,r,rie),t.compressionMethod!=e.compressionMethod&&E0(s,r,oie),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&E0(s,r,sie)}function E0(e,t,n){e?X5(n):_h(t,n)}function _h(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==Ue&&(i.filename=n),e.push(i)}}function X5(e){let t=new Error(Gne);throw t.reason=e,t}function Os(e,t,n){return t[n]===Ue?e.options[n]:t[n]}function kPe(e,t,n){return gI(Os(e,t,n))}function oTt(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<mI?mI:i}function Ane(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function db(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 nd(e,t){let n=e.getBigUint64(t,!0);if(n>zxt)throw new Error($ne);return Number(n)}var BI,Fne,Bne,kne,Une,zne,Vne,$5,J5,Z5,jne,Hne,Gne,Wne,qne,Yne,Xne,Kne,$ne,Jne,Zne,Qne,h9,eie,Q5,e9,t9,tie,nie,iie,kI,rie,oie,sie,Fxt,Bxt,vPe,kxt,SPe,wPe,UPe,Uxt,IPe,zxt,Vxt,jxt,PPe,aie,n9,ME,i9,bne,lie=hs(()=>{yc();_0();vE();B5();j5();Hte();EE();EI();_3();gne();h3();BI="File format is not recognized",Fne="End of central directory not found",Bne="End of Zip64 central directory locator not found",kne="Central directory header not found",Une="Local file header not found",zne="Zip64 extra field not found",Vne="File contains encrypted entry",$5="Encryption method not supported",J5="Compression method not supported",Z5="Split zip file",jne="Overlapping entry found",Hne="Entry data out of bounds",Gne="Ambiguous archive",Wne="Encrypted central directory is not supported",qne="Unsafe filename",Yne="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Xne="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Kne="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",$ne="64-bit value exceeds Number.MAX_SAFE_INTEGER",Jne="unsorted central directory",Zne="unknown version needed to extract",Qne="compressed patched data",h9="malformed extra field",eie="unknown zip64 extensible data",Q5="wrapped entries count",e9="appended data",t9="prepended data",tie="prepended central directory",nie="trailing central directory data",iie="duplicate filename",kI="mismatched zip64 end of central directory record",rie="mismatched local file header (general purpose bit flag)",oie="mismatched local file header (compression method)",sie="mismatched local file header (crc32 or sizes)",Fxt=63,Bxt=/^[a-zA-Z]:/,vPe="utf-8",kxt="UTF8",SPe="cp437",wPe=2057,UPe=1,Uxt=[[N3,4294967295],[$te,4294967295],[Jte,4294967295],[Zte,65535]],IPe={65535:{getValue:Ri,bytes:4},4294967295:{getValue:nd,bytes:8}},zxt=BigInt(Number.MAX_SAFE_INTEGER),Vxt=64,jxt=1032,PPe=0,aie=1,n9=2,ME=class{constructor(t,n={}){Object.assign(this,{reader:new G_(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await kc(i),(i.size===Ue||!i.readUint8Array)&&(i=new rf(await b0(i.readable)),await kc(i)),i.size<22)throw new Error(BI);let r=n.warnings=[],o=cie(t,n.options),s=o==ob,a=o!=z_,c=WPe(Os(n,t,_te),o),u=tTt(Os(n,t,oIe),o),f=Os(n,t,sIe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await qPe(i,a,c);if(!d)throw await $xt(i)?new Error(Z5):new Error(Fne);a&&p>1&&X5("multiple end of central directory records");let g=di(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&&X5(e9),T>0&&_h(r,e9);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+=UI(i,S)),M){let He=d.offset>=20?await Uo(i,d.offset-20,20):gr,Xe=di(He);if(He.length==20&&Ri(Xe,0)==117853008){y=UI(i,Ri(Xe,4))+nd(Xe,8);let $e=await Uo(i,y,56),Pe=di($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=di($e)}if($e.length<56||Ri(Pe,0)!=101075792)throw new Error(Bne);if(_=!0,C=nd(Pe,4)>44,C){let st=Math.min(nd(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Uo(i,y+56,st);P=Gxt(vt)}}E==65535?E=Ri(Pe,16):E!=Ri(Pe,16)&&E0(s,r,kI),S==65535?S=Ri(Pe,20):S!=Ri(Pe,20)&&E0(s,r,kI),I==65535?I=nd(Pe,32):I!=nd(Pe,32)&&E0(s,r,kI),m==4294967295?m=nd(Pe,40):m!=nd(Pe,40)&&E0(s,r,kI),y=UI(i,S)+nd(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(Z5);if(y<0)throw new Error(BI);let B=0,j=await Uo(i,y,m),k=di(j);if(m){if(j.length<4)throw new Error(BI);let He=V-m;if(y!=He&&S==E){let Xe=Ri(k,B)==33639248||!!(P&&P.compressedSize)||_ne(k),$e=!Xe;if(!$e&&He>=0&&He+4<=i.size){let Pe=await Uo(i,He,4);$e=Ri(di(Pe),0)==33639248}if($e){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Xe),j=await Uo(i,y,m),k=di(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Uo(i,y,m),k=di(j)),y<0||y>=i.size)throw new Error(BI);n.directoryOffset=y,n.directoryLength=F;let q=kPe(n,t,aIe),Q,W;if(q&&I&&j.length>=4&&Ri(k,0)!=33639248&&(C||_ne(k))){let He=Hxt(P,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),P),k=di(j),F=j.length,Q=!0}P&&!Q&&(j.length<4||Ri(k,0)==33639248)&&_h(r,eie),L=y;let J=Os(n,t,Rwe),Z=Os(n,t,Owe),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=DPe(k,j,B),I&&_h(r,Q5));for(let He=0;He<I;He++){let Xe=new bne(i,n.options);if(B+46>j.length||Ri(k,B)!=33639248)throw He==0&&!Q&&(C||_ne(k))?new Error(Wne):new Error(kne);VPe(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),bi=Xn&255,Wi={readOnly:!!(bi&1),hidden:!!(bi&2),system:!!(bi&4),directory:!!(bi&16),archive:!!(bi&32)},wi=Ri(k,B+42),hi=kPe(n,t,Mwe)||P3,xi=ht?vPe:J||SPe,jn=Bi?vPe:Z||SPe,nn=hi(mt,xi,a5);if(nn===Ue&&(nn=P3(mt,xi)),f){let ki=f(nn);ki!==Ue&&(nn=ki)}if(nTt(nn,u)){let ki=new Error(qne);throw ki.filename=nn,ki}let Wn=hi(rt,jn,c5);Wn===Ue&&(Wn=P3(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:bi,msdosAttributes:Wi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Bi,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:nn,comment:Wn}),jPe(Xe,Xe,k,B+6)&&_h(r,h9,nn),Xe.offset+=R;let Zi=UI(i,Xe.diskNumberStart)+Xe.offset;L=Math.min(Zi,L),Zi<fe&&_h(r,Jne,nn),fe=Zi,(Xe.version&255)>Fxt&&_h(r,Zne,nn),(Xe.rawBitFlag&32)==32&&_h(r,Qne,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),gi=((Xe.unixMode===Ue?Mr:Xe.unixMode)&61440)==40960,ho=!gi&&(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:gi,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 ub(Xe);if(Bn.getData=(ki,Nr)=>Xe.getData(ki,Bn,n.readRanges,Nr),Bn.arrayBuffer=async ki=>{let Nr=new null,Wc=b0(Nr.readable).then(bd=>bd.arrayBuffer());return Wc.catch(()=>{}),await Xe.getData(Nr,Bn,n.readRanges,ki),Wc},B=Xt,He==I-1&&xe){let ki=DPe(k,j,B);ki&&(I+=ki,_h(r,Q5))}let{onprogress:qi}=t;if(qi)try{await qi(He+1,I,new ub(Xe))}catch{}yield Bn}let ge=B,we=yne(j.subarray(B))||(Q?yne(W):Ue);if(!we&&!Q){let He=y+B,Xe=Math.min(V-He,65541);Xe>=6&&(we=yne(await Uo(i,He,Xe)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&E0(s,r,nie),Ae&&E0(s,r,iie);let Se=Os(n,t,Nwe),Re=Os(n,t,Lwe),Qe=(s||Se)&&I&&L==4&&await Jxt(i)?4:0;return s&&(R||I&&L>Qe)&&X5(t9),(R||I&&L>4)&&_h(r,t9),O&&_h(r,tie),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 ME(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}};bne=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=V_(),{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=UI(a,f)+u,R=await Uo(a,I,30),O=di(R),L=Os(o,r,QG),_=Os(o,r,e5),C=Os(o,r,t5);if(f5(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(J5);if(R.length<30||Ri(O,0)!=67324752)throw new Error(Une);VPe(v,O,4);let{extraFieldLength:w,filenameLength:P}=v,M=v.dataOffset=I+30+P+w,F=Os(o,r,zwe),V=cie(r,o.options),B=Qxt(F,V),j=eTt(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),jPe(o,v,O,4,!0)&&_h(S,h9),rTt(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($5);let ae=C?Ue:x5(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(J5);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error($5);if(!L&&!_)throw new Error(Vne)}if(M+T>a.size)throw new Error(Hne);let Ae=T,fe=Wm(a.createReadable({offset:M,size:Ae})),xe=u5(Os(o,r,n5)),ge=Os(o,r,Fwe),we=Os(o,r,kwe),Se=Os(o,r,Bwe);Se&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Xe=g!=0&&!C,$e=C?T:x,Pe=g==9,qe=Os(o,r,r5);Pe&&(qe=!1);let st=Os(o,r,jwe),vt=(st===Ue?Os(o,r,Vwe):st)&&!C&&(!J||Z||d&&d.vendorVersion==UPe),Gt={options:{codecType:I5,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:Os(o,r,Hwe),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:$e,crc32:A,compressed:Xe,encrypted:J,useWebWorkers:Os(o,r,i5),useCompressionStream:qe,transferStreams:Os(o,r,o5),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 Kxt({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 NI(t),await kc(t,Zxt($e,T,Xe)),{writable:lt}=t;let{outputSize:ft}=await F5({readable:fe,writable:lt},Gt);if(t.size+=ft,ft!=$e)throw new Error(lb)}}catch(ft){if(ft.outputSize!==Ue&&(t.size+=ft.outputSize),!ge||ft.message!=j_)throw mt=ft,ft}finally{if(!(!V5(t)&&Os(o,r,s5))&<&&!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 a1e=Yi((w9,s1e)=>{(function(e,t){typeof w9=="object"&&typeof s1e<"u"?t(w9):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(w9,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 Km={};Oq(Km,{__addDisposableResource:()=>J1e,__assign:()=>D9,__asyncDelegator:()=>H1e,__asyncGenerator:()=>j1e,__asyncValues:()=>G1e,__await:()=>XI,__awaiter:()=>F1e,__classPrivateFieldGet:()=>X1e,__classPrivateFieldIn:()=>$1e,__classPrivateFieldSet:()=>K1e,__createBinding:()=>O9,__decorate:()=>P1e,__disposeResources:()=>Z1e,__esDecorate:()=>R1e,__exportStar:()=>k1e,__extends:()=>w1e,__generator:()=>B1e,__importDefault:()=>Y1e,__importStar:()=>q1e,__makeTemplateObject:()=>W1e,__metadata:()=>L1e,__param:()=>D1e,__propKey:()=>M1e,__read:()=>zie,__rest:()=>I1e,__rewriteRelativeImportExtension:()=>Q1e,__runInitializers:()=>O1e,__setFunctionName:()=>N1e,__spread:()=>U1e,__spreadArray:()=>V1e,__spreadArrays:()=>z1e,__values:()=>R9,default:()=>SEt});function w1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");kie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function I1e(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 P1e(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 D1e(e,t){return function(n,i){t(n,i,e)}}function R1e(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 O1e(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 M1e(e){return typeof e=="symbol"?e:"".concat(e)}function N1e(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 L1e(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function F1e(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 B1e(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 k1e(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&O9(t,e,n)}function R9(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 zie(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 U1e(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(zie(arguments[t]));return e}function z1e(){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 V1e(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 XI(e){return this instanceof XI?(this.v=e,this):new XI(e)}function j1e(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 XI?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 H1e(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:XI(e[r](s)),done:!1}:o?o(s):s}:o}}function G1e(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 R9=="function"?R9(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 W1e(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function q1e(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=Uie(e),i=0;i<n.length;i++)n[i]!=="default"&&O9(t,e,n[i]);return CEt(t,e),t}function Y1e(e){return e&&e.__esModule?e:{default:e}}function X1e(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 K1e(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 $1e(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 J1e(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 Z1e(e){function t(o){e.error=e.hasError?new vEt(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 Q1e(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 kie,D9,O9,CEt,Uie,vEt,SEt,$m=hs(()=>{kie=function(e,t){return kie=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])},kie(e,t)};D9=function(){return D9=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},D9.apply(this,arguments)};O9=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]});CEt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},Uie=function(e){return Uie=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},Uie(e)};vEt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};SEt={__extends:w1e,__assign:D9,__rest:I1e,__decorate:P1e,__param:D1e,__esDecorate:R1e,__runInitializers:O1e,__propKey:M1e,__setFunctionName:N1e,__metadata:L1e,__awaiter:F1e,__generator:B1e,__createBinding:O9,__exportStar:k1e,__values:R9,__read:zie,__spread:U1e,__spreadArrays:z1e,__spreadArray:V1e,__await:XI,__asyncGenerator:j1e,__asyncDelegator:H1e,__asyncValues:G1e,__makeTemplateObject:W1e,__importStar:q1e,__importDefault:Y1e,__classPrivateFieldGet:X1e,__classPrivateFieldSet:K1e,__classPrivateFieldIn:$1e,__addDisposableResource:J1e,__disposeResources:Z1e,__rewriteRelativeImportExtension:Q1e}});var eRe=Yi(M9=>{"use strict";Object.defineProperty(M9,"__esModule",{value:!0});M9.version=void 0;M9.version="4.1.5"});var gb=Yi(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});pb.hasOwnProperty=void 0;pb.isBoolean=wEt;pb.ellipsis=IEt;pb.removeWithPredicate=PEt;pb.assertNever=DEt;pb.hasOwnProperty=Object.prototype.hasOwnProperty;function wEt(e){return typeof e=="boolean"}function IEt(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 PEt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function DEt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var N9=Yi(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});S0.HtmlTag=S0.whitespaceRe=void 0;var REt=gb();S0.whitespaceRe=/\s+/;var OEt=(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(S0.whitespaceRe):[],r=t.split(S0.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(S0.whitespaceRe):[],r=t.split(S0.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)REt.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();S0.HtmlTag=OEt});var nRe=Yi(jie=>{"use strict";Object.defineProperty(jie,"__esModule",{value:!0});jie.truncateSmart=MEt;function MEt(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=NEt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=tRe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=tRe(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):Vie(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+Vie(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+Vie(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 NEt(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 tRe(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 Vie(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 iRe=Yi(Hie=>{"use strict";Object.defineProperty(Hie,"__esModule",{value:!0});Hie.truncateMiddle=LEt;function LEt(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 rRe=Yi(Gie=>{"use strict";Object.defineProperty(Gie,"__esModule",{value:!0});Gie.truncateEnd=BEt;var FEt=gb();function BEt(e,t,n){return(0,FEt.ellipsis)(e,t,n)}});var Wie=Yi(L9=>{"use strict";Object.defineProperty(L9,"__esModule",{value:!0});L9.AnchorTagBuilder=void 0;var kEt=N9(),UEt=nRe(),zEt=iRe(),VEt=rRe(),jEt=(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 kEt.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,UEt.truncateSmart)(t,i):r==="middle"?(0,zEt.truncateMiddle)(t,i):(0,VEt.truncateEnd)(t,i)},e})();L9.AnchorTagBuilder=jEt});var VE=Yi(F9=>{"use strict";Object.defineProperty(F9,"__esModule",{value:!0});F9.AbstractMatch=void 0;var HEt=(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})();F9.AbstractMatch=HEt});var jE=Yi(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.isControlChar=GEt;od.isAsciiLetterChar=WEt;od.isDigitChar=qEt;od.isQuoteChar=YEt;od.isWhitespaceChar=XEt;od.isAlphaNumericOrMarkChar=KEt;od.isValidEmailLocalPartSpecialChar=$Et;od.isUrlSuffixAllowedSpecialChar=JEt;od.isUrlSuffixNotAllowedAsFinalChar=ZEt;od.isOpenBraceChar=QEt;od.isCloseBraceChar=eCt;function GEt(e){return e>=0&&e<=31||e==127}function WEt(e){return e>=65&&e<=90||e>=97&&e<=122}function qEt(e){return e>=48&&e<=57}function YEt(e){return e==34||e==39}function XEt(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 KEt(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 $Et(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 JEt(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 ZEt(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function QEt(e){return e<91?e==40:e==91||e==123}function eCt(e){return e<93?e==41:e==93||e==125}});var oRe=Yi(B9=>{"use strict";Object.defineProperty(B9,"__esModule",{value:!0});B9.tldRegex=void 0;B9.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 k9=Yi(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.isDomainLabelStartChar=Qr.isSchemeStartChar=Qr.tldUrlHostRe=Qr.schemeUrlRe=Qr.invalidSchemeRe=Qr.httpSchemePrefixRe=Qr.httpSchemeRe=void 0;Qr.isSchemeChar=nCt;Qr.isDomainLabelChar=iCt;Qr.isPathChar=rCt;Qr.isUrlSuffixStartChar=oCt;Qr.isKnownTld=sRe;Qr.isValidSchemeUrl=sCt;Qr.isValidTldMatch=aCt;Qr.isValidIpV4Address=uCt;var HE=jE(),tCt=oRe();Qr.httpSchemeRe=/https?:\/\//i;Qr.httpSchemePrefixRe=new RegExp("^"+Qr.httpSchemeRe.source,"i");Qr.invalidSchemeRe=/^(javascript|vbscript):/i;Qr.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Qr.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;Qr.isSchemeStartChar=HE.isAsciiLetterChar;function nCt(e){return(0,HE.isAsciiLetterChar)(e)||(0,HE.isDigitChar)(e)||e===43||e===45||e===46}Qr.isDomainLabelStartChar=HE.isAlphaNumericOrMarkChar;function iCt(e){return e===95||(0,Qr.isDomainLabelStartChar)(e)}function rCt(e){return(0,HE.isAlphaNumericOrMarkChar)(e)||(0,HE.isUrlSuffixAllowedSpecialChar)(e)||(0,HE.isUrlSuffixNotAllowedAsFinalChar)(e)}function oCt(e){return e===47||e===63||e===35}function sRe(e){return tCt.tldRegex.test(e.toLowerCase())}function sCt(e){if(Qr.invalidSchemeRe.test(e))return!1;var t=e.match(Qr.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function aCt(e){var t=e.match(Qr.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!!sRe(r)}var cCt=/^(?:(?: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]?)$/,lCt=/[:/?#]/;function uCt(e){var t=e.split(lCt,1)[0];return cCt.test(t)}});var qie=Yi(U9=>{"use strict";Object.defineProperty(U9,"__esModule",{value:!0});U9.UrlMatch=void 0;var fCt=($m(),Fh(Km)),dCt=VE(),hCt=k9(),mCt=/^(https?:\/\/)?(?:www\.)?/i,pCt=/^\/\//,gCt=(function(e){fCt.__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=ACt(n)),this.stripPrefix.scheme&&(n=_Ct(n)),this.stripPrefix.www&&(n=yCt(n)),this.stripTrailingSlash&&(n=bCt(n)),this.decodePercentEncoding&&(n=xCt(n)),n},t})(dCt.AbstractMatch);U9.UrlMatch=gCt;function _Ct(e){return e.replace(hCt.httpSchemePrefixRe,"")}function yCt(e){return e.includes("www.")?e.replace(mCt,"$1"):e}function ACt(e){return e.replace(pCt,"")}function bCt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function xCt(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 cRe=Yi($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});$_.isEmailLocalPartStartChar=$_.mailtoSchemePrefixRe=void 0;$_.isEmailLocalPartChar=ECt;$_.isValidEmail=CCt;var aRe=jE(),TCt=k9();$_.mailtoSchemePrefixRe=/^mailto:/i;$_.isEmailLocalPartStartChar=aRe.isAlphaNumericOrMarkChar;function ECt(e){return(0,$_.isEmailLocalPartStartChar)(e)||(0,aRe.isValidEmailLocalPartSpecialChar)(e)}function CCt(e){var t=e.split(".").pop();return(0,TCt.isKnownTld)(t)}});var Yie=Yi(z9=>{"use strict";Object.defineProperty(z9,"__esModule",{value:!0});z9.EmailMatch=void 0;var vCt=($m(),Fh(Km)),SCt=VE(),wCt=(function(e){vCt.__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})(SCt.AbstractMatch);z9.EmailMatch=wCt});var Xie=Yi(KI=>{"use strict";Object.defineProperty(KI,"__esModule",{value:!0});KI.hashtagServices=void 0;KI.isHashtagTextChar=PCt;KI.isValidHashtag=DCt;var ICt=jE();function PCt(e){return e===95||(0,ICt.isAlphaNumericOrMarkChar)(e)}function DCt(e){return e.length<=140}KI.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var Kie=Yi(V9=>{"use strict";Object.defineProperty(V9,"__esModule",{value:!0});V9.HashtagMatch=void 0;var RCt=($m(),Fh(Km)),OCt=gb(),MCt=VE(),NCt=(function(e){RCt.__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,OCt.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})(MCt.AbstractMatch);V9.HashtagMatch=NCt});var $ie=Yi($I=>{"use strict";Object.defineProperty($I,"__esModule",{value:!0});$I.mentionServices=void 0;$I.isMentionTextChar=FCt;$I.isValidMention=BCt;var lRe=jE(),LCt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function FCt(e){return e===45||e===46||e===95||(0,lRe.isAsciiLetterChar)(e)||(0,lRe.isDigitChar)(e)}function BCt(e,t){var n=LCt[t];return n.test(e)}$I.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var Jie=Yi(j9=>{"use strict";Object.defineProperty(j9,"__esModule",{value:!0});j9.MentionMatch=void 0;var kCt=($m(),Fh(Km)),UCt=gb(),zCt=VE(),VCt=(function(e){kCt.__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,UCt.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})(zCt.AbstractMatch);j9.MentionMatch=VCt});var uRe=Yi(eU=>{"use strict";Object.defineProperty(eU,"__esModule",{value:!0});eU.isPhoneNumberSeparatorChar=qCt;eU.isPhoneNumberControlChar=YCt;eU.isValidPhoneNumber=XCt;var jCt=/[-. ()]/,HCt=/(?:(?:(?:(\+)?\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]+#?)*/,GCt=/(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})/,WCt=new RegExp("^".concat(HCt.source,"|").concat(GCt.source,"$"));function qCt(e){return e===45||e===46||e===32}function YCt(e){return e===44||e===59}function XCt(e){var t=e.charAt(0)==="+"||jCt.test(e);return t&&WCt.test(e)}});var Zie=Yi(H9=>{"use strict";Object.defineProperty(H9,"__esModule",{value:!0});H9.PhoneMatch=void 0;var KCt=($m(),Fh(Km)),$Ct=VE(),JCt=(function(e){KCt.__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})($Ct.AbstractMatch);H9.PhoneMatch=JCt});var ire=Yi(Y9=>{"use strict";Object.defineProperty(Y9,"__esModule",{value:!0});Y9.parseMatches=rvt;Y9.excludeUnbalancedTrailingBracesAndPunctuation=hRe;var ZCt=qie(),G9=gb(),zo=k9(),JI=cRe(),QCt=Yie(),tre=Xie(),evt=Kie(),nre=$ie(),tvt=Jie(),ZI=uRe(),nvt=Zie(),aa=jE(),ivt=(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),dRe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),dRe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function rvt(e,t){for(var n=new ivt(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)W9(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:uvt(n,s,r);break;case 12:fvt(n,s,r);break;case 0:ovt(n,s,r);break;case 1:svt(n,s,r);break;case 2:avt(n,s,r);break;case 3:cvt(n,s,r);break;case 4:lvt(n,s,i,r);break;case 5:dvt(n,s,r);break;case 6:hvt(n,s,i,r);break;case 7:mvt(n,s,i,r);break;case 13:pvt(n,s,r);break;case 14:gvt(n,s,r);break;case 8:_vt(n,s,r);break;case 9:yvt(n,s,r);break;case 10:Avt(n,s,r);break;case 15:bvt(n,s,i,r);break;case 16:xvt(n,s,i,r);break;case 17:Tvt(n,s,i,r);break;case 18:Evt(n,s,i,r);break;case 19:Cvt(n,s,i,r);break;case 20:vvt(n,s,r);break;case 21:Svt(n,s,r);break;case 22:GE(n,s,r);break;case 23:wvt(n,s,r);break;case 24:Ivt(n,s,r);break;case 25:Pvt(n,s,r);break;case 26:Dvt(n,s,r);break;case 27:Rvt(n,s,r);break;case 28:Ovt(n,s,r);break;case 29:Mvt(n,s,r);break;case 30:Nvt(n,s,r);break;case 31:Lvt(n,s,r);break;case 32:Bvt(n,s,i,r);break;case 33:kvt(n,s,r);break;case 34:Uvt(n,s,r);break;case 35:zvt(n,s,r);break;case 36:Vvt(n,s,i,r);break;case 37:Fvt(n,s,i,r);break;case 38:jvt(n,s,i,r);break;case 39:Hvt(n,s,i,r);break;case 40:Gvt(n,s,r);break;case 41:Wvt(n,s,r);break;default:(0,G9.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(q9(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Ns(n,u)});return n.matches}function W9(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(Kvt(i,28));else if(n===64)e.addMachine($vt(i,30));else if(n===47)e.addMachine(ere(i,11));else if(n===43)e.addMachine(Qie(i,37));else if(n===40)e.addMachine(Qie(i,32));else{if((0,aa.isDigitChar)(n)&&(e.addMachine(Qie(i,38)),e.addMachine(Yvt(i,13))),(0,JI.isEmailLocalPartStartChar)(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(Xvt(i,r))}(0,zo.isSchemeStartChar)(n)&&e.addMachine(q9(i,0)),(0,aa.isAlphaNumericOrMarkChar)(n)&&e.addMachine(ere(i,5))}}function ovt(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,zo.isSchemeChar)(n)||e.removeMachine(t)}function svt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(ere(i,11))):(0,zo.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function avt(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(q9(i,0))):e.removeMachine(t)}function cvt(e,t,n){n===47?t.state=4:(0,zo.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):Ns(e,t)}function lvt(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 uvt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function fvt(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function dvt(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)||Ns(e,t)}function hvt(e,t,n,i){i===45||(i===46?Ns(e,t):(0,zo.isDomainLabelStartChar)(i)?t.state=5:Ns(e,t))}function mvt(e,t,n,i){i===46?Ns(e,t):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):Ns(e,t)}function pvt(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,aa.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,aa.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Ns(e,t))}function gvt(e,t,n){(0,aa.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Ns(e,t)}function _vt(e,t,n){(0,aa.isDigitChar)(n)?t.state=9:Ns(e,t)}function yvt(e,t,n){(0,aa.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:Ns(e,t))}function Avt(e,t,n){(0,zo.isPathChar)(n)||Ns(e,t)}function bvt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:GE(e,t,i)}function xvt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:GE(e,t,i)}function Tvt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:GE(e,t,i)}function Evt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:GE(e,t,i)}function Cvt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:GE(e,t,i)}function vvt(e,t,n){n===58?t.state=21:GE(e,t,n)}function Svt(e,t,n){(0,JI.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function GE(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,JI.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function wvt(e,t,n){n===46||n===64?e.removeMachine(t):(0,JI.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function Ivt(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function Pvt(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,zo.isDomainLabelChar)(n)||Ns(e,t)}function Dvt(e,t,n){n===45||n===46?Ns(e,t):(0,zo.isDomainLabelChar)(n)?t.state=25:Ns(e,t)}function Rvt(e,t,n){n===46||n===45?Ns(e,t):(0,zo.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):Ns(e,t)}function Ovt(e,t,n){(0,tre.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function Mvt(e,t,n){(0,tre.isHashtagTextChar)(n)||Ns(e,t)}function Nvt(e,t,n){(0,nre.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function Lvt(e,t,n){(0,nre.isMentionTextChar)(n)||((0,aa.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Ns(e,t))}function Fvt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=38:(e.removeMachine(t),W9(e,n,i))}function Bvt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=33:e.removeMachine(t),W9(e,n,i)}function kvt(e,t,n){(0,aa.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function Uvt(e,t,n){(0,aa.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function zvt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function Vvt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=38:(0,ZI.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function jvt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,(0,ZI.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,aa.isDigitChar)(i)||(i===40?t.state=32:(0,ZI.isPhoneNumberSeparatorChar)(i)?t.state=39:(Ns(e,t),(0,zo.isSchemeStartChar)(i)&&e.addMachine(q9(r,0))))}function Hvt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=38:i===40?t.state=32:(Ns(e,t),W9(e,n,i))}function Gvt(e,t,n){(0,ZI.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,aa.isDigitChar)(n)?t.state=38:Ns(e,t))}function Wvt(e,t,n){(0,ZI.isPhoneNumberControlChar)(n)?t.state=40:(0,aa.isDigitChar)(n)?e.removeMachine(t):Ns(e,t)}function Ns(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=hRe(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,G9.assertNever)(t)}n.push(new ZCt.UrlMatch({tagBuilder:o,matchedText:p,offset:d,urlMatchType:qvt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,JI.isValidEmail)(p)&&n.push(new QCt.EmailMatch({tagBuilder:o,matchedText:p,offset:d,email:p.replace(JI.mailtoSchemePrefixRe,"")}));break}case 2:{(0,tre.isValidHashtag)(p)&&n.push(new evt.HashtagMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,nre.isValidMention)(p,f)&&n.push(new tvt.MentionMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,ZI.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new nvt.PhoneMatch({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,G9.assertNever)(t)}}}function qvt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,G9.assertNever)(e)}}var fRe={")":"(","}":"{","]":"["};function hRe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);(0,aa.isOpenBraceChar)(r)?t[i]++:(0,aa.isCloseBraceChar)(r)&&t[fRe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if((0,aa.isCloseBraceChar)(r)){var s=fRe[i];if(t[s]<0)t[s]++,o--;else break}else if((0,aa.isUrlSuffixNotAllowedAsFinalChar)(r))o--;else break}return e.slice(0,o+1)}function q9(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function ere(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function Yvt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function Xvt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function Kvt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function $vt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Qie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function dRe(e){return e.type===0&&e.matchType===0}});var mRe=Yi(sre=>{"use strict";Object.defineProperty(sre,"__esModule",{value:!0});sre.parseHtml=Qvt;var El=($m(),Fh(Km)),_u=jE(),Jvt=gb(),w0=(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})(),ore=new w0,Zvt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=ore,this.html=t,this.callbacks=n}return e})();function Qvt(e,t){for(var n=new Zvt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:eSt(n,r);break;case 1:tSt(n,r,o);break;case 2:iSt(n,r,o);break;case 3:nSt(n,r,o);break;case 4:rSt(n,r,o);break;case 5:oSt(n,r,o);break;case 6:sSt(n,r,o);break;case 7:aSt(n,r,o);break;case 8:cSt(n,r);break;case 9:lSt(n,r);break;case 10:uSt(n,r,o);break;case 11:fSt(n,r,o);break;case 12:dSt(n,r);break;case 13:hSt(n);break;case 14:mSt(n,r);break;case 15:pSt(n,r);break;case 16:gSt(n,r);break;case 17:_St(n,r);break;case 18:ySt(n,r);break;case 19:ASt(n,r);break;case 20:bSt(n,r);break;default:(0,Jvt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&xSt(n)}function eSt(e,t){t==="<"&&I0(e)}function tSt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?I0(e):(0,_u.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=ore)}function nSt(e,t,n){(0,_u.isWhitespaceChar)(n)?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{name:rre(e)})),e.state=4):t==="<"?I0(e):t==="/"?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{name:rre(e)})),e.state=12):t===">"?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{name:rre(e)})),P0(e)):!(0,_u.isAsciiLetterChar)(n)&&!(0,_u.isDigitChar)(n)&&t!==":"&&Ah(e)}function iSt(e,t,n){t===">"?Ah(e):(0,_u.isAsciiLetterChar)(n)?e.state=3:Ah(e)}function rSt(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?P0(e):t==="<"?I0(e):t==="="||(0,_u.isQuoteChar)(n)||(0,_u.isControlChar)(n)?Ah(e):e.state=5)}function oSt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?P0(e):t==="<"?I0(e):(0,_u.isQuoteChar)(n)&&Ah(e)}function sSt(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?P0(e):t==="<"?I0(e):(0,_u.isQuoteChar)(n)?Ah(e):e.state=5)}function aSt(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Ah(e):t==="<"?I0(e):e.state=10)}function cSt(e,t){t==='"'&&(e.state=11)}function lSt(e,t){t==="'"&&(e.state=11)}function uSt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=4:t===">"?P0(e):t==="<"&&I0(e)}function fSt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?P0(e):t==="<"?I0(e):(e.state=4,TSt(e))}function dSt(e,t){t===">"?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{isClosing:!0})),P0(e)):Ah(e)}function hSt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{type:"doctype"})),e.state=20):Ah(e)}function mSt(e,t){t==="-"?e.state=15:t===">"?Ah(e):e.state=16}function pSt(e,t){t==="-"?e.state=18:t===">"?Ah(e):e.state=16}function gSt(e,t){t==="-"&&(e.state=17)}function _St(e,t){t==="-"?e.state=18:e.state=16}function ySt(e,t){t===">"?P0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function ASt(e,t){t==="-"?e.state=17:t===">"?P0(e):e.state=16}function bSt(e,t){t===">"?P0(e):t==="<"&&I0(e)}function Ah(e){e.state=0,e.currentTag=ore}function I0(e){e.state=1,e.currentTag=new w0({idx:e.charIdx})}function P0(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)),Ah(e),e.currentDataIdx=e.charIdx+1}function xSt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function rre(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function TSt(e){e.charIdx--}});var X9=Yi(cre=>{"use strict";Object.defineProperty(cre,"__esModule",{value:!0});var are=($m(),Fh(Km)),ESt=eRe(),Ka=gb(),CSt=Wie(),vSt=N9(),SSt=ire(),wSt=mRe(),ISt=$ie(),PSt=Xie(),DSt=(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=RSt(t.urls),this.email=(0,Ka.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Ka.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Ka.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=OSt(t.stripPrefix),this.stripTrailingSlash=(0,Ka.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Ka.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&ISt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&PSt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=MSt(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,wSt.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,are.__spreadArray([],are.__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(NSt);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,Ka.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Ka.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,SSt.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 vSt.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 CSt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=ESt.version,e})();cre.default=DSt;function RSt(e){return e==null&&(e=!0),(0,Ka.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Ka.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Ka.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Ka.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function OSt(e){return e==null&&(e=!0),(0,Ka.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Ka.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Ka.isBoolean)(e.www)?e.www:!0}}function MSt(e){return typeof e=="number"?{length:e,location:"end"}:are.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function NSt(e,t){return e.getOffset()-t.getOffset()}});var gRe=Yi(pRe=>{"use strict";Object.defineProperty(pRe,"__esModule",{value:!0})});var _Re=Yi(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});var WE=($m(),Fh(Km));WE.__exportStar(gRe(),J_);WE.__exportStar(Yie(),J_);WE.__exportStar(Kie(),J_);WE.__exportStar(VE(),J_);WE.__exportStar(Jie(),J_);WE.__exportStar(Zie(),J_);WE.__exportStar(qie(),J_)});var yRe=Yi(lre=>{"use strict";Object.defineProperty(lre,"__esModule",{value:!0});var LSt=($m(),Fh(Km));LSt.__exportStar(ire(),lre)});var ure=Yi((Jm,bRe)=>{"use strict";Jm=bRe.exports=X9().default;Object.defineProperty(Jm,"__esModule",{value:!0});Jm.Autolinker=void 0;var QI=($m(),Fh(Km)),ARe=QI.__importDefault(X9());Jm.Autolinker=ARe.default;Jm.default=ARe.default;QI.__exportStar(X9(),Jm);QI.__exportStar(Wie(),Jm);QI.__exportStar(N9(),Jm);QI.__exportStar(_Re(),Jm);QI.__exportStar(yRe(),Jm)});var Toe=Yi((aHi,zU)=>{/*! * 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(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 f3=="object"&&f3&&f3.exports&&(f3.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 VSe=Yi((Gvi,s5)=>{/* 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 s5<"u"&&s5.exports?s5.exports=i:this.Lerc=i})()});var Nm={};Oq(Nm,{__addDisposableResource:()=>xwe,__assign:()=>c5,__asyncDelegator:()=>hwe,__asyncGenerator:()=>dwe,__asyncValues:()=>mwe,__await:()=>Nw,__awaiter:()=>swe,__classPrivateFieldGet:()=>ywe,__classPrivateFieldIn:()=>bwe,__classPrivateFieldSet:()=>Awe,__createBinding:()=>u5,__decorate:()=>QSe,__disposeResources:()=>Twe,__esDecorate:()=>twe,__exportStar:()=>cwe,__extends:()=>JSe,__generator:()=>awe,__importDefault:()=>_we,__importStar:()=>gwe,__makeTemplateObject:()=>pwe,__metadata:()=>owe,__param:()=>ewe,__propKey:()=>iwe,__read:()=>ine,__rest:()=>ZSe,__rewriteRelativeImportExtension:()=>Ewe,__runInitializers:()=>nwe,__setFunctionName:()=>rwe,__spread:()=>lwe,__spreadArray:()=>fwe,__spreadArrays:()=>uwe,__values:()=>l5,default:()=>PTt});function JSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");tne(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function ZSe(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 QSe(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 ewe(e,t){return function(n,i){t(n,i,e)}}function twe(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 nwe(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 iwe(e){return typeof e=="symbol"?e:"".concat(e)}function rwe(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 owe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function swe(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 awe(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 cwe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&u5(t,e,n)}function l5(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 ine(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 lwe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ine(arguments[t]));return e}function uwe(){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 fwe(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 Nw(e){return this instanceof Nw?(this.v=e,this):new Nw(e)}function dwe(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 Nw?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 hwe(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:Nw(e[r](s)),done:!1}:o?o(s):s}:o}}function mwe(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 l5=="function"?l5(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 pwe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function gwe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=nne(e),i=0;i<n.length;i++)n[i]!=="default"&&u5(t,e,n[i]);return wTt(t,e),t}function _we(e){return e&&e.__esModule?e:{default:e}}function ywe(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 Awe(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 bwe(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 xwe(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 Twe(e){function t(o){e.error=e.hasError?new ITt(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 Ewe(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 tne,c5,u5,wTt,nne,ITt,PTt,Lm=hs(()=>{tne=function(e,t){return tne=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])},tne(e,t)};c5=function(){return c5=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},c5.apply(this,arguments)};u5=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]});wTt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},nne=function(e){return nne=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},nne(e)};ITt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};PTt={__extends:JSe,__assign:c5,__rest:ZSe,__decorate:QSe,__param:ewe,__esDecorate:twe,__runInitializers:nwe,__propKey:iwe,__setFunctionName:rwe,__metadata:owe,__awaiter:swe,__generator:awe,__createBinding:u5,__exportStar:cwe,__values:l5,__read:ine,__spread:lwe,__spreadArrays:uwe,__spreadArray:fwe,__await:Nw,__asyncGenerator:dwe,__asyncDelegator:hwe,__asyncValues:mwe,__makeTemplateObject:pwe,__importStar:gwe,__importDefault:_we,__classPrivateFieldGet:ywe,__classPrivateFieldSet:Awe,__classPrivateFieldIn:bwe,__addDisposableResource:xwe,__disposeResources:Twe,__rewriteRelativeImportExtension:Ewe}});var Cwe=Yi(f5=>{"use strict";Object.defineProperty(f5,"__esModule",{value:!0});f5.version=void 0;f5.version="4.1.5"});var YA=Yi(qA=>{"use strict";Object.defineProperty(qA,"__esModule",{value:!0});qA.hasOwnProperty=void 0;qA.isBoolean=DTt;qA.ellipsis=RTt;qA.removeWithPredicate=OTt;qA.assertNever=MTt;qA.hasOwnProperty=Object.prototype.hasOwnProperty;function DTt(e){return typeof e=="boolean"}function RTt(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 OTt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function MTt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var d5=Yi(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});T0.HtmlTag=T0.whitespaceRe=void 0;var NTt=YA();T0.whitespaceRe=/\s+/;var LTt=(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(T0.whitespaceRe):[],r=t.split(T0.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(T0.whitespaceRe):[],r=t.split(T0.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)NTt.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();T0.HtmlTag=LTt});var Swe=Yi(one=>{"use strict";Object.defineProperty(one,"__esModule",{value:!0});one.truncateSmart=FTt;function FTt(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=BTt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=vwe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=vwe(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):rne(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+rne(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+rne(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 BTt(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 vwe(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 rne(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 wwe=Yi(sne=>{"use strict";Object.defineProperty(sne,"__esModule",{value:!0});sne.truncateMiddle=kTt;function kTt(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 Iwe=Yi(ane=>{"use strict";Object.defineProperty(ane,"__esModule",{value:!0});ane.truncateEnd=zTt;var UTt=YA();function zTt(e,t,n){return(0,UTt.ellipsis)(e,t,n)}});var cne=Yi(h5=>{"use strict";Object.defineProperty(h5,"__esModule",{value:!0});h5.AnchorTagBuilder=void 0;var VTt=d5(),jTt=Swe(),HTt=wwe(),GTt=Iwe(),WTt=(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 VTt.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,jTt.truncateSmart)(t,i):r==="middle"?(0,HTt.truncateMiddle)(t,i):(0,GTt.truncateEnd)(t,i)},e})();h5.AnchorTagBuilder=WTt});var lE=Yi(m5=>{"use strict";Object.defineProperty(m5,"__esModule",{value:!0});m5.AbstractMatch=void 0;var qTt=(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})();m5.AbstractMatch=qTt});var uE=Yi(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.isControlChar=YTt;Qf.isAsciiLetterChar=XTt;Qf.isDigitChar=KTt;Qf.isQuoteChar=$Tt;Qf.isWhitespaceChar=JTt;Qf.isAlphaNumericOrMarkChar=ZTt;Qf.isValidEmailLocalPartSpecialChar=QTt;Qf.isUrlSuffixAllowedSpecialChar=eEt;Qf.isUrlSuffixNotAllowedAsFinalChar=tEt;Qf.isOpenBraceChar=nEt;Qf.isCloseBraceChar=iEt;function YTt(e){return e>=0&&e<=31||e==127}function XTt(e){return e>=65&&e<=90||e>=97&&e<=122}function KTt(e){return e>=48&&e<=57}function $Tt(e){return e==34||e==39}function JTt(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 ZTt(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 QTt(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 eEt(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 tEt(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function nEt(e){return e<91?e==40:e==91||e==123}function iEt(e){return e<93?e==41:e==93||e==125}});var Pwe=Yi(p5=>{"use strict";Object.defineProperty(p5,"__esModule",{value:!0});p5.tldRegex=void 0;p5.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 g5=Yi(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.isDomainLabelStartChar=Qr.isSchemeStartChar=Qr.tldUrlHostRe=Qr.schemeUrlRe=Qr.invalidSchemeRe=Qr.httpSchemePrefixRe=Qr.httpSchemeRe=void 0;Qr.isSchemeChar=oEt;Qr.isDomainLabelChar=sEt;Qr.isPathChar=aEt;Qr.isUrlSuffixStartChar=cEt;Qr.isKnownTld=Dwe;Qr.isValidSchemeUrl=lEt;Qr.isValidTldMatch=uEt;Qr.isValidIpV4Address=hEt;var fE=uE(),rEt=Pwe();Qr.httpSchemeRe=/https?:\/\//i;Qr.httpSchemePrefixRe=new RegExp("^"+Qr.httpSchemeRe.source,"i");Qr.invalidSchemeRe=/^(javascript|vbscript):/i;Qr.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Qr.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;Qr.isSchemeStartChar=fE.isAsciiLetterChar;function oEt(e){return(0,fE.isAsciiLetterChar)(e)||(0,fE.isDigitChar)(e)||e===43||e===45||e===46}Qr.isDomainLabelStartChar=fE.isAlphaNumericOrMarkChar;function sEt(e){return e===95||(0,Qr.isDomainLabelStartChar)(e)}function aEt(e){return(0,fE.isAlphaNumericOrMarkChar)(e)||(0,fE.isUrlSuffixAllowedSpecialChar)(e)||(0,fE.isUrlSuffixNotAllowedAsFinalChar)(e)}function cEt(e){return e===47||e===63||e===35}function Dwe(e){return rEt.tldRegex.test(e.toLowerCase())}function lEt(e){if(Qr.invalidSchemeRe.test(e))return!1;var t=e.match(Qr.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function uEt(e){var t=e.match(Qr.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!!Dwe(r)}var fEt=/^(?:(?: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]?)$/,dEt=/[:/?#]/;function hEt(e){var t=e.split(dEt,1)[0];return fEt.test(t)}});var lne=Yi(_5=>{"use strict";Object.defineProperty(_5,"__esModule",{value:!0});_5.UrlMatch=void 0;var mEt=(Lm(),Fh(Nm)),pEt=lE(),gEt=g5(),_Et=/^(https?:\/\/)?(?:www\.)?/i,yEt=/^\/\//,AEt=(function(e){mEt.__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=TEt(n)),this.stripPrefix.scheme&&(n=bEt(n)),this.stripPrefix.www&&(n=xEt(n)),this.stripTrailingSlash&&(n=EEt(n)),this.decodePercentEncoding&&(n=CEt(n)),n},t})(pEt.AbstractMatch);_5.UrlMatch=AEt;function bEt(e){return e.replace(gEt.httpSchemePrefixRe,"")}function xEt(e){return e.includes("www.")?e.replace(_Et,"$1"):e}function TEt(e){return e.replace(yEt,"")}function EEt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function CEt(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 Owe=Yi(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.isEmailLocalPartStartChar=I_.mailtoSchemePrefixRe=void 0;I_.isEmailLocalPartChar=SEt;I_.isValidEmail=wEt;var Rwe=uE(),vEt=g5();I_.mailtoSchemePrefixRe=/^mailto:/i;I_.isEmailLocalPartStartChar=Rwe.isAlphaNumericOrMarkChar;function SEt(e){return(0,I_.isEmailLocalPartStartChar)(e)||(0,Rwe.isValidEmailLocalPartSpecialChar)(e)}function wEt(e){var t=e.split(".").pop();return(0,vEt.isKnownTld)(t)}});var une=Yi(y5=>{"use strict";Object.defineProperty(y5,"__esModule",{value:!0});y5.EmailMatch=void 0;var IEt=(Lm(),Fh(Nm)),PEt=lE(),DEt=(function(e){IEt.__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})(PEt.AbstractMatch);y5.EmailMatch=DEt});var fne=Yi(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});Lw.hashtagServices=void 0;Lw.isHashtagTextChar=OEt;Lw.isValidHashtag=MEt;var REt=uE();function OEt(e){return e===95||(0,REt.isAlphaNumericOrMarkChar)(e)}function MEt(e){return e.length<=140}Lw.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var dne=Yi(A5=>{"use strict";Object.defineProperty(A5,"__esModule",{value:!0});A5.HashtagMatch=void 0;var NEt=(Lm(),Fh(Nm)),LEt=YA(),FEt=lE(),BEt=(function(e){NEt.__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,LEt.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})(FEt.AbstractMatch);A5.HashtagMatch=BEt});var hne=Yi(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});Fw.mentionServices=void 0;Fw.isMentionTextChar=UEt;Fw.isValidMention=zEt;var Mwe=uE(),kEt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function UEt(e){return e===45||e===46||e===95||(0,Mwe.isAsciiLetterChar)(e)||(0,Mwe.isDigitChar)(e)}function zEt(e,t){var n=kEt[t];return n.test(e)}Fw.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var mne=Yi(b5=>{"use strict";Object.defineProperty(b5,"__esModule",{value:!0});b5.MentionMatch=void 0;var VEt=(Lm(),Fh(Nm)),jEt=YA(),HEt=lE(),GEt=(function(e){VEt.__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,jEt.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})(HEt.AbstractMatch);b5.MentionMatch=GEt});var Nwe=Yi(R3=>{"use strict";Object.defineProperty(R3,"__esModule",{value:!0});R3.isPhoneNumberSeparatorChar=KEt;R3.isPhoneNumberControlChar=$Et;R3.isValidPhoneNumber=JEt;var WEt=/[-. ()]/,qEt=/(?:(?:(?:(\+)?\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]+#?)*/,YEt=/(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})/,XEt=new RegExp("^".concat(qEt.source,"|").concat(YEt.source,"$"));function KEt(e){return e===45||e===46||e===32}function $Et(e){return e===44||e===59}function JEt(e){var t=e.charAt(0)==="+"||WEt.test(e);return t&&XEt.test(e)}});var pne=Yi(x5=>{"use strict";Object.defineProperty(x5,"__esModule",{value:!0});x5.PhoneMatch=void 0;var ZEt=(Lm(),Fh(Nm)),QEt=lE(),eCt=(function(e){ZEt.__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})(QEt.AbstractMatch);x5.PhoneMatch=eCt});var bne=Yi(v5=>{"use strict";Object.defineProperty(v5,"__esModule",{value:!0});v5.parseMatches=aCt;v5.excludeUnbalancedTrailingBracesAndPunctuation=Bwe;var tCt=lne(),T5=YA(),Bo=g5(),Bw=Owe(),nCt=une(),yne=fne(),iCt=dne(),Ane=hne(),rCt=mne(),kw=Nwe(),oCt=pne(),ua=uE(),sCt=(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),Fwe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),Fwe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function aCt(e,t){for(var n=new sCt(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)E5(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:hCt(n,s,r);break;case 12:mCt(n,s,r);break;case 0:cCt(n,s,r);break;case 1:lCt(n,s,r);break;case 2:uCt(n,s,r);break;case 3:fCt(n,s,r);break;case 4:dCt(n,s,i,r);break;case 5:pCt(n,s,r);break;case 6:gCt(n,s,i,r);break;case 7:_Ct(n,s,i,r);break;case 13:yCt(n,s,r);break;case 14:ACt(n,s,r);break;case 8:bCt(n,s,r);break;case 9:xCt(n,s,r);break;case 10:TCt(n,s,r);break;case 15:ECt(n,s,i,r);break;case 16:CCt(n,s,i,r);break;case 17:vCt(n,s,i,r);break;case 18:SCt(n,s,i,r);break;case 19:wCt(n,s,i,r);break;case 20:ICt(n,s,r);break;case 21:PCt(n,s,r);break;case 22:dE(n,s,r);break;case 23:DCt(n,s,r);break;case 24:RCt(n,s,r);break;case 25:OCt(n,s,r);break;case 26:MCt(n,s,r);break;case 27:NCt(n,s,r);break;case 28:LCt(n,s,r);break;case 29:FCt(n,s,r);break;case 30:BCt(n,s,r);break;case 31:kCt(n,s,r);break;case 32:zCt(n,s,i,r);break;case 33:VCt(n,s,r);break;case 34:jCt(n,s,r);break;case 35:HCt(n,s,r);break;case 36:GCt(n,s,i,r);break;case 37:UCt(n,s,i,r);break;case 38:WCt(n,s,i,r);break;case 39:qCt(n,s,i,r);break;case 40:YCt(n,s,r);break;case 41:XCt(n,s,r);break;default:(0,T5.assertNever)(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,Bo.isSchemeStartChar)(r)){var a=n.text.charCodeAt(n.charIdx-1);(0,Bo.isSchemeStartChar)(a)||n.addMachine(C5(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Os(n,u)});return n.matches}function E5(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(ZCt(i,28));else if(n===64)e.addMachine(QCt(i,30));else if(n===47)e.addMachine(_ne(i,11));else if(n===43)e.addMachine(gne(i,37));else if(n===40)e.addMachine(gne(i,32));else{if((0,ua.isDigitChar)(n)&&(e.addMachine(gne(i,38)),e.addMachine($Ct(i,13))),(0,Bw.isEmailLocalPartStartChar)(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(JCt(i,r))}(0,Bo.isSchemeStartChar)(n)&&e.addMachine(C5(i,0)),(0,ua.isAlphaNumericOrMarkChar)(n)&&e.addMachine(_ne(i,5))}}function cCt(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,Bo.isSchemeChar)(n)||e.removeMachine(t)}function lCt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(_ne(i,11))):(0,Bo.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function uCt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,Bo.isDomainLabelStartChar)(n)?(t.state=5,(0,Bo.isSchemeStartChar)(n)&&e.addMachine(C5(i,0))):e.removeMachine(t)}function fCt(e,t,n){n===47?t.state=4:(0,Bo.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):Os(e,t)}function dCt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,Bo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function hCt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function mCt(e,t,n){(0,Bo.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function pCt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,Bo.isUrlSuffixStartChar)(n)?t.state=10:(0,Bo.isDomainLabelChar)(n)||Os(e,t)}function gCt(e,t,n,i){i===45||(i===46?Os(e,t):(0,Bo.isDomainLabelStartChar)(i)?t.state=5:Os(e,t))}function _Ct(e,t,n,i){i===46?Os(e,t):(0,Bo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):Os(e,t)}function yCt(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,ua.isDigitChar)(n)||((0,Bo.isUrlSuffixStartChar)(n)?t.state=10:(0,ua.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Os(e,t))}function ACt(e,t,n){(0,ua.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Os(e,t)}function bCt(e,t,n){(0,ua.isDigitChar)(n)?t.state=9:Os(e,t)}function xCt(e,t,n){(0,ua.isDigitChar)(n)||((0,Bo.isUrlSuffixStartChar)(n)?t.state=10:Os(e,t))}function TCt(e,t,n){(0,Bo.isPathChar)(n)||Os(e,t)}function ECt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:dE(e,t,i)}function CCt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:dE(e,t,i)}function vCt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:dE(e,t,i)}function SCt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:dE(e,t,i)}function wCt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:dE(e,t,i)}function ICt(e,t,n){n===58?t.state=21:dE(e,t,n)}function PCt(e,t,n){(0,Bw.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function dE(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,Bw.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function DCt(e,t,n){n===46||n===64?e.removeMachine(t):(0,Bw.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function RCt(e,t,n){(0,Bo.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function OCt(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,Bo.isDomainLabelChar)(n)||Os(e,t)}function MCt(e,t,n){n===45||n===46?Os(e,t):(0,Bo.isDomainLabelChar)(n)?t.state=25:Os(e,t)}function NCt(e,t,n){n===46||n===45?Os(e,t):(0,Bo.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):Os(e,t)}function LCt(e,t,n){(0,yne.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function FCt(e,t,n){(0,yne.isHashtagTextChar)(n)||Os(e,t)}function BCt(e,t,n){(0,Ane.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function kCt(e,t,n){(0,Ane.isMentionTextChar)(n)||((0,ua.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Os(e,t))}function UCt(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=38:(e.removeMachine(t),E5(e,n,i))}function zCt(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=33:e.removeMachine(t),E5(e,n,i)}function VCt(e,t,n){(0,ua.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function jCt(e,t,n){(0,ua.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function HCt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function GCt(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=38:(0,kw.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function WCt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,(0,kw.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,ua.isDigitChar)(i)||(i===40?t.state=32:(0,kw.isPhoneNumberSeparatorChar)(i)?t.state=39:(Os(e,t),(0,Bo.isSchemeStartChar)(i)&&e.addMachine(C5(r,0))))}function qCt(e,t,n,i){(0,ua.isDigitChar)(i)?t.state=38:i===40?t.state=32:(Os(e,t),E5(e,n,i))}function YCt(e,t,n){(0,kw.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,ua.isDigitChar)(n)?t.state=38:Os(e,t))}function XCt(e,t,n){(0,kw.isPhoneNumberControlChar)(n)?t.state=40:(0,ua.isDigitChar)(n)?e.removeMachine(t):Os(e,t)}function Os(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=Bwe(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=Bo.httpSchemeRe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!(0,Bo.isValidSchemeUrl)(p))return;break}case 1:{if(!(0,Bo.isValidTldMatch)(p))return;break}case 2:{if(!(0,Bo.isValidIpV4Address)(p))return;break}default:(0,T5.assertNever)(t)}n.push(new tCt.UrlMatch({tagBuilder:o,matchedText:p,offset:d,urlMatchType:KCt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,Bw.isValidEmail)(p)&&n.push(new nCt.EmailMatch({tagBuilder:o,matchedText:p,offset:d,email:p.replace(Bw.mailtoSchemePrefixRe,"")}));break}case 2:{(0,yne.isValidHashtag)(p)&&n.push(new iCt.HashtagMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,Ane.isValidMention)(p,f)&&n.push(new rCt.MentionMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,kw.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new oCt.PhoneMatch({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,T5.assertNever)(t)}}}function KCt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,T5.assertNever)(e)}}var Lwe={")":"(","}":"{","]":"["};function Bwe(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[Lwe[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=Lwe[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 C5(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function _ne(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function $Ct(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function JCt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function ZCt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function QCt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function gne(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function Fwe(e){return e.type===0&&e.matchType===0}});var kwe=Yi(Ene=>{"use strict";Object.defineProperty(Ene,"__esModule",{value:!0});Ene.parseHtml=nvt;var bl=(Lm(),Fh(Nm)),au=uE(),evt=YA(),E0=(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})(),Tne=new E0,tvt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Tne,this.html=t,this.callbacks=n}return e})();function nvt(e,t){for(var n=new tvt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:ivt(n,r);break;case 1:rvt(n,r,o);break;case 2:svt(n,r,o);break;case 3:ovt(n,r,o);break;case 4:avt(n,r,o);break;case 5:cvt(n,r,o);break;case 6:lvt(n,r,o);break;case 7:uvt(n,r,o);break;case 8:fvt(n,r);break;case 9:dvt(n,r);break;case 10:hvt(n,r,o);break;case 11:mvt(n,r,o);break;case 12:pvt(n,r);break;case 13:gvt(n);break;case 14:_vt(n,r);break;case 15:yvt(n,r);break;case 16:Avt(n,r);break;case 17:bvt(n,r);break;case 18:xvt(n,r);break;case 19:Tvt(n,r);break;case 20:Evt(n,r);break;default:(0,evt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&Cvt(n)}function ivt(e,t){t==="<"&&C0(e)}function rvt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?C0(e):(0,au.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Tne)}function ovt(e,t,n){(0,au.isWhitespaceChar)(n)?(e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{name:xne(e)})),e.state=4):t==="<"?C0(e):t==="/"?(e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{name:xne(e)})),e.state=12):t===">"?(e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{name:xne(e)})),v0(e)):!(0,au.isAsciiLetterChar)(n)&&!(0,au.isDigitChar)(n)&&t!==":"&&dh(e)}function svt(e,t,n){t===">"?dh(e):(0,au.isAsciiLetterChar)(n)?e.state=3:dh(e)}function avt(e,t,n){(0,au.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?v0(e):t==="<"?C0(e):t==="="||(0,au.isQuoteChar)(n)||(0,au.isControlChar)(n)?dh(e):e.state=5)}function cvt(e,t,n){(0,au.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?v0(e):t==="<"?C0(e):(0,au.isQuoteChar)(n)&&dh(e)}function lvt(e,t,n){(0,au.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?v0(e):t==="<"?C0(e):(0,au.isQuoteChar)(n)?dh(e):e.state=5)}function uvt(e,t,n){(0,au.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?dh(e):t==="<"?C0(e):e.state=10)}function fvt(e,t){t==='"'&&(e.state=11)}function dvt(e,t){t==="'"&&(e.state=11)}function hvt(e,t,n){(0,au.isWhitespaceChar)(n)?e.state=4:t===">"?v0(e):t==="<"&&C0(e)}function mvt(e,t,n){(0,au.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?v0(e):t==="<"?C0(e):(e.state=4,vvt(e))}function pvt(e,t){t===">"?(e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{isClosing:!0})),v0(e)):dh(e)}function gvt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new E0(bl.__assign(bl.__assign({},e.currentTag),{type:"doctype"})),e.state=20):dh(e)}function _vt(e,t){t==="-"?e.state=15:t===">"?dh(e):e.state=16}function yvt(e,t){t==="-"?e.state=18:t===">"?dh(e):e.state=16}function Avt(e,t){t==="-"&&(e.state=17)}function bvt(e,t){t==="-"?e.state=18:e.state=16}function xvt(e,t){t===">"?v0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function Tvt(e,t){t==="-"?e.state=17:t===">"?v0(e):e.state=16}function Evt(e,t){t===">"?v0(e):t==="<"&&C0(e)}function dh(e){e.state=0,e.currentTag=Tne}function C0(e){e.state=1,e.currentTag=new E0({idx:e.charIdx})}function v0(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)),dh(e),e.currentDataIdx=e.charIdx+1}function Cvt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function xne(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function vvt(e){e.charIdx--}});var S5=Yi(vne=>{"use strict";Object.defineProperty(vne,"__esModule",{value:!0});var Cne=(Lm(),Fh(Nm)),Svt=Cwe(),Ja=YA(),wvt=cne(),Ivt=d5(),Pvt=bne(),Dvt=kwe(),Rvt=hne(),Ovt=fne(),Mvt=(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=Nvt(t.urls),this.email=(0,Ja.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Ja.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Ja.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Lvt(t.stripPrefix),this.stripTrailingSlash=(0,Ja.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Ja.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Rvt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Ovt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Fvt(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,Dvt.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,Cne.__spreadArray([],Cne.__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(Bvt);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,Ja.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Ja.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Ja.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Ja.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Ja.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Ja.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Ja.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,Pvt.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 Ivt.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 wvt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Svt.version,e})();vne.default=Mvt;function Nvt(e){return e==null&&(e=!0),(0,Ja.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Ja.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Ja.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Ja.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function Lvt(e){return e==null&&(e=!0),(0,Ja.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Ja.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Ja.isBoolean)(e.www)?e.www:!0}}function Fvt(e){return typeof e=="number"?{length:e,location:"end"}:Cne.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function Bvt(e,t){return e.getOffset()-t.getOffset()}});var zwe=Yi(Uwe=>{"use strict";Object.defineProperty(Uwe,"__esModule",{value:!0})});var Vwe=Yi(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var hE=(Lm(),Fh(Nm));hE.__exportStar(zwe(),P_);hE.__exportStar(une(),P_);hE.__exportStar(dne(),P_);hE.__exportStar(lE(),P_);hE.__exportStar(mne(),P_);hE.__exportStar(pne(),P_);hE.__exportStar(lne(),P_)});var jwe=Yi(Sne=>{"use strict";Object.defineProperty(Sne,"__esModule",{value:!0});var kvt=(Lm(),Fh(Nm));kvt.__exportStar(bne(),Sne)});var wne=Yi((Fm,Gwe)=>{"use strict";Fm=Gwe.exports=S5().default;Object.defineProperty(Fm,"__esModule",{value:!0});Fm.Autolinker=void 0;var Uw=(Lm(),Fh(Nm)),Hwe=Uw.__importDefault(S5());Fm.Autolinker=Hwe.default;Fm.default=Hwe.default;Uw.__exportStar(S5(),Fm);Uw.__exportStar(cne(),Fm);Uw.__exportStar(d5(),Fm);Uw.__exportStar(Vwe(),Fm);Uw.__exportStar(jwe(),Fm)});var Ine,zw,Ue,mE,sf,Uo,Wwe,pE,qwe,Ywe,mr,_c=hs(()=>{Ine=new Date(2107,11,31,23,59,58),zw=new Date(1980,0,1),Ue=void 0,mE=1/0,sf="undefined",Uo="function",Wwe="object",pE="string",qwe="number",Ywe="boolean",mr=new Uint8Array});function jw(e){if(e&&typeof e!=Uo)throw new Error(SIe);return e}function k5(e){if(e&&(typeof e.addEventListener!=Uo||typeof e.aborted!=Ywe))throw new Error(wIe);return e||Ue}function U5(e,t){if(e&&typeof e!=pE||t&&!(t instanceof Uint8Array))throw new Error(Rne)}function One(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function Hw(e,t,n){e!==Ue&&One(e,t,n)}function gE(e){return typeof e==pE&&e.trim()?Number(e):e}var Xwe,Kwe,$we,Jwe,Zwe,w5,I5,P5,D5,Qwe,eIe,tIe,nIe,iIe,rIe,oIe,sIe,R5,O5,M5,N5,aIe,cIe,lIe,uIe,fIe,dIe,hIe,mIe,pIe,Pne,gIe,_Ie,O3,Vw,yIe,AIe,bIe,xIe,TIe,EIe,Dne,CIe,vIe,L5,F5,XA,B5,D_,SIe,wIe,Rne,M3=hs(()=>{_c();Xwe="filenameEncoding",Kwe="commentEncoding",$we="decodeText",Jwe="extractPrependedData",Zwe="extractAppendedData",w5="password",I5="rawPassword",P5="passThrough",D5="signal",Qwe="checkPasswordOnly",eIe="checkOverlappingEntryOnly",tIe="checkOverlappingEntry",nIe="checkAmbiguity",iIe="checkLocalDirectory",rIe="checkSignature",oIe="checkCrc32",sIe="checkAuthenticationCode",R5="useWebWorkers",O5="useCompressionStream",M5="transferStreams",N5="preventClose",aIe="encryptionStrength",cIe="extendedTimestamp",lIe="ntfsTimestamp",uIe="keepOrder",fIe="level",dIe="bufferedWrite",hIe="createTempStream",mIe="dataDescriptorSignature",pIe="useUnicodeFileNames",Pne="dataDescriptor",gIe="supportZip64SplitFile",_Ie="encodeText",O3="offset",Vw="usdz",yIe="unixExtraFieldType",AIe="localExtraField",bIe="centralExtraField",xIe="strictness",TIe="filenameValidation",EIe="normalizeFilename",Dne="maxAppendedDataSize",CIe="decryptCentralDirectory",vIe="signCentralDirectory",L5="filename",F5="comment",XA="strict",B5="balanced",D_="tolerant",SIe="Invalid option (must be a function)",wIe="Invalid signal (must be an AbortSignal instance)",Rne="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function R_(){return Mne}function N3(e){return Nne(e.chunkSize)}function Nne(e){return e=gE(e),Number.isInteger(e)&&e>=PIe?Math.max(e,Uvt):IIe}function L3(e){Object.assign(Mne,FIe(BIe(e)))}function FIe(e){let t={};for(let n of jvt){let i=e[n];i!==Ue&&(t[n]=Hvt(n,i))}return t}function Hvt(e,t){if(NIe.includes(e)){if(t=gE(t),e==MIe&&(!Number.isInteger(t)||t<PIe))throw new Error(DIe)}else LIe.includes(e)&&jw(t);return t}function BIe(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 Gw(e){let t=FIe(BIe(e));Object.assign(OIe,t),Object.assign(Mne,t)}var IIe,Uvt,PIe,DIe,RIe,OIe,MIe,zvt,Vvt,NIe,LIe,jvt,Mne,S0=hs(()=>{_c();M3();IIe=64*1024,Uvt=64,PIe=1,DIe="Invalid maxWorkers (must be an integer greater than 0)",RIe=2;try{typeof navigator!=sf&&navigator.hardwareConcurrency&&(RIe=navigator.hardwareConcurrency)}catch{}OIe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:IIe,maxWorkers:RIe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=sf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=sf&&DecompressionStream},MIe="maxWorkers",zvt=["baseURI","wasmURI","workerURI"],Vvt=["useCompressionStream","useWebWorkers","transferStreams"],NIe=["chunkSize",MIe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],LIe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],jvt=[...zvt,...Vvt,...NIe,...LIe],Mne={...OIe}});function hh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function z5(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 _E=hs(()=>{});var F3,kIe,Gvt,Wvt,qvt,Yvt,Xvt,Kvt,$vt,Bm,B3=hs(()=>{F3=[[],[],[],[],[],[],[],[]];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;F3[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=F3[t-1][e];F3[t][e]=n>>>8^F3[0][n&255]}[kIe,Gvt,Wvt,qvt,Yvt,Xvt,Kvt,$vt]=F3,Bm=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=$vt[a&255]^Kvt[a>>>8&255]^Xvt[a>>>16&255]^Yvt[a>>>24&255]^qvt[c&255]^Wvt[c>>>8&255]^Gvt[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 k3,UIe=hs(()=>{B3();k3=class extends null{constructor(){let t,n=new Bm;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 Ww(e){if(typeof TextEncoder==sf){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 Lne=hs(()=>{_c()});var cu,U3,zIe,Fne,Bne,KA,VIe=hs(()=>{cu={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=cu.getPartial(n);return i===32?e.concat(t):cu._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+cu.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]=cu.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=cu.getPartial(r);return i.push(cu.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},U3={bytes:{fromBits(e){let n=cu.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(cu.partial(8*(n&3),i)),t}}},zIe={};zIe.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=U3.utf8String.toBits(e));let n=t._buffer=cu.concat(t._buffer,e),i=t._length,r=t._length=i+cu.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=cu.concat(t,[cu.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}};Fne={};Fne.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}};Bne={};Bne.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=cu.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 cu.clamp(t,r)}};KA={importKey(e){return new KA.hmacSha1(U3.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=cu;for(t=U3.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)}};KA.hmacSha1=class{constructor(e){let t=this,n=t._hash=zIe.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 V5(e){if(Jvt)return crypto.getRandomValues(e);throw new Error(qw)}var Jvt,w0,$A,JA,O_,qw,j5=hs(()=>{_c();Jvt=typeof crypto!=sf&&typeof crypto.getRandomValues==Uo,w0="Invalid password",$A="Invalid signature",JA=$A,O_="zipjs-abort-check-password",qw="Crypto API not supported"});function qIe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:fSt(t,n),strength:i-1,pendingInput:mr})}function YIe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=hh(c,t));let u=t.length-r;n=dSt(n,i+(u-u%Yw));let f;for(f=0;f<=u-Yw;f+=Yw){let d=H3(I0,mh(t,f,f+Yw));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(j3(I0,p),f+i)}return e.pendingInput=mh(t,f),n}async function aSt(e,t,n,i){let r=await XIe(e,t,n,mh(i,0,V3[t])),o=mh(i,V3[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(w0)}async function cSt(e,t,n){let i=V5(new Uint8Array(V3[t])),r=await XIe(e,t,n,i);return hh(i,r)}async function XIe(e,t,n,i){e.password=null;let r=await lSt(Zvt,n,tSt,!1,nSt),o=await uSt(Object.assign({salt:i},kne),r,8*(z3[t]*2+2)),s=new Uint8Array(o),a=H3(I0,mh(s,0,z3[t])),c=H3(I0,mh(s,z3[t],z3[t]*2)),u=mh(s,z3[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new oSt(new rSt(a),Array.from(iSt)),hmac:new sSt(c)}),u}async function lSt(e,t,n,i,r){if(jIe)try{return await G3.importKey(e,t,n,i,r)}catch{return jIe=!1,KA.importKey(t)}else return KA.importKey(t)}async function uSt(e,t,n){if(HIe)try{return await G3.deriveBits(e,t,n)}catch{return HIe=!1,KA.pbkdf2(t,e.salt,kne.iterations,n)}else return KA.pbkdf2(t,e.salt,kne.iterations,n)}function fSt(e,t){return t===Ue?Ww(e):t}function dSt(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 j3(e,t){return e.fromBits(t)}function H3(e,t){return e.toBits(t)}var Yw,Zvt,GIe,Qvt,eSt,tSt,kne,nSt,V3,z3,M_,iSt,W5,G3,WIe,I0,rSt,oSt,sSt,jIe,HIe,H5,G5,KIe=hs(()=>{_c();Lne();_E();VIe();j5();Yw=16,Zvt="raw",GIe={name:"PBKDF2"},Qvt={name:"HMAC"},eSt="SHA-1",tSt=Object.assign({hash:Qvt},GIe),kne=Object.assign({iterations:1e3,hash:{name:eSt}},GIe),nSt=["deriveBits"],V3=[8,12,16],z3=[16,24,32],M_=10,iSt=[0,0,0,0],W5=typeof crypto!=sf,G3=W5&&crypto.subtle,WIe=W5&&typeof G3!=sf,I0=U3.bytes,rSt=Fne.aes,oSt=Bne.ctrGladman,sSt=KA.hmacSha1,jIe=W5&&WIe&&typeof G3.importKey==Uo,HIe=W5&&WIe&&typeof G3.deriveBits==Uo,H5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){qIe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await aSt(c,f,u,mh(s,0,V3[f]+2)),s=mh(s,V3[f]+2),r?a.error(new Error(O_)):d()):await p;let g=new Uint8Array(s.length-M_-(s.length-M_)%Yw);a.enqueue(YIe(c,s,g,0,M_,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=mh(u,0,u.length-M_),p=mh(u,u.length-M_),g=mr;if(d.length){let A=H3(I0,d);c.update(A);let b=a.update(A);g=j3(I0,b)}let m=mh(j3(I0,c.digest()),0,M_),y=u.length<M_?1:0;for(let A=0;A<M_;A++)y|=m[A]^p[A];if(y&&o)throw new Error(JA);s.enqueue(g)}}})}},G5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){qIe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=mr;a?(d=await cSt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%Yw);p.set(d,0),o.enqueue(YIe(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=mr;if(a.length){let d=o.update(H3(I0,a));s.update(d),u=j3(I0,d)}let f=j3(I0,s.digest()).slice(0,M_);r.enqueue(hh(u,f))}}})}}});function QIe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),hSt(e,t,n)}function $Ie(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=ePe(e)^t[i],X5(e,n[i]);return n}function JIe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=ePe(e)^t[i],X5(e,t[i]);return n}function hSt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new Bm(i[0]),crcKey2:new Bm(i[2])}),n)for(let r=0;r<n.length;r++)X5(e,n[r]);else for(let r=0;r<t.length;r++)X5(e,t.charCodeAt(r))}function X5(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=ZIe(Math.imul(ZIe(n+tPe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function ePe(e){let t=e.keys[2]|2;return tPe(Math.imul(t,t^1)>>>8)}function tPe(e){return e&255}function ZIe(e){return e&4294967295}var Xw,q5,Y5,nPe=hs(()=>{B3();j5();Xw=12,q5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){QIe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=$Ie(a,o.subarray(0,Xw));if(a.password=a.rawPassword=null,(c[Xw-1]^a.passwordVerification)!=0)throw new Error(w0);o=o.subarray(Xw)}r?s.error(new Error(O_)):s.enqueue($Ie(a,o))}})}},Y5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){QIe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=V5(new Uint8Array(Xw));u[Xw-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(JIe(s,u),0),c=Xw}else a=new Uint8Array(r.length),c=0;a.set(JIe(s,r),c),o.enqueue(a)}})}}});function km(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 P0(e,t){e=km(e);let n=t?{type:t}:{};if(mSt())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 mSt(){return typeof Blob.prototype.stream!=Uo||new Blob([]).stream()instanceof ReadableStream}function iPe(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 Kw=hs(()=>{_c()});function K5(e){return pSt.get(e)}function $5(e){return Une.get(e)}function gSt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Uo&&typeof i!=Uo)throw new Error(rPe);Une.set(e,{CompressionStream:n,DecompressionStream:i})}async function oPe(e,t){!Une.has(e)&&t&&gSt(e,await import(t))}var rPe,pSt,Une,AE=hs(()=>{_c();rPe="Invalid codec module",pSt=new Map,Une=new Map});function bSt(e,t,n){let i=new Bm,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(cPe);y.set(ySt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(zne),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=Um(e,f),e=Jw(e,t),Um(e,d);function p(){g(),s=setTimeout(()=>c(new Error(ZA)),ASt)}function g(){clearTimeout(s)}}function jne(e,t){if(!e)return!1;let n=sPe.get(e);n||(n=new Map,sPe.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 e9(e){return jne(e,Vne)}function Hne(e){return jne(e,q3)}function lPe(e,t,n){t=Um(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function uPe(e,t,n){if(!e)throw new Error(_St);return new e(t,n)}function fPe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?aPe:Vne,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return Jw(e,a)}function Um(e,t){return km(e).pipeThrough(t)}function Jw(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 xSt(n,o),await TSt(i,o)}}}async function xSt(e,t){try{await e.abort(t)}catch{}}async function TSt(e,t){try{await e.cancel(t)}catch{}}function ESt(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(Zw);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var ZA,Zw,Qw,_St,Vne,aPe,q3,cPe,zne,ySt,ASt,J5,Z5,Q5,sPe,Gne=hs(()=>{B3();UIe();KIe();nPe();j5();_c();_E();Kw();AE();ZA="Invalid uncompressed size",Zw="Invalid compressed data",Qw=$A,_St="Compression method not supported",Vne="deflate-raw",aPe="deflate64-raw",q3="gzip",cPe=10,zne=8,ySt=[31,139,8],ASt=5e3,J5=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&&$5(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new k3,T=Um(T,A)),o)if(E)T=Jw(T,uPe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new Z5,T=Jw(T,new r(q3)),T=Um(T,x);else try{T=fPe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(q3)}catch{throw S}T=Jw(T,I),T=Um(T,new Z5)}s&&(c?T=Um(T,new Y5(t)):(b=new G5(t),T=Um(T,b))),lPe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},Z5=class extends null{constructor(){let t,n=cPe,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<=zne){i=hh(i,r);return}let a=s-zne,c=Math.min(a,i.length);o.enqueue(hh(i.subarray(0,c),r.subarray(0,a-c))),i=hh(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}};Q5=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=Um(x,new q5(t)):(b=new H5(t),x=Um(x,b))),u){let T=p&&$5(p);if(T)x=Jw(x,uPe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=fPe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===Ue)throw E;let v;try{v=new r(q3)}catch{throw E}x=bSt(x,v,y)}x=ESt(x)}a&&(A=new k3,x=Um(x,A)),lPe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(Qw)}})}},sPe=new Map});var CSt,dPe,hPe,mPe,Wne,pPe,gPe,eI,n9,t9,Y3,i9=hs(()=>{_c();Gne();CSt=64*1024,dPe="message",hPe="start",mPe="pull",Wne="data",pPe="ack",gPe="close",eI="deflate",n9="inflate",t9=class extends null{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(eI)?o=J5:r.startsWith(n9)&&(o=Q5),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(ZA)},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)}})}},Y3=class extends null{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=CSt),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 yPe({initModule:e}){o9=e}function APe(e){Yne=e}async function bPe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||e9(t)||Hne(t))return!0;if(n)try{return await o9(e),!0}catch{return!1}return!1}function Kne(e){e.createWorker?_Pe=!0:r9=!1}async function qne(e,...t){try{await e(...t)}catch{}}function $ne(e,t){return{run:()=>s9(e,t)}}async function s9({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(eI),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!e9(d))try{await o9(r)}catch{}}else try{await o9(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new t9(e,r),await t.pipeThrough(o).pipeThrough(new Y3(N3(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 xE,r9,_Pe,Yne,o9,bE,Xne,X3=hs(()=>{_c();S0();i9();xE="Worker startup timeout",o9=()=>{};bE=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 _Pe&&(f=Ue),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new Y3(N3(o))).pipeThrough(new Xne(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)}}}),r9===Ue&&(r9=typeof Worker!=sf),(a&&Yne&&(r9&&u||f)?Yne:$ne)(t,o)}},Xne=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await qne(t,i)},async transform(s,a){o+=s.length,n&&await qne(n,o,i),a.enqueue(s)},async flush(){r&&await qne(r,o)}})}}});async function u9(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 oPe(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=TE.find(v=>!v.busy);if(E)return IPe(E),new bE(E,e,t,T);if(TE.length<y){let v={indexWorker:wPe};return wPe++,TE.push(v),new bE(v,e,t,T)}else return new Promise(v=>{tI.push({resolve:v,stream:e,workerOptions:t}),c9=i.workerStarvationTimeout,l9()})}function T(E){if(PPe(),tI.length){let[{resolve:v,stream:S,workerOptions:I}]=tI.splice(0,1);v(new bE(E,S,I,T)),l9()}else E.worker?(IPe(E),NSt(E,t)):TE=TE.filter(v=>v!=E)}}function RSt(e,t){try{return new URL(e,t).toString()}catch{return e}}function l9(){!nI&&tI.length&&Number.isFinite(c9)&&c9>=0&&(nI=setTimeout(OSt,c9))}function PPe(){nI&&(clearTimeout(nI),nI=null)}function OSt(){if(nI=null,tI.length){let[{resolve:e,stream:t,workerOptions:n}]=tI.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:Ue,createWorker:Ue});e(new bE({},t,i,MSt)),l9()}}function MSt(){PPe(),l9()}function NSt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{TE=TE.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function IPe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var TE,tI,nI,c9,wPe,f9=hs(()=>{_c();i9();AE();X3();TE=[],tI=[],wPe=0});function RPe(e){if(LSt){let t="";for(let n=0;n<e.length;n++)t+=DPe[e[n]];return t}else return new TextDecoder().decode(e)}var DPe,LSt,OPe=hs(()=>{DPe="\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(""),LSt=DPe.length==256});function K3(e,t){return NPe(e,t,!0)}function MPe(e,t){return NPe(e,t,!1)}function NPe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?RPe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var nie=hs(()=>{OPe()});function BSt(){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();iie=n==1}catch{iie=!1}})()}function p9(e){return!!(e&&e.getData)}async function Vc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function kSt(e){return e=new N_(e),await Vc(e),(e.size===Ue||!e.readUint8Array)&&(e=new af(await P0(e.readable)),await Vc(e)),e}function zo(e,t,n){return e.readUint8Array(t,n)}function oie(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?rI.prototype.createReadable.call(e,t):e.readable}var FPe,BPe,FSt,UIi,zIi,rie,LPe,iI,rI,d9,$3,iie,kPe,af,oI,J3,Z3,h9,m9,N_,sI,g9=hs(()=>{_c();S0();_E();Kw();nie();FPe="Writer iterator completed too soon",BPe="Writer not initialized",FSt="text/plain",UIi=256*1024,zIi=16*1024*1024,rie="writable",LPe=Symbol(),iI=class{constructor(){this.size=0}init(){this.initialized=!0}},rI=class extends iI{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=N3(R_())}={}){let r=this,o=0;return i=Nne(i),new ReadableStream({async pull(s){let a=n===Ue?i:Math.min(i,n-o),c=await zo(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},d9=class extends iI{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(BPe);return t.writeUint8Array(z5(i))}});Object.defineProperty(t,rie,{get(){return n}})}writeUint8Array(){}},$3=class extends d9{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)}};af=class extends rI{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),kPe||BSt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?km(i.stream()):iie?km(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)}},oI=class extends iI{constructor(t){super();let n=this,i=new null;Object.defineProperty(n,rie,{get(){return i.writable}}),n.contentType=t,n.blobPromise=P0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},J3=class extends af{constructor(t){super(new Blob([t],{type:FSt}))}},Z3=class extends oI{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():MPe(new Uint8Array(await i.arrayBuffer()),t)}},h9=class extends rI{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(kSt));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 zo(c,a,n);else{let f=u-a,d=await zo(c,a,f),p=await i.readUint8Array(t+f,n-f);o=hh(d,p)}}else o=mr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},m9=class extends iI{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===LPe){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(FPe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Vc(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,rie,{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(LPe)}finally{t.releaseLock()}}},N_=class{constructor(t){return Array.isArray(t)&&(t=new h9(t)),(t instanceof ReadableStream||typeof t.getReader==Uo)&&(t={readable:km(t)}),t}},sI=class{constructor(t){return t.writable===Ue&&typeof t.next==Uo&&(t=new m9(t)),(t instanceof WritableStream||typeof t.getWriter==Uo)&&(t={writable:iPe(t)}),t.size===Ue&&(t.size=0),t}}});var sie,aie,Q3,cie,eU,lie,uie,fie,aI,cI,tU,die,nU,hie,mie,pie,_9,y9,gie,_ie,yie,A9,Aie,bie,xie,Tie,EE,Eie,USt,Cie,b9,zSt,x9,VSt,jSt,HSt,GSt,vie,Sie,wie,Iie,WSt,qSt,YSt,XSt,KSt,$St,JSt,ZSt,QSt,ewt,twt,nwt,iwt,rwt,owt,swt,QA,Pie=hs(()=>{sie="filename",aie="rawFilename",Q3="comment",cie="rawComment",eU="uncompressedSize",lie="compressedSize",uie="offset",fie="diskNumberStart",aI="lastModDate",cI="rawLastModDate",tU="lastAccessDate",die="rawLastAccessDate",nU="creationDate",hie="rawCreationDate",mie="internalFileAttributes",pie="externalFileAttributes",_9="internalFileAttribute",y9="externalFileAttribute",gie="msdosAttributesRaw",_ie="msdosAttributes",yie="msDosCompatible",A9="zip64",Aie="encrypted",bie="version",xie="versionMadeBy",Tie="zipCrypto",EE="directory",Eie="executable",USt="symlink",Cie="compressionMethod",b9="signature",zSt="crc32",x9="extraField",VSt="extraFieldInfoZip",jSt="extraFieldUnix",HSt="extraFieldUnixType1",GSt="extraFieldPkwareUnix",vie="unixMode",Sie="setuid",wie="setgid",Iie="sticky",WSt="bitFlag",qSt="rawBitFlag",YSt="filenameLength",XSt="extraFieldLength",KSt="unixExternalUpper",$St="filenameUTF8",JSt="commentUTF8",ZSt="rawExtraField",QSt="extraFieldZip64",ewt="extraFieldUnicodePath",twt="extraFieldUnicodeComment",nwt="extraFieldAES",iwt="extraFieldNTFS",rwt="extraFieldExtendedTimestamp",owt="extraFieldUSDZ",swt=[sie,aie,eU,lie,aI,cI,Q3,cie,tU,die,nU,hie,uie,fie,mie,pie,_9,y9,gie,_ie,yie,A9,Aie,bie,xie,Tie,EE,Eie,USt,Cie,b9,zSt,x9,jSt,VSt,HSt,GSt,"uid","gid",vie,KSt,Sie,wie,Iie,WSt,qSt,YSt,XSt,$St,JSt,ZSt,QSt,ewt,twt,nwt,iwt,rwt,owt],QA=class{constructor(t){swt.forEach(n=>this[n]=t[n])}}});var dDe={};Oq(dDe,{ERR_AMBIGUOUS_ARCHIVE:()=>ire,ERR_BAD_FORMAT:()=>lI,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>Jie,ERR_ENCRYPTED:()=>ere,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>rre,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>nre,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>$ie,ERR_EOCDR_NOT_FOUND:()=>Kie,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>Qie,ERR_INVALID_AUTHENTICATION_CODE:()=>JA,ERR_INVALID_COMPRESSED_DATA:()=>Zw,ERR_INVALID_CRC32:()=>Qw,ERR_INVALID_FILENAME_VALIDATION:()=>are,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>cre,ERR_INVALID_PASSWORD:()=>w0,ERR_INVALID_SIGNATURE:()=>$A,ERR_INVALID_STRICTNESS:()=>sre,ERR_INVALID_UNCOMPRESSED_SIZE:()=>ZA,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Zie,ERR_OVERLAPPING_ENTRY:()=>tre,ERR_SPLIT_ZIP_FILE:()=>S9,ERR_UNSAFE_FILENAME:()=>ore,ERR_UNSUPPORTED_COMPRESSION:()=>v9,ERR_UNSUPPORTED_ENCRYPTION:()=>C9,ERR_UNSUPPORTED_UINT64:()=>lre,ERR_WORKER_STARTUP_TIMEOUT:()=>xE,WARNING_APPENDED_DATA:()=>I9,WARNING_COMPRESSED_PATCHED_DATA:()=>dre,WARNING_DUPLICATE_FILENAME:()=>gre,WARNING_MALFORMED_EXTRA_FIELD:()=>V9,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>_re,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>yre,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Are,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>uI,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>mre,WARNING_PREPENDED_DATA:()=>P9,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>pre,WARNING_UNKNOWN_VERSION:()=>fre,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>hre,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>ure,WARNING_WRAPPED_ENTRIES_COUNT:()=>w9,ZipReader:()=>wE,ZipReaderStream:()=>R9,isZipFile:()=>iDe});async function iDe(e,t={}){if(e=new N_(e),await Vc(e),(e.size===Ue||!e.readUint8Array)&&(e=new af(await P0(e.readable)),await Vc(e)),e.size<22)return!1;let n=xre(t,{}),i=n!=D_,r=cDe(t[Dne],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await lDe(e,i,r);if(!o||n==XA&&s>1)return!1;let a=pr(fi(o),20),c=o.offset+22+a;return e.size-c<=r}function Die(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 YPe(e,t,n){let i=0;for(;n+46<=t.length&&Pi(e,n)==33639248;)n+=46+pr(e,n+28)+pr(e,n+30)+pr(e,n+32),i++;return i%65536?0:i}function Rie(e){if(e.length>=6){let t=fi(e);if(Pi(t,0)==84233040){let n=pr(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 xwt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=fi(e),i=pr(n,26);Object.assign(t,{compressionMethod:pr(n,0),compressedSize:ed(n,2),uncompressedSize:ed(n,10),encryptionAlgorithm:pr(n,18),bitLength:pr(n,20),flags:pr(n,22),hashAlgorithm:pr(n,24),hashData:e.subarray(28,28+i)})}return t}function rDe(e,t,n){let i=e.rawBitFlag=pr(t,n+2),r=(i&1)==1,o=Pi(t,n+6);Object.assign(e,{encrypted:r,version:pr(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:Fwt(o),filenameLength:pr(t,n+22),extraFieldLength:pr(t,n+24)})}function oDe(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=pr(a,c),I=pr(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=pr(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&&(Twt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(XPe(p,sie,aie,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(XPe(g,Q3,cie,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(Ewt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(KPe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(KPe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(Cwt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=$Pe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&($Pe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(vwt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function Twt(e,t){t.zip64=!0;let n=fi(e.data),i=gwt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+WPe[s].bytes,0);if(e.data.length<r)throw new Error(Qie);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=WPe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function XPe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=fi(e.data),s=new Bm;s.append(r[n]);let a=fi(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Pi(o,1),u=tb(o,0);Object.assign(e,{version:u,[t]:K3(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Pi(a,0)}),e.valid&&(i[t]=e[t],i[t+pwt]=!0)}function Ewt(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:pr(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=nDe&&(t.crc32=Ue)}function Cwt(e,t){let n=fi(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=pr(n,i),s=pr(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=Oie(s),f=Oie(a),d=Oie(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function KPe(e,t){if(e.data.length<8)return;let n=fi(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=pr(n,8),o.gid=pr(n,10)),Object.assign(e,o),Object.assign(t,o)}function $Pe(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=JPe(e.data.subarray(s,s+c)),s+=c;let u=tb(i,s++);o=JPe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=pr(i,0),o=pr(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 JPe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function vwt(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(aI),s.push(cI)),(r&2)==2&&(o.push(tU),s.push(die)),(r&4)==4&&(o.push(nU),s.push(hie))):e.data.length>=5&&(o.push(aI),s.push(cI));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 Swt({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 zo(e,a+o,d+4),m=fi(g),y=g.length==d+4&&Pi(m,0)==134695760;if(y){let A=ZPe(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=ZPe(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(tre);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function ZPe(e,t,n){let i=Pi(e,t),r,o;return n?(r=ed(e,t+4),o=ed(e,t+12)):(r=Pi(e,t+4),o=Pi(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function fI(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function wwt(e){return await sDe(e)==134695760}async function Iwt(e){let t=await sDe(e);return t==134695760||t==808471376}async function sDe(e){let t=await zo(e,0,4);return Pi(fi(t))}function aDe(e){return e===XA||e===B5||e===D_}function Pwt(e,t,n){return Math.min(e,n?t*Awt:t)}function xre(e,t){return QPe(e,QPe(t,B5))}function QPe(e,t){let n=e[xIe];if(n!==Ue){if(!aDe(n))throw new Error(sre);return n}let i=e[nIe];return i===Ue?t:i?XA:t==D_?D_:B5}function Dwt(e,t){return e===Ue?t!=D_:!!e}function Rwt(e,t){return e===Ue?t==XA:!!e}function Owt(e,t){if(e===Ue)return t;if(!aDe(e))throw new Error(are);return e}function Mwt(e,t){if(t==D_)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||mwt.test(e)?!0:t==XA&&(n.includes(".")||n.includes(""))}function cDe(e,t){if(e!==Ue){let n=gE(e);if(typeof n!=qwe||Number.isNaN(n)||n<0)throw new Error(cre);return n}return t==XA?0:t==D_?1/0:65535}async function lDe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:ywt},s,a,c=0;for await(let[u,f,d,p,g]of uDe(e,r)){let m=pr(u,p+20);if(g+22+m==i){let y=await fDe(e,u,f,p,g,i,o);if(y==D9){if(s||(s=Nie(d,p,g)),c++,!t||c>1)break}else y==bre&&!a&&(a=Nie(d,p,g))}}return s||(s=a),s||(s=await Nwt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function Nwt(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 uDe(e,r)){let p=Nie(u,f,d);o||(o=p);let g=await fDe(e,a,c,f,d,i,n);if(g==D9)return p;g==bre&&!s&&(s=p)}return s||o}async function*uDe(e,t){let n=e.size-t,i=await zo(e,n,t),r=fi(i);for(let o=i.length-22;o>=0;o--)Pi(r,o)==101010256&&(yield[r,n,i,o,n+o])}function Nie(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function fDe(e,t,n,i,r,o,s){let a=pr(t,i+10),c=Pi(t,i+12),u=Pi(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await eDe(e,t,n,r-20,o,s)==117853008?D9:qPe;if(!a&&!c)return bre;let f=pr(t,i+6);for(let d of[r-c,fI(e,f)+u])if(await eDe(e,t,n,d,o,s)==33639248)return D9;return qPe}async function eDe(e,t,n,i,r,o){if(i<0||i+4>r)return Ue;if(i>=n)return Pi(t,i-n);if(o.count>0){o.count--;let s=await zo(e,i,4);return Pi(fi(s),0)}return Ue}function Lwt(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]))&&O0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&GPe)!=(e.rawBitFlag&GPe)&&O0(s,r,_re),t.compressionMethod!=e.compressionMethod&&O0(s,r,yre),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&O0(s,r,Are)}function O0(e,t,n){e?T9(n):ph(t,n)}function ph(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==Ue&&(i.filename=n),e.push(i)}}function T9(e){let t=new Error(ire);throw t.reason=e,t}function Ms(e,t,n){return t[n]===Ue?e.options[n]:t[n]}function tDe(e,t,n){return jw(Ms(e,t,n))}function Fwt(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<zw?zw:i}function Oie(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function tb(e,t){return e.getUint8(t)}function pr(e,t){return e.getUint16(t,!0)}function Pi(e,t){return e.getUint32(t,!0)}function ed(e,t){let n=e.getBigUint64(t,!0);if(n>_wt)throw new Error(lre);return Number(n)}var lI,Kie,$ie,Jie,Zie,Qie,ere,C9,v9,S9,tre,nre,ire,rre,ore,sre,are,cre,lre,ure,fre,dre,V9,hre,w9,I9,P9,mre,pre,gre,uI,_re,yre,Are,hwt,mwt,jPe,pwt,HPe,GPe,nDe,gwt,WPe,_wt,ywt,Awt,qPe,bre,D9,wE,R9,Mie,Tre=hs(()=>{_c();S0();AE();f9();g9();nie();_E();Kw();B3();Pie();M3();lI="File format is not recognized",Kie="End of central directory not found",$ie="End of Zip64 central directory locator not found",Jie="Central directory header not found",Zie="Local file header not found",Qie="Zip64 extra field not found",ere="File contains encrypted entry",C9="Encryption method not supported",v9="Compression method not supported",S9="Split zip file",tre="Overlapping entry found",nre="Entry data out of bounds",ire="Ambiguous archive",rre="Encrypted central directory is not supported",ore="Unsafe filename",sre="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",are="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",cre="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",lre="64-bit value exceeds Number.MAX_SAFE_INTEGER",ure="unsorted central directory",fre="unknown version needed to extract",dre="compressed patched data",V9="malformed extra field",hre="unknown zip64 extensible data",w9="wrapped entries count",I9="appended data",P9="prepended data",mre="prepended central directory",pre="trailing central directory data",gre="duplicate filename",uI="mismatched zip64 end of central directory record",_re="mismatched local file header (general purpose bit flag)",yre="mismatched local file header (compression method)",Are="mismatched local file header (crc32 or sizes)",hwt=63,mwt=/^[a-zA-Z]:/,jPe="utf-8",pwt="UTF8",HPe="cp437",GPe=2057,nDe=1,gwt=[[eU,4294967295],[lie,4294967295],[uie,4294967295],[fie,65535]],WPe={65535:{getValue:Pi,bytes:4},4294967295:{getValue:ed,bytes:8}},_wt=BigInt(Number.MAX_SAFE_INTEGER),ywt=64,Awt=1032,qPe=0,bre=1,D9=2,wE=class{constructor(t,n={}){Object.assign(this,{reader:new N_(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Vc(i),(i.size===Ue||!i.readUint8Array)&&(i=new af(await P0(i.readable)),await Vc(i)),i.size<22)throw new Error(lI);let r=n.warnings=[],o=xre(t,n.options),s=o==XA,a=o!=D_,c=cDe(Ms(n,t,Dne),o),u=Owt(Ms(n,t,TIe),o),f=Ms(n,t,EIe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await lDe(i,a,c);if(!d)throw await wwt(i)?new Error(S9):new Error(Kie);a&&p>1&&T9("multiple end of central directory records");let g=fi(d),m=Pi(g,12),y=Pi(g,16),A=d.offset,b=pr(g,20),x=A+22+b,T=i.size-x;T>c&&T9(I9),T>0&&ph(r,I9);let E=pr(g,4),v=i.lastDiskNumber||0,S=pr(g,6),I=pr(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+=fI(i,S)),M){let He=d.offset>=20?await zo(i,d.offset-20,20):mr,Xe=fi(He);if(He.length==20&&Pi(Xe,0)==117853008){y=fI(i,Pi(Xe,4))+ed(Xe,8);let $e=await zo(i,y,56),Pe=fi($e),qe=d.offset-20-56;if(($e.length<56||Pi(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),$e=await zo(i,y,56),Pe=fi($e)}if($e.length<56||Pi(Pe,0)!=101075792)throw new Error($ie);if(_=!0,C=ed(Pe,4)>44,C){let st=Math.min(ed(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await zo(i,y+56,st);P=xwt(vt)}}E==65535?E=Pi(Pe,16):E!=Pi(Pe,16)&&O0(s,r,uI),S==65535?S=Pi(Pe,20):S!=Pi(Pe,20)&&O0(s,r,uI),I==65535?I=ed(Pe,32):I!=ed(Pe,32)&&O0(s,r,uI),m==4294967295?m=ed(Pe,40):m!=ed(Pe,40)&&O0(s,r,uI),y=fI(i,S)+ed(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(S9);if(y<0)throw new Error(lI);let B=0,j=await zo(i,y,m),k=fi(j);if(m){if(j.length<4)throw new Error(lI);let He=V-m;if(y!=He&&S==E){let Xe=Pi(k,B)==33639248||!!(P&&P.compressedSize)||Die(k),$e=!Xe;if(!$e&&He>=0&&He+4<=i.size){let Pe=await zo(i,He,4);$e=Pi(fi(Pe),0)==33639248}if($e){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Xe),j=await zo(i,y,m),k=fi(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await zo(i,y,m),k=fi(j)),y<0||y>=i.size)throw new Error(lI);n.directoryOffset=y,n.directoryLength=F;let q=tDe(n,t,CIe),Q,W;if(q&&I&&j.length>=4&&Pi(k,0)!=33639248&&(C||Die(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||Pi(k,0)==33639248)&&ph(r,hre),L=y;let J=Ms(n,t,Xwe),Z=Ms(n,t,Kwe),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=YPe(k,j,B),I&&ph(r,w9));for(let He=0;He<I;He++){let Xe=new Mie(i,n.options);if(B+46>j.length||Pi(k,B)!=33639248)throw He==0&&!Q&&(C||Die(k))?new Error(rre):new Error(Jie);rDe(Xe,k,B+6);let $e=!!Xe.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Xe.filenameLength,st=qe+Xe.extraFieldLength,vt=pr(k,B+4),Gt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=pr(k,B+32),Xt=st+ft,rt=j.subarray(st,Xt),ht=$e,Bi=$e,Xn=Pi(k,B+38),bi=Xn&255,Wi={readOnly:!!(bi&1),hidden:!!(bi&2),system:!!(bi&4),directory:!!(bi&16),archive:!!(bi&32)},wi=Pi(k,B+42),hi=tDe(n,t,$we)||K3,xi=ht?jPe:J||HPe,jn=Bi?jPe:Z||HPe,nn=hi(mt,xi,L5);if(nn===Ue&&(nn=K3(mt,xi)),f){let ki=f(nn);ki!==Ue&&(nn=ki)}if(Mwt(nn,u)){let ki=new Error(ore);throw ki.filename=nn,ki}let Wn=hi(rt,jn,F5);Wn===Ue&&(Wn=K3(rt,jn)),Object.assign(Xe,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:Gt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:wi,diskNumberStart:pr(k,B+34),internalFileAttributes:pr(k,B+36),externalFileAttributes:Xn,msdosAttributesRaw:bi,msdosAttributes:Wi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Bi,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:nn,comment:Wn}),oDe(Xe,Xe,k,B+6)&&ph(r,V9,nn),Xe.offset+=R;let Zi=fI(i,Xe.diskNumberStart)+Xe.offset;L=Math.min(Zi,L),Zi<fe&&ph(r,ure,nn),fe=Zi,(Xe.version&255)>hwt&&ph(r,fre,nn),(Xe.rawBitFlag&32)==32&&ph(r,dre,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),gi=((Xe.unixMode===Ue?Mr:Xe.unixMode)&61440)==40960,ho=!gi&&(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:gi,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 QA(Xe);if(Bn.getData=(ki,Nr)=>Xe.getData(ki,Bn,n.readRanges,Nr),Bn.arrayBuffer=async ki=>{let Nr=new null,Wc=P0(Nr.readable).then(bd=>bd.arrayBuffer());return Wc.catch(()=>{}),await Xe.getData(Nr,Bn,n.readRanges,ki),Wc},B=Xt,He==I-1&&xe){let ki=YPe(k,j,B);ki&&(I+=ki,ph(r,w9))}let{onprogress:qi}=t;if(qi)try{await qi(He+1,I,new QA(Xe))}catch{}yield Bn}let ge=B,we=Rie(j.subarray(B))||(Q?Rie(W):Ue);if(!we&&!Q){let He=y+B,Xe=Math.min(V-He,65541);Xe>=6&&(we=Rie(await zo(i,He,Xe)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&O0(s,r,pre),Ae&&O0(s,r,gre);let Se=Ms(n,t,Jwe),Re=Ms(n,t,Zwe),Qe=(s||Se)&&I&&L==4&&await Iwt(i)?4:0;return s&&(R||I&&L>Qe)&&T9(P9),(R||I&&L>4)&&ph(r,P9),O&&ph(r,mre),Se&&(n.prependedData=L>Qe?await zo(i,Qe,L-Qe):mr),n.comment=b?await zo(i,A+22,b):mr,Re&&(n.appendedData=x<i.size?await zo(i,x,i.size-x):mr),!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()}},R9=class{constructor(t={}){let{readable:n,writable:i}=new null,r=new wE(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}};Mie=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=R_(),{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=fI(a,f)+u,R=await zo(a,I,30),O=fi(R),L=Ms(o,r,w5),_=Ms(o,r,I5),C=Ms(o,r,P5);if(U5(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(v9);if(R.length<30||Pi(O,0)!=67324752)throw new Error(Zie);rDe(v,O,4);let{extraFieldLength:w,filenameLength:P}=v,M=v.dataOffset=I+30+P+w,F=Ms(o,r,iIe),V=xre(r,o.options),B=Dwt(F,V),j=Rwt(F,V),k=mr;if(j&&(P||w)){let ft=await zo(a,I+30,P+w);k=ft.subarray(0,P),v.rawExtraField=ft.subarray(P)}else v.rawExtraField=w?await zo(a,I+30+P,w):mr;j&&(v.rawFilename=k),oDe(o,v,O,4,!0)&&ph(S,V9),Lwt(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(C9);let ae=C?Ue:K5(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(v9);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(C9);if(!L&&!_)throw new Error(ere)}if(M+T>a.size)throw new Error(nre);let Ae=T,fe=km(a.createReadable({offset:M,size:Ae})),xe=k5(Ms(o,r,D5)),ge=Ms(o,r,Qwe),we=Ms(o,r,tIe),Se=Ms(o,r,eIe);Se&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Xe=g!=0&&!C,$e=C?T:x,Pe=g==9,qe=Ms(o,r,O5);Pe&&(qe=!1);let st=Ms(o,r,oIe),vt=(st===Ue?Ms(o,r,rIe):st)&&!C&&(!J||Z||d&&d.vendorVersion==nDe),Gt={options:{codecType:n9,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:Ms(o,r,sIe),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:$e,crc32:A,compressed:Xe,encrypted:J,useWebWorkers:Ms(o,r,R5),useCompressionStream:qe,transferStreams:Ms(o,r,M5),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 Swt({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 sI(t),await Vc(t,Pwt($e,T,Xe)),{writable:lt}=t;let{outputSize:ft}=await u9({readable:fe,writable:lt},Gt);if(t.size+=ft,ft!=$e)throw new Error(ZA)}}catch(ft){if(ft.outputSize!==Ue&&(t.size+=ft.outputSize),!ge||ft.message!=O_)throw mt=ft,ft}finally{if(!(!p9(t)&&Ms(o,r,N5))&<&&!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 xRe=Yi((l7,bRe)=>{(function(e,t){typeof l7=="object"&&typeof bRe<"u"?t(l7):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(l7,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 _3e=Yi((lj,Wle)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof lj=="object"&&typeof Wle=="object"?Wle.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lj=="object"?lj.NoSleep=t():e.NoSleep=t()})(lj,(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(` + */(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 zU=="object"&&zU&&zU.exports&&(zU.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 bBe=Yi((Msr,EW)=>{/* 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 EW<"u"&&EW.exports?EW.exports=i:this.Lerc=i})()});var y3e=Yi((lj,Wle)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof lj=="object"&&typeof Wle=="object"?Wle.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lj=="object"?lj.NoSleep=t():e.NoSleep=t()})(lj,(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 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,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBV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VgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4z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AABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])}))});var D9t={};Oq(D9t,{AlphaMode:()=>Sp,AlphaPipelineStage:()=>NL,AnchorPointDirect:()=>LN,AnchorPointIndirect:()=>FN,Animation:()=>N8,AnimationViewModel:()=>L8,Appearance:()=>vr,ApproximateTerrainHeights:()=>Ni,ArcGISTiledElevationTerrainProvider:()=>bce,ArcGisBaseMapType:()=>Bh,ArcGisMapServerImageryProvider:()=>ag,ArcGisMapService:()=>vf,ArcType:()=>un,ArticulationStageType:()=>hl,AssociativeArray:()=>Ut,Atmosphere:()=>fx,AtmospherePipelineStage:()=>fL,AttributeCompression:()=>cn,AttributeType:()=>Vt,AutoExposure:()=>ND,AutomaticUniforms:()=>hg,Axis:()=>Vi,AxisAlignedBoundingBox:()=>Nf,Azure2DImageryProvider:()=>BD,B3dmLoader:()=>$N,B3dmParser:()=>zD,BaseLayerPicker:()=>P8,BaseLayerPickerViewModel:()=>I8,BatchTable:()=>hx,BatchTableHierarchy:()=>gx,BatchTexture:()=>Vl,BatchTexturePipelineStage:()=>LL,Billboard:()=>Lr,BillboardCollection:()=>Df,BillboardGraphics:()=>Tl,BillboardLoadState:()=>Us,BillboardTexture:()=>pg,BillboardVisualizer:()=>jV,BingMapsGeocoderService:()=>Tce,BingMapsImageryProvider:()=>FO,BingMapsStyle:()=>Rv,BlendEquation:()=>wc,BlendFunction:()=>$r,BlendOption:()=>Li,BlendingState:()=>tn,BoundingRectangle:()=>et,BoundingSphere:()=>ue,BoundingSphereState:()=>Pt,BoundingVolumeSemantics:()=>Gy,BoxEmitter:()=>eK,BoxGeometry:()=>Lc,BoxGeometryUpdater:()=>GV,BoxGraphics:()=>NE,BoxOutlineGeometry:()=>Tm,BrdfLutGenerator:()=>UO,Buffer:()=>tt,BufferLoader:()=>Tx,BufferPoint:()=>Dc,BufferPointCollection:()=>ku,BufferPointMaterial:()=>Kh,BufferPolygon:()=>Oo,BufferPolygonCollection:()=>Ua,BufferPolygonMaterial:()=>Rf,BufferPolyline:()=>Aa,BufferPolylineCollection:()=>il,BufferPolylineMaterial:()=>Of,BufferPrimitive:()=>ns,BufferPrimitiveCollection:()=>ta,BufferPrimitiveMaterial:()=>Hl,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>UL,CallbackPositionProperty:()=>WV,CallbackProperty:()=>$m,Camera:()=>Pr,CameraEventAggregator:()=>VM,CameraEventType:()=>nr,CameraFlightPath:()=>BM,Cartesian2:()=>U,Cartesian3:()=>h,Cartesian4:()=>se,CartesianRectangle:()=>GS,Cartographic:()=>he,CartographicGeocoderService:()=>Cce,CatmullRomSpline:()=>vce,Cesium3DContentGroup:()=>Rx,Cesium3DTile:()=>ih,Cesium3DTileBatchTable:()=>Wh,Cesium3DTileColorBlendMode:()=>Fu,Cesium3DTileContent:()=>nee,Cesium3DTileContentFactory:()=>xT,Cesium3DTileContentState:()=>Or,Cesium3DTileContentType:()=>Ca,Cesium3DTileFeature:()=>ra,Cesium3DTileFeatureTable:()=>fm,Cesium3DTileOptimizationHint:()=>Qd,Cesium3DTileOptimizations:()=>C2,Cesium3DTilePass:()=>so,Cesium3DTilePassState:()=>rh,Cesium3DTilePointFeature:()=>Xg,Cesium3DTileRefine:()=>_o,Cesium3DTileStyle:()=>Qg,Cesium3DTileStyleEngine:()=>R2,Cesium3DTileVectorFeature:()=>yT,Cesium3DTilesInspector:()=>V8,Cesium3DTilesInspectorViewModel:()=>z8,Cesium3DTilesTerrainData:()=>f8,Cesium3DTilesTerrainGeometryProcessor:()=>YP,Cesium3DTilesTerrainProvider:()=>Rce,Cesium3DTilesVoxelProvider:()=>bee,Cesium3DTileset:()=>Yo,Cesium3DTilesetBaseTraversal:()=>B2,Cesium3DTilesetCache:()=>I2,Cesium3DTilesetGraphics:()=>VE,Cesium3DTilesetHeatmap:()=>P2,Cesium3DTilesetMetadata:()=>MT,Cesium3DTilesetMostDetailedTraversal:()=>N2,Cesium3DTilesetSkipTraversal:()=>z2,Cesium3DTilesetStatistics:()=>Em,Cesium3DTilesetTraversal:()=>Ya,Cesium3DTilesetVisualizer:()=>qV,CesiumInspector:()=>w8,CesiumInspectorViewModel:()=>S8,CesiumTerrainProvider:()=>gC,CesiumWidget:()=>_8,Check:()=>Wr,CheckerboardMaterialProperty:()=>KI,CircleEmitter:()=>Y2,CircleGeometry:()=>Oce,CircleOutlineGeometry:()=>Mce,ClassificationModelDrawCommand:()=>$F,ClassificationPipelineStage:()=>FL,ClassificationPrimitive:()=>dw,ClassificationType:()=>ei,ClearCommand:()=>li,ClippingPlane:()=>na,ClippingPlaneCollection:()=>Ts,ClippingPolygon:()=>AS,ClippingPolygonCollection:()=>Nc,Clock:()=>Vm,ClockRange:()=>Ps,ClockStep:()=>Vr,ClockViewModel:()=>C8,CloudCollection:()=>Iee,CloudType:()=>hw,Color:()=>z,ColorBlendMode:()=>dl,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>Kt,Command:()=>Rle,ComponentDatatype:()=>Y,Composite3DTileContent:()=>HM,CompositeEntityCollection:()=>bae,CompositeMaterialProperty:()=>JI,CompositePositionProperty:()=>yc,CompositeProperty:()=>El,CompressedTextureBuffer:()=>SD,ComputeCommand:()=>Bf,ComputeEngine:()=>Qz,ConditionsExpression:()=>QB,ConeEmitter:()=>Mee,ConstantPositionProperty:()=>uu,ConstantProperty:()=>di,ConstantSpline:()=>eL,ContentMetadata:()=>l2,Context:()=>aC,ContextLimits:()=>kt,Controller:()=>ple,ControllerHost:()=>rV,CoplanarPolygonGeometry:()=>x4,CoplanarPolygonGeometryLibrary:()=>a_,CoplanarPolygonOutlineGeometry:()=>nh,CornerType:()=>cr,CorrelationGroup:()=>BN,CorridorGeometry:()=>CC,CorridorGeometryLibrary:()=>gr,CorridorGeometryUpdater:()=>ZV,CorridorGraphics:()=>FE,CorridorOutlineGeometry:()=>JV,Credit:()=>It,CreditDisplay:()=>ik,CubeMap:()=>rs,CubeMapFace:()=>TN,CubeMapPanorama:()=>HT,CubicRealPolynomial:()=>Ix,CullFace:()=>Ui,CullingVolume:()=>ea,CumulusCloud:()=>Kf,CustomDataSource:()=>QV,CustomHeightmapTerrainProvider:()=>Nce,CustomShader:()=>zp,CustomShaderMode:()=>Tg,CustomShaderPipelineStage:()=>qL,CustomShaderTranslucencyMode:()=>Yy,CylinderGeometry:()=>e4,CylinderGeometryLibrary:()=>vC,CylinderGeometryUpdater:()=>n4,CylinderGraphics:()=>BE,CylinderOutlineGeometry:()=>t4,CzmlDataSource:()=>d4,DataSource:()=>Ls,DataSourceClock:()=>jm,DataSourceCollection:()=>h4,DataSourceDisplay:()=>n8,DebugAppearance:()=>Vee,DebugCameraPrimitive:()=>d0,DebugInspector:()=>mk,DebugModelMatrixPrimitive:()=>_k,DefaultProxy:()=>Lce,DepthFunction:()=>cc,DepthPlane:()=>Ck,DequantizationPipelineStage:()=>XL,DerivedCommand:()=>wm,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>vk,DirectionalLight:()=>Kee,DiscardEmptyTileImagePolicy:()=>Ov,DiscardMissingTileImagePolicy:()=>vD,DistanceDisplayCondition:()=>Ht,DistanceDisplayConditionGeometryInstanceAttribute:()=>ni,DoubleEndedPriorityQueue:()=>p_,DoublyLinkedList:()=>w2,DracoLoader:()=>Rg,DrawCommand:()=>at,DynamicAtmosphereLightingType:()=>cg,DynamicEnvironmentMapManager:()=>Lg,DynamicGeometryBatch:()=>IC,DynamicGeometryUpdater:()=>Di,EarthOrientationParameters:()=>yD,EarthOrientationParametersSample:()=>wy,EasingFunction:()=>Es,EdgeDetectionPipelineStage:()=>$L,EdgeDisplayMode:()=>Wd,EdgeFramebuffer:()=>Sk,EdgeVisibilityPipelineStage:()=>QL,EllipseGeometry:()=>xu,EllipseGeometryLibrary:()=>mf,EllipseGeometryUpdater:()=>m4,EllipseGraphics:()=>kE,EllipseOutlineGeometry:()=>gd,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>vg,EllipsoidGeometry:()=>Xa,EllipsoidGeometryUpdater:()=>g4,EllipsoidGraphics:()=>UE,EllipsoidOutlineGeometry:()=>qf,EllipsoidPrimitive:()=>wk,EllipsoidRhumbLine:()=>Rc,EllipsoidSurfaceAppearance:()=>Jee,EllipsoidTangentPlane:()=>Vs,EllipsoidTerrainProvider:()=>g0,EllipsoidalOccluder:()=>Im,Empty3DTileContent:()=>o0,EncodedCartesian3:()=>Sn,Entity:()=>eo,EntityCluster:()=>rd,EntityCollection:()=>Qa,EntityView:()=>r8,EquirectangularPanorama:()=>Qee,Event:()=>be,EventHelper:()=>$o,Expression:()=>Fd,ExpressionNodeType:()=>Mt,ExtrapolationType:()=>du,FeatureDetection:()=>dn,FeatureIdPipelineStage:()=>bA,Fog:()=>kk,ForEach:()=>ke,FrameRateMonitor:()=>Uk,FrameState:()=>LA,Framebuffer:()=>gs,FramebufferManager:()=>ai,Frozen:()=>H,FrustumCommands:()=>zk,FrustumGeometry:()=>WT,FrustumOutlineGeometry:()=>dk,Fullscreen:()=>es,FullscreenButton:()=>B8,FullscreenButtonViewModel:()=>F8,GaussianSplat3DTileContent:()=>RA,GaussianSplatPrimitive:()=>c2,GaussianSplatRenderResources:()=>i2,GaussianSplatSorter:()=>AT,GaussianSplatTextureGenerator:()=>n2,GeoJsonDataSource:()=>db,GeoJsonLoader:()=>JN,GeoJsonPrimitive:()=>rte,GeocodeType:()=>jb,Geocoder:()=>H8,GeocoderService:()=>$P,GeocoderViewModel:()=>j8,GeographicProjection:()=>zi,GeographicTilingScheme:()=>Qi,Geometry:()=>St,Geometry3DTileContent:()=>WM,GeometryAttribute:()=>Ne,GeometryAttributes:()=>En,GeometryFactory:()=>Fce,GeometryInstance:()=>Bt,GeometryInstanceAttribute:()=>gl,GeometryOffsetAttribute:()=>gn,GeometryPipeline:()=>Gn,GeometryPipelineStage:()=>iF,GeometryType:()=>Dd,GeometryUpdater:()=>Ri,GeometryUpdaterSet:()=>UC,GeometryVisualizer:()=>j4,GetFeatureInfoFormat:()=>mm,Globe:()=>s3,GlobeDepth:()=>a3,GlobeSurfaceShaderSet:()=>Kk,GlobeSurfaceTile:()=>lh,GlobeSurfaceTileProvider:()=>Jk,GlobeTranslucency:()=>Zk,GlobeTranslucencyFramebuffer:()=>c3,GlobeTranslucencyState:()=>l3,GltfBufferViewLoader:()=>$v,GltfDracoLoader:()=>Jv,GltfGpmLoader:()=>UN,GltfGpmLocal:()=>TS,GltfImageLoader:()=>Zv,GltfIndexBufferLoader:()=>Qv,GltfJsonLoader:()=>tS,GltfLoader:()=>Uf,GltfLoaderUtil:()=>ju,GltfMeshPrimitiveGpmLoader:()=>HN,GltfSpzLoader:()=>lN,GltfStructuralMetadataLoader:()=>MN,GltfTextureLoader:()=>oS,GltfVertexBufferLoader:()=>sS,Google2DImageryProvider:()=>uF,GoogleEarthEnterpriseImageryProvider:()=>Fte,GoogleEarthEnterpriseMapsProvider:()=>rF,GoogleEarthEnterpriseMetadata:()=>T_,GoogleEarthEnterpriseTerrainData:()=>JP,GoogleEarthEnterpriseTerrainProvider:()=>Uce,GoogleEarthEnterpriseTileInformation:()=>d3,GoogleGeocoderService:()=>Vce,GoogleMaps:()=>Ta,GoogleStreetViewCubeMapPanoramaProvider:()=>Bte,GpxDataSource:()=>c8,GregorianDate:()=>Uh,GridImageryProvider:()=>kte,GridMaterialProperty:()=>sP,GroundGeometryUpdater:()=>ii,GroundPolylineGeometry:()=>oE,GroundPolylinePrimitive:()=>Rm,GroundPrimitive:()=>su,GroupMetadata:()=>cw,HeadingPitchRange:()=>Nd,HeadingPitchRoll:()=>Ic,Heap:()=>hD,HeightReference:()=>We,HeightmapEncoding:()=>ah,HeightmapTerrainData:()=>Uc,HeightmapTessellator:()=>xw,HermitePolynomialApproximation:()=>i4,HermiteSpline:()=>_A,HilbertOrder:()=>qv,HomeButton:()=>$8,HomeButtonViewModel:()=>K8,HorizontalOrigin:()=>ji,HybridScreenSpacePanCameraController:()=>ble,I3SBuildingSceneLayerExplorer:()=>zle,I3SBuildingSceneLayerExplorerViewModel:()=>G8,I3SDataProvider:()=>Mm,I3SDecoder:()=>A3,I3SFeature:()=>b3,I3SField:()=>x3,I3SGeometry:()=>Pw,I3SLayer:()=>cE,I3SNode:()=>Dw,I3SStatistics:()=>C3,I3SSublayer:()=>S3,I3SSymbology:()=>E3,I3dmLoader:()=>QN,I3dmParser:()=>ZN,ITwinData:()=>Doe,ITwinPlatform:()=>la,Iau2000Orientation:()=>nz,Iau2006XysData:()=>AD,Iau2006XysSample:()=>ux,IauOrientationAxes:()=>iz,IauOrientationParameters:()=>tz,ImageBasedLighting:()=>tT,ImageBasedLightingPipelineStage:()=>hL,ImageMaterialProperty:()=>rb,Imagery:()=>jS,ImageryConfiguration:()=>sB,ImageryCoverage:()=>WS,ImageryFlags:()=>hF,ImageryInput:()=>pF,ImageryLayer:()=>Is,ImageryLayerCollection:()=>NT,ImageryLayerFeatureInfo:()=>Hh,ImageryPipelineStage:()=>gF,ImageryProvider:()=>Sf,ImageryState:()=>Vn,Implicit3DTileContent:()=>fS,ImplicitAvailabilityBitstream:()=>Xv,ImplicitMetadataView:()=>Kv,ImplicitSubdivisionScheme:()=>Hs,ImplicitSubtree:()=>Ng,ImplicitSubtreeCache:()=>H2,ImplicitSubtreeMetadata:()=>YM,ImplicitTileCoordinates:()=>u0,ImplicitTileset:()=>l0,IndexDatatype:()=>je,InfoBox:()=>X8,InfoBoxViewModel:()=>Y8,InspectorShared:()=>Af,InstanceAttributeSemantic:()=>Lo,InstancingPipelineStage:()=>DL,InterpolationAlgorithm:()=>Hce,InterpolationType:()=>cm,Intersect:()=>$t,IntersectionTests:()=>yi,Intersections2D:()=>ep,Interval:()=>zs,InvertClassification:()=>Ow,Ion:()=>Nu,IonGeocodeProviderType:()=>Ty,IonGeocoderService:()=>XC,IonImageryProvider:()=>eu,IonImageryProviderFactory:()=>zS,IonResource:()=>jo,IonSnapGeometryType:()=>qce,IonSnapHeat:()=>Yce,IonSnapMode:()=>h8,IonSnapParentGeometryType:()=>Xce,IonSnapService:()=>Kce,IonWorldImageryStyle:()=>Wg,Iso8601:()=>nt,JobScheduler:()=>$U,JobType:()=>Oc,JsonMetadataTable:()=>Fg,JulianDate:()=>K,KTX2Transcoder:()=>wD,KeyboardEventModifier:()=>Zr,KeyframeNode:()=>Hr,KmlCamera:()=>jU,KmlDataSource:()=>YE,KmlLookAt:()=>HU,KmlTour:()=>GU,KmlTourFlyTo:()=>WU,KmlTourWait:()=>qU,Label:()=>vA,LabelCollection:()=>i0,LabelGraphics:()=>Gm,LabelStyle:()=>yo,LabelVisualizer:()=>H4,LagrangePolynomialApproximation:()=>r4,LeapSecond:()=>yr,Light:()=>Ooe,LightingModel:()=>e0,LightingPipelineStage:()=>yF,LinearApproximation:()=>sb,LinearSpline:()=>gA,MVTDataProvider:()=>koe,ManagedArray:()=>ru,MapMode2D:()=>Xl,MapProjection:()=>Jce,MapboxImageryProvider:()=>oF,MapboxStyleImageryProvider:()=>Moe,MappedPositions:()=>mF,Material:()=>rr,MaterialAppearance:()=>Cr,MaterialPipelineStage:()=>TF,MaterialProperty:()=>Co,Math:()=>D,Matrix2:()=>Xi,Matrix3:()=>$,Matrix4:()=>N,Megatexture:()=>QU,MeshPrimitiveGpmLocal:()=>jN,MetadataClass:()=>rm,MetadataClassProperty:()=>qp,MetadataComponentType:()=>Lt,MetadataEntity:()=>Yn,MetadataEnum:()=>dN,MetadataEnumValue:()=>fN,MetadataPicking:()=>ez,MetadataPickingPipelineStage:()=>Vf,MetadataPipelineStage:()=>qd,MetadataSchema:()=>Kl,MetadataSchemaLoader:()=>cA,MetadataSemantic:()=>zd,MetadataTable:()=>Bd,MetadataTableProperty:()=>$M,MetadataType:()=>bt,MipmapHint:()=>vd,Model:()=>jf,Model3DTileContent:()=>Hf,ModelAlphaOptions:()=>lT,ModelAnimation:()=>rL,ModelAnimationChannel:()=>iL,ModelAnimationCollection:()=>oL,ModelAnimationLoop:()=>Hu,ModelAnimationState:()=>dm,ModelArticulation:()=>pL,ModelArticulationStage:()=>mL,ModelClippingPlanesPipelineStage:()=>yL,ModelClippingPolygonsPipelineStage:()=>xL,ModelColorPipelineStage:()=>yA,ModelComponents:()=>Tn,ModelDrawCommand:()=>JF,ModelDrawCommands:()=>eB,ModelFeature:()=>sL,ModelFeatureTable:()=>aL,ModelGraphics:()=>V_,ModelImagery:()=>aB,ModelImageryMapping:()=>sT,ModelLightingOptions:()=>YF,ModelMatrixUpdateStage:()=>RL,ModelNode:()=>vL,ModelPrimitiveImagery:()=>aT,ModelReader:()=>xa,ModelRenderResources:()=>zF,ModelRuntimeNode:()=>ML,ModelRuntimePrimitive:()=>kF,ModelSceneGraph:()=>tB,ModelSilhouettePipelineStage:()=>HF,ModelSkin:()=>UF,ModelSplitterPipelineStage:()=>WF,ModelStatistics:()=>nB,ModelType:()=>Wo,ModelUtility:()=>xt,ModelVectorLookupPipelineStage:()=>CL,ModelVisualizer:()=>W4,Moon:()=>sz,MorphTargetsPipelineStage:()=>CF,MorphWeightSpline:()=>Zce,MortonOrder:()=>FA,MouseButton:()=>ec,Multiple3DTileContent:()=>d2,MultisampleFramebuffer:()=>ID,NavigationHelpButton:()=>q8,NavigationHelpButtonViewModel:()=>W8,NearFarScalar:()=>qt,NeverTileDiscardPolicy:()=>zoe,NodeRenderResources:()=>qF,NodeStatisticsPipelineStage:()=>OL,NodeTransformationProperty:()=>zE,OIT:()=>lz,Occluder:()=>Jz,OffsetGeometryInstanceAttribute:()=>Er,OpenCageGeocoderService:()=>ele,OpenStreetMapImageryProvider:()=>$_,OrderedGroundPrimitiveCollection:()=>uz,OrientedBoundingBox:()=>en,OrthographicFrustum:()=>mn,OrthographicOffCenterFrustum:()=>bs,Packable:()=>tle,PackableForInterpolation:()=>nle,Panorama:()=>Goe,PanoramaProvider:()=>Woe,Particle:()=>PI,ParticleBurst:()=>Yoe,ParticleEmitter:()=>Xoe,ParticleSystem:()=>Koe,Pass:()=>Ie,PassState:()=>Tc,PathGraphics:()=>j_,PathMode:()=>j0,PathVisualizer:()=>K4,PeliasGeocoderService:()=>d8,PerInstanceColorAppearance:()=>yn,PerformanceDisplay:()=>J_,PerformanceWatchdog:()=>Z8,PerformanceWatchdogViewModel:()=>J8,PerspectiveFrustum:()=>Ki,PerspectiveOffCenterFrustum:()=>Yl,PickDepth:()=>dz,PickDepthFramebuffer:()=>mz,PickFramebuffer:()=>_z,PickId:()=>eV,PickedMetadataInfo:()=>pz,Picking:()=>Sz,PickingPipelineStage:()=>vF,PinBuilder:()=>w_,PixelDatatype:()=>ze,PixelFormat:()=>Ke,PlanarFillIdFramebuffer:()=>yz,Plane:()=>sn,PlaneGeometry:()=>_4,PlaneGeometryUpdater:()=>A4,PlaneGraphics:()=>DU,PlaneOutlineGeometry:()=>y4,PntsLoader:()=>rB,PntsParser:()=>fT,PointCloud:()=>Iz,PointCloudEyeDomeLighting:()=>kg,PointCloudShading:()=>Zp,PointCloudStylingPipelineStage:()=>wF,PointGraphics:()=>jE,PointPrimitive:()=>Pa,PointPrimitiveCollection:()=>EI,PointVisualizer:()=>J4,PolygonGeometry:()=>Jp,PolygonGeometryLibrary:()=>ti,PolygonGeometryUpdater:()=>E4,PolygonGraphics:()=>Wm,PolygonHierarchy:()=>Mc,PolygonOutlineGeometry:()=>T4,PolygonPipeline:()=>ui,Polyline:()=>Kd,PolylineArrowMaterialProperty:()=>cP,PolylineCollection:()=>Am,PolylineColorAppearance:()=>Ys,PolylineDashMaterialProperty:()=>uP,PolylineGeometry:()=>__,PolylineGeometryUpdater:()=>Q4,PolylineGlowMaterialProperty:()=>dP,PolylineGraphics:()=>Cl,PolylineMaterialAppearance:()=>gc,PolylineOutlineMaterialProperty:()=>Db,PolylinePipeline:()=>or,PolylineVisualizer:()=>t8,PolylineVolumeGeometry:()=>S4,PolylineVolumeGeometryLibrary:()=>rp,PolylineVolumeGeometryUpdater:()=>D4,PolylineVolumeGraphics:()=>HE,PolylineVolumeOutlineGeometry:()=>P4,PositionProperty:()=>Hm,PositionPropertyArray:()=>W_,PostProcessStage:()=>Ur,PostProcessStageCollection:()=>$z,PostProcessStageComposite:()=>uf,PostProcessStageLibrary:()=>ud,PostProcessStageSampleMode:()=>ld,PostProcessStageTextureCache:()=>iC,PpeMetadata:()=>VN,PpeSource:()=>wle,PpeTexture:()=>zN,Primitive:()=>Mn,PrimitiveCollection:()=>wl,PrimitiveLoadPlan:()=>Qx,PrimitiveOutlineGenerator:()=>Zx,PrimitiveOutlinePipelineStage:()=>DF,PrimitivePipeline:()=>ST,PrimitiveRenderResources:()=>XF,PrimitiveState:()=>ss,PrimitiveStatisticsPipelineStage:()=>RF,PrimitiveType:()=>Oe,ProjectionPicker:()=>nj,ProjectionPickerViewModel:()=>tj,Property:()=>X,PropertyArray:()=>mP,PropertyAttribute:()=>$x,PropertyAttributeProperty:()=>PN,PropertyBag:()=>fu,PropertyTable:()=>Zl,PropertyTexture:()=>Bg,PropertyTextureProperty:()=>IN,ProviderViewModel:()=>uo,Proxy:()=>rle,QuadraticRealPolynomial:()=>ql,QuadtreeOccluders:()=>Qk,QuadtreePrimitive:()=>o3,QuadtreeTile:()=>e3,QuadtreeTileLoadState:()=>$a,QuadtreeTileProvider:()=>gse,QuantizedMeshTerrainData:()=>mC,QuarticRealPolynomial:()=>LM,Quaternion:()=>Le,QuaternionSpline:()=>nL,Queue:()=>fA,Ray:()=>pn,Rectangle:()=>ie,RectangleCollisionChecker:()=>VC,RectangleGeometry:()=>MC,RectangleGeometryLibrary:()=>Sa,RectangleGeometryUpdater:()=>R4,RectangleGraphics:()=>qm,RectangleOutlineGeometry:()=>CT,ReferenceFrame:()=>Gi,ReferenceProperty:()=>q_,RenderState:()=>Ge,Renderbuffer:()=>wf,RenderbufferFormat:()=>zl,Request:()=>wo,RequestErrorEvent:()=>Ip,RequestScheduler:()=>Kc,RequestState:()=>Ti,RequestType:()=>Zs,Resource:()=>De,ResourceCache:()=>Fi,ResourceCacheKey:()=>$l,ResourceCacheStatistics:()=>pN,ResourceLoader:()=>er,ResourceLoaderState:()=>Tt,Rotation:()=>wh,RuntimeError:()=>oe,S2Cell:()=>Ig,SDFSettings:()=>ka,SampledPositionProperty:()=>Ac,SampledProperty:()=>od,Sampler:()=>jt,ScaledPositionProperty:()=>L0,Scene:()=>EV,SceneFramebuffer:()=>ZE,SceneMode:()=>re,SceneMode2DPipelineStage:()=>OF,SceneModePicker:()=>ej,SceneModePickerViewModel:()=>Q8,SceneTransforms:()=>fr,SceneTransitioner:()=>sV,ScreenSpaceCameraController:()=>lV,ScreenSpaceElevatorCameraController:()=>y8,ScreenSpaceEventHandler:()=>ia,ScreenSpaceEventType:()=>ln,ScreenSpaceInputBindings:()=>yp,ScreenSpaceMapCameraController:()=>A8,ScreenSpaceTiltOrbitCameraController:()=>Tle,ScreenSpaceZoomCameraController:()=>Cle,SelectedFeatureIdPipelineStage:()=>xA,SelectionIndicator:()=>oj,SelectionIndicatorViewModel:()=>rj,SensorVolumePortionToDisplay:()=>NI,ShaderBuilder:()=>Cg,ShaderCache:()=>tV,ShaderDestination:()=>de,ShaderFunction:()=>pM,ShaderProgram:()=>Qt,ShaderSource:()=>Ye,ShaderStruct:()=>mM,ShadowMap:()=>Q_,ShadowMapShader:()=>Jm,ShadowMode:()=>Pn,ShadowVolumeAppearance:()=>Xf,SharedContext:()=>uV,ShowGeometryInstanceAttribute:()=>Dn,Simon1994PlanetaryPositions:()=>pb,SimplePolylineGeometry:()=>ole,SingleTileImageryProvider:()=>sF,SkinningPipelineStage:()=>NF,SkyAtmosphere:()=>SV,SkyBox:()=>wV,SnapFramebuffer:()=>dV,SnapService:()=>sle,Snapping:()=>mV,SpatialNode:()=>bV,Spdcf:()=>kN,SpecularEnvironmentCubeMap:()=>um,SphereEmitter:()=>Qse,SphereGeometry:()=>Dk,SphereOutlineGeometry:()=>l_,Spherical:()=>o4,Spline:()=>Rr,SplitDirection:()=>Ho,Splitter:()=>RI,StaticGeometryColorBatch:()=>Ph,StaticGeometryPerMaterialBatch:()=>Dh,StaticGroundGeometryColorBatch:()=>BP,StaticGroundGeometryPerMaterialBatch:()=>V4,StaticGroundPolylinePerMaterialBatch:()=>e8,StaticOutlineGeometryBatch:()=>zP,StencilConstants:()=>Yt,StencilFunction:()=>Zn,StencilOperation:()=>Rt,SteppedSpline:()=>tL,Stereographic:()=>ul,StorageType:()=>mA,StripeMaterialProperty:()=>gP,StripeOrientation:()=>ap,StructuralMetadata:()=>Ha,StyleCommandsNeeded:()=>hm,StyleExpression:()=>eae,Sun:()=>NV,SunLight:()=>iy,SunPostProcess:()=>_V,SupportedImageFormats:()=>NN,SvgPathBindingHandler:()=>T8,Sync:()=>gz,TaskProcessor:()=>Kn,Terrain:()=>kV,TerrainData:()=>tf,TerrainEncoding:()=>To,TerrainFillMesh:()=>Sw,TerrainMesh:()=>mc,TerrainOffsetProperty:()=>xC,TerrainPicker:()=>Wk,TerrainProvider:()=>Xr,TerrainQuantization:()=>Ka,TerrainState:()=>kr,Texture:()=>Dt,Texture3D:()=>ZU,TextureAtlas:()=>Ax,TextureCache:()=>nV,TextureMagnificationFilter:()=>$n,TextureManager:()=>uM,TextureMinificationFilter:()=>Wt,TexturePacker:()=>Dv,TextureUniform:()=>dM,TextureWrap:()=>hn,TileAvailability:()=>tp,TileBoundingRegion:()=>Wf,TileBoundingS2Cell:()=>E2,TileBoundingSphere:()=>u_,TileBoundingVolume:()=>aae,TileCoordinatesImageryProvider:()=>zV,TileDiscardPolicy:()=>lae,TileEdge:()=>wn,TileImagery:()=>HS,TileMapServiceImageryProvider:()=>TA,TileMetadata:()=>u2,TileOrientedBoundingBox:()=>$u,TileProviderError:()=>Jr,TileReplacementQueue:()=>t3,TileSelectionResult:()=>pi,TileState:()=>uae,Tileset3DTileContent:()=>uB,TilesetMetadata:()=>v2,TilesetPipelineStage:()=>cL,TilingScheme:()=>cle,TimeConstants:()=>kn,TimeDynamicImagery:()=>oT,TimeDynamicPointCloud:()=>GI,TimeInterval:()=>Cn,TimeIntervalCollection:()=>Rs,TimeIntervalCollectionPositionProperty:()=>my,TimeIntervalCollectionProperty:()=>Y_,TimeStandard:()=>si,Timeline:()=>cj,TimelineHighlightRange:()=>sj,TimelineTrack:()=>aj,Tipsify:()=>gN,ToggleButtonViewModel:()=>Wb,Tonemapper:()=>ny,TrackingReferenceFrame:()=>U_,Transforms:()=>At,TranslationRotationScale:()=>AA,TranslucentTileClassification:()=>bz,TridiagonalSystemSolver:()=>IS,TrustedServers:()=>dv,TweenCollection:()=>lC,UniformState:()=>iV,UniformType:()=>Up,UrlTemplate3DTilesDataProvider:()=>az,UrlTemplateImageryProvider:()=>_s,VERSION:()=>P9t,VRButton:()=>fj,VRButtonViewModel:()=>uj,VRTheWorldTerrainProvider:()=>ule,VaryingType:()=>vle,Vector3DTileBatch:()=>Wp,Vector3DTileClampedPolylines:()=>$B,Vector3DTileContent:()=>ZB,Vector3DTileGeometry:()=>wg,Vector3DTilePoints:()=>VB,Vector3DTilePolygons:()=>jB,Vector3DTilePolylines:()=>_T,Vector3DTilePrimitive:()=>Nx,VectorGltf3DTileContent:()=>DA,VectorPipeline:()=>Ss,VectorProvider:()=>e_,VelocityOrientationProperty:()=>a4,VelocityVectorProperty:()=>py,VertexArray:()=>zn,VertexArrayFacade:()=>Ag,VertexAttributeSemantic:()=>ct,VertexFormat:()=>Be,VerticalExaggeration:()=>Ar,VerticalExaggerationPipelineStage:()=>FF,VerticalOrigin:()=>Hn,VideoSynchronizer:()=>lle,View:()=>eC,Viewer:()=>Yle,ViewportQuad:()=>hae,Visibility:()=>Ko,Visualizer:()=>yce,VoxelBoundsCollection:()=>Eg,VoxelBoxShape:()=>FT,VoxelCell:()=>yV,VoxelContent:()=>LT,VoxelCylinderShape:()=>BT,VoxelEllipsoidShape:()=>kT,VoxelInspector:()=>hj,VoxelInspectorViewModel:()=>dj,VoxelMetadataOrder:()=>Vp,VoxelPrimitive:()=>xb,VoxelProvider:()=>pae,VoxelRenderResources:()=>DM,VoxelShape:()=>gae,VoxelShapeType:()=>hc,VoxelTraversal:()=>xV,VulkanConstants:()=>fle,WallGeometry:()=>M4,WallGeometryLibrary:()=>NC,WallGeometryUpdater:()=>F4,WallGraphics:()=>H_,WallOutlineGeometry:()=>L4,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>cF,WebMapTileServiceImageryProvider:()=>lF,WebMercatorProjection:()=>_i,WebMercatorTilingScheme:()=>Po,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>qS,WireframePipelineStage:()=>BF,_shadersAcesTonemappingStage:()=>Pz,_shadersAdditiveBlend:()=>pV,_shadersAdjustTranslucentFS:()=>II,_shadersAllMaterialAppearanceFS:()=>Rk,_shadersAllMaterialAppearanceVS:()=>Ok,_shadersAmbientOcclusionGenerate:()=>Dz,_shadersAmbientOcclusionModulate:()=>Rz,_shadersAspectRampMaterial:()=>gB,_shadersAtmosphereCommon:()=>am,_shadersAtmosphereStageFS:()=>lL,_shadersAtmosphereStageVS:()=>uL,_shadersBasicMaterialAppearanceFS:()=>Mk,_shadersBasicMaterialAppearanceVS:()=>Nk,_shadersBillboardCollectionFS:()=>RO,_shadersBillboardCollectionVS:()=>OO,_shadersBlackAndWhite:()=>Oz,_shadersBloomComposite:()=>Mz,_shadersBrdfLutGeneratorFS:()=>BO,_shadersBrightPass:()=>gV,_shadersBrightness:()=>Nz,_shadersBufferPointMaterialFS:()=>jO,_shadersBufferPointMaterialVS:()=>VO,_shadersBufferPolygonMaterialFS:()=>XO,_shadersBufferPolygonMaterialVS:()=>YO,_shadersBufferPolylineMaterialFS:()=>ZO,_shadersBufferPolylineMaterialVS:()=>JO,_shadersBumpMapMaterial:()=>_B,_shadersCPUStylingStageFS:()=>kL,_shadersCPUStylingStageVS:()=>BL,_shadersCheckerboardMaterial:()=>yB,_shadersCloudCollectionFS:()=>K2,_shadersCloudCollectionVS:()=>$2,_shadersCloudNoiseFS:()=>J2,_shadersCloudNoiseVS:()=>Z2,_shadersCompareAndPackTranslucentDepth:()=>Az,_shadersCompositeOITFS:()=>cz,_shadersCompositeTranslucentClassification:()=>QE,_shadersComputeIrradianceFS:()=>EN,_shadersComputeRadianceMapFS:()=>CN,_shadersConstantLodStageFS:()=>xF,_shadersConstantLodStageVS:()=>bF,_shadersContrastBias:()=>Lz,_shadersConvolveSpecularMapFS:()=>vN,_shadersConvolveSpecularMapVS:()=>SN,_shadersCubeMapPanoramaVS:()=>ak,_shadersCustomShaderStageFS:()=>VL,_shadersCustomShaderStageVS:()=>zL,_shadersCzmBuiltins:()=>px,_shadersDepthOfField:()=>Fz,_shadersDepthPlaneFS:()=>bk,_shadersDepthPlaneVS:()=>xk,_shadersDepthView:()=>Bz,_shadersDepthViewPacked:()=>Sle,_shadersDotMaterial:()=>AB,_shadersEdgeDetection:()=>kz,_shadersEdgeDetectionStageFS:()=>KL,_shadersEdgeVisibilityStageFS:()=>JL,_shadersEdgeVisibilityStageVS:()=>ZL,_shadersElevationBandMaterial:()=>bB,_shadersElevationContourMaterial:()=>xB,_shadersElevationRampMaterial:()=>TB,_shadersEllipsoidFS:()=>yw,_shadersEllipsoidSurfaceAppearanceFS:()=>Ik,_shadersEllipsoidSurfaceAppearanceVS:()=>Pk,_shadersEllipsoidVS:()=>Aw,_shadersFXAA:()=>Vz,_shadersFXAA3_11:()=>Yz,_shadersFadeMaterial:()=>EB,_shadersFeatureIdStageFS:()=>jL,_shadersFeatureIdStageVS:()=>HL,_shadersFilmicTonemapping:()=>Uz,_shadersGaussianBlur1D:()=>Ab,_shadersGeometryStageFS:()=>eF,_shadersGeometryStageVS:()=>tF,_shadersGlobeFS:()=>Yk,_shadersGlobeVS:()=>Xk,_shadersGridMaterial:()=>CB,_shadersGroundAtmosphere:()=>Ew,_shadersHSBToRGB:()=>ER,_shadersHSLToRGB:()=>CR,_shadersImageBasedLightingStageFS:()=>dL,_shadersInstancingStageCommon:()=>SL,_shadersInstancingStageVS:()=>wL,_shadersIntersectBox:()=>TM,_shadersIntersectCylinder:()=>EM,_shadersIntersectDepth:()=>bM,_shadersIntersectEllipsoid:()=>CM,_shadersIntersectLongitude:()=>zv,_shadersIntersectPlane:()=>xM,_shadersIntersection:()=>wx,_shadersIntersectionUtils:()=>AM,_shadersLegacyInstancingStageVS:()=>IL,_shadersLensFlare:()=>jz,_shadersLightingStageFS:()=>_F,_shadersMaterialStageFS:()=>AF,_shadersMegatexture:()=>PM,_shadersMetadataStageFS:()=>GL,_shadersMetadataStageVS:()=>WL,_shadersModelClippingPlanesStageFS:()=>_L,_shadersModelClippingPolygonsStageFS:()=>AL,_shadersModelClippingPolygonsStageVS:()=>bL,_shadersModelColorStageFS:()=>gL,_shadersModelFS:()=>QF,_shadersModelSilhouetteStageFS:()=>VF,_shadersModelSilhouetteStageVS:()=>jF,_shadersModelSplitterStageFS:()=>GF,_shadersModelVS:()=>ZF,_shadersModelVectorLookupStageFS:()=>EL,_shadersModelVectorLookupStageVS:()=>TL,_shadersModifiedReinhardTonemapping:()=>Hz,_shadersMorphTargetsStageVS:()=>EF,_shadersNightVision:()=>Gz,_shadersNormalMapMaterial:()=>vB,_shadersOctree:()=>IM,_shadersPassThrough:()=>nf,_shadersPassThroughDepth:()=>HA,_shadersPbrNeutralTonemapping:()=>zz,_shadersPerInstanceColorAppearanceFS:()=>m2,_shadersPerInstanceColorAppearanceVS:()=>p2,_shadersPerInstanceFlatColorAppearanceFS:()=>vT,_shadersPerInstanceFlatColorAppearanceVS:()=>g2,_shadersPointCloudEyeDomeLighting:()=>YN,_shadersPointCloudStylingStageVS:()=>SF,_shadersPointPrimitiveCollectionFS:()=>ob,_shadersPointPrimitiveCollectionVS:()=>BU,_shadersPolylineArrowMaterial:()=>SB,_shadersPolylineColorAppearanceVS:()=>gk,_shadersPolylineCommon:()=>Gl,_shadersPolylineDashMaterial:()=>wB,_shadersPolylineFS:()=>gT,_shadersPolylineGlowMaterial:()=>IB,_shadersPolylineMaterialAppearanceVS:()=>y3,_shadersPolylineOutlineMaterial:()=>PB,_shadersPolylineShadowVolumeFS:()=>m3,_shadersPolylineShadowVolumeMorphFS:()=>p3,_shadersPolylineShadowVolumeMorphVS:()=>g3,_shadersPolylineShadowVolumeVS:()=>_3,_shadersPolylineVS:()=>pB,_shadersPrimitiveGaussianSplatFS:()=>o2,_shadersPrimitiveGaussianSplatVS:()=>r2,_shadersPrimitiveOutlineStageFS:()=>PF,_shadersPrimitiveOutlineStageVS:()=>IF,_shadersRGBToHSB:()=>$R,_shadersRGBToHSL:()=>JR,_shadersRGBToXYZ:()=>ZR,_shadersReinhardTonemapping:()=>Wz,_shadersReprojectWebMercatorFS:()=>fF,_shadersReprojectWebMercatorVS:()=>dF,_shadersRimLightingMaterial:()=>DB,_shadersSelectedFeatureIdStageCommon:()=>BS,_shadersShadowVolumeAppearanceFS:()=>uw,_shadersShadowVolumeAppearanceVS:()=>X2,_shadersShadowVolumeFS:()=>Jy,_shadersSilhouette:()=>qz,_shadersSkinningStageVS:()=>MF,_shadersSkyAtmosphereCommon:()=>LI,_shadersSkyAtmosphereFS:()=>CV,_shadersSkyAtmosphereVS:()=>vV,_shadersSkyBoxFS:()=>ok,_shadersSkyBoxVS:()=>sk,_shadersSlopeRampMaterial:()=>RB,_shadersStripeMaterial:()=>OB,_shadersSunFS:()=>PV,_shadersSunTextureFS:()=>DV,_shadersSunVS:()=>RV,_shadersTexturedMaterialAppearanceFS:()=>Lk,_shadersTexturedMaterialAppearanceVS:()=>Fk,_shadersVector3DTileClampedPolylinesFS:()=>XB,_shadersVector3DTileClampedPolylinesVS:()=>YB,_shadersVector3DTilePolylinesVS:()=>HB,_shadersVectorCommon:()=>Hg,_shadersVectorTileVS:()=>Wv,_shadersVerticalExaggerationStageVS:()=>LF,_shadersViewportQuadFS:()=>VV,_shadersViewportQuadVS:()=>oC,_shadersVoxelFS:()=>_M,_shadersVoxelUtils:()=>gM,_shadersVoxelVS:()=>yM,_shadersWater:()=>NB,_shadersWaterMaskMaterial:()=>MB,_shadersXYZToRGB:()=>TO,_shadersacesTonemapping:()=>U1,_shadersalphaWeight:()=>z1,_shadersantialias:()=>V1,_shadersapplyHSBShift:()=>j1,_shadersapproximateSphericalCoordinates:()=>H1,_shadersapproximateTanh:()=>G1,_shadersbackFacing:()=>W1,_shadersbranchFreeTernary:()=>q1,_shaderscascadeColor:()=>Y1,_shaderscascadeDistance:()=>X1,_shaderscascadeMatrix:()=>K1,_shaderscascadeWeights:()=>$1,_shaderscolumbusViewMorph:()=>J1,_shaderscomputeAtmosphereColor:()=>Z1,_shaderscomputeGroundAtmosphereScattering:()=>Q1,_shaderscomputePosition:()=>eR,_shaderscomputeScattering:()=>tR,_shaderscomputeTextureTransform:()=>nR,_shadersconvertLocalToBoxUv:()=>vM,_shadersconvertLocalToCylinderUv:()=>SM,_shadersconvertLocalToEllipsoidUv:()=>wM,_shaderscosineAndSine:()=>iR,_shadersdecodeRGB8:()=>rR,_shadersdecompressTextureCoordinates:()=>oR,_shadersdegreesPerRadian:()=>HD,_shadersdepthClamp:()=>sR,_shadersdepthRange:()=>GD,_shadersdepthRangeStruct:()=>R1,_shaderseastNorthUpToEyeCoordinates:()=>aR,_shadersellipsoidContainsPoint:()=>cR,_shadersellipsoidTextureCoordinates:()=>lR,_shadersepsilon1:()=>WD,_shadersepsilon2:()=>qD,_shadersepsilon3:()=>YD,_shadersepsilon4:()=>XD,_shadersepsilon5:()=>KD,_shadersepsilon6:()=>$D,_shadersepsilon7:()=>JD,_shadersequalsEpsilon:()=>uR,_shaderseyeOffset:()=>fR,_shaderseyeToCartographicDelta:()=>dR,_shaderseyeToWindowCoordinates:()=>hR,_shadersfastApproximateAtan:()=>mR,_shadersfog:()=>pR,_shadersgammaCorrect:()=>gR,_shadersgeodeticSurfaceNormal:()=>_R,_shadersgetDefaultMaterial:()=>yR,_shadersgetDynamicAtmosphereLightDirection:()=>AR,_shadersgetLambertDiffuse:()=>bR,_shadersgetSpecular:()=>xR,_shadersgetWaterNoise:()=>TR,_shadershue:()=>vR,_shadersinfinity:()=>ZD,_shadersinverseGamma:()=>SR,_shadersisEmpty:()=>wR,_shadersisFull:()=>IR,_shaderslatitudeToWebMercatorFraction:()=>PR,_shaderslineDistance:()=>RR,_shaderslinearToSrgb:()=>DR,_shadersluminance:()=>OR,_shadersmaterial:()=>O1,_shadersmaterialInput:()=>M1,_shadersmaximumComponent:()=>MR,_shadersmetersPerPixel:()=>NR,_shadersmodelMaterial:()=>N1,_shadersmodelToWindowCoordinates:()=>LR,_shadersmodelVertexOutput:()=>L1,_shadersmultiplyWithColorBalance:()=>FR,_shadersnearFarScalar:()=>BR,_shadersoctDecode:()=>kR,_shadersoneOverPi:()=>QD,_shadersoneOverTwoPi:()=>e1,_shaderspackDepth:()=>UR,_shaderspassCesium3DTile:()=>t1,_shaderspassCesium3DTileClassification:()=>n1,_shaderspassCesium3DTileClassificationIgnoreShow:()=>i1,_shaderspassCesium3DTileEdges:()=>r1,_shaderspassCesium3DTileEdgesDirect:()=>o1,_shaderspassCesium3DTilePlanarFillId:()=>s1,_shaderspassClassification:()=>a1,_shaderspassCompute:()=>c1,_shaderspassEnvironment:()=>l1,_shaderspassGaussianSplats:()=>u1,_shaderspassGlobe:()=>f1,_shaderspassOpaque:()=>d1,_shaderspassOverlay:()=>h1,_shaderspassTerrainClassification:()=>m1,_shaderspassTranslucent:()=>p1,_shaderspassVoxels:()=>g1,_shaderspbrLighting:()=>zR,_shaderspbrNeutralTonemapping:()=>VR,_shadersphong:()=>jR,_shaderspi:()=>_1,_shaderspiOverFour:()=>y1,_shaderspiOverSix:()=>A1,_shaderspiOverThree:()=>b1,_shaderspiOverTwo:()=>x1,_shadersplaneDistance:()=>HR,_shaderspointAlongRay:()=>GR,_shadersradiansPerDegree:()=>T1,_shadersray:()=>F1,_shadersrayEllipsoidIntersectionInterval:()=>WR,_shadersraySegment:()=>B1,_shadersraySphereIntersectionInterval:()=>qR,_shadersreadDepth:()=>YR,_shadersreadNonPerspective:()=>XR,_shadersreverseLogDepth:()=>KR,_shadersround:()=>QR,_shaderssaturation:()=>eO,_shaderssceneMode2D:()=>E1,_shaderssceneMode3D:()=>C1,_shaderssceneModeColumbusView:()=>v1,_shaderssceneModeMorphing:()=>S1,_shadersshadowDepthCompare:()=>tO,_shadersshadowParameters:()=>k1,_shadersshadowVisibility:()=>nO,_shaderssignNotZero:()=>iO,_shaderssolarRadius:()=>w1,_shaderssphericalHarmonics:()=>rO,_shaderssrgbToLinear:()=>oO,_shaderstangentToEyeSpaceMatrix:()=>sO,_shaderstextureCube:()=>aO,_shadersthreePiOver2:()=>I1,_shaderstransformPlane:()=>cO,_shaderstranslateRelativeToEye:()=>lO,_shaderstranslucentPhong:()=>uO,_shaderstranspose:()=>fO,_shaderstwoPi:()=>P1,_shadersunpackDepth:()=>dO,_shadersunpackFloat:()=>hO,_shadersunpackTexture:()=>mO,_shadersunpackUint:()=>pO,_shadersvalueTransform:()=>gO,_shadersvertexLogDepth:()=>_O,_shaderswebMercatorMaxLatitude:()=>D1,_shaderswindowToEyeCoordinates:()=>yO,_shaderswriteDepthClamp:()=>AO,_shaderswriteLogDepth:()=>bO,_shaderswriteNonPerspective:()=>xO,addAllToArray:()=>Qn,addBuffer:()=>oN,addDefaults:()=>ZM,addExtensionsRequired:()=>nN,addExtensionsUsed:()=>kd,addPipelineExtras:()=>oA,addToArray:()=>ba,appendForwardSlash:()=>uD,arrayRemoveDuplicates:()=>Br,assert:()=>jX,barycentricCoordinates:()=>Gx,binarySearch:()=>wr,buildModuleUrl:()=>Zt,buildVectorGltfFromMVT:()=>aM,buildVoxelCustomShader:()=>kv,buildVoxelDrawCommands:()=>RM,clone:()=>Je,combine:()=>Ot,computeFlyToLocationForRectangle:()=>jT,createBillboardPointCallback:()=>dT,createColorRamp:()=>cM,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>D8,createDefaultTerrainProviderViewModels:()=>R8,createElevationBandMaterial:()=>Bee,createGooglePhotorealistic3DTileset:()=>kee,createGuid:()=>Jn,createMaterialPropertyDescriptor:()=>lo,createOsmBuildingsAsync:()=>Uee,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>lu,createTangentSpaceDebugPrimitive:()=>zee,createTaskProcessorWorker:()=>Ile,createUniform:()=>PO,createUniformArray:()=>DO,createVectorTileBuffersFromModelComponents:()=>e2,createWorldBathymetryAsync:()=>BV,createWorldImageryAsync:()=>qg,createWorldTerrainAsync:()=>_C,decodeGoogleEarthEnterpriseData:()=>u3,decodeMVT:()=>Ak,decodeVectorPolylinePositions:()=>JB,defaultPickWorldPosition:()=>_p,defer:()=>Pu,defined:()=>l,demodernizeShader:()=>EO,deprecationWarning:()=>qr,destroyObject:()=>le,exportKml:()=>hce,findAccessorMinMax:()=>jx,findContentMetadata:()=>TT,findGroupMetadata:()=>ET,findMeshoptExtension:()=>iA,findTileMetadata:()=>f2,forEachTextureInMaterial:()=>eS,formatError:()=>kp,freezeRenderState:()=>XY,getAbsoluteUri:()=>Td,getAccessorByteStride:()=>Vu,getBaseUri:()=>fD,getBinaryAccessor:()=>wd,getClipAndStyleCode:()=>Vk,getClippingFunction:()=>ZT,getComponentReader:()=>Mg,getElement:()=>Ln,getExtensionFromUri:()=>ng,getFilenameFromUri:()=>S_,getImageFromTypedArray:()=>lM,getImagePixels:()=>zh,getJsonFromTypedArray:()=>Do,getMagic:()=>tm,getMeshPrimitives:()=>GN,getMetadataClassProperty:()=>jk,getMetadataProperty:()=>Hk,getStringFromTypedArray:()=>Lu,getTimestamp:()=>xn,hasExtension:()=>ir,heightReferenceOnEntityPropertyChanged:()=>ly,isBitSet:()=>_l,isBlobUri:()=>ix,isCrossOriginUrl:()=>Dy,isDataUri:()=>Vh,isLeapYear:()=>Bl,knockout:()=>ve,knockout_3_5_1:()=>$C,knockout_es5:()=>x8,loadAndExecuteScript:()=>rx,loadCubeMap:()=>rk,loadImageFromTypedArray:()=>Og,loadKTX2:()=>Ou,mergeSort:()=>f0,mostDetailedSurfaceHeight:()=>ip,moveTechniqueRenderStates:()=>tN,moveTechniquesToExtension:()=>iN,numberOfComponentsForType:()=>Ff,objectToQuery:()=>ox,oneTimeWarning:()=>_t,parseBatchTable:()=>Ug,parseFeatureMetadataLegacy:()=>ON,parseGlb:()=>Vx,parseResponseHeaders:()=>dD,parseStructuralMetadata:()=>RN,pickModel:()=>XS,pointInsideTriangle:()=>ile,positionForSurfaceHeight:()=>cy,preprocess3DTileContent:()=>r_,processVoxelProperties:()=>hM,queryToObject:()=>Cf,readAccessorPacked:()=>sN,removeExtension:()=>Hx,removeExtensionsRequired:()=>QM,removeExtensionsUsed:()=>zx,removePipelineExtras:()=>eN,removeUnusedElements:()=>rN,renderBufferPointCollection:()=>qO,renderBufferPolygonCollection:()=>$O,renderBufferPolylineCollection:()=>nM,resizeImageToNextPowerOfTwo:()=>qy,sampleTerrain:()=>Q2,sampleTerrainMostDetailed:()=>VT,scaleToGeodeticSurface:()=>ex,srgbToLinear:()=>aE,subdivideArray:()=>_2,subscribeAndEvaluate:()=>Cc,updateAccessorComponentTypes:()=>aN,updateVersion:()=>cN,usesExtension:()=>Go,viewerCesium3DTilesInspectorMixin:()=>Xle,viewerCesiumInspectorMixin:()=>Kle,viewerDragDropMixin:()=>Jle,viewerPerformanceWatchdogMixin:()=>Zle,viewerVoxelInspectorMixin:()=>eue,webGLConstantToGlslType:()=>dle,wrapFunction:()=>p8,writeTextToCanvas:()=>mT});module.exports=Fh(D9t);var nue={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(nue);var Sp=nue;function iue(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=iue(r,t)),n[i]=r}return n}var Je=iue;function O3e(e){return e!=null}var l=O3e;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;var Mq={};Mq.EMPTY_OBJECT=Object.freeze({});Mq.EMPTY_ARRAY=Object.freeze([]);var H=Mq;var oue={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(oue);var te=oue;var sue={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(sue);var wc=sue;var aue={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(aue);var $r=aue;var cue={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:wc.ADD,equationAlpha:wc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:wc.ADD,equationAlpha:wc.ADD,functionSourceRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:wc.ADD,equationAlpha:wc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE,functionDestinationAlpha:$r.ONE})};Object.freeze(cue);var tn=cue;var lue={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(lue);var Ui=lue;function nv(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(nv.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}}});nv.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(` -`)};nv.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};nv.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};nv.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:Ui.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var vr=nv;var uue={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(uue);var Bh=uue;function Qb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Qb.prototype=Object.create(Error.prototype),Qb.prototype.constructor=Qb);Qb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};Qb.throwInstantiationError=function(){throw new Qb("This function defines an interface and should not be called directly.")};var pe=Qb;var ha={};ha.typeOf={};function M3e(e){return`${e} is required, actual value was undefined`}function iv(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(iv(typeof t,"function",e))};ha.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(iv(typeof t,"string",e))};ha.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(iv(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(iv(typeof t,"object",e))};ha.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(iv(typeof t,"boolean",e))};ha.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(iv(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 Nq=Qo(mj(),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 pj=[1];yt.factorial=function(e){let t=pj.length;if(e>=t){let n=pj[t-1];for(let i=t;i<=e;i++){let r=n*i;pj.push(r),n=r}}return pj[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 due=new Nq.default;yt.setRandomNumberSeed=function(e){due=new Nq.default(e)};yt.nextRandomNumber=function(){return due.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 ms=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,gj),e.magnitude(gj)}static distanceSquared(t,n){return e.subtract(t,n,gj),e.magnitudeSquared(gj)}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,N3e);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})`}};ms.fromCartesian3=ms.clone;ms.fromCartesian4=ms.clone;ms.packedLength=2;ms.fromArray=ms.unpack;var gj=new ms,hue=new ms,mue=new ms,pue=new ms,N3e=new ms;ms.ZERO=Object.freeze(new ms(0,0));ms.ONE=Object.freeze(new ms(1,1));ms.UNIT_X=Object.freeze(new ms(1,0));ms.UNIT_Y=Object.freeze(new ms(0,1));var U=ms;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,_j),e.magnitude(_j)}static distanceSquared(t,n){return e.subtract(t,n,_j),e.magnitudeSquared(_j)}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,gue),r=e.multiplyByScalar(t,1-i,r),e.add(gue,r,r)}static angleBetween(t,n){e.normalize(t,yj),e.normalize(n,Lq);let i=e.dot(yj,Lq),r=e.magnitude(e.cross(yj,Lq,yj));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,L3e);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);xd.x=a*Math.cos(t),xd.y=a*Math.sin(t),xd.z=Math.sin(n),xd=e.normalize(xd,xd),e.multiplyComponents(s,xd,rv);let c=Math.sqrt(e.dot(xd,rv));return rv=e.divideByScalar(rv,c,rv),xd=e.multiplyByScalar(xd,i,xd),l(o)||(o=new e),e.add(rv,xd,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 _j=new po,gue=new po,yj=new po,Lq=new po,L3e=new po,xd=new po,rv=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 F3e=new h,B3e=new h;function k3e(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,F3e);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=B3e;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 ex=k3e;var Ll=class Ll{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 Ll(t,n,i)}static fromDegrees(t,n,i,r){return t=D.toRadians(t),n=D.toRadians(n),Ll.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:Ll._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:Ll._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Ll._ellipsoidCenterToleranceSquared,a=ex(t,r,o,s,z3e);if(!l(a))return;let c=h.multiplyComponents(a,o,U3e);c=h.normalize(c,c);let u=h.subtract(t,a,V3e),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 Ll(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 Ll(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 Ll.clone(this,t)}equals(t){return Ll.equals(this,t)}equalsEpsilon(t,n){return Ll.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(Ll,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(Ll,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(Ll,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var rD=Ll;rD.ZERO=Object.freeze(new rD(0,0,0));var U3e=new h,z3e=new h,V3e=new h,he=rD;/*! @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 _ue(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 j3e(e){if(Array.isArray(e))return e}function H3e(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 G3e(){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 W3e(e,t){return j3e(e)||H3e(e,t)||q3e(e,t)||G3e()}function q3e(e,t){if(e){if(typeof e=="string")return _ue(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)?_ue(e,t):void 0}}var Oue=Object.entries,yue=Object.setPrototypeOf,Y3e=Object.isFrozen,X3e=Object.getPrototypeOf,K3e=Object.getOwnPropertyDescriptor,Na=Object.freeze,nc=Object.seal,ov=Object.create,Mue=typeof Reflect<"u"&&Reflect,jq=Mue.apply,Hq=Mue.construct;Na||(Na=function(t){return t});nc||(nc=function(t){return t});jq||(jq=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)});Hq||(Hq=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 nx=ma(Array.prototype.forEach),$3e=ma(Array.prototype.lastIndexOf),Aue=ma(Array.prototype.pop),oD=ma(Array.prototype.push),J3e=ma(Array.prototype.splice),sv=Array.isArray,cD=ma(String.prototype.toLowerCase),Fq=ma(String.prototype.toString),bue=ma(String.prototype.match),sD=ma(String.prototype.replace),xue=ma(String.prototype.indexOf),Z3e=ma(String.prototype.trim),Q3e=ma(Number.prototype.toString),eUe=ma(Boolean.prototype.toString),Tue=typeof BigInt>"u"?null:ma(BigInt.prototype.toString),Eue=typeof Symbol>"u"?null:ma(Symbol.prototype.toString),Iu=ma(Object.prototype.hasOwnProperty),aD=ma(Object.prototype.toString),qc=ma(RegExp.prototype.test),tx=tUe(TypeError);function ma(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 jq(e,t,i)}}function tUe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Hq(e,n)}}function Sr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cD;if(yue&&yue(e,null),!sv(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(Y3e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function nUe(e){for(let t=0;t<e.length;t++)Iu(e,t)||(e[t]=null);return e}function Tf(e){let t=ov(null);for(let i of Oue(e)){var n=W3e(i,2);let r=n[0],o=n[1];Iu(e,r)&&(sv(o)?t[r]=nUe(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=Tf(o):t[r]=o)}return t}function iUe(e){switch(typeof e){case"string":return e;case"number":return Q3e(e);case"boolean":return eUe(e);case"bigint":return Tue?Tue(e):"0";case"symbol":return Eue?Eue(e):"Symbol()";case"undefined":return aD(e);case"function":case"object":{if(e===null)return aD(e);let t=e,n=kh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:aD(i)}return aD(e)}default:return aD(e)}}function kh(e,t){for(;e!==null;){let i=K3e(e,t);if(i){if(i.get)return ma(i.get);if(typeof i.value=="function")return ma(i.value)}e=X3e(e)}function n(){return null}return n}function rUe(e){try{return qc(e,""),!0}catch{return!1}}var Cue=Na(["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"]),Bq=Na(["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"]),kq=Na(["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"]),oUe=Na(["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"]),Uq=Na(["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"]),sUe=Na(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vue=Na(["#text"]),Sue=Na(["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"]),zq=Na(["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"]),wue=Na(["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"]),Aj=Na(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),aUe=nc(/{{[\w\W]*|^[\w\W]*}}/g),cUe=nc(/<%[\w\W]*|^[\w\W]*%>/g),lUe=nc(/\${[\w\W]*/g),uUe=nc(/^data-[\-\w.\u00B7-\uFFFF]+$/),fUe=nc(/^aria-[\-\w]+$/),Iue=nc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dUe=nc(/^(?:\w+script|data):/i),hUe=nc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mUe=nc(/^html$/i),pUe=nc(/^[a-z][.\w]*(-[.\w]+)+$/i),Pue=nc(/<[/\w!]/g),Due=nc(/<[/\w]/g),gUe=nc(/<\/no(script|embed|frames)/i),_Ue=nc(/\/>/i),xf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Nue=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],yUe=Na(Sr({},Nue)),AUe=(function(){let e={};return nx(Nue,t=>{e[t]=nc(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Na(e)})(),bUe=function(){return typeof window>"u"?null:window},xUe=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}},Rue=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sy=function(t,n,i,r){return Iu(t,n)&&sv(t[n])?Sr(r.base?Tf(r.base):{},t[n],r.transform):i},Vq=function(t,n,i){let r=Iu(t,n)?t[n]:void 0;return r&&typeof r=="object"?Tf(r):i()};function Lue(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bUe(),t=Ct=>Lue(Ct);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==xf.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=kh(p,"cloneNode"),m=kh(p,"remove"),y=kh(p,"nextSibling"),A=kh(p,"childNodes"),b=kh(p,"parentNode"),x=kh(p,"shadowRoot"),T=kh(p,"attributes"),E=s&&s.prototype?kh(s.prototype,"nodeType"):null,v=s&&s.prototype?kh(s.prototype,"nodeName"):null,S=s&&s.prototype?kh(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||(_=xUe(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=Rue();t.isSupported=typeof Oue=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=aUe,Z=cUe,ae=lUe,Ae=uUe,fe=fUe,xe=dUe,ge=hUe,we=pUe,Se=Iue,Re=null,Qe=Sr({},[...Cue,...Bq,...kq,...Uq,...vue]),He=null,Xe=Sr({},[...Sue,...zq,...wue,...Aj]),$e=Object.seal(ov(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(ov(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,bi=!1,Wi=!1,wi=!1,hi=!1,xi=!0,jn=!1,nn="user-content-",Wn=!0,Zi=!1,Mr={},fo=null,Bs=Sr({},["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=Sr({},["audio","video","img","source","image","track"]),gi=null,ho=Sr({},["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=Sr({},[ur,Zo,Bn],Fq),bd=Na(["mi","mo","mn","ms","mtext"]),xp=Sr({},bd),Nh=Na(["annotation-xml"]),da=Sr({},Nh),Tp=Sr({},["title","style","font","a","script"]),ks=null,tc=["application/xhtml+xml","text/html"],Kb="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=Tf(ye),ks=tc.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Kb:ye.PARSER_MEDIA_TYPE,ri=ks==="application/xhtml+xml"?Fq:cD,Re=Sy(ye,"ALLOWED_TAGS",Qe,{transform:ri}),He=Sy(ye,"ALLOWED_ATTR",Xe,{transform:ri}),Nr=Sy(ye,"ALLOWED_NAMESPACES",Wc,{transform:Fq}),gi=Sy(ye,"ADD_URI_SAFE_ATTR",ho,{transform:ri,base:ho}),Ks=Sy(ye,"ADD_DATA_URI_TAGS",no,{transform:ri,base:no}),fo=Sy(ye,"FORBID_CONTENTS",Bs,{transform:ri}),Pe=Sy(ye,"FORBID_TAGS",Tf({}),{transform:ri}),qe=Sy(ye,"FORBID_ATTR",Tf({}),{transform:ri}),Mr=Iu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?Tf(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,hi=ye.RETURN_TRUSTED_TYPE||!1,bi=ye.FORCE_BODY||!1,xi=ye.SANITIZE_DOM!==!1,jn=ye.SANITIZE_NAMED_PROPS||!1,Wn=ye.KEEP_CONTENT!==!1,Zi=ye.IN_PLACE||!1,Se=rUe(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:Iue,qi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Bn,xp=Vq(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>Sr({},bd)),da=Vq(ye,"HTML_INTEGRATION_POINTS",()=>Sr({},Nh));let Fe=Vq(ye,"CUSTOM_ELEMENT_HANDLING",()=>ov(null));if($e=ov(null),Iu(Fe,"tagNameCheck")&&Z0(Fe.tagNameCheck)&&($e.tagNameCheck=Fe.tagNameCheck),Iu(Fe,"attributeNameCheck")&&Z0(Fe.attributeNameCheck)&&($e.attributeNameCheck=Fe.attributeNameCheck),Iu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),nc($e),ft&&(Gt=!1),wi&&(Wi=!0),Mr&&(Re=Sr({},vue),He=ov(null),Mr.html===!0&&(Sr(Re,Cue),Sr(He,Sue)),Mr.svg===!0&&(Sr(Re,Bq),Sr(He,zq),Sr(He,Aj)),Mr.svgFilters===!0&&(Sr(Re,kq),Sr(He,zq),Sr(He,Aj)),Mr.mathMl===!0&&(Sr(Re,Uq),Sr(He,wue),Sr(He,Aj))),st.tagCheck=null,st.attributeCheck=null,Iu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:sv(ye.ADD_TAGS)&&(Re===Qe&&(Re=Tf(Re)),Sr(Re,ye.ADD_TAGS,ri))),Iu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:sv(ye.ADD_ATTR)&&(He===Xe&&(He=Tf(He)),Sr(He,ye.ADD_ATTR,ri))),Iu(ye,"ADD_FORBID_CONTENTS")&&sv(ye.ADD_FORBID_CONTENTS)&&(fo===Bs&&(fo=Tf(fo)),Sr(fo,ye.ADD_FORBID_CONTENTS,ri)),Wn&&(Re["#text"]=!0),rt&&Sr(Re,["html","head","body"]),Re.table&&(Sr(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("")));Na&&Na(ye),Kr=ye},Ep=Sr({},[...Bq,...kq,...oUe]),Cy=Sr({},[...Uq,...sUe]),Sq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="svg":Fe.namespaceURI===ur?ye==="svg"&&(gt==="annotation-xml"||xp[gt]):!!Ep[ye]},wq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="math":Fe.namespaceURI===Zo?ye==="math"&&da[gt]:!!Cy[ye]},Iq=function(ye,Fe,gt){return Fe.namespaceURI===Zo&&!da[gt]||Fe.namespaceURI===ur&&!xp[gt]?!1:!Cy[ye]&&(Tp[ye]||!Ep[ye])},Pq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:qi,tagName:"template"});let gt=cD(ye.tagName),on=cD(Fe.tagName);return Nr[ye.namespaceURI]?ye.namespaceURI===Zo?Sq(gt,Fe,on):ye.namespaceURI===ur?wq(gt,Fe,on):ye.namespaceURI===Bn?Iq(gt,Fe,on):!!(ks==="application/xhtml+xml"&&Nr[ye.namespaceURI]):!1},Cp=function(ye){oD(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")}},QC=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},$b=function(ye){Jb(ye);let Fe=A(ye);if(Fe){let on=[];nx(Fe,In=>{oD(on,In)}),nx(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"&&QC(ye,In,oi)}},Lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}oD(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{}},Dq=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)]||QC(ye,on,In)}},Jb=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===xf.element&&Dq(gt);let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},ev=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===xf.processingInstruction||on===xf.comment&&qc(Due,gt.data)){try{m(gt)}catch{}continue}if(on===xf.element){let oi=gt,So=ri(R(gt));try{oi.hasAttribute&&oi.hasAttribute("patchsrc")&&oi.removeAttribute("patchsrc"),oi.hasAttribute&&oi.hasAttribute("for")&&ev("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])}},Zb=function(ye){let Fe=null,gt=null;if(bi)ye="<remove></remove>"+ye;else{let oi=bue(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},nD=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)},tv=function(ye){return ye=sD(ye,J," "),ye=sD(ye,Z," "),ye=sD(ye,ae," "),ye},vy=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=tv(In.data),In=on.nextNode();let oi=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");oi&&nx(oi,So=>{ne(So.content)&&vy(So.content)})},ce=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)===xf.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&&nx(Ct,gt=>{gt.call(t,ye,Fe,Kr)})}let Ze=function(ye,Fe){return!!(Xt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&qc(Pue,ye.textContent)&&qc(Pue,ye.innerHTML)||Xt&&ye.namespaceURI===Bn&&yUe[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&qc(AUe[Fe],ye.textContent))||ye.nodeType===xf.processingInstruction||Xt&&ye.nodeType===xf.comment&&qc(Due,ye.data))},Et=function(ye,Fe){if(ye instanceof RegExp)return qc(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?Tf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Zi&&Jb(ye),!0)},qn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(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)===xf.element&&!Pq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&qc(gUe,ye.innerHTML))return Cp(ye),!0;if(ft&&ye.nodeType===xf.text){let In=tv(ye.textContent);ye.textContent!==In&&(oD(t.removed,{element:ye.cloneNode()}),ye.textContent=In)}return Ce(W.afterSanitizeElements,ye,null),!1},_n=function(ye,Fe,gt){if(qe[Fe]||ev(Fe,ye)||xi&&(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&&qc(Ae,Fe)||vt&&qc(fe,Fe)?!0:on?gi[Fe]||qc(Se,sD(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&xue(gt,"data:")===0&&Ks[ye]||lt&&!qc(xe,sD(gt,ge,""))?!0:!gt:mo(ye)&&Et($e.tagNameCheck,ye)&&Et($e.attributeNameCheck,Fe,ye)||Fe==="is"&&$e.allowCustomizedBuiltInElements&&Et($e.tagNameCheck,gt)},vo=Sr({},["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[cD(ye)]&&qc(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),ce(ye)?Cp(ye):Aue(t.removed)}catch{Lh(Fe,ye)}},Ml=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(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,Su=oi.value,wu=ri(So),Rq=Su,Nl=So==="value"?Rq:Z3e(Rq);if(gt.attrName=wu,gt.attrValue=Nl,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Nl=gt.attrValue,jn&&(wu==="id"||wu==="name")&&xue(Nl,nn)!==0&&(Lh(So,ye,oi),Nl=nn+Nl),Xt&&qc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nl)){Lh(So,ye,oi);continue}if(wu==="attributename"&&bue(Nl,"href")){Lh(So,ye,oi);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){Lh(So,ye,oi);continue}if(!mt&&qc(_Ue,Nl)){Lh(So,ye,oi);continue}if(ft&&(Nl=tv(Nl)),!_n(In,wu,Nl)){Lh(So,ye,oi);continue}Nl=$s(In,wu,ds,Nl),Nl!==Rq&&Sc(ye,So,ds,Nl)}}Ce(W.afterSanitizeAttributes,ye,null)},vu=function(ye){let Fe=null,gt=nD(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),qn(Fe,ye),Ml(Fe),ne(Fe.content)&&vu(Fe.content),I(Fe)===xf.element){let on=x(Fe);ne(on)&&(Q0(on),vu(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){vu(gt.shadow);continue}let on=gt.node,oi=I(on)===xf.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 Su=on.content;ne(Su)&&Fe.push({node:Su,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=iUe(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=Tf(Re)),W.uponSanitizeAttribute.length>0&&(He=Tf(He)),t.removed=[];let oi=Zi&&typeof Ct!="string"&&Te(Ct);if(oi){vp(Ct);let Su=R(Ct);if(typeof Su=="string"){let wu=ri(Su);if(!Re[wu]||Pe[wu])throw $b(Ct),tx("root node is forbidden and cannot be sanitized in-place")}if(ce(Ct))throw $b(Ct),tx("root node is clobbered and cannot be sanitized in-place");try{Q0(Ct)}catch(wu){throw $b(Ct),wu}}else if(Te(Ct))Fe=Zb("<!---->"),gt=Fe.ownerDocument.importNode(Ct,!0),gt.nodeType===xf.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),Q0(gt);else{if(!Wi&&!ft&&!rt&&Ct.indexOf("<")===-1)return O&&hi?M(Ct):Ct;if(Fe=Zb(Ct),!Fe)return Wi?null:hi?L:""}Fe&&bi&&Cp(Fe.firstChild);let So=oi?Ct:Fe;try{let Su=nD(So);for(;on=Su.nextNode();)qn(on,So),Ml(on),ne(on.content)&&vu(on.content)}catch(Su){throw oi&&($b(Ct),nx(t.removed,wu=>{wu.element&&Jb(wu.element)})),Su}if(oi)return nx(t.removed,Su=>{Su.element&&Jb(Su.element)}),ft&&vy(Ct),Ct;if(Wi){if(ft&&vy(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&&qc(mUe,Fe.ownerDocument.doctype.name)&&(ds="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> -`+ds),ft&&(ds=tv(ds)),O&&hi?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"&&Iu(W,Ct)&&oD(W[Ct],ye)},t.removeHook=function(Ct,ye){if(Iu(W,Ct)){if(ye!==void 0){let Fe=$3e(W[Ct],ye);return Fe===-1?void 0:J3e(W[Ct],Fe,1)[0]}return Aue(W[Ct])}},t.removeHooks=function(Ct){Iu(W,Ct)&&(W[Ct]=[])},t.removeAllHooks=function(){W=Rue()},t}var Fue=Lue();var TUe=0,Gq={},Wq=class e{constructor(t,n){let i,r=t;l(Gq[r])?i=Gq[r]:(i=TUe++,Gq[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=Fue.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=Wq;function lD(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(lD.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});lD.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Yq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Yq(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)}lD.prototype.removeEventListener=function(e,t){let n=qq(this,this._listeners,e,t),i=qq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function qq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!Yq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var xj,bj;function EUe(e){xj.apply(e,bj)}function CUe(e,t){l(t)&&(xj=t,e.forEach(EUe))}lD.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=xj,t=bj;bj=arguments;try{this._listeners.forEach(CUe)}finally{xj=e,bj=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)Yq(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)qq(this,this._listeners,n,r);this._toRemove.clear()}};var be=lD;function Bue(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 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,Bue(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)&&Bue(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=vUe,r=SUe;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,IUe);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,wUe),o=h.subtract(t,i,PUe),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 ex(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,DUe),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 kue(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*kue(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)})})}};Fl.WGS84=Object.freeze(new Fl(6378137,6378137,6356752314245179e-9));Fl.UNIT_SPHERE=Object.freeze(new Fl(1,1,1));Fl.MOON=Object.freeze(new Fl(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Fl.MARS=Object.freeze(new Fl(3396190,3396190,3376200));Fl._default=Fl.WGS84;Fl.packedLength=h.packedLength;Fl.prototype.geocentricSurfaceNormal=h.normalize;var vUe=new h,SUe=new h,wUe=new h,IUe=new h,PUe=new h,DUe=new h,RUe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],OUe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function kue(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*RUe[s];o+=OUe[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Fl;var Xq=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)}},zi=Xq;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,Tj),e.magnitude(Tj)}static distanceSquared(t,n){return e.subtract(t,n,Tj),e.magnitudeSquared(Tj)}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,Uue),r=e.multiplyByScalar(t,1-i,r),e.add(Uue,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,MUe);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),Kq[0]=t,zue?(n.x=Yc[0],n.y=Yc[1],n.z=Yc[2],n.w=Yc[3]):(n.x=Yc[3],n.y=Yc[2],n.z=Yc[1],n.w=Yc[0]),n}static unpackFloat(t){return zue?(Yc[0]=t.x,Yc[1]=t.y,Yc[2]=t.z,Yc[3]=t.w):(Yc[0]=t.w,Yc[1]=t.z,Yc[2]=t.y,Yc[3]=t.x),Kq[0]}};Js.packedLength=4;Js.fromArray=Js.unpack;var Tj=new Js,Uue=new Js,MUe=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 Kq=new Float32Array(1),Yc=new Uint8Array(Kq.buffer),NUe=new Uint32Array([287454020]),LUe=new Uint8Array(NUe.buffer),zue=LUe[0]===68,se=Js;function FUe(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 wr=FUe;function BUe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var wy=BUe;function kUe(e){return e%4===0&&e%100!==0||e%400===0}var Bl=kUe;var Vue=[31,28,31,30,31,30,31,31,30,31,30,31];function UUe(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&&Bl(e)?Vue[t-1]+1:Vue[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Uh=UUe;function zUe(e,t){this.julianDate=e,this.offset=t}var yr=zUe;var jue={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(jue);var kn=jue;var Hue={UTC:0,TAI:1};Object.freeze(Hue);var si=Hue;var Gue=new Uh,Cj=[31,28,31,30,31,30,31,31,30,31,30,31],vj=29;function Jq(e,t){return mi.compare(e.julianDate,t.julianDate)}var av=new yr;function Sj(e){av.julianDate=e;let t=mi.leapSeconds,n=wr(t,av,Jq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&mi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),mi.addSeconds(e,i,e)}function Wue(e,t){av.julianDate=e;let n=mi.leapSeconds,i=wr(n,av,Jq);if(i<0&&(i=~i),i===0)return mi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return mi.addSeconds(e,-n[i-1].offset,t);let r=mi.secondsDifference(n[i].julianDate,e);if(r===0)return mi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return mi.addSeconds(e,-n[i-1].offset,t)}function Iy(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 $q(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 VUe=/^(\d{4})$/,jUe=/^(\d{4})-(\d{2})$/,HUe=/^(\d{4})-?(\d{3})$/,GUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,WUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Zq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,qUe=/^(\d{2})(\.\d+)?/.source+Zq.source,YUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Zq.source,XUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Zq.source;var Py={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},KUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function tg(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var que=NaN,Yue=0;function Xue(e,t,n,i,r,o,s){Py.year=e,Py.month=t,Py.day=n,Py.hour=i,Py.minute=r,Py.second=o,Py.millisecond=s}function $Ue(e){let t=e.length;if(t===4){let m=tg(e,0),y=tg(e,2);return m<0||y<0?!1:(Xue(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=tg(e,0),o=tg(e,2),s=tg(e,5),a=tg(e,8),c=tg(e,11),u=tg(e,14),f=tg(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/KUe[y]*1e3}let p=r*100+o,g=Bl(p);if((s!==2||!g?Cj[s-1]:vj)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==que&&(que=m,Yue=new Date(m).getTimezoneOffset()),u=u+Yue}return Xue(p,s,a,c,u,f,d),!0}function Kue(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?vj:Cj[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?vj:Cj[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?vj:Cj[t-1],n+=u;let d=$q(e,t,n,i,r,o,s);return l(c)?(Iy(d[0],d[1],c),Sj(c)):c=new mi(d[0],d[1],si.UTC),f&&mi.addSeconds(c,1,c),c}var mi=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,Iy(r,n,this),i===si.UTC&&Sj(this)}static fromGregorianDate(t,n){let i=$q(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Iy(i[0],i[1],n),Sj(n),n):new e(i[0],i[1],si.UTC)}static fromDate(t,n){let i=$q(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Iy(i[0],i[1],n),Sj(n),n):new e(i[0],i[1],si.UTC)}static fromIso8601(t,n){if($Ue(t)){let A=Py;return Kue(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,Bl(A.year),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(WUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(jUe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(VUe),i!==null)r=+i[1];else{let A;if(i=d.match(HUe),i!==null)r=+i[1],A=+i[2],m=Bl(r);else if(i=d.match(GUe),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=Bl(r);let y;if(l(p)){i=p.match(XUe),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(YUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(qUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return Kue(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=Wue(t,Ej);l(r)||(e.addSeconds(t,-1,Ej),r=Wue(Ej,Ej),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 Uh(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,Gue),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,Gue),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){av.julianDate=t;let n=e.leapSeconds,i=wr(n,av,Jq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Iy(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_MINUTE;return Iy(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_HOUR;return Iy(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return Iy(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)}},Ej=new mi(0,0,si.TAI);mi.leapSeconds=[new yr(new mi(2441317,43210,si.TAI),10),new yr(new mi(2441499,43211,si.TAI),11),new yr(new mi(2441683,43212,si.TAI),12),new yr(new mi(2442048,43213,si.TAI),13),new yr(new mi(2442413,43214,si.TAI),14),new yr(new mi(2442778,43215,si.TAI),15),new yr(new mi(2443144,43216,si.TAI),16),new yr(new mi(2443509,43217,si.TAI),17),new yr(new mi(2443874,43218,si.TAI),18),new yr(new mi(2444239,43219,si.TAI),19),new yr(new mi(2444786,43220,si.TAI),20),new yr(new mi(2445151,43221,si.TAI),21),new yr(new mi(2445516,43222,si.TAI),22),new yr(new mi(2446247,43223,si.TAI),23),new yr(new mi(2447161,43224,si.TAI),24),new yr(new mi(2447892,43225,si.TAI),25),new yr(new mi(2448257,43226,si.TAI),26),new yr(new mi(2448804,43227,si.TAI),27),new yr(new mi(2449169,43228,si.TAI),28),new yr(new mi(2449534,43229,si.TAI),29),new yr(new mi(2450083,43230,si.TAI),30),new yr(new mi(2450630,43231,si.TAI),31),new yr(new mi(2451179,43232,si.TAI),32),new yr(new mi(2453736,43233,si.TAI),33),new yr(new mi(2454832,43234,si.TAI),34),new yr(new mi(2456109,43235,si.TAI),35),new yr(new mi(2457204,43236,si.TAI),36),new yr(new mi(2457754,43237,si.TAI),37)];var K=mi;var mfe=Qo(Ef(),1);function JUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var uD=JUe;function ZUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Pu=ZUe;var nfe=Qo(Ef(),1);function Qq(e,t){let n;return typeof document<"u"&&(n=document),Qq._implementation(e,t,n)}Qq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new nfe.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Td=Qq;var ife=Qo(Ef(),1);function QUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new ife.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var fD=QUe;var rfe=Qo(Ef(),1);function eze(e){let t=new rfe.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 ng=eze;var ofe={};function tze(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=ofe[t];l(i)||(i={},ofe[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 zh=tze;var nze=/^blob:/i;function ize(e){return nze.test(e)}var ix=ize;var wp;function rze(e){l(wp)||(wp=document.createElement("a")),wp.href=window.location.href;let t=wp.host,n=wp.protocol;return wp.href=e,wp.href=wp.href,n!==wp.protocol||t!==wp.host}var Dy=rze;var oze=/^data:/i;function sze(e){return oze.test(e)}var Vh=sze;function aze(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 rx=aze;function cze(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 ox=cze;function lze(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 Cf=lze;var sfe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(sfe);var Ti=sfe;var afe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(afe);var Zs=afe;function Dj(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}Dj.prototype.cancel=function(){this.cancelled=!0};Dj.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 Dj(this)};var wo=Dj;function uze(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 dD=uze;function cfe(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=dD(this.responseHeaders))}cfe.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Ip=cfe;var Rj=Qo(Ef(),1);function sx(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(sx.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 eY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}sx.prototype.reserve=function(e){e=e??this._length,this._array.length=e};sx.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?(eY(i,r,e),e=r):o=!1}};sx.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};sx.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)eY(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};sx.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return eY(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var hD=sx;function mD(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(mD.prototype=Object.create(Error.prototype),mD.prototype.constructor=mD);mD.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var oe=mD;function fze(e,t){return e.priority-t.priority}var Ir={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},uv=20,Xc=new hD({comparator:fze});Xc.maximumLength=uv;Xc.reserve(uv);var Pp=[],ig={},dze=typeof document<"u"?new Rj.default(document.location.href):new Rj.default,Oj=new be;function Io(){}Io.maximumRequests=50;Io.maximumRequestsPerServer=18;Io.requestsByServer={};Io.throttleRequests=!0;Io.debugShowStatistics=!1;Io.requestCompletedEvent=Oj;Object.defineProperties(Io,{statistics:{get:function(){return Ir}},priorityHeapLength:{get:function(){return uv},set:function(e){if(e<uv)for(;Xc.length>e;){let t=Xc.pop();ax(t)}uv=e,Xc.maximumLength=e,Xc.reserve(e)}}});function lfe(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Io.serverHasOpenSlots=function(e,t){t=t??1;let n=Io.requestsByServer[e]??Io.maximumRequestsPerServer;return ig[e]+t<=n};Io.heapHasOpenSlots=function(e){return Xc.length+e<=uv};function ufe(e){return e.state===Ti.UNISSUED&&(e.state=Ti.ISSUED,e.deferred=Pu()),e.deferred.promise}function hze(e){return function(t){if(e.state===Ti.CANCELLED)return;let n=e.deferred;--Ir.numberOfActiveRequests,--ig[e.serverKey],Oj.raiseEvent(),e.state=Ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function mze(e){return function(t){e.state!==Ti.CANCELLED&&(++Ir.numberOfFailedRequests,--Ir.numberOfActiveRequests,--ig[e.serverKey],Oj.raiseEvent(t),e.state=Ti.FAILED,e.deferred.reject(t))}}function ffe(e){let t=ufe(e);return e.state=Ti.ACTIVE,Pp.push(e),++Ir.numberOfActiveRequests,++Ir.numberOfActiveRequestsEver,++ig[e.serverKey],e.requestFunction().then(hze(e)).catch(mze(e)),t}function ax(e){let t=e.state===Ti.ACTIVE;if(e.state=Ti.CANCELLED,++Ir.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Ir.numberOfActiveRequests,--ig[e.serverKey],++Ir.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Io.update=function(){let e,t,n=0,i=Pp.length;for(e=0;e<i;++e){if(t=Pp[e],t.cancelled&&ax(t),t.state!==Ti.ACTIVE){++n;continue}n>0&&(Pp[e-n]=t)}Pp.length-=n;let r=Xc.internalArray,o=Xc.length;for(e=0;e<o;++e)lfe(r[e]);Xc.resort();let s=Math.max(Io.maximumRequests-Pp.length,0),a=0;for(;a<s&&Xc.length>0;){if(t=Xc.pop(),t.cancelled){ax(t);continue}if(t.throttleByServer&&!Io.serverHasOpenSlots(t.serverKey)){ax(t);continue}ffe(t),++a}pze()};Io.getServerKey=function(e){let t=new Rj.default(e);t.scheme()===""&&(t=t.absoluteTo(dze),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=ig[n];return l(i)||(ig[n]=0),n};Io.request=function(e){if(Vh(e.url)||ix(e.url))return Oj.raiseEvent(),e.state=Ti.RECEIVED,e.requestFunction();if(++Ir.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 ffe(e);if(Pp.length>=Io.maximumRequests)return;lfe(e);let t=Xc.insert(e);if(l(t)){if(t===e)return;ax(t)}return ufe(e)};function pze(){Io.debugShowStatistics&&(Ir.numberOfActiveRequests===0&&Ir.lastNumberOfActiveRequests>0&&(Ir.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ir.numberOfAttemptedRequests}`),Ir.numberOfAttemptedRequests=0),Ir.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ir.numberOfCancelledRequests}`),Ir.numberOfCancelledRequests=0),Ir.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ir.numberOfCancelledActiveRequests}`),Ir.numberOfCancelledActiveRequests=0),Ir.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ir.numberOfFailedRequests}`),Ir.numberOfFailedRequests=0)),Ir.lastNumberOfActiveRequests=Ir.numberOfActiveRequests)}Io.clearForSpecs=function(){for(;Xc.length>0;){let t=Xc.pop();ax(t)}let e=Pp.length;for(let t=0;t<e;++t)ax(Pp[t]);Pp.length=0,ig={},Ir.numberOfAttemptedRequests=0,Ir.numberOfActiveRequests=0,Ir.numberOfCancelledRequests=0,Ir.numberOfCancelledActiveRequests=0,Ir.numberOfFailedRequests=0,Ir.numberOfActiveRequestsEver=0,Ir.lastNumberOfActiveRequests=0};Io.numberOfActiveRequestsByServer=function(e){return ig[e]};Io.requestHeap=Xc;var Kc=Io;var dfe=Qo(Ef(),1);var pD={},fv={};pD.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(fv[n])||(fv[n]=!0)};pD.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(fv[n])&&delete fv[n]};function gze(e){let t=new dfe.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}}pD.contains=function(e){let t=gze(e);return!!(l(t)&&l(fv[t]))};pD.clear=function(){fv={}};var dv=pD;var pfe=(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=Dp(e.templateValues,{}),this._queryParameters=Dp(e.queryParameters,{}),this.headers=Dp(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 Dp(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 hv;zt.supportsImageBitmapOptions=function(){return l(hv)?hv:typeof createImageBitmap!="function"?(hv=Promise.resolve(!1),hv):(hv=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=zh(t[0]),i=zh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),hv)};Object.defineProperties(zt,{isBlobSupported:{get:function(){return pfe}}});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 ng(this._url)}},isDataUri:{get:function(){return Vh(this._url)}},isBlobUri:{get:function(){return ix(this._url)}},isCrossOriginUrl:{get:function(){return Dy(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 mfe.default(e),o=_ze(r.query());this._queryParameters=t?Nj(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(Td(i))),this._url=r.toString()};function _ze(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Cf(e)}function Nj(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}${yze(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 yze(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${ox(e)}`}zt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Nj(this._queryParameters,e,!1):this._queryParameters=Nj(e,this._queryParameters,!1)};zt.prototype.appendQueryParameters=function(e){this._queryParameters=Nj(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 fD(this.getUrlComponent(e),e)};zt.prototype.appendForwardSlash=function(){this._url=uD(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(tY(this.request),!pfe||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=Pu();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",tY(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return gfe(this,e,t)};function gfe(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=Pu();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,gfe(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;tY(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=Pu(),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 tY(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 Aze=/^data:(.*?)(;base64)?,(.*)$/;function Mj(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function hfe(e,t){let n=Mj(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 bze(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return Mj(i,r);case"arraybuffer":return hfe(i,r);case"blob":return o=hfe(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(Mj(i,r),n);case"json":return JSON.parse(Mj(i,r));default:}}zt.prototype.fetch=function(e){return e=Dp(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=Dp(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=Dp(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=Dp(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=Dp(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=Dp(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=Dp(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&&(dv.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=Pu(),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 xze(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 Ip(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 Ip)})}var Tze=typeof XMLHttpRequest>"u";zt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=Aze.exec(e);if(a!==null){o.resolve(bze(a,t));return}if(Tze){xze(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(dv.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 Ip(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 Ip)},c.send(i),c};zt._Implementations.loadAndExecuteScript=function(e,t,n){return rx(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 _D(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)?_fe(this,e.data):_fe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}_D.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 _D({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};_D.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 wy(0,0,0,0,0),t}});_D.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new wy(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,Afe(this,n,this._samples,e,r,o,t),t}let s=wr(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,Afe(this,n,this._samples,e,r,o,t),t};function Eze(e,t){return K.compare(e.julianDate,t)}function _fe(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=wr(T,x,Eze);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function yfe(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 gD(e,t,n){return t+e*(n-t)}function Afe(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 yfe(e,n,r,a,s),s;if(i.equals(u))return yfe(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=gD(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=gD(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=gD(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=gD(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=gD(f,g,m),s}var yD=_D;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 Ic=$c;var bfe={},xfe=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Cze(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=xfe.exec(i);if(r!==null)return r[1]}}var Lj;function Tfe(e){return typeof document>"u"?e:(l(Lj)||(Lj=document.createElement("a")),Lj.href=e,Lj.href)}var cx;function Efe(){if(l(cx))return cx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(bfe?.url)?e=Td(".",bfe.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Td("..",lx("Core/buildModuleUrl.js")):e=Cze(),cx=new De({url:Tfe(e)}),cx.appendForwardSlash(),cx}function vze(e){return Tfe(require.toUrl(`../${e}`))}function Cfe(e){return Efe().getDerivedResource({url:e}).url}var Fj;function lx(e){return l(Fj)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Fj=vze:Fj=Cfe),Fj(e)}lx._cesiumScriptRegex=xfe;lx._buildModuleUrlFromBaseUrl=Cfe;lx._clearBaseResource=function(){cx=void 0};lx.setBaseUrl=function(e){cx=De.DEFAULT.getDerivedResource({url:e})};lx.getCesiumBaseUrl=Efe;var Zt=lx;function Sze(e,t,n){this.x=e,this.y=t,this.s=n}var ux=Sze;function Bj(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 wze=new K(0,0,si.TAI);function nY(e,t,n){let i=wze;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}Bj.prototype.preload=function(e,t,n,i){let r=nY(this,e,t),o=nY(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(iY(this,d));return Promise.all(f)};Bj.prototype.computeXysRadians=function(e,t,n){let i=nY(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])||(iY(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(iY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new ux(0,0,0);let 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};Bj.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 Ize(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function iY(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=Ize(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var AD=Bj;var Pze=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,Pze,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,Dze),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,Rze),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],rY)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],rY)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],rY)),n}static getMaximumScale(t){return e.getScale(t,vfe),h.maximumComponent(vfe)}static setRotation(t,n,i){let r=e.getScale(t,Oze);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,Mze);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*Lze(c);for(;s<r&&Fze(c)>u;)Bze(c,kj),e.transpose(kj,Sfe),e.multiply(c,kj,c),e.multiply(Sfe,c,c),e.multiply(a,kj,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,Nze),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]}) + `),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";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JkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEE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AAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])}))});var R9t={};Oq(R9t,{AlphaMode:()=>Gp,AlphaPipelineStage:()=>GL,AnchorPointDirect:()=>jN,AnchorPointIndirect:()=>HN,Animation:()=>R8,AnimationViewModel:()=>O8,Appearance:()=>wr,ApproximateTerrainHeights:()=>Mi,ArcGISTiledElevationTerrainProvider:()=>Kre,ArcGisBaseMapType:()=>gm,ArcGisMapServerImageryProvider:()=>$g,ArcGisMapService:()=>Bf,ArcType:()=>ln,ArticulationStageType:()=>ul,AssociativeArray:()=>kt,Atmosphere:()=>cT,AtmospherePipelineStage:()=>xL,AttributeCompression:()=>cn,AttributeType:()=>Vt,AutoExposure:()=>QU,AutomaticUniforms:()=>dg,Axis:()=>Hi,AxisAlignedBoundingBox:()=>vf,Azure2DImageryProvider:()=>SF,B3dmLoader:()=>sL,B3dmParser:()=>iL,BaseLayerPicker:()=>S8,BaseLayerPickerViewModel:()=>v8,BatchTable:()=>xx,BatchTableHierarchy:()=>qx,BatchTexture:()=>Kl,BatchTexturePipelineStage:()=>WL,Billboard:()=>Br,BillboardCollection:()=>Gf,BillboardGraphics:()=>qc,BillboardLoadState:()=>qs,BillboardTexture:()=>i_,BillboardVisualizer:()=>TD,BingMapsGeocoderService:()=>Jre,BingMapsImageryProvider:()=>gF,BingMapsStyle:()=>FS,BlendEquation:()=>Pc,BlendFunction:()=>$r,BlendOption:()=>Fi,BlendingState:()=>tn,BoundingRectangle:()=>et,BoundingSphere:()=>ue,BoundingSphereState:()=>Pt,BoundingVolumeSemantics:()=>lA,BoxEmitter:()=>yse,BoxGeometry:()=>Ic,BoxGeometryUpdater:()=>NM,BoxGraphics:()=>Px,BoxOutlineGeometry:()=>Hh,BrdfLutGenerator:()=>nz,Buffer:()=>nt,BufferLoader:()=>Zx,BufferPoint:()=>Bc,BufferPointCollection:()=>Ku,BufferPointMaterial:()=>Sm,BufferPolygon:()=>Mo,BufferPolygonCollection:()=>Ua,BufferPolygonMaterial:()=>Of,BufferPolyline:()=>ya,BufferPolylineCollection:()=>ml,BufferPolylineMaterial:()=>Mf,BufferPrimitive:()=>ss,BufferPrimitiveCollection:()=>ra,BufferPrimitiveMaterial:()=>Zl,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>KL,CallbackPositionProperty:()=>LM,CallbackProperty:()=>em,Camera:()=>Or,CameraEventAggregator:()=>Iz,CameraEventType:()=>cr,CameraFlightPath:()=>vz,Cartesian2:()=>U,Cartesian3:()=>h,Cartesian4:()=>se,CartesianRectangle:()=>XS,Cartographic:()=>he,CartographicGeocoderService:()=>Qre,CatmullRomSpline:()=>eoe,Cesium3DContentGroup:()=>Wx,Cesium3DTile:()=>ih,Cesium3DTileBatchTable:()=>rm,Cesium3DTileColorBlendMode:()=>Uu,Cesium3DTileContent:()=>Nse,Cesium3DTileContentFactory:()=>BT,Cesium3DTileContentState:()=>Rr,Cesium3DTileContentType:()=>Ca,Cesium3DTileFeature:()=>na,Cesium3DTileFeatureTable:()=>dm,Cesium3DTileOptimizationHint:()=>Qd,Cesium3DTileOptimizations:()=>I2,Cesium3DTilePass:()=>ao,Cesium3DTilePassState:()=>vh,Cesium3DTilePointFeature:()=>r_,Cesium3DTileRefine:()=>yo,Cesium3DTileStyle:()=>l_,Cesium3DTileStyleEngine:()=>N2,Cesium3DTileVectorFeature:()=>NT,Cesium3DTilesInspector:()=>F8,Cesium3DTilesInspectorViewModel:()=>L8,Cesium3DTilesTerrainData:()=>RU,Cesium3DTilesTerrainGeometryProcessor:()=>uP,Cesium3DTilesTerrainProvider:()=>aoe,Cesium3DTilesVoxelProvider:()=>jse,Cesium3DTileset:()=>Yo,Cesium3DTilesetBaseTraversal:()=>z2,Cesium3DTilesetCache:()=>R2,Cesium3DTilesetGraphics:()=>Fx,Cesium3DTilesetHeatmap:()=>O2,Cesium3DTilesetMetadata:()=>YT,Cesium3DTilesetMostDetailedTraversal:()=>B2,Cesium3DTilesetSkipTraversal:()=>H2,Cesium3DTilesetStatistics:()=>Im,Cesium3DTilesetTraversal:()=>qa,Cesium3DTilesetVisualizer:()=>G2,CesiumInspector:()=>V8,CesiumInspectorViewModel:()=>z8,CesiumTerrainProvider:()=>tC,CesiumWidget:()=>_8,Check:()=>Wr,CheckerboardMaterialProperty:()=>gw,CircleEmitter:()=>Nz,CircleGeometry:()=>hoe,CircleOutlineGeometry:()=>moe,ClassificationModelDrawCommand:()=>mB,ClassificationPipelineStage:()=>qL,ClassificationPrimitive:()=>Iv,ClassificationType:()=>Qn,ClearCommand:()=>ui,ClippingPlane:()=>ia,ClippingPlaneCollection:()=>bs,ClippingPolygon:()=>fS,ClippingPolygonCollection:()=>Mc,Clock:()=>Nm,ClockRange:()=>Rs,ClockStep:()=>Vr,ClockViewModel:()=>C8,CloudCollection:()=>Yse,CloudType:()=>CP,Color:()=>z,ColorBlendMode:()=>ll,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>Kt,Command:()=>Rle,ComponentDatatype:()=>Y,Composite3DTileContent:()=>GM,CompositeEntityCollection:()=>tee,CompositeMaterialProperty:()=>yw,CompositePositionProperty:()=>mc,CompositeProperty:()=>_l,CompressedTextureBuffer:()=>RD,ComputeCommand:()=>Nf,ComputeEngine:()=>pU,ConditionsExpression:()=>l2,ConeEmitter:()=>$se,ConstantPositionProperty:()=>Gl,ConstantProperty:()=>li,ConstantSpline:()=>uL,ContentMetadata:()=>A2,Context:()=>$E,ContextLimits:()=>Ut,Controller:()=>ple,ControllerHost:()=>F4,CoplanarPolygonGeometry:()=>wk,CoplanarPolygonGeometryLibrary:()=>p_,CoplanarPolygonOutlineGeometry:()=>nh,CornerType:()=>rr,CorrelationGroup:()=>GN,CorridorGeometry:()=>JT,CorridorGeometryLibrary:()=>mr,CorridorGeometryUpdater:()=>Q2,CorridorGraphics:()=>Rx,CorridorOutlineGeometry:()=>Z2,Credit:()=>It,CreditDisplay:()=>jz,CubeMap:()=>ts,CubeMapFace:()=>VD,CubeMapPanorama:()=>bC,CubicRealPolynomial:()=>ux,CullFace:()=>Vi,CullingVolume:()=>ta,CumulusCloud:()=>hd,CustomDataSource:()=>rk,CustomHeightmapTerrainProvider:()=>poe,CustomShader:()=>k0,CustomShaderMode:()=>Kg,CustomShaderPipelineStage:()=>nF,CustomShaderTranslucencyMode:()=>TA,CylinderGeometry:()=>ok,CylinderGeometryLibrary:()=>ZT,CylinderGeometryUpdater:()=>ak,CylinderGraphics:()=>Ox,CylinderOutlineGeometry:()=>sk,CzmlDataSource:()=>_k,DataSource:()=>Ds,DataSourceClock:()=>Lm,DataSourceCollection:()=>yk,DataSourceDisplay:()=>l3,DebugAppearance:()=>tae,DebugCameraPrimitive:()=>z0,DebugInspector:()=>Kz,DebugModelMatrixPrimitive:()=>$z,DefaultProxy:()=>_oe,DepthFunction:()=>ac,DepthPlane:()=>iV,DequantizationPipelineStage:()=>rF,DerivedCommand:()=>up,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>rV,DirectionalLight:()=>aae,DiscardEmptyTileImagePolicy:()=>BS,DiscardMissingTileImagePolicy:()=>mF,DistanceDisplayCondition:()=>jt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Kn,DoubleEndedPriorityQueue:()=>iy,DoublyLinkedList:()=>D2,DracoLoader:()=>Og,DrawCommand:()=>at,DynamicAtmosphereLightingType:()=>Bg,DynamicEnvironmentMapManager:()=>kg,DynamicGeometryBatch:()=>rE,DynamicGeometryUpdater:()=>Ii,EarthOrientationParameters:()=>pD,EarthOrientationParametersSample:()=>wy,EasingFunction:()=>Ls,EdgeDetectionPipelineStage:()=>sF,EdgeDisplayMode:()=>Hd,EdgeFramebuffer:()=>oV,EdgeVisibilityPipelineStage:()=>lF,EllipseGeometry:()=>mu,EllipseGeometryLibrary:()=>Qu,EllipseGeometryUpdater:()=>bk,EllipseGraphics:()=>Mx,EllipseOutlineGeometry:()=>Qf,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>_g,EllipsoidGeometry:()=>Xa,EllipsoidGeometryUpdater:()=>Tk,EllipsoidGraphics:()=>Nx,EllipsoidOutlineGeometry:()=>Yf,EllipsoidPrimitive:()=>sV,EllipsoidRhumbLine:()=>Dc,EllipsoidSurfaceAppearance:()=>lae,EllipsoidTangentPlane:()=>Vs,EllipsoidTerrainProvider:()=>M0,EllipsoidalOccluder:()=>Om,Empty3DTileContent:()=>n0,EncodedCartesian3:()=>Sn,Entity:()=>Jr,EntityCluster:()=>Kf,EntityCollection:()=>Ya,EntityView:()=>f3,EquirectangularPanorama:()=>uae,Event:()=>be,EventHelper:()=>Xo,Expression:()=>Ld,ExpressionNodeType:()=>Mt,ExtrapolationType:()=>fu,FeatureDetection:()=>dn,FeatureIdPipelineStage:()=>xA,Fog:()=>uV,ForEach:()=>ke,FrameRateMonitor:()=>fV,FrameState:()=>kA,Framebuffer:()=>ys,FramebufferManager:()=>ai,Frozen:()=>H,FrustumCommands:()=>dV,FrustumGeometry:()=>rC,FrustumOutlineGeometry:()=>kU,Fullscreen:()=>es,FullscreenButton:()=>k8,FullscreenButtonViewModel:()=>B8,GaussianSplat3DTileContent:()=>NA,GaussianSplatPrimitive:()=>y2,GaussianSplatRenderResources:()=>h2,GaussianSplatSorter:()=>LT,GaussianSplatTextureGenerator:()=>d2,GeoJsonDataSource:()=>mb,GeoJsonLoader:()=>aL,GeoJsonPrimitive:()=>pae,GeocodeType:()=>Ib,Geocoder:()=>H8,GeocoderService:()=>pP,GeocoderViewModel:()=>j8,GeographicProjection:()=>Ui,GeographicTilingScheme:()=>er,Geometry:()=>St,Geometry3DTileContent:()=>YM,GeometryAttribute:()=>Ne,GeometryAttributes:()=>Tn,GeometryFactory:()=>xoe,GeometryInstance:()=>Ft,GeometryInstanceAttribute:()=>Qc,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Gn,GeometryPipelineStage:()=>hF,GeometryType:()=>Sd,GeometryUpdater:()=>Pi,GeometryUpdaterSet:()=>pE,GeometryVisualizer:()=>Xk,GetFeatureInfoFormat:()=>_m,Globe:()=>PV,GlobeDepth:()=>DV,GlobeSurfaceShaderSet:()=>yV,GlobeSurfaceTile:()=>wh,GlobeSurfaceTileProvider:()=>bV,GlobeTranslucency:()=>xV,GlobeTranslucencyFramebuffer:()=>RV,GlobeTranslucencyState:()=>OV,GltfBufferViewLoader:()=>Hv,GltfDracoLoader:()=>Gv,GltfGpmLoader:()=>qN,GltfGpmLocal:()=>gS,GltfImageLoader:()=>Wv,GltfIndexBufferLoader:()=>qv,GltfJsonLoader:()=>Xv,GltfLoader:()=>Lf,GltfLoaderUtil:()=>ju,GltfMeshPrimitiveGpmLoader:()=>$N,GltfSpzLoader:()=>fN,GltfStructuralMetadataLoader:()=>zN,GltfTextureLoader:()=>Zv,GltfVertexBufferLoader:()=>Qv,Google2DImageryProvider:()=>vF,GoogleEarthEnterpriseImageryProvider:()=>Lae,GoogleEarthEnterpriseMapsProvider:()=>AF,GoogleEarthEnterpriseMetadata:()=>oy,GoogleEarthEnterpriseTerrainData:()=>gP,GoogleEarthEnterpriseTerrainProvider:()=>Ioe,GoogleEarthEnterpriseTileInformation:()=>VU,GoogleGeocoderService:()=>Doe,GoogleMaps:()=>Ta,GoogleStreetViewCubeMapPanoramaProvider:()=>Fae,GpxDataSource:()=>rU,GregorianDate:()=>Bh,GridImageryProvider:()=>Bae,GridMaterialProperty:()=>Iw,GroundGeometryUpdater:()=>ii,GroundPolylineGeometry:()=>vx,GroundPolylinePrimitive:()=>Kh,GroundPrimitive:()=>Vl,GroupMetadata:()=>hw,HeadingPitchRange:()=>mh,HeadingPitchRoll:()=>wc,Heap:()=>uD,HeightReference:()=>We,HeightmapEncoding:()=>xh,HeightmapTerrainData:()=>jc,HeightmapTessellator:()=>oP,HermitePolynomialApproximation:()=>ck,HermiteSpline:()=>yA,HilbertOrder:()=>Uv,HomeButton:()=>W8,HomeButtonViewModel:()=>G8,HorizontalOrigin:()=>zi,HybridScreenSpacePanCameraController:()=>ble,I3SBuildingSceneLayerExplorer:()=>zle,I3SBuildingSceneLayerExplorerViewModel:()=>q8,I3SDataProvider:()=>mp,I3SDecoder:()=>MV,I3SFeature:()=>NV,I3SField:()=>LV,I3SGeometry:()=>FP,I3SLayer:()=>RC,I3SNode:()=>BP,I3SStatistics:()=>kV,I3SSublayer:()=>zV,I3SSymbology:()=>BV,I3dmLoader:()=>lL,I3dmParser:()=>cL,ITwinData:()=>Vae,ITwinPlatform:()=>la,Iau2000Orientation:()=>HU,Iau2006XysData:()=>gD,Iau2006XysSample:()=>cx,IauOrientationAxes:()=>GU,IauOrientationParameters:()=>jU,ImageBasedLighting:()=>Gx,ImageBasedLightingPipelineStage:()=>EL,ImageMaterialProperty:()=>Hy,Imagery:()=>qS,ImageryConfiguration:()=>CB,ImageryCoverage:()=>KS,ImageryFlags:()=>PF,ImageryInput:()=>RF,ImageryLayer:()=>Ss,ImageryLayerCollection:()=>XT,ImageryLayerFeatureInfo:()=>pm,ImageryPipelineStage:()=>OF,ImageryProvider:()=>kf,ImageryState:()=>Vn,Implicit3DTileContent:()=>rS,ImplicitAvailabilityBitstream:()=>Vv,ImplicitMetadataView:()=>jv,ImplicitSubdivisionScheme:()=>Gs,ImplicitSubtree:()=>Lg,ImplicitSubtreeCache:()=>Dz,ImplicitSubtreeMetadata:()=>KM,ImplicitTileCoordinates:()=>o0,ImplicitTileset:()=>r0,IndexDatatype:()=>je,InfoBox:()=>X8,InfoBoxViewModel:()=>Y8,InspectorShared:()=>Af,InstanceAttributeSemantic:()=>No,InstancingPipelineStage:()=>zL,InterpolationAlgorithm:()=>Moe,InterpolationType:()=>um,Intersect:()=>$t,IntersectionTests:()=>_i,Intersections2D:()=>np,Interval:()=>Us,InvertClassification:()=>UP,Ion:()=>Fu,IonGeocodeProviderType:()=>sy,IonGeocoderService:()=>sC,IonImageryProvider:()=>iu,IonImageryProviderFactory:()=>GS,IonResource:()=>Ho,IonSnapGeometryType:()=>Foe,IonSnapHeat:()=>Boe,IonSnapMode:()=>qU,IonSnapParentGeometryType:()=>koe,IonSnapService:()=>Uoe,IonWorldImageryStyle:()=>Zg,Iso8601:()=>tt,JobScheduler:()=>jV,JobType:()=>Oc,JsonMetadataTable:()=>Ug,JulianDate:()=>K,KTX2Transcoder:()=>OD,KeyboardEventModifier:()=>to,KeyframeNode:()=>Hr,KmlCamera:()=>oU,KmlDataSource:()=>YE,KmlLookAt:()=>sU,KmlTour:()=>aU,KmlTourFlyTo:()=>lU,KmlTourWait:()=>uU,Label:()=>IA,LabelCollection:()=>e0,LabelGraphics:()=>Jh,LabelStyle:()=>Ao,LabelVisualizer:()=>Kk,LagrangePolynomialApproximation:()=>lk,LeapSecond:()=>yr,Light:()=>Hae,LightingModel:()=>Jp,LightingPipelineStage:()=>NF,LinearApproximation:()=>YA,LinearSpline:()=>_A,MVTDataProvider:()=>qae,ManagedArray:()=>Xl,MapMode2D:()=>Au,MapProjection:()=>Voe,MapboxImageryProvider:()=>bF,MapboxStyleImageryProvider:()=>Gae,MappedPositions:()=>DF,Material:()=>Qi,MaterialAppearance:()=>Er,MaterialPipelineStage:()=>kF,MaterialProperty:()=>_o,Math:()=>D,Matrix2:()=>Xi,Matrix3:()=>$,Matrix4:()=>N,Megatexture:()=>GV,MeshPrimitiveGpmLocal:()=>KN,MetadataClass:()=>am,MetadataClassProperty:()=>Vp,MetadataComponentType:()=>Lt,MetadataEntity:()=>Yn,MetadataEnum:()=>mN,MetadataEnumValue:()=>hN,MetadataPicking:()=>WV,MetadataPickingPipelineStage:()=>Vf,MetadataPipelineStage:()=>Gd,MetadataSchema:()=>$l,MetadataSchemaLoader:()=>aA,MetadataSemantic:()=>Ud,MetadataTable:()=>Fd,MetadataTableProperty:()=>ZM,MetadataType:()=>bt,MipmapHint:()=>Pd,Model:()=>jf,Model3DTileContent:()=>Hf,ModelAlphaOptions:()=>bT,ModelAnimation:()=>mL,ModelAnimationChannel:()=>hL,ModelAnimationCollection:()=>pL,ModelAnimationLoop:()=>Hu,ModelAnimationState:()=>hm,ModelArticulation:()=>vL,ModelArticulationStage:()=>CL,ModelClippingPlanesPipelineStage:()=>IL,ModelClippingPolygonsPipelineStage:()=>RL,ModelColorPipelineStage:()=>bA,ModelComponents:()=>Cn,ModelDrawCommand:()=>pB,ModelDrawCommands:()=>yB,ModelFeature:()=>gL,ModelFeatureTable:()=>_L,ModelGraphics:()=>Tg,ModelImagery:()=>vB,ModelImageryMapping:()=>_T,ModelLightingOptions:()=>fB,ModelMatrixUpdateStage:()=>VL,ModelNode:()=>LL,ModelPrimitiveImagery:()=>yT,ModelReader:()=>ba,ModelRenderResources:()=>rB,ModelRuntimeNode:()=>HL,ModelRuntimePrimitive:()=>eB,ModelSceneGraph:()=>AB,ModelSilhouettePipelineStage:()=>aB,ModelSkin:()=>tB,ModelSplitterPipelineStage:()=>lB,ModelStatistics:()=>bB,ModelType:()=>Wo,ModelUtility:()=>xt,ModelVectorLookupPipelineStage:()=>NL,ModelVisualizer:()=>Jk,Moon:()=>YV,MorphTargetsPipelineStage:()=>zF,MorphWeightSpline:()=>Woe,MortonOrder:()=>UA,MouseButton:()=>ec,Multiple3DTileContent:()=>T2,MultisampleFramebuffer:()=>QN,NavigationHelpButton:()=>$8,NavigationHelpButtonViewModel:()=>K8,NearFarScalar:()=>qt,NeverTileDiscardPolicy:()=>Xae,NodeRenderResources:()=>uB,NodeStatisticsPipelineStage:()=>jL,NodeTransformationProperty:()=>Lx,OIT:()=>$V,Occluder:()=>YU,OffsetGeometryInstanceAttribute:()=>xr,OpenCageGeocoderService:()=>Xoe,OpenStreetMapImageryProvider:()=>hy,OrderedGroundPrimitiveCollection:()=>Ak,OrientedBoundingBox:()=>Qt,OrthographicFrustum:()=>gn,OrthographicOffCenterFrustum:()=>As,Packable:()=>Koe,PackableForInterpolation:()=>$oe,Panorama:()=>Zae,PanoramaProvider:()=>Qae,Particle:()=>jP,ParticleBurst:()=>tce,ParticleEmitter:()=>nce,ParticleSystem:()=>ice,Pass:()=>Ie,PassState:()=>Ac,PathGraphics:()=>Eg,PathMode:()=>a0,PathVisualizer:()=>t3,PeliasGeocoderService:()=>WU,PerInstanceColorAppearance:()=>yn,PerformanceDisplay:()=>my,PerformanceWatchdog:()=>Z8,PerformanceWatchdogViewModel:()=>J8,PerspectiveFrustum:()=>Ji,PerspectiveOffCenterFrustum:()=>yu,PickDepth:()=>ZV,PickDepthFramebuffer:()=>e4,PickFramebuffer:()=>n4,PickId:()=>gU,PickedMetadataInfo:()=>t4,Picking:()=>f4,PickingPipelineStage:()=>VF,PinBuilder:()=>K_,PixelDatatype:()=>ze,PixelFormat:()=>Ke,PlanarFillIdFramebuffer:()=>i4,Plane:()=>sn,PlaneGeometry:()=>Ek,PlaneGeometryUpdater:()=>vk,PlaneGraphics:()=>wM,PlaneOutlineGeometry:()=>Ck,PntsLoader:()=>TB,PntsParser:()=>TT,PointCloud:()=>h4,PointCloudEyeDomeLighting:()=>Vg,PointCloudShading:()=>Yp,PointCloudStylingPipelineStage:()=>HF,PointGraphics:()=>Bx,PointPrimitive:()=>Ia,PointPrimitiveCollection:()=>Ew,PointVisualizer:()=>i3,PolygonGeometry:()=>qp,PolygonGeometryLibrary:()=>ni,PolygonGeometryUpdater:()=>Pk,PolygonGraphics:()=>Zh,PolygonHierarchy:()=>Rc,PolygonOutlineGeometry:()=>Ik,PolygonPipeline:()=>fi,Polyline:()=>Kd,PolylineArrowMaterialProperty:()=>Dw,PolylineCollection:()=>Em,PolylineColorAppearance:()=>js,PolylineDashMaterialProperty:()=>Ow,PolylineGeometry:()=>U_,PolylineGeometryUpdater:()=>s3,PolylineGlowMaterialProperty:()=>Nw,PolylineGraphics:()=>el,PolylineMaterialAppearance:()=>cc,PolylineOutlineMaterialProperty:()=>XA,PolylinePipeline:()=>ir,PolylineVisualizer:()=>c3,PolylineVolumeGeometry:()=>Ok,PolylineVolumeGeometryLibrary:()=>Pm,PolylineVolumeGeometryUpdater:()=>Fk,PolylineVolumeGraphics:()=>kx,PolylineVolumeOutlineGeometry:()=>Lk,PositionProperty:()=>$h,PositionPropertyArray:()=>P_,PostProcessStage:()=>Ur,PostProcessStageCollection:()=>L4,PostProcessStageComposite:()=>yf,PostProcessStageLibrary:()=>_d,PostProcessStageSampleMode:()=>gd,PostProcessStageTextureCache:()=>zC,PpeMetadata:()=>XN,PpeSource:()=>wle,PpeTexture:()=>YN,Primitive:()=>On,PrimitiveCollection:()=>xl,PrimitiveLoadPlan:()=>dT,PrimitiveOutlineGenerator:()=>fT,PrimitiveOutlinePipelineStage:()=>qF,PrimitivePipeline:()=>Tx,PrimitiveRenderResources:()=>dB,PrimitiveState:()=>is,PrimitiveStatisticsPipelineStage:()=>YF,PrimitiveType:()=>Oe,ProjectionPicker:()=>ej,ProjectionPickerViewModel:()=>Q8,Property:()=>X,PropertyArray:()=>Fw,PropertyAttribute:()=>lT,PropertyAttributeProperty:()=>FN,PropertyBag:()=>ql,PropertyTable:()=>Ql,PropertyTexture:()=>zg,PropertyTextureProperty:()=>LN,ProviderViewModel:()=>uo,Proxy:()=>Zoe,QuadraticRealPolynomial:()=>Ul,QuadtreeOccluders:()=>TV,QuadtreePrimitive:()=>IV,QuadtreeTile:()=>EV,QuadtreeTileLoadState:()=>Qa,QuadtreeTileProvider:()=>Cce,QuantizedMeshTerrainData:()=>eC,QuarticRealPolynomial:()=>LD,Quaternion:()=>Le,QuaternionSpline:()=>dL,Queue:()=>dA,Ray:()=>pn,Rectangle:()=>ie,RectangleCollisionChecker:()=>_E,RectangleGeometry:()=>lE,RectangleGeometryLibrary:()=>Sa,RectangleGeometryUpdater:()=>Bk,RectangleGraphics:()=>Qh,RectangleOutlineGeometry:()=>zT,ReferenceFrame:()=>ji,ReferenceProperty:()=>D_,RenderState:()=>Ge,Renderbuffer:()=>Ff,RenderbufferFormat:()=>nu,Request:()=>wo,RequestErrorEvent:()=>wp,RequestScheduler:()=>Kc,RequestState:()=>Ti,RequestType:()=>Zs,Resource:()=>De,ResourceCache:()=>Li,ResourceCacheKey:()=>Jl,ResourceCacheStatistics:()=>_N,ResourceLoader:()=>nr,ResourceLoaderState:()=>Tt,Rotation:()=>ch,RuntimeError:()=>oe,S2Cell:()=>Pg,SDFSettings:()=>Ga,SampledPositionProperty:()=>gc,SampledProperty:()=>Jf,Sampler:()=>Ht,ScaledPositionProperty:()=>m0,Scene:()=>e8,SceneFramebuffer:()=>LC,SceneMode:()=>re,SceneMode2DPipelineStage:()=>XF,SceneModePicker:()=>nj,SceneModePickerViewModel:()=>tj,SceneTransforms:()=>dr,SceneTransitioner:()=>k4,ScreenSpaceCameraController:()=>V4,ScreenSpaceElevatorCameraController:()=>y8,ScreenSpaceEventHandler:()=>ua,ScreenSpaceEventType:()=>un,ScreenSpaceInputBindings:()=>yp,ScreenSpaceMapCameraController:()=>A8,ScreenSpaceTiltOrbitCameraController:()=>Tle,ScreenSpaceZoomCameraController:()=>Cle,SelectedFeatureIdPipelineStage:()=>EA,SelectionIndicator:()=>oj,SelectionIndicatorViewModel:()=>rj,SensorVolumePortionToDisplay:()=>zw,ShaderBuilder:()=>e_,ShaderCache:()=>_U,ShaderDestination:()=>de,ShaderFunction:()=>iB,ShaderProgram:()=>en,ShaderSource:()=>Ye,ShaderStruct:()=>nB,ShadowMap:()=>gy,ShadowMapShader:()=>pp,ShadowMode:()=>Dn,ShadowVolumeAppearance:()=>Sf,SharedContext:()=>TU,ShowGeometryInstanceAttribute:()=>Pn,Simon1994PlanetaryPositions:()=>xb,SimplePolylineGeometry:()=>lse,SingleTileImageryProvider:()=>xF,SkinningPipelineStage:()=>$F,SkyAtmosphere:()=>i8,SkyBox:()=>r8,SnapFramebuffer:()=>H4,SnapService:()=>use,Snapping:()=>W4,SpatialNode:()=>J4,Spdcf:()=>WN,SpecularEnvironmentCubeMap:()=>nm,SphereEmitter:()=>tle,SphereGeometry:()=>JU,SphereOutlineGeometry:()=>__,Spherical:()=>uk,Spline:()=>Dr,SplitDirection:()=>Vo,Splitter:()=>GP,StaticGeometryColorBatch:()=>dh,StaticGeometryPerMaterialBatch:()=>hh,StaticGroundGeometryColorBatch:()=>sI,StaticGroundGeometryPerMaterialBatch:()=>Yk,StaticGroundPolylinePerMaterialBatch:()=>a3,StaticOutlineGeometryBatch:()=>lI,StencilConstants:()=>Yt,StencilFunction:()=>ei,StencilOperation:()=>Rt,SteppedSpline:()=>fL,Stereographic:()=>al,StorageType:()=>pA,StripeMaterialProperty:()=>kw,StripeOrientation:()=>Fm,StructuralMetadata:()=>za,StyleCommandsNeeded:()=>mm,StyleExpression:()=>nle,Sun:()=>f8,SunLight:()=>Q_,SunPostProcess:()=>X4,SupportedImageFormats:()=>VN,SvgPathBindingHandler:()=>T8,Sync:()=>EU,TaskProcessor:()=>Jn,Terrain:()=>d8,TerrainData:()=>uf,TerrainEncoding:()=>Co,TerrainFillMesh:()=>MP,TerrainMesh:()=>bc,TerrainOffsetProperty:()=>Ux,TerrainPicker:()=>SU,TerrainProvider:()=>Xr,TerrainQuantization:()=>$a,TerrainState:()=>kr,Texture:()=>Dt,Texture3D:()=>CU,TextureAtlas:()=>CT,TextureCache:()=>yU,TextureMagnificationFilter:()=>Zn,TextureManager:()=>rz,TextureMinificationFilter:()=>Wt,TexturePacker:()=>QS,TextureUniform:()=>sz,TextureWrap:()=>hn,TileAvailability:()=>tp,TileBoundingRegion:()=>qf,TileBoundingS2Cell:()=>S2,TileBoundingSphere:()=>y_,TileBoundingVolume:()=>ile,TileCoordinatesImageryProvider:()=>m8,TileDiscardPolicy:()=>ole,TileEdge:()=>wn,TileImagery:()=>YS,TileMapServiceImageryProvider:()=>CA,TileMetadata:()=>b2,TileOrientedBoundingBox:()=>$u,TileProviderError:()=>Zr,TileReplacementQueue:()=>CV,TileSelectionResult:()=>pi,TileState:()=>sle,Tileset3DTileContent:()=>IB,TilesetMetadata:()=>w2,TilesetPipelineStage:()=>yL,TilingScheme:()=>dse,TimeConstants:()=>kn,TimeDynamicImagery:()=>gT,TimeDynamicPointCloud:()=>ZP,TimeInterval:()=>En,TimeIntervalCollection:()=>Ps,TimeIntervalCollectionPositionProperty:()=>R_,TimeIntervalCollectionProperty:()=>O_,TimeStandard:()=>si,Timeline:()=>cj,TimelineHighlightRange:()=>sj,TimelineTrack:()=>aj,Tipsify:()=>FD,ToggleButtonViewModel:()=>Wb,Tonemapper:()=>Ay,TrackingReferenceFrame:()=>gg,Transforms:()=>At,TranslationRotationScale:()=>Gy,TranslucentTileClassification:()=>o4,TridiagonalSystemSolver:()=>CS,TrustedServers:()=>lv,TweenCollection:()=>HC,UniformState:()=>bU,UniformType:()=>B0,UrlTemplate3DTilesDataProvider:()=>XV,UrlTemplateImageryProvider:()=>vs,VERSION:()=>D9t,VRButton:()=>fj,VRButtonViewModel:()=>uj,VRTheWorldTerrainProvider:()=>mse,VaryingType:()=>vle,Vector3DTileBatch:()=>zp,Vector3DTileClampedPolylines:()=>$B,Vector3DTileContent:()=>ZB,Vector3DTileGeometry:()=>Ig,Vector3DTilePoints:()=>HB,Vector3DTilePolygons:()=>GB,Vector3DTilePolylines:()=>RT,Vector3DTilePrimitive:()=>Kx,VectorGltf3DTileContent:()=>MA,VectorPipeline:()=>Es,VectorProvider:()=>u_,VelocityOrientationProperty:()=>dk,VelocityVectorProperty:()=>M_,VertexArray:()=>zn,VertexArrayFacade:()=>n_,VertexAttributeSemantic:()=>ct,VertexFormat:()=>Be,VerticalExaggeration:()=>Ar,VerticalExaggerationPipelineStage:()=>ZF,VerticalOrigin:()=>Hn,VideoSynchronizer:()=>hse,View:()=>BC,Viewer:()=>Xle,ViewportQuad:()=>lle,Visibility:()=>$o,Visualizer:()=>Nre,VoxelBoundsCollection:()=>ay,VoxelBoxShape:()=>pC,VoxelCell:()=>K4,VoxelContent:()=>mC,VoxelCylinderShape:()=>gC,VoxelEllipsoidShape:()=>_C,VoxelInspector:()=>hj,VoxelInspectorViewModel:()=>dj,VoxelMetadataOrder:()=>U0,VoxelPrimitive:()=>Hb,VoxelProvider:()=>fle,VoxelRenderResources:()=>Tz,VoxelShape:()=>dle,VoxelShapeType:()=>xc,VoxelTraversal:()=>Z4,VulkanConstants:()=>pse,WallGeometry:()=>Uk,WallGeometryLibrary:()=>uE,WallGeometryUpdater:()=>jk,WallGraphics:()=>Cg,WallOutlineGeometry:()=>Vk,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>EF,WebMapTileServiceImageryProvider:()=>CF,WebMercatorProjection:()=>yi,WebMercatorTilingScheme:()=>Lo,WindingOrder:()=>ea,WireframeIndexGenerator:()=>$S,WireframePipelineStage:()=>QF,_shadersAcesTonemappingStage:()=>m4,_shadersAdditiveBlend:()=>q4,_shadersAdjustTranslucentFS:()=>VP,_shadersAllMaterialAppearanceFS:()=>vD,_shadersAllMaterialAppearanceVS:()=>SD,_shadersAmbientOcclusionGenerate:()=>p4,_shadersAmbientOcclusionModulate:()=>g4,_shadersAspectRampMaterial:()=>qD,_shadersAtmosphereCommon:()=>lm,_shadersAtmosphereStageFS:()=>AL,_shadersAtmosphereStageVS:()=>bL,_shadersBasicMaterialAppearanceFS:()=>wD,_shadersBasicMaterialAppearanceVS:()=>ID,_shadersBillboardCollectionFS:()=>PB,_shadersBillboardCollectionVS:()=>DB,_shadersBlackAndWhite:()=>_4,_shadersBloomComposite:()=>y4,_shadersBrdfLutGeneratorFS:()=>ez,_shadersBrightPass:()=>Y4,_shadersBrightness:()=>A4,_shadersBufferPointMaterialFS:()=>e2,_shadersBufferPointMaterialVS:()=>QB,_shadersBufferPolygonMaterialFS:()=>CN,_shadersBufferPolygonMaterialVS:()=>EN,_shadersBufferPolylineMaterialFS:()=>o2,_shadersBufferPolylineMaterialVS:()=>r2,_shadersBumpMapMaterial:()=>YD,_shadersCPUStylingStageFS:()=>XL,_shadersCPUStylingStageVS:()=>YL,_shadersCheckerboardMaterial:()=>XD,_shadersCloudCollectionFS:()=>Lz,_shadersCloudCollectionVS:()=>Fz,_shadersCloudNoiseFS:()=>Bz,_shadersCloudNoiseVS:()=>kz,_shadersCompareAndPackTranslucentDepth:()=>r4,_shadersCompositeOITFS:()=>KV,_shadersCompositeTranslucentClassification:()=>FC,_shadersComputeIrradianceFS:()=>DN,_shadersComputeRadianceMapFS:()=>RN,_shadersConstantLodStageFS:()=>BF,_shadersConstantLodStageVS:()=>FF,_shadersContrastBias:()=>b4,_shadersConvolveSpecularMapFS:()=>ON,_shadersConvolveSpecularMapVS:()=>MN,_shadersCubeMapPanoramaVS:()=>Wz,_shadersCustomShaderStageFS:()=>JL,_shadersCustomShaderStageVS:()=>$L,_shadersCzmBuiltins:()=>bx,_shadersDepthOfField:()=>x4,_shadersDepthPlaneFS:()=>Qz,_shadersDepthPlaneVS:()=>eV,_shadersDepthView:()=>T4,_shadersDepthViewPacked:()=>Sle,_shadersDotMaterial:()=>KD,_shadersEdgeDetection:()=>E4,_shadersEdgeDetectionStageFS:()=>oF,_shadersEdgeVisibilityStageFS:()=>aF,_shadersEdgeVisibilityStageVS:()=>cF,_shadersElevationBandMaterial:()=>$D,_shadersElevationContourMaterial:()=>JD,_shadersElevationRampMaterial:()=>ZD,_shadersEllipsoidFS:()=>IP,_shadersEllipsoidSurfaceAppearanceFS:()=>aV,_shadersEllipsoidSurfaceAppearanceVS:()=>cV,_shadersEllipsoidVS:()=>PP,_shadersFXAA:()=>S4,_shadersFXAA3_11:()=>O4,_shadersFadeMaterial:()=>QD,_shadersFeatureIdStageFS:()=>ZL,_shadersFeatureIdStageVS:()=>QL,_shadersFilmicTonemapping:()=>C4,_shadersGaussianBlur1D:()=>Vb,_shadersGeometryStageFS:()=>uF,_shadersGeometryStageVS:()=>fF,_shadersGlobeFS:()=>gV,_shadersGlobeVS:()=>_V,_shadersGridMaterial:()=>e1,_shadersGroundAtmosphere:()=>DP,_shadersHSBToRGB:()=>eO,_shadersHSLToRGB:()=>tO,_shadersImageBasedLightingStageFS:()=>TL,_shadersInstancingStageCommon:()=>FL,_shadersInstancingStageVS:()=>BL,_shadersIntersectBox:()=>mz,_shadersIntersectCylinder:()=>pz,_shadersIntersectDepth:()=>dz,_shadersIntersectEllipsoid:()=>gz,_shadersIntersectLongitude:()=>xP,_shadersIntersectPlane:()=>hz,_shadersIntersection:()=>hC,_shadersIntersectionUtils:()=>fz,_shadersLegacyInstancingStageVS:()=>kL,_shadersLensFlare:()=>w4,_shadersLightingStageFS:()=>MF,_shadersMaterialStageFS:()=>LF,_shadersMegatexture:()=>xz,_shadersMetadataStageFS:()=>eF,_shadersMetadataStageVS:()=>tF,_shadersModelClippingPlanesStageFS:()=>wL,_shadersModelClippingPolygonsStageFS:()=>PL,_shadersModelClippingPolygonsStageVS:()=>DL,_shadersModelColorStageFS:()=>SL,_shadersModelFS:()=>_B,_shadersModelSilhouetteStageFS:()=>oB,_shadersModelSilhouetteStageVS:()=>sB,_shadersModelSplitterStageFS:()=>cB,_shadersModelVS:()=>gB,_shadersModelVectorLookupStageFS:()=>ML,_shadersModelVectorLookupStageVS:()=>OL,_shadersModifiedReinhardTonemapping:()=>I4,_shadersMorphTargetsStageVS:()=>UF,_shadersNightVision:()=>P4,_shadersNormalMapMaterial:()=>t1,_shadersOctree:()=>bz,_shadersPassThrough:()=>gf,_shadersPassThroughDepth:()=>Fb,_shadersPbrNeutralTonemapping:()=>v4,_shadersPerInstanceColorAppearanceFS:()=>d1,_shadersPerInstanceColorAppearanceVS:()=>h1,_shadersPerInstanceFlatColorAppearanceFS:()=>yx,_shadersPerInstanceFlatColorAppearanceVS:()=>m1,_shadersPointCloudEyeDomeLighting:()=>tL,_shadersPointCloudStylingStageVS:()=>jF,_shadersPointPrimitiveCollectionFS:()=>qA,_shadersPointPrimitiveCollectionVS:()=>ek,_shadersPolylineArrowMaterial:()=>n1,_shadersPolylineColorAppearanceVS:()=>mM,_shadersPolylineCommon:()=>Hl,_shadersPolylineDashMaterial:()=>i1,_shadersPolylineFS:()=>wx,_shadersPolylineGlowMaterial:()=>r1,_shadersPolylineMaterialAppearanceVS:()=>pM,_shadersPolylineOutlineMaterial:()=>o1,_shadersPolylineShadowVolumeFS:()=>uM,_shadersPolylineShadowVolumeMorphFS:()=>fM,_shadersPolylineShadowVolumeMorphVS:()=>dM,_shadersPolylineShadowVolumeVS:()=>hM,_shadersPolylineVS:()=>BB,_shadersPrimitiveGaussianSplatFS:()=>p2,_shadersPrimitiveGaussianSplatVS:()=>m2,_shadersPrimitiveOutlineStageFS:()=>WF,_shadersPrimitiveOutlineStageVS:()=>GF,_shadersRGBToHSB:()=>wO,_shadersRGBToHSL:()=>IO,_shadersRGBToXYZ:()=>PO,_shadersReinhardTonemapping:()=>D4,_shadersReprojectWebMercatorFS:()=>wF,_shadersReprojectWebMercatorVS:()=>IF,_shadersRimLightingMaterial:()=>s1,_shadersSelectedFeatureIdStageCommon:()=>MS,_shadersShadowVolumeAppearanceFS:()=>Sv,_shadersShadowVolumeAppearanceVS:()=>tM,_shadersShadowVolumeFS:()=>zy,_shadersSilhouette:()=>R4,_shadersSkinningStageVS:()=>KF,_shadersSkyAtmosphereCommon:()=>qP,_shadersSkyAtmosphereFS:()=>t8,_shadersSkyAtmosphereVS:()=>n8,_shadersSkyBoxFS:()=>Hz,_shadersSkyBoxVS:()=>Gz,_shadersSlopeRampMaterial:()=>a1,_shadersStripeMaterial:()=>c1,_shadersSunFS:()=>s8,_shadersSunTextureFS:()=>a8,_shadersSunVS:()=>c8,_shadersTexturedMaterialAppearanceFS:()=>PD,_shadersTexturedMaterialAppearanceVS:()=>DD,_shadersVector3DTileClampedPolylinesFS:()=>XB,_shadersVector3DTileClampedPolylinesVS:()=>YB,_shadersVector3DTilePolylinesVS:()=>WB,_shadersVectorCommon:()=>Xg,_shadersVectorTileVS:()=>kv,_shadersVerticalExaggerationStageVS:()=>JF,_shadersViewportQuadFS:()=>p8,_shadersViewportQuadVS:()=>XE,_shadersVoxelFS:()=>lz,_shadersVoxelUtils:()=>cz,_shadersVoxelVS:()=>uz,_shadersWater:()=>u1,_shadersWaterMaskMaterial:()=>l1,_shadersXYZToRGB:()=>QO,_shadersacesTonemapping:()=>gR,_shadersalphaWeight:()=>_R,_shadersantialias:()=>yR,_shadersapplyHSBShift:()=>AR,_shadersapproximateSphericalCoordinates:()=>bR,_shadersapproximateTanh:()=>xR,_shadersbackFacing:()=>TR,_shadersbranchFreeTernary:()=>ER,_shaderscascadeColor:()=>CR,_shaderscascadeDistance:()=>vR,_shaderscascadeMatrix:()=>SR,_shaderscascadeWeights:()=>wR,_shaderscolumbusViewMorph:()=>IR,_shaderscomputeAtmosphereColor:()=>PR,_shaderscomputeGroundAtmosphereScattering:()=>DR,_shaderscomputePosition:()=>RR,_shaderscomputeScattering:()=>OR,_shaderscomputeTextureTransform:()=>MR,_shadersconvertLocalToBoxUv:()=>_z,_shadersconvertLocalToCylinderUv:()=>yz,_shadersconvertLocalToEllipsoidUv:()=>Az,_shaderscosineAndSine:()=>NR,_shadersdecodeRGB8:()=>LR,_shadersdecompressTextureCoordinates:()=>FR,_shadersdegreesPerRadian:()=>b1,_shadersdepthClamp:()=>BR,_shadersdepthRange:()=>x1,_shadersdepthRangeStruct:()=>cR,_shaderseastNorthUpToEyeCoordinates:()=>kR,_shadersellipsoidContainsPoint:()=>UR,_shadersellipsoidTextureCoordinates:()=>zR,_shadersepsilon1:()=>T1,_shadersepsilon2:()=>E1,_shadersepsilon3:()=>C1,_shadersepsilon4:()=>v1,_shadersepsilon5:()=>S1,_shadersepsilon6:()=>w1,_shadersepsilon7:()=>I1,_shadersequalsEpsilon:()=>VR,_shaderseyeOffset:()=>jR,_shaderseyeToCartographicDelta:()=>HR,_shaderseyeToWindowCoordinates:()=>GR,_shadersfastApproximateAtan:()=>WR,_shadersfog:()=>qR,_shadersgammaCorrect:()=>YR,_shadersgeodeticSurfaceNormal:()=>XR,_shadersgetDefaultMaterial:()=>KR,_shadersgetDynamicAtmosphereLightDirection:()=>$R,_shadersgetLambertDiffuse:()=>JR,_shadersgetSpecular:()=>ZR,_shadersgetWaterNoise:()=>QR,_shadershue:()=>nO,_shadersinfinity:()=>P1,_shadersinverseGamma:()=>iO,_shadersisEmpty:()=>rO,_shadersisFull:()=>oO,_shaderslatitudeToWebMercatorFraction:()=>sO,_shaderslineDistance:()=>cO,_shaderslinearToSrgb:()=>aO,_shadersluminance:()=>lO,_shadersmaterial:()=>lR,_shadersmaterialInput:()=>uR,_shadersmaximumComponent:()=>uO,_shadersmetersPerPixel:()=>fO,_shadersmodelMaterial:()=>fR,_shadersmodelToWindowCoordinates:()=>dO,_shadersmodelVertexOutput:()=>dR,_shadersmultiplyWithColorBalance:()=>hO,_shadersnearFarScalar:()=>mO,_shadersoctDecode:()=>pO,_shadersoneOverPi:()=>D1,_shadersoneOverTwoPi:()=>R1,_shaderspackDepth:()=>gO,_shaderspassCesium3DTile:()=>O1,_shaderspassCesium3DTileClassification:()=>M1,_shaderspassCesium3DTileClassificationIgnoreShow:()=>N1,_shaderspassCesium3DTileEdges:()=>L1,_shaderspassCesium3DTileEdgesDirect:()=>F1,_shaderspassCesium3DTilePlanarFillId:()=>B1,_shaderspassClassification:()=>k1,_shaderspassCompute:()=>U1,_shaderspassEnvironment:()=>z1,_shaderspassGaussianSplats:()=>V1,_shaderspassGlobe:()=>j1,_shaderspassOpaque:()=>H1,_shaderspassOverlay:()=>G1,_shaderspassTerrainClassification:()=>W1,_shaderspassTranslucent:()=>q1,_shaderspassVoxels:()=>Y1,_shaderspbrLighting:()=>_O,_shaderspbrNeutralTonemapping:()=>yO,_shadersphong:()=>AO,_shaderspi:()=>X1,_shaderspiOverFour:()=>K1,_shaderspiOverSix:()=>$1,_shaderspiOverThree:()=>J1,_shaderspiOverTwo:()=>Z1,_shadersplaneDistance:()=>bO,_shaderspointAlongRay:()=>xO,_shadersradiansPerDegree:()=>Q1,_shadersray:()=>hR,_shadersrayEllipsoidIntersectionInterval:()=>TO,_shadersraySegment:()=>mR,_shadersraySphereIntersectionInterval:()=>EO,_shadersreadDepth:()=>CO,_shadersreadNonPerspective:()=>vO,_shadersreverseLogDepth:()=>SO,_shadersround:()=>DO,_shaderssaturation:()=>RO,_shaderssceneMode2D:()=>eR,_shaderssceneMode3D:()=>tR,_shaderssceneModeColumbusView:()=>nR,_shaderssceneModeMorphing:()=>iR,_shadersshadowDepthCompare:()=>OO,_shadersshadowParameters:()=>pR,_shadersshadowVisibility:()=>MO,_shaderssignNotZero:()=>NO,_shaderssolarRadius:()=>rR,_shaderssphericalHarmonics:()=>LO,_shaderssrgbToLinear:()=>FO,_shaderstangentToEyeSpaceMatrix:()=>BO,_shaderstextureCube:()=>kO,_shadersthreePiOver2:()=>oR,_shaderstransformPlane:()=>UO,_shaderstranslateRelativeToEye:()=>zO,_shaderstranslucentPhong:()=>VO,_shaderstranspose:()=>jO,_shaderstwoPi:()=>sR,_shadersunpackDepth:()=>HO,_shadersunpackFloat:()=>GO,_shadersunpackTexture:()=>WO,_shadersunpackUint:()=>qO,_shadersvalueTransform:()=>YO,_shadersvertexLogDepth:()=>XO,_shaderswebMercatorMaxLatitude:()=>aR,_shaderswindowToEyeCoordinates:()=>KO,_shaderswriteDepthClamp:()=>$O,_shaderswriteLogDepth:()=>JO,_shaderswriteNonPerspective:()=>ZO,addAllToArray:()=>ti,addBuffer:()=>aN,addDefaults:()=>eN,addExtensionsRequired:()=>rN,addExtensionsUsed:()=>Bd,addPipelineExtras:()=>iA,addToArray:()=>ga,appendForwardSlash:()=>aD,arrayRemoveDuplicates:()=>Fr,assert:()=>lX,barycentricCoordinates:()=>lx,binarySearch:()=>vr,buildModuleUrl:()=>Zt,buildVectorGltfFromMVT:()=>iz,buildVoxelCustomShader:()=>bP,buildVoxelDrawCommands:()=>Ez,clone:()=>Je,combine:()=>Ot,computeFlyToLocationForRectangle:()=>AC,createBillboardPointCallback:()=>wT,createColorRamp:()=>MU,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>w8,createDefaultTerrainProviderViewModels:()=>I8,createElevationBandMaterial:()=>Jse,createGooglePhotorealistic3DTileset:()=>Zse,createGuid:()=>$n,createMaterialPropertyDescriptor:()=>ro,createOsmBuildingsAsync:()=>Qse,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>Wl,createTangentSpaceDebugPrimitive:()=>eae,createTaskProcessorWorker:()=>Ile,createUniform:()=>y1,createUniformArray:()=>A1,createVectorTileBuffersFromModelComponents:()=>u2,createWorldBathymetryAsync:()=>NU,createWorldImageryAsync:()=>Qg,createWorldTerrainAsync:()=>nC,decodeGoogleEarthEnterpriseData:()=>LU,decodeMVT:()=>Zz,decodeVectorPolylinePositions:()=>JB,defaultPickWorldPosition:()=>_p,defer:()=>Iu,defined:()=>l,demodernizeShader:()=>eM,deprecationWarning:()=>qr,destroyObject:()=>le,exportKml:()=>Iie,findAccessorMinMax:()=>rT,findContentMetadata:()=>kT,findGroupMetadata:()=>UT,findMeshoptExtension:()=>tA,findTileMetadata:()=>x2,forEachTextureInMaterial:()=>Yv,formatError:()=>Kp,freezeRenderState:()=>gX,getAbsoluteUri:()=>Td,getAccessorByteStride:()=>Vu,getBaseUri:()=>cD,getBinaryAccessor:()=>Nd,getClipAndStyleCode:()=>hV,getClippingFunction:()=>CC,getComponentReader:()=>Ng,getElement:()=>Ln,getExtensionFromUri:()=>ng,getFilenameFromUri:()=>w_,getImageFromTypedArray:()=>UU,getImagePixels:()=>kh,getJsonFromTypedArray:()=>Ro,getMagic:()=>im,getMeshPrimitives:()=>JN,getMetadataClassProperty:()=>mV,getMetadataProperty:()=>pV,getStringFromTypedArray:()=>ku,getTimestamp:()=>xn,hasExtension:()=>tr,heightReferenceOnEntityPropertyChanged:()=>vg,isBitSet:()=>Cl,isBlobUri:()=>tx,isCrossOriginUrl:()=>Dy,isDataUri:()=>Uh,isLeapYear:()=>Bl,knockout:()=>ve,knockout_3_5_1:()=>$C,knockout_es5:()=>x8,loadAndExecuteScript:()=>nx,loadCubeMap:()=>xU,loadImageFromTypedArray:()=>Mg,loadKTX2:()=>Ou,mergeSort:()=>F0,mostDetailedSurfaceHeight:()=>jh,moveTechniqueRenderStates:()=>iN,moveTechniquesToExtension:()=>oN,numberOfComponentsForType:()=>Rf,objectToQuery:()=>ix,oneTimeWarning:()=>_t,parseBatchTable:()=>Gg,parseFeatureMetadataLegacy:()=>UN,parseGlb:()=>iT,parseResponseHeaders:()=>lD,parseStructuralMetadata:()=>kN,pickModel:()=>ZS,pointInsideTriangle:()=>Joe,positionForSurfaceHeight:()=>ag,preprocess3DTileContent:()=>m_,processVoxelProperties:()=>az,queryToObject:()=>Tf,readAccessorPacked:()=>cN,removeExtension:()=>oT,removeExtensionsRequired:()=>tN,removeExtensionsUsed:()=>nT,removePipelineExtras:()=>nN,removeUnusedElements:()=>sN,renderBufferPointCollection:()=>i2,renderBufferPolygonCollection:()=>wN,renderBufferPolylineCollection:()=>c2,resizeImageToNextPowerOfTwo:()=>sA,sampleTerrain:()=>XU,sampleTerrainMostDetailed:()=>aC,scaleToGeodeticSurface:()=>ex,srgbToLinear:()=>lC,subdivideArray:()=>nM,subscribeAndEvaluate:()=>Cc,updateAccessorComponentTypes:()=>lN,updateVersion:()=>uN,usesExtension:()=>Go,viewerCesium3DTilesInspectorMixin:()=>Kle,viewerCesiumInspectorMixin:()=>$le,viewerDragDropMixin:()=>Zle,viewerPerformanceWatchdogMixin:()=>Qle,viewerVoxelInspectorMixin:()=>eue,webGLConstantToGlslType:()=>gse,wrapFunction:()=>ZU,writeTextToCanvas:()=>PT});module.exports=Fh(R9t);var Mq={};Mq.EMPTY_OBJECT=Object.freeze({});Mq.EMPTY_ARRAY=Object.freeze([]);var H=Mq;function M3e(e){return e!=null}var l=M3e;function Qb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Qb.prototype=Object.create(Error.prototype),Qb.prototype.constructor=Qb);Qb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};Qb.throwInstantiationError=function(){throw new Qb("This function defines an interface and should not be called directly.")};var pe=Qb;var ha={};ha.typeOf={};function N3e(e){return`${e} is required, actual value was undefined`}function nv(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(N3e(e))};ha.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(nv(typeof t,"function",e))};ha.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(nv(typeof t,"string",e))};ha.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(nv(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(nv(typeof t,"object",e))};ha.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(nv(typeof t,"boolean",e))};ha.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(nv(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;function rD(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(rD.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});rD.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Lq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Lq(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)}rD.prototype.removeEventListener=function(e,t){let n=Nq(this,this._listeners,e,t),i=Nq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function Nq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!Lq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var pj,mj;function L3e(e){pj.apply(e,mj)}function F3e(e,t){l(t)&&(pj=t,e.forEach(L3e))}rD.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=pj,t=mj;mj=arguments;try{this._listeners.forEach(F3e)}finally{pj=e,mj=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)Lq(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)Nq(this,this._listeners,n,r);this._toRemove.clear()}};var be=rD;function Sy(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(Sy.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Sy.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Sy.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))}};Sy.prototype.equals=function(e){return this===e||e instanceof Sy&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Sy.prototype.valueOf=function(){return this._value};Sy.prototype.toString=function(){return String(this._value)};var li=Sy;function B3e(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 k3e(e){return new li(e)}function U3e(e,t,n){return B3e(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??k3e)}var me=U3e;function oD(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(oD.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")});oD.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 oD(this)};oD.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 qc=oD;var Fq=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)}},kt=Fq;var Bq=Qo(gj(),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 _j=[1];yt.factorial=function(e){let t=_j.length;if(e>=t){let n=_j[t-1];for(let i=t;i<=e;i++){let r=n*i;_j.push(r),n=r}}return _j[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 iue=new Bq.default;yt.setRandomNumberSeed=function(e){iue=new Bq.default(e)};yt.nextRandomNumber=function(){return iue.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 ms=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,yj),e.magnitude(yj)}static distanceSquared(t,n){return e.subtract(t,n,yj),e.magnitudeSquared(yj)}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,rue),r=e.multiplyByScalar(t,1-i,r),e.add(rue,r,r)}static angleBetween(t,n){return e.normalize(t,oue),e.normalize(n,sue),D.acosClamped(e.dot(oue,sue))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,z3e);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})`}};ms.fromCartesian3=ms.clone;ms.fromCartesian4=ms.clone;ms.packedLength=2;ms.fromArray=ms.unpack;var yj=new ms,rue=new ms,oue=new ms,sue=new ms,z3e=new ms;ms.ZERO=Object.freeze(new ms(0,0));ms.ONE=Object.freeze(new ms(1,1));ms.UNIT_X=Object.freeze(new ms(1,0));ms.UNIT_Y=Object.freeze(new ms(0,1));var U=ms;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,Aj),e.magnitude(Aj)}static distanceSquared(t,n){return e.subtract(t,n,Aj),e.magnitudeSquared(Aj)}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,aue),r=e.multiplyByScalar(t,1-i,r),e.add(aue,r,r)}static angleBetween(t,n){e.normalize(t,bj),e.normalize(n,kq);let i=e.dot(bj,kq),r=e.magnitude(e.cross(bj,kq,bj));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,V3e);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);xd.x=a*Math.cos(t),xd.y=a*Math.sin(t),xd.z=Math.sin(n),xd=e.normalize(xd,xd),e.multiplyComponents(s,xd,iv);let c=Math.sqrt(e.dot(xd,iv));return iv=e.divideByScalar(iv,c,iv),xd=e.multiplyByScalar(xd,i,xd),l(o)||(o=new e),e.add(iv,xd,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 Aj=new po,aue=new po,bj=new po,kq=new po,V3e=new po,xd=new po,iv=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 j3e=new h,H3e=new h;function G3e(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,j3e);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=H3e;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 ex=G3e;var Ll=class Ll{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 Ll(t,n,i)}static fromDegrees(t,n,i,r){return t=D.toRadians(t),n=D.toRadians(n),Ll.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:Ll._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:Ll._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Ll._ellipsoidCenterToleranceSquared,a=ex(t,r,o,s,q3e);if(!l(a))return;let c=h.multiplyComponents(a,o,W3e);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=D.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new Ll(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 Ll(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 Ll.clone(this,t)}equals(t){return Ll.equals(this,t)}equalsEpsilon(t,n){return Ll.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(Ll,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(Ll,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(Ll,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var sD=Ll;sD.ZERO=Object.freeze(new sD(0,0,0));var W3e=new h,q3e=new h,Y3e=new h,he=sD;function cue(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 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,cue(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)&&cue(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=X3e,r=K3e;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,J3e);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,$3e),o=h.subtract(t,i,Z3e),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 ex(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,Q3e),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 lue(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*lue(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)})})}};Fl.WGS84=Object.freeze(new Fl(6378137,6378137,6356752314245179e-9));Fl.UNIT_SPHERE=Object.freeze(new Fl(1,1,1));Fl.MOON=Object.freeze(new Fl(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Fl.MARS=Object.freeze(new Fl(3396190,3396190,3376200));Fl._default=Fl.WGS84;Fl.packedLength=h.packedLength;Fl.prototype.geocentricSurfaceNormal=h.normalize;var X3e=new h,K3e=new h,$3e=new h,J3e=new h,Z3e=new h,Q3e=new h,eUe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],tUe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function lue(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*eUe[s];o+=tUe[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Fl;var Uq=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=Uq;var uue={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(uue);var $t=uue;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,xj),e.magnitude(xj)}static distanceSquared(t,n){return e.subtract(t,n,xj),e.magnitudeSquared(xj)}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,fue),r=e.multiplyByScalar(t,1-i,r),e.add(fue,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,nUe);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),zq[0]=t,due?(n.x=Yc[0],n.y=Yc[1],n.z=Yc[2],n.w=Yc[3]):(n.x=Yc[3],n.y=Yc[2],n.z=Yc[1],n.w=Yc[0]),n}static unpackFloat(t){return due?(Yc[0]=t.x,Yc[1]=t.y,Yc[2]=t.z,Yc[3]=t.w):(Yc[0]=t.w,Yc[1]=t.z,Yc[2]=t.y,Yc[3]=t.x),zq[0]}};Js.packedLength=4;Js.fromArray=Js.unpack;var xj=new Js,fue=new Js,nUe=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 zq=new Float32Array(1),Yc=new Uint8Array(zq.buffer),iUe=new Uint32Array([287454020]),rUe=new Uint8Array(iUe.buffer),due=rUe[0]===68,se=Js;function oUe(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=oUe;function sUe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var wy=sUe;function aUe(e){return e%4===0&&e%100!==0||e%400===0}var Bl=aUe;var hue=[31,28,31,30,31,30,31,31,30,31,30,31];function cUe(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&&Bl(e)?hue[t-1]+1:hue[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Bh=cUe;function lUe(e,t){this.julianDate=e,this.offset=t}var yr=lUe;var mue={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(mue);var kn=mue;var pue={UTC:0,TAI:1};Object.freeze(pue);var si=pue;var gue=new Bh,Ej=[31,28,31,30,31,30,31,31,30,31,30,31],Cj=29;function jq(e,t){return mi.compare(e.julianDate,t.julianDate)}var rv=new yr;function vj(e){rv.julianDate=e;let t=mi.leapSeconds,n=vr(t,rv,jq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&mi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),mi.addSeconds(e,i,e)}function _ue(e,t){rv.julianDate=e;let n=mi.leapSeconds,i=vr(n,rv,jq);if(i<0&&(i=~i),i===0)return mi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return mi.addSeconds(e,-n[i-1].offset,t);let r=mi.secondsDifference(n[i].julianDate,e);if(r===0)return mi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return mi.addSeconds(e,-n[i-1].offset,t)}function Iy(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 Vq(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 uUe=/^(\d{4})$/,fUe=/^(\d{4})-(\d{2})$/,dUe=/^(\d{4})-?(\d{3})$/,hUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,mUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Hq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,pUe=/^(\d{2})(\.\d+)?/.source+Hq.source,gUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Hq.source,_Ue=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Hq.source;var Py={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},yUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function tg(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var yue=NaN,Aue=0;function bue(e,t,n,i,r,o,s){Py.year=e,Py.month=t,Py.day=n,Py.hour=i,Py.minute=r,Py.second=o,Py.millisecond=s}function AUe(e){let t=e.length;if(t===4){let m=tg(e,0),y=tg(e,2);return m<0||y<0?!1:(bue(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=tg(e,0),o=tg(e,2),s=tg(e,5),a=tg(e,8),c=tg(e,11),u=tg(e,14),f=tg(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/yUe[y]*1e3}let p=r*100+o,g=Bl(p);if((s!==2||!g?Ej[s-1]:Cj)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==yue&&(yue=m,Aue=new Date(m).getTimezoneOffset()),u=u+Aue}return bue(p,s,a,c,u,f,d),!0}function xue(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?Cj:Ej[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?Cj:Ej[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?Cj:Ej[t-1],n+=u;let d=Vq(e,t,n,i,r,o,s);return l(c)?(Iy(d[0],d[1],c),vj(c)):c=new mi(d[0],d[1],si.UTC),f&&mi.addSeconds(c,1,c),c}var mi=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,Iy(r,n,this),i===si.UTC&&vj(this)}static fromGregorianDate(t,n){let i=Vq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Iy(i[0],i[1],n),vj(n),n):new e(i[0],i[1],si.UTC)}static fromDate(t,n){let i=Vq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Iy(i[0],i[1],n),vj(n),n):new e(i[0],i[1],si.UTC)}static fromIso8601(t,n){if(AUe(t)){let A=Py;return xue(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,Bl(A.year),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(mUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(fUe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(uUe),i!==null)r=+i[1];else{let A;if(i=d.match(dUe),i!==null)r=+i[1],A=+i[2],m=Bl(r);else if(i=d.match(hUe),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=Bl(r);let y;if(l(p)){i=p.match(_Ue),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(gUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(pUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return xue(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=_ue(t,Tj);l(r)||(e.addSeconds(t,-1,Tj),r=_ue(Tj,Tj),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,gue),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,gue),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,jq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Iy(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_MINUTE;return Iy(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_HOUR;return Iy(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return Iy(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)}},Tj=new mi(0,0,si.TAI);mi.leapSeconds=[new yr(new mi(2441317,43210,si.TAI),10),new yr(new mi(2441499,43211,si.TAI),11),new yr(new mi(2441683,43212,si.TAI),12),new yr(new mi(2442048,43213,si.TAI),13),new yr(new mi(2442413,43214,si.TAI),14),new yr(new mi(2442778,43215,si.TAI),15),new yr(new mi(2443144,43216,si.TAI),16),new yr(new mi(2443509,43217,si.TAI),17),new yr(new mi(2443874,43218,si.TAI),18),new yr(new mi(2444239,43219,si.TAI),19),new yr(new mi(2444786,43220,si.TAI),20),new yr(new mi(2445151,43221,si.TAI),21),new yr(new mi(2445516,43222,si.TAI),22),new yr(new mi(2446247,43223,si.TAI),23),new yr(new mi(2447161,43224,si.TAI),24),new yr(new mi(2447892,43225,si.TAI),25),new yr(new mi(2448257,43226,si.TAI),26),new yr(new mi(2448804,43227,si.TAI),27),new yr(new mi(2449169,43228,si.TAI),28),new yr(new mi(2449534,43229,si.TAI),29),new yr(new mi(2450083,43230,si.TAI),30),new yr(new mi(2450630,43231,si.TAI),31),new yr(new mi(2451179,43232,si.TAI),32),new yr(new mi(2453736,43233,si.TAI),33),new yr(new mi(2454832,43234,si.TAI),34),new yr(new mi(2456109,43235,si.TAI),35),new yr(new mi(2457204,43236,si.TAI),36),new yr(new mi(2457754,43237,si.TAI),37)];var K=mi;var jue=Qo(xf(),1);function bUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var aD=bUe;function Iue(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=Iue(r,t)),n[i]=r}return n}var Je=Iue;function Pue(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]=Pue(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=Pue;function xUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Iu=xUe;var Due=Qo(xf(),1);function Gq(e,t){let n;return typeof document<"u"&&(n=document),Gq._implementation(e,t,n)}Gq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Due.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Td=Gq;var Rue=Qo(xf(),1);function TUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Rue.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var cD=TUe;var Oue=Qo(xf(),1);function EUe(e){let t=new Oue.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 ng=EUe;var Mue={};function CUe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Mue[t];l(i)||(i={},Mue[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=CUe;var vUe=/^blob:/i;function SUe(e){return vUe.test(e)}var tx=SUe;var Sp;function wUe(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 Dy=wUe;var IUe=/^data:/i;function PUe(e){return IUe.test(e)}var Uh=PUe;function DUe(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 nx=DUe;function RUe(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 ix=RUe;function OUe(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 Tf=OUe;var Nue={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Nue);var Ti=Nue;var Lue={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Lue);var Zs=Lue;function Pj(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}Pj.prototype.cancel=function(){this.cancelled=!0};Pj.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 Pj(this)};var wo=Pj;function MUe(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 lD=MUe;function Fue(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=lD(this.responseHeaders))}Fue.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var wp=Fue;var Dj=Qo(xf(),1);function rx(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(rx.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 Wq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}rx.prototype.reserve=function(e){e=e??this._length,this._array.length=e};rx.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?(Wq(i,r,e),e=r):o=!1}};rx.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};rx.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)Wq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};rx.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Wq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var uD=rx;function fD(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(fD.prototype=Object.create(Error.prototype),fD.prototype.constructor=fD);fD.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var oe=fD;function NUe(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 uD({comparator:NUe});Xc.maximumLength=av;Xc.reserve(av);var Ip=[],ig={},LUe=typeof document<"u"?new Dj.default(document.location.href):new Dj.default,Rj=new be;function Io(){}Io.maximumRequests=50;Io.maximumRequestsPerServer=18;Io.requestsByServer={};Io.throttleRequests=!0;Io.debugShowStatistics=!1;Io.requestCompletedEvent=Rj;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();ox(t)}av=e,Xc.maximumLength=e,Xc.reserve(e)}}});function Bue(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Io.serverHasOpenSlots=function(e,t){t=t??1;let n=Io.requestsByServer[e]??Io.maximumRequestsPerServer;return ig[e]+t<=n};Io.heapHasOpenSlots=function(e){return Xc.length+e<=av};function kue(e){return e.state===Ti.UNISSUED&&(e.state=Ti.ISSUED,e.deferred=Iu()),e.deferred.promise}function FUe(e){return function(t){if(e.state===Ti.CANCELLED)return;let n=e.deferred;--Sr.numberOfActiveRequests,--ig[e.serverKey],Rj.raiseEvent(),e.state=Ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function BUe(e){return function(t){e.state!==Ti.CANCELLED&&(++Sr.numberOfFailedRequests,--Sr.numberOfActiveRequests,--ig[e.serverKey],Rj.raiseEvent(t),e.state=Ti.FAILED,e.deferred.reject(t))}}function Uue(e){let t=kue(e);return e.state=Ti.ACTIVE,Ip.push(e),++Sr.numberOfActiveRequests,++Sr.numberOfActiveRequestsEver,++ig[e.serverKey],e.requestFunction().then(FUe(e)).catch(BUe(e)),t}function ox(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,--ig[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&&ox(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)Bue(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){ox(t);continue}if(t.throttleByServer&&!Io.serverHasOpenSlots(t.serverKey)){ox(t);continue}Uue(t),++a}kUe()};Io.getServerKey=function(e){let t=new Dj.default(e);t.scheme()===""&&(t=t.absoluteTo(LUe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=ig[n];return l(i)||(ig[n]=0),n};Io.request=function(e){if(Uh(e.url)||tx(e.url))return Rj.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 Uue(e);if(Ip.length>=Io.maximumRequests)return;Bue(e);let t=Xc.insert(e);if(l(t)){if(t===e)return;ox(t)}return kue(e)};function kUe(){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();ox(t)}let e=Ip.length;for(let t=0;t<e;++t)ox(Ip[t]);Ip.length=0,ig={},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 ig[e]};Io.requestHeap=Xc;var Kc=Io;var zue=Qo(xf(),1);var dD={},cv={};dD.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(cv[n])||(cv[n]=!0)};dD.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(cv[n])&&delete cv[n]};function UUe(e){let t=new zue.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}}dD.contains=function(e){let t=UUe(e);return!!(l(t)&&l(cv[t]))};dD.clear=function(){cv={}};var lv=dD;var Hue=(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 Hue}}});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 ng(this._url)}},isDataUri:{get:function(){return Uh(this._url)}},isBlobUri:{get:function(){return tx(this._url)}},isCrossOriginUrl:{get:function(){return Dy(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 jue.default(e),o=zUe(r.query());this._queryParameters=t?Mj(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(Td(i))),this._url=r.toString()};function zUe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Tf(e)}function Mj(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}${VUe(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 VUe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${ix(e)}`}zt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Mj(this._queryParameters,e,!1):this._queryParameters=Mj(e,this._queryParameters,!1)};zt.prototype.appendQueryParameters=function(e){this._queryParameters=Mj(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 cD(this.getUrlComponent(e),e)};zt.prototype.appendForwardSlash=function(){this._url=aD(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),!Hue||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 Gue(this,e,t)};function Gue(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,Gue(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 jUe=/^data:(.*?)(;base64)?,(.*)$/;function Oj(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Vue(e,t){let n=Oj(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 HUe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return Oj(i,r);case"arraybuffer":return Vue(i,r);case"blob":return o=Vue(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(Oj(i,r),n);case"json":return JSON.parse(Oj(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 GUe(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 WUe=typeof XMLHttpRequest>"u";zt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=jUe.exec(e);if(a!==null){o.resolve(HUe(a,t));return}if(WUe){GUe(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 nx(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 mD(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)?Wue(this,e.data):Wue(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}mD.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 mD({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};mD.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 wy(0,0,0,0,0),t}});mD.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new wy(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,Yue(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,Yue(this,n,this._samples,e,r,o,t),t};function qUe(e,t){return K.compare(e.julianDate,t)}function Wue(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,qUe);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function que(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 hD(e,t,n){return t+e*(n-t)}function Yue(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 que(e,n,r,a,s),s;if(i.equals(u))return que(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=hD(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=hD(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=hD(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=hD(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=hD(f,g,m),s}var pD=mD;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 Xue={},Kue=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function YUe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Kue.exec(i);if(r!==null)return r[1]}}var Nj;function $ue(e){return typeof document>"u"?e:(l(Nj)||(Nj=document.createElement("a")),Nj.href=e,Nj.href)}var sx;function Jue(){if(l(sx))return sx;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(Xue?.url)?e=Td(".",Xue.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Td("..",ax("Core/buildModuleUrl.js")):e=YUe(),sx=new De({url:$ue(e)}),sx.appendForwardSlash(),sx}function XUe(e){return $ue(require.toUrl(`../${e}`))}function Zue(e){return Jue().getDerivedResource({url:e}).url}var Lj;function ax(e){return l(Lj)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Lj=XUe:Lj=Zue),Lj(e)}ax._cesiumScriptRegex=Kue;ax._buildModuleUrlFromBaseUrl=Zue;ax._clearBaseResource=function(){sx=void 0};ax.setBaseUrl=function(e){sx=De.DEFAULT.getDerivedResource({url:e})};ax.getCesiumBaseUrl=Jue;var Zt=ax;function KUe(e,t,n){this.x=e,this.y=t,this.s=n}var cx=KUe;function Fj(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 $Ue=new K(0,0,si.TAI);function Yq(e,t,n){let i=$Ue;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}Fj.prototype.preload=function(e,t,n,i){let r=Yq(this,e,t),o=Yq(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(Xq(this,d));return Promise.all(f)};Fj.prototype.computeXysRadians=function(e,t,n){let i=Yq(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])||(Xq(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(Xq(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new cx(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};Fj.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 JUe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function Xq(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=JUe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var gD=Fj;var ZUe=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,ZUe,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,QUe),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,eze),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],Kq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],Kq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],Kq)),n}static getMaximumScale(t){return e.getScale(t,Que),h.maximumComponent(Que)}static setRotation(t,n,i){let r=e.getScale(t,tze);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,nze);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*rze(c);for(;s<r&&oze(c)>u;)sze(c,Bj),e.transpose(Bj,efe),e.multiply(c,Bj,c),e.multiply(efe,c,c),e.multiply(a,Bj,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,ize),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]})`}};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 Dze=new h,Rze=new h,rY=new h,vfe=new h,Oze=new h,Mze=new h,kj=new br,Sfe=new br,Nze=new br;function Lze(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var oY=[1,0,0],sY=[2,2,1];function Fze(e){let t=0;for(let n=0;n<3;++n){let i=e[br.getElementIndex(sY[n],oY[n])];t+=2*i*i}return Math.sqrt(t)}function Bze(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[br.getElementIndex(sY[u],oY[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=oY[r],c=sY[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;var kze=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,kze,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,mv),h.normalize(h.cross(mv,o,pv),pv),h.normalize(h.cross(pv,mv,bD),bD);let s=pv.x,a=pv.y,c=pv.z,u=mv.x,f=mv.y,d=mv.z,p=bD.x,g=bD.y,m=bD.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,Uze),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,zze),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],aY)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],aY)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],aY)),n}static getMaximumScale(t){return e.getScale(t,wfe),h.maximumComponent(wfe)}static setRotation(t,n,i){let r=e.getScale(t,Vze);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,jze);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,Hze),Gze,D.EPSILON7)&&se.equals(e.getRow(t,3,Wze),qze))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,Yze),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[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 QUe=new h,eze=new h,Kq=new h,Que=new h,tze=new h,nze=new h,Bj=new br,efe=new br,ize=new br;function rze(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var $q=[1,0,0],Jq=[2,2,1];function oze(e){let t=0;for(let n=0;n<3;++n){let i=e[br.getElementIndex(Jq[n],$q[n])];t+=2*i*i}return Math.sqrt(t)}function sze(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[br.getElementIndex(Jq[u],$q[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=$q[r],c=Jq[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;var aze=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,aze,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,fv),h.normalize(h.cross(fv,o,dv),dv),h.normalize(h.cross(dv,fv,_D),_D);let s=dv.x,a=dv.y,c=dv.z,u=fv.x,f=fv.y,d=fv.z,p=_D.x,g=_D.y,m=_D.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,cze),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,lze),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],Zq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],Zq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],Zq)),n}static getMaximumScale(t){return e.getScale(t,tfe),h.maximumComponent(tfe)}static setRotation(t,n,i){let r=e.getScale(t,uze);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,fze);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,dze),hze,D.EPSILON7)&&se.equals(e.getRow(t,3,mze),pze))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,gze),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]})`}};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 mv=new h,pv=new h,bD=new h,Uze=new h,zze=new h,aY=new h,wfe=new h,Vze=new h,jze=new h,Hze=new $,Gze=new $,Wze=new se,qze=new se(0,0,0,1),Yze=new go,N=go;var Ry,ps={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Du={};Object.defineProperties(Du,{element:{get:function(){if(Du.supportsFullscreen())return document[ps.fullscreenElement]}},changeEventName:{get:function(){if(Du.supportsFullscreen())return ps.fullscreenchange}},errorEventName:{get:function(){if(Du.supportsFullscreen())return ps.fullscreenerror}},enabled:{get:function(){if(Du.supportsFullscreen())return document[ps.fullscreenEnabled]}},fullscreen:{get:function(){if(Du.supportsFullscreen())return Du.element!==null}}});Du.supportsFullscreen=function(){if(l(Ry))return Ry;Ry=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ps.requestFullscreen="requestFullscreen",ps.exitFullscreen="exitFullscreen",ps.fullscreenEnabled="fullscreenEnabled",ps.fullscreenElement="fullscreenElement",ps.fullscreenchange="fullscreenchange",ps.fullscreenerror="fullscreenerror",Ry=!0,Ry;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"?(ps.requestFullscreen=n,Ry=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ps.requestFullscreen=n,Ry=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ps.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ps.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ps.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ps.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ps.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ps.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ps.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ps.fullscreenerror=n)}return Ry};Du.requestFullscreen=function(e,t){Du.supportsFullscreen()&&e[ps.requestFullscreen]({vrDisplay:t})};Du.exitFullscreen=function(){Du.supportsFullscreen()&&document[ps.exitFullscreen]()};Du._names=ps;var es=Du;var Ed;typeof navigator<"u"?Ed=navigator:Ed={};function xD(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var Uj,Ife;function dY(){if(!l(Uj)&&(Uj=!1,!Wj())){let e=/ Chrome\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(Uj=!0,Ife=xD(e[1]))}return Uj}function Xze(){return dY()&&Ife}var zj,Pfe;function Dfe(){if(!l(zj)&&(zj=!1,!dY()&&!Wj()&&/ Safari\/[\.0-9]+/.test(Ed.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(zj=!0,Pfe=xD(e[1]))}return zj}function Kze(){return Dfe()&&Pfe}var Vj,fY;function Rfe(){if(!l(Vj)){Vj=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ed.userAgent);e!==null&&(Vj=!0,fY=xD(e[1]),fY.isNightly=!!e[2])}return Vj}function $ze(){return Rfe()&&fY}var jj,Ofe;function Wj(){if(!l(jj)){jj=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(jj=!0,Ofe=xD(e[1]))}return jj}function Jze(){return Wj()&&Ofe}var Hj,hY;function qj(){if(!l(Hj)){Hj=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(Hj=!0,hY=xD(e[1]))}return Hj}var cY;function Zze(){return l(cY)||(cY=/Windows/i.test(Ed.appVersion)),cY}var lY;function Qze(){return l(lY)||(lY=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),lY}function eVe(){return qj()&&hY}var uY;function tVe(){return l(uY)||(uY=!qj()&&typeof PointerEvent<"u"&&(!l(Ed.pointerEnabled)||Ed.pointerEnabled)),uY}var Mfe,Gj;function Nfe(){if(!l(Gj)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;Gj=l(t)&&t!=="",Gj&&(Mfe=t)}return Gj}function nVe(){return Nfe()?Mfe:void 0}function kl(){return kl._result}kl._promise=void 0;kl._result=void 0;kl.initialize=function(){return l(kl._promise)||(kl._promise=new Promise(e=>{let t=new Image;t.onload=function(){kl._result=t.width>0&&t.height>0,e(kl._result)},t.onerror=function(){kl._result=!1,e(kl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),kl._promise};Object.defineProperties(kl,{initialized:{get:function(){return l(kl._result)}}});var gv=[];typeof ArrayBuffer<"u"&&(gv.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&gv.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&gv.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&gv.push(BigInt64Array),typeof BigUint64Array<"u"&&gv.push(BigUint64Array));var Cd={isChrome:dY,chromeVersion:Xze,isSafari:Dfe,safariVersion:Kze,isWebkit:Rfe,webkitVersion:$ze,isEdge:Wj,edgeVersion:Jze,isFirefox:qj,firefoxVersion:eVe,isWindows:Zze,isIPadOrIOS:Qze,hardwareConcurrency:Ed.hardwareConcurrency??3,supportsPointerEvents:tVe,supportsImageRenderingPixelated:Nfe,supportsWebP:kl,imageRenderingValue:nVe,typedArrayTypes:gv};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!qj()||parseInt(hY)>=114};var dn=Cd;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var TD=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);TD=h.normalize(e,TD);let o=TD.x*r,s=TD.y*r,a=TD.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 iVe=[1,2,0],rVe=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=iVe,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=rVe;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 Lfe=new dt,Ffe=new dt,mY=new dt,Bfe=new dt;dt.fromHeadingPitchRoll=function(e,t){return Bfe=dt.fromAxisAngle(h.UNIT_X,e.roll,Lfe),mY=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(mY,Bfe,mY),Ffe=dt.fromAxisAngle(h.UNIT_Z,-e.heading,Lfe),dt.multiply(Ffe,t,t)};var Yj=new h,pY=new h,jh=new dt,kfe=new dt,Xj=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,Xj),dt.conjugate(Xj,Xj);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,jh),dt.multiply(jh,Xj,jh),jh.w<0&&dt.negate(jh,jh),dt.computeAxis(jh,Yj);let a=dt.computeAngle(jh);l(i)||(i=[]),i[s]=Yj.x*a,i[s+1]=Yj.y*a,i[s+2]=Yj.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,pY);let o=h.magnitude(pY);return dt.unpack(t,i*4,kfe),o===0?dt.clone(dt.IDENTITY,jh):dt.fromAxisAngle(pY,o,jh),dt.multiply(jh,kfe,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 gY=new dt;dt.lerp=function(e,t,n,i){return gY=dt.multiplyByScalar(t,n,gY),i=dt.multiplyByScalar(e,1-n,i),dt.add(gY,i,i)};var Ufe=new dt,_Y=new dt,yY=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=Ufe=dt.negate(t,Ufe)),1-r<D.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return _Y=dt.multiplyByScalar(e,Math.sin((1-n)*s),_Y),yY=dt.multiplyByScalar(o,Math.sin(n*s),yY),i=dt.add(_Y,yY,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 oVe=new h,sVe=new h,ED=new dt,_v=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,ED);dt.multiply(r,n,_v);let o=dt.log(_v,oVe);dt.multiply(r,e,_v);let s=dt.log(_v,sVe);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,ED),dt.multiply(t,ED,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,ED),a=dt.slerp(n,i,r,_v);return dt.slerp(s,a,2*r*(1-r),o)};var aVe=new dt,zfe=1.9011074535173003,Kj=dn.supportsTypedArrays()?new Float32Array(8):[],$j=dn.supportsTypedArrays()?new Float32Array(8):[],rg=dn.supportsTypedArrays()?new Float32Array(8):[],og=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Kj[e]=1/(t*n),$j[e]=t/n}Kj[7]=zfe/136;$j[7]=zfe*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)rg[g]=(Kj[g]*c-$j[g])*s,og[g]=(Kj[g]*u-$j[g])*s;let f=o*n*(1+rg[0]*(1+rg[1]*(1+rg[2]*(1+rg[3]*(1+rg[4]*(1+rg[5]*(1+rg[6]*(1+rg[7])))))))),d=a*(1+og[0]*(1+og[1]*(1+og[2]*(1+og[3]*(1+og[4]*(1+og[5]*(1+og[6]*(1+og[7])))))))),p=dt.multiplyByScalar(e,d,aVe);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,ED),a=dt.fastSlerp(n,i,r,_v);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"}},yv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},bY={},Ru={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Oy=new h,My=new h,Ny=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(bY[r])?i=bY[r]:(i=function(o,s,a){if(l(a)||(a=new N),h.equalsEpsilon(o,h.ZERO,D.EPSILON14))h.unpack(yv[e],0,Oy),h.unpack(yv[t],0,My),h.unpack(yv[n],0,Ny);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);h.unpack(yv[e],0,Oy),e!=="east"&&e!=="west"&&h.multiplyByScalar(Oy,c,Oy),h.unpack(yv[t],0,My),t!=="east"&&t!=="west"&&h.multiplyByScalar(My,c,My),h.unpack(yv[n],0,Ny),n!=="east"&&n!=="west"&&h.multiplyByScalar(Ny,c,Ny)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,Ru.up);let c=Ru.up,u=Ru.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Ru.east),h.cross(c,u,Ru.north),h.multiplyByScalar(Ru.up,-1,Ru.down),h.multiplyByScalar(Ru.east,-1,Ru.west),h.multiplyByScalar(Ru.north,-1,Ru.south),Oy=Ru[e],My=Ru[t],Ny=Ru[n]}return a[0]=Oy.x,a[1]=Oy.y,a[2]=Oy.z,a[3]=0,a[4]=My.x,a[5]=My.y,a[6]=My.z,a[7]=0,a[8]=Ny.x,a[9]=Ny.y,a[10]=Ny.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},bY[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 cVe=new Le,lVe=new h(1,1,1),uVe=new N;Ei.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ei.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,cVe),s=N.fromTranslationQuaternionRotationScale(h.ZERO,o,lVe,uVe);return r=i(e,n,r),N.multiply(r,s,r)};var fVe=new N,dVe=new $;Ei.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ei.headingPitchRollToFixedFrame(e,t,n,i,fVe),s=N.getMatrix3(o,dVe);return Le.fromRotationMatrix(s,r)};var hVe=new h(1,1,1),mVe=new h,Vfe=new N,pVe=new N,gVe=new $,_Ve=new Le;Ei.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??Ei.eastNorthUpToFixedFrame,l(i)||(i=new Ic);let r=N.getTranslation(e,mVe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,Vfe),Vfe),s=N.setScale(e,hVe,pVe);s=N.setTranslation(s,h.ZERO,s),o=N.multiply(o,s,o);let a=Le.fromRotationMatrix(N.getMatrix3(o,gVe),_Ve);return a=Le.normalize(a,a),Ic.fromQuaternion(a,i)};var yVe=6*3600+2460+50.54841,AVe=8640184812866e-6,bVe=.093104,xVe=-62e-7,TVe=11772758384668e-32,EVe=72921158553e-15,CVe=D.TWO_PI/86400,Jj=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){Jj=K.addSeconds(e,-K.computeTaiMinusUtc(e),Jj);let n=Jj.dayNumber,i=Jj.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=(yVe+r*(AVe+r*(bVe+r*xVe)))*CVe%D.TWO_PI,c=EVe+TVe*(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 AD;Ei.earthOrientationParameters=yD.NONE;var EY=32.184,vVe=2451545;Ei.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+EY,i=e.stop.dayNumber,r=e.stop.secondsOfDay+EY;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 SVe=32.184,wVe=2451545,Zj=new Ic,IVe=new $,PVe=new K;Ei.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,SVe,PVe),i=K.totalDays(n)-wVe,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 Zj.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),Zj.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),Zj.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(Zj,IVe,t)};Ei.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var DVe=new ux(0,0,0),RVe=new wy(0,0,0,0,0,0),xY=new $,TY=new $;Ei.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ei.earthOrientationParameters.compute(e,RVe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+EY,o=Ei.iau2006XysData.computeXysRadians(i,r,DVe);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=xY;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,TY),d=$.multiply(u,f,xY),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,TY),x=$.multiply(d,b,xY),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-vVe+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),_=TY;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 OVe=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=OVe;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 MVe=new h,NVe=new h,LVe=new h;Ei.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,MVe),o=h.cross(t,r,NVe);h.equalsEpsilon(o,h.ZERO,D.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,LVe);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 jfe=new he,CY=new h,FVe=new h,BVe=new $,vY=new N,Hfe=new N;Ei.basisTo2D=function(e,t,n){let i=N.getTranslation(t,FVe),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,CY);else{let f=r.cartesianToCartographic(i,jfe);o=e.project(f,CY),h.fromElements(o.z,o.x,o.y,o)}let s=Ei.eastNorthUpToFixedFrame(i,r,vY),a=N.inverseTransformation(s,Hfe),c=N.getMatrix3(t,BVe),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,vY),o=N.inverseTransformation(r,Hfe),s=i.cartesianToCartographic(t,jfe),a=e.project(s,CY);h.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,vY);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,o,n),N.multiply(c,n,n),n};var At=Ei;var Av=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,kVe),a=N.multiplyByPointAsVector(s,h.UNIT_X,UVe);h.normalize(a,a);let c=N.multiplyByPointAsVector(s,h.UNIT_Y,zVe);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,jVe),f=h.negate(a,VVe),d=SY,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=HVe;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}};Av.packedLength=4;var kVe=new N,UVe=new h,zVe=new h,VVe=new h,jVe=new h,SY=new Array(5);for(let e=0;e<SY.length;++e)SY[e]=new h;var HVe=new he;Av.MAX_VALUE=Object.freeze(new Av(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ie=Av;var wY=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new zi(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=wY;var CD=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)}};CD.MaximumLatitude=CD.mercatorAngleToGeodeticLatitude(Math.PI);var _i=CD;var IY=new he,PY=new he,Gfe=new h,Wfe=new h,DY=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 _i(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,Gfe),this._projection.unproject(Gfe,IY),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Wfe),this._projection.unproject(Wfe,PY),this._rectangle=new ie(IY.longitude,IY.latitude,PY.longitude,PY.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)}},Po=DY;var RY,qfe="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",bv={};bv.defaultAccessToken=qfe;bv.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});bv.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});bv.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});bv.getDefaultTokenCredit=function(e){if(e===qfe){if(!l(RY)){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>';RY=new It(t,!0)}return RY}};var vf=bv;function OY(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=zh(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)}OY.prototype.isReady=function(){return this._isReady};OY.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=zh(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 vD=OY;function MY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}MY.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])};MY.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 Hh=MY;function xv(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(xv.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}}});xv.clone=function(e){if(l(e))return new xv(e._format,e._datatype,e._width,e._height,e._buffer)};xv.prototype.clone=function(){return xv.clone(this)};var SD=xv;var Yfe=Qo(Ef(),1);function GVe(){return!0}function WVe(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=GVe}var le=WVe;function Xfe(){if(!l(ic._canTransferArrayBuffer)){let e=FY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ic._canTransferArrayBuffer=!1,ic._canTransferArrayBuffer}ic._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),ic._canTransferArrayBuffer=s}})}return ic._canTransferArrayBuffer}var LY=new be;function NY(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 FY(e){let t=new Yfe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(Dy(e))s=e;else if(!n){let a=Zt(`${ic._workerModulePrefix}/${i}.js`);Dy(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=NY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${NY(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return o=NY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${ic._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 qVe(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 ic(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var YVe=(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),LY.raiseEvent(s),i(s)}else LY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},XVe=[];async function KVe(e,t,n){let i=await Promise.resolve(Xfe());l(n)?i||(n.length=0):n=XVe;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",YVe(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function $Ve(e,t,n){++e._activeTasks;try{let i=await KVe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ic.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=FY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return $Ve(this,e,t)};ic.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=FY(this._workerPath),i=await qVe(this,e),r=await Promise.resolve(Xfe()),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};ic.prototype.isDestroyed=function(){return!1};ic.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),le(this)};ic.taskCompletedEvent=LY;ic._defaultWorkerModulePrefix="Workers/";ic._workerModulePrefix=ic._defaultWorkerModulePrefix;ic._canTransferArrayBuffer=void 0;var Kn=ic;function sg(){}sg._transcodeTaskProcessor=new Kn("transcodeKTX2",Number.POSITIVE_INFINITY);sg._readyPromise=void 0;function JVe(){let e=sg._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return sg._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});sg._readyPromise=e}sg.transcode=function(e,t){return l(sg._readyPromise)||JVe(),sg._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 SD(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 wD=sg;var Kfe;$fe.setKTX2SupportedFormats=function(e,t,n,i,r,o){Kfe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function $fe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return wD.transcode(n,Kfe)})}var Ou=$fe;function Tv(){pe.throwInstantiationError()}Object.defineProperties(Tv.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}});Tv.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};Tv.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};Tv.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var ZVe=/\.ktx2$/i;Tv.loadImage=function(e,t){let n=De.createIfNeeded(t);return ZVe.test(n.url)?Ou(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Sf=Tv;function Jfe(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}Jfe.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 vD({missingImageUrl:Zfe(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 QVe(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 Po({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 _i,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 e4e(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 t4e(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();QVe(i,t)}catch(i){e4e(e,i)}}function Rp(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}Rp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Bh.SATELLITE:{n=t.token??vf.defaultAccessToken,i=De.createIfNeeded(vf.defaultWorldImageryServer),i.appendForwardSlash();let o=vf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Bh.OCEANS:{n=t.token??vf.defaultAccessToken,i=De.createIfNeeded(vf.defaultWorldOceanServer),i.appendForwardSlash();let o=vf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Bh.HILLSHADE:{n=t.token??vf.defaultAccessToken,i=De.createIfNeeded(vf.defaultWorldHillshadeServer),i.appendForwardSlash();let o=vf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Rp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function Zfe(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 zi?(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(Rp.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}}});Rp.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 Rp(t);i._resource=n;let r=new Jfe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await t4e(n,r),r.build(i),i};Rp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Rp.prototype.requestImage=function(e,t,n,i){return Sf.loadImage(this,Zfe(this,e,t,n,i))};Rp.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 zi)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 Hh;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 _i;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};Rp._metadataCache={};var ag=Rp;var Ev={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};Ev.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?Ev.SUNLIGHT:Ev.SCENE_LIGHT:Ev.NONE};Object.freeze(Ev);var cg=Ev;function Qfe(){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=cg.NONE}Qfe.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 fx=Qfe;var n4e=Object.freeze([NaN,NaN,NaN,NaN]),Mu=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,n4e,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,i4e),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,r4e),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],ede)),n.y=U.magnitude(U.fromElements(t[2],t[3],ede)),n}static getMaximumScale(t){return e.getScale(t,tde),U.maximumComponent(tde)}static setRotation(t,n,i){let r=e.getScale(t,o4e);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,s4e);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]})`}};Mu.packedLength=4;Mu.fromArray=Mu.unpack;Mu.IDENTITY=new Mu(1,0,0,1);Mu.ZERO=new Mu(0,0,0,0);Mu.COLUMN0ROW0=0;Mu.COLUMN0ROW1=1;Mu.COLUMN1ROW0=2;Mu.COLUMN1ROW1=3;var i4e=new U,r4e=new U,ede=new U,tde=new U,o4e=new U,s4e=new U,Xi=Mu;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;function BY(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 UY[0]=t,e.fromBytes(lg[0],lg[1],lg[2],lg[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=BY(f,u,t+1/3),a=BY(f,u,t),c=BY(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=a4e.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=c4e.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=l4e.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=u4e.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 lg[0]=t,lg[1]=n,lg[2]=i,lg[3]=r,UY[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}},kY,UY,lg;dn.supportsTypedArrays()&&(kY=new ArrayBuffer(4),UY=new Uint32Array(kY),lg=new Uint8Array(kY));var a4e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,c4e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,l4e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,u4e=/^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 Qj(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}Qj.ALL=Object.freeze(new Qj({color:new z(0,0,0,0),depth:1,stencil:0}));Qj.prototype.execute=function(e,t){e.clear(this,t)};var li=Qj;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 zY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function e6(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Gh(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;zY(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;e6(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;zY(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;e6(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;e6(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;zY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;e6(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Gh.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)}}});Gh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Gh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Gh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Gh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Gh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Gh.prototype.getColorTexture=function(e){return this._colorTextures[e]};Gh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Gh.prototype.isDestroyed=function(){return!1};Gh.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),le(this)};var gs=Gh;function Cv(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 gs({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new gs({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}Cv.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};Cv.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};Cv.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)};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var ID=Cv;var Ul={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===Ul.RGBA4||e===Ul.RGBA8||e===Ul.RGBA16F||e===Ul.RGBA32F||e===Ul.RGB5_A1||e===Ul.RGB565||e===Ul.DEPTH_COMPONENT16||e===Ul.STENCIL_INDEX8||e===Ul.DEPTH_STENCIL||e===Ul.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Ul.RGBA32F:e===te.HALF_FLOAT_OES?Ul.RGBA16F:Ul.RGBA8}};Object.freeze(Ul);var zl=Ul;function PD(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumRenderbufferSize,r=e.format??zl.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(PD.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});PD.prototype._getRenderbuffer=function(){return this._renderbuffer};PD.prototype.isDestroyed=function(){return!1};PD.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var wf=PD;var DD={NEAREST:te.NEAREST,LINEAR:te.LINEAR};DD.validate=function(e){return e===DD.NEAREST||e===DD.LINEAR};Object.freeze(DD);var $n=DD;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 RD={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===RD.CLAMP_TO_EDGE||e===RD.REPEAT||e===RD.MIRRORED_REPEAT}};Object.freeze(RD);var hn=RD;function OD(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=$n.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(OD.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}}});OD.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};OD.NEAREST=Object.freeze(new OD({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:$n.NEAREST}));var jt=OD;function f4e(){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=f4e;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 vd=MD;function Sd(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??Jn(),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,ode(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)?d4e(this,n):nde(this,n):l(n.framebuffer)?m4e(this,n):ide(this,n),this._initialized=!0):rde(this),g.bindTexture(this._textureTarget,null)}function d4e(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=t6(c),u=t6(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function nde(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=t6(g),m=t6(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function h4e(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 m4e(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 ide(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 p4e(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 t6(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function rde(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)}Sd.create=function(e){return new Sd(e)};Sd.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 Sd({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(Sd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){ode(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 ode(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=$n.NEAREST),o.webgl2&&Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=$n.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)}Sd.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)?nde(this,i):ide(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),rde(this)),this._initialized=!0),f||(l(i.arrayBufferView)?h4e(this,i.arrayBufferView,t,n,c,u):p4e(this,i,t,n)),s.bindTexture(a,null)};Sd.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};Sd.prototype.generateMipmap=function(e){e=e??vd.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)};Sd.prototype.isDestroyed=function(){return!1};Sd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};Sd.defaultColor=z.WHITE;var Dt=Sd;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=zl.getColorFormat(r);this._colorRenderbuffers[s]=new wf({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 wf({context:e,width:t,height:n,format:zl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new wf({context:e,width:t,height:n,format:zl.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 wf({context:e,width:t,height:n,format:zl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new ID({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 gs({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 dx(){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(dx.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 sde(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 g4e(e,t){sde(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 ade(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 _4e(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 y4e(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 A4e(e,t){ade(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(y4e(o,i),{framebuffer:n[o].framebuffer,uniformMap:_4e(e,o)});e._commands=r}dx.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)};dx.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,g4e(this,e),A4e(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};dx.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)};dx.prototype.isDestroyed=function(){return!1};dx.prototype.destroy=function(){return sde(this),ade(this),le(this)};var ND=dx;var Op={X:0,Y:1,Z:2};Op.Y_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Op.Z_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Op.X_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Op.Z_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Op.X_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Op.Y_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Op.fromName=function(e){return Op[e]};Object.freeze(Op);var Vi=Op;var jY=Qo(Ef(),1);var VY,cde="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",n6={};n6.defaultAccessToken=cde;n6.defaultServer=new De({url:"https://api.cesium.com/"});n6.getDefaultTokenCredit=function(e){if(e===cde){if(!l(VY)){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>`;VY=new It(t,!0)}return VY}};var Nu=n6;function Jc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:b4e};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 jY.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)&&(Jc.prototype=Object.create(De.prototype),Jc.prototype.constructor=Jc);Jc.fromAssetId=function(e,t){let n=Jc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Jc(i,n)})};Object.defineProperties(Jc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Jc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Jc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=Nu.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};Jc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(Jc.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};Jc.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)};Jc.prototype._makeRequest=function(e){return this._isExternal||new jY.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=HY(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Jc._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??Nu.defaultServer,i=t.accessToken??Nu.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=HY(r.headers),n.getDerivedResource(r)};function HY(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}Jc._addClientHeaders=HY;function b4e(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 jo=Jc;var lde=/{[^}]+}/g,ude={x:C4e,y:S4e,z:P4e,s:D4e,reverseX:v4e,reverseY:w4e,reverseZ:I4e,westDegrees:R4e,southDegrees:O4e,eastDegrees:M4e,northDegrees:N4e,westProjected:L4e,southProjected:F4e,eastProjected:B4e,northProjected:k4e,width:U4e,height:z4e},x4e=Ot(ude,{i:V4e,j:j4e,reverseI:H4e,reverseJ:G4e,longitudeDegrees:q4e,latitudeDegrees:Y4e,longitudeProjected:X4e,latitudeProjected:K4e,format:J4e});function LD(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 Po({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(ude,o),a=Ot(x4e,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(LD.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}}});LD.prototype.getTileCredits=function(e,t,n){};LD.prototype.requestImage=function(e,t,n,i){return Sf.loadImage(this,T4e(this,e,t,n,i))};LD.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=E4e(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 i6=!1,If=new ie,r6=!1,FD=new ie;function T4e(e,t,n,i,r){i6=!1,r6=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(lde);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 GY=!1,Sv=new U,WY=!1;function E4e(e,t,n,i,r,o,s){i6=!1,r6=!1,GY=!1,WY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(lde);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 wv(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 C4e(e,t,n,i){return wv(e,"{x}",t)}function v4e(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return wv(e,"{reverseX}",r)}function S4e(e,t,n,i){return wv(e,"{y}",n)}function w4e(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return wv(e,"{reverseY}",r)}function I4e(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return wv(e,"{reverseZ}",o)}function P4e(e,t,n,i){return wv(e,"{z}",i)}function D4e(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function o6(e,t,n,i){i6||(e.tilingScheme.tileXYToRectangle(t,n,i,If),If.west=D.toDegrees(If.west),If.south=D.toDegrees(If.south),If.east=D.toDegrees(If.east),If.north=D.toDegrees(If.north),i6=!0)}function R4e(e,t,n,i){return o6(e,t,n,i),If.west}function O4e(e,t,n,i){return o6(e,t,n,i),If.south}function M4e(e,t,n,i){return o6(e,t,n,i),If.east}function N4e(e,t,n,i){return o6(e,t,n,i),If.north}function s6(e,t,n,i){r6||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,FD),r6=!0)}function L4e(e,t,n,i){return s6(e,t,n,i),FD.west}function F4e(e,t,n,i){return s6(e,t,n,i),FD.south}function B4e(e,t,n,i){return s6(e,t,n,i),FD.east}function k4e(e,t,n,i){return s6(e,t,n,i),FD.north}function U4e(e,t,n,i){return e.tileWidth}function z4e(e,t,n,i){return e.tileHeight}function V4e(e,t,n,i,r,o,s){return a6(e,t,n,i,r,o),Sv.x}function j4e(e,t,n,i,r,o,s){return a6(e,t,n,i,r,o),Sv.y}function H4e(e,t,n,i,r,o,s){return a6(e,t,n,i,r,o),e.tileWidth-Sv.x-1}function G4e(e,t,n,i,r,o,s){return a6(e,t,n,i,r,o),e.tileHeight-Sv.y-1}var W4e=new ie,vv=new h;function a6(e,t,n,i,r,o,s){if(GY)return;qY(e,t,n,i,r,o);let a=vv,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,W4e);Sv.x=e.tileWidth*(a.x-c.west)/c.width|0,Sv.y=e.tileHeight*(c.north-a.y)/c.height|0,GY=!0}function q4e(e,t,n,i,r,o,s){return D.toDegrees(r)}function Y4e(e,t,n,i,r,o,s){return D.toDegrees(o)}function X4e(e,t,n,i,r,o,s){return qY(e,t,n,i,r,o),vv.x}function K4e(e,t,n,i,r,o,s){return qY(e,t,n,i,r,o),vv.y}var $4e=new he;function qY(e,t,n,i,r,o,s){if(!WY){if(e.tilingScheme.projection instanceof zi)vv.x=D.toDegrees(r),vv.y=D.toDegrees(o);else{let a=$4e;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,vv)}WY=!0}}function J4e(e,t,n,i,r,o,s){return s}var _s=LD;var Z4e=/\/$/;function Iv(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 jo?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Z4e.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 _s({...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(Iv.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}}});Iv.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};Iv.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])};Iv.prototype.pickFeatures=function(e,t,n,i,r){};Iv.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Q4e(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 Q4e(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 BD=Iv;var fde={};function kD(e,t){l(fde[e])||(fde[e]=!0,console.warn(t??e))}kD.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.";kD.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";kD.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";kD.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var _t=kD;function e8e(e,t){_t(e,t)}var qr=e8e;function Ly(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Ly.decode(e)}Ly.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Ly.decodeWithFromCharCode=function(e){let t="",n=t8e(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 UD(e,t,n){return t<=e&&e<=n}function t8e(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(UD(u,0,127)){s.push(u);continue}if(UD(u,194,223)){i=1,t=u&31;continue}if(UD(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(UD(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!UD(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"?Ly.decode=Ly.decodeWithTextDecoder:Ly.decode=Ly.decodeWithFromCharCode;var Lu=Ly;function n8e(e,t,n){return JSON.parse(Lu(e,t,n))}var Do=n8e;var Pv={};Pv._deprecationWarning=qr;var fg=Uint32Array.BYTES_PER_ELEMENT;Pv.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=fg;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+=fg;let s=r.getUint32(t,!0);t+=fg;let a=r.getUint32(t,!0);t+=fg;let c=r.getUint32(t,!0);t+=fg;let u=r.getUint32(t,!0);t+=fg;let f=r.getUint32(t,!0);t+=fg;let d;u>=570425344?(t-=fg*2,d=a,u=c,f=0,a=0,c=0,Pv._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-=fg,d=u,u=a,f=c,a=0,c=0,Pv._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=Do(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Do(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):(Pv._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 zD=Pv;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;function dg(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=i8e(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=r8e(t,o),a=o8e(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(dg.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function i8e(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 hde(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function r8e(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 o8e(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 VD=new se;function s8e(e,t,n){let i=se.unpack(e,t,VD),r=se.unpackFloat(i);i=se.unpack(e,t+4,VD);let o=se.unpackFloat(i);i=se.unpack(e,t+8,VD);let s=se.unpackFloat(i);i=se.unpack(e,t+12,VD);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function a8e(e,t,n){let i=se.packFloat(e.x,VD);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 dde=new se;dg.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=s8e(this._batchValues,s,dde):a=se.unpack(this._batchValues,s,dde);let c=hde(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var c8e=[void 0,void 0,new U,new h,new se],l8e=new se;dg.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=c8e[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=hde(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=l8e;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?a8e(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function u8e(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 f8e(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}dg.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||u8e(this,e.context),f8e(this))};dg.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 d8e(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float numberOfAttributes = float(${t}); - return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); -} -`:`uniform vec4 batchTextureStep; -uniform vec2 batchTextureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float stepY = batchTextureStep.z; - float centerY = batchTextureStep.w; - float numberOfAttributes = float(${t}); - float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); - float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}function h8e(e){return e===1?"float":`vec${e}`}function m8e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function p8e(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=h8e(r),a=m8e(r),c=e._offsets[t],u=`${s} ${o}(float batchId) -{ - vec2 st = computeSt(batchId); - 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===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}dg.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${d8e(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=p8e(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} -${t} -${s}`}};dg.prototype.isDestroyed=function(){return!1};dg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var hx=dg;var g8e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_8e={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:Xi,MAT3:$,MAT4:N};function y8e(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=g8e[e.type],r=_8e[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var wd=y8e;var rc={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};rc.isLines=function(e){return e===rc.LINES||e===rc.LINE_LOOP||e===rc.LINE_STRIP};rc.isTriangles=function(e){return e===rc.TRIANGLES||e===rc.TRIANGLE_STRIP||e===rc.TRIANGLE_FAN};rc.validate=function(e){return e===rc.POINTS||e===rc.LINES||e===rc.LINE_LOOP||e===rc.LINE_STRIP||e===rc.TRIANGLES||e===rc.TRIANGLE_STRIP||e===rc.TRIANGLE_FAN};Object.freeze(rc);var Oe=rc;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},YY=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 Zc(this,ts.CULL)}set cull(t){Zc(this,ts.CULL)!==t&&(Fy(this,ts.CULL,t),this.dirty=!0)}get occlude(){return Zc(this,ts.OCCLUDE)}set occlude(t){Zc(this,ts.OCCLUDE)!==t&&(Fy(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 Zc(this,ts.CAST_SHADOWS)}set castShadows(t){Zc(this,ts.CAST_SHADOWS)!==t&&(Fy(this,ts.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Zc(this,ts.RECEIVE_SHADOWS)}set receiveShadows(t){Zc(this,ts.RECEIVE_SHADOWS)!==t&&(Fy(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 Zc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Zc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Fy(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 Zc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Zc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Fy(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 Zc(this,ts.PICK_ONLY)}set pickOnly(t){Zc(this,ts.PICK_ONLY)!==t&&(Fy(this,ts.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Zc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Zc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Fy(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 Zc(e,t){return(e._flags&t)===t}function Fy(e,t,n){n?e._flags|=t:e._flags&=~t}var at=YY;var mde={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(mde);var Ie=mde;var pde={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(pde);var $t=pde;function ys(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}ys.packedLength=4;ys.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};ys.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ys),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};ys.fromPoints=function(e,t){if(l(t)||(t=new ys),!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 gde=new zi,A8e=new he,b8e=new he;ys.fromRectangle=function(e,t,n){if(l(n)||(n=new ys),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;gde._ellipsoid=ee.default,t=t??gde;let i=t.project(ie.southwest(e,A8e)),r=t.project(ie.northeast(e,b8e));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};ys.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 ys(e.x,e.y,e.width,e.height)};ys.union=function(e,t,n){l(n)||(n=new ys);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};ys.expand=function(e,t,n){n=ys.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};ys.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};ys.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};ys.prototype.clone=function(e){return ys.clone(this,e)};ys.prototype.intersect=function(e){return ys.intersect(this,e)};ys.prototype.equals=function(e){return ys.equals(this,e)};var et=ys;var jD={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};jD.validate=function(e){return e===jD.CLOCKWISE||e===jD.COUNTER_CLOCKWISE};Object.freeze(jD);var Qs=jD;function _de(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]=_de(e[t]));return Object.freeze(e)}var XY=_de;function Np(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 x8e=0,Mp={};Np.fromCache=function(e){let t=JSON.stringify(e),n=Mp[t];if(l(n))return++n.referenceCount,n.state;let i=new Np(e),r=JSON.stringify(i);return n=Mp[r],l(n)||(i.id=x8e++,n={referenceCount:0,state:i},Mp[r]=n),++n.referenceCount,Mp[t]={referenceCount:1,state:n.state},n.state};Np.removeFromCache=function(e){let t=new Np(e),n=JSON.stringify(t),i=Mp[n],r=JSON.stringify(e),o=Mp[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Mp[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Mp[n]};Np.getCache=function(){return Mp};Np.clearCache=function(){Mp={}};function mx(e,t,n){n?e.enable(t):e.disable(t)}function yde(e,t){e.frontFace(t.frontFace)}function Ade(e,t){let n=t.cull,i=n.enabled;mx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function bde(e,t){e.lineWidth(t.lineWidth)}function xde(e,t){let n=t.polygonOffset,i=n.enabled;mx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Tde(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(mx(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 Ede(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Cde(e,t){let n=t.depthTest,i=n.enabled;mx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function vde(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Sde(e,t){e.depthMask(t.depthMask)}function wde(e,t){e.stencilMask(t.stencilMask)}function T8e(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Ide(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;mx(e,e.BLEND,r),r&&(T8e(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Pde(e,t){let n=t.stencilTest,i=n.enabled;if(mx(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 Dde(e,t){let n=t.sampleCoverage,i=n.enabled;mx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var E8e=new et;function Rde(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=E8e,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)}Np.apply=function(e,t,n){yde(e,t),Ade(e,t),bde(e,t),xde(e,t),Ede(e,t),Cde(e,t),vde(e,t),Sde(e,t),wde(e,t),Pde(e,t),Dde(e,t),Tde(e,t,n),Ide(e,t,n),Rde(e,t,n)};function C8e(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(yde),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Ade),e.lineWidth!==t.lineWidth&&n.push(bde),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(xde),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Ede),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Cde),(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(vde),e.depthMask!==t.depthMask&&n.push(Sde),e.stencilMask!==t.stencilMask&&n.push(wde),(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(Pde),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Dde),n}Np.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=C8e(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)&&Tde(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)&&Ide(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Rde(e,n,r)};Np.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=Np;var HD=`const float czm_degreesPerRadian = 57.29577951308232; -`;var GD=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); -`;var WD=`const float czm_epsilon1 = 0.1; -`;var qD=`const float czm_epsilon2 = 0.01; -`;var YD=`const float czm_epsilon3 = 0.001; -`;var XD=`const float czm_epsilon4 = 0.0001; -`;var KD=`const float czm_epsilon5 = 0.00001; -`;var $D=`const float czm_epsilon6 = 0.000001; -`;var JD=`const float czm_epsilon7 = 0.0000001; -`;var ZD=`const float czm_infinity = 5906376272000.0; -`;var QD=`const float czm_oneOverPi = 0.3183098861837907; -`;var e1=`const float czm_oneOverTwoPi = 0.15915494309189535; -`;var t1=`const float czm_passCesium3DTile = 6.0; -`;var n1=`const float czm_passCesium3DTileClassification = 7.0; -`;var i1=`const float czm_passCesium3DTileClassificationIgnoreShow = 8.0; -`;var r1=`const float czm_passCesium3DTileEdges = 4.0; -`;var o1=`const float czm_passCesium3DTileEdgesDirect = 12.0; -`;var s1=`const float czm_passCesium3DTilePlanarFillId = 5.0; -`;var a1=`const float czm_passClassification = 8.0; -`;var c1=`const float czm_passCompute = 1.0; -`;var l1=`const float czm_passEnvironment = 0.0; -`;var u1=`const float czm_passGaussianSplats = 12.0; -`;var f1=`const float czm_passGlobe = 2.0; -`;var d1=`const float czm_passOpaque = 9.0; -`;var h1=`const float czm_passOverlay = 13.0; -`;var m1=`const float czm_passTerrainClassification = 3.0; -`;var p1=`const float czm_passTranslucent = 10.0; -`;var g1=`const float czm_passVoxels = 11.0; -`;var _1=`const float czm_pi = 3.141592653589793; -`;var y1=`const float czm_piOverFour = 0.7853981633974483; -`;var A1=`const float czm_piOverSix = 0.5235987755982988; -`;var b1=`const float czm_piOverThree = 1.0471975511965976; -`;var x1=`const float czm_piOverTwo = 1.5707963267948966; -`;var T1=`const float czm_radiansPerDegree = 0.017453292519943295; -`;var E1=`const float czm_sceneMode2D = 2.0; -`;var C1=`const float czm_sceneMode3D = 3.0; -`;var v1=`const float czm_sceneModeColumbusView = 1.0; -`;var S1=`const float czm_sceneModeMorphing = 0.0; -`;var w1=`const float czm_solarRadius = 695500000.0; -`;var I1=`const float czm_threePiOver2 = 4.71238898038469; -`;var P1=`const float czm_twoPi = 6.283185307179586; -`;var D1=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; -`;var R1=`struct czm_depthRangeStruct -{ -float near; -float far; -}; -`;var O1=`struct czm_material -{ -vec3 diffuse; -float specular; -float shininess; -vec3 normal; -vec3 emission; -float alpha; -}; -`;var M1=`struct czm_materialInput +(${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 fv=new h,dv=new h,_D=new h,cze=new h,lze=new h,Zq=new h,tfe=new h,uze=new h,fze=new h,dze=new $,hze=new $,mze=new se,pze=new se(0,0,0,1),gze=new go,N=go;var Ry,ps={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Pu={};Object.defineProperties(Pu,{element:{get:function(){if(Pu.supportsFullscreen())return document[ps.fullscreenElement]}},changeEventName:{get:function(){if(Pu.supportsFullscreen())return ps.fullscreenchange}},errorEventName:{get:function(){if(Pu.supportsFullscreen())return ps.fullscreenerror}},enabled:{get:function(){if(Pu.supportsFullscreen())return document[ps.fullscreenEnabled]}},fullscreen:{get:function(){if(Pu.supportsFullscreen())return Pu.element!==null}}});Pu.supportsFullscreen=function(){if(l(Ry))return Ry;Ry=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ps.requestFullscreen="requestFullscreen",ps.exitFullscreen="exitFullscreen",ps.fullscreenEnabled="fullscreenEnabled",ps.fullscreenElement="fullscreenElement",ps.fullscreenchange="fullscreenchange",ps.fullscreenerror="fullscreenerror",Ry=!0,Ry;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"?(ps.requestFullscreen=n,Ry=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ps.requestFullscreen=n,Ry=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ps.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ps.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ps.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ps.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ps.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ps.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ps.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ps.fullscreenerror=n)}return Ry};Pu.requestFullscreen=function(e,t){Pu.supportsFullscreen()&&e[ps.requestFullscreen]({vrDisplay:t})};Pu.exitFullscreen=function(){Pu.supportsFullscreen()&&document[ps.exitFullscreen]()};Pu._names=ps;var es=Pu;var Ed;typeof navigator<"u"?Ed=navigator:Ed={};function yD(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var kj,nfe;function iY(){if(!l(kj)&&(kj=!1,!Gj())){let e=/ Chrome\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(kj=!0,nfe=yD(e[1]))}return kj}function _ze(){return iY()&&nfe}var Uj,ife;function rfe(){if(!l(Uj)&&(Uj=!1,!iY()&&!Gj()&&/ Safari\/[\.0-9]+/.test(Ed.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(Uj=!0,ife=yD(e[1]))}return Uj}function yze(){return rfe()&&ife}var zj,nY;function ofe(){if(!l(zj)){zj=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ed.userAgent);e!==null&&(zj=!0,nY=yD(e[1]),nY.isNightly=!!e[2])}return zj}function Aze(){return ofe()&&nY}var Vj,sfe;function Gj(){if(!l(Vj)){Vj=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(Vj=!0,sfe=yD(e[1]))}return Vj}function bze(){return Gj()&&sfe}var jj,rY;function Wj(){if(!l(jj)){jj=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(jj=!0,rY=yD(e[1]))}return jj}var Qq;function xze(){return l(Qq)||(Qq=/Windows/i.test(Ed.appVersion)),Qq}var eY;function Tze(){return l(eY)||(eY=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),eY}function Eze(){return Wj()&&rY}var tY;function Cze(){return l(tY)||(tY=!Wj()&&typeof PointerEvent<"u"&&(!l(Ed.pointerEnabled)||Ed.pointerEnabled)),tY}var afe,Hj;function cfe(){if(!l(Hj)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;Hj=l(t)&&t!=="",Hj&&(afe=t)}return Hj}function vze(){return cfe()?afe:void 0}function kl(){return kl._result}kl._promise=void 0;kl._result=void 0;kl.initialize=function(){return l(kl._promise)||(kl._promise=new Promise(e=>{let t=new Image;t.onload=function(){kl._result=t.width>0&&t.height>0,e(kl._result)},t.onerror=function(){kl._result=!1,e(kl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),kl._promise};Object.defineProperties(kl,{initialized:{get:function(){return l(kl._result)}}});var hv=[];typeof ArrayBuffer<"u"&&(hv.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&hv.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&hv.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&hv.push(BigInt64Array),typeof BigUint64Array<"u"&&hv.push(BigUint64Array));var Cd={isChrome:iY,chromeVersion:_ze,isSafari:rfe,safariVersion:yze,isWebkit:ofe,webkitVersion:Aze,isEdge:Gj,edgeVersion:bze,isFirefox:Wj,firefoxVersion:Eze,isWindows:xze,isIPadOrIOS:Tze,hardwareConcurrency:Ed.hardwareConcurrency??3,supportsPointerEvents:Cze,supportsImageRenderingPixelated:cfe,supportsWebP:kl,imageRenderingValue:vze,typedArrayTypes:hv};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!Wj()||parseInt(rY)>=114};var dn=Cd;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var AD=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);AD=h.normalize(e,AD);let o=AD.x*r,s=AD.y*r,a=AD.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 Sze=[1,2,0],wze=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=Sze,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=wze;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 lfe=new dt,ufe=new dt,oY=new dt,ffe=new dt;dt.fromHeadingPitchRoll=function(e,t){return ffe=dt.fromAxisAngle(h.UNIT_X,e.roll,lfe),oY=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(oY,ffe,oY),ufe=dt.fromAxisAngle(h.UNIT_Z,-e.heading,lfe),dt.multiply(ufe,t,t)};var qj=new h,sY=new h,zh=new dt,dfe=new dt,Yj=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,Yj),dt.conjugate(Yj,Yj);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,Yj,zh),zh.w<0&&dt.negate(zh,zh),dt.computeAxis(zh,qj);let a=dt.computeAngle(zh);l(i)||(i=[]),i[s]=qj.x*a,i[s+1]=qj.y*a,i[s+2]=qj.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,sY);let o=h.magnitude(sY);return dt.unpack(t,i*4,dfe),o===0?dt.clone(dt.IDENTITY,zh):dt.fromAxisAngle(sY,o,zh),dt.multiply(zh,dfe,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 aY=new dt;dt.lerp=function(e,t,n,i){return aY=dt.multiplyByScalar(t,n,aY),i=dt.multiplyByScalar(e,1-n,i),dt.add(aY,i,i)};var hfe=new dt,cY=new dt,lY=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=hfe=dt.negate(t,hfe)),1-r<D.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return cY=dt.multiplyByScalar(e,Math.sin((1-n)*s),cY),lY=dt.multiplyByScalar(o,Math.sin(n*s),lY),i=dt.add(cY,lY,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 Ize=new h,Pze=new h,bD=new dt,mv=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,bD);dt.multiply(r,n,mv);let o=dt.log(mv,Ize);dt.multiply(r,e,mv);let s=dt.log(mv,Pze);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,bD),dt.multiply(t,bD,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,bD),a=dt.slerp(n,i,r,mv);return dt.slerp(s,a,2*r*(1-r),o)};var Dze=new dt,mfe=1.9011074535173003,Xj=dn.supportsTypedArrays()?new Float32Array(8):[],Kj=dn.supportsTypedArrays()?new Float32Array(8):[],rg=dn.supportsTypedArrays()?new Float32Array(8):[],og=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Xj[e]=1/(t*n),Kj[e]=t/n}Xj[7]=mfe/136;Kj[7]=mfe*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)rg[g]=(Xj[g]*c-Kj[g])*s,og[g]=(Xj[g]*u-Kj[g])*s;let f=o*n*(1+rg[0]*(1+rg[1]*(1+rg[2]*(1+rg[3]*(1+rg[4]*(1+rg[5]*(1+rg[6]*(1+rg[7])))))))),d=a*(1+og[0]*(1+og[1]*(1+og[2]*(1+og[3]*(1+og[4]*(1+og[5]*(1+og[6]*(1+og[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,bD),a=dt.fastSlerp(n,i,r,mv);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={},uY={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"}},pv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},fY={},Du={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Oy=new h,My=new h,Ny=new h;Ei.localFrameToFixedFrameGenerator=function(e,t){if(!uY.hasOwnProperty(e)||!uY[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=uY[e][t],i,r=e+t;return l(fY[r])?i=fY[r]:(i=function(o,s,a){if(l(a)||(a=new N),h.equalsEpsilon(o,h.ZERO,D.EPSILON14))h.unpack(pv[e],0,Oy),h.unpack(pv[t],0,My),h.unpack(pv[n],0,Ny);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);h.unpack(pv[e],0,Oy),e!=="east"&&e!=="west"&&h.multiplyByScalar(Oy,c,Oy),h.unpack(pv[t],0,My),t!=="east"&&t!=="west"&&h.multiplyByScalar(My,c,My),h.unpack(pv[n],0,Ny),n!=="east"&&n!=="west"&&h.multiplyByScalar(Ny,c,Ny)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,Du.up);let c=Du.up,u=Du.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Du.east),h.cross(c,u,Du.north),h.multiplyByScalar(Du.up,-1,Du.down),h.multiplyByScalar(Du.east,-1,Du.west),h.multiplyByScalar(Du.north,-1,Du.south),Oy=Du[e],My=Du[t],Ny=Du[n]}return a[0]=Oy.x,a[1]=Oy.y,a[2]=Oy.z,a[3]=0,a[4]=My.x,a[5]=My.y,a[6]=My.z,a[7]=0,a[8]=Ny.x,a[9]=Ny.y,a[10]=Ny.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},fY[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 Rze=new Le,Oze=new h(1,1,1),Mze=new N;Ei.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ei.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,Rze),s=N.fromTranslationQuaternionRotationScale(h.ZERO,o,Oze,Mze);return r=i(e,n,r),N.multiply(r,s,r)};var Nze=new N,Lze=new $;Ei.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ei.headingPitchRollToFixedFrame(e,t,n,i,Nze),s=N.getMatrix3(o,Lze);return Le.fromRotationMatrix(s,r)};var Fze=new h(1,1,1),Bze=new h,pfe=new N,kze=new N,Uze=new $,zze=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,Bze);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,pfe),pfe),s=N.setScale(e,Fze,kze);s=N.setTranslation(s,h.ZERO,s),o=N.multiply(o,s,o);let a=Le.fromRotationMatrix(N.getMatrix3(o,Uze),zze);return a=Le.normalize(a,a),wc.fromQuaternion(a,i)};var Vze=6*3600+2460+50.54841,jze=8640184812866e-6,Hze=.093104,Gze=-62e-7,Wze=11772758384668e-32,qze=72921158553e-15,Yze=D.TWO_PI/86400,$j=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){$j=K.addSeconds(e,-K.computeTaiMinusUtc(e),$j);let n=$j.dayNumber,i=$j.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=(Vze+r*(jze+r*(Hze+r*Gze)))*Yze%D.TWO_PI,c=qze+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 gD;Ei.earthOrientationParameters=pD.NONE;var mY=32.184,Xze=2451545;Ei.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+mY,i=e.stop.dayNumber,r=e.stop.secondsOfDay+mY;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 Kze=32.184,$ze=2451545,Jj=new wc,Jze=new $,Zze=new K;Ei.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,Kze,Zze),i=K.totalDays(n)-$ze,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 Jj.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),Jj.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),Jj.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(Jj,Jze,t)};Ei.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Qze=new cx(0,0,0),eVe=new wy(0,0,0,0,0,0),dY=new $,hY=new $;Ei.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ei.earthOrientationParameters.compute(e,eVe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+mY,o=Ei.iau2006XysData.computeXysRadians(i,r,Qze);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=dY;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,hY),d=$.multiply(u,f,dY),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,hY),x=$.multiply(d,b,dY),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-Xze+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),_=hY;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 tVe=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=tVe;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 nVe=new h,iVe=new h,rVe=new h;Ei.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,nVe),o=h.cross(t,r,iVe);h.equalsEpsilon(o,h.ZERO,D.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,rVe);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 gfe=new he,pY=new h,oVe=new h,sVe=new $,gY=new N,_fe=new N;Ei.basisTo2D=function(e,t,n){let i=N.getTranslation(t,oVe),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,pY);else{let f=r.cartesianToCartographic(i,gfe);o=e.project(f,pY),h.fromElements(o.z,o.x,o.y,o)}let s=Ei.eastNorthUpToFixedFrame(i,r,gY),a=N.inverseTransformation(s,_fe),c=N.getMatrix3(t,sVe),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,gY),o=N.inverseTransformation(r,_fe),s=i.cartesianToCartographic(t,gfe),a=e.project(s,pY);h.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,gY);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,o,n),N.multiply(c,n,n),n};var At=Ei;var gv=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,aVe),a=N.multiplyByPointAsVector(s,h.UNIT_X,cVe);h.normalize(a,a);let c=N.multiplyByPointAsVector(s,h.UNIT_Y,lVe);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,fVe),f=h.negate(a,uVe),d=_Y,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=dVe;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}};gv.packedLength=4;var aVe=new N,cVe=new h,lVe=new h,uVe=new h,fVe=new h,_Y=new Array(5);for(let e=0;e<_Y.length;++e)_Y[e]=new h;var dVe=new he;gv.MAX_VALUE=Object.freeze(new gv(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ie=gv;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 yfe=new Ui,hVe=new he,mVe=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;yfe._ellipsoid=ee.default,t=t??yfe;let i=t.project(ie.southwest(e,hVe)),r=t.project(ie.northeast(e,mVe));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;function yY(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 bY[0]=t,e.fromBytes(sg[0],sg[1],sg[2],sg[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=yY(f,u,t+1/3),a=yY(f,u,t),c=yY(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=pVe.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=gVe.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=_Ve.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=yVe.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 sg[0]=t,sg[1]=n,sg[2]=i,sg[3]=r,bY[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}},AY,bY,sg;dn.supportsTypedArrays()&&(AY=new ArrayBuffer(4),bY=new Uint32Array(AY),sg=new Uint8Array(AY));var pVe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,gVe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,_Ve=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,yVe=/^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 AVe(){return!0}function bVe(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=AVe}var le=bVe;function Ef(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Ef.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}}});Ef.packedLength=2;Ef.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Ef.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ef),n.near=e[t++],n.far=e[t],n};Ef.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Ef.clone=function(e,t){if(l(e))return l(t)||(t=new Ef),t.near=e.near,t.far=e.far,t};Ef.prototype.clone=function(e){return Ef.clone(this,e)};Ef.prototype.equals=function(e){return Ef.equals(this,e)};var jt=Ef;function vd(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}vd.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 vd(e.near,e.nearValue,e.far,e.farValue)};vd.packedLength=4;vd.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};vd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new vd),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};vd.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};vd.prototype.clone=function(e){return vd.clone(this,e)};vd.prototype.equals=function(e){return vd.equals(this,e)};var qt=vd;var Ly={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(Ly);var We=Ly;function _s(e){return e===Ly.CLAMP_TO_GROUND||e===Ly.CLAMP_TO_3D_TILE||e===Ly.CLAMP_TO_TERRAIN}function Fy(e){return e===Ly.RELATIVE_TO_GROUND||e===Ly.RELATIVE_TO_3D_TILE||e===Ly.RELATIVE_TO_TERRAIN}var Afe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Afe);var zi=Afe;var bfe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(bfe);var Hn=bfe;var xVe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=xVe;function Vh(){pe.throwInstantiationError()}Object.defineProperties(Vh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Vh.prototype.getValue=pe.throwInstantiationError;Vh.prototype.equals=pe.throwInstantiationError;Vh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Vh.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(!Vh.equals(e[i],t[i]))return!1;return!0};Vh.isConstant=function(e){return!l(e)||e.isConstant};Vh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Vh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Vh.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=Vh;var xD={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};xD.getMorphTime=function(e){return e===xD.SCENE3D?1:e===xD.MORPHING?void 0:0};Object.freeze(xD);var re=xD;var TVe=500;function EVe(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>TVe&&(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 jh=EVe;var CVe=new he;function vVe(e,t,n,i,r){let o=i.cartesianToCartographic(e,CVe);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):_s(n)?o.height=t:Fy(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var ag=vVe;var xfe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(xfe);var Vo=xfe;var SVe=z.WHITE,wVe=h.ZERO,IVe=We.NONE,PVe=U.ZERO,DVe=1,RVe=0,OVe=h.ZERO,MVe=zi.CENTER,NVe=Hn.CENTER,LVe=!1,FVe=Vo.NONE,BVe=new h,kVe=new z,UVe=new h,zVe=new U,VVe=new qt,jVe=new qt,HVe=new qt,GVe=new et,WVe=new jt;function Tfe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function By(e,t){t.collectionChanged.addEventListener(By.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}By.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,BVe),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){xY(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,SVe,kVe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,wVe,UVe),u.heightReference=X.getValueOrDefault(a._heightReference,e,IVe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,PVe,zVe),u.scale=X.getValueOrDefault(a._scale,e,DVe),u.rotation=X.getValueOrDefault(a._rotation,e,RVe),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,OVe),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,MVe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,NVe),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,VVe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,jVe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,HVe),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,LVe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,WVe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,FVe),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,GVe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};By.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=jh(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=ag(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};By.prototype.isDestroyed=function(){return!1};By.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(By.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};By.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 Tfe(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 Tfe(o)):(xY(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],xY(s.get(o.id),o,a),s.remove(o.id)};function xY(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var TD=By;function qVe(e,t){this.start=e??0,this.stop=t??0}var Us=qVe;var Zj=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],IY),r=h.clone(i,TY),o=h.clone(i,EY),s=h.clone(i,CY),a=h.clone(i,vY),c=h.clone(i,SY),u=h.clone(i,wY),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,nc)),g=h.magnitudeSquared(h.subtract(c,o,nc)),m=h.magnitudeSquared(h.subtract(u,s,nc)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=PY;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,nc)),E=Math.sqrt(T),v=DY;v.x=r.x,v.y=o.y,v.z=s.z;let S=RY;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,OY),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,nc));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,nc));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;Efe._ellipsoid=ee.default,n=n??Efe,ie.southwest(t,MY),MY.height=i,ie.northeast(t,NY),NY.height=r;let s=n.project(MY,XVe),a=n.project(NY,KVe),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,$Ve);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=IY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,TY),a=h.clone(o,EY),c=h.clone(o,CY),u=h.clone(o,vY),f=h.clone(o,SY),d=h.clone(o,wY),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,nc)),y=h.magnitudeSquared(h.subtract(f,a,nc)),A=h.magnitudeSquared(h.subtract(d,c,nc)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=PY;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,nc)),S=Math.sqrt(v),I=DY;I.x=s.x,I.y=a.y,I.z=c.z;let R=RY;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,OY),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,nc));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,nc));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=IY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,TY),s=h.clone(r,EY),a=h.clone(r,CY),c=h.clone(r,vY),u=h.clone(r,SY),f=h.clone(r,wY),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,nc)),m=h.magnitudeSquared(h.subtract(u,s,nc)),y=h.magnitudeSquared(h.subtract(f,a,nc)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=PY;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,nc)),v=Math.sqrt(E),S=DY;S.x=o.x,S.y=s.y,S.z=a.z;let I=RY;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,OY),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,nc));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,nc));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,JVe),o=$.getColumn(i,1,ZVe),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,e4e),r=N.getScale(t,t4e),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,n4e),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,i4e);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,r4e));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,o4e),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,s4e),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){vfe._ellipsoid=ee.default,n=n??vfe;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,Cfe):a=r.geodeticSurfaceNormal(o,Cfe);let c=h.cross(h.UNIT_Z,a,a4e);h.normalize(c,c);let u=h.cross(a,c,c4e);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,u4e),d=h.negate(c,l4e),p=Sfe,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,f4e);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 YVe*t*t*t}};Zj.packedLength=4;var TY=new h,EY=new h,CY=new h,vY=new h,SY=new h,wY=new h,IY=new h,nc=new h,PY=new h,DY=new h,RY=new h,OY=new h,YVe=4/3*D.PI,Efe=new Ui,XVe=new h,KVe=new h,MY=new he,NY=new he,$Ve=[],JVe=new h,ZVe=new h,QVe=new h,e4e=new h,t4e=new h,n4e=new h,i4e=new h,r4e=new h,o4e=new h,s4e=new h,Cfe=new h,a4e=new h,c4e=new h,l4e=new h,u4e=new h,f4e=new he,Sfe=new Array(8);for(let e=0;e<8;++e)Sfe[e]=new h;var vfe=new Ui,ue=Zj;var wfe={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(wfe);var te=wfe;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 Ife={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Ife);var Sd=Ife;var d4e=Object.freeze([NaN,NaN,NaN,NaN]),Ru=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,d4e,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,h4e),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,m4e),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],Pfe)),n.y=U.magnitude(U.fromElements(t[2],t[3],Pfe)),n}static getMaximumScale(t){return e.getScale(t,Dfe),U.maximumComponent(Dfe)}static setRotation(t,n,i){let r=e.getScale(t,p4e);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,g4e);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]})`}};Ru.packedLength=4;Ru.fromArray=Ru.unpack;Ru.IDENTITY=new Ru(1,0,0,1);Ru.ZERO=new Ru(0,0,0,0);Ru.COLUMN0ROW0=0;Ru.COLUMN0ROW1=1;Ru.COLUMN1ROW0=2;Ru.COLUMN1ROW1=3;var h4e=new U,m4e=new U,Pfe=new U,Dfe=new U,p4e=new U,g4e=new U,Xi=Ru;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;function LY(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}LY.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 _4e=new he,y4e=new h,Rfe=new N,A4e=[new he,new he,new he],b4e=[new U,new U,new U],x4e=[new U,new U,new U],T4e=new h,E4e=new Le,C4e=new N,v4e=new Xi;LY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,_4e),s=he.toCartesian(o,n,y4e),a=At.eastNorthUpToFixedFrame(s,n,Rfe),c=N.inverse(a,Rfe),u=b4e,f=A4e;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=T4e;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,E4e),g=$.fromQuaternion(p,C4e),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,v4e),E=x4e;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=LY;function S4e(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=S4e;function w4e(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=w4e;var Ofe={NONE:0,TOP:1,ALL:2};Object.freeze(Ofe);var mn=Ofe;function Qs(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}Qs.POSITION_ONLY=Object.freeze(new Qs({position:!0}));Qs.POSITION_AND_NORMAL=Object.freeze(new Qs({position:!0,normal:!0}));Qs.POSITION_NORMAL_AND_ST=Object.freeze(new Qs({position:!0,normal:!0,st:!0}));Qs.POSITION_AND_ST=Object.freeze(new Qs({position:!0,st:!0}));Qs.POSITION_AND_COLOR=Object.freeze(new Qs({position:!0,color:!0}));Qs.ALL=Object.freeze(new Qs({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Qs.DEFAULT=Qs.POSITION_NORMAL_AND_ST;Qs.packedLength=6;Qs.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};Qs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Qs),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};Qs.clone=function(e,t){if(l(e))return l(t)||(t=new Qs),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=Qs;var I4e=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 Nfe=new h,Lfe=new h,Ffe=new Be,Mfe={minimum:Nfe,maximum:Lfe,vertexFormat:Ffe,offsetAttribute:void 0};Cf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Nfe),r=h.unpack(e,t+h.packedLength,Lfe),o=Be.unpack(e,t+2*h.packedLength,Ffe),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):(Mfe.offsetAttribute=s===-1?void 0:s,new Cf(Mfe))};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,I4e),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 ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var FY;Cf.getUnitBox=function(){return l(FY)||(FY=Cf.createGeometry(Cf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),FY};var Ic=Cf;var P4e=new h;function Dp(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"}Dp.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Dp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Dp.fromAxisAlignedBoundingBox=function(e){return new Dp({minimum:e.minimum,maximum:e.maximum})};Dp.packedLength=2*h.packedLength+1;Dp.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 kfe=new h,Ufe=new h,Bfe={minimum:kfe,maximum:Ufe,offsetAttribute:void 0};Dp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,kfe),r=h.unpack(e,t+h.packedLength,Ufe),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):(Bfe.offsetAttribute=o===-1?void 0:o,new Dp(Bfe))};Dp.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,P4e),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 ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Hh=Dp;function _v(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(_v.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});_v.fromColor=function(e){return new _v(e.red,e.green,e.blue,e.alpha)};_v.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};_v.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=_v;function ED(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(ED.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});ED.fromDistanceDisplayCondition=function(e){return new ED(e.near,e.far)};ED.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Kn=ED;function D4e(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=D4e;function Po(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(Po.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var yv={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Po.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):(yv.start=i,yv.stop=r,yv.isStartIncluded=o,yv.isStopIncluded=s,yv.data=a,new Po(yv))};Po.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Po.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 Po(e)};Po.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)))};Po.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)))};Po.intersect=function(e,t,n,i){if(!l(t))return Po.clone(Po.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 Po.clone(Po.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 Po),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};Po.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};Po.prototype.clone=function(e){return Po.clone(this,e)};Po.prototype.equals=function(e,t){return Po.equals(this,e,t)};Po.prototype.equalsEpsilon=function(e,t,n){return Po.equalsEpsilon(this,e,t,n)};Po.prototype.toString=function(){return Po.toIso8601(this)};Po.EMPTY=Object.freeze(new Po({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var En=Po;var zfe=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),Vfe=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),R4e=Object.freeze(new En({start:zfe,stop:Vfe})),O4e={MINIMUM_VALUE:zfe,MAXIMUM_VALUE:Vfe,MAXIMUM_INTERVAL:R4e},tt=O4e;function CD(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(CD.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});CD.fromCartesian3=function(e){return new CD(e.x,e.y,e.z)};CD.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 xr=CD;function Qj(e){e=e??!0,this.value=Qj.toValue(e)}Object.defineProperties(Qj.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});Qj.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Pn=Qj;var vD=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; +void main() { -float s; -vec2 st; -vec3 str; -vec3 normalEC; -mat3 tangentToEyeMatrix; -vec3 positionToEyeEC; -float height; -float slope; -float aspect; -float waterMask; -}; -`;var N1=`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; +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 -#ifdef USE_CLEARCOAT -float clearcoatFactor; -float clearcoatRoughness; -vec3 clearcoatNormal; +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.tangentToEyeMatrix = tangentToEyeMatrix; +materialInput.positionToEyeEC = positionToEyeEC; +materialInput.st = v_st; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif -}; -`;var L1=`struct czm_modelVertexOutput { -vec3 positionMC; -float pointSize; -}; -`;var F1=`struct czm_ray -{ -vec3 origin; -vec3 direction; -}; -`;var B1=`struct czm_raySegment +} +`;var SD=`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 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 k1=`struct czm_shadowParameters +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 wD=`in vec3 v_positionEC; +in vec3 v_normalEC; +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; +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 U1=`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 z1=`float czm_alphaWeight(float a) +`;var ID=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +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; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var V1=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var PD=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; +void main() { -float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); -float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); -val1 = val1 * (1.0 - val2); -val1 = val1 * val1 * (3.0 - (2.0 * val1)); -val1 = pow(val1, 0.5); -vec4 midColor = (color1 + color2) * 0.5; -return mix(midColor, currentColor, val1); +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 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) +`;var DD=`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() { -return czm_antialias(color1, color2, currentColor, dist, 0.1); +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var j1=`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); -if (ignoreBlackPixels) { -hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0; -} else { -hsb.z = hsb.z + hsbShift.z; +`;var jfe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(jfe);var Pc=jfe;var Hfe={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(Hfe);var $r=Hfe;var Gfe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Pc.ADD,equationAlpha:Pc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Pc.ADD,equationAlpha:Pc.ADD,functionSourceRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Pc.ADD,equationAlpha:Pc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE,functionDestinationAlpha:$r.ONE})};Object.freeze(Gfe);var tn=Gfe;var Wfe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(Wfe);var Vi=Wfe;function Av(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(Av.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}}});Av.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(` +`)};Av.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Av.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};Av.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 wr=Av;function M4e(){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 $n=M4e;function bv(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(bv.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}}});bv.clone=function(e){if(l(e))return new bv(e._format,e._datatype,e._width,e._height,e._buffer)};bv.prototype.clone=function(){return bv.clone(this)};var RD=bv;var qfe=Qo(xf(),1);function Yfe(){if(!l(rc._canTransferArrayBuffer)){let e=UY("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 kY=new be;function BY(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 UY(e){let t=new qfe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(Dy(e))s=e;else if(!n){let a=Zt(`${rc._workerModulePrefix}/${i}.js`);Dy(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=BY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${BY(CESIUM_WORKERS)}"); + CesiumWorkers["${i}"](); + `;return o=BY(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 N4e(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 L4e=(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),kY.raiseEvent(s),i(s)}else kY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},F4e=[];async function B4e(e,t,n){let i=await Promise.resolve(Yfe());l(n)?i||(n.length=0):n=F4e;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",L4e(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function k4e(e,t,n){++e._activeTasks;try{let i=await B4e(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=UY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return k4e(this,e,t)};rc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=UY(this._workerPath),i=await N4e(this,e),r=await Promise.resolve(Yfe()),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(),le(this)};rc.taskCompletedEvent=kY;rc._defaultWorkerModulePrefix="Workers/";rc._workerModulePrefix=rc._defaultWorkerModulePrefix;rc._canTransferArrayBuffer=void 0;var Jn=rc;function cg(){}cg._transcodeTaskProcessor=new Jn("transcodeKTX2",Number.POSITIVE_INFINITY);cg._readyPromise=void 0;function U4e(){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)||U4e(),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 RD(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 OD=cg;var Xfe;Kfe.setKTX2SupportedFormats=function(e,t,n,i,r,o){Xfe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Kfe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return OD.transcode(n,Xfe)})}var Ou=Kfe;var Tr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Tr.getMathType=function(e){switch(e){case Tr.SCALAR:return Number;case Tr.VEC2:return U;case Tr.VEC3:return h;case Tr.VEC4:return se;case Tr.MAT2:return Xi;case Tr.MAT3:return $;case Tr.MAT4:return N}};Tr.getNumberOfComponents=function(e){switch(e){case Tr.SCALAR:return 1;case Tr.VEC2:return 2;case Tr.VEC3:return 3;case Tr.VEC4:case Tr.MAT2:return 4;case Tr.MAT3:return 9;case Tr.MAT4:return 16}};Tr.getAttributeLocationCount=function(e){switch(e){case Tr.SCALAR:case Tr.VEC2:case Tr.VEC3:case Tr.VEC4:return 1;case Tr.MAT2:return 2;case Tr.MAT3:return 3;case Tr.MAT4:return 4}};Tr.getGlslType=function(e){switch(e){case Tr.SCALAR:return"float";case Tr.VEC2:return"vec2";case Tr.VEC3:return"vec3";case Tr.VEC4:return"vec4";case Tr.MAT2:return"mat2";case Tr.MAT3:return"mat3";case Tr.MAT4:return"mat4"}};Object.freeze(Tr);var Vt=Tr;var $fe=1/256,z4e=65536,VY=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 MD=new U,Jfe=new Uint8Array(1);function e6(e){return Jfe[0]=e,Jfe[0]}Lr.octEncodeToCartesian4=function(e,t){return Lr.octEncodeInRange(e,65535,MD),t.x=e6(MD.x*$fe),t.y=e6(MD.x),t.z=e6(MD.y*$fe),t.w=e6(MD.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*VY+i,a=r*VY+o;return Lr.octDecodeInRange(s,a,65535,t)};Lr.octPackFloat=function(e){return 256*e.x+e.y};var jY=new U;Lr.octEncodeFloat=function(e){return Lr.octEncode(e,jY),Lr.octPackFloat(jY)};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,jY);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 zY(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+=zY(e[a]),o+=zY(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=zY(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))*z4e+Math.round(D.clamp(e.green*255,0,255))*VY+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 Zfe=new h,Qfe=new h,ede=new h;function V4e(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,Zfe),s=h.subtract(i,t,Qfe),a=h.subtract(e,t,ede),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,Zfe),s=U.subtract(i,t,Qfe),a=U.subtract(e,t,ede),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 lx=V4e;function Rp(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Rp.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};Rp.fromCartesian=function(e,t){l(t)||(t=new Rp);let n=t.high,i=t.low;return Rp.encode(e.x,lg),n.x=lg.high,i.x=lg.low,Rp.encode(e.y,lg),n.y=lg.high,i.y=lg.low,Rp.encode(e.z,lg),n.z=lg.high,i.z=lg.low,t};var HY=new Rp;Rp.writeElements=function(e,t,n){Rp.fromCartesian(e,HY);let i=HY.high,r=HY.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=Rp;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 GY={};GY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function tde(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}GY.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=tde(r,-o,D.EPSILON14);if(s<0)return[];let a=-.5*tde(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Ul=GY;var qY={};qY.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 WY(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]}qY.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Ul.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=Ul.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return WY(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):WY(e,t,0,i);if(i===0)return r=Ul.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 WY(e,t,n,i)};var ux=qY;var YY={};YY.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 Gh(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=ux.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=Ul.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=Ul.computeRealRoots(1,d,p),y=Ul.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 ND(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=ux.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=Ul.computeRealRoots(1,S,R),_=Ul.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[]}YY.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return ux.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 Gh(o,s,a,c);case 1:return ND(o,s,a,c);case 2:return ND(o,s,a,c);case 3:return Gh(o,s,a,c);case 4:return Gh(o,s,a,c);case 5:return ND(o,s,a,c);case 6:return Gh(o,s,a,c);case 7:return Gh(o,s,a,c);case 8:return ND(o,s,a,c);case 9:return Gh(o,s,a,c);case 10:return Gh(o,s,a,c);case 11:return ND(o,s,a,c);case 12:return Gh(o,s,a,c);case 13:return Gh(o,s,a,c);case 14:return Gh(o,s,a,c);case 15:return Gh(o,s,a,c);default:return}};var LD=YY;var XY=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=XY;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 j4e=new h,H4e=new h,lde=new h,nde=new h,ide=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,j4e),c=h.subtract(i,t,H4e),u=h.cross(s,c,lde),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<D.EPSILON6||(d=h.subtract(o,t,nde),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,ide),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,nde),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,ide),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 G4e=new pn;io.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=G4e;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 W4e(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 q4e={root0:0,root1:0};function ude(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,lde),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=W4e(c,u,f,q4e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}io.raySphere=function(e,t,n){if(n=ude(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var Y4e=new pn;io.lineSegmentSphere=function(e,t,n,i){let r=Y4e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=ude(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 X4e=new h,K4e=new h;io.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,X4e),r=h.multiplyComponents(n,e.direction,K4e),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,J4e=new Us,Z4e=new Us;io.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Us);let i=KY(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,$4e),r=KY(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,J4e),o=KY(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,Z4e);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 KY(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 fx(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*fx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*fx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*fx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Ul.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=LD.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=fx(a*L+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?w=fx(a*L,c*O+u,D.EPSILON12):w=fx(a*L+c*O,u,D.EPSILON12);let P=fx(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 $Y=new h,rde=new h,ode=new h,t6=new h,Q4e=new h,e8e=new $,t8e=new $,n8e=new $,i8e=new $,r8e=new $,sde=new $,ade=new $,cde=new h,o8e=new h,s8e=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,$Y);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,$Y),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,t6),c=h.normalize(h.cross(a,s,rde),rde),u=h.normalize(h.cross(s,c,ode),ode),f=e8e;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,t8e),p=$.fromScale(t.radii,n8e),g=$.fromScale(t.oneOverRadii,i8e),m=r8e;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,sde),m,sde),A=$.multiply($.multiply(y,p,ade),f,ade),b=$.multiplyByVector(y,n,Q4e),x=io.quadraticVectorExpression(A,h.negate(b,$Y),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,o8e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],cde),cde);let L=h.normalize(h.subtract(T,n,t6),t6),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,s8e);return I=D.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,t6))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var a8e=new h;io.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,a8e),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 _i=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 c8e=new h;Na.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,c8e),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 l8e=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,l8e);return h.subtract(t,r,n)};var u8e=new N,f8e=new se,d8e=new h;Na.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,u8e),s=se.fromElements(i.x,i.y,i.z,r,f8e);s=N.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,d8e);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 JY={};JY.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)};JY.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 FD=JY;var zl={};function c6(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function h8e(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)c6(i,r,e[o],e[o+1],e[o+2]);return i}function m8e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);c6(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)c6(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function p8e(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)c6(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}zl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=h8e(t);break;case Oe.TRIANGLE_STRIP:e.indices=m8e(t);break;case Oe.TRIANGLE_FAN:e.indices=p8e(t);break}e.primitiveType=Oe.LINES}return e};zl.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 ue(u.center,u.radius+n)),new St({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};zl.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};zl.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};zl.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=FD.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function fde(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 g8e(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])}}zl.fitToUnsignedShortIndices=function(e){let t=[],n=St.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=fde(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,g8e(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=fde(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 dde=new h,_8e=new he;zl.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,dde),p=s.cartesianToCartographic(d,_8e),g=r.project(p,dde);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 ZY={high:0,low:0};zl.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],ZY),a[f]=ZY.high,c[f]=ZY.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 qh=new h;function QY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,qh),N.multiplyByPoint(e,qh,qh),h.pack(qh,n,r)}}function eX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,qh),$.multiplyByVector(e,qh,qh),qh=h.normalize(qh,qh),h.pack(qh,n,r)}}var n6=new N,i6=new $;zl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;QY(t,n.position),QY(t,n.prevPosition),QY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(N.inverse(t,n6),N.transpose(n6,n6),N.getMatrix3(n6,i6),eX(i6,n.normal),eX(i6,n.tangent),eX(i6,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function y8e(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 A8e=new h;function tX(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=y8e(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,A8e))+b.radius;x>A&&(A=x)}return new St({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}zl.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(tX(t,"geometry")),n.length>0&&(r.push(tX(n,"westHemisphereGeometry")),r.push(tX(n,"eastHemisphereGeometry"))),r};var wd=new h,BD=new h,xv=new h,Tv=new h;zl.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;BD.x=i[b],BD.y=i[b+1],BD.z=i[b+2],xv.x=i[x],xv.y=i[x+1],xv.z=i[x+2],Tv.x=i[T],Tv.y=i[T+1],Tv.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(xv,BD,xv),h.subtract(Tv,BD,Tv),a[f]=h.cross(xv,Tv,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 b8e=new h,hde=new h,x8e=new h;zl.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,b8e),A=h.fromArray(c,f,x8e),b=h.dot(y,A);h.multiplyByScalar(y,b,hde),h.normalize(h.subtract(A,hde,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 kD=new U,Wh=new h,mde=new h,pde=new h,r6=new U;zl.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,Wh),h.equals(Wh,h.ZERO)){R+=2;continue}r6=cn.octEncodeInRange(Wh,65535,r6),I[R++]=r6.x,I[R++]=r6.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,kD),E[v++]=cn.compressTextureCoordinates(kD));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,Wh),h.fromArray(m,S,mde),h.fromArray(y,S,pde),cn.octPack(Wh,mde,pde,kD),E[v++]=kD.x,E[v++]=kD.y):(s&&(h.fromArray(p,S,Wh),E[v++]=cn.octEncodeFloat(Wh)),f&&(h.fromArray(m,S,Wh),E[v++]=cn.octEncodeFloat(Wh)),d&&(h.fromArray(y,S,Wh),E[v++]=cn.octEncodeFloat(Wh)))}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 T8e(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 E8e(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 C8e(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 v8e(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 S8e(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 w8e(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 I8e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return E8e(e);case Oe.TRIANGLE_STRIP:return C8e(e);case Oe.TRIANGLES:return T8e(e);case Oe.LINE_STRIP:return S8e(e);case Oe.LINE_LOOP:return w8e(e);case Oe.LINES:return v8e(e)}return e}function ky(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function P8e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){ky(e,e.y<0),ky(t,t.y<0),ky(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;ky(e,a),ky(t,a),ky(n,a)}var gde=new h;function Id(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,gde),e.y/(e.y-t.y),gde),n),h.clone(n,i),ky(n,!0),ky(i,!1)}var dx=new h,hx=new h,mx=new h,px=new h,nX={positions:new Array(7),indices:new Array(9)};function D8e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;P8e(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=nX.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Id(e,t,dx,mx),Id(e,n,hx,px),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Id(t,n,dx,mx),Id(t,e,hx,px),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Id(n,e,dx,mx),Id(n,t,hx,px),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,dx,mx),Id(n,t,hx,px),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Id(t,n,dx,mx),Id(t,e,hx,px),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Id(e,t,dx,mx),Id(e,n,hx,px),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=nX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=dx,c[4]=hx,c[5]=mx,c[6]=px,c.length=7),nX}function _de(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=ue.fromVertices(n.position.values)),e}function Cv(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 sX(e,t,n){let i=l(e.geometry.boundingSphere);t=_de(t,i),n=_de(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 aX(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 R8e=aX(se,4),a6=aX(h,3),Ede=aX(U,2),O8e=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},UD=new h,iX=new h,rX=new h,M8e=new h;function o6(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,UD),b=h.fromArray(r,t*3,iX),x=h.fromArray(r,n*3,rX),T=lx(i,A,b,x,M8e);if(l(T)){if(l(o)&&a6(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,UD),v=h.fromArray(u,t*3,iX),S=h.fromArray(u,n*3,rX);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=UD,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&O8e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&a6(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&a6(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&Ede(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];N8e(e,t,n,T,y,m[v],d[v])}}}function N8e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:R8e(e,t,n,i,c,u,r,!1);break;case 3:a6(e,t,n,i,c,u,r,!1);break;case 2:Ede(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 Op(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 L8e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function yde(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)&&!L8e[I]&&l(n[I])&&d.push(I);let p=d.length,g=Cv(t),m=Cv(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=D8e(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=Op(y,A,b,f,B<3?T+B:-1,j),o6(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=Op(y,A,b,f,T,L),o6(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=Op(y,A,b,f,T+1,_),o6(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=Op(y,A,b,f,T+2,C),o6(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}sX(e,m,g)}var Cde=sn.fromPointNormal(h.ZERO,h.UNIT_Y),F8e=new h,B8e=new h;function Ev(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,UD);h.equalsEpsilon(a,n,D.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function Ade(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=Cv(t),a=Cv(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,UD),y=h.fromArray(i,g*3,iX),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=_i.lineSegmentPlane(m,y,Cde,rX);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,F8e);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,B8e);A=Op(b,x,T,o,c,m),Ev(p,g,m,i,A,b,r),A=Op(b,x,T,o,-1,O),Ev(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=Op(E,v,S,o,-1,O),Ev(p,g,O,i,A,E,r),A=Op(E,v,S,o,c+1,y),Ev(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=Op(R,O,L,o,c,m),Ev(p,g,m,i,A,R,r),A=Op(R,O,L,o,c+1,y),Ev(p,g,y,i,A,R,r)}}sX(e,a,s)}var bde=new U,k8e=new U,vde=new h,Sde=new h,oX=new h,U8e=new h,z8e=new h,V8e=new h,xde=new se;function Tde(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,vde);if(a.x>0)continue;let c=h.unpack(i,s,Sde);(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,oX);(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 j8e=5*D.EPSILON9,s6=D.EPSILON6;function H8e(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=Cv(t),f=Cv(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,vde),T=h.fromArray(i,b*3,Sde);if(Math.abs(x.y)<s6)for(x.y=s6*(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)<s6)for(T.y=s6*(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=_i.lineSegmentPlane(x,T,Cde,U8e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,j8e,z8e);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,V8e);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,bde),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,oX));if(w/=h.magnitudeSquared(h.subtract(T,x,oX)),l(c)){let P=se.fromArray(c,A*4,xde),M=se.fromArray(c,b*4,xde),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,bde),M=U.fromArray(a,(d+3)*2,k8e),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&&(Tde(f),Tde(u)),sX(e,f,u)}zl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==Sd.NONE)switch(t.geometryType){case Sd.POLYLINES:H8e(e);break;case Sd.TRIANGLES:yde(e);break;case Sd.LINES:Ade(e);break}else I8e(t),t.primitiveType===Oe.TRIANGLES?yde(e):t.primitiveType===Oe.LINES&&Ade(e);return e};var Gn=zl;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 gx={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};gx.validate=function(e){return e===gx.STREAM_DRAW||e===gx.STATIC_DRAW||e===gx.DYNAMIC_DRAW||e===gx.DYNAMIC_READ};Object.freeze(gx);var Me=gx;var jo={_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(jo,{maximumCombinedTextureImageUnits:{get:function(){return jo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return jo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return jo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return jo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return jo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return jo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return jo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return jo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return jo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return jo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return jo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return jo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return jo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return jo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return jo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return jo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return jo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return jo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return jo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return jo._maximumColorAttachments}},maximumSamples:{get:function(){return jo._maximumSamples}},highpFloatSupported:{get:function(){return jo._highpFloatSupported}},highpIntSupported:{get:function(){return jo._highpIntSupported}}});var Ut=jo;function zD(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(zD.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});zD.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)};zD.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};zD.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 VD=zD;function cX(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function l6(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Yh(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;cX(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;l6(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;cX(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;l6(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;l6(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;cX(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;l6(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Yh.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)}}});Yh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Yh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Yh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Yh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Yh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Yh.prototype.getColorTexture=function(e){return this._colorTextures[e]};Yh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Yh.prototype.isDestroyed=function(){return!1};Yh.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),le(this)};var ys=Yh;var jD={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===jD.DONT_CARE||e===jD.FASTEST||e===jD.NICEST}};Object.freeze(jD);var Pd=jD;var HD={NEAREST:te.NEAREST,LINEAR:te.LINEAR};HD.validate=function(e){return e===HD.NEAREST||e===HD.LINEAR};Object.freeze(HD);var Zn=HD;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 GD={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===GD.CLAMP_TO_EDGE||e===GD.REPEAT||e===GD.MIRRORED_REPEAT}};Object.freeze(GD);var hn=GD;function WD(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=Zn.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(WD.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}}});WD.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};WD.NEAREST=Object.freeze(new WD({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST}));var Ht=WD;function Jc(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=$n(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Jc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Jc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Jc.createVertexBuffer=function(e){return new Jc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Jc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Jc({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(Jc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Jc.prototype._getBuffer=function(){return this._buffer};Jc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Jc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Jc.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)};Jc.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)};Jc.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)};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var nt=Jc;function G8e(e,t){if(!e)throw new pe(t)}var lX=G8e;function W8e(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 Ide(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 Xh(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)W8e(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),Ide(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 wde(e){return e.values.length/e.componentsPerAttribute}function q8e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function Y8e(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=wde(e[r[0]]),t=1;t<s;++t){let u=wde(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+=q8e(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}}}Xh.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=Y8e(d);if(l(m)){u=nt.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=nt.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=nt.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=nt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=nt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Xh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Xh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Xh.prototype.getAttribute=function(e){return this._attributes[e]};function X8e(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 K8e(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)}}Xh.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)};Xh.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)};Xh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&X8e(this),this._hasConstantAttributes&&K8e(this,this._gl)):Ide(this._gl,this._attributes,this._indexBuffer)};Xh.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)}};Xh.prototype.isDestroyed=function(){return!1};Xh.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),le(this)};var zn=Xh;function Do(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 Ht}=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 VD(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,Pde(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 Do.faceNames())uX(this[T],n?.[T],0);m.bindTexture(y,null)}Do.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new ys({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};Do.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*$8e(){yield Do.FaceName.POSITIVEX,yield Do.FaceName.NEGATIVEX,yield Do.FaceName.POSITIVEY,yield Do.FaceName.NEGATIVEY,yield Do.FaceName.POSITIVEZ,yield Do.FaceName.NEGATIVEZ}Do.faceNames=function(){return $8e()};function uX(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))}Do.loadFace=uX;Object.defineProperties(Do.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){Pde(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}}});Do.getDirection=function(e,t){switch(e){case Do.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Do.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Do.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Do.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Do.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Do.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Pde(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=Zn.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)}Do.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 Do.faceNames())uX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};Do.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)};Do.createVertexArray=function(e){let t=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Gn.createAttributeLocations(t);return zn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Do.prototype.isDestroyed=function(){return!1};Do.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var ts=Do;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 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===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??$n(),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,Mde(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)?J8e(this,n):Dde(this,n):l(n.framebuffer)?Q8e(this,n):Rde(this,n),this._initialized=!0):Ode(this),g.bindTexture(this._textureTarget,null)}function J8e(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=u6(c),u=u6(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Dde(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=u6(g),m=u6(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function Z8e(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 Q8e(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 Rde(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 eje(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 u6(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Ode(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){Mde(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 Mde(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=Zn.NEAREST),o.webgl2&&Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Zn.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)?Dde(this,i):Rde(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Ode(this)),this._initialized=!0),f||(l(i.arrayBufferView)?Z8e(this,i.arrayBufferView,t,n,c,u):eje(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),le(this)};Dd.defaultColor=z.WHITE;var Dt=Dd;var qD=`uniform sampler2D image; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); +rampColor = czm_gammaCorrect(rampColor); +material.diffuse = rampColor.rgb; +material.alpha = rampColor.a; +return material; } -hsb.z = clamp(hsb.z, 0.0, 1.0); -return czm_HSBToRGB(hsb); +`;var YD=`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 H1=`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 XD=`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 G1=`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 KD=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +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 W1=`bool czm_backFacing() +`;var $D=`uniform sampler2D heights; +uniform sampler2D colors; +float getHeight(int idx, float invTexSize) { -return gl_FrontFacing == false; +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 } -`;var q1=`float czm_branchFreeTernary(bool comparison, float a, float 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; } -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 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; } -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); +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 Y1=`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 X1=`uniform vec4 shadowMap_cascadeDistances; -float czm_cascadeDistance(vec4 weights) -{ -return dot(shadowMap_cascadeDistances, weights); +color.rgb = czm_gammaCorrect(color.rgb); +material.diffuse = color.rgb; +material.alpha = color.a; +return material; } -`;var K1=`uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +`;var JD=`uniform vec4 color; +uniform float spacing; +uniform float width; +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 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 $1=`uniform vec4 shadowMap_cascadeSplits[2]; -vec4 czm_cascadeWeights(float depthEye) +`;var ZD=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; +czm_material czm_getMaterial(czm_materialInput materialInput) { -vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); -vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); -return near * far; +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 J1=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var QD=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; +float getTime(float t, float coord) { -vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; -return vec4(p, 1.0); -} -`;var Z1=`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 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); } -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); +return clamp(q, 0.0, 1.0); } -`;var Q1=`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 -); +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 eR=`vec4 czm_computePosition(); -`;var tR=`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; +`;var e1=`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 +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; } -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; +`;var t1=`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; } -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 n1=`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; } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +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 +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); } -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); +else +{ +float d1 = czm_infinity; +if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +{ +d1 = abs(st.s - base); } -rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = czm_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); +float d2 = abs(st.t - ptOnUpperLine); +float d3 = abs(st.t - ptOnLowerLine); +dist = min(min(d1, d2), d3); +} +vec4 outsideColor = vec4(0.0); +vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); +vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); +outColor = czm_gammaCorrect(outColor); +material.diffuse = outColor.rgb; +material.alpha = outColor.a; +return material; +} +`;var i1=`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 nR=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) +czm_material czm_getMaterial(czm_materialInput materialInput) { -return vec2(textureTransform * vec3(texCoord, 1.0)); +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; +} +fragColor = czm_gammaCorrect(fragColor); +material.emission = fragColor.rgb; +material.alpha = fragColor.a; +return material; } -`;var iR=`vec2 cordic(float angle) +`;var r1=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; +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); +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)); } -vec2 czm_cosineAndSine(float angle) -{ -if (angle < -czm_piOverTwo || angle > czm_piOverTwo) -{ -if (angle < 0.0) +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; +} +`;var o1=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; +in float v_width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle + czm_pi); +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; } -else +`;var s1=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle - czm_pi); +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 a1=`uniform sampler2D image; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); +rampColor = czm_gammaCorrect(rampColor); +material.diffuse = rampColor.rgb; +material.alpha = rampColor.a; +return material; } -else +`;var c1=`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_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; } +`;var l1=`uniform vec4 waterColor; +uniform vec4 landColor; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); +outColor = czm_gammaCorrect(outColor); +material.diffuse = outColor.rgb; +material.alpha = outColor.a; +return material; } -`;var rR=`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 u1=`uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +float time = czm_frameNumber * animationSpeed; +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 oR=`vec2 czm_decompressTextureCoordinates(float encoded) +`;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??Zn.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,tje(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(Fde(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Fde(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];Fde(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 ts({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 le(this)};function tje(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:$n(),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}oje(t),aje(t),fje(t),hje(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 fX(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 Nde(e,t){}function nje(e,t){}var ije=["type","materials","uniforms","components","source"],rje=["diffuse","specular","shininess","normal","emission","alpha"];function oje(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;fX(t,ije,Nde,!0),fX(r,rje,Nde,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);fX(n,o,nje,!1)}function sje(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 aje(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 r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&sje(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 sR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif -vec4 czm_depthClamp(vec4 coords) +`}}var Lde={mat2:Xi,mat3:$,mat4:N},cje=/\.ktx2$/i;function lje(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}Bde(n,e)}}}function Bde(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 cje.test(r.url)?a=Ou(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 uje(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ts){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),kde(t,e)}}function kde(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 fje(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Ude(e,n)}function Ude(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=dje(r),s;if(o==="channels")s=f1(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;mje(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Ude(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=f1(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(lje(t)),e._initializationPromises.push(Bde(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(uje(t)),e._initializationPromises.push(kde(e,t));else if(o.indexOf("mat")!==-1){let u=new Lde[o];e._uniforms[c]=function(){return Lde[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function dje(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 hje(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++}`;f1(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=f1(e,i,a)}}function f1(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 mje(e,t,n){return f1(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:YD},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:t1},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:e1},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:c1},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:XD},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:KD},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:u1},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:s1},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:QD},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:n1},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:i1},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:r1},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:o1},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:JD},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:ZD},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:a1},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:qD},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:$D},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:l1,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var Qi=it;function _x(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??_x.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:Qi.fromType(Qi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=wr.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(_x.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}}});_x.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;_x.prototype.isTranslucent=wr.prototype.isTranslucent;_x.prototype.getRenderState=wr.prototype.getRenderState;_x.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:ID,fragmentShaderSource:wD}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:DD,fragmentShaderSource:PD}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:SD,fragmentShaderSource:vD})};var Er=_x;var d1=`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; +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 aR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) +`;var h1=`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() { -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); +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var cR=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var yx=`in vec4 v_color; +void main() { -vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; -return (dot(scaled, scaled) <= 1.0); +out_FragColor = czm_gammaCorrect(v_color); } -`;var lR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) +`;var m1=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() { -return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;var uR=`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))); +vec4 p = czm_computePosition(); +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -bool czm_equalsEpsilon(float left, float right, float epsilon) { -return (abs(left - right) <= epsilon); +`;function fg(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?m1:h1,o=i?yx:d1,s=i?fg.FLAT_VERTEX_FORMAT:fg.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(fg.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}}});fg.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;fg.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;fg.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;fg.prototype.isTranslucent=wr.prototype.isTranslucent;fg.prototype.getRenderState=wr.prototype.getRenderState;var yn=fg;function vv(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(vv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});vv.prototype.getType=function(e){return"Color"};var pje=new K;vv.prototype.getValue=function(e,t){return l(e)||(e=K.now(pje)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};vv.prototype.equals=function(e){return this===e||e instanceof vv&&X.equals(this._color,e._color)};var Kt=vv;var dX=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)}},er=dX;var zde=new h,Vde=new h,jde=new he,hX=new h,gje=new h,Hde=new ue,_je=new er,p1=[new he,new he,new he,new he],g1=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=Gde(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,jde),zde),t.cartographicToCartesian(ie.southwest(e,jde),Vde),h.midpoint(Vde,zde,hX);let a=t.scaleToGeodeticSurface(hX,gje);if(l(a)){let c=h.distance(hX,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=Gde(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=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,Hde),ue.union(r,Hde,r)};function Gde(e){he.fromRadians(e.east,e.north,0,p1[0]),he.fromRadians(e.west,e.north,0,p1[1]),he.fromRadians(e.east,e.south,0,p1[2]),he.fromRadians(e.west,e.south,0,p1[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=p1[c];if(_je.positionToTileXY(u,s,g1),c===0)i=g1.x,r=g1.y;else if(i!==g1.x||r!==g1.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;function oc(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}oc.fromCorners=function(e,t,n){return l(n)||(n=new oc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};oc.fromPoints=function(e,t){if(l(t)||(t=new oc),!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};oc.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 oc(e.minimum,e.maximum,e.center)};oc.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;oc.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};oc.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};oc.prototype.clone=function(e){return oc.clone(this,e)};oc.prototype.intersectPlane=function(e){return oc.intersectPlane(this,e)};oc.prototype.intersectAxisAlignedBoundingBox=function(e){return oc.intersectAxisAlignedBoundingBox(this,e)};oc.prototype.equals=function(e){return oc.equals(this,e)};var vf=oc;var mX=new se;function Mp(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,mX)),this._yAxis=h.fromCartesian4(N.getColumn(n,1,mX));let i=h.fromCartesian4(N.getColumn(n,2,mX));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Mp.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 yje=new vf;Mp.fromPoints=function(e,t){let n=vf.fromPoints(e,yje);return new Mp(n.center,t)};var Wde=new pn,d6=new h;Mp.prototype.projectPointOntoPlane=function(e,t){let n=Wde;n.origin=e,h.normalize(e,n.direction);let i=_i.rayPlane(n,this._plane,d6);if(l(i)||(h.negate(n.direction,n.direction),i=_i.rayPlane(n,this._plane,d6)),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)}};Mp.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};Mp.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Wde;n.origin=e,h.clone(this._plane.normal,n.direction);let i=_i.rayPlane(n,this._plane,d6);l(i)||(h.negate(n.direction,n.direction),i=_i.rayPlane(n,this._plane,d6));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};Mp.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 Aje=new h;Mp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=Aje;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};Mp.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=Mp;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 bje=new h,xje=new h,Tje=new h,Eje=new h,Cje=new h,vje=new h,Sje=new $,wje={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],bje);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,xje),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=Sje;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,wje),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,Eje),b=$.getColumn(y,1,Cje),x=$.getColumn(y,2,vje),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=Tje;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 Jde=new h,Ije=new h;function qde(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=Jde;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=Ije;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 Yde=new he,Pje=new h,Dje=new he,Rje=new he,Oje=new he,Mje=new he,Nje=new he,Lje=new h,Xde=new h,Fje=new h,Kde=new h,Bje=new h,kje=new U,Uje=new U,zje=new U,Vje=new U,jje=new U,Hje=new h,Gje=new h,Wje=new h,qje=new h,Yje=new U,Xje=new h,Kje=new h,$je=new h,Jje=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,Yde),R=i.cartographicToCartesian(I,Pje),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,Dje),w=he.fromRadians(e.west,e.north,n,Rje),P=he.fromRadians(e.west,_,n,Oje),M=he.fromRadians(e.west,e.south,n,Mje),F=he.fromRadians(L,e.south,n,Nje),V=i.cartographicToCartesian(C,Lje),B=i.cartographicToCartesian(w,Xde),j=i.cartographicToCartesian(P,Fje),k=i.cartographicToCartesian(M,Kde),G=i.cartographicToCartesian(F,Bje),q=O.projectPointToNearestOnPlane(V,kje),Q=O.projectPointToNearestOnPlane(B,Uje),W=O.projectPointToNearestOnPlane(j,zje),J=O.projectPointToNearestOnPlane(k,Vje),Z=O.projectPointToNearestOnPlane(G,jje);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,Xde),k=i.cartographicToCartesian(M,Kde),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,qde(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,Yde).longitude,A=h.fromRadians(y,m,n,i,Hje);A.z=0;let x=Math.abs(A.x)<D.EPSILON10&&Math.abs(A.y)<D.EPSILON10?h.UNIT_X:h.normalize(A,Gje),T=h.UNIT_Z,E=h.cross(x,T,Wje);d=sn.fromPointNormal(A,x,Jje);let v=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,qje);s=h.dot(sn.projectPointOntoPlane(d,v,Yje),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,Xje).z,a=h.fromRadians(0,e.south,p?t:n,i,Kje).z;let S=h.fromRadians(e.east,m,n,i,$je);return u=sn.getPointDistance(d,S),f=0,qde(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 Zde=new h,Qde=new h,ehe=new h,Zje=new h,$de=new h,Qje=new h;fr.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Jde),i=e.halfAxes,r=$.getColumn(i,0,Zde),o=$.getColumn(i,1,Qde),s=$.getColumn(i,2,ehe),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,$de),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,Zje),h.normalize(y,y),A=h.cross(m,y,$de),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=Qje;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 e6e=new h,t6e=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,Zde),u=$.getColumn(a,1,Qde),f=$.getColumn(a,2,ehe),d=h.add(c,u,e6e);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,t6e),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 n6e=new h,i6e=new h,r6e=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,n6e),o=$.getColumn(i,1,i6e),s=$.getColumn(i,2,r6e);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 o6e=new $;fr.computeTransformation=function(e,t){l(t)||(t=new N);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,o6e);return N.fromRotationTranslation(i,n,t)};var s6e=new ue;fr.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,s6e);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 Qt=fr;var h6={};h6.getHeight=function(e,t,n){return(e-n)*t+n};var a6e=new he;h6.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,a6e);if(!l(o))return h.clone(e,r);let s=h6.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var Ar=h6;var ns={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},pX=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 Zc(this,ns.CULL)}set cull(t){Zc(this,ns.CULL)!==t&&(Uy(this,ns.CULL,t),this.dirty=!0)}get occlude(){return Zc(this,ns.OCCLUDE)}set occlude(t){Zc(this,ns.OCCLUDE)!==t&&(Uy(this,ns.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 Zc(this,ns.CAST_SHADOWS)}set castShadows(t){Zc(this,ns.CAST_SHADOWS)!==t&&(Uy(this,ns.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Zc(this,ns.RECEIVE_SHADOWS)}set receiveShadows(t){Zc(this,ns.RECEIVE_SHADOWS)!==t&&(Uy(this,ns.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 Zc(this,ns.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Zc(this,ns.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Uy(this,ns.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 Zc(this,ns.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Zc(this,ns.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Uy(this,ns.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 Zc(this,ns.PICK_ONLY)}set pickOnly(t){Zc(this,ns.PICK_ONLY)!==t&&(Uy(this,ns.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Zc(this,ns.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Zc(this,ns.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Uy(this,ns.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 Zc(e,t){return(e._flags&t)===t}function Uy(e,t,n){n?e._flags|=t:e._flags&=~t}var at=pX;var the={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(the);var Ie=the;var _1={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};_1.validate=function(e){return e===_1.CLOCKWISE||e===_1.COUNTER_CLOCKWISE};Object.freeze(_1);var ea=_1;function nhe(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]=nhe(e[t]));return Object.freeze(e)}var gX=nhe;function Lp(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??ea.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 c6e=0,Np={};Lp.fromCache=function(e){let t=JSON.stringify(e),n=Np[t];if(l(n))return++n.referenceCount,n.state;let i=new Lp(e),r=JSON.stringify(i);return n=Np[r],l(n)||(i.id=c6e++,n={referenceCount:0,state:i},Np[r]=n),++n.referenceCount,Np[t]={referenceCount:1,state:n.state},n.state};Lp.removeFromCache=function(e){let t=new Lp(e),n=JSON.stringify(t),i=Np[n],r=JSON.stringify(e),o=Np[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Np[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Np[n]};Lp.getCache=function(){return Np};Lp.clearCache=function(){Np={}};function Ax(e,t,n){n?e.enable(t):e.disable(t)}function ihe(e,t){e.frontFace(t.frontFace)}function rhe(e,t){let n=t.cull,i=n.enabled;Ax(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function ohe(e,t){e.lineWidth(t.lineWidth)}function she(e,t){let n=t.polygonOffset,i=n.enabled;Ax(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function ahe(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Ax(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 che(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function lhe(e,t){let n=t.depthTest,i=n.enabled;Ax(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function uhe(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function fhe(e,t){e.depthMask(t.depthMask)}function dhe(e,t){e.stencilMask(t.stencilMask)}function l6e(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function hhe(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Ax(e,e.BLEND,r),r&&(l6e(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function mhe(e,t){let n=t.stencilTest,i=n.enabled;if(Ax(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 phe(e,t){let n=t.sampleCoverage,i=n.enabled;Ax(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var u6e=new et;function ghe(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=u6e,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)}Lp.apply=function(e,t,n){ihe(e,t),rhe(e,t),ohe(e,t),she(e,t),che(e,t),lhe(e,t),uhe(e,t),fhe(e,t),dhe(e,t),mhe(e,t),phe(e,t),ahe(e,t,n),hhe(e,t,n),ghe(e,t,n)};function f6e(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(ihe),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(rhe),e.lineWidth!==t.lineWidth&&n.push(ohe),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(she),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(che),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(lhe),(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(uhe),e.depthMask!==t.depthMask&&n.push(fhe),e.stencilMask!==t.stencilMask&&n.push(dhe),(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(mhe),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(phe),n}Lp.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=f6e(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)&&ahe(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)&&hhe(e,n,r),(t!==n||i!==r||i.context!==r.context)&&ghe(e,n,r)};Lp.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=Lp;var d6e=new h;function Nt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var sc={};sc[te.FLOAT]="float";sc[te.FLOAT_VEC2]="vec2";sc[te.FLOAT_VEC3]="vec3";sc[te.FLOAT_VEC4]="vec4";sc[te.INT]="int";sc[te.INT_VEC2]="ivec2";sc[te.INT_VEC3]="ivec3";sc[te.INT_VEC4]="ivec4";sc[te.BOOL]="bool";sc[te.BOOL_VEC2]="bvec2";sc[te.BOOL_VEC3]="bvec3";sc[te.BOOL_VEC4]="bvec4";sc[te.FLOAT_MAT2]="mat2";sc[te.FLOAT_MAT3]="mat3";sc[te.FLOAT_MAT4]="mat4";sc[te.SAMPLER_2D]="sampler2D";sc[te.SAMPLER_CUBE]="samplerCube";Nt.prototype.getDeclaration=function(e){let t=`uniform ${sc[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var h6e={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,d6e)}}),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}})},dg=h6e;function m6e(e,t,n,i){switch(t.type){case e.FLOAT:return new _X(e,t,n,i);case e.FLOAT_VEC2:return new yX(e,t,n,i);case e.FLOAT_VEC3:return new AX(e,t,n,i);case e.FLOAT_VEC4:return new bX(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new m6(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new m6(e,t,n,i);case e.INT:case e.BOOL:return new xX(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new TX(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new EX(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new CX(e,t,n,i);case e.FLOAT_MAT2:return new vX(e,t,n,i);case e.FLOAT_MAT3:return new SX(e,t,n,i);case e.FLOAT_MAT4:return new wX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var _X=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))}},yX=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))}},AX=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)))}},bX=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)))}},m6=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}},xX=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))}},TX=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))}},EX=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))}},CX=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))}},p6e=new Float32Array(4),vX=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,p6e);this._gl.uniformMatrix2fv(this._location,!1,t)}}},g6e=new Float32Array(9),SX=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,g6e);this._gl.uniformMatrix3fv(this._location,!1,t)}}},_6e=new Float32Array(16),wX=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,_6e);this._gl.uniformMatrix4fv(this._location,!1,t)}}},y1=m6e;function y6e(e,t,n,i){switch(t.type){case e.FLOAT:return new IX(e,t,n,i);case e.FLOAT_VEC2:return new PX(e,t,n,i);case e.FLOAT_VEC3:return new DX(e,t,n,i);case e.FLOAT_VEC4:return new RX(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new OX(e,t,n,i);case e.INT:case e.BOOL:return new MX(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new NX(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new LX(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new FX(e,t,n,i);case e.FLOAT_MAT2:return new BX(e,t,n,i);case e.FLOAT_MAT3:return new kX(e,t,n,i);case e.FLOAT_MAT4:return new UX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var IX=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)}},PX=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)}},DX=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)}},RX=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)}},OX=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}},MX=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)}},NX=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)}},LX=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)}},FX=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)}},BX=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)}},kX=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)}},UX=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)}},A1=y6e;var A6e=0;function hg(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=b6e(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=A6e++}hg.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};hg.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(hg.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return p6(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return p6(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return p6(this),this._uniformsByName}}});function _he(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 b6e(e,t){let n={};if(!Ut.highpFloatSupported||!Ut.highpIntSupported){let i,r,o,s,a=_he(e),c=_he(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 Fp="[Cesium WebGL] ";function x6e(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(`${Fp}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Fp}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Fp}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(`${Fp}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(`${Fp}Vertex shader compile log: ${c}`),console.error(`${Fp} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Fp}Fragment shader compile log: ${c}`),console.error(`${Fp} 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(`${Fp}${g} shader translation failed.`);return}console.error(`${Fp}Translated ${g} shaderSource: +${m}`)}}function T6e(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 E6e(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=y1(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=A1(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function C6e(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=dg[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function v6e(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 p6(e){l(e._program)||yhe(e)}function yhe(e){let t=e._program,n=e._gl,i=x6e(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=E6e(n,i),s=C6e(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=T6e(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=v6e(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{yhe(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)}})}hg.prototype._bind=function(){p6(this),this._gl.useProgram(this._program)};hg.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)}};hg.prototype.isDestroyed=function(){return!1};hg.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};hg.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var en=hg;var b1=`const float czm_degreesPerRadian = 57.29577951308232; +`;var x1=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); +`;var T1=`const float czm_epsilon1 = 0.1; +`;var E1=`const float czm_epsilon2 = 0.01; +`;var C1=`const float czm_epsilon3 = 0.001; +`;var v1=`const float czm_epsilon4 = 0.0001; +`;var S1=`const float czm_epsilon5 = 0.00001; +`;var w1=`const float czm_epsilon6 = 0.000001; +`;var I1=`const float czm_epsilon7 = 0.0000001; +`;var P1=`const float czm_infinity = 5906376272000.0; +`;var D1=`const float czm_oneOverPi = 0.3183098861837907; +`;var R1=`const float czm_oneOverTwoPi = 0.15915494309189535; +`;var O1=`const float czm_passCesium3DTile = 6.0; +`;var M1=`const float czm_passCesium3DTileClassification = 7.0; +`;var N1=`const float czm_passCesium3DTileClassificationIgnoreShow = 8.0; +`;var L1=`const float czm_passCesium3DTileEdges = 4.0; +`;var F1=`const float czm_passCesium3DTileEdgesDirect = 12.0; +`;var B1=`const float czm_passCesium3DTilePlanarFillId = 5.0; +`;var k1=`const float czm_passClassification = 8.0; +`;var U1=`const float czm_passCompute = 1.0; +`;var z1=`const float czm_passEnvironment = 0.0; +`;var V1=`const float czm_passGaussianSplats = 12.0; +`;var j1=`const float czm_passGlobe = 2.0; +`;var H1=`const float czm_passOpaque = 9.0; +`;var G1=`const float czm_passOverlay = 13.0; +`;var W1=`const float czm_passTerrainClassification = 3.0; +`;var q1=`const float czm_passTranslucent = 10.0; +`;var Y1=`const float czm_passVoxels = 11.0; +`;var X1=`const float czm_pi = 3.141592653589793; +`;var K1=`const float czm_piOverFour = 0.7853981633974483; +`;var $1=`const float czm_piOverSix = 0.5235987755982988; +`;var J1=`const float czm_piOverThree = 1.0471975511965976; +`;var Z1=`const float czm_piOverTwo = 1.5707963267948966; +`;var Q1=`const float czm_radiansPerDegree = 0.017453292519943295; +`;var eR=`const float czm_sceneMode2D = 2.0; +`;var tR=`const float czm_sceneMode3D = 3.0; +`;var nR=`const float czm_sceneModeColumbusView = 1.0; +`;var iR=`const float czm_sceneModeMorphing = 0.0; +`;var rR=`const float czm_solarRadius = 695500000.0; +`;var oR=`const float czm_threePiOver2 = 4.71238898038469; +`;var sR=`const float czm_twoPi = 6.283185307179586; +`;var aR=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var cR=`struct czm_depthRangeStruct +{ +float near; +float far; +}; +`;var lR=`struct czm_material +{ +vec3 diffuse; +float specular; +float shininess; +vec3 normal; +vec3 emission; +float alpha; +}; +`;var uR=`struct czm_materialInput +{ +float s; +vec2 st; +vec3 str; +vec3 normalEC; +mat3 tangentToEyeMatrix; +vec3 positionToEyeEC; +float height; +float slope; +float aspect; +float waterMask; +}; +`;var fR=`struct czm_modelMaterial { +vec4 baseColor; +vec3 diffuse; +float alpha; +vec3 specular; +float roughness; +vec3 normalEC; +float occlusion; +vec3 emissive; +#ifdef USE_SPECULAR +float specularWeight; +#endif +#ifdef USE_ANISOTROPY +vec3 anisotropicT; +vec3 anisotropicB; +float anisotropyStrength; +#endif +#ifdef USE_CLEARCOAT +float clearcoatFactor; +float clearcoatRoughness; +vec3 clearcoatNormal; +#endif +}; +`;var dR=`struct czm_modelVertexOutput { +vec3 positionMC; +float pointSize; +}; +`;var hR=`struct czm_ray +{ +vec3 origin; +vec3 direction; +}; +`;var mR=`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 pR=`struct czm_shadowParameters +{ +#ifdef USE_CUBE_MAP_SHADOW +vec3 texCoords; +#else +vec2 texCoords; +#endif +float depthBias; +float depth; +float nDotL; +vec2 texelStepSize; +float normalShadingSmooth; +float darkness; +}; +`;var gR=`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 fR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +`;var _R=`float czm_alphaWeight(float a) { -vec4 p = positionEC; -vec4 zEyeOffset = normalize(p) * eyeOffset.z; -p.xy += eyeOffset.xy + zEyeOffset.xy; -p.z += zEyeOffset.z; -return p; +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 dR=`vec3 czm_eyeToCartographicDelta(vec3 positionEC) +`;var yR=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) { -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); +float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); +float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); +val1 = val1 * (1.0 - val2); +val1 = val1 * val1 * (3.0 - (2.0 * val1)); +val1 = pow(val1, 0.5); +vec4 midColor = (color1 + color2) * 0.5; +return mix(midColor, currentColor, val1); } -`;var hR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { -vec4 q = czm_projection * positionEC; -q.xyz /= q.w; -q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; -return q; +return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var mR=`float czm_fastApproximateAtan(float x) { -return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +`;var AR=`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); +if (ignoreBlackPixels) { +hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0; +} else { +hsb.z = hsb.z + hsbShift.z; } -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; +hsb.z = clamp(hsb.z, 0.0, 1.0); +return czm_HSBToRGB(hsb); } -`;var pR=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) -{ -float scalar = distanceToCamera * czm_fogDensity; -float fog = 1.0 - exp(-(scalar * scalar)); -return mix(color, fogColor, fog); +`;var bR=`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); } -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) -{ -float scalar = distanceToCamera * czm_fogDensity; -float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); -return mix(color, fogColor, fog); +`;var xR=`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 gR=`vec3 czm_gammaCorrect(vec3 color) { -#ifdef HDR -color = pow(color, vec3(czm_gamma)); -#endif -return color; +`;var TR=`bool czm_backFacing() +{ +return gl_FrontFacing == false; } -vec4 czm_gammaCorrect(vec4 color) { -#ifdef HDR -color.rgb = pow(color.rgb, vec3(czm_gamma)); -#endif -return color; +`;var ER=`float czm_branchFreeTernary(bool comparison, float a, float b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var _R=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) -{ -return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); +vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var yR=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) -{ -czm_material material; -material.diffuse = vec3(0.0); -material.specular = 0.0; -material.shininess = 1.0; -material.normal = materialInput.normalEC; -material.emission = vec3(0.0); -material.alpha = 1.0; -return material; +vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var AR=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { -const float NONE = 0.0; -const float SCENE_LIGHT = 1.0; -const float SUNLIGHT = 2.0; -vec3 lightDirection = -positionWC * float(lightEnum == NONE) + -czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) + -czm_sunDirectionWC * float(lightEnum == SUNLIGHT); -return normalize(lightDirection); +vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var bR=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var CR=`vec4 czm_cascadeColor(vec4 weights) { -return max(dot(lightDirectionEC, normalEC), 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; } -`;var xR=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var vR=`uniform vec4 shadowMap_cascadeDistances; +float czm_cascadeDistance(vec4 weights) { -vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); -float specular = max(dot(toReflectedLight, toEyeEC), 0.0); -return pow(specular, max(shininess, czm_epsilon2)); +return dot(shadowMap_cascadeDistances, weights); } -`;var TR=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var SR=`uniform mat4 shadowMap_cascadeMatrices[4]; +mat4 czm_cascadeMatrix(vec4 weights) { -float cosAngle = cos(angleInRadians); -float sinAngle = sin(angleInRadians); -vec2 s0 = vec2(1.0/17.0, 0.0); -vec2 s1 = vec2(-1.0/29.0, 0.0); -vec2 s2 = vec2(1.0/101.0, 1.0/59.0); -vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); -s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); -s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); -s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); -s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); -vec2 uv0 = (uv/103.0) + (time * s0); -vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); -vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); -vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); -uv0 = fract(uv0); -uv1 = fract(uv1); -uv2 = fract(uv2); -uv3 = fract(uv3); -vec4 noise = (texture(normalMap, uv0)) + -(texture(normalMap, uv1)) + -(texture(normalMap, uv2)) + -(texture(normalMap, uv3)); -return ((noise / 4.0) - 0.5) * 2.0; +return shadowMap_cascadeMatrices[0] * weights.x + +shadowMap_cascadeMatrices[1] * weights.y + +shadowMap_cascadeMatrices[2] * weights.z + +shadowMap_cascadeMatrices[3] * weights.w; } -`;var ER=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -vec3 czm_HSBToRGB(vec3 hsb) +`;var wR=`uniform vec4 shadowMap_cascadeSplits[2]; +vec4 czm_cascadeWeights(float depthEye) { -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); +vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); +vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); +return near * far; } -`;var CR=`vec3 hueToRGB(float hue) +`;var IR=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -float r = abs(hue * 6.0 - 3.0) - 1.0; -float g = 2.0 - abs(hue * 6.0 - 2.0); -float b = 2.0 - abs(hue * 6.0 - 4.0); -return clamp(vec3(r, g, b), 0.0, 1.0); -} -vec3 czm_HSLToRGB(vec3 hsl) -{ -vec3 rgb = hueToRGB(hsl.x); -float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; -return (rgb - 0.5) * c + hsl.z; -} -`;var vR=`vec3 czm_hue(vec3 rgb, float adjustment) -{ -const mat3 toYIQ = mat3(0.299, 0.587, 0.114, -0.595716, -0.274453, -0.321263, -0.211456, -0.522591, 0.311135); -const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, -1.0, -0.2721, -0.6474, -1.0, -1.107, 1.7046); -vec3 yiq = toYIQ * rgb; -float hue = atan(yiq.z, yiq.y) + adjustment; -float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); -vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); -return toRGB * color; -} -`;var SR=`vec3 czm_inverseGamma(vec3 color) { -return pow(color, vec3(1.0 / czm_gamma)); -} -`;var wR=`bool czm_isEmpty(czm_raySegment interval) -{ -return (interval.stop < 0.0); -} -`;var IR=`bool czm_isFull(czm_raySegment interval) -{ -return (interval.start == 0.0 && interval.stop == czm_infinity); -} -`;var PR=`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 DR=`vec3 czm_linearToSrgb(vec3 linearIn) -{ -return pow(linearIn, vec3(1.0/2.2)); -} -vec4 czm_linearToSrgb(vec4 linearIn) -{ -vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); -return vec4(srgbOut, linearIn.a); -} -`;var RR=`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 OR=`float czm_luminance(vec3 rgb) -{ -const vec3 W = vec3(0.2125, 0.7154, 0.0721); -return dot(rgb, W); -} -`;var MR=`float czm_maximumComponent(vec2 v) -{ -return max(v.x, v.y); -} -float czm_maximumComponent(vec3 v) -{ -return max(max(v.x, v.y), v.z); -} -float czm_maximumComponent(vec4 v) -{ -return max(max(max(v.x, v.y), v.z), v.w); -} -`;var NR=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) -{ -float width = czm_viewport.z; -float height = czm_viewport.w; -float pixelWidth; -float pixelHeight; -float top = czm_frustumPlanes.x; -float bottom = czm_frustumPlanes.y; -float left = czm_frustumPlanes.z; -float right = czm_frustumPlanes.w; -if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) -{ -float frustumWidth = right - left; -float frustumHeight = top - bottom; -pixelWidth = frustumWidth / width; -pixelHeight = frustumHeight / height; -} -else -{ -float distanceToPixel = -positionEC.z; -float inverseNear = 1.0 / czm_currentFrustum.x; -float tanTheta = top * inverseNear; -pixelHeight = 2.0 * distanceToPixel * tanTheta / height; -tanTheta = right * inverseNear; -pixelWidth = 2.0 * distanceToPixel * tanTheta / width; -} -return max(pixelWidth, pixelHeight) * pixelRatio; +vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; +return vec4(p, 1.0); } -float czm_metersPerPixel(vec4 positionEC) -{ -return czm_metersPerPixel(positionEC, czm_pixelRatio); +`;var PR=`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); } -`;var LR=`vec4 czm_modelToWindowCoordinates(vec4 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; +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); } -`;var FR=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) -{ -const vec3 W = vec3(0.2125, 0.7154, 0.0721); -vec3 target = left * right; -float leftLuminance = dot(left, W); -float rightLuminance = dot(right, W); -float targetLuminance = dot(target, W); -return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; +`;var DR=`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 BR=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) -{ -float valueAtMin = nearFarScalar.y; -float valueAtMax = nearFarScalar.w; -float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; -float farDistanceSq = nearFarScalar.z * nearFarScalar.z; -float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); -t = pow(clamp(t, 0.0, 1.0), 0.2); -return mix(valueAtMin, valueAtMax, t); +`;var RR=`vec4 czm_computePosition(); +`;var OR=`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; } -`;var kR=`vec3 czm_octDecode(vec2 encoded, float range) -{ -if (encoded.x == 0.0 && encoded.y == 0.0) { -return vec3(0.0, 0.0, 0.0); +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; } -encoded = encoded / range * 2.0 - 1.0; -vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); -if (v.z < 0.0) -{ -v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); +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; } -return normalize(v); +vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); +float lightHeight = length(lightPosition) - atmosphereInnerRadius; +lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; +lightPositionLength += lightStepLength; } -vec3 czm_octDecode(vec2 encoded) -{ -return czm_octDecode(encoded, 255.0); +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); } -vec3 czm_octDecode(float encoded) -{ -float temp = encoded / 256.0; -float x = floor(temp); -float y = (temp - x) * 256.0; -return czm_octDecode(vec2(x, y)); +rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; +mieColor = czm_atmosphereMieCoefficient * mieAccumulation; +opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } -void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) +`;var MR=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) { -float temp = encoded.x / 65536.0; -float x = floor(temp); -float encodedFloat1 = (temp - x) * 65536.0; -temp = encoded.y / 65536.0; -float y = floor(temp); -float encodedFloat2 = (temp - y) * 65536.0; -vector1 = czm_octDecode(encodedFloat1); -vector2 = czm_octDecode(encodedFloat2); -vector3 = czm_octDecode(vec2(x, y)); +return vec2(textureTransform * vec3(texCoord, 1.0)); } -`;var UR=`vec4 czm_packDepth(float depth) +`;var NR=`vec2 cordic(float angle) { -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; +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; } -`;var zR=`vec3 lambertianDiffuse(vec3 diffuseColor) +vec2 czm_cosineAndSine(float angle) { -return diffuseColor / czm_pi; +if (angle < -czm_piOverTwo || angle > czm_piOverTwo) +{ +if (angle < 0.0) +{ +return -cordic(angle + czm_pi); } -vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) +else { -float versine = 1.0 - VdotH; -float versineSquared = versine * versine; -return f0 + (f90 - f0) * versineSquared * versineSquared * versine; +return -cordic(angle - czm_pi); } -#ifdef USE_ANISOTROPY -float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection) +} +else { -vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0); -float GGXV = lightDirection.z * length(roughnessScale * viewDirection); -float GGXL = viewDirection.z * length(roughnessScale * lightDirection); -float v = 0.5 / (GGXV + GGXL); -return clamp(v, 0.0, 1.0); +return cordic(angle); } -float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection) +} +`;var LR=`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 FR=`vec2 czm_decompressTextureCoordinates(float encoded) { -float roughnessSquared = bitangentRoughness * tangentialRoughness; -vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared); -float w2 = roughnessSquared / dot(f, f); -return roughnessSquared * w2 * w2 / czm_pi; +float temp = encoded / 4096.0; +float xZeroTo4095 = floor(temp); +float stx = xZeroTo4095 / 4095.0; +float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; +return vec2(stx, sty); } +`;var BR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +out float v_WindowZ; #endif -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +vec4 czm_depthClamp(vec4 coords) { -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) +#ifndef LOG_DEPTH +#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) +v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; +coords.z = 0.0; +#else +coords.z = min(coords.z, coords.w); +#endif +#endif +return coords; +} +`;var kR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { -return 0.5 / GGX; +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); } -return 0.0; +`;var UR=`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); } -float GGX(float alphaRoughness, float NdotH) +`;var zR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { -float alphaRoughnessSquared = alphaRoughness * alphaRoughness; -float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0; -return alphaRoughnessSquared / (czm_pi * f * f); +return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } -float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness) +`;var VR=`bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { +return all(lessThanEqual(abs(left - right), vec4(epsilon))); +} +bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { +return all(lessThanEqual(abs(left - right), vec3(epsilon))); +} +bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { +return all(lessThanEqual(abs(left - right), vec2(epsilon))); +} +bool czm_equalsEpsilon(float left, float right, float epsilon) { +return (abs(left - right) <= epsilon); +} +`;var jR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { -float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0); -float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); -float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); -float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0); -float D = GGX(alphaRoughness, NdotH); -return G * D; +vec4 p = positionEC; +vec4 zEyeOffset = normalize(p) * eyeOffset.z; +p.xy += eyeOffset.xy + zEyeOffset.xy; +p.z += zEyeOffset.z; +return p; } -vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material) +`;var HR=`vec3 czm_eyeToCartographicDelta(vec3 positionEC) { -vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC); -float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0); -float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0); -vec3 f0 = material.specular; -float reflectance = czm_maximumComponent(f0); -vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); -vec3 F = fresnelSchlick2(f0, f90, VdotH); -#if defined(USE_SPECULAR) -F *= material.specularWeight; -#endif -float alphaRoughness = material.roughness * material.roughness; -#ifdef USE_ANISOTROPY -mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC); -vec3 lightDirection = lightDirectionEC * tbn; -vec3 viewDirection = viewDirectionEC * tbn; -vec3 halfwayDirection = halfwayDirectionEC * tbn; -float anisotropyStrength = material.anisotropyStrength; -float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength); -float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0); -float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection); -float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection); -vec3 specularContribution = F * G * D; -#else -float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness); -vec3 specularContribution = F * specularStrength; -#endif -vec3 diffuseColor = material.diffuse; -vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); -return (diffuseContribution + specularContribution) * NdotL; -} -`;var VR=`vec3 czm_pbrNeutralTonemapping(vec3 color) { -const float startCompression = 0.8 - 0.04; -const float desaturation = 0.15; -float x = min(color.r, min(color.g, color.b)); -float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04); -color -= offset; -float peak = max(color.r, max(color.g, color.b)); -if (peak < startCompression) return color; -const float d = 1.0 - startCompression; -float newPeak = 1.0 - d * d / (peak + d - startCompression); -color *= newPeak / peak; -float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0); -return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g); +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 jR=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +`;var GR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { -return czm_getLambertDiffuse(lightDirectionEC, material.normal); +vec4 q = czm_projection * positionEC; +q.xyz /= q.w; +q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; +return q; } -float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) -{ -return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); +`;var WR=`float czm_fastApproximateAtan(float x) { +return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } -vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ -float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); -if (czm_sceneMode == czm_sceneMode3D) { -diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); +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; } -float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); -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 qR=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +{ +float scalar = distanceToCamera * czm_fogDensity; +float fog = 1.0 - exp(-(scalar * scalar)); +return mix(color, fogColor, fog); } -vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) { -float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); -float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); -vec3 ambient = vec3(0.0); -vec3 color = ambient + material.emission; -color += material.diffuse * diffuse * czm_lightColor; -color += material.specular * specular * czm_lightColor; -return vec4(color, material.alpha); +float scalar = distanceToCamera * czm_fogDensity; +float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); +return mix(color, fogColor, fog); } -`;var HR=`float czm_planeDistance(vec4 plane, vec3 point) { -return (dot(plane.xyz, point) + plane.w); +`;var YR=`vec3 czm_gammaCorrect(vec3 color) { +#ifdef HDR +color = pow(color, vec3(czm_gamma)); +#endif +return color; } -float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { -return (dot(planeNormal, point) + planeDistance); +vec4 czm_gammaCorrect(vec4 color) { +#ifdef HDR +color.rgb = pow(color.rgb, vec3(czm_gamma)); +#endif +return color; } -`;var GR=`vec3 czm_pointAlongRay(czm_ray ray, float time) +`;var XR=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { -return ray.origin + (time * ray.direction); +return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -`;var WR=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) +`;var KR=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) { -vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; -vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; -q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; -float q2 = dot(q, q); -float qw = dot(q, w); -if (q2 > 1.0) +czm_material material; +material.diffuse = vec3(0.0); +material.specular = 0.0; +material.shininess = 1.0; +material.normal = materialInput.normalEC; +material.emission = vec3(0.0); +material.alpha = 1.0; +return material; +} +`;var $R=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { +const float NONE = 0.0; +const float SCENE_LIGHT = 1.0; +const float SUNLIGHT = 2.0; +vec3 lightDirection = +positionWC * float(lightEnum == NONE) + +czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) + +czm_sunDirectionWC * float(lightEnum == SUNLIGHT); +return normalize(lightDirection); +} +`;var JR=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { -if (qw >= 0.0) +return max(dot(lightDirectionEC, normalEC), 0.0); +} +`;var ZR=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { -return czm_emptyRaySegment; +vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); +float specular = max(dot(toReflectedLight, toEyeEC), 0.0); +return pow(specular, max(shininess, czm_epsilon2)); } -else +`;var QR=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) { -float qw2 = qw * qw; -float difference = q2 - 1.0; -float w2 = dot(w, w); -float product = w2 * difference; -if (qw2 < product) +float cosAngle = cos(angleInRadians); +float sinAngle = sin(angleInRadians); +vec2 s0 = vec2(1.0/17.0, 0.0); +vec2 s1 = vec2(-1.0/29.0, 0.0); +vec2 s2 = vec2(1.0/101.0, 1.0/59.0); +vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); +s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); +s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); +s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); +s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); +vec2 uv0 = (uv/103.0) + (time * s0); +vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); +vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); +vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); +uv0 = fract(uv0); +uv1 = fract(uv1); +uv2 = fract(uv2); +uv3 = fract(uv3); +vec4 noise = (texture(normalMap, uv0)) + +(texture(normalMap, uv1)) + +(texture(normalMap, uv2)) + +(texture(normalMap, uv3)); +return ((noise / 4.0) - 0.5) * 2.0; +} +`;var eO=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 czm_HSBToRGB(vec3 hsb) { -return czm_emptyRaySegment; +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); } -else if (qw2 > product) +`;var tO=`vec3 hueToRGB(float hue) { -float discriminant = qw * qw - product; -float temp = -qw + sqrt(discriminant); -float root0 = temp / w2; -float root1 = difference / temp; -if (root0 < root1) +float r = abs(hue * 6.0 - 3.0) - 1.0; +float g = 2.0 - abs(hue * 6.0 - 2.0); +float b = 2.0 - abs(hue * 6.0 - 4.0); +return clamp(vec3(r, g, b), 0.0, 1.0); +} +vec3 czm_HSLToRGB(vec3 hsl) { -czm_raySegment i = czm_raySegment(root0, root1); -return i; +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; } -else +`;var nO=`vec3 czm_hue(vec3 rgb, float adjustment) { -czm_raySegment i = czm_raySegment(root1, root0); -return i; +const mat3 toYIQ = mat3(0.299, 0.587, 0.114, +0.595716, -0.274453, -0.321263, +0.211456, -0.522591, 0.311135); +const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, +1.0, -0.2721, -0.6474, +1.0, -1.107, 1.7046); +vec3 yiq = toYIQ * rgb; +float hue = atan(yiq.z, yiq.y) + adjustment; +float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); +vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); +return toRGB * color; } +`;var iO=`vec3 czm_inverseGamma(vec3 color) { +return pow(color, vec3(1.0 / czm_gamma)); } -else +`;var rO=`bool czm_isEmpty(czm_raySegment interval) { -float root = sqrt(difference / w2); -czm_raySegment i = czm_raySegment(root, root); -return i; +return (interval.stop < 0.0); } +`;var oO=`bool czm_isFull(czm_raySegment interval) +{ +return (interval.start == 0.0 && interval.stop == czm_infinity); } +`;var sO=`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; } -else if (q2 < 1.0) +`;var aO=`vec3 czm_linearToSrgb(vec3 linearIn) { -float difference = q2 - 1.0; -float w2 = dot(w, w); -float product = w2 * difference; -float discriminant = qw * qw - product; -float temp = -qw + sqrt(discriminant); -czm_raySegment i = czm_raySegment(0.0, temp / w2); -return i; +return pow(linearIn, vec3(1.0/2.2)); } -else +vec4 czm_linearToSrgb(vec4 linearIn) { -if (qw < 0.0) +vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); +return vec4(srgbOut, linearIn.a); +} +`;var cO=`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 lO=`float czm_luminance(vec3 rgb) { -float w2 = dot(w, w); -czm_raySegment i = czm_raySegment(0.0, -qw / w2); -return i; +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +return dot(rgb, W); } -else +`;var uO=`float czm_maximumComponent(vec2 v) { -return czm_emptyRaySegment; +return max(v.x, v.y); } +float czm_maximumComponent(vec3 v) +{ +return max(max(v.x, v.y), v.z); } +float czm_maximumComponent(vec4 v) +{ +return max(max(max(v.x, v.y), v.z), v.w); } -`;var qR=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +`;var fO=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) { -vec3 o = ray.origin; -vec3 d = ray.direction; -vec3 oc = o - center; -float a = dot(d, d); -float b = 2.0 * dot(d, oc); -float c = dot(oc, oc) - (radius * radius); -float det = (b * b) - (4.0 * a * c); -if (det < 0.0) { -return czm_emptyRaySegment; -} -float sqrtDet = sqrt(det); -float t0 = (-b - sqrtDet) / (2.0 * a); -float t1 = (-b + sqrtDet) / (2.0 * a); -czm_raySegment result = czm_raySegment(t0, t1); -return result; -} -`;var YR=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +float width = czm_viewport.z; +float height = czm_viewport.w; +float pixelWidth; +float pixelHeight; +float top = czm_frustumPlanes.x; +float bottom = czm_frustumPlanes.y; +float left = czm_frustumPlanes.z; +float right = czm_frustumPlanes.w; +if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) { -return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var XR=`float czm_readNonPerspective(float value, float oneOverW) { -return value * oneOverW; -} -vec2 czm_readNonPerspective(vec2 value, float oneOverW) { -return value * oneOverW; +float frustumWidth = right - left; +float frustumHeight = top - bottom; +pixelWidth = frustumWidth / width; +pixelHeight = frustumHeight / height; } -vec3 czm_readNonPerspective(vec3 value, float oneOverW) { -return value * oneOverW; +else +{ +float distanceToPixel = -positionEC.z; +float inverseNear = 1.0 / czm_currentFrustum.x; +float tanTheta = top * inverseNear; +pixelHeight = 2.0 * distanceToPixel * tanTheta / height; +tanTheta = right * inverseNear; +pixelWidth = 2.0 * distanceToPixel * tanTheta / width; } -vec4 czm_readNonPerspective(vec4 value, float oneOverW) { -return value * oneOverW; +return max(pixelWidth, pixelHeight) * pixelRatio; } -`;var KR=`float czm_reverseLogDepth(float logZ) +float czm_metersPerPixel(vec4 positionEC) { -#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; +return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var $R=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -vec3 czm_RGBToHSB(vec3 rgb) +`;var dO=`vec4 czm_modelToWindowCoordinates(vec4 position) { -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); +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 JR=`vec3 RGBtoHCV(vec3 rgb) +`;var hO=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { -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); +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +vec3 target = left * right; +float leftLuminance = dot(left, W); +float rightLuminance = dot(right, W); +float targetLuminance = dot(target, W); +return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } -vec3 czm_RGBToHSL(vec3 rgb) +`;var mO=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { -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); +float valueAtMin = nearFarScalar.y; +float valueAtMax = nearFarScalar.w; +float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; +float farDistanceSq = nearFarScalar.z * nearFarScalar.z; +float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); +t = pow(clamp(t, 0.0, 1.0), 0.2); +return mix(valueAtMin, valueAtMax, t); } -`;var ZR=`vec3 czm_RGBToXYZ(vec3 rgb) +`;var pO=`vec3 czm_octDecode(vec2 encoded, float range) { -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 QR=`float czm_round(float value) { -return floor(value + 0.5); -} -vec2 czm_round(vec2 value) { -return floor(value + 0.5); +if (encoded.x == 0.0 && encoded.y == 0.0) { +return vec3(0.0, 0.0, 0.0); } -vec3 czm_round(vec3 value) { -return floor(value + 0.5); +encoded = encoded / range * 2.0 - 1.0; +vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); +if (v.z < 0.0) +{ +v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); } -vec4 czm_round(vec4 value) { -return floor(value + 0.5); +return normalize(v); } -`;var eO=`vec3 czm_saturation(vec3 rgb, float adjustment) +vec3 czm_octDecode(vec2 encoded) { -const vec3 W = vec3(0.2125, 0.7154, 0.0721); -vec3 intensity = vec3(dot(rgb, W)); -return mix(intensity, rgb, adjustment); +return czm_octDecode(encoded, 255.0); } -`;var tO=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) +vec3 czm_octDecode(float encoded) { -return czm_unpackDepth(czm_textureCube(shadowMap, d)); +float temp = encoded / 256.0; +float x = floor(temp); +float y = (temp - x) * 256.0; +return czm_octDecode(vec2(x, y)); } -float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) +void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) { -#ifdef USE_SHADOW_DEPTH_TEXTURE -return texture(shadowMap, uv).r; -#else -return czm_unpackDepth(texture(shadowMap, uv)); -#endif +float temp = encoded.x / 65536.0; +float x = floor(temp); +float encodedFloat1 = (temp - x) * 65536.0; +temp = encoded.y / 65536.0; +float y = floor(temp); +float encodedFloat2 = (temp - y) * 65536.0; +vector1 = czm_octDecode(encodedFloat1); +vector2 = czm_octDecode(encodedFloat2); +vector3 = czm_octDecode(vec2(x, y)); } -float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) +`;var gO=`vec4 czm_packDepth(float depth) { -return step(depth, czm_sampleShadowMap(shadowMap, uv)); +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; } -float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) +`;var _O=`vec3 lambertianDiffuse(vec3 diffuseColor) { -return step(depth, czm_sampleShadowMap(shadowMap, uv)); +return diffuseColor / czm_pi; } -`;var nO=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) { -#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; +float versine = 1.0 - VdotH; +float versineSquared = versine * versine; +return f0 + (f90 - f0) * versineSquared * versineSquared * versine; } -#ifdef USE_CUBE_MAP_SHADOW -float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +#ifdef USE_ANISOTROPY +float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection) { -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); +vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0); +float GGXV = lightDirection.z * length(roughnessScale * viewDirection); +float GGXL = viewDirection.z * length(roughnessScale * lightDirection); +float v = 0.5 / (GGXV + GGXL); +return clamp(v, 0.0, 1.0); } -#else -float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) +float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection) { -float depthBias = shadowParameters.depthBias; -float depth = shadowParameters.depth; -float nDotL = shadowParameters.nDotL; -float normalShadingSmooth = shadowParameters.normalShadingSmooth; -float darkness = shadowParameters.darkness; -vec2 uv = shadowParameters.texCoords; -depth -= depthBias; -#ifdef USE_SOFT_SHADOWS -vec2 texelStepSize = shadowParameters.texelStepSize; -float radius = 1.0; -float dx0 = -texelStepSize.x * radius; -float dy0 = -texelStepSize.y * radius; -float dx1 = texelStepSize.x * radius; -float dy1 = texelStepSize.y * radius; -float visibility = ( -czm_shadowDepthCompare(shadowMap, uv, depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) -) * (1.0 / 9.0); -#else -float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); -#endif -return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +float roughnessSquared = bitangentRoughness * tangentialRoughness; +vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared); +float w2 = roughnessSquared / dot(f, f); +return roughnessSquared * w2 * w2 / czm_pi; } #endif -`;var iO=`float czm_signNotZero(float value) +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) { -return value >= 0.0 ? 1.0 : -1.0; -} -vec2 czm_signNotZero(vec2 value) +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 vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); +return 0.5 / GGX; } -vec3 czm_signNotZero(vec3 value) +return 0.0; +} +float GGX(float alphaRoughness, float NdotH) { -return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0; +return alphaRoughnessSquared / (czm_pi * f * f); } -vec4 czm_signNotZero(vec4 value) +float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness) { -return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); +float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0); +float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); +float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); +float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0); +float D = GGX(alphaRoughness, NdotH); +return G * D; } -`;var rO=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial 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 oO=`vec3 czm_srgbToLinear(vec3 srgbIn) -{ -return pow(srgbIn, vec3(2.2)); -} -vec4 czm_srgbToLinear(vec4 srgbIn) -{ -vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); -return vec4(linearOut, srgbIn.a); -} -`;var sO=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) -{ -vec3 normal = normalize(normalEC); -vec3 tangent = normalize(tangentEC); -vec3 bitangent = normalize(bitangentEC); -return mat3(tangent.x , tangent.y , tangent.z, -bitangent.x, bitangent.y, bitangent.z, -normal.x , normal.y , normal.z); -} -`;var aO=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { -#if __VERSION__ == 300 -return texture(sampler, p); -#else -return textureCube(sampler, p); +vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC); +float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0); +float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0); +vec3 f0 = material.specular; +float reflectance = czm_maximumComponent(f0); +vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); +vec3 F = fresnelSchlick2(f0, f90, VdotH); +#if defined(USE_SPECULAR) +F *= material.specularWeight; #endif -} -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); +float alphaRoughness = material.roughness * material.roughness; +#ifdef USE_ANISOTROPY +mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC); +vec3 lightDirection = lightDirectionEC * tbn; +vec3 viewDirection = viewDirectionEC * tbn; +vec3 halfwayDirection = halfwayDirectionEC * tbn; +float anisotropyStrength = material.anisotropyStrength; +float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength); +float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0); +float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection); +float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection); +vec3 specularContribution = F * G * D; +#else +float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness); +vec3 specularContribution = F * specularStrength; #endif +vec3 diffuseColor = material.diffuse; +vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); +return (diffuseContribution + specularContribution) * NdotL; } -`;var cO=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { -vec4 transformedPlane = transform * plane; -float normalMagnitude = length(transformedPlane.xyz); -return transformedPlane / normalMagnitude; +`;var yO=`vec3 czm_pbrNeutralTonemapping(vec3 color) { +const float startCompression = 0.8 - 0.04; +const float desaturation = 0.15; +float x = min(color.r, min(color.g, color.b)); +float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04); +color -= offset; +float peak = max(color.r, max(color.g, color.b)); +if (peak < startCompression) return color; +const float d = 1.0 - startCompression; +float newPeak = 1.0 - d * d / (peak + d - startCompression); +color *= newPeak / peak; +float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0); +return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g); } -`;var lO=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +`;var AO=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { -vec3 highDifference = high - czm_encodedCameraPositionMCHigh; -if (length(highDifference) == 0.0) { -highDifference = vec3(0); +return czm_getLambertDiffuse(lightDirectionEC, material.normal); } -vec3 lowDifference = low - czm_encodedCameraPositionMCLow; -return vec4(highDifference + lowDifference, 1.0); +float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) +{ +return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); } -`;var uO=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); +float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); if (czm_sceneMode == czm_sceneMode3D) { -diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); +diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); } -diffuse = clamp(diffuse, 0.0, 1.0); -float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); +float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); vec3 materialDiffuse = material.diffuse * 0.5; vec3 ambient = materialDiffuse; vec3 color = ambient + material.emission; @@ -1557,2580 +1728,1714 @@ color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var fO=`mat2 czm_transpose(mat2 matrix) +vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -return mat2( -matrix[0][0], matrix[1][0], -matrix[0][1], matrix[1][1]); +float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); +float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); +vec3 ambient = vec3(0.0); +vec3 color = ambient + material.emission; +color += material.diffuse * diffuse * czm_lightColor; +color += material.specular * specular * czm_lightColor; +return vec4(color, material.alpha); } -mat3 czm_transpose(mat3 matrix) +`;var bO=`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 xO=`vec3 czm_pointAlongRay(czm_ray ray, float time) { -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]); +return ray.origin + (time * ray.direction); } -mat4 czm_transpose(mat4 matrix) +`;var TO=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { -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]); +vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; +vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; +q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; +float q2 = dot(q, q); +float qw = dot(q, w); +if (q2 > 1.0) +{ +if (qw >= 0.0) +{ +return czm_emptyRaySegment; } -`;var dO=`float czm_unpackDepth(vec4 packedDepth) +else { -return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); +float qw2 = qw * qw; +float difference = q2 - 1.0; +float w2 = dot(w, w); +float product = w2 * difference; +if (qw2 < product) +{ +return czm_emptyRaySegment; } -`;var hO=`float czm_unpackFloat(vec4 packedFloat) +else if (qw2 > product) { -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) +float discriminant = qw * qw - product; +float temp = -qw + sqrt(discriminant); +float root0 = temp / w2; +float root1 = difference / temp; +if (root0 < root1) { -return 0.0; +czm_raySegment i = czm_raySegment(root0, root1); +return i; } -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; +else +{ +czm_raySegment i = czm_raySegment(root1, root0); +return i; } -`;var mO=`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); +else +{ +float root = sqrt(difference / w2); +czm_raySegment i = czm_raySegment(root, root); +return i; } -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 pO=`int czm_unpackUint(float packedValue) { -float rounded = czm_round(packedValue * 255.0); -return int(rounded); +else if (q2 < 1.0) +{ +float difference = q2 - 1.0; +float w2 = dot(w, w); +float product = w2 * difference; +float discriminant = qw * qw - product; +float temp = -qw + sqrt(discriminant); +czm_raySegment i = czm_raySegment(0.0, temp / w2); +return i; } -int czm_unpackUint(vec2 packedValue) { -vec2 rounded = czm_round(packedValue * 255.0); -return int(dot(rounded, vec2(1.0, 256.0))); +else +{ +if (qw < 0.0) +{ +float w2 = dot(w, w); +czm_raySegment i = czm_raySegment(0.0, -qw / w2); +return i; } -int czm_unpackUint(vec3 packedValue) { -vec3 rounded = czm_round(packedValue * 255.0); -return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); +else +{ +return czm_emptyRaySegment; } -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 gO=`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; +`;var EO=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +{ +vec3 o = ray.origin; +vec3 d = ray.direction; +vec3 oc = o - center; +float a = dot(d, d); +float b = 2.0 * dot(d, oc); +float c = dot(oc, oc) - (radius * radius); +float det = (b * b) - (4.0 * a * c); +if (det < 0.0) { +return czm_emptyRaySegment; } -vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { -return scale * value + offset; +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; } -vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { -return scale * value + offset; +`;var CO=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +{ +return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { -return matrixCompMult(scale, value) + offset; +`;var vO=`float czm_readNonPerspective(float value, float oneOverW) { +return value * oneOverW; } -mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { -return matrixCompMult(scale, value) + offset; +vec2 czm_readNonPerspective(vec2 value, float oneOverW) { +return value * oneOverW; } -mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { -return matrixCompMult(scale, value) + offset; +vec3 czm_readNonPerspective(vec3 value, float oneOverW) { +return value * oneOverW; } -`;var _O=`#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; +vec4 czm_readNonPerspective(vec4 value, float oneOverW) { +return value * oneOverW; } -void czm_vertexLogDepth() +`;var SO=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH -v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; -gl_Position = czm_updatePositionDepth(gl_Position); +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; } -void czm_vertexLogDepth(vec4 clipCoords) +`;var wO=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec3 czm_RGBToHSB(vec3 rgb) { -#ifdef LOG_DEPTH -v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; -czm_updatePositionDepth(clipCoords); -#endif +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 yO=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var IO=`vec3 RGBtoHCV(vec3 rgb) { -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))) +vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); +vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); +float c = q.x - min(q.w, q.y); +float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); +return vec3(h, c, q.x); +} +vec3 czm_RGBToHSL(vec3 rgb) { -q = czm_inverseProjection * q; +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); } -else +`;var PO=`vec3 czm_RGBToXYZ(vec3 rgb) { -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; +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; } -return q; +`;var DO=`float czm_round(float value) { +return floor(value + 0.5); } -vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) +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 RO=`vec3 czm_saturation(vec3 rgb, float adjustment) { -vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; -return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +vec3 intensity = vec3(dot(rgb, W)); +return mix(intensity, rgb, adjustment); } -vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +`;var OO=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { -#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; +return czm_unpackDepth(czm_textureCube(shadowMap, d)); +} +float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) +{ +#ifdef USE_SHADOW_DEPTH_TEXTURE +return texture(shadowMap, uv).r; #else -vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); -vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +return czm_unpackDepth(texture(shadowMap, uv)); #endif -return eyeCoordinate; } -vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) { -vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; -return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); +return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var AO=`#if !defined(LOG_DEPTH) -in float v_WindowZ; -#endif -void czm_writeDepthClamp() +float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { -#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) -gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); -#endif +return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var bO=`#ifdef LOG_DEPTH -in float v_depthFromNearPlusOne; -#ifdef POLYGON_OFFSET -uniform vec2 u_polygonOffset; +`;var MO=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +{ +#ifdef USE_NORMAL_SHADING +#ifdef USE_NORMAL_SHADING_SMOOTH +float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); +#else +float strength = step(0.0, nDotL); #endif +visibility *= strength; #endif -void czm_writeLogDepth(float depth) -{ -#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) -if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { -discard; +visibility = max(visibility, darkness); +return visibility; } -#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; +#ifdef USE_CUBE_MAP_SHADOW +float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +{ +float depthBias = shadowParameters.depthBias; +float depth = shadowParameters.depth; +float nDotL = shadowParameters.nDotL; +float normalShadingSmooth = shadowParameters.normalShadingSmooth; +float darkness = shadowParameters.darkness; +vec3 uvw = shadowParameters.texCoords; +depth -= depthBias; +float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); +return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } +#else +float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) +{ +float depthBias = shadowParameters.depthBias; +float depth = shadowParameters.depth; +float nDotL = shadowParameters.nDotL; +float normalShadingSmooth = shadowParameters.normalShadingSmooth; +float darkness = shadowParameters.darkness; +vec2 uv = shadowParameters.texCoords; +depth -= depthBias; +#ifdef USE_SOFT_SHADOWS +vec2 texelStepSize = shadowParameters.texelStepSize; +float radius = 1.0; +float dx0 = -texelStepSize.x * radius; +float dy0 = -texelStepSize.y * radius; +float dx1 = texelStepSize.x * radius; +float dy1 = texelStepSize.y * radius; +float visibility = ( +czm_shadowDepthCompare(shadowMap, uv, depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) +) * (1.0 / 9.0); +#else +float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); #endif -#endif -gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; -#ifdef POLYGON_OFFSET -gl_FragDepth += czm_epsilon7 * units; -#endif -#endif +return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } -void czm_writeLogDepth() { -#ifdef LOG_DEPTH -czm_writeLogDepth(v_depthFromNearPlusOne); #endif +`;var NO=`float czm_signNotZero(float value) +{ +return value >= 0.0 ? 1.0 : -1.0; } -`;var xO=`float czm_writeNonPerspective(float value, float w) { -return value * w; +vec2 czm_signNotZero(vec2 value) +{ +return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); } -vec2 czm_writeNonPerspective(vec2 value, float w) { -return value * w; +vec3 czm_signNotZero(vec3 value) +{ +return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); } -vec3 czm_writeNonPerspective(vec3 value, float w) { -return value * w; +vec4 czm_signNotZero(vec4 value) +{ +return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -vec4 czm_writeNonPerspective(vec4 value, float w) { -return value * w; +`;var LO=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +{ +vec3 L00 = coefficients[0]; +vec3 L1_1 = coefficients[1]; +vec3 L10 = coefficients[2]; +vec3 L11 = coefficients[3]; +vec3 L2_2 = coefficients[4]; +vec3 L2_1 = coefficients[5]; +vec3 L20 = coefficients[6]; +vec3 L21 = coefficients[7]; +vec3 L22 = coefficients[8]; +float x = normal.x; +float y = normal.y; +float z = normal.z; +vec3 L = +L00 ++ L1_1 * y ++ L10 * z ++ L11 * x ++ L2_2 * (y * x) ++ L2_1 * (y * z) ++ L20 * (3.0 * z * z - 1.0) ++ L21 * (z * x) ++ L22 * (x * x - y * y); +return max(L, vec3(0.0)); } -`;var TO=`vec3 czm_XYZToRGB(vec3 Yxy) +`;var FO=`vec3 czm_srgbToLinear(vec3 srgbIn) { -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; +return pow(srgbIn, vec3(2.2)); } -`;var px={czm_degreesPerRadian:HD,czm_depthRange:GD,czm_epsilon1:WD,czm_epsilon2:qD,czm_epsilon3:YD,czm_epsilon4:XD,czm_epsilon5:KD,czm_epsilon6:$D,czm_epsilon7:JD,czm_infinity:ZD,czm_oneOverPi:QD,czm_oneOverTwoPi:e1,czm_passCesium3DTile:t1,czm_passCesium3DTileClassification:n1,czm_passCesium3DTileClassificationIgnoreShow:i1,czm_passCesium3DTileEdges:r1,czm_passCesium3DTileEdgesDirect:o1,czm_passCesium3DTilePlanarFillId:s1,czm_passClassification:a1,czm_passCompute:c1,czm_passEnvironment:l1,czm_passGaussianSplats:u1,czm_passGlobe:f1,czm_passOpaque:d1,czm_passOverlay:h1,czm_passTerrainClassification:m1,czm_passTranslucent:p1,czm_passVoxels:g1,czm_pi:_1,czm_piOverFour:y1,czm_piOverSix:A1,czm_piOverThree:b1,czm_piOverTwo:x1,czm_radiansPerDegree:T1,czm_sceneMode2D:E1,czm_sceneMode3D:C1,czm_sceneModeColumbusView:v1,czm_sceneModeMorphing:S1,czm_solarRadius:w1,czm_threePiOver2:I1,czm_twoPi:P1,czm_webMercatorMaxLatitude:D1,czm_depthRangeStruct:R1,czm_material:O1,czm_materialInput:M1,czm_modelMaterial:N1,czm_modelVertexOutput:L1,czm_ray:F1,czm_raySegment:B1,czm_shadowParameters:k1,czm_acesTonemapping:U1,czm_alphaWeight:z1,czm_antialias:V1,czm_applyHSBShift:j1,czm_approximateSphericalCoordinates:H1,czm_approximateTanh:G1,czm_backFacing:W1,czm_branchFreeTernary:q1,czm_cascadeColor:Y1,czm_cascadeDistance:X1,czm_cascadeMatrix:K1,czm_cascadeWeights:$1,czm_columbusViewMorph:J1,czm_computeAtmosphereColor:Z1,czm_computeGroundAtmosphereScattering:Q1,czm_computePosition:eR,czm_computeScattering:tR,czm_computeTextureTransform:nR,czm_cosineAndSine:iR,czm_decodeRGB8:rR,czm_decompressTextureCoordinates:oR,czm_depthClamp:sR,czm_eastNorthUpToEyeCoordinates:aR,czm_ellipsoidContainsPoint:cR,czm_ellipsoidTextureCoordinates:lR,czm_equalsEpsilon:uR,czm_eyeOffset:fR,czm_eyeToCartographicDelta:dR,czm_eyeToWindowCoordinates:hR,czm_fastApproximateAtan:mR,czm_fog:pR,czm_gammaCorrect:gR,czm_geodeticSurfaceNormal:_R,czm_getDefaultMaterial:yR,czm_getDynamicAtmosphereLightDirection:AR,czm_getLambertDiffuse:bR,czm_getSpecular:xR,czm_getWaterNoise:TR,czm_HSBToRGB:ER,czm_HSLToRGB:CR,czm_hue:vR,czm_inverseGamma:SR,czm_isEmpty:wR,czm_isFull:IR,czm_latitudeToWebMercatorFraction:PR,czm_linearToSrgb:DR,czm_lineDistance:RR,czm_luminance:OR,czm_maximumComponent:MR,czm_metersPerPixel:NR,czm_modelToWindowCoordinates:LR,czm_multiplyWithColorBalance:FR,czm_nearFarScalar:BR,czm_octDecode:kR,czm_packDepth:UR,czm_pbrLighting:zR,czm_pbrNeutralTonemapping:VR,czm_phong:jR,czm_planeDistance:HR,czm_pointAlongRay:GR,czm_rayEllipsoidIntersectionInterval:WR,czm_raySphereIntersectionInterval:qR,czm_readDepth:YR,czm_readNonPerspective:XR,czm_reverseLogDepth:KR,czm_RGBToHSB:$R,czm_RGBToHSL:JR,czm_RGBToXYZ:ZR,czm_round:QR,czm_saturation:eO,czm_shadowDepthCompare:tO,czm_shadowVisibility:nO,czm_signNotZero:iO,czm_sphericalHarmonics:rO,czm_srgbToLinear:oO,czm_tangentToEyeSpaceMatrix:sO,czm_textureCube:aO,czm_transformPlane:cO,czm_translateRelativeToEye:lO,czm_translucentPhong:uO,czm_transpose:fO,czm_unpackDepth:dO,czm_unpackFloat:hO,czm_unpackTexture:mO,czm_unpackUint:pO,czm_valueTransform:gO,czm_vertexLogDepth:_O,czm_windowToEyeCoordinates:yO,czm_writeDepthClamp:AO,czm_writeLogDepth:bO,czm_writeNonPerspective:xO,czm_XYZToRGB:TO};var v8e=new h;function Nt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var oc={};oc[te.FLOAT]="float";oc[te.FLOAT_VEC2]="vec2";oc[te.FLOAT_VEC3]="vec3";oc[te.FLOAT_VEC4]="vec4";oc[te.INT]="int";oc[te.INT_VEC2]="ivec2";oc[te.INT_VEC3]="ivec3";oc[te.INT_VEC4]="ivec4";oc[te.BOOL]="bool";oc[te.BOOL_VEC2]="bvec2";oc[te.BOOL_VEC3]="bvec3";oc[te.BOOL_VEC4]="bvec4";oc[te.FLOAT_MAT2]="mat2";oc[te.FLOAT_MAT3]="mat3";oc[te.FLOAT_MAT4]="mat4";oc[te.SAMPLER_2D]="sampler2D";oc[te.SAMPLER_CUBE]="samplerCube";Nt.prototype.getDeclaration=function(e){let t=`uniform ${oc[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var S8e={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,v8e)}}),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}})},hg=S8e;function w8e(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 EO=w8e;function Ode(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 Mde(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=Ode(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Nde(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=Mde(i,La._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),Nde(r,t)}}))}function I8e(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 P8e(e){let t=[],n=Mde("main",e,t);Nde(n,t),I8e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} -`;return i.replace(n.glslSource,"")}function Lde(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` -#line 0 -${r[g]}`;i=Ode(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; +vec4 czm_srgbToLinear(vec4 srgbIn) +{ +vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); +return vec4(linearOut, srgbIn.a); +} +`;var BO=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +{ +vec3 normal = normalize(normalEC); +vec3 tangent = normalize(tangentEC); +vec3 bitangent = normalize(bitangentEC); +return mat3(tangent.x , tangent.y , tangent.z, +bitangent.x, bitangent.y, bitangent.z, +normal.x , normal.y , normal.z); +} +`;var kO=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 +return texture(sampler, p); #else - precision mediump float; - precision mediump int; - #define highp mediump -#endif -`),n.webgl2&&(c+=`precision highp sampler3D; - -`);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&&(c+=`#define OES_texture_float - -`);let d="";e.includeBuiltIns&&(d=P8e(i)),c+=` -#line 0 -`;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; - -`),c+=d,c+=i,n.webgl2?c=`#version 300 es -${c}`:c=EO(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 Lde(this,!1,e)};La.prototype.createCombinedFragmentShader=function(e){return Lde(this,!0,e)};La._czmBuiltinsAndUniforms={};for(let e in px)px.hasOwnProperty(e)&&(La._czmBuiltinsAndUniforms[e]=px[e]);for(let e in hg)if(hg.hasOwnProperty(e)){let t=hg[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; -}`};La.createPickFragmentShaderSource=function(e,t){let n=La.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; -void main() -{ - czm_old_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = czm_pickColor; -}`;return`${n} -${i}`};function D8e(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 Fde(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 Bde(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Fde(e,r))return r}}var R8e=["v_normalEC","v_normal"];La.findNormalVarying=function(e){return Fde(e,"#ifdef HAS_NORMALS")?D8e(e,"HAS_NORMALS")?"v_normalEC":void 0:Bde(e,R8e)};var O8e=["v_positionEC"];La.findPositionVarying=function(e){return Bde(e,O8e)};var Ye=La;function Qc(e){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 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(Qc.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}}});Qc.DEFAULT_COLOR_VALUE=z.WHITE;Qc.DEFAULT_SHOW_VALUE=!0;function kde(e){let t=e._textureDimensions;return t.x*t.y*4}function Ude(e){if(!l(e._batchValues)){let t=kde(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function zde(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Qc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=zde(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=Ude(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};Qc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Qc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var M8e=new Array(4);Qc.prototype.setColor=function(e,t){if(z.equals(t,Qc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(M8e),i=n[3],r=Ude(this),o=e*4,s=zde(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)}};Qc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Qc.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Qc.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)};Qc.prototype.getPickColor=function(e){return this._pickIds[e]};function Vde(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 N8e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=kde(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=Vde(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function L8e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Qc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&N8e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Vde(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),L8e(this))};Qc.prototype.isDestroyed=function(){return!1};Qc.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 le(this)};var Vl=Qc;var jde={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(jde);var Fu=jde;var Hde={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(Hde);var Zn=Hde;var Gde={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(Gde);var Rt=Gde;var c6={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};c6.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Zn.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:Zn.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:c6.CESIUM_3D_TILE_MASK,mask:c6.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(c6);function F8e(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 Qn=F8e;var KY=Vl.DEFAULT_COLOR_VALUE,$Y=Vl.DEFAULT_SHOW_VALUE;function Yr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=B8e(n);this._properties=s,this._batchTableHierarchy=k8e(this,n,i);let a=qde(t,s,i);this._binaryPropertiesByteLength=U8e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Vl({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Yr._deprecationWarning=qr;Object.defineProperties(Yr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function B8e(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 k8e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Yr._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 gx({extension:i,binaryBody:n})}function qde(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=wd(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 U8e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Yr.getBinaryProperties=function(e,t,n){return qde(e,t,n)};Yr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Yr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Yr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Yr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Yr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Yr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Yr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var z8e=new z;Yr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(KY),this.setAllShow($Y);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,z8e)??KY:KY,s=l(e.show)?e.show.evaluate(r)??$Y:$Y;this.setColor(i,o),this.setShow(i,s)}};function V8e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function j8e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Yr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Yr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Yr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Yr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Yr.prototype.hasPropertyBySemantic=function(){return!1};Yr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Qn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Qn(t,i)}return t};Yr.prototype.getPropertyBySemantic=function(e,t){};Yr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return V8e(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}};Yr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){j8e(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 H8e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}Yr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=Yde(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; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${H8e(i)}${s}`}};function Wde(e,t){return e=Ye.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function G8e(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 Yde(e,t,n){if(!l(t))return Wde(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return Wde(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))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,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=G8e(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${o} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}Yr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Yde(i,t,!0),kt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};function W8e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Fu.HIGHLIGHT)return 0;if(n===Fu.REPLACE)return 1;if(n===Fu.MIX)return D.clamp(i,D.EPSILON4,1)}Yr.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 W8e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Yr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var By={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Yr.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=q8e(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=Y8e(f),f.dirty=!1);let p=d.originalCommand;c!==By.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=X8e(p))),c!==By.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=K8e(p)),a&&(o||(l(d.zback)||(d.zback=J8e(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Q8e(d.stencil))&&(f.renderState.depthMask?d.stencil=Z8e(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 q8e(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?By.ALL_OPAQUE:t===e.featuresLength?By.ALL_TRANSLUCENT:By.OPAQUE_AND_TRANSLUCENT}function Y8e(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 X8e(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=eje(e.renderState),t}function K8e(e){let t=at.shallowClone(e);return t.renderState=tje(e.renderState),t}function $8e(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 J8e(e,t){let n=at.shallowClone(t),i=Je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ui.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=$8e(e,t.shaderProgram),n}function Z8e(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=Zn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=Zn.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 Q8e(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function eje(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 tje(e){let t=Je(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Yr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Yr.prototype.isDestroyed=function(){return!1};Yr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var Wh=Yr;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,nje(this,e.extension,e.binaryBody)}Object.defineProperties(mg.prototype,{byteLength:{get:function(){return this._byteLength}}});function nje(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=wd(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=wd(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=wd(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=Wh.getBinaryProperties(b,x,n);p+=ije(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 ije(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var rje=[],oje=[],sje=0;function aje(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=rje;c.length=Math.max(c.length,a);let u=++sje,f=oje;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 cje(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 CO(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return aje(e,t,n)}else return n(e,t);return cje(e,t,n)}mg.prototype.hasProperty=function(e,t){let n=CO(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,CO(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 CO(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)?lje(a,s):Je(a[s],!0)})};function lje(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=CO(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)?uje(u,c,n):u[c]=Je(n,!0),!0});return l(i)};function uje(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=CO(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 gx=mg;function Pf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Pf.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}}});Pf.packedLength=2;Pf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Pf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Pf),n.near=e[t++],n.far=e[t],n};Pf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Pf.clone=function(e,t){if(l(e))return l(t)||(t=new Pf),t.near=e.near,t.far=e.far,t};Pf.prototype.clone=function(e){return Pf.clone(this,e)};Pf.prototype.equals=function(e){return Pf.equals(this,e)};var Ht=Pf;function Id(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Id.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 Id(e.near,e.nearValue,e.far,e.farValue)};Id.packedLength=4;Id.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};Id.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Id),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Id.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};Id.prototype.clone=function(e){return Id.clone(this,e)};Id.prototype.equals=function(e){return Id.equals(this,e)};var qt=Id;var fje=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Us=fje;function qh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Us.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(qh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Us.LOADED}},hasImage:{get:function(){return this._loadState!==Us.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});qh.prototype.unload=async function(){this._loadState!==Us.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Us.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};qh.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===Us.LOADING||t.loadState===Us.LOADED){qh.clone(s,this);return}l(s)||(s=new qh(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Us.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=Us.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Us.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Us.FAILED,s._index=-1,this._id!==e)return;this._loadState=Us.FAILED,this._index=-1;return}s._index=a,s._loadState=Us.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Us.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};qh.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)};qh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Us.LOADING,i=await n}catch(r){this._loadState=Us.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Us.LOADED,this.setImageSubRegion(i,t))};qh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Us.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}};qh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};qh.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 pg=qh;var ky={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(ky);var We=ky;function As(e){return e===ky.CLAMP_TO_GROUND||e===ky.CLAMP_TO_3D_TILE||e===ky.CLAMP_TO_TERRAIN}function Uy(e){return e===ky.RELATIVE_TO_GROUND||e===ky.RELATIVE_TO_3D_TILE||e===ky.RELATIVE_TO_TERRAIN}var Xde={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Xde);var ji=Xde;var vO={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};vO.getMorphTime=function(e){return e===vO.SCENE3D?1:e===vO.MORPHING?void 0:0};Object.freeze(vO);var re=vO;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 dje=new h;Fa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,dje),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 hje=new h;Fa.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Fa.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,hje);return h.subtract(t,r,n)};var mje=new N,pje=new se,gje=new h;Fa.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,mje),s=se.fromElements(i.x,i.y,i.z,r,pje);s=N.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,gje);return s=se.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 sn=Fa;function Pd(e){this.planes=e??[]}var SO=[new h,new h,new h];h.clone(h.UNIT_X,SO[0]);h.clone(h.UNIT_Y,SO[1]);h.clone(h.UNIT_Z,SO[2]);var zy=new h,_je=new h,Kde=new sn(new h(1,0,0),0);function $de(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Pd.fromBoundingSphere=function(e,t){l(t)||(t=new Pd);let n=SO.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=SO[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,zy),h.add(r,zy,zy),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,zy),h.multiplyByScalar(c,o,zy),h.add(r,zy,zy),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,_je),zy),s+=2}return t};Pd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane($de(t[i],Kde));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};Pd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Pd.MASK_OUTSIDE||t===Pd.MASK_INSIDE)return t;let n=Pd.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($de(i[r],Kde));if(a===$t.OUTSIDE)return Pd.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};Pd.MASK_OUTSIDE=4294967295;Pd.MASK_INSIDE=0;Pd.MASK_INDETERMINATE=2147483647;var ea=Pd;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 ea,this._orthographicMatrix=new N}function Jde(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 Jde(this),this._orthographicMatrix}}});var yje=new h,Aje=new h,bje=new h,JY=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,yje);h.normalize(f,f);let d=Aje;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=bje;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,JY),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,JY),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,JY),p),this._cullingVolume};Lp.prototype.getPixelDimensions=function(e,t,n,i,r){Jde(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 bs=Lp;function Bu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new bs,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}Bu.packedLength=4;Bu.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};Bu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Bu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Vy(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(Bu.prototype,{projectionMatrix:{get:function(){return Vy(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Vy(this),this._offCenterFrustum}}});Bu.prototype.computeCullingVolume=function(e,t,n){return Vy(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Bu.prototype.getPixelDimensions=function(e,t,n,i,r){return Vy(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.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};Bu.prototype.equals=function(e){return!l(e)||!(e instanceof Bu)?!1:(Vy(this),Vy(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Bu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Bu)?!1:(Vy(this),Vy(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 mn=Bu;var Pc={},xje=new se(0,0,0,1),el=new se,Tje=new et,ZY=new U,QY=new U;Pc.worldToWindowCoordinates=function(e,t,n){return Pc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Zde=new se,Qde=new h;function wO(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,Zde),Zde),s=h.multiplyComponents(t,h.normalize(o,Qde),Qde);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 Eje=new he(Math.PI,D.PI_OVER_TWO),Cje=new h,vje=new h;Pc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Pc.computeActualEllipsoidPosition(r,t,xje);if(!l(o))return;let s=e.canvas,a=Tje;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=Eje,p=f.project(d,Cje),g=h.clone(c.position,vje),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,el=wO(o,n,c,el),Pc.clipToGLWindowCoordinates(a,el,ZY),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,el=wO(o,n,c,el),Pc.clipToGLWindowCoordinates(a,el,QY)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,el=wO(o,n,c,el),Pc.clipToGLWindowCoordinates(a,el,ZY),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,el=wO(o,n,c,el),Pc.clipToGLWindowCoordinates(a,el,QY)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(ZY,i),(i.x<0||i.x>s.clientWidth)&&(i.x=QY.x)}}if(r.mode!==re.SCENE2D||u){if(el=wO(o,n,c,el),el.z<0&&!(c.frustum instanceof mn)&&!(c.frustum instanceof bs))return;i=Pc.clipToGLWindowCoordinates(a,el,i)}return i.y=s.clientHeight-i.y,i};Pc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Pc.worldToWindowCoordinates(e,t,n),!!l(n))return Pc.transformWindowToDrawingBuffer(e,n,n)};var gg=new h,Sje=new he;Pc.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,Sje);if(!l(o))return;if(r.project(o,gg),i===re.COLUMBUS_VIEW)return h.fromElements(gg.z,gg.x,gg.y,n);if(i===re.SCENE2D)return h.fromElements(0,gg.x,gg.y,n);let s=e.morphTime;return h.fromElements(D.lerp(gg.z,t.x,s),D.lerp(gg.x,t.y,s),D.lerp(gg.y,t.z,s),n)};var ehe=new h,the=new h,nhe=new N;Pc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,ehe),N.computeViewportTransformation(e,0,1,nhe),N.multiplyByPoint(nhe,ehe,the),U.fromCartesian3(the,n)};Pc.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 wje=new se,ihe=new se;Pc.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,wje);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,ihe);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=ihe,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 fr=Pc;var rhe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(rhe);var Hn=rhe;var ohe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(ohe);var Ho=ohe;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=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??Hn.CENTER,this._horizontalOrigin=e.horizontalOrigin??ji.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 pg(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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!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??Ho.NONE,this._positionFromParent=!1}var she=Mi.SHOW_INDEX=0,u6=Mi.POSITION_INDEX=1,phe=Mi.PIXEL_OFFSET_INDEX=2,Ije=Mi.EYE_OFFSET_INDEX=3,Pje=Mi.HORIZONTAL_ORIGIN_INDEX=4,Dje=Mi.VERTICAL_ORIGIN_INDEX=5,Rje=Mi.SCALE_INDEX=6,ahe=Mi.IMAGE_INDEX_INDEX=7,che=Mi.COLOR_INDEX=8,Oje=Mi.ROTATION_INDEX=9,Mje=Mi.ALIGNED_AXIS_INDEX=10,Nje=Mi.SCALE_BY_DISTANCE_INDEX=11,Lje=Mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Fje=Mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Bje=Mi.DISTANCE_DISPLAY_CONDITION=14,kje=Mi.DISABLE_DEPTH_DISTANCE=15;Mi.TEXTURE_COORDINATE_BOUNDS=16;var lhe=Mi.SDF_INDEX=17,Uje=Mi.SPLIT_DIRECTION_INDEX=18;Mi.NUMBER_OF_PROPERTIES=19;function Ro(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function eX(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function _x(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Mi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ro(this,she))}},position:{get:function(){return this._position},set:function(e){let t=this._position;eX(t,e)||(_x(e,t),_x(e,this._actualPosition),this._updateClamping(),Ro(this,u6))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Ro(this,u6))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Ro(this,phe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Ro(this,Nje))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Ro(this,Lje))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),Ro(this,Fje))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Ro(this,Ije))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Ro(this,Pje))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Ro(this,Dje))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Ro(this,Rje))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Ro(this,che))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Ro(this,Oje))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Ro(this,Mje))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Ro(this,ahe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Ro(this,ahe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Ro(this,che))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Ro(this,Bje))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ro(this,kje))}},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=_x(e,this._actualClampedPosition),Ro(this,u6)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ro(this,she))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Ro(this,lhe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ro(this,lhe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ro(this,Uje))}}});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 f6=new he,zje=new he,uhe=200,fhe=30;function dhe(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);Uy(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}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;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<fhe){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+uhe){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,zje);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=_x(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<fhe,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+uhe,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,dhe(t,i,A,b)},t._heightReference)}he.clone(a,f6);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(f6.height=y),dhe(t,i,a,f6)};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){pg.clone(e,this._imageTexture)};var hhe=512;Mi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Jn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Jn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&Vje(n)&&(this._imageWidth=Math.min(this._width,hhe),this._imageHeight=Math.min(this._height,hhe))};function Vje(e){return l(e)?Vh(e)?e.startsWith("data:image/svg+xml"):ng(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),Ro(this,phe))};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),Ro(this,u6)};var mhe=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:(N.multiplyByPoint(i,t,mhe),fr.computeActualEllipsoidPosition(n,mhe))};var ghe=new h;Mi._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,ghe),a=fr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var l6=new U(0,0);Mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,l6),U.add(l6,this._translate,l6);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,f6);r=a.cartographicToCartesian(c,ghe),i=N.IDENTITY}return Mi._computeScreenSpacePosition(i,r,this._eyeOffset,l6,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===ji.RIGHT?s-=i:e.horizontalOrigin===ji.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Hn.BOTTOM||e.verticalOrigin===Hn.BASELINE?a-=r:e.verticalOrigin===Hn.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)&&Ht.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 Lr=Mi;var _he=1/256,jje=65536,nX=256,Fr={};Fr.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};Fr.octEncode=function(e,t){return Fr.octEncodeInRange(e,255,t)};var IO=new U,yhe=new Uint8Array(1);function d6(e){return yhe[0]=e,yhe[0]}Fr.octEncodeToCartesian4=function(e,t){return Fr.octEncodeInRange(e,65535,IO),t.x=d6(IO.x*_he),t.y=d6(IO.x),t.z=d6(IO.y*_he),t.w=d6(IO.y),t};Fr.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)};Fr.octDecode=function(e,t,n){return Fr.octDecodeInRange(e,t,255,n)};Fr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*nX+i,a=r*nX+o;return Fr.octDecodeInRange(s,a,65535,t)};Fr.octPackFloat=function(e){return 256*e.x+e.y};var iX=new U;Fr.octEncodeFloat=function(e){return Fr.octEncode(e,iX),Fr.octPackFloat(iX)};Fr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Fr.octDecode(i,r,t)};Fr.octPack=function(e,t,n,i){let r=Fr.octEncodeFloat(e),o=Fr.octEncodeFloat(t),s=Fr.octEncode(n,iX);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Fr.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;Fr.octDecodeFloat(s,t),Fr.octDecodeFloat(c,n),Fr.octDecode(o,a,i)};Fr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Fr.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 tX(e){return e>>1^-(e&1)}Fr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=tX(e[a]),o+=tX(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=tX(n[a]),n[a]=s)};Fr.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};Fr.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*jje+Math.round(D.clamp(e.green*255,0,255))*nX+Math.round(D.clamp(e.blue*255,0,255))};Fr.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};Fr.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=Fr;function Hje(e,t){this.start=e??0,this.stop=t??0}var zs=Hje;var h6=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],uX),r=h.clone(i,rX),o=h.clone(i,oX),s=h.clone(i,sX),a=h.clone(i,aX),c=h.clone(i,cX),u=h.clone(i,lX),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,sc)),g=h.magnitudeSquared(h.subtract(c,o,sc)),m=h.magnitudeSquared(h.subtract(u,s,sc)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=fX;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,sc)),E=Math.sqrt(T),v=dX;v.x=r.x,v.y=o.y,v.z=s.z;let S=hX;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,mX),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,sc));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,sc));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;Ahe._ellipsoid=ee.default,n=n??Ahe,ie.southwest(t,pX),pX.height=i,ie.northeast(t,gX),gX.height=r;let s=n.project(pX,Wje),a=n.project(gX,qje),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,Yje);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=uX;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,rX),a=h.clone(o,oX),c=h.clone(o,sX),u=h.clone(o,aX),f=h.clone(o,cX),d=h.clone(o,lX),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,sc)),y=h.magnitudeSquared(h.subtract(f,a,sc)),A=h.magnitudeSquared(h.subtract(d,c,sc)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=fX;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,sc)),S=Math.sqrt(v),I=dX;I.x=s.x,I.y=a.y,I.z=c.z;let R=hX;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,mX),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,sc));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,sc));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=uX;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,rX),s=h.clone(r,oX),a=h.clone(r,sX),c=h.clone(r,aX),u=h.clone(r,cX),f=h.clone(r,lX),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,sc)),m=h.magnitudeSquared(h.subtract(u,s,sc)),y=h.magnitudeSquared(h.subtract(f,a,sc)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=fX;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,sc)),v=Math.sqrt(E),S=dX;S.x=o.x,S.y=s.y,S.z=a.z;let I=hX;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,mX),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,sc));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,sc));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,Xje),o=$.getColumn(i,1,Kje),s=$.getColumn(i,2,$je);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,Jje),r=N.getScale(t,Zje),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,Qje),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,e6e);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,t6e));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,n6e),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 zs);let o=h.subtract(t.center,n,i6e),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){xhe._ellipsoid=ee.default,n=n??xhe;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,bhe):a=r.geodeticSurfaceNormal(o,bhe);let c=h.cross(h.UNIT_Z,a,r6e);h.normalize(c,c);let u=h.cross(a,c,o6e);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,a6e),d=h.negate(c,s6e),p=The,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,c6e);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 Gje*t*t*t}};h6.packedLength=4;var rX=new h,oX=new h,sX=new h,aX=new h,cX=new h,lX=new h,uX=new h,sc=new h,fX=new h,dX=new h,hX=new h,mX=new h,Gje=4/3*D.PI,Ahe=new zi,Wje=new h,qje=new h,pX=new he,gX=new he,Yje=[],Xje=new h,Kje=new h,$je=new h,Jje=new h,Zje=new h,Qje=new h,e6e=new h,t6e=new h,n6e=new h,i6e=new h,bhe=new h,r6e=new h,o6e=new h,s6e=new h,a6e=new h,c6e=new he,The=new Array(8);for(let e=0;e<8;++e)The[e]=new h;var xhe=new zi,ue=h6;function Fp(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Fp.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 _g={high:0,low:0};Fp.fromCartesian=function(e,t){l(t)||(t=new Fp);let n=t.high,i=t.low;return Fp.encode(e.x,_g),n.x=_g.high,i.x=_g.low,Fp.encode(e.y,_g),n.y=_g.high,i.y=_g.low,Fp.encode(e.z,_g),n.z=_g.high,i.z=_g.low,t};var _X=new Fp;Fp.writeElements=function(e,t,n){Fp.fromCartesian(e,_X);let i=_X.high,r=_X.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=Fp;var ga={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ga.getSizeInBytes=function(e){switch(e){case ga.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ga.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ga.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ga.fromSizeInBytes=function(e){switch(e){case 2:return ga.UNSIGNED_SHORT;case 4:return ga.UNSIGNED_INT;case 1:return ga.UNSIGNED_BYTE}};ga.validate=function(e){return l(e)&&(e===ga.UNSIGNED_BYTE||e===ga.UNSIGNED_SHORT||e===ga.UNSIGNED_INT)};ga.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ga.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ga.fromTypedArray=function(e){if(e instanceof Uint8Array)return ga.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ga.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ga.UNSIGNED_INT};Object.freeze(ga);var je=ga;var yx={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};yx.validate=function(e){return e===yx.STREAM_DRAW||e===yx.STATIC_DRAW||e===yx.DYNAMIC_DRAW||e===yx.DYNAMIC_READ};Object.freeze(yx);var Me=yx;function tl(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=Jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}tl.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new tl({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};tl.createVertexBuffer=function(e){return new tl({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};tl.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new tl({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(tl.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});tl.prototype._getBuffer=function(){return this._buffer};tl.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};tl.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};tl.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)};tl.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)};tl.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)};tl.prototype.isDestroyed=function(){return!1};tl.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var tt=tl;function l6e(e,t,n,i){switch(t.type){case e.FLOAT:return new yX(e,t,n,i);case e.FLOAT_VEC2:return new AX(e,t,n,i);case e.FLOAT_VEC3:return new bX(e,t,n,i);case e.FLOAT_VEC4:return new xX(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new m6(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new m6(e,t,n,i);case e.INT:case e.BOOL:return new TX(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new EX(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new CX(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new vX(e,t,n,i);case e.FLOAT_MAT2:return new SX(e,t,n,i);case e.FLOAT_MAT3:return new wX(e,t,n,i);case e.FLOAT_MAT4:return new IX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var yX=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))}},AX=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))}},bX=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)))}},xX=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)))}},m6=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}},TX=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))}},EX=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))}},CX=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))}},vX=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))}},u6e=new Float32Array(4),SX=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,u6e);this._gl.uniformMatrix2fv(this._location,!1,t)}}},f6e=new Float32Array(9),wX=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,f6e);this._gl.uniformMatrix3fv(this._location,!1,t)}}},d6e=new Float32Array(16),IX=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,d6e);this._gl.uniformMatrix4fv(this._location,!1,t)}}},PO=l6e;function h6e(e,t,n,i){switch(t.type){case e.FLOAT:return new PX(e,t,n,i);case e.FLOAT_VEC2:return new DX(e,t,n,i);case e.FLOAT_VEC3:return new RX(e,t,n,i);case e.FLOAT_VEC4:return new OX(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new MX(e,t,n,i);case e.INT:case e.BOOL:return new NX(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new LX(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new FX(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new BX(e,t,n,i);case e.FLOAT_MAT2:return new kX(e,t,n,i);case e.FLOAT_MAT3:return new UX(e,t,n,i);case e.FLOAT_MAT4:return new zX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var PX=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)}},DX=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)}},RX=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)}},OX=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)}},MX=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}},NX=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)}},LX=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)}},FX=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)}},BX=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)}},kX=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)}},UX=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)}},zX=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)}},DO=h6e;var m6e=0;function yg(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=p6e(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=m6e++}yg.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};yg.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(yg.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return p6(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return p6(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return p6(this),this._uniformsByName}}});function Ehe(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 p6e(e,t){let n={};if(!kt.highpFloatSupported||!kt.highpIntSupported){let i,r,o,s,a=Ehe(e),c=Ehe(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 Bp="[Cesium WebGL] ";function g6e(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(`${Bp}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Bp}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Bp}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(`${Bp}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(`${Bp}Vertex shader compile log: ${c}`),console.error(`${Bp} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Bp}Fragment shader compile log: ${c}`),console.error(`${Bp} 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(`${Bp}${g} shader translation failed.`);return}console.error(`${Bp}Translated ${g} shaderSource: -${m}`)}}function _6e(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 y6e(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=PO(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=DO(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function A6e(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=hg[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function b6e(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 p6(e){l(e._program)||Che(e)}function Che(e){let t=e._program,n=e._gl,i=g6e(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=y6e(n,i),s=A6e(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=_6e(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=b6e(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{Che(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)}})}yg.prototype._bind=function(){p6(this),this._gl.useProgram(this._program)};yg.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)}};yg.prototype.isDestroyed=function(){return!1};yg.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};yg.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var Qt=yg;var vhe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(vhe);var Dd=vhe;function VX(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??Dd.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}VX.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 x6e=new he,T6e=new h,She=new N,E6e=[new he,new he,new he],C6e=[new U,new U,new U],v6e=[new U,new U,new U],S6e=new h,w6e=new Le,I6e=new N,P6e=new Xi;VX._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,x6e),s=he.toCartesian(o,n,T6e),a=At.eastNorthUpToFixedFrame(s,n,She),c=N.inverse(a,She),u=C6e,f=E6e;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=S6e;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,w6e),g=$.fromQuaternion(p,I6e),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,P6e),E=v6e;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=VX;function D6e(e,t){if(!e)throw new pe(t)}var jX=D6e;function R6e(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 Ihe(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 Yh(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)R6e(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),Ihe(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 whe(e){return e.values.length/e.componentsPerAttribute}function O6e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function M6e(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=whe(e[r[0]]),t=1;t<s;++t){let u=whe(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+=O6e(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}}}Yh.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=M6e(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 Yh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Yh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Yh.prototype.getAttribute=function(e){return this._attributes[e]};function N6e(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 L6e(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)}}Yh.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)};Yh.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)};Yh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&N6e(this),this._hasConstantAttributes&&L6e(this,this._gl)):Ihe(this._gl,this._attributes,this._indexBuffer)};Yh.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)}};Yh.prototype.isDestroyed=function(){return!1};Yh.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),le(this)};var zn=Yh;function Ba(e,t,n,i){let r=Ba._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=Ba._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ba._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)}Ba._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};Ba._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};Ba._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};Ba.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];Ba._resize(r,this._size),Ba._appendWriters(this.writers,r)}HX(this)};Ba._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 F6e=[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}}];Ba._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]=F6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Ba.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=B6e(this,i)||t;if(t||!l(this.va)){HX(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);Ba._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 B6e(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}Ba._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})}};Ba.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)k6e(n[i],e,t)};function k6e(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)}}Ba.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function HX(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}Ba.prototype.isDestroyed=function(){return!1};Ba.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 HX(this),le(this)};var Ag=Ba;var RO=`uniform sampler2D u_atlas; -uniform float u_coarseDepthTestDistance; -uniform float u_threePointDepthTestDistance; -#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; +return textureCube(sampler, p); #endif -in vec2 v_textureCoordinates; -in vec4 v_pickColor; -in vec4 v_color; -flat in vec2 v_splitDirectionAndEllipsoidDepthEC; -#ifdef SDF -in vec4 v_outlineColor; -in float v_outlineWidth; +} +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 -in vec4 v_compressed; -const float SHIFT_LEFT1 = 2.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; -float getGlobeDepthAtCoords(vec2 st) +} +`;var UO=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { +vec4 transformedPlane = transform * plane; +float normalMagnitude = length(transformedPlane.xyz); +return transformedPlane / normalMagnitude; +} +`;var zO=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); -if (logDepthOrDepth == 0.0) +vec3 highDifference = high - czm_encodedCameraPositionMCHigh; +if (length(highDifference) == 0.0) { +highDifference = vec3(0); +} +vec3 lowDifference = low - czm_encodedCameraPositionMCLow; +return vec4(highDifference + lowDifference, 1.0); +} +`;var VO=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -return 0.0; +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 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -return eyeCoordinate.z / eyeCoordinate.w; +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); } -#ifdef SDF -float getDistance(vec2 position) +`;var jO=`mat2 czm_transpose(mat2 matrix) { -return texture(u_atlas, position).r; +return mat2( +matrix[0][0], matrix[1][0], +matrix[0][1], matrix[1][1]); } -vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) +mat3 czm_transpose(mat3 matrix) { -float distance = getDistance(position); -if (outlineWidth > 0.0) +return mat3( +matrix[0][0], matrix[1][0], matrix[2][0], +matrix[0][1], matrix[1][1], matrix[2][1], +matrix[0][2], matrix[1][2], matrix[2][2]); +} +mat4 czm_transpose(mat4 matrix) { -float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); -float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); -vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); -float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); -return vec4(sdfColor.rgb, sdfColor.a * alpha); +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]); } -else +`;var HO=`float czm_unpackDepth(vec4 packedDepth) { -float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); -return vec4(v_color.rgb, v_color.a * alpha); +return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } +`;var GO=`float czm_unpackFloat(vec4 packedFloat) +{ +packedFloat = floor(packedFloat * 255.0 + 0.5); +float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; +float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; +if (exponent == -127.0) +{ +return 0.0; } -#endif -bool getDepthTestEnabled() { -float temp = v_compressed.y; -temp = temp * SHIFT_RIGHT1; -float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; -return temp2 != 0.0; +float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); +float result = sign * exp2(exponent - 23.0) * mantissa; +return result; } -float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) { -float depthDifferential = eyeDepth - distanceToEllipsoid; -float depthRatio = abs(depthDifferential / distanceToEllipsoid); -if (depthRatio < epsilon) { -return 0.0; +`;var WO=`uint czm_unpackTexture(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return uint(rounded); } -return depthDifferential; +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); } -void doDepthTest(float eyeDepth, float globeDepth) { -#ifdef VS_THREE_POINT_DEPTH_CHECK -if (eyeDepth > -u_threePointDepthTestDistance) { -if (eyeDepth == 0.0) { -discard; +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); } -return; +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); } -#endif -bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; -if (useGlobeDepth && globeDepth == 0.0) { -return; +`;var qO=`int czm_unpackUint(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return int(rounded); } -if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { -discard; +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))); } -#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); +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))); } -czm_writeLogDepth(depthArg); +`;var YO=`float czm_valueTransform(float offset, float scale, float value) { +return scale * value + offset; } -#endif -void main() -{ -if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { -discard; +vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { +return scale * value + offset; } -if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) { -discard; +vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { +return scale * value + offset; } -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 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { +return scale * value + offset; } -vec4 color = texture(u_atlas, v_textureCoordinates); -#ifdef SDF -float outlineWidth = v_outlineWidth; -vec4 outlineColor = v_outlineColor; -float distance = getDistance(v_textureCoordinates); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float smoothing = fwidth(distance); -vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); -vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); -color = (center + color1 + color2 + color3 + color4)/5.0; -#else -float smoothing = 1.0/32.0; -color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -#endif -color = czm_gammaCorrect(color); -#else -color = czm_gammaCorrect(color); -color *= czm_gammaCorrect(v_color); -#endif -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; +mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { +return matrixCompMult(scale, value) + offset; } -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; +mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { +return matrixCompMult(scale, value) + offset; } -#else -if (color.a >= 0.995) -{ -discard; +mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { +return matrixCompMult(scale, value) + offset; } +`;var XO=`#ifdef LOG_DEPTH +out float v_depthFromNearPlusOne; +#ifdef SHADOW_MAP +out vec3 v_logPositionEC; #endif #endif -#ifdef VECTOR_TILE -color *= u_highlightColor; -#endif -out_FragColor = color; -} -`;var OO=`uniform float u_threePointDepthTestDistance; -in vec2 direction; -in vec4 positionHighAndScale; -in vec4 positionLowAndRotation; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 compressedAttribute2; -in vec4 eyeOffset; -in vec4 scaleByDistance; -in vec4 pixelOffsetScaleByDistance; -in vec4 compressedAttribute3; -in vec2 sdf; -in float splitDirection; -#ifdef VS_THREE_POINT_DEPTH_CHECK -in vec4 textureCoordinateBoundsOrLabelTranslate; +vec4 czm_updatePositionDepth(vec4 coords) { +#if defined(LOG_DEPTH) +#ifdef SHADOW_MAP +vec3 logPositionEC = (czm_inverseProjection * coords).xyz; +v_logPositionEC = logPositionEC; #endif -#ifdef VECTOR_TILE -in float a_batchId; +coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; #endif -out vec2 v_textureCoordinates; -out vec4 v_compressed; -out vec4 v_pickColor; -out vec4 v_color; -flat out vec2 v_splitDirectionAndEllipsoidDepthEC; -#ifdef SDF -out vec4 v_outlineColor; -out float v_outlineWidth; +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 -const float UPPER_BOUND = 32768.0; -const float SHIFT_LEFT16 = 65536.0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_LEFT7 = 128.0; -const float SHIFT_LEFT5 = 32.0; -const float SHIFT_LEFT3 = 8.0; -const float SHIFT_LEFT2 = 4.0; -const float SHIFT_LEFT1 = 2.0; -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -const float SHIFT_RIGHT7 = 1.0 / 128.0; -const float SHIFT_RIGHT5 = 1.0 / 32.0; -const float SHIFT_RIGHT3 = 1.0 / 8.0; -const float SHIFT_RIGHT2 = 1.0 / 4.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; -vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +} +void czm_vertexLogDepth(vec4 clipCoords) { -vec2 halfSize = imageSize * scale * 0.5; -halfSize *= ((direction * 2.0) - 1.0); -vec2 originTranslate = origin * abs(halfSize); -#if defined(ROTATION) || defined(ALIGNED_AXIS) -if (validAlignedAxis || rotation != 0.0) +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; +czm_updatePositionDepth(clipCoords); +#endif +} +`;var KO=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { -float angle = rotation; -if (validAlignedAxis) +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))) { -vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); -angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / -(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); -} -float cosTheta = cos(angle); -float sinTheta = sin(angle); -rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); -halfSize = rotationMatrix * halfSize; +q = czm_inverseProjection * q; } else { -rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); +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; } -#endif -mpp = czm_metersPerPixel(positionEC); -positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); -positionEC.xy += (translate + pixelOffset) * mpp; -return positionEC; +return q; } -#ifdef VS_THREE_POINT_DEPTH_CHECK -float getGlobeDepth(vec4 positionEC) +vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) { -vec4 posWC = czm_eyeToWindowCoordinates(positionEC); -float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); -if (globeDepth == 0.0) -{ -return 0.0; -} -vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); -return eyeCoordinate.z / eyeCoordinate.w; +vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; +return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); } -#endif -void main() +vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) { -vec3 positionHigh = positionHighAndScale.xyz; -vec3 positionLow = positionLowAndRotation.xyz; -float scale = positionHighAndScale.w; -#if defined(ROTATION) || defined(ALIGNED_AXIS) -float rotation = positionLowAndRotation.w; -#else -float rotation = 0.0; -#endif -float compressed = compressedAttribute0.x; -vec2 pixelOffset; -pixelOffset.x = floor(compressed * SHIFT_RIGHT7); -compressed -= pixelOffset.x * SHIFT_LEFT7; -pixelOffset.x -= UPPER_BOUND; -vec2 origin; -origin.x = floor(compressed * SHIFT_RIGHT5); -compressed -= origin.x * SHIFT_LEFT5; -origin.y = floor(compressed * SHIFT_RIGHT3); -compressed -= origin.y * SHIFT_LEFT3; -origin -= vec2(1.0); -float show = floor(compressed * SHIFT_RIGHT2); -compressed -= show * SHIFT_LEFT2; -vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); -vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); -vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; -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 EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -#ifdef VS_THREE_POINT_DEPTH_CHECK -temp = compressedAttribute3.w; -temp = temp * SHIFT_RIGHT12; -vec2 dimensions; -dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; -dimensions.x = floor(temp); -#endif -#ifdef ALIGNED_AXIS -vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); -temp = compressedAttribute2.z * SHIFT_RIGHT5; -bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; +#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 -vec3 alignedAxis = vec3(0.0); -bool validAlignedAxis = false; +vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); +vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); #endif -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.a /= 255.0; -color.a = floor(temp); -color.a /= 255.0; -vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); -vec4 positionEC = czm_modelViewRelativeToEye * p; -positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); -positionEC.xyz *= show; -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; +return eyeCoordinate; } -else +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) { -lengthSq = dot(positionEC.xyz, positionEC.xyz); +vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; +return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } +`;var $O=`#if !defined(LOG_DEPTH) +in float v_WindowZ; #endif -#ifdef EYE_DISTANCE_SCALING -float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); -scale *= distanceScale; -translate *= distanceScale; -if (scale == 0.0) +void czm_writeDepthClamp() { -positionEC.xyz = vec3(0.0); -} +#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) +gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency == 0.0) -{ -positionEC.xyz = vec3(0.0); } +`;var JO=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; #endif -#ifdef EYE_DISTANCE_PIXEL_OFFSET -float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); -pixelOffset *= pixelOffsetScale; #endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = compressedAttribute3.x; -float farSq = compressedAttribute3.y; -if (lengthSq < nearSq || lengthSq > farSq) +void czm_writeLogDepth(float depth) { -positionEC.xyz = vec3(0.0); +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) +if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { +discard; } -#endif -mat2 rotationMatrix; -float mpp; -float enableDepthCheck = 1.0; -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistanceSq = compressedAttribute3.z; -if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; +#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; } -if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) -{ -enableDepthCheck = 0.0; +#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 -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 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), 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), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); -float globeDepth3 = getGlobeDepth(pEC3); -if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) -{ -positionEC.xyz = vec3(0.0); +`;var ZO=`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; } -#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; -#ifdef LOG_DEPTH -czm_vertexLogDepth(); -#endif -#ifdef DISABLE_DEPTH_DISTANCE -if (disableDepthTestDistanceSq != 0.0) -{ -float zclip = gl_Position.z / gl_Position.w; -bool clipped = (zclip < -1.0 || zclip > 1.0); -if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) +`;var QO=`vec3 czm_XYZToRGB(vec3 Yxy) { -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -v_depthFromNearPlusOne = 1.0; -#endif -} +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 bx={czm_degreesPerRadian:b1,czm_depthRange:x1,czm_epsilon1:T1,czm_epsilon2:E1,czm_epsilon3:C1,czm_epsilon4:v1,czm_epsilon5:S1,czm_epsilon6:w1,czm_epsilon7:I1,czm_infinity:P1,czm_oneOverPi:D1,czm_oneOverTwoPi:R1,czm_passCesium3DTile:O1,czm_passCesium3DTileClassification:M1,czm_passCesium3DTileClassificationIgnoreShow:N1,czm_passCesium3DTileEdges:L1,czm_passCesium3DTileEdgesDirect:F1,czm_passCesium3DTilePlanarFillId:B1,czm_passClassification:k1,czm_passCompute:U1,czm_passEnvironment:z1,czm_passGaussianSplats:V1,czm_passGlobe:j1,czm_passOpaque:H1,czm_passOverlay:G1,czm_passTerrainClassification:W1,czm_passTranslucent:q1,czm_passVoxels:Y1,czm_pi:X1,czm_piOverFour:K1,czm_piOverSix:$1,czm_piOverThree:J1,czm_piOverTwo:Z1,czm_radiansPerDegree:Q1,czm_sceneMode2D:eR,czm_sceneMode3D:tR,czm_sceneModeColumbusView:nR,czm_sceneModeMorphing:iR,czm_solarRadius:rR,czm_threePiOver2:oR,czm_twoPi:sR,czm_webMercatorMaxLatitude:aR,czm_depthRangeStruct:cR,czm_material:lR,czm_materialInput:uR,czm_modelMaterial:fR,czm_modelVertexOutput:dR,czm_ray:hR,czm_raySegment:mR,czm_shadowParameters:pR,czm_acesTonemapping:gR,czm_alphaWeight:_R,czm_antialias:yR,czm_applyHSBShift:AR,czm_approximateSphericalCoordinates:bR,czm_approximateTanh:xR,czm_backFacing:TR,czm_branchFreeTernary:ER,czm_cascadeColor:CR,czm_cascadeDistance:vR,czm_cascadeMatrix:SR,czm_cascadeWeights:wR,czm_columbusViewMorph:IR,czm_computeAtmosphereColor:PR,czm_computeGroundAtmosphereScattering:DR,czm_computePosition:RR,czm_computeScattering:OR,czm_computeTextureTransform:MR,czm_cosineAndSine:NR,czm_decodeRGB8:LR,czm_decompressTextureCoordinates:FR,czm_depthClamp:BR,czm_eastNorthUpToEyeCoordinates:kR,czm_ellipsoidContainsPoint:UR,czm_ellipsoidTextureCoordinates:zR,czm_equalsEpsilon:VR,czm_eyeOffset:jR,czm_eyeToCartographicDelta:HR,czm_eyeToWindowCoordinates:GR,czm_fastApproximateAtan:WR,czm_fog:qR,czm_gammaCorrect:YR,czm_geodeticSurfaceNormal:XR,czm_getDefaultMaterial:KR,czm_getDynamicAtmosphereLightDirection:$R,czm_getLambertDiffuse:JR,czm_getSpecular:ZR,czm_getWaterNoise:QR,czm_HSBToRGB:eO,czm_HSLToRGB:tO,czm_hue:nO,czm_inverseGamma:iO,czm_isEmpty:rO,czm_isFull:oO,czm_latitudeToWebMercatorFraction:sO,czm_linearToSrgb:aO,czm_lineDistance:cO,czm_luminance:lO,czm_maximumComponent:uO,czm_metersPerPixel:fO,czm_modelToWindowCoordinates:dO,czm_multiplyWithColorBalance:hO,czm_nearFarScalar:mO,czm_octDecode:pO,czm_packDepth:gO,czm_pbrLighting:_O,czm_pbrNeutralTonemapping:yO,czm_phong:AO,czm_planeDistance:bO,czm_pointAlongRay:xO,czm_rayEllipsoidIntersectionInterval:TO,czm_raySphereIntersectionInterval:EO,czm_readDepth:CO,czm_readNonPerspective:vO,czm_reverseLogDepth:SO,czm_RGBToHSB:wO,czm_RGBToHSL:IO,czm_RGBToXYZ:PO,czm_round:DO,czm_saturation:RO,czm_shadowDepthCompare:OO,czm_shadowVisibility:MO,czm_signNotZero:NO,czm_sphericalHarmonics:LO,czm_srgbToLinear:FO,czm_tangentToEyeSpaceMatrix:BO,czm_textureCube:kO,czm_transformPlane:UO,czm_translateRelativeToEye:zO,czm_translucentPhong:VO,czm_transpose:jO,czm_unpackDepth:HO,czm_unpackFloat:GO,czm_unpackTexture:WO,czm_unpackUint:qO,czm_valueTransform:YO,czm_vertexLogDepth:XO,czm_windowToEyeCoordinates:KO,czm_writeDepthClamp:$O,czm_writeLogDepth:JO,czm_writeNonPerspective:ZO,czm_XYZToRGB:QO};function S6e(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 -#ifdef SDF -vec4 outlineColor = czm_decodeRGB8(sdf.x); -float outlineWidth; -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.a /= 255.0; -v_outlineWidth = outlineWidth / 255.0; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency; +${n}`,n=`#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable #endif -v_pickColor = pickColor; -v_color = color; -v_color.a *= translucency; -v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; -} -`;var Phe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(Phe);var Li=Phe;var U6e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},ka=Object.freeze(U6e);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 GX({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})}GX.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};GX.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 Dv=GX;var Dhe=16;function jl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(Dhe,Dhe);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(jl.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}}});jl.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};jl.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 gs({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};jl.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 Rhe({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 Dv({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=Jn()};jl.prototype.getImageIndex=function(e){return this._indexById.get(e)};jl.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 Rhe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}jl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Rhe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};jl.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};jl.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 Dv({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function z6e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}jl.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 z6e(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)};jl.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};jl.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}))};jl.prototype.isDestroyed=function(){return!1};jl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var Ax=jl;var V6e=Lr.SHOW_INDEX,NO=Lr.POSITION_INDEX,Mhe=Lr.PIXEL_OFFSET_INDEX,Nhe=Lr.EYE_OFFSET_INDEX,j6e=Lr.HORIZONTAL_ORIGIN_INDEX,H6e=Lr.VERTICAL_ORIGIN_INDEX,G6e=Lr.SCALE_INDEX,bx=Lr.IMAGE_INDEX_INDEX,Lhe=Lr.COLOR_INDEX,W6e=Lr.ROTATION_INDEX,q6e=Lr.ALIGNED_AXIS_INDEX,Fhe=Lr.SCALE_BY_DISTANCE_INDEX,Bhe=Lr.TRANSLUCENCY_BY_DISTANCE_INDEX,khe=Lr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Uhe=Lr.DISTANCE_DISPLAY_CONDITION,Y6e=Lr.DISABLE_DEPTH_DISTANCE,X6e=Lr.TEXTURE_COORDINATE_BOUNDS,zhe=Lr.SDF_INDEX,Vhe=Lr.SPLIT_DIRECTION_INDEX,$X=Lr.NUMBER_OF_PROPERTIES,zr={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 Od(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Ax),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($X),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=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??Li.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(Od.prototype,{length:{get:function(){return JX(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 jhe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Od.prototype.add=function(e){let t=new Lr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Od.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Od.prototype.removeAll=function(){jhe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function JX(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}}Od.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Od.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Od.prototype.get=function(e){return JX(this),this._billboards[e]};function Ohe(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 K6e(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}Od.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<$X;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function $6e(e,t,n,i,r){let o=[{index:zr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[NO]},{index:zr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[NO]},{index:zr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Mhe]},{index:zr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Bhe]},{index:zr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Lhe]},{index:zr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Nhe]},{index:zr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Fhe]},{index:zr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[khe]},{index:zr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Uhe]},{index:zr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[X6e]},{index:zr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[Vhe]},{index:zr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:K6e(e)}];return l(i)&&o.push({index:zr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:zr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[zhe]}),new Ag(e,o,t,!0)}var WX=new Sn;function Hhe(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function Ghe(e,t,n,i){let r=n[zr.positionHighAndScale],o=n[zr.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(Hhe(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,WX);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=WX.high,f=WX.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var jy=new U,Rd=32768,ZX=65536,qX=4096,xx=256,J6e=128,Z6e=32,Q6e=8,g6=4,eHe=1/256,Whe=new et;function qhe(e,t,n,i){let r=n[zr.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===Hn.BASELINE&&(p=Hn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===ji.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Hn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(Whe);m=I.x,y=I.y}let A=Math.floor(D.clamp(s,-Rd,Rd)+Rd)*J6e;A+=(d+1)*Z6e,A+=(p+1)*Q6e,A+=(g?1:0)*g6;let b=Math.floor(D.clamp(a,-Rd,Rd)+Rd)*xx,x=Math.floor(D.clamp(u*g6,-Rd,Rd)+Rd)*xx,T=(D.clamp(f*g6,-Rd,Rd)+Rd)*eHe,E=Math.floor(T),v=Math.floor((T-E)*xx);b+=E,x+=v,jy.x=m,jy.y=y;let S=cn.compressTextureCoordinates(jy);r(i._index,A,b,x,S)}function Yhe(e,t,n,i){let r=n[zr.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,ZX),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*xx+a,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*xx+u,r(i._index,p,g,s,c)}function XX(e,t,n,i){let r=n[zr.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)*ZX+z.floatToByte(s.alpha)*xx+(a*2+f),A=d*g6+p;r(i._index,g,m,y,A)}function KX(e,t,n,i){let r=n[zr.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)),jy.x=0,jy.y=0,i.ready){let c=i.computeTextureCoordinates(Whe);jy.x=c.width,jy.y=c.height}let a=cn.compressTextureCoordinates(jy);r(i._index,o.x,o.y,s,a)}function Xhe(e,t,n,i){let r=n[zr.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 Khe(e,t,n,i){let r=n[zr.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 $he(e,t,n,i){let r=n[zr.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=As(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,qX)),g=Math.floor(D.clamp(f,0,qX)),m=p*qX+g;r(i._index,o,s,c,m)}function Jhe(e,t,n,i){if(As(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[zr.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function tHe(e,t,n,i){if(!l(e._batchTable))return;let r=n[zr.a_batchId],o=i._batchIndex;r(i._index,o)}function Zhe(e,t,n,i){if(!e._sdf)return;let r=n[zr.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/ka.RADIUS,u=z.floatToByte(o.alpha)*ZX+z.floatToByte(c)*xx;r(i._index,a,u)}function Qhe(e,t,n,i){let r=n[zr.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function nHe(e,t,n,i){Ghe(e,t,n,i),qhe(e,t,n,i),Yhe(e,t,n,i),XX(e,t,n,i),KX(e,t,n,i),Xhe(e,t,n,i),Khe(e,t,n,i),$he(e,t,n,i),Jhe(e,t,n,i),tHe(e,t,n,i),Zhe(e,t,n,i),Qhe(e,t,n,i)}function YX(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=Lr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):Hhe(s,d))}o&&ue.fromPoints(a,s)}function iHe(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)&&YX(e,i,i.length,t,o,!0)):n===re.MORPHING?YX(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&YX(e,r,e._billboardsToUpdateIndex,t,o,!1)}function rHe(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 oHe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; -void main() +${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 eM=S6e;function Ahe(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 bhe(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=Ahe(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function xhe(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=bhe(i,La._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),xhe(r,t)}}))}function w6e(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 I6e(e){let t=[],n=bhe("main",e,t);xhe(n,t),w6e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +`;return i.replace(n.glslSource,"")}function The(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` +#line 0 +${r[g]}`;i=Ahe(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 + precision mediump float; + precision mediump int; + #define highp mediump +#endif +`),n.webgl2&&(c+=`precision highp sampler3D; + +`);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&&(c+=`#define OES_texture_float + +`);let d="";e.includeBuiltIns&&(d=I6e(i)),c+=` +#line 0 +`;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; + +`),c+=d,c+=i,n.webgl2?c=`#version 300 es +${c}`:c=eM(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 The(this,!1,e)};La.prototype.createCombinedFragmentShader=function(e){return The(this,!0,e)};La._czmBuiltinsAndUniforms={};for(let e in bx)bx.hasOwnProperty(e)&&(La._czmBuiltinsAndUniforms[e]=bx[e]);for(let e in dg)if(dg.hasOwnProperty(e)){let t=dg[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() { - out_FragColor = texture(billboard_texture, v_textureCoordinates); -} -`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var sHe=[];Od.prototype.update=function(e){if(JX(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,bx),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;iHe(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<$X;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=$6e(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,nHe(this,e,d,R)}this._vaf.commit(Ohe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=sHe;I.length=0,(c[NO]||c[W6e]||c[G6e])&&I.push(Ghe),(c[bx]||c[Mhe]||c[j6e]||c[H6e]||c[V6e])&&(I.push(qhe),I.push(KX)),(c[bx]||c[q6e]||c[Bhe])&&(I.push(Yhe),I.push(XX)),(c[bx]||c[Lhe])&&I.push(XX),(c[bx]||c[Nhe])&&I.push(KX),c[Fhe]&&I.push(Xhe),c[khe]&&I.push(Khe),(c[Uhe]||c[Y6e]||c[bx]||c[NO])&&I.push($he),(c[bx]||c[NO])&&I.push(Jhe),c[zhe]&&I.push(Zhe),c[Vhe]&&I.push(Qhe);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(Ohe(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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=N.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),rHe(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Li.OPAQUE||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===Li.TRANSLUCENT;this._blendOption===Li.TRANSLUCENT||this._blendOption===Li.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=OO,x=RO,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-ka.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Li.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:zr}),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:zr})),this._blendOption===Li.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:zr})),this._blendOption===Li.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:zr})),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===Li.OPAQUE,O=this._blendOption===Li.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=oHe(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};Od.prototype.isDestroyed=function(){return!1};Od.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(),jhe(this._billboards),le(this)};var Df=Od;function aHe(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 kp=aHe;function _6(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}_6.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 _6(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}": ${kp(i)}`),c};_6.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Jr=_6;var eme={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(eme);var Rv=eme;function LO(e){}LO.prototype.isReady=function(){return!0};LO.prototype.shouldDiscardImage=function(e){return LO.EMPTY_IMAGE===e};var y6;Object.defineProperties(LO,{EMPTY_IMAGE:{get:function(){return l(y6)||(y6=new Image,y6.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),y6}}});var Ov=LO;function tme(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}tme.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 cHe(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 lHe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Jr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function uHe(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 cHe(o,t)}catch(o){lHe(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??Rv.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Ov),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 Po({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??Rv.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 tme(t);return await uHe(s,c),c.build(a),a};var fHe=new ie;_a.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,fHe);return mHe(this._attributionList,n,i)};_a.prototype.requestImage=function(e,t,n,i){let r=Sf.loadImage(this,dHe(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?Ov.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 dHe(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 hHe=new ie;function mHe(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,hHe);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}_a._metadataCache={};var FO=_a;var Hy={};Hy.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:Hy.parseBoundingVolumeSemantic(e,t),minimumHeight:Hy._parseMinimumHeight(e,t),maximumHeight:Hy._parseMaximumHeight(e,t)}};Hy.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}};Hy._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Hy._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var Gy=Hy;var pHe=new h(1,1,1);function QX(e){e=e??pHe,this._dimensions=h.clone(e)}Object.defineProperties(QX.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var gHe=new h;QX.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,gHe),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 eK=QX;var BO=`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) + czm_old_main(); + czm_pickColor = pickColor; +}`};La.createPickFragmentShaderSource=function(e,t){let n=La.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +void main() +{ + czm_old_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = czm_pickColor; +}`;return`${n} +${i}`};function P6e(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 Ehe(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 Che(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Ehe(e,r))return r}}var D6e=["v_normalEC","v_normal"];La.findNormalVarying=function(e){return Ehe(e,"#ifdef HAS_NORMALS")?P6e(e,"HAS_NORMALS")?"v_normalEC":void 0:Che(e,D6e)};var R6e=["v_positionEC"];La.findPositionVarying=function(e){return Che(e,R6e)};var Ye=La;var tM=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES +void main() { -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +vec4 position = czm_computePosition(); +#ifdef EXTRUDED_GEOMETRY +float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); +delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; +position = position + vec4(extrudeDirection * delta, 0.0); +#endif +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); +v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D +vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); +vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); +vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); +bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; +planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); +planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); +idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; +idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); +planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); +planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); +vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; +vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; +vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D +vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; +vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; +vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D +vec3 eastWard = southEastCorner - southWestCorner; +float eastExtent = length(eastWard); +eastWard /= eastExtent; +vec3 northWard = northWestCorner - southWestCorner; +float northExtent = length(northWard); +northWard /= northExtent; +v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); +v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); +v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL +vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); +vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); +v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); +v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); +v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#endif +gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +`;var zy=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif +void main(void) { -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; +#ifdef VECTOR_TILE +out_FragColor = czm_gammaCorrect(u_highlightColor); +#else +out_FragColor = vec4(1.0); +#endif +czm_writeDepthClamp(); } -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) -{ -float alphaRoughnessSq = alphaRoughness * alphaRoughness; -float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); -float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); -float GGX = GGXV + GGXL; -if (GGX > 0.0) +`;var zX={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};zX.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(zX);var Qn=zX;var vhe={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(vhe);var ac=vhe;function O6e(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 nM=O6e;function mg(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=M6e(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=N6e(t,o),a=L6e(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(mg.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function M6e(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 whe(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function N6e(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 L6e(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 iM=new se;function F6e(e,t,n){let i=se.unpack(e,t,iM),r=se.unpackFloat(i);i=se.unpack(e,t+4,iM);let o=se.unpackFloat(i);i=se.unpack(e,t+8,iM);let s=se.unpackFloat(i);i=se.unpack(e,t+12,iM);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function B6e(e,t,n){let i=se.packFloat(e.x,iM);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 She=new se;mg.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=F6e(this._batchValues,s,She):a=se.unpack(this._batchValues,s,She);let c=whe(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var k6e=[void 0,void 0,new U,new h,new se],U6e=new se;mg.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=k6e[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=whe(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=U6e;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?B6e(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function z6e(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:Ht.NEAREST,flipY:!1})}function V6e(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}mg.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||z6e(this,e.context),V6e(this))};mg.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 j6e(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float numberOfAttributes = float(${t}); + return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); +} +`:`uniform vec4 batchTextureStep; +uniform vec2 batchTextureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float stepY = batchTextureStep.z; + float centerY = batchTextureStep.w; + float numberOfAttributes = float(${t}); + float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); + float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}function H6e(e){return e===1?"float":`vec${e}`}function G6e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function W6e(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=H6e(r),a=G6e(r),c=e._offsets[t],u=`${s} ${o}(float batchId) +{ + vec2 st = computeSt(batchId); + 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===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}mg.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${j6e(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=W6e(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} +${t} +${s}`}};mg.prototype.isDestroyed=function(){return!1};mg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var xx=mg;var rM=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)}};rM.MaximumLatitude=rM.mercatorAngleToGeodeticLatitude(Math.PI);var yi=rM;function q6e(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)&&Gn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function VX(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 Y6e(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?VX(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(VX(i.westHemisphereGeometry,n),VX(i.eastHemisphereGeometry,n))}}function X6e(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(q6e(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Gn.splitLongitude(t[c]);if(Y6e(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Gn.reorderForPostVertexCache(g.geometry),Gn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Gn.reorderForPostVertexCache(g.westHemisphereGeometry),Gn.reorderForPreVertexCache(g.westHemisphereGeometry),Gn.reorderForPostVertexCache(g.eastHemisphereGeometry),Gn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Gn.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&&Gn.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`;Gn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),Gn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Gn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Gn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Gn.fitToUnsignedShortIndices(u));p=g}return p}function jX(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 K6e(e,t){let n=[];return jX(e,"geometry",t,n),jX(e,"westHemisphereGeometry",t,n),jX(e,"eastHemisphereGeometry",t,n),n}var pg={};pg.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=X6e(e),t.length>0&&(n=Gn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=K6e(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]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function $6e(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 J6e(e,t){let n=e.length;for(let i=0;i<n;++i)$6e(e[i],t)}function Z6e(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*ue.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}pg.packCreateGeometryResults=function(e,t){let n=new Float64Array(Z6e(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&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.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}};pg.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=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.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 Q6e(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 eHe(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 xr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}pg.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:Q6e(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}};pg.unpackCombineGeometryParameters=function(e){let t=eHe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=pg.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 yi(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 Ihe(e){let t=e.length,n=1+(ue.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,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function Phe(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}pg.packCombineGeometryResults=function(e,t){l(e.geometries)&&J6e(e.geometries,t);let n=Ihe(e.boundingSpheres),i=Ihe(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}};pg.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Phe(e.boundingSpheres),boundingSpheresCV:Phe(e.boundingSpheresCV)}};var Tx=pg;var Dhe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(Dhe);var is=Dhe;var Mu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Mu.NUMBER_OF_SHADOW_MODES=4;Mu.castShadows=function(e){return e===Mu.ENABLED||e===Mu.CAST_ONLY};Mu.receiveShadows=function(e){return e===Mu.ENABLED||e===Mu.RECEIVE_ONLY};Mu.fromCastReceive=function(e,t){return e&&t?Mu.ENABLED:e?Mu.CAST_ONLY:t?Mu.RECEIVE_ONLY:Mu.DISABLED};Object.freeze(Mu);var Dn=Mu;function rs(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=is.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(rs.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 tHe(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 nHe=new U,iHe=new h,Uhe=new se;function zhe(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,nHe);if(t===3)return h.unpack(e,0,iHe);if(t===4)return se.unpack(e,0,Uhe)}function rHe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=tHe(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 xx(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=zhe(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=Uhe;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 oHe(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 sHe(e){let t=e.attributes,n=new Tn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=oHe(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:ue.clone(e.boundingSphere)})}function aHe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var cHe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;rs._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=cHe.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 0.5 / GGX; -} -return 0.0; + return u_modifiedModelView * position; } -vec2 integrateBrdf(float roughness, float NdotV) -{ -vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); -float A = 0.0; -float B = 0.0; -const int NumSamples = 1024; -float alphaRoughness = roughness * roughness; -for (int i = 0; i < NumSamples; i++) -{ -vec2 xi = hammersley2D(i, NumSamples); -vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); -vec3 L = 2.0 * dot(V, H) * H - V; -float NdotL = clamp(L.z, 0.0, 1.0); -float NdotH = clamp(H.z, 0.0, 1.0); -float VdotH = clamp(dot(V, H), 0.0, 1.0); -if (NdotL > 0.0) + +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} { -float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); -float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; -float Fc = pow(1.0 - VdotH, 5.0); -A += (1.0 - Fc) * G_Vis; -B += Fc * G_Vis; -} -} -return vec2(A, B) / float(NumSamples); + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); } -void main() + +`:(o+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} { -out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); + vec4 p; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); + } + return p; } -`;function kO(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(kO.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function _He(e,t,n){let i=t.createViewportQuadCommand(BO,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}kO.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 gs({context:t,colorTextures:[n],destroyAttachments:!1});_He(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};kO.prototype.isDestroyed=function(){return!1};kO.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var UO=kO;var tK=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(),le(this)}},er=tK;var nme={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(nme);var Tt=nme;var A6=class extends er{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=yHe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function yHe(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await A6._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 Tx=A6;var Xh=class Xh{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(Xh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Xh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Xh.Layout.SHOW_U8)===1}set show(t){this._setUint8(Xh.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(Xh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Xh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Xh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Xh.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(Xh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var nK=Xh,ns=nK;var zO=class zO{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??Li.TRANSLUCENT,this._modelMatrix=N.clone(t.modelMatrix??N.IDENTITY),this._boundingVolume=ue.clone(t.boundingVolume??new ue,new ue),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??zO.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??zO.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)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.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&&!As(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(zO,"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 b6=zO;b6.DEFAULT_CAPACITY=1024;var ta=b6;var{ERR_CAPACITY:cfn}=ta.Error,AHe=new h,x6=class x6 extends ns{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(AHe)),i}get vertexOffset(){return this._getUint32(x6.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(x6,"Layout",{...ns.Layout,POSITION_OFFSET_U32:ns.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ns.Layout.__BYTE_LENGTH+4});var iK=x6,Dc=iK;var VO=`#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; + +`)}return[r,o,t,s].join(` +`)};rs._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};rs._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 Rhe(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 Ohe(e){return`in vec4 v_pickColor; +${e}`}rs._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};rs._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};rs._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?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) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); + } + else if (czm_morphTime == 0.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); + } + else + { + centerRTE = czm_columbusViewMorph( + czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), + czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), + czm_morphTime); + } +`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; + float distanceSq; + if (czm_sceneMode == czm_sceneMode2D) + { + distanceSq = czm_eyeHeight2D.y - radiusSq; + } + else + { + distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; + } + distanceSq = max(distanceSq, 0.0); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${r}`};function Mhe(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; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,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() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function lHe(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 uHe(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(); + #else + czm_writeDepthClamp(); + #endif } -`;var jO=`in vec4 v_pickColor; +`,t}function Nhe(e,t){let n=e.vertexAttributes}function fHe(e,t){return function(){return e[t]}}var HX=Math.max(dn.hardwareConcurrency-1,1),g6,dHe=new Jn("combineGeometry");function hHe(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===is.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(g6))for(g6=new Array(HX),r=0;r<HX;r++)g6[r]=new Jn("createGeometry");let f;for(u=nM(u,HX),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(g6[r].scheduleTask({subTasks:u[r]},m))}e._state=is.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=is.CREATED}).catch(function(d){sM(e,t,is.FAILED,d)})}else if(e._state===is.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=dHe.scheduleTask(Tx.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=is.COMBINING,Promise.resolve(f).then(function(d){let p=Tx.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=is.COMBINED):sM(e,t,is.FAILED,void 0)}).catch(function(d){sM(e,t,is.FAILED,d)})}}function mHe(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=sHe(p):g=p.constructor.createGeometry(p),r[c++]=aHe(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Tx.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=is.COMBINED):sM(e,t,is.FAILED,void 0)}function pHe(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 ue;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),Ghe(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.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=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.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]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}rs._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Lhe=new Sn,Vhe=new he,jhe=new h,Hhe=new ue;function gHe(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=ue.transform(y,A,Hhe));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,Lhe);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,Vhe),v=u.project(E,jhe);T=Sn.fromCartesian(v,Lhe),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var GX=new h,_He=new h;function Fhe(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=ue.transform(f,p,Hhe));let g=f.center;g=o.scaleToGeodeticSurface(g,_He);let m=o.cartesianToCartographic(g,Vhe),y=r.project(m,jhe),A=h.add(d,g,GX);m=o.cartesianToCartographic(A,m);let b=r.project(m,GX),x=h.subtract(b,y,GX),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function yHe(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(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!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(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,sM(e,t,is.COMPLETE,void 0)}function AHe(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=ac.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 bHe(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=rs._appendOffsetToShader(e,o),o=rs._appendShowToShader(e,o),o=rs._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=Rhe(o),o=rs._updateColorAttribute(e,o,!1),o=Mhe(e,o),o=rs._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Ohe(s),e._sp=en.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Nhe(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=rs._appendShowToShader(e,o),o=rs._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=Rhe(o),o=rs._updateColorAttribute(e,o,!0),o=Mhe(e,o),o=rs._modifyShaderPosition(e,o,t.scene3DOnly),o=lHe(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=Ohe(s),s=uHe(s),e._spDepthFail=en.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Nhe(e._spDepthFail,r))}var oM=new N,Bhe=new h;function khe(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]=fHe(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,oM),N.multiplyByPoint(oM,e.rtcCenter,Bhe),N.setTranslation(oM,Bhe,oM),oM}),a}function xHe(e,t,n,i,r,o,s,a){let c=khe(e,t,n,a),u;l(e._depthFailAppearance)&&(u=khe(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}}rs._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]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.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 THe(e,t,n,i,r,o,s,a){rs._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)}}}rs.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===is.FAILED)return;let t=e.context;if(l(this._batchTable)||rHe(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!==is.COMPLETE&&this._state!==is.COMBINED&&(this.asynchronous?hHe(this,e):mHe(this,e)),this._state===is.COMBINED&&(gHe(this,e),Fhe(this,e),yHe(this,e)),!this.show||this._state!==is.COMPLETE)return;this._batchTableOffsetsUpdated||Fhe(this,e),this._recomputeBoundingSpheres&&pHe(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??AHe)(this,t,n,u),o&&(this._createShaderProgramFunction??bHe)(this,e,n),(r||o)&&(this._createCommandsFunction??xHe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??THe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var EHe=new ue,CHe=new ue;function Ghe(e,t,n){if(n===mn.TOP){let i=ue.clone(e,EHe),r=ue.clone(e,CHe);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===mn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function vHe(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 SHe(e,t,n,i,r){return function(o){let s=zhe(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var wHe=new h;function IHe(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)&&Ghe(i,h.fromArray(o.get(),0,wHe),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function PHe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}rs.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:vHe(s,n,f),set:SHe(s,n,f,this,u)}}return IHe(this,c,n),PHe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};rs.prototype.isDestroyed=function(){return!1};rs.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,le(this)};function sM(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===is.COMPLETE||e._state===is.FAILED,!0})}var On=rs;function DHe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Qc=DHe;var Sv=`#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +in vec4 v_sphericalExtents; +#else // SPHERICAL +in vec2 v_inversePlaneExtents; +in vec4 v_westPlane; +in vec4 v_southPlane; +#endif // SPHERICAL +in vec3 v_uvMinAndSphericalLongitudeRotation; +in vec3 v_uMaxAndInverseDistance; +in vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES +#ifdef PER_INSTANCE_COLOR in vec4 v_color; -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; +#endif +#ifdef NORMAL_EC +vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { +vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); +return eyeCoordinate.xyz / eyeCoordinate.w; } -out_FragColor = czm_gammaCorrect(color); -czm_writeLogDepth(); +vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { +vec2 glFragCoordXY = gl_FragCoord.xy; +float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); +float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); +bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); +float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); +float useDownOrLeft = float(useUpOrRight == 0.0); +vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); +vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); +return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; } -`;var HO=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(HO,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(HO,"DEFAULT_MATERIAL");var Hl=HO;var GO=class GO extends Hl{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(GO,"Layout",{...Hl.Layout,SIZE_U8:Hl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Hl.Layout.__BYTE_LENGTH+4}),ut(GO,"DEFAULT_MATERIAL",Object.freeze(new GO));var rK=GO,Kh=rK;var oK={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},ime={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Ex=new Dc,$h=new Kh,WO=new z,rme=new h,sK=new Sn;function bHe(e,t,n){let i=t.context;n=n||{destroy:xHe};let r=e._positionDatatype===Y.DOUBLE,o=r?oK:ime;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,Ex),Ex._dirty&&(r&&(Ex.getPosition(rme),Sn.fromCartesian(rme,sK),h.pack(sK.high,c,y*3),h.pack(sK.low,u,y*3)),Ex.getMaterial($h),z.fromRgba(Ex._pickId,WO),f[y*4]=z.floatToByte(WO.red),f[y*4+1]=z.floatToByte(WO.green),f[y*4+2]=z.floatToByte(WO.blue),f[y*4+3]=z.floatToByte(WO.alpha),d[y*4]=Ex.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,Ex._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:oK.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:oK.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:ime.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===Li.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[VO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[jO]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===Li.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 xHe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var qO=bHe;var aK=class e extends ta{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Dc}_getMaterialClass(){return Kh}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Dc){return super.add(t,n),n._setUint32(Dc.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=qO(this,t,this._renderContext))}},ku=aK;var{ERR_CAPACITY:Qfn,ERR_RESIZE:edn,ERR_OUT_OF_RANGE:tdn}=ta.Error,Md=class Md extends ns{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(Md.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Md.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(Md.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(Md.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Md.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(Md.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(Md.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Md.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(Md.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(Md,"Layout",{...ns.Layout,POSITION_OFFSET_U32:ns.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ns.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ns.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ns.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ns.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ns.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ns.Layout.__BYTE_LENGTH+24});var cK=Md,Oo=cK;var YO=`#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() +#endif // NORMAL_EC +void main(void) { -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); +#ifdef REQUIRES_EC +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); #endif -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -v_pickColor = pickColor / 255.0; -v_color = color; -v_color.a *= alpha * show; -gl_Position *= show; -} -`;var XO=`in vec4 v_pickColor; -in vec4 v_color; -void main() -{ -if (v_color.a < 0.005) -{ +#ifdef REQUIRES_WC +vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; +vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif +#ifdef TEXTURE_COORDINATES +vec2 uv; +#ifdef SPHERICAL +vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); +sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; +sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); +uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; +uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL +uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; +uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES +#ifdef CULL_FRAGMENTS +if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { discard; } -out_FragColor = czm_gammaCorrect(v_color); -czm_writeLogDepth(); -} -`;var T6=class T6 extends Hl{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(T6,"DEFAULT_MATERIAL",Object.freeze(new T6));var lK=T6,Rf=lK;var uK={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},ome={position:0,pickColor:1,showColorAlpha:2},ya=new Oo,fK=new Rf,KO=new z,sme=new h,dK=new Sn;function THe(e,t,n){let i=t.context;n=n||{destroy:CHe};let r=e._positionDatatype===Y.DOUBLE,o=r?uK:ome;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,ya),!ya._dirty)continue;let x=ya.triangleOffset,T=ya.vertexOffset,E=ya.getTriangles();for(let R=0,O=ya.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=ya.show,S=r?ya.getPositions():null;ya.getMaterial(fK);let I=cn.encodeRGB8(fK.color);z.fromRgba(ya._pickId,KO);for(let R=0,O=ya.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,sme),Sn.fromCartesian(sme,dK),h.pack(dK.high,d,T*3),h.pack(dK.low,p,T*3)),m[T*4]=z.floatToByte(KO.red),m[T*4+1]=z.floatToByte(KO.green),m[T*4+2]=z.floatToByte(KO.blue),m[T*4+3]=z.floatToByte(KO.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=fK.color.alpha,T++;ya._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=EHe(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:uK.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:uK.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:ome.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===Li.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[YO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[XO]}),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===Li.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 EHe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ya);let i=ya.vertexOffset,r=ya.triangleOffset*3;e.get(t+n-1,ya);let o=ya.vertexOffset+ya.vertexCount-i,s=(ya.triangleOffset+ya.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function CHe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var $O=THe;var{ERR_CAPACITY:zdn}=ta.Error,hK=class e extends ta{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??ta.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??ta.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Oo}_getMaterialClass(){return Rf}_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 Oo){super.add(t,n);let i=this._positionCount;n._setUint32(Oo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Oo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Oo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Oo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Oo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Oo.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=$O(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}},Ua=hK;var{ERR_RESIZE:Wdn,ERR_CAPACITY:qdn}=ta.Error,Mv=class Mv extends ns{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(Mv.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Mv.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(Mv.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(Mv,"Layout",{...ns.Layout,POSITION_OFFSET_U32:ns.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ns.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ns.Layout.__BYTE_LENGTH+8});var mK=Mv,Aa=mK;var JO=`#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); +#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)); +vec3 normalEC = normalize(cross(leftRight, downUp)); #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); +#ifdef PER_INSTANCE_COLOR +vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT +out_FragColor = color; +#else // FLAT +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = -eyeCoordinate.xyz; +czm_material material = czm_getDefaultMaterial(materialInput); +material.diffuse = color.rgb; +material.alpha = color.a; +out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT +out_FragColor.rgb *= out_FragColor.a; +#else // PER_INSTANCE_COLOR +czm_materialInput materialInput; +#ifdef USES_NORMAL_EC +materialInput.normalEC = normalEC; #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; +#ifdef USES_POSITION_TO_EYE_EC +materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif +#ifdef USES_TANGENT_TO_EYE +materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif +#ifdef USES_ST +materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; +materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT +out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT +out_FragColor.rgb *= out_FragColor.a; +#endif // PER_INSTANCE_COLOR +czm_writeDepthClamp(); +#endif // PICK } -`;var ZO=`in vec4 v_pickColor; +`;function Rd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new WX;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new WX;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}Rd.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,Sv]})};Rd.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:[Sv],pickColorQualifier:"in"})};Rd.prototype.createVertexShader=function(e,t,n,i){return Zhe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Rd.prototype.createPickVertexShader=function(e,t,n,i){return Zhe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Whe=new h,qhe=new he,Yhe={high:0,low:0};function Zhe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=qhe;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,Whe),d=Sn.encode(f.x,Yhe);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=qhe;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=s.project(p,Whe);d=Sn.encode(g.x,Yhe),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 WX(){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(WX.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 Xhe(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 RHe=[new U,new U,new U,new U];function Qhe(e,t){let n=RHe,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Xhe(i,r,o),a=1/Xhe(i,o,r);e.uvMinAndExtents=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var eme=new he,tme=new h,OHe=new h,MHe=new h,_6={high:0,low:0};function nme(e,t,n){let i=eme;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,tme);i.latitude=e.north;let o=t.project(i,OHe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,MHe),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,_6);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,_6),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,_6),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,_6),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var NHe=new N,LHe=new N,Khe=new h,FHe=new he,BHe=[new he,new he,new he,new he,new he,new he,new he,new he];function kHe(e,t,n,i,r,o){let s=ie.center(e,FHe);s.height=n;let a=he.toCartesian(s,t,Khe),c=At.eastNorthUpToFixedFrame(a,t,NHe),u=N.inverse(c,LHe),f=e.west,d=e.east,p=e.north,g=e.south,m=BHe;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,Khe);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 UHe=new h,zHe=new h,VHe=new Sn;Rd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=tme,s=UHe,a=zHe;kHe(e,n,r??0,o,s,a);let c={};Qhe(c,t);let u=Sn.fromCartesian(o,VHe);return c.southWest_HIGH=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),nme(e,i,c),c};var jHe=new h;function $he(e,t,n,i){let r=eme;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,jHe),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 Jhe=new U;Rd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=$he(e.south,e.west,n,Jhe),o=r.x,s=r.y,a=$he(e.north,e.east,n,Jhe),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 Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Qhe(g,t),nme(e,i,g),g};Rd.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)};Rd.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 HHe(e){return Math.max(e.width,e.height)>Rd.MAX_WIDTH_FOR_PLANAR_EXTENTS}Rd.shouldUseSphericalCoordinates=function(e){return HHe(e)};Rd.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Sf=Rd;var ime={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(ime);var ei=ime;var rme={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(rme);var Rt=rme;var y6={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};y6.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ei.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ei.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:y6.CESIUM_3D_TILE_MASK,mask:y6.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(y6);function Ex(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.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(Ex.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}}});Ex.isSupported=function(e){return e.context.stencilBuffer};function wv(e,t){let n=t?ei.EQUAL:ei.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:ac.LESS_OR_EQUAL},depthMask:!1}}function YX(e){return{stencilTest:{enabled:e,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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 GHe={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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 WHe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(wv(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(wv(r,!0)),e._rsColorPass=Ge.fromCache(YX(r,!1)),e._rsPickPass=Ge.fromCache(GHe)}function qHe(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() +{ +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function YHe(e,t){let n=t.context,i=e._primitive,r=tM;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=On._appendDistanceDisplayConditionToShader(i,r),r=On._modifyShaderPosition(e,r,t.scene3DOnly),r=On._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=qHe(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ye({defines:[a],sources:[r]}),u=new Ye({sources:[zy]}),f=e._primitive._attributeLocations,d=new Sf(s,o,e.appearance);if(e._spStencil=en.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ye.createPickVertexShaderSource(r);m=On._appendShowToShader(i,m),m=On._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=en.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=en.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=On._appendShowToShader(i,r),c=new Ye({defines:[a],sources:[r]}),e._sp=en.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=en.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 XHe(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 KHe(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 $He(e,t,n,i,r,o,s){XHe(e,o),KHe(e,s)}function ome(e,t){return Math.floor(e%t/2)}function qX(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function sme(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function JHe(e,t,n,i,r,o,s,a){let c=e._primitive;On._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!==Qn.CESIUM_3D_TILE,p=f!==Qn.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[ome(m,b)],d&&(A=n[m],qX(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,qX(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],qX(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[ome(m,b)];y=u[T.index],d&&(A=i[m],sme(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,sme(A,t,r,o,y))}}}Ex.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=Sf.hasAttributesForSphericalExtents(c),g=Sf.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){WHe(n,A)},i._createShaderProgramFunction=function(y,A,b){YHe(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){$He(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){JHe(n,A,b,x,T,E,v,S)},this._primitive=new On(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(wv(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(wv(!1,!0)),this._rsColorPass=Ge.fromCache(YX(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(wv(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(wv(!0,!0)),this._rsColorPass=Ge.fromCache(YX(!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))})};Ex.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ex.prototype.isDestroyed=function(){return!1};Ex.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,le(this)};var Iv=Ex;var ZHe={u_globeMinimumAltitude:function(){return 55e3}};function Nu(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??Qn.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:ZHe}}Object.defineProperties(Nu.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}}});Nu.isSupported=Iv.isSupported;function ame(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function cme(e){return function(t,n){return e._minHeight}}var QHe=new h,eGe=new h,tGe=new h,nGe=new he,iGe=new ie;function A6(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,QHe),g=h.unpack(r,d,eGe),m=h.add(p,g,tGe),y=n.cartesianToCartographic(m,nGe),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=iGe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function rGe(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function oGe(e,t,n){let i=t.mapProjection.ellipsoid,r=A6(t,n),o=Qt.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.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 XX(e,t){return Math.floor(e%t/2)}function KX(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 lme(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 sGe(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!==Qn.CESIUM_3D_TILE,d=u!==Qn.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[XX(m,b)],f&&(A=n[m],KX(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,KX(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],KX(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[XX(m,b)],!e._useFragmentCulling){let T=x[XX(m,b)];y=c[T.index]}f&&(A=i[m],lme(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,lme(e,A,t,r,o,y))}}}Nu.initializeTerrainHeights=function(){return Mi.initialize()};Nu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){Nu.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=A6(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)}rGe(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=Nu._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=A6(e,o),Sf.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=A6(e,o),x=o.textureCoordinateRotationPoints;A?y=Sf.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Sf.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,cme(this),ame(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,cme(this),ame(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){oGe(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){sGe(t,A,b,x,T,E,v,S)},this._primitive=new Iv(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))})};Nu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Nu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};Nu._supportsMaterials=function(e){return e.depthTexture};Nu.supportsMaterials=function(e){return Nu._supportsMaterials(e.frameState.context)};var Vl=Nu;function Pv(){pe.throwInstantiationError()}Object.defineProperties(Pv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Pv.prototype.getType=pe.throwInstantiationError;Pv.prototype.getValue=pe.throwInstantiationError;Pv.prototype.equals=pe.throwInstantiationError;var aGe=new K;Pv.getValue=function(e,t,n){let i;return l(e)||(e=K.now(aGe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Qi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Qi.ColorType)&&(n=Qi.fromType(Qi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var _o=Pv;function Cx(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}Cx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Cx.prototype._setOptions=pe.throwInstantiationError;Cx.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=_o.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 Vl({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 On({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 On({geometryInstances:u,appearance:new yn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Cx.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))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};Cx.prototype.isDestroyed=function(){return!1};Cx.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),le(this)};var Ii=Cx;var ume={};function aM(e,t){l(ume[e])||(ume[e]=!0,console.warn(t??e))}aM.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.";aM.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";aM.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";aM.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var _t=aM;var fme={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(fme);var gg=fme;var dme={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(dme);var ln=dme;var hme=D.EPSILON10;function cGe(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,hme)?(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],hme)&&(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=cGe;function lGe(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 uGe(e,t){return e*t*(4+e*(4-3*t))/16}function mme(e,t,n,i,r,o,s){let a=uGe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function fGe(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+mme(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 dGe=new h,$X=new h;function pme(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,$X),dGe),o=h.normalize(i.cartographicToCartesian(n,$X),$X);fGe(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,lGe(e)}function cM(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)&&pme(this,e,t,i)}Object.defineProperties(cM.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}}});cM.prototype.setEndPoints=function(e,t){pme(this,e,t,this._ellipsoid)};cM.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};cM.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)-mme(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 _g=cM;function ZX(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 hGe(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 Dv(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 mGe(e,t,n,i,r){let o=Dv(e._ellipticity,n),s=Dv(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),s-o)}function pGe(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=ZX(e._ellipticity,t,r);u=(ZX(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var gGe=new h,JX=new h;function gme(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,JX),gGe),o=h.normalize(i.cartographicToCartesian(n,JX),JX),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=mGe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=pGe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function _me(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=ZX(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=hGe(p,r,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let g=Dv(r,e.latitude),m=Dv(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 yg(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)&&gme(this,e,t,i)}Object.defineProperties(yg.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}}});yg.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=_me(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new yg(e,d,o):(r.setEndPoints(e,d),r)};yg.prototype.setEndPoints=function(e,t){gme(this,e,t,this._ellipsoid)};yg.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};yg.prototype.interpolateUsingSurfaceDistance=function(e,t){return _me(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};yg.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};yg.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=Dv(n,r.latitude),s=Dv(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 Dc=yg;var sK=[Ui,yi],_Ge=sK.length,Bme=Math.cos(D.toRadians(30)),yme=Math.cos(D.toRadians(150)),kme=0,Ume=1e3;function jy(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(jy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});jy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<_Ge;i++)if(t instanceof sK[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var yGe=new h,Ame=new h,bme=new h;function oK(e,t,n,i,r){let o=jl(i,e,0,yGe),s=jl(i,e,n,Ame),a=jl(i,t,0,bme),c=Ag(s,o,Ame),u=Ag(a,o,bme);return h.cross(u,c,r),h.normalize(r,r)}var AGe=new he,bGe=new h,xGe=new h,TGe=new h;function QX(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new _g(e,t,s):o===ln.RHUMB&&(d=new Dc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=oK(e,t,i,s,TGe),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,AGe),v=jl(s,E,n,bGe),S=jl(s,E,i,xGe);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 eK=new he;function jl(e,t,n,i){return he.clone(t,eK),eK.height=n,he.toCartesian(eK,e,i)}jy.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};jy.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 jy({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 Ag(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function xme(e,t,n,i){return i=Ag(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var EGe=new h,CGe=new h,vGe=new h,zme=new h,SGe=0,wGe=-1;function tK(e,t,n,i,r){let o=Ag(n,t,zme),s=xme(e,t,o,EGe),a=xme(i,t,o,CGe);if(D.equalsEpsilon(h.dot(s,a),wGe,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,vGe);return h.dot(a,c)<SGe&&(r=h.negate(r,r)),r}var E6=sn.fromPointNormal(h.ZERO,h.UNIT_Y),IGe=new h,PGe=new h,DGe=new h,RGe=new h,OGe=new h,b6=new h,x6=new he,Tme=new he,Eme=new he;jy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new sK[e._projectionIndex](i),a=kme,c=Ume,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Dc(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=_i.lineSegmentPlane(g,m,E6,b6),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,x6).longitude,y=i.cartesianToCartographic(g,x6),A=i.cartesianToCartographic(m,Tme),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,Eme),x=i.cartographicToCartesian(T,b6),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=_i.lineSegmentPlane(g,m,E6,b6),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,x6).longitude,y=i.cartesianToCartographic(g,x6),A=i.cartesianToCartographic(m,Tme),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,Eme),x=i.cartographicToCartesian(T,b6),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=IGe,w=PGe,P=DGe,M=RGe,F=OGe,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=tK(C,w,P,M,F):F=oK(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),QX(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),tK(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),QX(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=tK(C,w,P,M,F)}else F=oK(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(QX(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 r5e(n,s,L,_,O,R,t)};var MGe=new h,NGe=new $,LGe=new Le;function Cme(e,t,n,i){let r=Ag(n,t,MGe),o=h.dot(r,e);if(o>Bme||o<yme){let s=Ag(i,n,zme),a=o<yme?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,LGe),u=$.fromQuaternion(c,NGe);return $.multiplyByVector(u,e,e),!0}return!1}var vme=new he,FGe=new h,Sme=new h;function lM(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,FGe),s=h.add(o,n,Sme),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,vme);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,Sme),u=c.cartesianToCartographic(s,vme)),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 BGe=new h,wme=new h;function Ime(e,t,n,i,r,o){let s=h.subtract(t,e,BGe);h.normalize(s,s);let a=n-kme,c=h.multiplyByScalar(s,a,wme);h.add(e,c,r);let u=i-Ume;c=h.multiplyByScalar(s,u,wme),h.add(t,c,o)}var kGe=new h;function T6(e,t){let n=sn.getPointDistance(E6,e),i=sn.getPointDistance(E6,t),r=kGe;D.equalsEpsilon(n,0,D.EPSILON2)?(r=Ag(t,e,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=Ag(e,t,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(t,r,t))}function UGe(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 Vme=new he,jme=new he,Pme=new h,nK=new h,Dme=new h,Rme=new h,zGe=new h,Ome=new h,VGe=[Vme,jme],jGe=new ie,HGe=new h,GGe=new h,WGe=new h,qGe=new h,YGe=new h,XGe=new h,iK=new h,rK=new h,KGe=new h,$Ge=new h,JGe=new h,Mme=new h,ZGe=new h,QGe=new h,e5e=new Sn,t5e=new Sn,Nme=new h,n5e=new h,Lme=new h,i5e=[new ue,new ue],Hme=[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],Fme=Hme.length;function r5e(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,_=Vme;_.height=0;let C=jme;C.height=0;let w=Pme,P=nK;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,Rme),W=h.unpack(i,0,nK),J=h.unpack(r,0,Ome);if(e){let Se=h.unpack(n,n.length-6,Dme);Cme(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,Dme),Re=h.clone(W,Pme),Qe=h.clone(J,zGe);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,Rme),W=h.unpack(i,c,nK),J=h.unpack(r,c,Ome),q=Cme(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 gi=UGe(_,C);He=t.project(_,YGe),Xe=t.project(C,XGe);let ho=Ag(Xe,He,Nme);ho.y=Math.abs(ho.y),$e=iK,Pe=rK,gi===0||h.dot(ho,h.UNIT_Y)>Bme?($e=lM(t,_,Qe,He,iK),Pe=lM(t,C,J,Xe,rK)):gi===1?(Pe=lM(t,C,J,Xe,rK),$e.x=0,$e.y=D.sign(_.longitude-Math.abs(C.longitude)),$e.z=0):($e=lM(t,_,Qe,He,iK),Pe.x=0,Pe.y=D.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(Se,e5e),vt=h.subtract(Q,Se,KGe),Gt=h.normalize(vt,Mme),lt=h.subtract(Re,Se,$Ge);lt=h.normalize(lt,lt);let mt=h.cross(Gt,lt,Mme);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,ZGe);ft=h.normalize(ft,ft);let Xt=h.subtract(W,Q,JGe);Xt=h.normalize(Xt,Xt);let rt=h.cross(J,Xt,QGe);rt=h.normalize(rt,rt);let ht=qe/F,Bi=Z/F,Xn=0,bi,Wi,wi,hi=0,xi=0;if(s){Xn=h.distance(He,Xe),bi=Sn.fromCartesian(He,t5e),Wi=h.subtract(Xe,He,Nme),wi=h.normalize(Wi,n5e);let gi=wi.x;wi.x=wi.y,wi.y=-gi,hi=Xn/L,xi=ae/L}for(V=0;V<8;V++){let gi=G+V*4,ho=j+V*2,ur=gi+3,Zo=V<4?1:-1,Bn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,gi),A[ur]=vt.x,h.pack(st.low,b,gi),b[ur]=vt.y,h.pack(ft,x,gi),x[ur]=vt.z,h.pack(rt,T,gi),T[ur]=ht*Zo,h.pack(mt,E,gi);let qi=Bi*Bn;qi===0&&Bn<0&&(qi=9),E[ur]=qi,s&&(v[gi]=bi.high.x,v[gi+1]=bi.high.y,v[gi+2]=bi.low.x,v[gi+3]=bi.low.y,I[gi]=-$e.y,I[gi+1]=$e.x,I[gi+2]=Pe.y,I[gi+3]=-Pe.x,S[gi]=Wi.x,S[gi+1]=Wi.y,S[gi+2]=wi.x,S[gi+3]=wi.y,R[ho]=hi*Zo,qi=xi*Bn,qi===0&&Bn<0&&(qi=9),R[ho+1]=qi)}let jn=WGe,nn=qGe,Wn=HGe,Zi=GGe,Mr=ie.fromCartographicArray(VGe,jGe),fo=Mi.getMinimumMaximumHeights(Mr,u),Bs=fo.minimumTerrainHeight,Ks=fo.maximumTerrainHeight;Ae+=Math.abs(Bs),Ae+=Math.abs(Ks),Ime(Se,Re,Bs,Ks,jn,Wn),Ime(Q,W,Bs,Ks,nn,Zi);let no=h.multiplyByScalar(mt,D.EPSILON5,Lme);h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),T6(jn,nn),T6(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,Lme),h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),T6(jn,nn),T6(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<Fme;V++)m[c+V]=Hme[V]+fe;fe+=8,c+=Fme}let xe=i5e;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:Vy(A),startLoAndForwardOffsetY:Vy(b),startNormalAndForwardOffsetZ:Vy(x),endNormalAndTextureCoordinateNormalizationX:Vy(T),rightNormalAndTextureCoordinateNormalizationY:Vy(E)};return s&&(we.startHiLo2D=Vy(v),we.offsetAndRight2D=Vy(S),we.startEndNormals2D=Vy(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new St({attributes:we,indices:m,boundingSphere:ge})}function Vy(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}jy._projectNormal=lM;var vx=jy;var uM=`in vec4 v_startPlaneNormalEcAndHalfWidth; +in vec4 v_endPlaneNormalEcAndBatchId; +in vec4 v_rightPlaneEC; +in vec4 v_endEcAndStartEcX; +in vec4 v_texcoordNormalizationAndStartEcYZ; +#ifdef PER_INSTANCE_COLOR in vec4 v_color; -void main() -{ -if (v_color.a < 0.005) +#endif +void main(void) { +float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); +vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); +if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME discard; +#endif // DEBUG_SHOW_VOLUME } -out_FragColor = czm_gammaCorrect(v_color); -czm_writeLogDepth(); -} -`;var Gl=`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); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +eyeCoordinate /= eyeCoordinate.w; +float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); +float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); +float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); +float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); +if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -else { -lineDir = normalize(nextWindow.xy - positionWindow.xy); +vec3 alignedPlaneNormal; +alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); +alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); +distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); +alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); +alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); +distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); +#ifdef PER_INSTANCE_COLOR +out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR +float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); +s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; +float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); +czm_materialInput materialInput; +materialInput.s = s; +materialInput.st = vec2(s, t); +materialInput.str = vec3(s, t, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +out_FragColor.rgb *= out_FragColor.a; +czm_writeDepthClamp(); } -angle = atan(lineDir.x, lineDir.y) - 1.570796327; -angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +`;var fM=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; #endif -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; +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { +return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -vec2 thisSegmentForwardWC, otherSegmentForwardWC; -if (usePrevious) +void main(void) { -thisSegmentForwardWC = -directionToPrevWC; -otherSegmentForwardWC = directionToNextWC; +vec4 eyeCoordinate = gl_FragCoord; +eyeCoordinate /= eyeCoordinate.w; +#ifdef PER_INSTANCE_COLOR +out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR +float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); +float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); +distanceFromStart = max(0.0, distanceFromStart); +distanceFromEnd = max(0.0, distanceFromEnd); +float s = distanceFromStart / (distanceFromStart + distanceFromEnd); +s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; +czm_materialInput materialInput; +materialInput.s = s; +materialInput.st = vec2(s, v_texcoordT); +materialInput.str = vec3(s, v_texcoordT, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR } -else +`;var dM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +in float batchId; +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif +void main() { -thisSegmentForwardWC = directionToNextWC; -otherSegmentForwardWC = -directionToPrevWC; +v_batchId = batchId; +vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); +vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); +vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); +vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; +vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; +vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +vec4 startPlane2D; +vec4 startPlane3D; +startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); +startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; +startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); +startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); +vec4 rightPlane2D; +vec4 rightPlane3D; +rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); +rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; +rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); +rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); +posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); +posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); +posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); +posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; +posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; +vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); +vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); +vec4 endPlane2D; +vec4 endPlane3D; +endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); +endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; +endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); +endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); +v_forwardDirectionEC = normalize(endEC - startEC); +vec2 cleanTexcoordNormalization2D; +cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); +cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); +vec2 cleanTexcoordNormalization3D; +cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); +cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; +cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); +v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR +v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); +v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR +#ifdef WIDTH_VARYING +float width = czm_batchTable_width(batchId); +float halfWidth = width * 0.5; +v_width = width; +v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else +float halfWidth = 0.5 * czm_batchTable_width(batchId); +v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif +vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); +float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); +float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); +vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); +vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); +vec3 normalEC = normalize(cross(planeDirection, upOrDown)); +vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); +geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); +geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; +positionEc3D.xyz += geodeticSurfaceNormal; +normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; +vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); +absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); +absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); +planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); +upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); +normalEC = normalize(cross(planeDirection, upOrDown)); +geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); +geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); +geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; +positionEc2D.xyz += geodeticSurfaceNormal; +normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR +v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif +positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; +gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); +#ifdef ANGLE_VARYING +vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); +approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); +v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } -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)) +`;var hM=`in vec3 position3DHigh; +in vec3 position3DLow; +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif +in float batchId; +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif +void main() { -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); +#ifdef COLUMBUS_VIEW_2D +vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; +vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); +vec3 ecEnd = forwardDirectionEC + ecStart; +forwardDirectionEC = normalize(forwardDirectionEC); +v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); +v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); +vec4 startPlaneEC; +startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); +startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); +vec4 endPlaneEC; +endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); +endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); +v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); +v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; +#else // COLUMBUS_VIEW_2D +vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; +vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); +vec3 ecEnd = ecStart + offset; +vec3 forwardDirectionEC = normalize(offset); +vec4 startPlaneEC; +startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; +startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); +vec4 endPlaneEC; +endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; +endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); +v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; +v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); +v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); +v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; +#endif // COLUMBUS_VIEW_2D +v_endEcAndStartEcX.xyz = ecEnd; +v_endEcAndStartEcX.w = ecStart.x; +v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR +vec4 positionRelativeToEye = czm_computePosition(); +vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; +float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); +float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); +vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); +vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); +vec3 normalEC = normalize(cross(planeDirection, upOrDown)); +upOrDown = cross(forwardDirectionEC, normalEC); +upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; +upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; +upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; +positionEC.xyz += upOrDown; +v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); +float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING +v_width = width; +#endif +v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; +v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; +v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; +v_endPlaneNormalEcAndBatchId.w = batchId; +width = width * max(0.0, czm_metersPerPixel(positionEC)); +width = width / dot(normalEC, v_rightPlaneEC.xyz); +#ifdef COLUMBUS_VIEW_2D +normalEC *= sign(texcoordNormalization2D.x); +#else +normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif +positionEC.xyz += width * normalEC; +gl_Position = czm_depthClamp(czm_projection * positionEC); +#ifdef ANGLE_VARYING +vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); +approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); +v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } -vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; -return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +`;var mM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() +{ +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = czm_computePosition(); +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_color = color; } -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +`;var Hl=`void clipLineSegmentToNearPlane( +vec3 p0, +vec3 p1, +out vec4 positionWC, +out bool clipped, +out bool culledByNearPlane, +out vec4 clippedPositionEC) { -vec4 positionEC = czm_modelViewRelativeToEye * position; -vec4 prevEC = czm_modelViewRelativeToEye * previous; -vec4 nextEC = czm_modelViewRelativeToEye * next; -return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +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; } -`;var QO=class QO extends Hl{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(QO,"Layout",{...Hl.Layout,WIDTH_F32:Hl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Hl.Layout.__BYTE_LENGTH+4}),ut(QO,"DEFAULT_MATERIAL",Object.freeze(new QO));var pK=QO,Of=pK;var Cx={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},E6={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},nl=new Aa,eM=new Of,tM=new z,ame=new h,cme=new h,lme=new h,gK=new Sn,_K=new Sn,yK=new Sn;function vHe(e,t,n){let i=t.context;n=n||{destroy:IHe};let r=e._positionDatatype===Y.DOUBLE,o=r?Cx:E6;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,nl),!nl._dirty)continue;nl.getMaterial(eM);let L=cn.encodeRGB8(eM.color),_=eM.color.alpha,C=f?-eM.width:eM.width;z.fromRgba(nl._pickId,tM);let w=nl.show,P=nl.vertexOffset*2,M=(nl.vertexOffset-R)*6,F=e._positionView,V=nl.vertexOffset*3;for(let B=0,j=nl.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,ame),h.fromElements(J,Z,ae,cme),h.fromElements(Ae,fe,xe,lme),Sn.fromCartesian(ame,gK),Sn.fromCartesian(cme,_K),Sn.fromCartesian(lme,yK));for(let ge=0;ge<2;ge++)r?(h.pack(gK.high,x,P*3),h.pack(gK.low,T,P*3),h.pack(_K.high,E,P*3),h.pack(_K.low,v,P*3),h.pack(yK.high,S,P*3),h.pack(yK.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(tM.red),p[P*4+1]=z.floatToByte(tM.green),p[P*4+2]=z.floatToByte(tM.blue),p[P*4+3]=z.floatToByte(tM.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++}nl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=wHe(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:Cx.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Cx.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:Cx.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Cx.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:Cx.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Cx.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:E6.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:E6.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:E6.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===Li.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[Gl,JO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[ZO]}),attributeLocations:o}));let s=SHe(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Li.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 SHe(e){return(e.vertexCount-e.primitiveCount)*6}function wHe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,nl);let i=nl.vertexOffset*2,o=(nl.vertexOffset-t)*6;e.get(t+n-1,nl);let s=(nl.vertexOffset+nl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function IHe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var nM=vHe;var AK=class e extends ta{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 Aa}_getMaterialClass(){return Of}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Aa){super.add(t,n);let i=this._positionCount;return n._setUint32(Aa.Layout.POSITION_OFFSET_U32,i),n._setUint32(Aa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=nM(this,t,this._renderContext))}},il=AK;function TK(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=fme(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=MHe(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 rM(o,s,n,a,c,u,0),s}function fme(e,t,n,i,r){let o;if(r===GHe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=ume(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=ume(s/i|0,e[s],e[s+1],o);return o&&Nv(o,o.next)&&(sM(o),o=o.next),o}function vx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(Nv(n,n.next)||xs(n.prev,n,n.next)===0)){if(sM(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function rM(e,t,n,i,r,o,s){if(!e)return;!s&&o&&kHe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?DHe(e,i,r,o):PHe(e)){t.push(c.i,e.i,u.i),sM(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=RHe(vx(e),t),rM(e,t,n,i,r,o,2)):s===2&&OHe(e,t,n,i,r,o):rM(vx(e),t,n,i,r,o,1);break}}}function PHe(e){let t=e.prev,n=e,i=e.next;if(xs(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&&iM(r,a,o,c,s,u,m.x,m.y)&&xs(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function DHe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(xs(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=bK(g,m,t,n,i),x=bK(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&&iM(a,f,c,d,u,p,T.x,T.y)&&xs(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&&iM(a,f,c,d,u,p,E.x,E.y)&&xs(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&&iM(a,f,c,d,u,p,T.x,T.y)&&xs(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&&iM(a,f,c,d,u,p,E.x,E.y)&&xs(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function RHe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!Nv(i,r)&&hme(i,n,n.next,r)&&oM(i,r)&&oM(r,i)&&(t.push(i.i,n.i,r.i),sM(n),sM(n.next),n=e=r),n=n.next}while(n!==e);return vx(n)}function OHe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&VHe(s,a)){let c=mme(s,a);s=vx(s,s.next),c=vx(c,c.next),rM(s,t,n,i,r,o,0),rM(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function MHe(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=fme(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(zHe(u))}r.sort(NHe);for(let o=0;o<r.length;o++)n=LHe(r[o],n);return n}function NHe(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 LHe(e,t){let n=FHe(e,t);if(!n)return t;let i=mme(n,e);return vx(i,i.next),vx(n,n.next)}function FHe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(Nv(e,n))return n;do{if(Nv(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&&dme(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);oM(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&BHe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function BHe(e,t){return xs(e.prev,e,t.prev)<0&&xs(t.next,e,e.next)<0}function kHe(e,t,n,i){let r=e;do r.z===0&&(r.z=bK(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,UHe(r)}function UHe(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 bK(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 zHe(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 dme(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 iM(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&dme(e,t,n,i,r,o,s,a)}function VHe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!jHe(e,t)&&(oM(e,t)&&oM(t,e)&&HHe(e,t)&&(xs(e.prev,e,t.prev)||xs(e,t.prev,t))||Nv(e,t)&&xs(e.prev,e,e.next)>0&&xs(t.prev,t,t.next)>0)}function xs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Nv(e,t){return e.x===t.x&&e.y===t.y}function hme(e,t,n,i){let r=v6(xs(e,t,n)),o=v6(xs(e,t,i)),s=v6(xs(n,i,e)),a=v6(xs(n,i,t));return!!(r!==o&&s!==a||r===0&&C6(e,n,t)||o===0&&C6(e,i,t)||s===0&&C6(n,e,i)||a===0&&C6(n,t,i))}function C6(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 v6(e){return e>0?1:e<0?-1:0}function jHe(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&&hme(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function oM(e,t){return xs(e.prev,e,e.next)<0?xs(e,t,e.next)>=0&&xs(e,e.prev,t)>=0:xs(e,t,e.prev)<0||xs(e,e.next,t)<0}function HHe(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 mme(e,t){let n=xK(e.i,e.x,e.y),i=xK(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 ume(e,t,n,i){let r=xK(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 sM(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 xK(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function GHe(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}function CK(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 WHe(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 Lv(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 qHe(e,t,n,i,r){let o=Lv(e._ellipticity,n),s=Lv(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),s-o)}function YHe(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=CK(e._ellipticity,t,r);u=(CK(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var XHe=new h,EK=new h;function pme(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,EK),XHe),o=h.normalize(i.cartographicToCartesian(n,EK),EK),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=qHe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=YHe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function gme(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=CK(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=WHe(p,r,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let g=Lv(r,e.latitude),m=Lv(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 bg(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)&&pme(this,e,t,i)}Object.defineProperties(bg.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}}});bg.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=gme(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new bg(e,d,o):(r.setEndPoints(e,d),r)};bg.prototype.setEndPoints=function(e,t){pme(this,e,t,this._ellipsoid)};bg.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};bg.prototype.interpolateUsingSurfaceDistance=function(e,t){return gme(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};bg.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};bg.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=Lv(n,r.latitude),s=Lv(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 Rc=bg;function KHe(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=KHe;var $He=new h,JHe=new h,Wy={};Wy.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};Wy.computeWindingOrder2D=function(e){return Wy.computeArea2D(e)>0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};Wy.triangulate=function(e,t){let n=U.packArray(e);return TK(n,t,2)};var bme=new h,xme=new h,Tme=new h,_me=new h,yme=new h,Ame=new h,xg=new h,Eme=new U,Cme=new U,vme=new U,Fv=new U;Wy.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,bme),I=h.fromArray(u,E*3,xme),R=h.fromArray(u,T*3,Tme),O,L,_;o&&(O=U.fromArray(f,v*2,Eme),L=U.fromArray(f,E*2,Cme),_=U.fromArray(f,T*2,vme));let C=h.multiplyByScalar(h.normalize(S,_me),y,_me),w=h.multiplyByScalar(h.normalize(I,yme),y,yme),P=h.multiplyByScalar(h.normalize(R,Ame),y,Ame),M=h.magnitudeSquared(h.subtract(C,w,xg)),F=h.magnitudeSquared(h.subtract(w,P,xg)),V=h.magnitudeSquared(h.subtract(P,C,xg)),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,xg),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,Fv),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,xg),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,_,Fv),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,xg),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,Fv),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 ZHe=new he,QHe=new he,eGe=new he,vK=new he;Wy.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 Rc(void 0,void 0,e),x=new Rc(void 0,void 0,e),T=new Rc(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,bme),O=h.fromArray(u,S*3,xme),L=h.fromArray(u,v*3,Tme),_,C,w;o&&(_=U.fromArray(f,I*2,Eme),C=U.fromArray(f,S*2,Cme),w=U.fromArray(f,v*2,vme));let P=e.cartesianToCartographic(R,ZHe),M=e.cartesianToCartographic(O,QHe),F=e.cartesianToCartographic(L,eGe);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,vK),Q=(P.height+M.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,xg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,Fv),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,vK),Q=(M.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,xg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,Fv),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,vK),Q=(F.height+P.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,xg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,Fv),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)};Wy.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=$He,o=JHe;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=Wy;var io={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};io.isVectorType=function(e){switch(e){case io.VEC2:case io.VEC3:case io.VEC4:return!0;default:return!1}};io.isMatrixType=function(e){switch(e){case io.MAT2:case io.MAT3:case io.MAT4:return!0;default:return!1}};io.getComponentCount=function(e){switch(e){case io.SCALAR:case io.STRING:case io.ENUM:case io.BOOLEAN:return 1;case io.VEC2:return 2;case io.VEC3:return 3;case io.VEC4:return 4;case io.MAT2:return 4;case io.MAT3:return 9;case io.MAT4:return 16}};io.getMathType=function(e){switch(e){case io.VEC2:return U;case io.VEC3:return h;case io.VEC4:return se;case io.MAT2:return Xi;case io.MAT3:return $;case io.MAT4:return N;default:return}};Object.freeze(io);var bt=io;var SK=0,Sme=new h,S6=new h,tGe=new Po;function nGe(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=tGe.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)?rGe(He,s,g)??d:iGe(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)wK(Pe,i,r,o,j,SK,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)wK(st,i,r,o,j,SK,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=oGe($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)),wK(Xn,i,r,o,j,SK,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=lGe(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}),cGe(V,P)}function iGe(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function rGe(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 oGe(e){let t=[];for(let n of e){let i=aGe(n);if(i.length<3)continue;sGe(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function sGe(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 aGe(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 wK(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,Sme),h.subtract(Sme,s,S6),a.push(S6.x,S6.y,S6.z)}function cGe(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 lGe(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var aM=nGe;function uGe(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 cM=uGe;var IK={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};IK.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(IK);var Tg=IK;var wme={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(wme);var Up=wme;function fGe(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 lM=fGe;function dGe(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 qy=dGe;function Bv(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Bv.prototype.getTexture=function(e){return this._textures[e]};function hGe(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})}Bv.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):hGe(this,e,t)};function mGe(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?w6(r,o,n):pGe(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function w6(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?Pme(e,n):new Dt({context:n,source:t,sampler:r});return Ime(r)&&o.generateMipmap(),o}function pGe(e,t,n){let{typedArray:i,sampler:r}=e,o=Ime(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=lM(i,a,c),p=qy(d);return w6({sampler:r},p,n)}}else{let d=qy(t);return w6(e,d,n)}else return w6(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."),Pme(e,n)}function Ime(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function Pme(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})}Bv.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];mGe(this,r,t)}n.length=0};Bv.prototype.isDestroyed=function(){return!1};Bv.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 le(this)};var uM=Bv;var Dme={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Dme);var Yy=Dme;function fM(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Tg.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??Yy.INHERIT,this._textureManager=new uM,this._defaultTexture=void 0,this.uniformMap=gGe(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},AGe(this),bGe(this)}function gGe(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===Up.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=_Ge(e,i)):n[i]=yGe(e,i)}return n}function _Ge(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function yGe(e,t){return function(){return e.uniforms[t].value}}function Sx(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function AGe(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,Sx(o,t,r),r=e.usedVariablesVertex.featureIdSet,Sx(o,n,r),r=e.usedVariablesVertex.metadataSet,Sx(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,Sx(s,t,r),r=e.usedVariablesFragment.featureIdSet,Sx(s,n,r),r=e.usedVariablesFragment.metadataSet,Sx(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;Sx(s,a,c)}}function Rme(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 rl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${Rme(t)} is not available in the ${i} shader. Did you mean ${Rme(n)} instead?`;throw new pe(r)}}function bGe(e){let t=e.usedVariablesVertex.attributeSet;rl(t,"position","positionMC","vertex"),rl(t,"normal","normalMC","vertex"),rl(t,"tangent","tangentMC","vertex"),rl(t,"bitangent","bitangentMC","vertex"),rl(t,"positionWC","positionMC","vertex"),rl(t,"positionEC","positionMC","vertex"),rl(t,"normalEC","normalMC","vertex"),rl(t,"tangentEC","tangentMC","vertex"),rl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;rl(n,"position","positionEC","fragment"),rl(n,"normal","normalEC","fragment"),rl(n,"tangent","tangentEC","fragment"),rl(n,"bitangent","bitangentEC","fragment"),rl(n,"normalMC","normalEC","fragment"),rl(n,"tangentMC","tangentEC","fragment"),rl(n,"bitangentMC","bitangentEC","fragment")}fM.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Up.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};fM.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};fM.prototype.isDestroyed=function(){return!1};fM.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var zp=fM;var fn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},ol={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};fn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:ol.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:ol.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:ol.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:ol.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:ol.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:ol.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:ol.INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:ol.UNSIGNED_INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:ol.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:ol.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!==ol.FLOAT};fn.isUnsignedIntegerType=function(e){return fn.typeInfo[e].category===ol.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;function xGe(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 dM=xGe;function TGe(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!EGe(r?.[s],o?.[s]))continue;let a=CGe(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function EGe(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function CGe(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return vGe(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return SGe(e,i,r)}function vGe(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new zp({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +else if (endPoint0Distance > 0.0) { - material.diffuse = fsInput.metadata.${e}.rgb; - material.alpha = fsInput.metadata.${e}.a; -}`})}function SGe(e,t,n){let r=cM([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 dM({typedArray:r,width:128,height:1});return new zp({uniforms:{u_colorMap:{type:Up.SAMPLER_2D,value:o},u_minimumValue:{type:Up.FLOAT,value:t[0]},u_maximumValue:{type:Up.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 kv=TGe;function Uv(e,t){this._distance=t,this._normal=new Ome(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 Ome(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Ome.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 na=Uv;function sl(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?Bme:kme,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 Bme(e){return e===$t.OUTSIDE}function kme(e){return e===$t.INSIDE}Object.defineProperties(sl.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?Bme:kme)}},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 Mme(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}sl.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Mme(n,i)},e.index=t,Mme(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};sl.prototype.get=function(e){return this._planes[e]};function Ume(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}sl.prototype.contains=function(e){return Ume(this._planes,e)!==-1};sl.prototype.remove=function(e){let t=this._planes,n=Ume(t,e);if(n===-1)return!1;e instanceof na&&(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 na&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};sl.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof na&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var wGe=new se,IGe=new se;function Nme(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,IGe);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,wGe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function Lme(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 zme(e,t){let n=kt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var PGe=new U;sl.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=sl.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=zme(r,PGe);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?(Lme(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Nme(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),Lme(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),Nme(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 DGe=new N,Fme=new sn(h.UNIT_X,0);sl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=N.multiply(t,r,DGe));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,Fme);let c=e.intersectPlane(Fme);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};sl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};sl.useFloatTexture=function(e){return e.floatingPointTexture};sl.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=sl.useFloatTexture(t)?e.length:e.length*2,o=zme(r,n);return o.y*=2,o};sl.prototype.isDestroyed=function(){return!1};sl.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Ts=sl;var Xy={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};Xy.includesVertexShader=function(e){return(e&Xy.VERTEX)!==0};Xy.includesFragmentShader=function(e){return(e&Xy.FRAGMENT)!==0};Xy.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};Xy.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(Xy);var de=Xy;function RGe(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=I6(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=I6(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=I6(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=I6(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=MGe(P,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${Vme(B)};`,`${p}.${w}.max${V} = ${Vme(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=OGe(w,P);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${L};`])}}function I6(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 OGe(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 Vme(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function MGe(e,t){return e===bt.SCALAR?"":`[${t}]`}var hM=RGe;function Jh(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?jme:Hme,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function jme(e){return e===$t.OUTSIDE}function Hme(e){return e===$t.INSIDE}Object.defineProperties(Jh.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?jme:Hme)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});Jh.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Jh.prototype.get=function(e){return this._planes[e]};function Gme(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}Jh.prototype.contains=function(e){return Gme(this._planes,e)!==-1};Jh.prototype.remove=function(e){let t=this._planes,n=Gme(t,e);if(n===-1)return!1;e instanceof na&&(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 na&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Jh.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof na&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var NGe=new sn(h.fromElements(1,0,0),0);function LGe(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=BGe(i[o],t,NGe);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var PK=new se,FGe=new h;function BGe(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,PK),s=N.multiplyByVector(t,o,PK),a=h.fromCartesian4(s,FGe);return s=se.divideByScalar(s,h.magnitude(a),PK),sn.fromCartesian4(s,n)}function Wme(e,t){return t.x=Math.min(e,kt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var kGe=new U;Jh.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=Wme(i,kGe);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;LGe(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};Jh.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=Wme(r,n);return o.y*=2,o};Jh.prototype.isDestroyed=function(){return!1};Jh.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Eg=Jh;function DK(e){this.name=e,this.fields=[]}DK.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};DK.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var mM=DK;function RK(e){this.signature=e,this.body=[]}RK.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}`)};RK.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var pM=RK;function Wl(){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(Wl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Wl.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)};Wl.prototype.addStruct=function(e,t,n){this._structs[e]=new mM(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Wl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Wl.prototype.addFunction=function(e,t,n){this._functions[e]=new pM(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Wl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Wl.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)};Wl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Wl.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+=zGe(e),i};Wl.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}`)};Wl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Qn(t,e):t.push(e)};Wl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Qn(t,e):t.push(e)};Wl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=UGe(this),i=VGe(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})};Wl.prototype.clone=function(){return Je(this,!0)};function UGe(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(),Qn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Qn(n,a);return{vertexLines:t,fragmentLines:n}}function zGe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function VGe(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(),Qn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Qn(n,a);return{vertexLines:t,fragmentLines:n}}var Cg=Wl;var gM=`struct Ray { -vec3 pos; -vec3 dir; -}; -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); +float t = endPoint0Distance / denominator; +if (t < 0.0 || t > magnitude) +{ +culledByNearPlane = true; } -`;var _M=`#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); +else +{ +p0 = p0 + t * direction; +p0.z = min(p0.z, -czm_currentFrustum.x); +clipped = true; } -#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); } -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; +clippedPositionEC = vec4(p0, 1.0); +positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); } -float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); -return vec4(entry.xyz, stepSize); +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); } -vec2 packIntToVec2(int value) { -float shifted = float(value) / 255.0; -float lowBits = fract(shifted); -float highBits = floor(shifted) / 255.0; -return vec2(highBits, lowBits); +else { +lineDir = normalize(nextWindow.xy - positionWindow.xy); } -vec2 packFloatToVec2(float value) { -float lowBits = fract(value); -float highBits = floor(value) / 255.0; -return vec2(highBits, lowBits); +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); } -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); +vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); +vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); +if (prevSegmentCulled) +{ +directionToPrevWC = -directionToNextWC; } -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); +else if (nextSegmentCulled) +{ +directionToNextWC = -directionToPrevWC; } -return Ray(origin, direction); +vec2 thisSegmentForwardWC, otherSegmentForwardWC; +if (usePrevious) +{ +thisSegmentForwardWC = -directionToPrevWC; +otherSegmentForwardWC = directionToNextWC; } -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); +else +{ +thisSegmentForwardWC = directionToNextWC; +otherSegmentForwardWC = -directionToPrevWC; } -void main() +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)) { -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; +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); } -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 -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; +vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; +return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; } -if (step.w == 0.0) { -step.w = 0.001; +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); } -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; +`;var o5e=`#define CLIP_POLYLINE +${Hl} +${mM}`,s5e=yx;function Sx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Sx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o5e,this._fragmentShaderSource=e.fragmentShaderSource??s5e,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Sx.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}}});Sx.VERTEX_FORMAT=Be.POSITION_ONLY;Sx.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Sx.prototype.isTranslucent=wr.prototype.isTranslucent;Sx.prototype.getRenderState=wr.prototype.getRenderState;var js=Sx;var pM=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; +out float v_width; +out vec2 v_st; +out float v_polylineAngle; +void main() +{ +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = czm_computePosition(); +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_width = width; +v_st.s = st.s; +v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); +v_polylineAngle = angle; } +`;var wx=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; #endif -} -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 -out_FragColor = colorAccum; -#endif -} -`;var yM=`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 AM=`#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -struct RayShapeIntersection { -vec4 entry; -vec4 exit; -}; -vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1) -{ -if (intersect0.w == NO_HIT) { -return intersect1; -} else if (intersect1.w == NO_HIT) { -return intersect0; -} -return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; -} -vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) -{ -return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; -} -RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) +in vec2 v_st; +void main() { -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; +czm_materialInput materialInput; +vec2 st = v_st; +st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); +materialInput.s = st.s; +materialInput.st = st; +materialInput.str = vec3(st, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE +out_FragColor *= u_highlightColor; #endif -}; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ -return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +czm_writeLogDepth(); } -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +`;var a5e=`#define CLIP_POLYLINE +${Hl} +${pM}`,c5e=wx;function Ix(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ix.VERTEX_FORMAT;this.material=l(e.material)?e.material:Qi.fromType(Qi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??a5e,this._fragmentShaderSource=e.fragmentShaderSource??c5e,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ix.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}}});Ix.VERTEX_FORMAT=Be.POSITION_AND_ST;Ix.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Ix.prototype.isTranslucent=wr.prototype.isTranslucent;Ix.prototype.getRenderState=wr.prototype.getRenderState;var cc=Ix;function bg(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new cc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.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=Gme(!1),this._renderState3DTiles=Gme(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},depthTest:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(bg.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}}});bg.initializeTerrainHeights=function(){return Mi.initialize()};function l5e(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(hM);s=On._appendShowToShader(r,s),s=On._appendDistanceDisplayConditionToShader(r,s),s=On._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(dM);a=On._appendShowToShader(r,a),a=On._appendDistanceDisplayConditionToShader(r,a),a=On._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(uM),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=en.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()(fM);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 Gme(e){return Ge.fromCache({cull:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function u5e(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof js?{}: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 Wme(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 f5e(e,t,n,i,r,o,s){let a=e._primitive;On._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!==Qn.CESIUM_3D_TILE,p=f!==Qn.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],Wme(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,Wme(e,g,t,r,o,b,s))}}}bg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){bg.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 Qc({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,vx.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){l5e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){u5e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){f5e(n,u,f,d,p,g,m)},this._primitive=new On(i)}if(this.appearance instanceof js&&!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))})};bg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};bg.isSupported=function(e){return e.frameState.context.depthTexture};bg.prototype.isDestroyed=function(){return!1};bg.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,le(this)};var Kh=bg;var d5e=new U(1,1),h5e=!1,m5e=z.WHITE;function Rv(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(Rv.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")});Rv.prototype.getType=function(e){return"Image"};var p5e=new K;Rv.prototype.getValue=function(e,t){return l(e)||(e=K.now(p5e)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,d5e,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,m5e,t.color),X.getValueOrDefault(this._transparent,e,h5e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};Rv.prototype.equals=function(e){return this===e||e instanceof Rv&&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 Hy=Rv;function g5e(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 Hy;return t.image=e,t}}function _5e(e,t){return me(e,t,g5e)}var ro=_5e;function gM(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(gM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});gM.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 gM(this)};gM.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 Px=gM;var qme={FIXED:0,INERTIAL:1};Object.freeze(qme);var ji=qme;function Ov(){pe.throwInstantiationError()}Object.defineProperties(Ov.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});Ov.prototype.getValue=pe.throwInstantiationError;Ov.prototype.getValueInReferenceFrame=pe.throwInstantiationError;Ov.prototype.equals=pe.throwInstantiationError;var Yme=new $;Ov.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,Yme);if(n===ji.INERTIAL)return $.multiplyByVector(o,t,r);if(n===ji.FIXED)return $.multiplyByVector($.transpose(o,Yme),t,r)};var $h=Ov;function Dx(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??ji.FIXED}Object.defineProperties(Dx.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 y5e=new K;Dx.prototype.getValue=function(e,t){return l(e)||(e=K.now(y5e)),this.getValueInReferenceFrame(e,ji.FIXED,t)};Dx.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)};Dx.prototype.getValueInReferenceFrame=function(e,t,n){return $h.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Dx.prototype.equals=function(e){return this===e||e instanceof Dx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Gl=Dx;function _M(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(_M.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:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});_M.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 _M(this)};_M.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 Rx=_M;function A5e(e){return e}function b5e(e,t){return me(e,t,A5e)}var Wl=b5e;function yM(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(yM.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:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});yM.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 yM(this)};yM.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 Ox=yM;function AM(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(AM.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:ro("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")});AM.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 AM(this)};AM.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 Mx=AM;function bM(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(bM.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:ro("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")});bM.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 bM(this)};bM.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 Nx=bM;function xM(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(xM.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")});xM.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 xM(this)};xM.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 Jh=xM;var x5e=new h(1,1,1),T5e=h.ZERO,E5e=Le.IDENTITY;function Xme(e,t,n){this.translation=h.clone(e??T5e),this.rotation=Le.clone(t??E5e),this.scale=h.clone(n??x5e)}Xme.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 Gy=Xme;var aK=new Gy;function TM(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(TM.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 C5e=new K;TM.prototype.getValue=function(e,t){return l(e)||(e=K.now(C5e)),l(t)||(t=new Gy),t.translation=X.getValueOrClonedDefault(this._translation,e,aK.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,aK.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,aK.scale,t.scale),t};TM.prototype.equals=function(e){return this===e||e instanceof TM&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var Lx=TM;function xg(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(xg.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}}});xg.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function v5e(e){return new li(e)}xg.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??v5e)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};xg.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var S5e=new K;xg.prototype.getValue=function(e,t){l(e)||(e=K.now(S5e)),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};xg.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 w5e(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}xg.prototype.equals=function(e){return this===e||e instanceof xg&&w5e(this,e)};var ql=xg;function Kme(e){return new Lx(e)}function I5e(e){return new ql(e,Kme)}function P5e(e){return new ql(e)}function D5e(e){return new ql(e)}function EM(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(EM.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,D5e),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,I5e),articulations:me("articulations",void 0,P5e),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});EM.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 EM(this)};EM.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 ql(t,Kme)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new ql(n)}};var Tg=EM;function CM(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(CM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});CM.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new CM(this)};CM.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Fx=CM;function vM(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(vM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:ro("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});vM.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 vM(this)};vM.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 Eg=vM;function SM(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(SM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});SM.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 SM(this)};SM.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 wM=SM;function IM(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(IM.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")});IM.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 IM(this)};IM.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 Bx=IM;function R5e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Rc=R5e;function O5e(e){return Array.isArray(e)&&(e=new Rc(e)),new li(e)}function PM(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(PM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,O5e),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("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")});PM.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 PM(this)};PM.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 Zh=PM;function DM(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(DM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:ro("material"),depthFailMaterial:ro("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});DM.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 DM(this)};DM.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 el=DM;function RM(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(RM.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:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});RM.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 RM(this)};RM.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 kx=RM;function OM(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(OM.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:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});OM.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 OM(this)};OM.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 Qh=OM;function MM(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(MM.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:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});MM.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 MM(this)};MM.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 Cg=MM;var M5e=new he,cK=[];function N5e(e){return new Gl(e)}function L5e(e){return me(e,void 0,N5e)}function Fa(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Od(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=$n()),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",...cK],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 lK(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)&&lK(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Od.prototype,{availability:Wl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Wl("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&&lK(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Wl("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&&lK(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Fa("billboard",qc),box:Fa("box",Px),corridor:Fa("corridor",Rx),cylinder:Fa("cylinder",Ox),description:me("description"),ellipse:Fa("ellipse",Mx),ellipsoid:Fa("ellipsoid",Nx),label:Fa("label",Jh),model:Fa("model",Tg),tileset:Fa("tileset",Fx),orientation:me("orientation"),path:Fa("path",Eg),plane:Fa("plane",wM),point:Fa("point",Bx),polygon:Fa("polygon",Zh),polyline:Fa("polyline",el),polylineVolume:Fa("polylineVolume",kx),properties:Fa("properties",ql),position:L5e("position"),rectangle:Fa("rectangle",Qh),viewFrom:me("viewFrom"),wall:Fa("wall",Cg)});Od.registerEntityType=function(e,t){Object.defineProperties(Od.prototype,{[e]:Fa(e,t)}),cK.includes(e)||cK.push(e)};Od.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Od.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Wl(e,!0))};Od.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Od.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 $me=new $,Jme=new h,Zme=new Le;Od.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,Jme);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,Zme);return l(i)?t=N.fromRotationTranslation($.fromQuaternion(i,$me),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};Od.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,Jme);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,M5e);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):_s(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,Zme);return l(c)?r=N.fromRotationTranslation($.fromQuaternion(c,$me),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};Od.supportsMaterialsforEntitiesOnTerrain=function(e){return Vl.supportsMaterials(e)};Od.supportsPolylinesOnTerrain=function(e){return Kh.isSupported(e)};var Jr=Od;var F5e=new Kt(z.WHITE),B5e=new li(!0),k5e=new li(!0),U5e=new li(!1),z5e=new li(z.BLACK),V5e=new li(Dn.DISABLED),j5e=new li(new jt),H5e=new li(Qn.BOTH);function Yl(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=Jr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Yl.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}}});Yl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Yl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Yl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Yl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Yl.prototype.isDestroyed=function(){return!1};Yl.prototype.destroy=function(){le(this)};Yl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(tt.MINIMUM_VALUE)};Yl.prototype._isOnTerrain=function(e,t){return!1};Yl.prototype._getIsClosed=function(e){return!0};Yl.prototype._isDynamic=pe.throwInstantiationError;Yl.prototype._setStaticOptions=pe.throwInstantiationError;Yl.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(tt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(tt.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??F5e,this._fillProperty=o??k5e,this._showProperty=u??B5e,this._showOutlineProperty=r.outline??U5e,this._outlineColorProperty=c?r.outlineColor??z5e:void 0,this._shadowsProperty=r.shadows??V5e,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??j5e,this._classificationTypeProperty=r.classificationType??H5e,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(tt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Yl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Pi=Yl;function Mv(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Mv.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var G5e=new K;Mv.prototype.getValue=function(e,t){return l(e)||(e=K.now(G5e)),this._callback(e,t)};Mv.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Mv.prototype.equals=function(e){return this===e||e instanceof Mv&&this._callback===e._callback&&this._isConstant===e._isConstant};var em=Mv;var Qme=new h;function Nv(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(tt.MINIMUM_VALUE,Qme);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(Nv.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Nv.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 W5e=new K;Nv.prototype.getValue=function(e,t){l(e)||(e=K.now(W5e));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!Fy(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,Qme);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)};Nv.prototype.isDestroyed=function(){return!1};Nv.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var Ux=Nv;function q5e(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 em(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ux(this._scene,s,o)}}var vg=q5e;var epe=h.ZERO,tpe=new h,Y5e=new h,npe=new z;function X5e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function wf(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new X5e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(wf.prototype=Object.create(Pi.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=Kn.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,npe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,epe,tpe))),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})};wf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,npe),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,epe,tpe))),new Ft({id:t,geometry:Hh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.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(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};wf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};wf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,tt.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(tt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};wf.prototype._onEntityPropertyChanged=vg;wf.DynamicGeometryUpdater=Lv;function Lv(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Lv.prototype=Object.create(Ii.prototype),Lv.prototype.constructor=Lv);Lv.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,Y5e),r=this._options.dimensions;return!l(i)||!l(r)||Ii.prototype._isHidden.call(this,e,t,n)};Lv.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 NM=wf;function zx(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(zx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var K5e=new K;zx.prototype.getValue=function(e,t){return l(e)||(e=K.now(K5e)),this.getValueInReferenceFrame(e,ji.FIXED,t)};zx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};zx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return $h.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};zx.prototype.equals=function(e){return this===e||e instanceof zx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var LM=zx;/*! @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 ipe(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 $5e(e){if(Array.isArray(e))return e}function J5e(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 Z5e(){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 Q5e(e,t){return $5e(e)||J5e(e,t)||e9e(e,t)||Z5e()}function e9e(e,t){if(e){if(typeof e=="string")return ipe(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)?ipe(e,t):void 0}}var ype=Object.entries,rpe=Object.setPrototypeOf,t9e=Object.isFrozen,n9e=Object.getPrototypeOf,i9e=Object.getOwnPropertyDescriptor,Ba=Object.freeze,lc=Object.seal,Fv=Object.create,Ape=typeof Reflect<"u"&&Reflect,gK=Ape.apply,_K=Ape.construct;Ba||(Ba=function(t){return t});lc||(lc=function(t){return t});gK||(gK=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)});_K||(_K=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 jx=pa(Array.prototype.forEach),r9e=pa(Array.prototype.lastIndexOf),ope=pa(Array.prototype.pop),FM=pa(Array.prototype.push),o9e=pa(Array.prototype.splice),Bv=Array.isArray,UM=pa(String.prototype.toLowerCase),uK=pa(String.prototype.toString),spe=pa(String.prototype.match),BM=pa(String.prototype.replace),ape=pa(String.prototype.indexOf),s9e=pa(String.prototype.trim),a9e=pa(Number.prototype.toString),c9e=pa(Boolean.prototype.toString),cpe=typeof BigInt>"u"?null:pa(BigInt.prototype.toString),lpe=typeof Symbol>"u"?null:pa(Symbol.prototype.toString),Lu=pa(Object.prototype.hasOwnProperty),kM=pa(Object.prototype.toString),tl=pa(RegExp.prototype.test),Vx=l9e(TypeError);function pa(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 gK(e,t,i)}}function l9e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return _K(e,n)}}function Ir(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:UM;if(rpe&&rpe(e,null),!Bv(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(t9e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function u9e(e){for(let t=0;t<e.length;t++)Lu(e,t)||(e[t]=null);return e}function Pf(e){let t=Fv(null);for(let i of ype(e)){var n=Q5e(i,2);let r=n[0],o=n[1];Lu(e,r)&&(Bv(o)?t[r]=u9e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=Pf(o):t[r]=o)}return t}function f9e(e){switch(typeof e){case"string":return e;case"number":return a9e(e);case"boolean":return c9e(e);case"bigint":return cpe?cpe(e):"0";case"symbol":return lpe?lpe(e):"Symbol()";case"undefined":return kM(e);case"function":case"object":{if(e===null)return kM(e);let t=e,n=tm(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:kM(i)}return kM(e)}default:return kM(e)}}function tm(e,t){for(;e!==null;){let i=i9e(e,t);if(i){if(i.get)return pa(i.get);if(typeof i.value=="function")return pa(i.value)}e=n9e(e)}function n(){return null}return n}function d9e(e){try{return tl(e,""),!0}catch{return!1}}var upe=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"]),fK=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"]),dK=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"]),h9e=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"]),hK=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"]),m9e=Ba(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fpe=Ba(["#text"]),dpe=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"]),mK=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"]),hpe=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"]),C6=Ba(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),p9e=lc(/{{[\w\W]*|^[\w\W]*}}/g),g9e=lc(/<%[\w\W]*|^[\w\W]*%>/g),_9e=lc(/\${[\w\W]*/g),y9e=lc(/^data-[\-\w.\u00B7-\uFFFF]+$/),A9e=lc(/^aria-[\-\w]+$/),mpe=lc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),b9e=lc(/^(?:\w+script|data):/i),x9e=lc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),T9e=lc(/^html$/i),E9e=lc(/^[a-z][.\w]*(-[.\w]+)+$/i),ppe=lc(/<[/\w!]/g),gpe=lc(/<[/\w]/g),C9e=lc(/<\/no(script|embed|frames)/i),v9e=lc(/\/>/i),If={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bpe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],S9e=Ba(Ir({},bpe)),w9e=(function(){let e={};return jx(bpe,t=>{e[t]=lc(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ba(e)})(),I9e=function(){return typeof window>"u"?null:window},P9e=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}},_pe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Wy=function(t,n,i,r){return Lu(t,n)&&Bv(t[n])?Ir(r.base?Pf(r.base):{},t[n],r.transform):i},pK=function(t,n,i){let r=Lu(t,n)?t[n]:void 0;return r&&typeof r=="object"?Pf(r):i()};function xpe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I9e(),t=Ct=>xpe(Ct);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==If.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=tm(p,"cloneNode"),m=tm(p,"remove"),y=tm(p,"nextSibling"),A=tm(p,"childNodes"),b=tm(p,"parentNode"),x=tm(p,"shadowRoot"),T=tm(p,"attributes"),E=s&&s.prototype?tm(s.prototype,"nodeType"):null,v=s&&s.prototype?tm(s.prototype,"nodeName"):null,S=s&&s.prototype?tm(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 Vx('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||(_=P9e(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=_pe();t.isSupported=typeof ype=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=p9e,Z=g9e,ae=_9e,Ae=y9e,fe=A9e,xe=b9e,ge=x9e,we=E9e,Se=mpe,Re=null,Qe=Ir({},[...upe,...fK,...dK,...hK,...fpe]),He=null,Xe=Ir({},[...dpe,...mK,...hpe,...C6]),$e=Object.seal(Fv(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(Fv(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,bi=!1,Wi=!1,wi=!1,hi=!1,xi=!0,jn=!1,nn="user-content-",Wn=!0,Zi=!1,Mr={},fo=null,Bs=Ir({},["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=Ir({},["audio","video","img","source","image","track"]),gi=null,ho=Ir({},["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=Ir({},[ur,Zo,Bn],uK),bd=Ba(["mi","mo","mn","ms","mtext"]),xp=Ir({},bd),Nh=Ba(["annotation-xml"]),da=Ir({},Nh),Tp=Ir({},["title","style","font","a","script"]),ks=null,tc=["application/xhtml+xml","text/html"],Kb="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=Pf(ye),ks=tc.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Kb:ye.PARSER_MEDIA_TYPE,ri=ks==="application/xhtml+xml"?uK:UM,Re=Wy(ye,"ALLOWED_TAGS",Qe,{transform:ri}),He=Wy(ye,"ALLOWED_ATTR",Xe,{transform:ri}),Nr=Wy(ye,"ALLOWED_NAMESPACES",Wc,{transform:uK}),gi=Wy(ye,"ADD_URI_SAFE_ATTR",ho,{transform:ri,base:ho}),Ks=Wy(ye,"ADD_DATA_URI_TAGS",no,{transform:ri,base:no}),fo=Wy(ye,"FORBID_CONTENTS",Bs,{transform:ri}),Pe=Wy(ye,"FORBID_TAGS",Pf({}),{transform:ri}),qe=Wy(ye,"FORBID_ATTR",Pf({}),{transform:ri}),Mr=Lu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?Pf(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,hi=ye.RETURN_TRUSTED_TYPE||!1,bi=ye.FORCE_BODY||!1,xi=ye.SANITIZE_DOM!==!1,jn=ye.SANITIZE_NAMED_PROPS||!1,Wn=ye.KEEP_CONTENT!==!1,Zi=ye.IN_PLACE||!1,Se=d9e(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:mpe,qi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Bn,xp=pK(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ir({},bd)),da=pK(ye,"HTML_INTEGRATION_POINTS",()=>Ir({},Nh));let Fe=pK(ye,"CUSTOM_ELEMENT_HANDLING",()=>Fv(null));if($e=Fv(null),Lu(Fe,"tagNameCheck")&&Z0(Fe.tagNameCheck)&&($e.tagNameCheck=Fe.tagNameCheck),Lu(Fe,"attributeNameCheck")&&Z0(Fe.attributeNameCheck)&&($e.attributeNameCheck=Fe.attributeNameCheck),Lu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),lc($e),ft&&(Gt=!1),wi&&(Wi=!0),Mr&&(Re=Ir({},fpe),He=Fv(null),Mr.html===!0&&(Ir(Re,upe),Ir(He,dpe)),Mr.svg===!0&&(Ir(Re,fK),Ir(He,mK),Ir(He,C6)),Mr.svgFilters===!0&&(Ir(Re,dK),Ir(He,mK),Ir(He,C6)),Mr.mathMl===!0&&(Ir(Re,hK),Ir(He,hpe),Ir(He,C6))),st.tagCheck=null,st.attributeCheck=null,Lu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:Bv(ye.ADD_TAGS)&&(Re===Qe&&(Re=Pf(Re)),Ir(Re,ye.ADD_TAGS,ri))),Lu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:Bv(ye.ADD_ATTR)&&(He===Xe&&(He=Pf(He)),Ir(He,ye.ADD_ATTR,ri))),Lu(ye,"ADD_FORBID_CONTENTS")&&Bv(ye.ADD_FORBID_CONTENTS)&&(fo===Bs&&(fo=Pf(fo)),Ir(fo,ye.ADD_FORBID_CONTENTS,ri)),Wn&&(Re["#text"]=!0),rt&&Ir(Re,["html","head","body"]),Re.table&&(Ir(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vx('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=Ir({},[...fK,...dK,...h9e]),Cy=Ir({},[...hK,...m9e]),Sq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="svg":Fe.namespaceURI===ur?ye==="svg"&&(gt==="annotation-xml"||xp[gt]):!!Ep[ye]},wq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="math":Fe.namespaceURI===Zo?ye==="math"&&da[gt]:!!Cy[ye]},Iq=function(ye,Fe,gt){return Fe.namespaceURI===Zo&&!da[gt]||Fe.namespaceURI===ur&&!xp[gt]?!1:!Cy[ye]&&(Tp[ye]||!Ep[ye])},Pq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:qi,tagName:"template"});let gt=UM(ye.tagName),on=UM(Fe.tagName);return Nr[ye.namespaceURI]?ye.namespaceURI===Zo?Sq(gt,Fe,on):ye.namespaceURI===ur?wq(gt,Fe,on):ye.namespaceURI===Bn?Iq(gt,Fe,on):!!(ks==="application/xhtml+xml"&&Nr[ye.namespaceURI]):!1},Cp=function(ye){FM(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw Vx("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},QC=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},$b=function(ye){Jb(ye);let Fe=A(ye);if(Fe){let on=[];jx(Fe,In=>{FM(on,In)}),jx(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"&&QC(ye,In,oi)}},Lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}FM(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{}},Dq=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)]||QC(ye,on,In)}},Jb=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===If.element&&Dq(gt);let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},ev=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===If.processingInstruction||on===If.comment&&tl(gpe,gt.data)){try{m(gt)}catch{}continue}if(on===If.element){let oi=gt,So=ri(R(gt));try{oi.hasAttribute&&oi.hasAttribute("patchsrc")&&oi.removeAttribute("patchsrc"),oi.hasAttribute&&oi.hasAttribute("for")&&ev("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])}},Zb=function(ye){let Fe=null,gt=null;if(bi)ye="<remove></remove>"+ye;else{let oi=spe(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},nD=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)},tv=function(ye){return ye=BM(ye,J," "),ye=BM(ye,Z," "),ye=BM(ye,ae," "),ye},vy=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=tv(In.data),In=on.nextNode();let oi=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");oi&&jx(oi,So=>{ne(So.content)&&vy(So.content)})},ce=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)===If.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&&jx(Ct,gt=>{gt.call(t,ye,Fe,Kr)})}let Ze=function(ye,Fe){return!!(Xt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&tl(ppe,ye.textContent)&&tl(ppe,ye.innerHTML)||Xt&&ye.namespaceURI===Bn&&S9e[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&tl(w9e[Fe],ye.textContent))||ye.nodeType===If.processingInstruction||Xt&&ye.nodeType===If.comment&&tl(gpe,ye.data))},Et=function(ye,Fe){if(ye instanceof RegExp)return tl(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?Pf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Zi&&Jb(ye),!0)},qn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(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)===If.element&&!Pq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&tl(C9e,ye.innerHTML))return Cp(ye),!0;if(ft&&ye.nodeType===If.text){let In=tv(ye.textContent);ye.textContent!==In&&(FM(t.removed,{element:ye.cloneNode()}),ye.textContent=In)}return Ce(W.afterSanitizeElements,ye,null),!1},_n=function(ye,Fe,gt){if(qe[Fe]||ev(Fe,ye)||xi&&(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&&tl(Ae,Fe)||vt&&tl(fe,Fe)?!0:on?gi[Fe]||tl(Se,BM(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&ape(gt,"data:")===0&&Ks[ye]||lt&&!tl(xe,BM(gt,ge,""))?!0:!gt:mo(ye)&&Et($e.tagNameCheck,ye)&&Et($e.attributeNameCheck,Fe,ye)||Fe==="is"&&$e.allowCustomizedBuiltInElements&&Et($e.tagNameCheck,gt)},vo=Ir({},["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[UM(ye)]&&tl(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),ce(ye)?Cp(ye):ope(t.removed)}catch{Lh(Fe,ye)}},Ml=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(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,Su=oi.value,wu=ri(So),Rq=Su,Nl=So==="value"?Rq:s9e(Rq);if(gt.attrName=wu,gt.attrValue=Nl,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Nl=gt.attrValue,jn&&(wu==="id"||wu==="name")&&ape(Nl,nn)!==0&&(Lh(So,ye,oi),Nl=nn+Nl),Xt&&tl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nl)){Lh(So,ye,oi);continue}if(wu==="attributename"&&spe(Nl,"href")){Lh(So,ye,oi);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){Lh(So,ye,oi);continue}if(!mt&&tl(v9e,Nl)){Lh(So,ye,oi);continue}if(ft&&(Nl=tv(Nl)),!_n(In,wu,Nl)){Lh(So,ye,oi);continue}Nl=$s(In,wu,ds,Nl),Nl!==Rq&&Sc(ye,So,ds,Nl)}}Ce(W.afterSanitizeAttributes,ye,null)},vu=function(ye){let Fe=null,gt=nD(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),qn(Fe,ye),Ml(Fe),ne(Fe.content)&&vu(Fe.content),I(Fe)===If.element){let on=x(Fe);ne(on)&&(Q0(on),vu(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){vu(gt.shadow);continue}let on=gt.node,oi=I(on)===If.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 Su=on.content;ne(Su)&&Fe.push({node:Su,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=f9e(Ct),typeof Ct!="string"))throw Vx("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=Pf(Re)),W.uponSanitizeAttribute.length>0&&(He=Pf(He)),t.removed=[];let oi=Zi&&typeof Ct!="string"&&Te(Ct);if(oi){vp(Ct);let Su=R(Ct);if(typeof Su=="string"){let wu=ri(Su);if(!Re[wu]||Pe[wu])throw $b(Ct),Vx("root node is forbidden and cannot be sanitized in-place")}if(ce(Ct))throw $b(Ct),Vx("root node is clobbered and cannot be sanitized in-place");try{Q0(Ct)}catch(wu){throw $b(Ct),wu}}else if(Te(Ct))Fe=Zb("<!---->"),gt=Fe.ownerDocument.importNode(Ct,!0),gt.nodeType===If.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),Q0(gt);else{if(!Wi&&!ft&&!rt&&Ct.indexOf("<")===-1)return O&&hi?M(Ct):Ct;if(Fe=Zb(Ct),!Fe)return Wi?null:hi?L:""}Fe&&bi&&Cp(Fe.firstChild);let So=oi?Ct:Fe;try{let Su=nD(So);for(;on=Su.nextNode();)qn(on,So),Ml(on),ne(on.content)&&vu(on.content)}catch(Su){throw oi&&($b(Ct),jx(t.removed,wu=>{wu.element&&Jb(wu.element)})),Su}if(oi)return jx(t.removed,Su=>{Su.element&&Jb(Su.element)}),ft&&vy(Ct),Ct;if(Wi){if(ft&&vy(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&&tl(T9e,Fe.ownerDocument.doctype.name)&&(ds="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> +`+ds),ft&&(ds=tv(ds)),O&&hi?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"&&Lu(W,Ct)&&FM(W[Ct],ye)},t.removeHook=function(Ct,ye){if(Lu(W,Ct)){if(ye!==void 0){let Fe=r9e(W[Ct],ye);return Fe===-1?void 0:o9e(W[Ct],Fe,1)[0]}return ope(W[Ct])}},t.removeHooks=function(Ct){Lu(W,Ct)&&(W[Ct]=[])},t.removeAllHooks=function(){W=_pe()},t}var Tpe=xpe();var D9e=0,yK={},AK=class e{constructor(t,n){let i,r=t;l(yK[r])?i=yK[r]:(i=D9e++,yK[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=Tpe.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=AK;function R9e(e,t){_t(e,t)}var qr=R9e;function Hx(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(Hx.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}}});Hx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function bK(e){e._cubeMapBuffers=void 0}Hx.prototype.update=function(e){let{context:t}=e;if(!Hx.isSupported(t))return;if(l(this._texture)){bK(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(bK(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Ou(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(ts.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 ts({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};Hx.prototype.isDestroyed=function(){return!1};Hx.prototype.destroy=function(){return bK(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var nm=Hx;function zM(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(zM.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 O9e(e,t){if(nm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new nm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}zM.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&&(O9e(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)};zM.prototype.isDestroyed=function(){return!1};zM.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var Gx=zM;var TK=Qo(xf(),1);var xK,Epe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",v6={};v6.defaultAccessToken=Epe;v6.defaultServer=new De({url:"https://api.cesium.com/"});v6.getDefaultTokenCredit=function(e){if(e===Epe){if(!l(xK)){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>`;xK=new It(t,!0)}return xK}};var Fu=v6;function nl(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:M9e};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 TK.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=Fu.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 TK.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=EK(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??Fu.defaultServer,i=t.accessToken??Fu.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=EK(r.headers),n.getDerivedResource(r)};function EK(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}nl._addClientHeaders=EK;function M9e(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 Bp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Bp.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}}});Bp.prototype.get=function(e){return this._array[e]};Bp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Bp.prototype.peek=function(){return this._array[this._length-1]};Bp.prototype.push=function(e){let t=this.length++;this._array[t]=e};Bp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Bp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Bp.prototype.resize=function(e){this.length=e};Bp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Xl=Bp;function S6(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}S6.ALL=Object.freeze(new S6({color:new z(0,0,0,0),depth:1,stencil:0}));S6.prototype.execute=function(e,t){e.clear(this,t)};var ui=S6;var kp={X:0,Y:1,Z:2};kp.Y_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));kp.Z_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));kp.X_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));kp.Z_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));kp.X_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));kp.Y_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));kp.fromName=function(e){return kp[e]};Object.freeze(kp);var Hi=kp;function Md(e){this.planes=e??[]}var VM=[new h,new h,new h];h.clone(h.UNIT_X,VM[0]);h.clone(h.UNIT_Y,VM[1]);h.clone(h.UNIT_Z,VM[2]);var qy=new h,N9e=new h,Cpe=new sn(new h(1,0,0),0);function vpe(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Md.fromBoundingSphere=function(e,t){l(t)||(t=new Md);let n=VM.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=VM[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,qy),h.add(r,qy,qy),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,qy),h.multiplyByScalar(c,o,qy),h.add(r,qy,qy),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,N9e),qy),s+=2}return t};Md.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(vpe(t[i],Cpe));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};Md.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Md.MASK_OUTSIDE||t===Md.MASK_INSIDE)return t;let n=Md.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(vpe(i[r],Cpe));if(a===$t.OUTSIDE)return Md.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};Md.MASK_OUTSIDE=4294967295;Md.MASK_INSIDE=0;Md.MASK_INDETERMINATE=2147483647;var ta=Md;function Up(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 Spe(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(Up.prototype,{projectionMatrix:{get:function(){return Spe(this),this._orthographicMatrix}}});var L9e=new h,F9e=new h,B9e=new h,CK=new h;Up.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,L9e);h.normalize(f,f);let d=F9e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=B9e;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,CK),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,CK),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,CK),p),this._cullingVolume};Up.prototype.getPixelDimensions=function(e,t,n,i,r){Spe(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};Up.prototype.clone=function(e){return l(e)||(e=new Up),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};Up.prototype.equals=function(e){return l(e)&&e instanceof Up&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Up.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Up&&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 As=Up;function Bu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new As,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}Bu.packedLength=4;Bu.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};Bu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Bu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Yy(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(Bu.prototype,{projectionMatrix:{get:function(){return Yy(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Yy(this),this._offCenterFrustum}}});Bu.prototype.computeCullingVolume=function(e,t,n){return Yy(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Bu.prototype.getPixelDimensions=function(e,t,n,i,r){return Yy(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.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};Bu.prototype.equals=function(e){return!l(e)||!(e instanceof Bu)?!1:(Yy(this),Yy(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Bu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Bu)?!1:(Yy(this),Yy(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=Bu;function wpe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(wpe.prototype,{metadata:{get:function(){return this._metadata}}});var Wx=wpe;function Xy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Xy.decode(e)}Xy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Xy.decodeWithFromCharCode=function(e){let t="",n=k9e(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 jM(e,t,n){return t<=e&&e<=n}function k9e(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(jM(u,0,127)){s.push(u);continue}if(jM(u,194,223)){i=1,t=u&31;continue}if(jM(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(jM(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!jM(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"?Xy.decode=Xy.decodeWithTextDecoder:Xy.decode=Xy.decodeWithFromCharCode;var ku=Xy;function U9e(e,t){return t=t??0,ku(e,t,Math.min(4,e.length))}var im=U9e;var vK=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+=HM;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=HM,o+=HM;let f=c.getUint32(o,!0);o+=HM;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=im(a,o),b=c.getUint32(o+HM*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 le(this)}},HM=Uint32Array.BYTES_PER_ELEMENT,GM=vK;function z9e(e,t,n){return JSON.parse(ku(e,t,n))}var Ro=z9e;function il(e){this._id=$n();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(il.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}}});il.DEFAULT_COLOR_VALUE=z.WHITE;il.DEFAULT_SHOW_VALUE=!0;function Ipe(e){let t=e._textureDimensions;return t.x*t.y*4}function Ppe(e){if(!l(e._batchValues)){let t=Ipe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Dpe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}il.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Dpe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=Ppe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};il.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};il.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var V9e=new Array(4);il.prototype.setColor=function(e,t){if(z.equals(t,il.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(V9e),i=n[3],r=Ppe(this),o=e*4,s=Dpe(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)}};il.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};il.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(il.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)};il.prototype.getPickColor=function(e){return this._pickIds[e]};function Rpe(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:Ht.NEAREST})}function j9e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=Ipe(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=Rpe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function H9e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}il.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&j9e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Rpe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),H9e(this))};il.prototype.isDestroyed=function(){return!1};il.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 le(this)};var Kl=il;var G9e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W9e={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:Xi,MAT3:$,MAT4:N};function q9e(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=G9e[e.type],r=W9e[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Nd=q9e;function Sg(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,Y9e(this,e.extension,e.binaryBody)}Object.defineProperties(Sg.prototype,{byteLength:{get:function(){return this._byteLength}}});function Y9e(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=Nd(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=Nd(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=Nd(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=rm.getBinaryProperties(b,x,n);p+=X9e(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 X9e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var K9e=[],$9e=[],J9e=0;function Z9e(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=K9e;c.length=Math.max(c.length,a);let u=++J9e,f=$9e;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 Q9e(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 WM(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return Z9e(e,t,n)}else return n(e,t);return Q9e(e,t,n)}Sg.prototype.hasProperty=function(e,t){let n=WM(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Sg.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};Sg.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,WM(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};Sg.prototype.getProperty=function(e,t){return WM(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)?e7e(a,s):Je(a[s],!0)})};function e7e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Sg.prototype.setProperty=function(e,t,n){let i=WM(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)?t7e(u,c,n):u[c]=Je(n,!0),!0});return l(i)};function t7e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Sg.prototype.isClass=function(e,t){let n=WM(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Sg.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var qx=Sg;var Ope={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(Ope);var Uu=Ope;function n7e(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 ti=n7e;var SK=Kl.DEFAULT_COLOR_VALUE,wK=Kl.DEFAULT_SHOW_VALUE;function Yr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=i7e(n);this._properties=s,this._batchTableHierarchy=r7e(this,n,i);let a=Npe(t,s,i);this._binaryPropertiesByteLength=o7e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Kl({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Yr._deprecationWarning=qr;Object.defineProperties(Yr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function i7e(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 r7e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Yr._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 qx({extension:i,binaryBody:n})}function Npe(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=Nd(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 o7e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Yr.getBinaryProperties=function(e,t,n){return Npe(e,t,n)};Yr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Yr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Yr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Yr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Yr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Yr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Yr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var s7e=new z;Yr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(SK),this.setAllShow(wK);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,s7e)??SK:SK,s=l(e.show)?e.show.evaluate(r)??wK:wK;this.setColor(i,o),this.setShow(i,s)}};function a7e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function c7e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Yr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Yr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Yr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Yr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Yr.prototype.hasPropertyBySemantic=function(){return!1};Yr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(ti(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);ti(t,i)}return t};Yr.prototype.getPropertyBySemantic=function(e,t){};Yr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return a7e(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}};Yr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){c7e(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 l7e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}Yr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=Lpe(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; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${o} +${l7e(i)}${s}`}};function Mpe(e,t){return e=Ye.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function u7e(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 Lpe(e,t,n){if(!l(t))return Mpe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return Mpe(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))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,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=u7e(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${o} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}Yr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Lpe(i,t,!0),Ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};function f7e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Uu.HIGHLIGHT)return 0;if(n===Uu.REPLACE)return 1;if(n===Uu.MIX)return D.clamp(i,D.EPSILON4,1)}Yr.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 f7e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Yr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Ky={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Yr.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=d7e(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=h7e(f),f.dirty=!1);let p=d.originalCommand;c!==Ky.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=m7e(p))),c!==Ky.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=p7e(p)),a&&(o||(l(d.zback)||(d.zback=_7e(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==A7e(d.stencil))&&(f.renderState.depthMask?d.stencil=y7e(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===Ky.ALL_OPAQUE&&(n[u]=g),c===Ky.ALL_TRANSLUCENT&&(n[u]=m),c===Ky.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function d7e(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Ky.ALL_OPAQUE:t===e.featuresLength?Ky.ALL_TRANSLUCENT:Ky.OPAQUE_AND_TRANSLUCENT}function h7e(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 m7e(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=b7e(e.renderState),t}function p7e(e){let t=at.shallowClone(e);return t.renderState=x7e(e.renderState),t}function g7e(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 _7e(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=g7e(e,t.shaderProgram),n}function y7e(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=ei.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ei.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 A7e(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function b7e(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 x7e(e){let t=Je(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Yr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Yr.prototype.isDestroyed=function(){return!1};Yr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var rm=Yr;function T7e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var zp=T7e;var kv=`in vec3 position; +in float a_batchId; +uniform mat4 u_modifiedModelViewProjection; +void main() { -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; +gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; +`;var IK=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)}},na=IK;var PK=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)})}},DK=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)})}},zu=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)}}},E7e=new PK;Object.assign(zu,{hooks:E7e,plugins:new DK(zu),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"});zu.max_unop_len=zu.getMaxKeyLen(zu.unary_ops);zu.max_binop_len=zu.getMaxKeyLen(zu.binary_ops);var $y=e=>new zu(e).parse(),C7e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(zu).filter(e=>!C7e.includes(e)&&$y[e]===void 0).forEach(e=>{$y[e]=zu[e]});$y.Jsep=zu;var v7e="ConditionalExpression",S7e={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:v7e,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 :")}})}};$y.plugins.register(S7e);var Fpe={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(Fpe);var Mt=Fpe;function om(e,t){this._expression=e,e=U7e(e,t),e=V7e(z7e(e)),$y.addBinaryOp("=~",0),$y.addBinaryOp("!~",0);let n;try{n=$y(e)}catch(i){throw new oe(i)}this._runtimeAst=Ki(this,n)}Object.defineProperties(om.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++]}};om.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};om.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};om.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} +{ + return ${r}; } -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 bM=`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 xM=`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 zv=`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 TM=`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 EM=`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 CM=`#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)); -} -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); -} -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 = u_ellipsoidRadii.x * inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; -} -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; -} -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; -} -} -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); -} -float tmin = intersect.x; -float tmax = intersect.y; -vec3 p0 = ray.pos + tmin * ray.dir; -vec3 p1 = ray.pos + tmax * ray.dir; -vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); -vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); -bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); -bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); -if (p0InShadowCone && p1InShadowCone) { -return RayShapeIntersection(miss, miss); -} else if (p0InShadowCone) { -return RayShapeIntersection(intersect1, farSide); -} else if (p1InShadowCone) { -return RayShapeIntersection(-1.0 * farSide, intersect0); -} else { -return RayShapeIntersection(intersect0, intersect1); -} -} -void intersectShape(in Ray ray, 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 -#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 wx=`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; -} -} -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; -} -`;var vM=`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); -} -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 SM=`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); -} -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); -} -#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 wM=`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; -} -return vec3(v * sign(pos), length(v - evolute)); -} -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); -} -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); -} -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 IM=`#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 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); -} -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { -return float(normU8x2_toInt(value)) / 65535.0; -} -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { -vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); -OctreeNodeData data; -data.data = normU8x2_toInt(texData.xy); -data.flag = normU8x2_toInt(texData.zw); -return data; -} -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { -int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; -int octreeCoordX = (parentOctreeIndex % u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; -int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; -vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); -return getOctreeNodeData(octreeUv); -} -int getOctreeParentIndex(in int octreeIndex) { -int octreeCoordX = (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 -#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); -} -#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; -} -traversalData.parentOctreeIndex = childData.data; -} -return childData; -} -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 -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(tileAndUv, sampleDatas[0]); -addSampleCoordinates(tileAndUv, sampleDatas[1]); -#endif -} -bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { -int levelDifference = tileCoordinate.w - octreeCoords.w; -if (levelDifference < 0) { -return false; -} -ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; -return coordinateAtLevel == octreeCoords.xyz; -} -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]); -} -return; -} -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); -} -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 -} -`;var PM=`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); -} -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 qme={Z_UP:0,Y_UP:1};Object.freeze(qme);var Vp=qme;function jGe(e){let t=new Cg;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([yM]),e.provider.metadataOrder===Vp.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",IM,gM,PM,AM,xM,bM]),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([vM,TM,wx]):u==="CYLINDER"?t.addFragmentLines([SM,zv,EM,wx]):u==="ELLIPSOID"&&t.addFragmentLines([wM,zv,CM,wx]),t.addFragmentLines([_M]);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 DM=jGe;var Yme=new U;function HGe(e,t){let n=new DM(e);hM(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=Ts.getTextureResolution(r,t,Yme),S=Xme(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=Eg.getTextureResolution(s,t,Yme),S=Xme(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:Ui.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 Xme(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 RM=HGe;var tr=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-tr.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?tr.Bounce.In(e*2)*.5:tr.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}}}}),OM=function(){return performance.now()},GGe=(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=OM()),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})(),Vv={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=Vv.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=Vv.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=Vv.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=Vv.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}}},Kme=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),OK=new GGe,$me=(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=tr.Linear.None,this._interpolationFunction=Vv.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Kme.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=OK,OK.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=OM()),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=OM()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=OM()),!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=tr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Vv.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=OM()),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 pgn=Kme.nextId,jp=OK,ggn=jp.getAll.bind(jp),_gn=jp.removeAll.bind(jp),ygn=jp.add.bind(jp),Agn=jp.remove.bind(jp),bgn=jp.update.bind(jp);var WGe={LINEAR_NONE:tr.Linear.None,QUADRATIC_IN:tr.Quadratic.In,QUADRATIC_OUT:tr.Quadratic.Out,QUADRATIC_IN_OUT:tr.Quadratic.InOut,CUBIC_IN:tr.Cubic.In,CUBIC_OUT:tr.Cubic.Out,CUBIC_IN_OUT:tr.Cubic.InOut,QUARTIC_IN:tr.Quartic.In,QUARTIC_OUT:tr.Quartic.Out,QUARTIC_IN_OUT:tr.Quartic.InOut,QUINTIC_IN:tr.Quintic.In,QUINTIC_OUT:tr.Quintic.Out,QUINTIC_IN_OUT:tr.Quintic.InOut,SINUSOIDAL_IN:tr.Sinusoidal.In,SINUSOIDAL_OUT:tr.Sinusoidal.Out,SINUSOIDAL_IN_OUT:tr.Sinusoidal.InOut,EXPONENTIAL_IN:tr.Exponential.In,EXPONENTIAL_OUT:tr.Exponential.Out,EXPONENTIAL_IN_OUT:tr.Exponential.InOut,CIRCULAR_IN:tr.Circular.In,CIRCULAR_OUT:tr.Circular.Out,CIRCULAR_IN_OUT:tr.Circular.InOut,ELASTIC_IN:tr.Elastic.In,ELASTIC_OUT:tr.Elastic.Out,ELASTIC_IN_OUT:tr.Elastic.InOut,BACK_IN:tr.Back.In,BACK_OUT:tr.Back.Out,BACK_IN_OUT:tr.Back.InOut,BOUNCE_IN:tr.Bounce.In,BOUNCE_OUT:tr.Bounce.Out,BOUNCE_IN_OUT:tr.Bounce.InOut},Es=Object.freeze(WGe);function qGe(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 YGe(e,t){return e*t*(4+e*(4-3*t))/16}function Jme(e,t,n,i,r,o,s){let a=YGe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function XGe(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+Jme(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 KGe=new h,MK=new h;function Zme(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,MK),KGe),o=h.normalize(i.cartographicToCartesian(n,MK),MK);XGe(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,qGe(e)}function MM(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)&&Zme(this,e,t,i)}Object.defineProperties(MM.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}}});MM.prototype.setEndPoints=function(e,t){Zme(this,e,t,this._ellipsoid)};MM.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};MM.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)-Jme(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 vg=MM;var NK;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?NK=function(){return performance.now()}:NK=function(){return Date.now()};var xn=NK;function LK(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}LK.clone=function(e,t){if(l(e))return l(t)||(t=new LK),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Nd=LK;var FK={};FK.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Qme(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}FK.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=Qme(r,-o,D.EPSILON14);if(s<0)return[];let a=-.5*Qme(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var ql=FK;var kK={};kK.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 BK(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]}kK.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return ql.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=ql.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return BK(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):BK(e,t,0,i);if(i===0)return r=ql.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 BK(e,t,n,i)};var Ix=kK;var UK={};UK.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 Zh(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=Ix.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=ql.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=ql.computeRealRoots(1,d,p),y=ql.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 NM(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=Ix.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=ql.computeRealRoots(1,S,R),_=ql.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[]}UK.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return Ix.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 Zh(o,s,a,c);case 1:return NM(o,s,a,c);case 2:return NM(o,s,a,c);case 3:return Zh(o,s,a,c);case 4:return Zh(o,s,a,c);case 5:return NM(o,s,a,c);case 6:return Zh(o,s,a,c);case 7:return Zh(o,s,a,c);case 8:return NM(o,s,a,c);case 9:return Zh(o,s,a,c);case 10:return Zh(o,s,a,c);case 11:return NM(o,s,a,c);case 12:return Zh(o,s,a,c);case 13:return Zh(o,s,a,c);case 14:return Zh(o,s,a,c);case 15:return Zh(o,s,a,c);default:return}};var LM=UK;var zK=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=zK;var ro={};ro.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 $Ge=new h,JGe=new h,ape=new h,epe=new h,tpe=new h;ro.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,$Ge),c=h.subtract(i,t,JGe),u=h.cross(s,c,ape),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<D.EPSILON6||(d=h.subtract(o,t,epe),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,tpe),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,epe),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,tpe),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};ro.rayTriangle=function(e,t,n,i,r,o){let s=ro.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 ZGe=new pn;ro.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=ZGe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=ro.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 QGe(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 e5e={root0:0,root1:0};function cpe(e,t,n){l(n)||(n=new zs);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,ape),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=QGe(c,u,f,e5e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}ro.raySphere=function(e,t,n){if(n=cpe(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var t5e=new pn;ro.lineSegmentSphere=function(e,t,n,i){let r=t5e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=cpe(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 n5e=new h,i5e=new h;ro.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,n5e),r=h.multiplyComponents(n,e.direction,i5e),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 zs(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new zs(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 zs(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new zs(0,-s/c)};var r5e=new zs,o5e=new zs,s5e=new zs;ro.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new zs);let i=VK(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,r5e),r=VK(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,o5e),o=VK(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,s5e);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 VK(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 Px(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}ro.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*Px(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*Px(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*Px(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=ql.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=LM.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=Px(a*L+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?w=Px(a*L,c*O+u,D.EPSILON12):w=Px(a*L+c*O,u,D.EPSILON12);let P=Px(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 jK=new h,npe=new h,ipe=new h,P6=new h,a5e=new h,c5e=new $,l5e=new $,u5e=new $,f5e=new $,d5e=new $,rpe=new $,ope=new $,spe=new h,h5e=new h,m5e=new he;ro.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,jK);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,jK),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,P6),c=h.normalize(h.cross(a,s,npe),npe),u=h.normalize(h.cross(s,c,ipe),ipe),f=c5e;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,l5e),p=$.fromScale(t.radii,u5e),g=$.fromScale(t.oneOverRadii,f5e),m=d5e;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,rpe),m,rpe),A=$.multiply($.multiply(y,p,ope),f,ope),b=$.multiplyByVector(y,n,a5e),x=ro.quadraticVectorExpression(A,h.negate(b,jK),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,h5e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],spe),spe);let L=h.normalize(h.subtract(T,n,P6),P6),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,m5e);return I=D.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,P6))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var p5e=new h;ro.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,p5e),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};ro.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 ro.lineSegmentPlane(e,t,i,f),ro.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return ro.lineSegmentPlane(t,n,i,f),ro.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return ro.lineSegmentPlane(n,e,i,f),ro.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 ro.lineSegmentPlane(e,n,i,f),ro.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return ro.lineSegmentPlane(n,t,i,f),ro.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return ro.lineSegmentPlane(t,e,i,f),ro.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var yi=ro;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 ea,this._perspectiveMatrix=new N,this._infinitePerspective=new N}function HK(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(Hp.prototype,{projectionMatrix:{get:function(){return HK(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return HK(this),this._infinitePerspective}}});var g5e=new h,_5e=new h,y5e=new h,A5e=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,g5e),d=_5e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=y5e;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=A5e;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){HK(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&&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 Yl=Hp;function Uu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Yl,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}Uu.packedLength=6;Uu.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};Uu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Uu),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 Qh(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(Uu.prototype,{projectionMatrix:{get:function(){return Qh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Qh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Qh(this),this._fovy}},sseDenominator:{get:function(){return Qh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Qh(this),this._offCenterFrustum}}});Uu.prototype.computeCullingVolume=function(e,t,n){return Qh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Uu.prototype.getPixelDimensions=function(e,t,n,i,r){return Qh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Uu.prototype.clone=function(e){return l(e)||(e=new Uu),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};Uu.prototype.equals=function(e){return!l(e)||!(e instanceof Uu)?!1:(Qh(this),Qh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Uu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Uu)?!1:(Qh(this),Qh(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=Uu;var dpe={};function b5e(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 Yl)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var x5e=new h,lpe=new h;function hpe(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 WK(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,x5e),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),lpe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),lpe));o=Math.min(b5e(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 FM(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 mpe=new h;function T5e(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,mpe),f=c.pitch,d=FM(c.heading,i),p=FM(c.roll,o),g=WK(c,n,u.z,n.z,s),m=hpe(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 E5e(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function C5e(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 v5e=new he,S5e=new he;function w5e(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,v5e),m=f.pitch,y=FM(f.heading,i),A=FM(f.roll,o),b=p.cartesianToCartographic(n,S5e);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?E5e(g,b):C5e(g,b);let T=WK(f,n,g.height,b.height,s),E=hpe(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 I5e(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,mpe),u=FM(a.heading,i),f=a.frustum.right-a.frustum.left,d=WK(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 upe=new he,P5e=new h;function GK(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function fpe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}dpe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return GK();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,upe),n=o.project(upe,P5e));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=fpe(x,t.complete),E=fpe(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 GK(T,E);let I=new Array(4);if(I[re.SCENE2D]=I5e,I[re.SCENE3D]=w5e,I[re.COLUMBUS_VIEW]=T5e,m<=0)return GK(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=Es.CUBIC_OUT:d=Es.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var BM=dpe;var ppe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(ppe);var Xl=ppe;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,Spe(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,kpe(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 Nd(0,-D.PI_OVER_FOUR,0);function Spe(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 D5e(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(D5e(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 R5e(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var O5e=new he,M5e=new h,D6=new h,N5e=new se,L5e=new se,F5e=new se,B5e=new se,k5e=new se;function U5e(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,N5e),r=n.cartesianToCartographic(i,O5e),o=t.project(r,M5e),s=L5e;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,k5e),c=se.add(N.getColumn(e._transform,0,D6),i,D6);n.cartesianToCartographic(c,r),t.project(r,o);let u=F5e;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=B5e;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(a,u,f);else{let d=se.add(N.getColumn(e._transform,1,D6),i,D6);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 qK=new h;function cl(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?R5e(e):U5e(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=qK;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,qK));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,qK);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)&&Spe(e)}function wpe(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 Ipe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function Ppe(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 M6=new N,N6=new N;Object.defineProperties(an.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!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,M6),n=At.eastNorthUpToFixedFrame(this.positionWC,e,N6);this._setTransform(n);let i=wpe(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,M6),n=At.eastNorthUpToFixedFrame(this.positionWC,e,N6);this._setTransform(n);let i=Ipe(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,M6),n=At.eastNorthUpToFixedFrame(this.positionWC,e,N6);this._setTransform(n);let i=Ppe(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&&Mpe(this,this.position)};var z5e=new h,V5e=new h,j5e=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,z5e),n=h.clone(this.upWC,V5e),i=h.clone(this.directionWC,j5e);N.clone(e,this._transform),this._transformChanged=!0,cl(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),cl(this)};var H5e=new U,G5e=new pn,W5e=new h,q5e=new h;function Dpe(e){if(!N.equals(N.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=H5e;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,G5e);r=n.pickWorldCoordinates(a,t,!0,W5e)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,q5e));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 mn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Dpe(this)))};var L6=new h,JK=new N,Y5e=new N,ZK=new Le,QK=new $,Rpe=new he;function X5e(e,t,n){let i=N.clone(e.transform,JK),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Y5e);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,ZK),s=$.fromQuaternion(o,QK);$.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 K5e(e,t,n,i){let r=N.clone(e.transform,JK);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Rpe);t=a.project(c,L6)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,ZK),s=$.fromQuaternion(o,QK);$.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 $5e(e,t,n,i){let r=N.clone(e.transform,JK);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Rpe);t=c.project(u,L6)}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===Xl.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,ZK),s=$.fromQuaternion(o,QK);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var J5e=new h,Z5e=new h,Q5e=new h;function Ope(e,t,n,i){let r=h.clone(n.direction,J5e),o=h.clone(n.up,Z5e);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,M6),u=N.inverseTransformation(c,N6);N.multiplyByPointAsVector(u,r,r),N.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,Q5e);return i.heading=wpe(r,o),i.pitch=Ipe(r),i.roll=Ppe(r,o,s),i}var $K={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},jv=new Ic;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,L6);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,L6),i=!1),l(t.direction)&&(t=Ope(this,r,t,$K.orientation)),jv.heading=t.heading??0,jv.pitch=t.pitch??-D.PI_OVER_TWO,jv.roll=t.roll??0,n===re.SCENE3D?X5e(this,r,jv):n===re.SCENE2D?$5e(this,r,jv,i):K5e(this,r,jv,i)};var e9e=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,e9e).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),cl(this),N.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),cl(this),N.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),cl(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),cl(this),N.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),cl(this),N.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),cl(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function Mpe(e,t){let n=e._scene.mapMode2D===Xl.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 gpe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,gpe),h.add(n,gpe,n),this._mode===re.SCENE2D&&Mpe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?F6(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?F6(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 t9e=new Le,n9e=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,t9e),r=$.fromQuaternion(i,n9e),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 i9e=new Le,r9e=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,i9e),r=$.fromQuaternion(i,r9e);$.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,Npe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,Npe(this,-e)};var o9e=new h,s9e=new h,a9e=new h,_pe=new h;function Npe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,o9e),r=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,_pe),D.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,s9e),a=h.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=h.dot(i,h.negate(s,_pe)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(s,i,a9e);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,Lpe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,Lpe(this,e)};function Lpe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function F6(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===Xl.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===Xl.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 Fpe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?F6(this,e):Fpe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?F6(this,-e):Fpe(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 c9e=new N;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,c9e);this.lookAtTransform(r,t)};var l9e=new h,u9e=new Le,f9e=new Le,d9e=new $;function Bpe(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,u9e),o=Le.fromAxisAngle(h.UNIT_Z,-e,f9e),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,d9e),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=Bpe(t.heading,t.pitch,t.range,l9e):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 h9e=new N,ype=new h,m9e=new h,Ape=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=N.clone(this._transform,h9e);this._setTransform(N.IDENTITY);let i=h.subtract(e,this.positionWC,ype);h.magnitudeSquared(i)<D.EPSILON8&&(i=h.clone(this.directionWC,ype)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,m9e),o=h.cross(i,r,Ape);h.magnitudeSquared(o)<D.EPSILON8&&(o=h.clone(this.rightWC,Ape)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var kM=new he,p9e=new he,g9e=new h,_9e=new h,y9e=new h,A9e=new h,b9e=new h,x9e=new h,T9e=new h,YK=new h,E9e={direction:new h,right:new h,up:new h},bpe;function al(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function kpe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:E9e,{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=kM;O.longitude=f,O.latitude=s,O.height=0;let L=p9e;L.longitude=f,L.latitude=a,L.height=0;let _=bpe;(!l(_)||_.ellipsoid!==r)&&(bpe=_=new vg(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,kM).latitude}let p=kM;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,T9e),m=kM;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,g9e);m.longitude=c;let A=r.cartographicToCartesian(m,y9e);m.longitude=f;let b=r.cartographicToCartesian(m,b9e);m.latitude=a;let x=r.cartographicToCartesian(m,x9e);m.longitude=u;let T=r.cartographicToCartesian(m,A9e);m.longitude=c;let E=r.cartographicToCartesian(m,_9e);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 mn){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(al(v,I,A,O),al(v,I,T,O),al(v,I,y,O),al(v,I,E,O),al(v,I,b,O),al(v,I,x,O),al(v,S,A,L),al(v,S,T,L),al(v,S,y,L),al(v,S,E,L),al(v,S,b,L),al(v,S,x,L)),a<0&&s>0){let _=kM;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,YK);h.subtract(C,g,C),R=Math.max(R,al(v,I,C,O),al(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,YK),h.subtract(C,g,C),R=Math.max(R,al(v,I,C,O),al(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,YK),n)}var C9e=new he,v9e=new h,S9e=new h;function w9e(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=C9e;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,v9e);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,S9e);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 I9e=new he,P9e=new h,D9e=new h;function R9e(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Xl.INFINITE_SCROLL?r+=D.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=I9e;o.longitude=r,o.latitude=t.north;let s=i.project(o,P9e);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,D9e),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 kpe(this,e,t);if(n===re.COLUMBUS_VIEW)return w9e(this,e,t);if(n===re.SCENE2D)return R9e(this,e,t)};var O9e=new pn;function M9e(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,O9e),o=yi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return pn.getPoint(r,s,i)}var N9e=new pn;function L9e(e,t,n,i){let o=e.getPickRay(t,N9e).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 F9e=new pn;function B9e(e,t,n,i){let r=e.getPickRay(t,F9e),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=M9e(this,e,t,n);else if(this._mode===re.SCENE2D)n=L9e(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=B9e(this,e,this._projection,n);else return;return n}};var k9e=new h,U9e=new h,z9e=new h;function V9e(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,k9e);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,U9e),m=h.multiplyByScalar(e.upWC,f*c*s,z9e),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var R6=new h;function j9e(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,R6),h.add(R6,f,f),h.multiplyByScalar(e.upWC,u,R6),h.add(R6,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===Xl.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)?V9e(this,e,t):j9e(this,e,t)};var H9e=new h,G9e=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,H9e),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),G9e);return Math.max(0,h.magnitude(n)-e.radius)};var W9e=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,W9e);return Math.max(r.x,r.y)};function q9e(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:Es.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var Y9e=new h,xpe=new h,X9e=new h,K9e=new h;function $9e(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,Y9e),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,xpe),xpe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,X9e);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,K9e)),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 q9e(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return $9e(this,e)};var J9e=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,J9e));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=Ope(this,t,r,$K.orientation)),l(e.duration)&&e.duration<=0){let f=$K;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=BM.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 Z9e(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function Q9e(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 e7e=100;function Upe(e,t,n){n=Nd.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=e7e:e.frustum instanceof mn||e._mode===re.SCENE2D?n.range=Q9e(e,s):n.range=Z9e(e,s),n.range=D.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=Upe(this,e,t),this.lookAt(e.center,t)};var t7e=new N,Tpe=new h,n7e=new h,i7e=new h,r7e=new h,o7e=new se,s7e=new Le,a7e=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=Upe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,Tpe):r=Bpe(i.heading,i.pitch,i.range,Tpe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,t7e);N.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,n7e),h.normalize(c,c),u=N.multiplyByPointAsVector(a,h.UNIT_Z,i7e),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,s7e),p=$.fromQuaternion(d,a7e);h.fromCartesian4(N.getColumn(a,1,o7e),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,r7e);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 Epe=new h,Cpe=new h,XK=new h,vpe=new h,UM=[new h,new h,new h,new h];function c7e(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,Epe),o=h.magnitude(r),s=h.normalize(r,Cpe),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,XK),XK),c=h.normalize(h.cross(s,a,vpe),vpe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,Epe),d=u/o,p=h.multiplyByScalar(a,d,Cpe),g=h.multiplyByScalar(c,d,XK),m=h.add(f,g,UM[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,UM[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,UM[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,UM[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),UM}var KK=new U,l7e=new h,Ky=[new he,new he,new he,new he];function O6(e,t,n,i,r,o){KK.x=e,KK.y=t;let s=i.pickEllipsoid(KK,r,l7e);return l(s)?(Ky[n]=r.cartesianToCartographic(s,Ky[n]),1):(Ky[n]=r.cartesianToCartographic(o[n],Ky[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 ue(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=c7e(this,e);if(c+=O6(0,0,0,this,e,u),c+=O6(0,a,1,this,e,u),c+=O6(s,a,2,this,e,u),c+=O6(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(Ky,t);let f=0,d=Ky[3].longitude;for(let p=0;p<4;++p){let g=Ky[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,Ky[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 mn)return;let e=Dpe(this),t=this._scene;this.frustum=new mn,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 Pr=an;var zpe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(zpe);var Zr=zpe;var e$=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=e$;var Vpe={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(Vpe);var ln=Vpe;function $y(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 s$(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function Dx(e){let t=[];if(e.shiftKey&&t.push(Zr.SHIFT),e.ctrlKey&&t.push(Zr.CTRL),e.altKey&&t.push(Zr.ALT),t.length)return t}var Cs={LEFT:0,MIDDLE:1,RIGHT:2};function Mf(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 u7e(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(Mf(e,"pointerdown",t,g7e),Mf(e,"pointerup",t,Jpe),Mf(e,"pointermove",t,_7e),Mf(e,"pointercancel",t,Jpe)):(Mf(e,"mousedown",t,Zpe),Mf(e,"mouseup",n,Qpe),Mf(e,"mousemove",n,e0e),Mf(e,"touchstart",t,m7e),Mf(e,"touchend",n,qpe),Mf(e,"touchmove",n,p7e),Mf(e,"touchcancel",n,qpe)),Mf(e,"dblclick",t,d7e);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Mf(e,i,t,h7e)}function f7e(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var jpe={position:new U};function a$(e){e._lastSeenTouchEvent=xn()}function c$(e){return xn()-e._lastSeenTouchEvent>em.mouseEmulationIgnoreMilliseconds}function o$(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function Zpe(e,t){if(!c$(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Cs.LEFT)i=ln.LEFT_DOWN;else if(n===Cs.MIDDLE)i=ln.MIDDLE_DOWN;else if(n===Cs.RIGHT)i=ln.RIGHT_DOWN;else return;let r=$y(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=Dx(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,jpe.position),s(jpe),t.preventDefault())}var Hpe={position:new U},Gpe={position:new U};function t$(e,t,n,i){let r=Dx(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=$y(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,Hpe.position),o(Hpe)),l(s)){let c=e._primaryStartPosition;o$(c,a,e._clickPixelTolerance)&&(U.clone(a,Gpe.position),s(Gpe))}}}function Qpe(e,t){if(!c$(e))return;let n=t.button;n!==Cs.LEFT&&n!==Cs.MIDDLE&&n!==Cs.RIGHT||(e._buttonDown[Cs.LEFT]&&(t$(e,ln.LEFT_UP,ln.LEFT_CLICK,t),e._buttonDown[Cs.LEFT]=!1),e._buttonDown[Cs.MIDDLE]&&(t$(e,ln.MIDDLE_UP,ln.MIDDLE_CLICK,t),e._buttonDown[Cs.MIDDLE]=!1),e._buttonDown[Cs.RIGHT]&&(t$(e,ln.RIGHT_UP,ln.RIGHT_CLICK,t),e._buttonDown[Cs.RIGHT]=!1))}var n$={startPosition:new U,endPosition:new U};function e0e(e,t){if(!c$(e))return;let n=Dx(t),i=$y(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(ln.MOUSE_MOVE,n);l(o)&&(U.clone(r,n$.startPosition),U.clone(i,n$.endPosition),o(n$)),U.clone(i,r),(e._buttonDown[Cs.LEFT]||e._buttonDown[Cs.MIDDLE]||e._buttonDown[Cs.RIGHT])&&t.preventDefault()}var Wpe={position:new U};function d7e(e,t){let n=t.button,i;if(n===Cs.LEFT)i=ln.LEFT_DOUBLE_CLICK;else return;let r=Dx(t),o=e.getInputAction(i,r);l(o)&&($y(e,t,Wpe.position),o(Wpe))}function h7e(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=Dx(t),r=e.getInputAction(ln.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function m7e(e,t){a$(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,$y(e,o,new U));B6(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 qpe(e,t){a$(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);B6(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var Ype={position:new U},i$={position1:new U,position2:new U},Xpe={position:new U},Kpe={position:new U},$pe={position:new U};function B6(e,t){let n=Dx(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[Cs.LEFT]){if(e._buttonDown[Cs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(ln.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,Xpe.position),o(Xpe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(ln.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];o$(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,Kpe.position),s(Kpe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(ln.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[Cs.LEFT]=!0,o=e.getInputAction(ln.LEFT_DOWN,n),l(o)&&(U.clone(c,Ype.position),o(Ype)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(ln.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];o$(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,$pe.position),s($pe))}},em.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(ln.PINCH_START,n),l(o)&&(U.clone(i.values[0],i$.position1),U.clone(i.values[1],i$.position2),o(i$),t.preventDefault()))}function p7e(e,t){a$(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)&&$y(e,o,u)}t0e(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 r$={startPosition:new U,endPosition:new U},zM={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function t0e(e,t){let n=Dx(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[Cs.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(ln.MOUSE_MOVE,n),l(s)&&(U.clone(c,r$.startPosition),U.clone(a,r$.endPosition),s(r$)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(ln.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,zM.distance.startPosition),U.fromElements(0,g,zM.distance.endPosition),U.fromElements(E,x,zM.angleAndHeight.startPosition),U.fromElements(T,b,zM.angleAndHeight.endPosition),s(zM)}}function g7e(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,$y(e,t,new U)),B6(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else Zpe(e,t)}function Jpe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),B6(e,t),e._previousPositions.remove(i)}else Qpe(e,t)}function _7e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;$y(e,t,r),t0e(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else e0e(e,t)}function em(e){this._inputEvents={},this._buttonDown={[Cs.LEFT]:!1,[Cs.MIDDLE]:!1,[Cs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-em.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,u7e(this)}em.prototype.setInputAction=function(e,t,n){let i=s$(t,n);this._inputEvents[i]=e};em.prototype.getInputAction=function(e,t){let n=s$(e,t);return this._inputEvents[n]};em.prototype.removeInputAction=function(e,t){let n=s$(e,t);delete this._inputEvents[n]};em.prototype.isDestroyed=function(){return!1};em.prototype.destroy=function(){return f7e(this),le(this)};em.mouseEmulationIgnoreMilliseconds=800;em.touchHoldDelayMilliseconds=1500;var ia=em;var n0e={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(n0e);var nr=n0e;var a0e=[Zr.SHIFT,Zr.CTRL,Zr.ALT,[Zr.SHIFT,Zr.CTRL],[Zr.SHIFT,Zr.ALT],[Zr.CTRL,Zr.ALT],[Zr.SHIFT,Zr.CTRL,Zr.ALT]];function Va(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function y7e(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 i0e(e,t,n){let i=Va(nr.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])},ln.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},ln.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(y7e(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}},ln.PINCH_MOVE,t)}function r0e(e,t){let n=Va(nr.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},ln.WHEEL,t)}function Hv(e,t,n){let i=Va(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===nr.LEFT_DRAG?(c=ln.LEFT_DOWN,u=ln.LEFT_UP):n===nr.RIGHT_DRAG?(c=ln.RIGHT_DOWN,u=ln.RIGHT_UP):n===nr.MIDDLE_DRAG&&(c=ln.MIDDLE_DOWN,u=ln.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(){l$(Va(n,void 0),e);for(let f of a0e){let d=Va(n,f);l$(d,e)}},u,t)}function l$(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 o0e(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function A7e(e,t,n){let i=n._isDown,r=!1,o=Va(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,l$(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 s0e(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in nr)if(nr.hasOwnProperty(s)){let a=nr[s];if(l(a)){let c=Va(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 nr)if(nr.hasOwnProperty(a)){let c=nr[a];if(l(c)){let u=Va(c,t);A7e(c,t,e),o[u]&&(n[u]?(o0e(i[u],r[u]),r[u].valid=!0,o0e(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},ln.MOUSE_MOVE,t)}function Ld(e){this._eventHandler=new ia(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,r0e(this,void 0),i0e(this,void 0,e),Hv(this,void 0,nr.LEFT_DRAG),Hv(this,void 0,nr.RIGHT_DRAG),Hv(this,void 0,nr.MIDDLE_DRAG),s0e(this,void 0);for(let t of a0e)r0e(this,t),i0e(this,t,e),Hv(this,t,nr.LEFT_DRAG),Hv(this,t,nr.RIGHT_DRAG),Hv(this,t,nr.MIDDLE_DRAG),s0e(this,t)}Object.defineProperties(Ld.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Va(nr.WHEEL)]||!this._update[Va(nr.WHEEL,Zr.SHIFT)]||!this._update[Va(nr.WHEEL,Zr.CTRL)]||!this._update[Va(nr.WHEEL,Zr.ALT)];return this._buttonsDown>0||e}}});Ld.prototype.isMoving=function(e,t){let n=Va(e,t);return!this._update[n]};Ld.prototype.getMovement=function(e,t){let n=Va(e,t);return this._movement[n]};Ld.prototype.getLastMovement=function(e,t){let n=Va(e,t),i=this._lastMovement[n];if(i.valid)return i};Ld.prototype.isButtonDown=function(e,t){let n=Va(e,t);return this._isDown[n]};Ld.prototype.getStartMousePosition=function(e,t){if(e===nr.WHEEL)return this._currentMousePosition;let n=Va(e,t);return this._eventStartPosition[n]};Ld.prototype.getButtonPressTime=function(e,t){let n=Va(e,t);return this._pressTime[n]};Ld.prototype.getButtonReleaseTime=function(e,t){let n=Va(e,t);return this._releaseTime[n]};Ld.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var VM=Ld;function c0e(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(c0e.prototype,{metadata:{get:function(){return this._metadata}}});var Rx=c0e;function Gv(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(Gv.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});Gv.fromColor=function(e){return new Gv(e.red,e.green,e.blue,e.alpha)};Gv.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};Gv.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=Gv;function ac(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}ac.fromCorners=function(e,t,n){return l(n)||(n=new ac),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};ac.fromPoints=function(e,t){if(l(t)||(t=new ac),!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};ac.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 ac(e.minimum,e.maximum,e.center)};ac.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 k6=new h;ac.intersectPlane=function(e,t){k6=h.subtract(e.maximum,e.minimum,k6);let n=h.multiplyByScalar(k6,.5,k6),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};ac.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};ac.prototype.clone=function(e){return ac.clone(this,e)};ac.prototype.intersectPlane=function(e){return ac.intersectPlane(this,e)};ac.prototype.intersectAxisAlignedBoundingBox=function(e){return ac.intersectAxisAlignedBoundingBox(this,e)};ac.prototype.equals=function(e){return ac.equals(this,e)};var Nf=ac;var u$=new se;function Gp(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,u$)),this._yAxis=h.fromCartesian4(N.getColumn(n,1,u$));let i=h.fromCartesian4(N.getColumn(n,2,u$));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Gp.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 b7e=new Nf;Gp.fromPoints=function(e,t){let n=Nf.fromPoints(e,b7e);return new Gp(n.center,t)};var l0e=new pn,U6=new h;Gp.prototype.projectPointOntoPlane=function(e,t){let n=l0e;n.origin=e,h.normalize(e,n.direction);let i=yi.rayPlane(n,this._plane,U6);if(l(i)||(h.negate(n.direction,n.direction),i=yi.rayPlane(n,this._plane,U6)),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)}};Gp.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};Gp.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=l0e;n.origin=e,h.clone(this._plane.normal,n.direction);let i=yi.rayPlane(n,this._plane,U6);l(i)||(h.negate(n.direction,n.direction),i=yi.rayPlane(n,this._plane,U6));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};Gp.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 x7e=new h;Gp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=x7e;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};Gp.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=Gp;function dr(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}dr.packedLength=h.packedLength+$.packedLength;dr.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};dr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dr),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var T7e=new h,E7e=new h,C7e=new h,v7e=new h,S7e=new h,w7e=new h,I7e=new $,P7e={unitary:new $,diagonal:new $};dr.fromPoints=function(e,t){if(l(t)||(t=new dr),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],T7e);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,E7e),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=I7e;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,P7e),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,v7e),b=$.getColumn(y,1,S7e),x=$.getColumn(y,2,w7e),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=C7e;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 p0e=new h,D7e=new h;function u0e(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new dr);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=p0e;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=D7e;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 f0e=new he,R7e=new h,O7e=new he,M7e=new he,N7e=new he,L7e=new he,F7e=new he,B7e=new h,d0e=new h,k7e=new h,h0e=new h,U7e=new h,z7e=new U,V7e=new U,j7e=new U,H7e=new U,G7e=new U,W7e=new h,q7e=new h,Y7e=new h,X7e=new h,K7e=new U,$7e=new h,J7e=new h,Z7e=new h,Q7e=new sn(h.UNIT_X,0);dr.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,f0e),R=i.cartographicToCartesian(I,R7e),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,O7e),w=he.fromRadians(e.west,e.north,n,M7e),P=he.fromRadians(e.west,_,n,N7e),M=he.fromRadians(e.west,e.south,n,L7e),F=he.fromRadians(L,e.south,n,F7e),V=i.cartographicToCartesian(C,B7e),B=i.cartographicToCartesian(w,d0e),j=i.cartographicToCartesian(P,k7e),k=i.cartographicToCartesian(M,h0e),G=i.cartographicToCartesian(F,U7e),q=O.projectPointToNearestOnPlane(V,z7e),Q=O.projectPointToNearestOnPlane(B,V7e),W=O.projectPointToNearestOnPlane(j,j7e),J=O.projectPointToNearestOnPlane(k,H7e),Z=O.projectPointToNearestOnPlane(G,G7e);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,d0e),k=i.cartographicToCartesian(M,h0e),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,u0e(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,f0e).longitude,A=h.fromRadians(y,m,n,i,W7e);A.z=0;let x=Math.abs(A.x)<D.EPSILON10&&Math.abs(A.y)<D.EPSILON10?h.UNIT_X:h.normalize(A,q7e),T=h.UNIT_Z,E=h.cross(x,T,Y7e);d=sn.fromPointNormal(A,x,Q7e);let v=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,X7e);s=h.dot(sn.projectPointOntoPlane(d,v,K7e),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,$7e).z,a=h.fromRadians(0,e.south,p?t:n,i,J7e).z;let S=h.fromRadians(e.east,m,n,i,Z7e);return u=sn.getPointDistance(d,S),f=0,u0e(A,E,T,x,o,s,a,c,u,f,r)};dr.fromTransformation=function(e,t){return l(t)||(t=new dr),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};dr.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new dr(e.center,e.halfAxes)};dr.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 g0e=new h,_0e=new h,y0e=new h,eWe=new h,m0e=new h,tWe=new h;dr.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,p0e),i=e.halfAxes,r=$.getColumn(i,0,g0e),o=$.getColumn(i,1,_0e),s=$.getColumn(i,2,y0e),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,m0e),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,eWe),h.normalize(y,y),A=h.cross(m,y,m0e),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=tWe;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 nWe=new h,iWe=new h;dr.computePlaneDistances=function(e,t,n,i){l(i)||(i=new zs);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,g0e),u=$.getColumn(a,1,_0e),f=$.getColumn(a,2,y0e),d=h.add(c,u,nWe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,iWe),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 rWe=new h,oWe=new h,sWe=new h;dr.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,rWe),o=$.getColumn(i,1,oWe),s=$.getColumn(i,2,sWe);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 aWe=new $;dr.computeTransformation=function(e,t){l(t)||(t=new N);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,aWe);return N.fromRotationTranslation(i,n,t)};var cWe=new ue;dr.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,cWe);return!t.isBoundingSphereVisible(n)};dr.prototype.intersectPlane=function(e){return dr.intersectPlane(this,e)};dr.prototype.distanceSquaredTo=function(e){return dr.distanceSquaredTo(this,e)};dr.prototype.computePlaneDistances=function(e,t,n){return dr.computePlaneDistances(this,e,t,n)};dr.prototype.computeCorners=function(e){return dr.computeCorners(this,e)};dr.prototype.computeTransformation=function(e){return dr.computeTransformation(this,e)};dr.prototype.isOccluded=function(e){return dr.isOccluded(this,e)};dr.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};dr.prototype.clone=function(e){return dr.clone(this,e)};dr.prototype.equals=function(e){return dr.equals(this,e)};var en=dr;function lWe(e,t){return t=t??0,Lu(e,t,Math.min(4,e.length))}var tm=lWe;var f$=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+=jM;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=jM,o+=jM;let f=c.getUint32(o,!0);o+=jM;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=tm(a,o),b=c.getUint32(o+jM*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 le(this)}},jM=Uint32Array.BYTES_PER_ELEMENT,HM=f$;var d$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};d$.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(d$);var ei=d$;function uWe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Wp=uWe;var Jy=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif -void main(void) -{ -#ifdef VECTOR_TILE -out_FragColor = czm_gammaCorrect(u_highlightColor); -#else -out_FragColor = vec4(1.0); -#endif -czm_writeDepthClamp(); -} -`;var Wv=`in vec3 position; -in float a_batchId; -uniform mat4 u_modifiedModelViewProjection; -void main() -{ -gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;var h$=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)}},ra=h$;var A0e={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(A0e);var cc=A0e;var m$=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)})}},p$=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)})}},zu=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)}}},fWe=new m$;Object.assign(zu,{hooks:fWe,plugins:new p$(zu),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"});zu.max_unop_len=zu.getMaxKeyLen(zu.unary_ops);zu.max_binop_len=zu.getMaxKeyLen(zu.binary_ops);var Zy=e=>new zu(e).parse(),dWe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(zu).filter(e=>!dWe.includes(e)&&Zy[e]===void 0).forEach(e=>{Zy[e]=zu[e]});Zy.Jsep=zu;var hWe="ConditionalExpression",mWe={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:hWe,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 :")}})}};Zy.plugins.register(mWe);var b0e={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(b0e);var Mt=b0e;function nm(e,t){this._expression=e,e=wWe(e,t),e=PWe(IWe(e)),Zy.addBinaryOp("=~",0),Zy.addBinaryOp("!~",0);let n;try{n=Zy(e)}catch(i){throw new oe(i)}this._runtimeAst=$i(this,n)}Object.defineProperties(nm.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++]}};nm.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};nm.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};nm.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} -{ - return ${r}; -} -`,r};nm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};nm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var pWe=["!","-","+"],x0e=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],GM=/\${(.*?)}/g,gWe=/\\/g,_We="@#%",yWe=/@#%/g,j6=new z,H6={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(bWe),log:ja(Math.log),log2:ja(xWe),fract:ja(AWe),length:TWe,normalize:EWe},G6={atan2:z6(Math.atan2,!1),pow:z6(Math.pow,!1),min:z6(Math.min,!0),max:z6(Math.max,!0),distance:CWe,dot:vWe,cross:SWe},y$={clamp:T0e(D.clamp,!0),mix:T0e(D.lerp,!0)};function AWe(e){return e-Math.floor(e)}function bWe(e){return Math.pow(2,e)}function xWe(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 z6(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 T0e(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 TWe(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 EWe(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 CWe(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 vWe(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 SWe(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 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,UWe(this)}function wWe(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 IWe(e){return e.replace(gWe,_We)}function _$(e){return e.replace(yWe,"\\")}function PWe(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 DWe(e){let t=typeof e.value;if(e.value===null)return new Ft(Mt.LITERAL_NULL,null);if(t==="boolean")return new Ft(Mt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Ft(Mt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Ft(Mt.VARIABLE_IN_STRING,e.value):new Ft(Mt.LITERAL_STRING,_$(e.value))}function RWe(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(Mt.LITERAL_BOOLEAN,!1):new Ft(Mt.LITERAL_NULL,null):(s=$i(e,c),a=$i(e,n[0]),new Ft(Mt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=$i(e,c),new Ft(Mt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Ft(Mt.LITERAL_COLOR,r);if(o=$i(e,n[0]),l(n[1])){let c=$i(e,n[1]);return new Ft(Mt.LITERAL_COLOR,r,[o,c])}return new Ft(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 Ft(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 Ft(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 Ft(Mt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Ft(Mt.LITERAL_BOOLEAN,!0):new Ft(Mt.LITERAL_BOOLEAN,!1):(o=$i(e,n[0]),new Ft(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 Ft(Mt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Ft(Mt.UNARY,r)}else if(l(H6[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=$i(e,n[0]),new Ft(Mt.UNARY,r,o)}else if(l(G6[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=$i(e,n[0]),a=$i(e,n[1]),new Ft(Mt.BINARY,r,s,a)}else if(l(y$[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 Ft(Mt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Ft(Mt.LITERAL_BOOLEAN,!1):(o=$i(e,n[0]),new Ft(Mt.UNARY,r,o));if(r==="Number")return i===0?new Ft(Mt.LITERAL_NUMBER,0):(o=$i(e,n[0]),new Ft(Mt.UNARY,r,o));if(r==="String")return i===0?new Ft(Mt.LITERAL_STRING,""):(o=$i(e,n[0]),new Ft(Mt.UNARY,r,o));if(r==="regExp")return OWe(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function OWe(e,t){let n=t.arguments;if(n.length===0)return new Ft(Mt.LITERAL_REGEX,new RegExp);let i=$i(e,n[0]),r;if(n.length>1){let o=$i(e,n[1]);if(g$(i)&&g$(o)){try{r=new RegExp(_$(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Ft(Mt.LITERAL_REGEX,r)}return new Ft(Mt.REGEX,i,o)}if(g$(i)){try{r=new RegExp(_$(String(i._value)))}catch(o){throw new oe(o)}return new Ft(Mt.LITERAL_REGEX,r)}return new Ft(Mt.REGEX,i)}function MWe(e){if(BWe(e.name)){let t=kWe(e.name);return t.substr(0,8)==="tiles3d_"?new Ft(Mt.BUILTIN_VARIABLE,t):new Ft(Mt.VARIABLE,t)}else{if(e.name==="NaN")return new Ft(Mt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Ft(Mt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Ft(Mt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function NWe(e){let t=e.property.name;if(t==="PI")return new Ft(Mt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Ft(Mt.LITERAL_NUMBER,Math.E)}function LWe(e){if(e.property.name==="POSITIVE_INFINITY")return new Ft(Mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function FWe(e,t){if(t.object.name==="Math")return NWe(t);if(t.object.name==="Number")return LWe(t);let n,i=$i(e,t.object);return t.computed?(n=$i(e,t.property),new Ft(Mt.MEMBER,"brackets",i,n)):(n=new Ft(Mt.LITERAL_STRING,t.property.name),new Ft(Mt.MEMBER,"dot",i,n))}function g$(e){return e._type>=Mt.LITERAL_NULL}function BWe(e){return e.substr(0,4)==="czm_"}function kWe(e){return e.substr(4)}function $i(e,t){let n,i,r,o;if(t.type==="Literal")n=DWe(t);else if(t.type==="CallExpression")n=RWe(e,t);else if(t.type==="Identifier")n=MWe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=$i(e,t.argument);if(pWe.indexOf(i)>-1)n=new Ft(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),x0e.indexOf(i)>-1)n=new Ft(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),x0e.indexOf(i)>-1&&(n=new Ft(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 Ft(Mt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=FWe(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 Ft(Mt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function UWe(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(H6[e._value])&&(e.evaluate=VWe(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(G6[e._value])&&(e.evaluate=jWe(e._value)):e._type===Mt.TERNARY?e.evaluate=HWe(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=zWe):e.evaluate=e._evaluateLiteral}function zWe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function VWe(e){let t=H6[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function jWe(e){let t=G6[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function HWe(e){let t=y$[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 W6(e,t){if(l(e))return e.getPropertyInherited(t)}Ft.prototype._evaluateLiteral=function(){return this._value};Ft.prototype._evaluateLiteralColor=function(e){let t=j6,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())};Ft.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())};Ft.prototype._evaluateLiteralString=function(){return this._value};Ft.prototype._evaluateVariableString=function(e){let t=this._value,n=GM.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=W6(e,r);l(o)||(o=""),t=t.replace(i,o),GM.lastIndex+=o.length-i.length,n=GM.exec(t)}return t};Ft.prototype._evaluateVariable=function(e){return W6(e,this._value)};function Ox(e){return e._value==="feature"}Ft.prototype._evaluateMemberDot=function(e){if(Ox(this._left))return W6(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(Ox(this._left))return W6(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,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}.`)};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,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}.`)};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,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}.`)};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,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}.`)};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,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}.`)};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,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}.`)};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 E0e(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,j6)}function C0e(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=j6;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 Qy(e){return e%1===0?e.toFixed(1):e.toString()}function GWe(e){let t=Qy(e.red),n=Qy(e.green),i=Qy(e.blue);return`vec3(${t}, ${n}, ${i})`}function V6(e){let t=Qy(e.red),n=Qy(e.green),i=Qy(e.blue),r=Qy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function v0e(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 S0e(e,t){return l(t[e])?t[e]:nm.NULL_SENTINEL}nm.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=v0e(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=v0e(this._value,e,t,this));let u,f,d;switch(a){case Mt.VARIABLE:return Ox(this)?void 0:S0e(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(H6[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(G6[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Mt.TERNARY:if(l(y$[c]))return`${c}(${r}, ${o}, ${s})`;break;case Mt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Mt.MEMBER:return Ox(this._left)?S0e(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 nm.NULL_SENTINEL;case Mt.LITERAL_BOOLEAN:return c?"true":"false";case Mt.LITERAL_NUMBER:return Qy(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"||Ox(n._left)))return c;if(i=z.fromCssColorString(c,j6),l(i))return GWe(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=C0e(this),l(i)?V6(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=C0e(this),l(i)?V6(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=E0e(this),l(i)?V6(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=E0e(this),l(i)?(i.alpha!==1&&(t.translucent=!0),V6(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 nm.NULL_SENTINEL;case Mt.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 Mt.VARIABLE:Ox(this)||e.push(s);break;case Mt.VARIABLE_IN_STRING:for(a=GM.exec(s);a!==null;)e.push(a[1]),a=GM.exec(s);break;case Mt.LITERAL_STRING:l(t)&&t._type===Mt.MEMBER&&Ox(t._left)&&e.push(s);break}};var Fd=nm;function Sg(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??ei.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(Sg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var WWe={position:0,a_batchId:1};function qWe(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 YWe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??WWe,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() +`,r};om.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};om.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var w7e=["!","-","+"],Bpe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],qM=/\${(.*?)}/g,I7e=/\\/g,P7e="@#%",D7e=/@#%/g,P6=new z,D6={abs:ka(Math.abs),sqrt:ka(Math.sqrt),cos:ka(Math.cos),sin:ka(Math.sin),tan:ka(Math.tan),acos:ka(Math.acos),asin:ka(Math.asin),atan:ka(Math.atan),radians:ka(D.toRadians),degrees:ka(D.toDegrees),sign:ka(D.sign),floor:ka(Math.floor),ceil:ka(Math.ceil),round:ka(Math.round),exp:ka(Math.exp),exp2:ka(O7e),log:ka(Math.log),log2:ka(M7e),fract:ka(R7e),length:N7e,normalize:L7e},R6={atan2:w6(Math.atan2,!1),pow:w6(Math.pow,!1),min:w6(Math.min,!0),max:w6(Math.max,!0),distance:F7e,dot:B7e,cross:k7e},MK={clamp:kpe(D.clamp,!0),mix:kpe(D.lerp,!0)};function R7e(e){return e-Math.floor(e)}function O7e(e){return Math.pow(2,e)}function M7e(e){return D.log2(e)}function ka(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 w6(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 kpe(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 N7e(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 L7e(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 F7e(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 B7e(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 k7e(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,J7e(this)}function U7e(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 z7e(e){return e.replace(I7e,P7e)}function OK(e){return e.replace(D7e,"\\")}function V7e(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 j7e(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,OK(e.value))}function H7e(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=Ki(e,c),a=Ki(e,n[0]),new Bt(Mt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Ki(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=Ki(e,n[0]),l(n[1])){let c=Ki(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=[Ki(e,n[0]),Ki(e,n[1]),Ki(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=[Ki(e,n[0]),Ki(e,n[1]),Ki(e,n[2]),Ki(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]=Ki(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=Ki(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=Ki(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(D6[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(l(R6[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Ki(e,n[0]),a=Ki(e,n[1]),new Bt(Mt.BINARY,r,s,a)}else if(l(MK[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=Ki(e,n[0]),a=Ki(e,n[1]);let c=Ki(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=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="Number")return i===0?new Bt(Mt.LITERAL_NUMBER,0):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="String")return i===0?new Bt(Mt.LITERAL_STRING,""):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="regExp")return G7e(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function G7e(e,t){let n=t.arguments;if(n.length===0)return new Bt(Mt.LITERAL_REGEX,new RegExp);let i=Ki(e,n[0]),r;if(n.length>1){let o=Ki(e,n[1]);if(RK(i)&&RK(o)){try{r=new RegExp(OK(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(RK(i)){try{r=new RegExp(OK(String(i._value)))}catch(o){throw new oe(o)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i)}function W7e(e){if(K7e(e.name)){let t=$7e(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 q7e(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 Y7e(e){if(e.property.name==="POSITIVE_INFINITY")return new Bt(Mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function X7e(e,t){if(t.object.name==="Math")return q7e(t);if(t.object.name==="Number")return Y7e(t);let n,i=Ki(e,t.object);return t.computed?(n=Ki(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 RK(e){return e._type>=Mt.LITERAL_NULL}function K7e(e){return e.substr(0,4)==="czm_"}function $7e(e){return e.substr(4)}function Ki(e,t){let n,i,r,o;if(t.type==="Literal")n=j7e(t);else if(t.type==="CallExpression")n=H7e(e,t);else if(t.type==="Identifier")n=W7e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ki(e,t.argument);if(w7e.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=Ki(e,t.left),o=Ki(e,t.right),Bpe.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=Ki(e,t.left),o=Ki(e,t.right),Bpe.indexOf(i)>-1&&(n=new Bt(Mt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Ki(e,t.test);r=Ki(e,t.consequent),o=Ki(e,t.alternate),n=new Bt(Mt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=X7e(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ki(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 J7e(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(D6[e._value])&&(e.evaluate=Q7e(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(R6[e._value])&&(e.evaluate=eWe(e._value)):e._type===Mt.TERNARY?e.evaluate=tWe(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=Z7e):e.evaluate=e._evaluateLiteral}function Z7e(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Q7e(e){let t=D6[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function eWe(e){let t=R6[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function tWe(e){let t=MK[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 O6(e,t){if(l(e))return e.getPropertyInherited(t)}Bt.prototype._evaluateLiteral=function(){return this._value};Bt.prototype._evaluateLiteralColor=function(e){let t=P6,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=qM.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=O6(e,r);l(o)||(o=""),t=t.replace(i,o),qM.lastIndex+=o.length-i.length,n=qM.exec(t)}return t};Bt.prototype._evaluateVariable=function(e){return O6(e,this._value)};function Yx(e){return e._value==="feature"}Bt.prototype._evaluateMemberDot=function(e){if(Yx(this._left))return O6(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(Yx(this._left))return O6(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 Upe(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,P6)}function zpe(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=P6;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 Jy(e){return e%1===0?e.toFixed(1):e.toString()}function nWe(e){let t=Jy(e.red),n=Jy(e.green),i=Jy(e.blue);return`vec3(${t}, ${n}, ${i})`}function I6(e){let t=Jy(e.red),n=Jy(e.green),i=Jy(e.blue),r=Jy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function Vpe(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 jpe(e,t){return l(t[e])?t[e]:om.NULL_SENTINEL}om.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=Vpe(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=Vpe(this._value,e,t,this));let u,f,d;switch(a){case Mt.VARIABLE:return Yx(this)?void 0:jpe(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(D6[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(R6[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Mt.TERNARY:if(l(MK[c]))return`${c}(${r}, ${o}, ${s})`;break;case Mt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Mt.MEMBER:return Yx(this._left)?jpe(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 om.NULL_SENTINEL;case Mt.LITERAL_BOOLEAN:return c?"true":"false";case Mt.LITERAL_NUMBER:return Jy(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"||Yx(n._left)))return c;if(i=z.fromCssColorString(c,P6),l(i))return nWe(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=zpe(this),l(i)?I6(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=zpe(this),l(i)?I6(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Upe(this),l(i)?I6(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Upe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),I6(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 om.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:Yx(this)||e.push(s);break;case Mt.VARIABLE_IN_STRING:for(a=qM.exec(s);a!==null;)e.push(a[1]),a=qM.exec(s);break;case Mt.LITERAL_STRING:l(t)&&t._type===Mt.MEMBER&&Yx(t._left)&&e.push(s);break}};var Ld=om;function wg(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??Qn.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(wg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var iWe={position:0,a_batchId:1};function rWe(e,t){if(l(e._va))return;let n=nt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=nt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=nt.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:nt.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 oWe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??iWe,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=en.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 = ${r}; } -`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Wv),c=n.getFragmentShaderCallback(!1,void 0,!0)(Jy);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:[Wv]}),f=new Ye({defines:["VECTOR_TILE"],sources:[Jy]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ye.replaceMain(c,"czm_non_pick_main"),c=`${c} +`,e._spPick=en.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(kv),c=n.getFragmentShaderCallback(!1,void 0,!0)(zy);r=n.getPickId();let u=new Ye({sources:[a]}),f=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._sp=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ye({sources:[kv]}),f=new Ye({defines:["VECTOR_TILE"],sources:[zy]}),e._spStencil=en.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 = ${r}; } -`;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 w0e(e){let t=e?Zn.EQUAL:Zn.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:cc.LESS_OR_EQUAL},depthMask:!1}}var XWe={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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},KWe={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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 $We(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(w0e(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(w0e(!0)),e._rsColorPass=Ge.fromCache(XWe),e._rsPickPass=Ge.fromCache(KWe))}var Mx=new N,I0e=new h;function JWe(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,Mx),N.multiplyByPoint(Mx,e._center,I0e),N.setTranslation(Mx,I0e,Mx),N.multiply(r,Mx,Mx),Mx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function A$(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 ZWe(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=A$(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=A$(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=A$(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 b$(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 QWe(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=b$(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=b$(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=b$(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 eqe(e,t){return t.color.toRgba()-e.color.toRgba()}function tqe(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(eqe),t.webgl2?QWe(e,n):ZWe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function nqe(e,t){let n=tqe(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 iqe(e,t){if(e.classificationType===ei.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 rqe(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}Sg.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 ra(e,o)}};Sg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function oqe(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 sqe=new z,aqe=z.WHITE,cqe=!0,lqe=/\$/;Sg.prototype.applyStyle=function(e,t){if(!l(e)){oqe(this,t);return}let n=e.color,i=n instanceof Fd&&!lqe.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,sqe):aqe,c.show=l(e.show)?e.show.evaluate(c):cqe}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}};Sg.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 Wp({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 Wp({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 P0e(e,t,n,i){let r=e.classificationType,o=r!==ei.CESIUM_3D_TILE,s=r!==ei.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 uqe(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 fqe(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}Sg.prototype.update=function(e){let t=e.context;qWe(this,t),YWe(this,t),$We(this),JWe(this,t);let n=e.passes;n.render&&(nqe(this,t),iqe(this,e),fqe(this),this._debugWireframe?uqe(e,this._commands):P0e(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(rqe(this),P0e(this,e,this._pickCommands))};Sg.prototype.isDestroyed=function(){return!1};Sg.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(),le(this)};var Nx=Sg;function Lf(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=ei.BOTH}Object.defineProperties(Lf.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}}});Lf.packedBoxLength=N.packedLength+h.packedLength;Lf.packedCylinderLength=N.packedLength+2;Lf.packedEllipsoidLength=N.packedLength+h.packedLength;Lf.packedSphereLength=h.packedLength+1;function dqe(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 hqe(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]=ue.unpack(t,n),n+=ue.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 Wp({color:u,offset:f,count:d,batchIds:g})}return i}var mqe=new Kn("createVectorTileGeometries",5),pqe=new z;function gqe(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,pqe);u[A]=b.toRgba()}f=e._packedBuffer=dqe(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=mqe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);hqe(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),_qe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function _qe(e){l(e._primitive)||(e._primitive=new Nx({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)}Lf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Lf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Lf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Lf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Lf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=gqe(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)};Lf.prototype.isDestroyed=function(){return!1};Lf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var wg=Lf;var x$=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,bqe(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 D0e(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){D0e(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(),le(this)}};function yqe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function Aqe(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 Lx=Uint32Array.BYTES_PER_ELEMENT;function bqe(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Lx;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=Lx;let s=r.getUint32(n,!0);if(n+=Lx,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Lx,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Lx;let u=r.getUint32(n,!0);n+=Lx;let f=r.getUint32(n,!0);n+=Lx;let d=Do(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Do(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 Wh(e,T,g,m,yqe(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=Aqe(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,wg.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,wg.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,wg.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,wg.packedSphereLength*x)}return e._geometries=new wg({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 D0e(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 WM=x$;var T$={};T$.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),R0e(i,r,o,s);return c};T$.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)),R0e(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function R0e(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 qv=T$;var Fx=30,xqe=1<<Fx,Tqe=1<<Fx+1>>>0,E$=2*Fx+1,eA=4,N0e=[],L0e=[],Eqe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],tA=1,Yv=2,q6=[tA,0,0,tA|Yv];function js(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=js.getLevel(e)}js.fromToken=function(e){return new js(js.getIdFromToken(e))};js.isValidId=function(e){return!(e<=0||e>>BigInt(E$)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};js.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?js.isValidId(js.getIdFromToken(e)):!1};js.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};js.getTokenFromId=function(e){let t=Math.floor(Mqe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};js.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Fx-(t>>1)};js.prototype.getChild=function(e){let t=k0e(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new js(n)};js.prototype.getParent=function(){let e=k0e(this._cellId)<<BigInt(2);return new js(this._cellId&~e+BigInt(1)|e)};js.prototype.getParentAtLevel=function(e){let t=Rqe(e);return new js(this._cellId&-t|t)};js.prototype.getCenter=function(e){e=e??ee.WGS84;let t=Cqe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};js.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=vqe(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)};js.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(E$-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new js(a)};function Cqe(e,t){let n=Sqe(e,t);return wqe(n[0],n[1],n[2])}function vqe(e,t,n){let i=F0e(e,t),r=Iqe([i[1],i[2]],t),o=n>>1&1;return B0e(i[0],r[0][o^n&1],r[1][o])}function Sqe(e,t){let n=F0e(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 F0e(e){N0e.length===0&&Dqe();let t=Number(e>>BigInt(E$)),n=t&tA,i=(1<<eA)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Fx-7*eA:eA))-1;n+=Number(e>>BigInt(s*2*eA+1)&BigInt(c))<<2,n=L0e[n];let u=s*eA;r+=n>>eA+2<<u,o+=(n>>2&i)<<u,n&=tA|Yv}return[t,r,o]}function wqe(e,t,n){let i=O0e(t),r=O0e(n),o=Y6(i),s=Y6(r);return B0e(e,o,s)}function B0e(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 Y6(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function O0e(e){return 1/Tqe*e}function Iqe(e,t){let n=[[],[]],i=Pqe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=Y6(M0e(o)),n[r][1]=Y6(M0e(s))}return n}function Pqe(e){return 1<<Fx-e>>>0}function M0e(e){return 1/xqe*e}function nA(e,t,n,i,r,o){if(e===eA){let s=(t<<eA)+n;N0e[(s<<2)+i]=(r<<2)+o,L0e[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=Eqe[o];nA(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^q6[0]),nA(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^q6[1]),nA(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^q6[2]),nA(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^q6[3])}}function Dqe(){nA(0,0,0,0,0,0),nA(0,0,0,tA,0,tA),nA(0,0,0,Yv,0,Yv),nA(0,0,0,tA|Yv,0,tA|Yv)}function k0e(e){return e&~e+BigInt(1)}function Rqe(e){return BigInt(1)<<BigInt(2*(Fx-e))}var Oqe=[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 Mqe(e){return Oqe[(-e&e)%BigInt(67)]}var Ig=js;function Nqe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ir=Nqe;function C$(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=Lqe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function Lqe(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(C$.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});C$.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 Xv=C$;function Pg(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(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 this._metadataTable.hasProperty(e)};Pg.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Pg.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Pg.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Pg.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Pg.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Pg.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Kv=Pg;var qM={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};qM.getBranchingFactor=function(e){switch(e){case qM.OCTREE:return 8;case qM.QUADTREE:return 4}};Object.freeze(qM);var Hs=qM;function lc(){}Object.defineProperties(lc.prototype,{class:{get:function(){pe.throwInstantiationError()}}});lc.prototype.hasProperty=function(e){pe.throwInstantiationError()};lc.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};lc.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};lc.prototype.getProperty=function(e){pe.throwInstantiationError()};lc.prototype.setProperty=function(e,t){pe.throwInstantiationError()};lc.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};lc.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};lc.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))};lc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};lc.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};lc.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)};lc.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};lc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return lc.getProperty(r.id,t,n)};lc.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?lc.setProperty(o.id,t,n,i):!1};var Yn=lc;function Dg(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(Dg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Dg.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Dg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Dg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Dg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Dg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Dg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Dg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var YM=Dg;function is(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)}is.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=Fqe(n),r=Bqe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new is({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(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 Fqe(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 Bqe(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}}is.prototype.normalize=function(e){return this._normalized?v$(e,this._valueType,Lt.normalize):e};is.prototype.unnormalize=function(e){return this._normalized?v$(e,this._valueType,Lt.unnormalize):e};is.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:is.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};is.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:is.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};is.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)};is.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!j0e(e,t))return e};function XM(e){return Array.isArray(e)&&!(e instanceof Xi)&&!(e instanceof $)&&!(e instanceof N)}function j0e(e,t){if(!XM(e))return e===t;if(!XM(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!j0e(e[n],t[n]))return!1;return!0}is.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};is.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};is.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?kqe(this,e):H0e(this,e)};function kqe(e,t){if(!XM(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=H0e(e,t[i]);if(l(r))return r}}function H0e(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?Uqe(t,n,i):bt.isMatrixType(n)?zqe(t,n,i):n===bt.STRING?Vqe(t):n===bt.BOOLEAN?jqe(t):n===bt.ENUM?Hqe(t,r):Gqe(t,i,o)}function Uqe(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 zqe(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 Vqe(e){if(typeof e!="string")return X6(e,bt.STRING)}function jqe(e){if(typeof e!="boolean")return X6(e,bt.BOOLEAN)}function Hqe(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 Gqe(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"?X6(e,t):isFinite(e)?z0e(e,t,n):V0e(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?X6(e,t):i==="number"&&!isFinite(e)?V0e(e,t):z0e(e,t,n)}}function X6(e,t){return`value ${e} does not match type ${t}`}function U0e(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function z0e(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?U0e(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return U0e(e,t,n)}function V0e(e,t){return`value ${e} of type ${t} must be finite`}function v$(e,t,n){if(!XM(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=v$(e[i],t,n);return e}is.valueTransformInPlace=function(e,t,n,i){if(!XM(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=is.valueTransformInPlace(e[r],t[r],n[r],i);return e};is.prototype.cpuBytesPerElement=function(){return G0e(this,this.valueType)};is.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return G0e(this,e)};function G0e(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}is.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var S$=[void 0,"float","vec2","vec3","vec4"],W0e=[void 0,"int","ivec2","ivec3","ivec4"],Wqe=[void 0,"uint","uvec2","uvec3","uvec4"],qqe={[ol.FLOAT]:"uintBitsToFloat",[ol.INTEGER]:"int",[ol.UNSIGNED_INTEGER]:""};is.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?S$[e]:W0e[e]};is.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?S$[t]:Lt.isUnsignedIntegerType(e)?Wqe[t]:W0e[t]};is.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=`${S$[s]} ${f} = ${e};`;i.push(y);let A=qqe[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};is.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var qp=is;function KM(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 w$(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 w$(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 w$(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=q0e(v),S=q0e(S);let R,O,L=this;f?R=function(_){return Kqe(_,L._values,L._stringOffsets)}:d?(R=function(_){return $qe(_,L._values)},O=function(_,C){Jqe(_,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(KM.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}}});KM.prototype.get=function(e){let t=Yqe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=oYe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};KM.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=sYe(this,t),t=n.unnormalize(t),Xqe(this,e,t)};KM.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function q0e(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)?Qn(t,i):t.push(i)}return t}function Yqe(e,t){X0e(e)&&K0e(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):Y0e(e,n,t)}function Y0e(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 Xqe(e,t,n){iYe(e,t,n)&&K0e(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 Kqe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Lu(t.typedArray,i,r)}function $qe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function Jqe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function Zqe(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 Qqe(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 eYe(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 tYe(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 nYe(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 X0e(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 iYe(e,t,n){if(X0e(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 K0e(e){e._unpackedValues=rYe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function rYe(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]=Y0e(e,i,a);return n}function oYe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:qp.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function sYe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:qp.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function w$(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 Qqe(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 Zqe(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 tYe(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 eYe(a,i)});else{let a=nYe(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 $M=KM;function im(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 $M({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(im.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}}});im.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};im.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};im.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};im.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=aYe(this._class,t),i};im.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};im.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)};im.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};im.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};im.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function aYe(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 Bd=im;function cYe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var iA=cYe;var Oxn=(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 rA=(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:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8Ppm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vorlvorlvorp: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 Lxn=(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:tjjjb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aBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1: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;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mbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeB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a85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXind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PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR: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),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 Bxn=(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:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6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Qce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz: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 Uxn=(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:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgr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bkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz: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 I$=class extends er{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=iA(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=lYe(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 lYe(e){try{let t=uYe(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);rA.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 uYe(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 $v=I$;var Bx=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Kn("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])}};Bx._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Bx._decoderTaskProcessor=void 0;Bx._taskProcessorReady=!1;Bx._error=void 0;var Rg=Bx;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 fYe(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=fYe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(On);var ct=On;var P$=class extends er{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=dYe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._dracoError)&&$0e(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=mYe(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=Rg.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=hYe(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 dYe(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;$0e(e,n)}}function $0e(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load Draco",t)}async function hYe(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 kx={};kx[ct.POSITION]="POSITION";kx[ct.NORMAL]="NORMAL";kx[ct.COLOR]="COLOR";kx[ct.TEXCOORD]="TEX_COORD";function mYe(e){for(let t in kx)if(kx.hasOwnProperty(t)&&e.startsWith(t))return kx[t]}var Jv=P$;function pYe(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 Og=pYe;var JM=class extends er{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=gYe(this),this._promise):(this._promise=_Ye(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 J0e(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 gYe(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 AYe(i);if(e.isDestroyed())return;let o=J0e(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(n){return e.isDestroyed()?void 0:Z0e(e,n,"Failed to load embedded image")}}async function _Ye(e){e._state=Tt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await xYe(i);if(e.isDestroyed())return;let o=J0e(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(r){return e.isDestroyed()?void 0:Z0e(e,r,`Failed to load image: ${n}`)}}function Z0e(e,t,n){return e.unload(),e._state=Tt.FAILED,Promise.reject(e.getError(n,t))}function yYe(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 AYe(e){let t=yYe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ou(n)}return JM._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var bYe=/(^data:image\/ktx2)|(\.ktx2$)/i;function xYe(e){let t=e.getUrlComponent(!1,!0);return bYe.test(t)?Ou(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}JM._loadImageFromTypedArray=Og;var Zv=JM;var Q0e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Q0e);var Oc=Q0e;var D$=class extends er{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=EYe(this),this._promise):(this._promise=CYe(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){O$(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=TYe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Oc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=ege(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}},R$=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=ege(this.typedArray,this.indexDatatype,this.context)}};function ege(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var TYe=new R$;async function EYe(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;O$(e,n)}}async function CYe(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=vYe(e,a),e._state=Tt.PROCESSING,e}catch(s){if(e.isDestroyed())return;O$(e,s)}}function vYe(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,qr("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 O$(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load index buffer",t)}var Qv=D$;function SYe(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 ba=SYe;function wYe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Go=wYe;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 Go(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 Go(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 Go(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 IYe(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 Ff=IYe;function PYe(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)*Ff(t.type)}var Vu=PYe;function DYe(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=ba(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=Vu(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)&&Ux(c)}),Ux(n.emissiveTexture),Ux(n.normalTexture),Ux(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,Ux(s.baseColorTexture),Ux(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,Ux(a.specularGlossinessTexture))}),ke.animation(e,function(n){ke.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=RYe(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 RYe(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 Ux(e){l(e)&&(e.texCoord=e.texCoord??0)}var ZM=DYe;function OYe(e){return ke.shader(e,function(t){K6(t)}),ke.buffer(e,function(t){K6(t)}),ke.image(e,function(t){K6(t)}),K6(e),e}function K6(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var oA=OYe;function MYe(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 QM=MYe;function NYe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),QM(e,t),n.length===0&&delete e.extensionsUsed}}var zx=NYe;var LYe=4;function FYe(e){if(tm(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=tge(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?BYe(e,n):kYe(e,n)}function tge(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*LYe,!0);return r}function BYe(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=Lu(e,o,i),c=JSON.parse(a);oA(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 zx(c,"KHR_binary_glTF"),c}function kYe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=tge(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=Lu(u);r=JSON.parse(f),oA(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 Vx=FYe;function UYe(e){return ke.shader(e,function(t){$6(t)}),ke.buffer(e,function(t){$6(t)}),ke.image(e,function(t){$6(t)}),$6(e),e}function $6(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var eN=UYe;function zYe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ba(n,t,!0)}var kd=zYe;function VYe(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 Mg=VYe;function jYe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=Ff(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=Vu(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=Mg(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 jx=jYe;var HYe=[te.FUNC_ADD,te.FUNC_ADD],GYe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function nge(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var WYe=[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 qYe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(WYe.indexOf(e[n])===-1)return t;return e}function YYe(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(nge(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??HYe,blendFactors:qYe(c.blendFuncSeparate,GYe)})}nge(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),kd(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 tN=YYe;function XYe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ba(n,t,!0),kd(e,t)}var nN=XYe;function KYe(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=ba(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=ba(o.shaders,m,!0),u.program=ba(o.programs,p),r[a.program]=u.program}i[c]=ba(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,kd(e,"KHR_techniques_webgl"),nN(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 iN=KYe;function $Ye(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 eS=$Ye;var ige=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function JYe(e,t){return t=t??ige,ige.forEach(function(n){t.indexOf(n)>-1&&QYe(e,n)}),e}var ZYe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function QYe(e,t){let n=ZYe[t],i=e[n];if(l(i)){let r=0,o=Xp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Yp[t](e,a-r),r++)}}function Yp(){}Yp.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--})})};Yp.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--}})};Yp.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--}),Go(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--})}),Go(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(Go(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--}}}}};Yp.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})};Yp.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)})};Yp.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})})};Yp.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--})})};Yp.sampler=function(e,t){e.samplers.splice(t,1),ke.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Yp.texture=function(e,t){if(e.textures.splice(t,1),ke.material(e,function(i){eS(i,function(r,o){o.index>t&&--o.index})}),Go(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(Go(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}}}})}),Go(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 Xp(){}Xp.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)})}),Go(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})}),Go(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};Xp.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};Xp.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)}),Go(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)})}),Go(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(Go(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};Xp.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};Xp.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 rge(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!rge(e,r,n)}).length===0}Xp.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){rge(e,i,t)||(t[i]=!0)}),t};Xp.material=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Xp.texture=function(e){let t={};if(ke.material(e,function(n){eS(n,function(i){t[i]=!0})}),Go(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(Go(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)}}}})}),Go(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};Xp.sampler=function(e){let t={};return ke.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var rN=JYe;function eXe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:ba(e.buffers,n),byteOffset:0,byteLength:t.length};return ba(e.bufferViews,r)}var oN=eXe;function tXe(e,t){let n=Vu(e,t),i=Y.getSizeInBytes(t.componentType),r=Ff(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=Mg(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 sN=tXe;function nXe(e){let t;return ke.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?J6(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&J6(e,i,Y.UNSIGNED_SHORT)}),ke.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?J6(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&J6(e,i,Y.UNSIGNED_SHORT)}),e}function J6(e,t,n){let i=Y.createTypedArray(n,sN(e,t)),r=new Uint8Array(i.buffer);t.bufferView=oN(e,r),t.componentType=n,t.byteOffset=0}var aN=nXe;function iXe(e,t){return zx(e,t),t==="CESIUM_RTC"&&rXe(e),M$(e,t)}function rXe(e){ke.technique(e,function(t){ke.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function M$(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)M$(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)&&M$(e[r],t);return i}}var Hx=iXe;var Z6={.8:uXe,"1.0":RXe,"2.0":void 0};function oXe(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(Z6,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(Z6,i)||(i="1.0"));let r=Z6[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=Z6[i];return t.keepLegacyExtensions||(NXe(e,t),LXe(e)),e}function age(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 sXe(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 aXe(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 cXe(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=Ff(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 lXe(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 uXe(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,age(e),sXe(e),aXe(e),cXe(e),lXe(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,kd(e,"KHR_materials_common")}}function fXe(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 oge(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 dXe(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]=oge(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=ba(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=oge(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 hXe(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){delete n.name})})}function mXe(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 pXe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var gXe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function _Xe(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(gXe[r])&&e.extensionsRequired.push(r)}}}function yXe(e){ke.buffer(e,function(t){delete t.type})}function AXe(e){ke.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function bXe(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 xXe={POSITION:!0,NORMAL:!0,TANGENT:!0},TXe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function EXe(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=TXe[a];l(f)?(u=f+c,t[o]=u):l(xXe[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 CXe(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 L$(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Vu(e,t)}function vXe(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=L$(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function SXe(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=L$(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?L$(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=ba(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}}}rN(e,["accessor","bufferView","buffer"])}function wXe(e){ke.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=jx(e,n);n.min=i.min,n.max=i.max}})}function cge(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 lge(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),cge(n)&&lge(e,i))}}),delete e.nodes[t]}function IXe(e){return ke.node(e,function(t,n){cge(t)&&lge(e,n)}),e}function PXe(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=jx(e,i);i.min=r.min,i.max=r.max}})})}function DXe(e){ke.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=jx(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function RXe(e){e.asset=e.asset??{},e.asset.version="2.0",age(e),fXe(e),IXe(e),dXe(e),hXe(e),pXe(e),_Xe(e),vXe(e),SXe(e),wXe(e),PXe(e),DXe(e),yXe(e),AXe(e),bXe(e),EXe(e),aN(e),CXe(e),tN(e),iN(e),mXe(e)}var OXe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],MXe=["u_diffuse","u_diffuse_mat"];function F$(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function B$(e){return l(e.index)}function k$(e){return Array.isArray(e)&&e.length===4}function uge(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 NXe(e,t){t=t??{};let n=t.baseColorTextureNames??OXe,i=t.baseColorFactorNames??MXe;ke.material(e,function(r){ke.materialValue(r,function(o,s){n.indexOf(s)!==-1&&B$(o)?(F$(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&k$(o)&&(F$(r),r.pbrMetallicRoughness.baseColorFactor=uge(o))})}),Hx(e,"KHR_techniques_webgl"),Hx(e,"KHR_blend")}function N$(e,t){l(t)&&(k$(t)?e.pbrMetallicRoughness.baseColorFactor=uge(t):B$(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function sge(e,t){l(t)&&(k$(t)?e.emissiveFactor=t.slice(0,3):B$(t)&&(e.emissiveTexture=t))}function LXe(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;F$(t),n.technique==="CONSTANT"?(kd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},N$(t,s),N$(t,r)):(N$(t,o),sge(t,r),sge(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")}),Hx(e,"KHR_materials_common")}var cN=oXe;function ll(){}ll.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +`;let d=new Ye({sources:[a]}),p=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._spPick=en.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Hpe(e){let t=e?ei.EQUAL:ei.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:ac.LESS_OR_EQUAL},depthMask:!1}}var sWe={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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},aWe={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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 cWe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(Hpe(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(Hpe(!0)),e._rsColorPass=Ge.fromCache(sWe),e._rsPickPass=Ge.fromCache(aWe))}var Xx=new N,Gpe=new h;function lWe(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,Xx),N.multiplyByPoint(Xx,e._center,Gpe),N.setTranslation(Xx,Gpe,Xx),N.multiply(r,Xx,Xx),Xx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function NK(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 uWe(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=NK(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=NK(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=NK(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 LK(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 fWe(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=LK(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=LK(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=LK(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 dWe(e,t){return t.color.toRgba()-e.color.toRgba()}function hWe(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(dWe),t.webgl2?fWe(e,n):uWe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function mWe(e,t){let n=hWe(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 pWe(e,t){if(e.classificationType===Qn.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 gWe(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}wg.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 na(e,o)}};wg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function _We(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 yWe=new z,AWe=z.WHITE,bWe=!0,xWe=/\$/;wg.prototype.applyStyle=function(e,t){if(!l(e)){_We(this,t);return}let n=e.color,i=n instanceof Ld&&!xWe.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,yWe):AWe,c.show=l(e.show)?e.show.evaluate(c):bWe}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}};wg.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 zp({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 zp({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 Wpe(e,t,n,i){let r=e.classificationType,o=r!==Qn.CESIUM_3D_TILE,s=r!==Qn.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 TWe(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 EWe(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}wg.prototype.update=function(e){let t=e.context;rWe(this,t),oWe(this,t),cWe(this),lWe(this,t);let n=e.passes;n.render&&(mWe(this,t),pWe(this,e),EWe(this),this._debugWireframe?TWe(e,this._commands):Wpe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(gWe(this),Wpe(this,e,this._pickCommands))};wg.prototype.isDestroyed=function(){return!1};wg.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(),le(this)};var Kx=wg;function Df(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=Qn.BOTH}Object.defineProperties(Df.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}}});Df.packedBoxLength=N.packedLength+h.packedLength;Df.packedCylinderLength=N.packedLength+2;Df.packedEllipsoidLength=N.packedLength+h.packedLength;Df.packedSphereLength=h.packedLength+1;function CWe(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 vWe(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]=ue.unpack(t,n),n+=ue.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 zp({color:u,offset:f,count:d,batchIds:g})}return i}var SWe=new Jn("createVectorTileGeometries",5),wWe=new z;function IWe(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,wWe);u[A]=b.toRgba()}f=e._packedBuffer=CWe(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=SWe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);vWe(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),PWe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function PWe(e){l(e._primitive)||(e._primitive=new Kx({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)}Df.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Df.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Df.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Df.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Df.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=IWe(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)};Df.prototype.isDestroyed=function(){return!1};Df.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var Ig=Df;var FK=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,OWe(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 qpe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){qpe(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(),le(this)}};function DWe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function RWe(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 $x=Uint32Array.BYTES_PER_ELEMENT;function OWe(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=$x;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=$x;let s=r.getUint32(n,!0);if(n+=$x,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=$x,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=$x;let u=r.getUint32(n,!0);n+=$x;let f=r.getUint32(n,!0);n+=$x;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 rm(e,T,g,m,DWe(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=RWe(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,Ig.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,Ig.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,Ig.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,Ig.packedSphereLength*x)}return e._geometries=new Ig({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 qpe(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 YM=FK;var BK={};BK.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),Ype(i,r,o,s);return c};BK.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)),Ype(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function Ype(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 Uv=BK;var Jx=30,MWe=1<<Jx,NWe=1<<Jx+1>>>0,kK=2*Jx+1,Zy=4,$pe=[],Jpe=[],LWe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Qy=1,zv=2,M6=[Qy,0,0,Qy|zv];function Hs(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Hs.getLevel(e)}Hs.fromToken=function(e){return new Hs(Hs.getIdFromToken(e))};Hs.isValidId=function(e){return!(e<=0||e>>BigInt(kK)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Hs.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Hs.isValidId(Hs.getIdFromToken(e)):!1};Hs.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Hs.getTokenFromId=function(e){let t=Math.floor(WWe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Hs.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Jx-(t>>1)};Hs.prototype.getChild=function(e){let t=e0e(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Hs(n)};Hs.prototype.getParent=function(){let e=e0e(this._cellId)<<BigInt(2);return new Hs(this._cellId&~e+BigInt(1)|e)};Hs.prototype.getParentAtLevel=function(e){let t=HWe(e);return new Hs(this._cellId&-t|t)};Hs.prototype.getCenter=function(e){e=e??ee.WGS84;let t=FWe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Hs.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=BWe(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)};Hs.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(kK-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Hs(a)};function FWe(e,t){let n=kWe(e,t);return UWe(n[0],n[1],n[2])}function BWe(e,t,n){let i=Zpe(e,t),r=zWe([i[1],i[2]],t),o=n>>1&1;return Qpe(i[0],r[0][o^n&1],r[1][o])}function kWe(e,t){let n=Zpe(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 Zpe(e){$pe.length===0&&jWe();let t=Number(e>>BigInt(kK)),n=t&Qy,i=(1<<Zy)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Jx-7*Zy:Zy))-1;n+=Number(e>>BigInt(s*2*Zy+1)&BigInt(c))<<2,n=Jpe[n];let u=s*Zy;r+=n>>Zy+2<<u,o+=(n>>2&i)<<u,n&=Qy|zv}return[t,r,o]}function UWe(e,t,n){let i=Xpe(t),r=Xpe(n),o=N6(i),s=N6(r);return Qpe(e,o,s)}function Qpe(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 N6(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Xpe(e){return 1/NWe*e}function zWe(e,t){let n=[[],[]],i=VWe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=N6(Kpe(o)),n[r][1]=N6(Kpe(s))}return n}function VWe(e){return 1<<Jx-e>>>0}function Kpe(e){return 1/MWe*e}function eA(e,t,n,i,r,o){if(e===Zy){let s=(t<<Zy)+n;$pe[(s<<2)+i]=(r<<2)+o,Jpe[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=LWe[o];eA(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^M6[0]),eA(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^M6[1]),eA(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^M6[2]),eA(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^M6[3])}}function jWe(){eA(0,0,0,0,0,0),eA(0,0,0,Qy,0,Qy),eA(0,0,0,zv,0,zv),eA(0,0,0,Qy|zv,0,Qy|zv)}function e0e(e){return e&~e+BigInt(1)}function HWe(e){return BigInt(1)<<BigInt(2*(Jx-e))}var GWe=[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 WWe(e){return GWe[(-e&e)%BigInt(67)]}var Pg=Hs;function qWe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var tr=qWe;function UK(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=YWe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function YWe(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(UK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});UK.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 Vv=UK;function Dg(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(Dg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Dg.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Dg.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Dg.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Dg.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Dg.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Dg.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Dg.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var jv=Dg;var XM={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};XM.getBranchingFactor=function(e){switch(e){case XM.OCTREE:return 8;case XM.QUADTREE:return 4}};Object.freeze(XM);var Gs=XM;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 Rg(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(Rg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Rg.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Rg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Rg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Rg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Rg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var KM=Rg;var fn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},rl={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};fn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:rl.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:rl.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:rl.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:rl.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:rl.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:rl.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:rl.INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:rl.UNSIGNED_INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:rl.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:rl.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!==rl.FLOAT};fn.isUnsignedIntegerType=function(e){return fn.typeInfo[e].category===rl.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 oo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};oo.isVectorType=function(e){switch(e){case oo.VEC2:case oo.VEC3:case oo.VEC4:return!0;default:return!1}};oo.isMatrixType=function(e){switch(e){case oo.MAT2:case oo.MAT3:case oo.MAT4:return!0;default:return!1}};oo.getComponentCount=function(e){switch(e){case oo.SCALAR:case oo.STRING:case oo.ENUM:case oo.BOOLEAN:return 1;case oo.VEC2:return 2;case oo.VEC3:return 3;case oo.VEC4:return 4;case oo.MAT2:return 4;case oo.MAT3:return 9;case oo.MAT4:return 16}};oo.getMathType=function(e){switch(e){case oo.VEC2:return U;case oo.VEC3:return h;case oo.VEC4:return se;case oo.MAT2:return Xi;case oo.MAT3:return $;case oo.MAT4:return N;default:return}};Object.freeze(oo);var bt=oo;function os(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)}os.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=XWe(n),r=KWe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new os({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(os.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 XWe(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 KWe(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}}os.prototype.normalize=function(e){return this._normalized?zK(e,this._valueType,Lt.normalize):e};os.prototype.unnormalize=function(e){return this._normalized?zK(e,this._valueType,Lt.unnormalize):e};os.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:os.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};os.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:os.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};os.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)};os.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!r0e(e,t))return e};function $M(e){return Array.isArray(e)&&!(e instanceof Xi)&&!(e instanceof $)&&!(e instanceof N)}function r0e(e,t){if(!$M(e))return e===t;if(!$M(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r0e(e[n],t[n]))return!1;return!0}os.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};os.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};os.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?$We(this,e):o0e(this,e)};function $We(e,t){if(!$M(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=o0e(e,t[i]);if(l(r))return r}}function o0e(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?JWe(t,n,i):bt.isMatrixType(n)?ZWe(t,n,i):n===bt.STRING?QWe(t):n===bt.BOOLEAN?eqe(t):n===bt.ENUM?tqe(t,r):nqe(t,i,o)}function JWe(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 ZWe(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 QWe(e){if(typeof e!="string")return L6(e,bt.STRING)}function eqe(e){if(typeof e!="boolean")return L6(e,bt.BOOLEAN)}function tqe(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 nqe(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"?L6(e,t):isFinite(e)?n0e(e,t,n):i0e(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?L6(e,t):i==="number"&&!isFinite(e)?i0e(e,t):n0e(e,t,n)}}function L6(e,t){return`value ${e} does not match type ${t}`}function t0e(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function n0e(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?t0e(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return t0e(e,t,n)}function i0e(e,t){return`value ${e} of type ${t} must be finite`}function zK(e,t,n){if(!$M(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=zK(e[i],t,n);return e}os.valueTransformInPlace=function(e,t,n,i){if(!$M(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=os.valueTransformInPlace(e[r],t[r],n[r],i);return e};os.prototype.cpuBytesPerElement=function(){return s0e(this,this.valueType)};os.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return s0e(this,e)};function s0e(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}os.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var VK=[void 0,"float","vec2","vec3","vec4"],a0e=[void 0,"int","ivec2","ivec3","ivec4"],iqe=[void 0,"uint","uvec2","uvec3","uvec4"],rqe={[rl.FLOAT]:"uintBitsToFloat",[rl.INTEGER]:"int",[rl.UNSIGNED_INTEGER]:""};os.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?VK[e]:a0e[e]};os.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?VK[t]:Lt.isUnsignedIntegerType(e)?iqe[t]:a0e[t]};os.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=`${VK[s]} ${f} = ${e};`;i.push(y);let A=rqe[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};os.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Vp=os;function JM(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 jK(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 jK(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 jK(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=c0e(v),S=c0e(S);let R,O,L=this;f?R=function(_){return aqe(_,L._values,L._stringOffsets)}:d?(R=function(_){return cqe(_,L._values)},O=function(_,C){lqe(_,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(JM.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}}});JM.prototype.get=function(e){let t=oqe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=_qe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};JM.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=yqe(this,t),t=n.unnormalize(t),sqe(this,e,t)};JM.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function c0e(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)?ti(t,i):t.push(i)}return t}function oqe(e,t){u0e(e)&&f0e(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):l0e(e,n,t)}function l0e(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 sqe(e,t,n){pqe(e,t,n)&&f0e(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 aqe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return ku(t.typedArray,i,r)}function cqe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function lqe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function uqe(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 fqe(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 dqe(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 hqe(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 mqe(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 u0e(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 pqe(e,t,n){if(u0e(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 f0e(e){e._unpackedValues=gqe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function gqe(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]=l0e(e,i,a);return n}function _qe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Vp.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function yqe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Vp.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function jK(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 fqe(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 uqe(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 hqe(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 dqe(a,i)});else{let a=mqe(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 ZM=JM;function sm(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 ZM({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(sm.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}}});sm.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};sm.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};sm.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};sm.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=Aqe(this._class,t),i};sm.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};sm.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)};sm.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};sm.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};sm.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function Aqe(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 Fd=sm;var HK=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(),le(this)}},nr=HK;var d0e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(d0e);var Tt=d0e;var F6=class extends nr{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=bqe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function bqe(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await F6._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 Zx=F6;function xqe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var tA=xqe;var UTn=(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 nA=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O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cjjjjjd: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:cjbp9Upmbedil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AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;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 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 jTn=(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;8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HalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;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:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJb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Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na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UdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za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ia8:Na9EMg8Va8VMMa88Na9Ca89Na9Ha88Na9FMg8Va8VMMa89Na9Da8:Na9Ja89Na9GMg8Va8VMMa8: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:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkk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aPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;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: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damaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;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 GTn=(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: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 qTn=(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:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdnd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dbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN: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 GK=class extends nr{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=tA(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=Tqe(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 Tqe(e){try{let t=Eqe(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);nA.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 Eqe(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 Hv=GK;var Qx=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Jn("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])}};Qx._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Qx._decoderTaskProcessor=void 0;Qx._taskProcessorReady=!1;Qx._error=void 0;var Og=Qx;var Mn={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 Cqe(e){switch(e){case Mn.POSITION:return"positionMC";case Mn.NORMAL:return"normalMC";case Mn.TANGENT:return"tangentMC";case Mn.TEXCOORD:return"texCoord";case Mn.COLOR:return"color";case Mn.JOINTS:return"joints";case Mn.WEIGHTS:return"weights";case Mn.FEATURE_ID:return"featureId";case Mn.SCALE:return"scale";case Mn.ROTATION:return"rotation";case Mn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Mn.hasSetIndex=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:case Mn.CUMULATIVE_DISTANCE:return!1;case Mn.TEXCOORD:case Mn.COLOR:case Mn.JOINTS:case Mn.WEIGHTS:case Mn.FEATURE_ID:case Mn.SCALE:case Mn.ROTATION:return!0}};Mn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Mn.POSITION;case"NORMAL":return Mn.NORMAL;case"TANGENT":return Mn.TANGENT;case"TEXCOORD":return Mn.TEXCOORD;case"COLOR":return Mn.COLOR;case"JOINTS":return Mn.JOINTS;case"WEIGHTS":return Mn.WEIGHTS;case"_FEATURE_ID":return Mn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Mn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Mn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Mn.CUMULATIVE_DISTANCE}};Mn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Mn.POSITION;case"RGBA":case"RGB":case"RGB565":return Mn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Mn.NORMAL;case"BATCH_ID":return Mn.FEATURE_ID}};Mn.getGlslType=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:return"vec3";case Mn.TEXCOORD:return"vec2";case Mn.COLOR:return"vec4";case Mn.JOINTS:return"ivec4";case Mn.WEIGHTS:return"vec4";case Mn.FEATURE_ID:return"int";case Mn.SCALE:return"vec3";case Mn.ROTATION:return"vec4";case Mn.CUMULATIVE_DISTANCE:return"float";case Mn.OPACITY:return"float"}};Mn.getVariableName=function(e,t){let n=Cqe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Mn);var ct=Mn;var WK=class extends nr{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=vqe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._dracoError)&&h0e(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=wqe(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=Og.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=Sqe(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 vqe(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;h0e(e,n)}}function h0e(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load Draco",t)}async function Sqe(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 eT={};eT[ct.POSITION]="POSITION";eT[ct.NORMAL]="NORMAL";eT[ct.COLOR]="COLOR";eT[ct.TEXCOORD]="TEX_COORD";function wqe(e){for(let t in eT)if(eT.hasOwnProperty(t)&&e.startsWith(t))return eT[t]}var Gv=WK;function Iqe(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 Mg=Iqe;var QM=class extends nr{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=Pqe(this),this._promise):(this._promise=Dqe(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 m0e(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 Pqe(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 Oqe(i);if(e.isDestroyed())return;let o=m0e(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(n){return e.isDestroyed()?void 0:p0e(e,n,"Failed to load embedded image")}}async function Dqe(e){e._state=Tt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await Nqe(i);if(e.isDestroyed())return;let o=m0e(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(r){return e.isDestroyed()?void 0:p0e(e,r,`Failed to load image: ${n}`)}}function p0e(e,t,n){return e.unload(),e._state=Tt.FAILED,Promise.reject(e.getError(n,t))}function Rqe(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 Oqe(e){let t=Rqe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ou(n)}return QM._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var Mqe=/(^data:image\/ktx2)|(\.ktx2$)/i;function Nqe(e){let t=e.getUrlComponent(!1,!0);return Mqe.test(t)?Ou(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}QM._loadImageFromTypedArray=Mg;var Wv=QM;var g0e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(g0e);var Oc=g0e;var qK=class extends nr{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=Fqe(this),this._promise):(this._promise=Bqe(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){XK(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=Lqe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Oc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=_0e(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}},YK=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=_0e(this.typedArray,this.indexDatatype,this.context)}};function _0e(e,t,n){let i=nt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var Lqe=new YK;async function Fqe(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;XK(e,n)}}async function Bqe(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=kqe(e,a),e._state=Tt.PROCESSING,e}catch(s){if(e.isDestroyed())return;XK(e,s)}}function kqe(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,qr("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 XK(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load index buffer",t)}var qv=qK;function Uqe(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 ga=Uqe;function zqe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Go=zqe;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 Go(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 Go(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 Go(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 Vqe(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 Rf=Vqe;function jqe(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)*Rf(t.type)}var Vu=jqe;function Hqe(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=ga(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=Vu(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)&&tT(c)}),tT(n.emissiveTexture),tT(n.normalTexture),tT(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,tT(s.baseColorTexture),tT(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,tT(a.specularGlossinessTexture))}),ke.animation(e,function(n){ke.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=Gqe(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 Gqe(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 tT(e){l(e)&&(e.texCoord=e.texCoord??0)}var eN=Hqe;function Wqe(e){return ke.shader(e,function(t){B6(t)}),ke.buffer(e,function(t){B6(t)}),ke.image(e,function(t){B6(t)}),B6(e),e}function B6(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var iA=Wqe;function qqe(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 tN=qqe;function Yqe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),tN(e,t),n.length===0&&delete e.extensionsUsed}}var nT=Yqe;var Xqe=4;function Kqe(e){if(im(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=y0e(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?$qe(e,n):Jqe(e,n)}function y0e(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*Xqe,!0);return r}function $qe(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=ku(e,o,i),c=JSON.parse(a);iA(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 nT(c,"KHR_binary_glTF"),c}function Jqe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=y0e(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=ku(u);r=JSON.parse(f),iA(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 iT=Kqe;function Zqe(e){return ke.shader(e,function(t){k6(t)}),ke.buffer(e,function(t){k6(t)}),ke.image(e,function(t){k6(t)}),k6(e),e}function k6(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var nN=Zqe;function Qqe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ga(n,t,!0)}var Bd=Qqe;function eYe(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 Ng=eYe;function tYe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=Rf(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=Vu(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=Ng(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 rT=tYe;var nYe=[te.FUNC_ADD,te.FUNC_ADD],iYe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function A0e(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var rYe=[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 oYe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(rYe.indexOf(e[n])===-1)return t;return e}function sYe(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(A0e(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??nYe,blendFactors:oYe(c.blendFuncSeparate,iYe)})}A0e(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Bd(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 iN=sYe;function aYe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ga(n,t,!0),Bd(e,t)}var rN=aYe;function cYe(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=ga(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=ga(o.shaders,m,!0),u.program=ga(o.programs,p),r[a.program]=u.program}i[c]=ga(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Bd(e,"KHR_techniques_webgl"),rN(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 oN=cYe;function lYe(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 Yv=lYe;var b0e=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function uYe(e,t){return t=t??b0e,b0e.forEach(function(n){t.indexOf(n)>-1&&dYe(e,n)}),e}var fYe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function dYe(e,t){let n=fYe[t],i=e[n];if(l(i)){let r=0,o=Hp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(jp[t](e,a-r),r++)}}function jp(){}jp.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--})})};jp.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--}})};jp.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--}),Go(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--})}),Go(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(Go(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--}}}}};jp.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})};jp.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)})};jp.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})})};jp.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--})})};jp.sampler=function(e,t){e.samplers.splice(t,1),ke.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};jp.texture=function(e,t){if(e.textures.splice(t,1),ke.material(e,function(i){Yv(i,function(r,o){o.index>t&&--o.index})}),Go(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(Go(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}}}})}),Go(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 Hp(){}Hp.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)})}),Go(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})}),Go(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};Hp.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};Hp.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)}),Go(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)})}),Go(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(Go(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};Hp.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};Hp.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 x0e(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!x0e(e,r,n)}).length===0}Hp.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){x0e(e,i,t)||(t[i]=!0)}),t};Hp.material=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Hp.texture=function(e){let t={};if(ke.material(e,function(n){Yv(n,function(i){t[i]=!0})}),Go(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(Go(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)}}}})}),Go(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};Hp.sampler=function(e){let t={};return ke.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var sN=uYe;function hYe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:ga(e.buffers,n),byteOffset:0,byteLength:t.length};return ga(e.bufferViews,r)}var aN=hYe;function mYe(e,t){let n=Vu(e,t),i=Y.getSizeInBytes(t.componentType),r=Rf(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=Ng(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 cN=mYe;function pYe(e){let t;return ke.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?U6(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&U6(e,i,Y.UNSIGNED_SHORT)}),ke.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?U6(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&U6(e,i,Y.UNSIGNED_SHORT)}),e}function U6(e,t,n){let i=Y.createTypedArray(n,cN(e,t)),r=new Uint8Array(i.buffer);t.bufferView=aN(e,r),t.componentType=n,t.byteOffset=0}var lN=pYe;function gYe(e,t){return nT(e,t),t==="CESIUM_RTC"&&_Ye(e),KK(e,t)}function _Ye(e){ke.technique(e,function(t){ke.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function KK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)KK(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)&&KK(e[r],t);return i}}var oT=gYe;var z6={.8:EYe,"1.0":GYe,"2.0":void 0};function yYe(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(z6,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(z6,i)||(i="1.0"));let r=z6[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=z6[i];return t.keepLegacyExtensions||(YYe(e,t),XYe(e)),e}function C0e(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 AYe(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 bYe(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 xYe(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=Rf(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 TYe(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 EYe(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,C0e(e),AYe(e),bYe(e),xYe(e),TYe(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,Bd(e,"KHR_materials_common")}}function CYe(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 T0e(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 vYe(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]=T0e(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=ga(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=T0e(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 SYe(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){delete n.name})})}function wYe(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 IYe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var PYe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function DYe(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(PYe[r])&&e.extensionsRequired.push(r)}}}function RYe(e){ke.buffer(e,function(t){delete t.type})}function OYe(e){ke.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function MYe(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 NYe={POSITION:!0,NORMAL:!0,TANGENT:!0},LYe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function FYe(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=LYe[a];l(f)?(u=f+c,t[o]=u):l(NYe[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 BYe(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 JK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Vu(e,t)}function kYe(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=JK(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function UYe(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=JK(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?JK(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=ga(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}}}sN(e,["accessor","bufferView","buffer"])}function zYe(e){ke.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=rT(e,n);n.min=i.min,n.max=i.max}})}function v0e(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 S0e(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),v0e(n)&&S0e(e,i))}}),delete e.nodes[t]}function VYe(e){return ke.node(e,function(t,n){v0e(t)&&S0e(e,n)}),e}function jYe(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=rT(e,i);i.min=r.min,i.max=r.max}})})}function HYe(e){ke.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=rT(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function GYe(e){e.asset=e.asset??{},e.asset.version="2.0",C0e(e),CYe(e),VYe(e),vYe(e),SYe(e),IYe(e),DYe(e),kYe(e),UYe(e),zYe(e),jYe(e),HYe(e),RYe(e),OYe(e),MYe(e),FYe(e),lN(e),BYe(e),iN(e),oN(e),wYe(e)}var WYe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],qYe=["u_diffuse","u_diffuse_mat"];function ZK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function QK(e){return l(e.index)}function e$(e){return Array.isArray(e)&&e.length===4}function w0e(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 YYe(e,t){t=t??{};let n=t.baseColorTextureNames??WYe,i=t.baseColorFactorNames??qYe;ke.material(e,function(r){ke.materialValue(r,function(o,s){n.indexOf(s)!==-1&&QK(o)?(ZK(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&e$(o)&&(ZK(r),r.pbrMetallicRoughness.baseColorFactor=w0e(o))})}),oT(e,"KHR_techniques_webgl"),oT(e,"KHR_blend")}function $K(e,t){l(t)&&(e$(t)?e.pbrMetallicRoughness.baseColorFactor=w0e(t):QK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function E0e(e,t){l(t)&&(e$(t)?e.emissiveFactor=t.slice(0,3):QK(t)&&(e.emissiveTexture=t))}function XYe(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;ZK(t),n.technique==="CONSTANT"?(Bd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},$K(t,s),$K(t,r)):($K(t,o),E0e(t,r),E0e(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")}),oT(e,"KHR_materials_common")}var uN=yYe;function ol(){}ol.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};ll.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)};ll.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}};ll.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}};ll.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}};ll.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};ll.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 FXe=new h,BXe=new h;ll.getPositionMinMax=function(e,t,n){let i=ll.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,BXe),r=h.add(r,n,FXe)),{min:o,max:r}};ll.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===Vi.Y?n=N.clone(Vi.Y_UP_TO_Z_UP,n):e===Vi.X&&(n=N.clone(Vi.X_UP_TO_Z_UP,n)),t===Vi.Z&&(n=N.multiplyTransformation(n,Vi.Z_UP_TO_X_UP,n)),n};var kXe=new $;ll.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Ui.BACK;let n=N.getMatrix3(e,kXe);return $.determinant(n)<0?Ui.FRONT:Ui.BACK};ll.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};ll.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};ll.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!ll.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=ll;var U$=class extends er{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=fge(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=dge(this,this._typedArray),this._promise):(this._promise=UXe(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 UXe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;z$(e,n)}return dge(e,t)}function z$(e,t){e.unload(),e._state=Tt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function zXe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Go(t,"KHR_techniques_webgl")&&!Go(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),cN(t)}function VXe(e){let t=[];return ke.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Vh(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function jXe(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 fge(e,t){try{oA(t),await VXe(t),await zXe(e,t),ZM(t),await jXe(e,t),eN(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;z$(e,n)}}async function dge(e,t){let n;try{tm(t)==="glTF"?n=Vx(t):n=Do(t)}catch(i){if(e.isDestroyed())return;z$(e,i)}return fge(e,n)}var tS=U$;var Dr={},V$=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}},j$=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}},H$=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},G$=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}},W$=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}},q$=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}},Y$=class{constructor(){this.attributes=[]}},X$=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}},$$=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},J$=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}},Z$=class{constructor(){this.nodes=[]}},HXe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},Q$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},eJ=class{constructor(){this.node=void 0,this.path=void 0}},tJ=class{constructor(){this.sampler=void 0,this.target=void 0}},nJ=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},iJ=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},rJ=class{constructor(){this.name=void 0,this.stages=[]}},Q6=class{constructor(){this.credits=[]}},oJ=class{constructor(){this.asset=new Q6,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={}}},sJ=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}},sA=class sA{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(sA.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=sA.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=sA.DEFAULT_ROUGHNESS_FACTOR}};ut(sA,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(sA,"DEFAULT_METALLIC_FACTOR",1),ut(sA,"DEFAULT_ROUGHNESS_FACTOR",1);var eH=sA,aA=class aA{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(aA.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(aA.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=aA.DEFAULT_GLOSSINESS_FACTOR}};ut(aA,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(aA,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(aA,"DEFAULT_GLOSSINESS_FACTOR",1);var aJ=aA,nS=class nS{constructor(){this.specularFactor=nS.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(nS.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(nS,"DEFAULT_SPECULAR_FACTOR",1),ut(nS,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var cJ=nS,iS=class iS{constructor(){this.anisotropyStrength=iS.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=iS.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(iS,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(iS,"DEFAULT_ANISOTROPY_ROTATION",0);var lJ=iS,rS=class rS{constructor(){this.clearcoatFactor=rS.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=rS.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(rS,"DEFAULT_CLEARCOAT_FACTOR",0),ut(rS,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var uJ=rS,fJ=class{constructor(){ut(this,"width");ut(this,"pattern")}},tH=class tH{constructor(t={}){let{wireframeFill:n=tH.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(tH,"DEFAULT_WIREFRAME_FILL",0);var dJ=tH,nH=class nH{constructor(){this.metallicRoughness=new eH,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(nH.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Sp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(nH,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var hJ=nH,mJ=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},pJ=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Dr.Quantization=V$;Dr.Attribute=j$;Dr.Indices=H$;Dr.FeatureIdAttribute=G$;Dr.FeatureIdTexture=q$;Dr.FeatureIdImplicitRange=W$;Dr.MorphTarget=Y$;Dr.Primitive=X$;Dr.Instances=K$;Dr.Skin=$$;Dr.Node=J$;Dr.Scene=Z$;Dr.AnimatedPropertyType=Object.freeze(HXe);Dr.AnimationSampler=Q$;Dr.AnimationTarget=eJ;Dr.AnimationChannel=tJ;Dr.Animation=nJ;Dr.ArticulationStage=iJ;Dr.Articulation=rJ;Dr.Asset=Q6;Dr.Components=oJ;Dr.TextureReader=sJ;Dr.MetallicRoughness=eH;Dr.SpecularGlossiness=aJ;Dr.Specular=cJ;Dr.Anisotropy=lJ;Dr.Clearcoat=uJ;Dr.PlanarFill=dJ;Dr.LineStyle=fJ;Dr.Material=hJ;Dr.Vector=pJ;Dr.Polygon=mJ;var Tn=Dr;var iH={};iH.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};iH.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=$n.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),$n.validate(a)||(a=$n.LINEAR),new jt({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var GXe=new U(1,1);iH.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):GXe;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 Tn.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 ju=iH;var gJ=class extends er{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=ju.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=qXe(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=WXe;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=hge(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}},_J=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=hge(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function hge(e,t,n,i,r,o){let s=i.internalFormat,a=!1;Ke.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=ju.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=qy(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var WXe=new _J;async function qXe(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 oS=gJ;var yJ=class extends er{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=KXe(this),this._promise):YXe(this._draco,this._attributeSemantic)?(this._promise=QXe(this),this._promise):(this._promise=tKe(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){rH(this,r)}eKe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){rH(this,r)}ZXe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=nKe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Oc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=mge(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 YXe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function XXe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Tn.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 KXe(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 $Xe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function JXe(e){let t=$Xe(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 ZXe(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}=JXe(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 QXe(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;rH(e)}}function eKe(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=XXe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function tKe(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;rH(e,n)}}function rH(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load vertex buffer",t)}var AJ=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=mge(this.typedArray,this.context)}};function mge(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var nKe=new AJ,sS=yJ;var pge={};async function iKe(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(()=>cKe);var u=ce(pge.url)}var f="./this.program",d=pge.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),Ze;ne<Te;++ne)Ze=ce.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 ce=Zb.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 P(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 M;async function F(ce){return ce}async function V(ce){var ne=M;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),P(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(wt){if(wt=Te(wt),wt.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],wt[bn])}ce.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=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"}},Se=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(Ze=>Ze()))}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}`)}},Xe=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},$e=!1,Pe=()=>{},qe=ce=>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(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),Gt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Ze){if(!ce[ne].U.hasOwnProperty(Ze.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Ze.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Ze.length].apply(this,Ze)},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 Xt(ce,ne,Te,Ce,Ze,Et,pt,wt){this.name=ce,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=(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 Bi(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 Xn(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,qi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function bi(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 Wi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=Wi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),wi={},hi=(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 wi[ne]},xi=(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 jn(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n){this.name=ce,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:bi,this.T=null)}var nn=(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)},Wn=(ce,ne)=>{ce=ge(ce);var Te=nD.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Zi extends Error{}var Mr=ce=>{ce=Jb(ce);var ne=ge(ce);return vp(ce),ne},fo=(ce,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(`${ce}: `+Ce.map(Mr).join([", "]))},Bs=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function Ks(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function no(ce,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=[ce,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}) { +${r.stack}`),r};ol.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)};ol.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}};ol.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}};ol.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}};ol.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};ol.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 KYe=new h,$Ye=new h;ol.getPositionMinMax=function(e,t,n){let i=ol.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,$Ye),r=h.add(r,n,KYe)),{min:o,max:r}};ol.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===Hi.Y?n=N.clone(Hi.Y_UP_TO_Z_UP,n):e===Hi.X&&(n=N.clone(Hi.X_UP_TO_Z_UP,n)),t===Hi.Z&&(n=N.multiplyTransformation(n,Hi.Z_UP_TO_X_UP,n)),n};var JYe=new $;ol.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Vi.BACK;let n=N.getMatrix3(e,JYe);return $.determinant(n)<0?Vi.FRONT:Vi.BACK};ol.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};ol.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};ol.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!ol.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=ol;var t$=class extends nr{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=I0e(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=P0e(this,this._typedArray),this._promise):(this._promise=ZYe(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 ZYe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;n$(e,n)}return P0e(e,t)}function n$(e,t){e.unload(),e._state=Tt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function QYe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Go(t,"KHR_techniques_webgl")&&!Go(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),uN(t)}function eXe(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 tXe(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 I0e(e,t){try{iA(t),await eXe(t),await QYe(e,t),eN(t),await tXe(e,t),nN(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;n$(e,n)}}async function P0e(e,t){let n;try{im(t)==="glTF"?n=iT(t):n=Ro(t)}catch(i){if(e.isDestroyed())return;n$(e,i)}return I0e(e,n)}var Xv=t$;var D0e={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(D0e);var Gp=D0e;var Pr={},i$=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}},r$=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}},o$=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},s$=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}},a$=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}},c$=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}},l$=class{constructor(){this.attributes=[]}},u$=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}},f$=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},d$=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},h$=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}},m$=class{constructor(){this.nodes=[]}},nXe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},p$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},g$=class{constructor(){this.node=void 0,this.path=void 0}},_$=class{constructor(){this.sampler=void 0,this.target=void 0}},y$=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},A$=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},b$=class{constructor(){this.name=void 0,this.stages=[]}},V6=class{constructor(){this.credits=[]}},x$=class{constructor(){this.asset=new V6,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={}}},T$=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}},rA=class rA{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(rA.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=rA.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=rA.DEFAULT_ROUGHNESS_FACTOR}};ut(rA,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(rA,"DEFAULT_METALLIC_FACTOR",1),ut(rA,"DEFAULT_ROUGHNESS_FACTOR",1);var j6=rA,oA=class oA{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(oA.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(oA.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=oA.DEFAULT_GLOSSINESS_FACTOR}};ut(oA,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(oA,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(oA,"DEFAULT_GLOSSINESS_FACTOR",1);var E$=oA,Kv=class Kv{constructor(){this.specularFactor=Kv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(Kv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(Kv,"DEFAULT_SPECULAR_FACTOR",1),ut(Kv,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var C$=Kv,$v=class $v{constructor(){this.anisotropyStrength=$v.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=$v.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut($v,"DEFAULT_ANISOTROPY_STRENGTH",0),ut($v,"DEFAULT_ANISOTROPY_ROTATION",0);var v$=$v,Jv=class Jv{constructor(){this.clearcoatFactor=Jv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=Jv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(Jv,"DEFAULT_CLEARCOAT_FACTOR",0),ut(Jv,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var S$=Jv,w$=class{constructor(){ut(this,"width");ut(this,"pattern")}},H6=class H6{constructor(t={}){let{wireframeFill:n=H6.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(H6,"DEFAULT_WIREFRAME_FILL",0);var I$=H6,G6=class G6{constructor(){this.metallicRoughness=new j6,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(G6.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Gp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(G6,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var P$=G6,D$=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},R$=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Pr.Quantization=i$;Pr.Attribute=r$;Pr.Indices=o$;Pr.FeatureIdAttribute=s$;Pr.FeatureIdTexture=c$;Pr.FeatureIdImplicitRange=a$;Pr.MorphTarget=l$;Pr.Primitive=u$;Pr.Instances=f$;Pr.Skin=d$;Pr.Node=h$;Pr.Scene=m$;Pr.AnimatedPropertyType=Object.freeze(nXe);Pr.AnimationSampler=p$;Pr.AnimationTarget=g$;Pr.AnimationChannel=_$;Pr.Animation=y$;Pr.ArticulationStage=A$;Pr.Articulation=b$;Pr.Asset=V6;Pr.Components=x$;Pr.TextureReader=T$;Pr.MetallicRoughness=j6;Pr.SpecularGlossiness=E$;Pr.Specular=C$;Pr.Anisotropy=v$;Pr.Clearcoat=S$;Pr.PlanarFill=I$;Pr.LineStyle=w$;Pr.Material=P$;Pr.Vector=R$;Pr.Polygon=D$;var Cn=Pr;var W6={};W6.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};W6.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=Zn.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),Zn.validate(a)||(a=Zn.LINEAR),new Ht({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var iXe=new U(1,1);W6.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):iXe;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 ju=W6;function rXe(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 sA=rXe;var O$=class extends nr{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=ju.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=sXe(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=oXe;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=R0e(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}},M$=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=R0e(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function R0e(e,t,n,i,r,o){let s=i.internalFormat,a=!1;Ke.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=ju.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=sA(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var oXe=new M$;async function sXe(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 Zv=O$;var N$=class extends nr{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=lXe(this),this._promise):aXe(this._draco,this._attributeSemantic)?(this._promise=hXe(this),this._promise):(this._promise=pXe(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){q6(this,r)}mXe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){q6(this,r)}dXe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=gXe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Oc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=O0e(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 aXe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function cXe(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 lXe(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 uXe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function fXe(e){let t=uXe(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 dXe(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}=fXe(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 hXe(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;q6(e)}}function mXe(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=cXe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function pXe(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;q6(e,n)}}function q6(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load vertex buffer",t)}var L$=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=O0e(this.typedArray,this.context)}};function O0e(e,t){let n=nt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var gXe=new L$,Qv=N$;var M0e={};async function _Xe(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(()=>TXe);var u=ce(M0e.url)}var f="./this.program",d=M0e.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),Ze;ne<Te;++ne)Ze=ce.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 ce=Zb.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 P(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 M;async function F(ce){return ce}async function V(ce){var ne=M;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),P(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(wt){if(wt=Te(wt),wt.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],wt[bn])}ce.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=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"}},Se=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(Ze=>Ze()))}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}`)}},Xe=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},$e=!1,Pe=()=>{},qe=ce=>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(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),Gt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Ze){if(!ce[ne].U.hasOwnProperty(Ze.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Ze.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Ze.length].apply(this,Ze)},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 Xt(ce,ne,Te,Ce,Ze,Et,pt,wt){this.name=ce,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=(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 Bi(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 Xn(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,qi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function bi(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 Wi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=Wi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),wi={},hi=(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 wi[ne]},xi=(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 jn(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n){this.name=ce,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:bi,this.T=null)}var nn=(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)},Wn=(ce,ne)=>{ce=ge(ce);var Te=nD.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Zi extends Error{}var Mr=ce=>{ce=Jb(ce);var ne=ge(ce);return vp(ce),ne},fo=(ce,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(`${ce}: `+Ce.map(Mr).join([", "]))},Bs=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function Ks(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function no(ce,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=[ce,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}); @@ -5160,7 +4465,46 @@ OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEv \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,vy.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 aS=(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},rKe=e=>1/(1+Math.exp(-e)),oKe=e=>t=>t*e+.5,sKe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:aS(e,t.positions),scales:aS(e,t.scales,Math.exp),rotations:aS(e,t.rotations),alphas:aS(e,t.alphas,rKe),colors:aS(e,t.colors,oKe(i)),sh:aS(e,t.sh)}},aKe=(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))},gge=async(e,t)=>{var n;let i=await iKe(),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=sKe(i,a,t);return aKe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var cKe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lKe=[0,9,24,45],uKe=14,fKe=1.6*1024*1024*1024;function dKe(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 hKe(e,t){let n=uKe+(lKe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var bJ=class extends er{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=mKe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._spzError)&&xJ(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=dKe(this._gltf,this._primitive);if(l(n)){let r=hKe(n.numPoints,n.shDegree);if(r>fKe){let o=Math.round(r/1048576);return xJ(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=gge(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=pKe(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 mKe(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;xJ(e,n)}}function xJ(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load SPZ",t)}async function pKe(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 lN=bJ;function uN(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)}uN.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=qp.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new uN({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(uN.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}}});uN.BATCH_TABLE_CLASS_NAME="_batchTable";var rm=uN;function oH(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)}oH.fromJson=function(e){return new oH({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(oH.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 fN=oH;function sH(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)}sH.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return fN.fromJson(r)});return new sH({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(sH.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 dN=sH;function aH(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)}aH.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=dN.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]=rm.fromJson({id:i,class:e.classes[i],enums:t}));return new aH({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(aH.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 Kl=aH;var TJ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Kl.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=gKe(this),this._promise)}unload(){this._schema=void 0}};async function gKe(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Kl.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 cA=TJ;var Ud={};function cS(e){return Td(e.url)}function hN(e){let{byteOffset:t,byteLength:n}=e,i=iA(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function _Ke(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function _ge(e,t){return`${cS(e)}-buffer-id-${t}`}function lS(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return cS(r)}return _ge(n,t)}function EJ(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=lS(a,s,n,i),u=hN(o);return`${c}-range-${u}`}function yge(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=lS(a,s,n,i),u=hN(o);return`${c}-range-${u}`}function Age(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 cS(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=lS(u,c,n,i),d=hN(a);return`${f}-range-${d}`}function yKe(e,t){let n=ju.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Ud.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${cS(n)}`};Ud.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${cS(t)}`};Ud.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${_ge(t,n)}`};Ud.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${cS(t)}`};Ud.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=iA(o);l(c)&&(s=c.buffer);let u=lS(a,s,i,r),f=hN(o);return`buffer-view:${u}-range-${f}`};Ud.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${EJ(t,n,i,r)}`};Ud.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${yge(t,n,i,r)}`};Ud.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:${yge(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${EJ(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=lS(y,m,n,i),b=hN(g);return`vertex-buffer:${A}-range-${b}${p}`};Ud.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:${EJ(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=lS(m,g,i,r),A=_Ke(f,p);return`index-buffer:${y}-accessor-${A}${u}`};Ud.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${Age(t,n,i,r)}`};Ud.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=ju.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=Age(t,c,i,r),f=yKe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var $l=Ud;function mN(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}mN.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};mN.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};mN.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};mN.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 pN=mN;function Nn(){}Nn.cacheEntries={};Nn.statistics=new pN;function AKe(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 AKe(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=$l.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new cA({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=$l.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new Tx({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=$l.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new Tx({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=$l.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new tS({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=$l.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new $v({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=$l.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new Jv({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=$l.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new lN({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=$l.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 sS({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=$l.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 Qv({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=$l.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new Zv({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=$l.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new oS({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[sS,Qv,Jv,oS,Zv,$v,Tx,cA,tS],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 Fi=Nn;function uc(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(uc.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}}});uc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};uc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};uc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};uc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};uc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};uc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};uc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};uc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Hs.OCTREE&&(t=3),e>>t};uc.fromSubtreeJson=async function(e,t,n,i,r){let o=new uc(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=bKe(n);let a=s.json;o._subtreeJson=a;let c;if(ir(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 YM({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ir(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=xKe(a.buffers),y=TKe(a.bufferViews,m);EKe(a,y),l(c)&&bge(c,y);for(let x=0;x<u.length;x++){let T=u[x];bge(T,y)}let A=await CKe(o,m,s.binary),b=SKe(y,A);return wKe(o,a,i,b),l(c)&&(IKe(o,i,b),DKe(o)),PKe(o,i,b),RKe(o),o._ready=!0,o};function bKe(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=Do(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function xKe(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 TKe(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 EKe(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 bge(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 CKe(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=vKe(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 vKe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Fi.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function SKe(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 wKe(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=ir(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=CJ(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=CJ(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=CJ(t.childSubtreeAvailability,i,a)}function CJ(e,t,n,i){if(l(e.constant))return new Xv({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 Xv({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function IKe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new Bd({class:a,count:r,properties:i.properties,bufferViews:n})}function PKe(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 Bd({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function xge(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 DKe(e){let t=xge(e._tileAvailability);e._tileJumpBuffer=t}function RKe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=xge(r);t.push(o)}}uc.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};uc.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 OKe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function MKe(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]}uc.prototype.getTileMetadataView=function(e){let t=OKe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Kv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};uc.prototype.getContentMetadataView=function(e,t){let n=MKe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new Kv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};uc.prototype.isDestroyed=function(){return!1};uc.prototype.destroy=function(){return l(this._bufferLoader)&&Fi.unload(this._bufferLoader),le(this)};var Ng=uc;var Tge={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(Tge);var zd=Tge;var uS=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 Ng.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,NKe(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(),le(this)}};function NKe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=FKe(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=LKe(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=WKe(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function LKe(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 FKe(e,t,n,i){let s=Ege(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=Ege(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Cge(e,t,n){let i=zd.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Ege(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=Gy.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=UKe(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=Gy.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=zKe(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=Cge(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=Pge(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function cH(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ir(e,"3DTILES_bounding_volume_S2")||l(e.region))}function SJ(e,t){l(t)&&(ir(e,"3DTILES_bounding_volume_S2")?kKe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&BKe(e.region,t.minimumHeight,t.maximumHeight))}function BKe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function kKe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function UKe(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!cH(o.boundingVolume,o)&&cH(e.boundingVolume,o)?s=vge(e,t,n,i??!1,r):s=o.boundingVolume,SJ(s,o),s}function zKe(e,t){let n;return l(t)&&(n=t.boundingVolume),cH(n,t)?SJ(n,t):cH(e,t)&&(n=Je(e,!0),SJ(n,t)),n}function vge(e,t,n,i,r){let o=e.boundingVolume;return ir(o,"3DTILES_bounding_volume_S2")?Sge(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:Ige(o.region,t.level,t.x,t.y,t.z)}:{box:wge(o.box,t.level,t.x,t.y,t.z)}}function Sge(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Ig.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?qv.encode2D(i,r,o):qv.encode2D(i,o,r),f=Ig.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:Ig.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var VKe=new h,jKe=new h,vJ=new h,HKe=new $;function wge(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,jKe),s=$.unpack(e,3,HKe),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,VKe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,vJ);p=$.multiplyByVector(s,p,vJ),p=h.add(p,o,vJ);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 GKe=new ie;function Ige(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,GKe),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 WKe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=vge(i,r,n,!1,t),s=Cge(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Pge(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Pge(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}uS._deriveBoundingBox=wge;uS._deriveBoundingRegion=Ige;uS._deriveBoundingVolumeS2=Sge;var fS=uS;var Dge={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Dge);var Hu=Dge;var Rge={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Rge);var un=Rge;function qKe(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 Bt=qKe;var Oge={NONE:0,TOP:1,ALL:2};Object.freeze(Oge);var gn=Oge;var Mge=new h,Nge=new h,Lge=new h;function YKe(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,Mge),s=h.subtract(i,t,Nge),a=h.subtract(e,t,Lge),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,Mge),s=U.subtract(i,t,Nge),a=U.subtract(e,t,Lge),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 Gx=YKe;var wJ={};wJ.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)};wJ.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 gN=wJ;var Jl={};function pH(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function XKe(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)pH(i,r,e[o],e[o+1],e[o+2]);return i}function KKe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);pH(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)pH(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function $Ke(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)pH(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Jl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=XKe(t);break;case Oe.TRIANGLE_STRIP:e.indices=KKe(t);break;case Oe.TRIANGLE_FAN:e.indices=$Ke(t);break}e.primitiveType=Oe.LINES}return e};Jl.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 ue(u.center,u.radius+n)),new St({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};Jl.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};Jl.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};Jl.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=gN.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function Fge(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 JKe(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])}}Jl.fitToUnsignedShortIndices=function(e){let t=[],n=St.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=Fge(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,JKe(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=Fge(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 Bge=new h,ZKe=new he;Jl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new zi;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,Bge),p=s.cartesianToCartographic(d,ZKe),g=r.project(p,Bge);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 IJ={high:0,low:0};Jl.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],IJ),a[f]=IJ.high,c[f]=IJ.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 sm=new h;function PJ(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,sm),N.multiplyByPoint(e,sm,sm),h.pack(sm,n,r)}}function DJ(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,sm),$.multiplyByVector(e,sm,sm),sm=h.normalize(sm,sm),h.pack(sm,n,r)}}var lH=new N,uH=new $;Jl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;PJ(t,n.position),PJ(t,n.prevPosition),PJ(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(N.inverse(t,lH),N.transpose(lH,lH),N.getMatrix3(lH,uH),DJ(uH,n.normal),DJ(uH,n.tangent),DJ(uH,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function QKe(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 e$e=new h;function RJ(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=QKe(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,e$e))+b.radius;x>A&&(A=x)}return new St({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}Jl.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(RJ(t,"geometry")),n.length>0&&(r.push(RJ(n,"westHemisphereGeometry")),r.push(RJ(n,"eastHemisphereGeometry"))),r};var Vd=new h,_N=new h,dS=new h,hS=new h;Jl.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;_N.x=i[b],_N.y=i[b+1],_N.z=i[b+2],dS.x=i[x],dS.y=i[x+1],dS.z=i[x+2],hS.x=i[T],hS.y=i[T+1],hS.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(dS,_N,dS),h.subtract(hS,_N,hS),a[f]=h.cross(dS,hS,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,Vd),p.count>0){for(f=0;f<p.count;f++)h.add(Vd,a[c[p.indexOffset+f]],Vd);h.equalsEpsilon(h.ZERO,Vd,D.EPSILON10)&&h.clone(a[c[p.indexOffset]],Vd)}h.equalsEpsilon(h.ZERO,Vd,D.EPSILON10)&&(Vd.z=1),h.normalize(Vd,Vd),g[m]=Vd.x,g[m+1]=Vd.y,g[m+2]=Vd.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var t$e=new h,kge=new h,n$e=new h;Jl.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,t$e),A=h.fromArray(c,f,n$e),b=h.dot(y,A);h.multiplyByScalar(y,b,kge),h.normalize(h.subtract(A,kge,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 yN=new U,om=new h,Uge=new h,zge=new h,fH=new U;Jl.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,om),h.equals(om,h.ZERO)){R+=2;continue}fH=cn.octEncodeInRange(om,65535,fH),I[R++]=fH.x,I[R++]=fH.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,yN),E[v++]=cn.compressTextureCoordinates(yN));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,om),h.fromArray(m,S,Uge),h.fromArray(y,S,zge),cn.octPack(om,Uge,zge,yN),E[v++]=yN.x,E[v++]=yN.y):(s&&(h.fromArray(p,S,om),E[v++]=cn.octEncodeFloat(om)),f&&(h.fromArray(m,S,om),E[v++]=cn.octEncodeFloat(om)),d&&(h.fromArray(y,S,om),E[v++]=cn.octEncodeFloat(om)))}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 i$e(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 r$e(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 o$e(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 s$e(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 a$e(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 c$e(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 l$e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return r$e(e);case Oe.TRIANGLE_STRIP:return o$e(e);case Oe.TRIANGLES:return i$e(e);case Oe.LINE_STRIP:return a$e(e);case Oe.LINE_LOOP:return c$e(e);case Oe.LINES:return s$e(e)}return e}function lA(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function u$e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){lA(e,e.y<0),lA(t,t.y<0),lA(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;lA(e,a),lA(t,a),lA(n,a)}var Vge=new h;function jd(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Vge),e.y/(e.y-t.y),Vge),n),h.clone(n,i),lA(n,!0),lA(i,!1)}var Wx=new h,qx=new h,Yx=new h,Xx=new h,OJ={positions:new Array(7),indices:new Array(9)};function f$e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;u$e(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=OJ.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(jd(e,t,Wx,Yx),jd(e,n,qx,Xx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(jd(t,n,Wx,Yx),jd(t,e,qx,Xx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(jd(n,e,Wx,Yx),jd(n,t,qx,Xx),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||(jd(n,e,Wx,Yx),jd(n,t,qx,Xx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(jd(t,n,Wx,Yx),jd(t,e,qx,Xx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(jd(e,t,Wx,Yx),jd(e,n,qx,Xx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=OJ.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Wx,c[4]=qx,c[5]=Yx,c[6]=Xx,c.length=7),OJ}function jge(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=ue.fromVertices(n.position.values)),e}function pS(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 FJ(e,t,n){let i=l(e.geometry.boundingSphere);t=jge(t,i),n=jge(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 BJ(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 d$e=BJ(se,4),mH=BJ(h,3),Xge=BJ(U,2),h$e=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},AN=new h,MJ=new h,NJ=new h,m$e=new h;function dH(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,AN),b=h.fromArray(r,t*3,MJ),x=h.fromArray(r,n*3,NJ),T=Gx(i,A,b,x,m$e);if(l(T)){if(l(o)&&mH(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,AN),v=h.fromArray(u,t*3,MJ),S=h.fromArray(u,n*3,NJ);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=AN,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&h$e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&mH(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&mH(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&Xge(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];p$e(e,t,n,T,y,m[v],d[v])}}}function p$e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:d$e(e,t,n,i,c,u,r,!1);break;case 3:mH(e,t,n,i,c,u,r,!1);break;case 2:Xge(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 Kp(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 g$e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Hge(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)&&!g$e[I]&&l(n[I])&&d.push(I);let p=d.length,g=pS(t),m=pS(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=f$e(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=Kp(y,A,b,f,B<3?T+B:-1,j),dH(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=Kp(y,A,b,f,T,L),dH(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=Kp(y,A,b,f,T+1,_),dH(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=Kp(y,A,b,f,T+2,C),dH(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}FJ(e,m,g)}var Kge=sn.fromPointNormal(h.ZERO,h.UNIT_Y),_$e=new h,y$e=new h;function mS(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,AN);h.equalsEpsilon(a,n,D.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function Gge(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=pS(t),a=pS(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,AN),y=h.fromArray(i,g*3,MJ),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=yi.lineSegmentPlane(m,y,Kge,NJ);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,_$e);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,y$e);A=Kp(b,x,T,o,c,m),mS(p,g,m,i,A,b,r),A=Kp(b,x,T,o,-1,O),mS(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=Kp(E,v,S,o,-1,O),mS(p,g,O,i,A,E,r),A=Kp(E,v,S,o,c+1,y),mS(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=Kp(R,O,L,o,c,m),mS(p,g,m,i,A,R,r),A=Kp(R,O,L,o,c+1,y),mS(p,g,y,i,A,R,r)}}FJ(e,a,s)}var Wge=new U,A$e=new U,$ge=new h,Jge=new h,LJ=new h,b$e=new h,x$e=new h,T$e=new h,qge=new se;function Yge(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,$ge);if(a.x>0)continue;let c=h.unpack(i,s,Jge);(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,LJ);(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 E$e=5*D.EPSILON9,hH=D.EPSILON6;function C$e(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=pS(t),f=pS(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,$ge),T=h.fromArray(i,b*3,Jge);if(Math.abs(x.y)<hH)for(x.y=hH*(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)<hH)for(T.y=hH*(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=yi.lineSegmentPlane(x,T,Kge,b$e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,E$e,x$e);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,T$e);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,Wge),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,LJ));if(w/=h.magnitudeSquared(h.subtract(T,x,LJ)),l(c)){let P=se.fromArray(c,A*4,qge),M=se.fromArray(c,b*4,qge),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,Wge),M=U.fromArray(a,(d+3)*2,A$e),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&&(Yge(f),Yge(u)),FJ(e,f,u)}Jl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==Dd.NONE)switch(t.geometryType){case Dd.POLYLINES:C$e(e);break;case Dd.TRIANGLES:Hge(e);break;case Dd.LINES:Gge(e);break}else l$e(t),t.primitiveType===Oe.TRIANGLES?Hge(e):t.primitiveType===Oe.LINES&&Gge(e);return e};var Gn=Jl;var Zge=D.EPSILON10;function v$e(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,Zge)?(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],Zge)&&(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 Br=v$e;function S$e(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=S$e;function w$e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Mc=w$e;function uA(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(uA.prototype,{length:{get:function(){return this._length}}});uA.prototype.enqueue=function(e){this._array.push(e),this._length++};uA.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};uA.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};uA.prototype.contains=function(e){return this._array.indexOf(e)!==-1};uA.prototype.clear=function(){this._array.length=this._offset=this._length=0};uA.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var fA=uA;var Mo={};Mo.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};Mo.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};Mo.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]=Mo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var Kx=new U;function t_e(e,t,n,i){return U.subtract(t,e,Kx),U.multiplyByScalar(Kx,n/i,Kx),U.add(e,Kx,Kx),[Kx.x,Kx.y]}var dA=new h;function I$e(e,t,n,i){return h.subtract(t,e,dA),h.multiplyByScalar(dA,n/i,dA),h.add(e,dA,dA),[dA.x,dA.y,dA.z]}Mo.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 _H=new he,yH=new he,P$e=new he,D$e=new h,gH=new Rc;Mo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,_H),o=e.cartesianToCartographic(n,yH),a=new Rc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};Mo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=Mo.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=t_e(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Mo.subdivideLine=function(e,t,n,i){let r=Mo.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=I$e(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Mo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,_H),c=n.cartesianToCartographic(r,yH);gH.setEndPoints(a,c);let u=gH.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=t_e(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};Mo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,_H),s=e.cartesianToCartographic(n,yH),a=new Rc(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,P$e),A=e.cartographicToCartesian(y,D$e);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var R$e=new h,O$e=new h,M$e=new h,N$e=new h;Mo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=R$e,s=O$e,a=M$e,c=N$e;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};Mo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new fA;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=Br(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=Br(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 L$e=new he;function F$e(e,t,n){let i=n.cartesianToCartographic(e,_H),r=n.cartesianToCartographic(t,yH);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;gH.setEndPoints(i,r);let o=gH.findIntersectionWithLatitude(0,L$e);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 B$e(e,t,n,i){if(i===un.RHUMB)return F$e(e,t,n);let r=yi.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var k$e=new he;function U$e(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,k$e).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=B$e(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 n_e(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=n_e(e,t+1,n,i,0,d,!s);return t}Mo.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=U$e(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=n_e(i,r,s,a,1,0,c)}return i};Mo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new fA;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=Br(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 Mc(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=Br(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 z$e=new U,V$e=new h,j$e=new Le,H$e=new $;Mo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,j$e),s=$.fromQuaternion(o,H$e),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],V$e);$.multiplyByVector(s,g,g);let m=t(g,z$e);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};Mo.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?Gn.computeNormal(y):y}if(s===un.GEODESIC)return ui.computeSubdivision(e,c,a,f,i);if(s===un.RHUMB)return ui.computeRhumbLineSubdivision(e,c,a,f,i)};var Qge=[],e_e=[],G$e=new h,W$e=new h;Mo.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===un.GEODESIC)for(c=0;c<y;c++)O+=Mo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===un.RHUMB)for(c=0;c<y;c++)O+=Mo.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===un.GEODESIC?(L=Mo.subdivideLine(u,f,R,e_e),x&&(_=Mo.subdivideTexcoordLine(d,p,u,f,R,Qge))):o===un.RHUMB&&(L=Mo.subdivideRhumbLine(n,u,f,R,e_e),x&&(_=Mo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,Qge)));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,G$e),f=h.fromArray(s,O*3,W$e),!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 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 St(S)};var ti=Mo;function vs(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=vs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(vs.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 gS=new he,q$e=new h;vs.prototype.getLatitude=function(e){l(e)||(e=ee.default),gS.latitude=this.conformalLatitude,gS.longitude=this.longitude,gS.height=0;let t=this.ellipsoid.cartographicToCartesian(gS,q$e);return e.cartesianToCartographic(t,gS),gS.latitude};var Y$e=new pn,X$e=new h,K$e=new h;vs.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=vs.NORTH_POLE_TANGENT_PLANE,r=vs.SOUTH_POLE;n<0&&(i=vs.SOUTH_POLE_TANGENT_PLANE,r=vs.NORTH_POLE);let o=Y$e;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,X$e),h.normalize(o.direction,o.direction);let s=yi.rayPlane(o,i.plane,K$e),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 vs(new U(c,u),i)};vs.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]=vs.fromCartesian(e[i],t[i]);return t};vs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new vs(e.position,e.tangentPlane)};vs.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));vs.NORTH_POLE=Object.freeze(new h(0,0,.5));vs.SOUTH_POLE=Object.freeze(new h(0,0,-.5));vs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Vs(vs.NORTH_POLE,vs.HALF_UNIT_SPHERE));vs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Vs(vs.SOUTH_POLE,vs.HALF_UNIT_SPHERE));var ul=vs;function oa(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}oa.POSITION_ONLY=Object.freeze(new oa({position:!0}));oa.POSITION_AND_NORMAL=Object.freeze(new oa({position:!0,normal:!0}));oa.POSITION_NORMAL_AND_ST=Object.freeze(new oa({position:!0,normal:!0,st:!0}));oa.POSITION_AND_ST=Object.freeze(new oa({position:!0,st:!0}));oa.POSITION_AND_COLOR=Object.freeze(new oa({position:!0,color:!0}));oa.ALL=Object.freeze(new oa({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));oa.DEFAULT=oa.POSITION_NORMAL_AND_ST;oa.packedLength=6;oa.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};oa.unpack=function(e,t,n){return t=t??0,l(n)||(n=new oa),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};oa.clone=function(e,t){if(l(e))return l(t)||(t=new oa),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=oa;var $$e=new he,i_e=new he;function J$e(e,t,n,i){let o=i.cartesianToCartographic(e,$$e).height,s=i.cartesianToCartographic(t,i_e);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,i_e);a.height=o-100,i.cartographicToCartesian(a,n)}var r_e=new et,Z$e=new h,Q$e=new h,eJe=new h,tJe=new h,nJe=new h,iJe=new h,AH=new h,$p=new h,_S=new h,rJe=new U,oJe=new U,sJe=new h,o_e=new Le,aJe=new $,cJe=new $;function kJ(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=rJe;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=Q$e,O=eJe,L=tJe,_=!0,C=aJe,w=cJe;if(m!==0){let F=Le.fromAxisAngle(d,m,o_e);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,o_e),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,sJe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,Z$e);B=g.scaleToGeodeticSurface(B,B);let j=p([B],oJe)[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,nJe);if(_){let G=h.fromArray(r,F+s,iJe);y&&J$e(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&&(AH=h.fromArray(x,I,AH),$p=h.cross(h.UNIT_Z,AH,$p),$p=h.normalize($.multiplyByVector(w,$p,$p),$p),t.bitangent&&(_S=h.normalize(h.cross(AH,$p,_S),_S))),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]=$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+P]=L.x,E[B+P]=L.y,E[j+P]=L.z),c&&(y?(E[I]=_S.x,E[B]=_S.y,E[j]=_S.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===gn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===gn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var s_e=[];function lJe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ti.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=Vs.fromPoints(p,e),m=g.projectPointsOntoPlane(p,s_e),y=ui.computeWindingOrder2D(m);y===Qs.CLOCKWISE&&(p=p.slice().reverse());let A=ti.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,s_e),y=ui.computeWindingOrder2D(m),y===Qs.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ti.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??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??un.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ti.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ti.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=ti.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=ti.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var uJe=ee.clone(ee.UNIT_SPHERE),fJe=new Be,dJe={polygonHierarchy:{}};Gd.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,uJe);t+=ee.packedLength;let o=Be.unpack(e,t,fJe);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:ti.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new Gd(dJe)),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 hJe=new U,mJe=new U,pJe=new ul;function a_e(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!==un.RHUMB){let p=U.subtract(t.position,e.position,hJe),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),mJe),y=ul.clone(t,pJe);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 c_e=new ul,gJe=new ul,Hd={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,Hd.northAngle=0,Hd.southAngle=0,Hd.westOverIdl=Number.POSITIVE_INFINITY,Hd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=ul.fromCartesian(e[0],gJe);for(let s=1;s<r;s++){let a=ul.fromCartesian(e[s],c_e);a_e(a,o,t,n,Hd,i),o=ul.clone(a,o)}return a_e(ul.fromCartesian(e[0],c_e),o,t,n,Hd,i),i.east-i.west>Hd.eastOverIdl-Hd.westOverIdl&&(i.west=Hd.westOverIdl,i.east=Hd.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(Hd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(Hd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var _Je=new ul;function yJe(e,t,n){return e.height>=D.PI||e.width>=D.PI?ul.fromCartesian(t[0],_Je).tangentPlane:Vs.fromPoints(t,n)}var l_e=new he;function AJe(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],l_e);r[s]=new U(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return r.length=i.length,r}return ul.fromCartesianArray(i,r)}return Vs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function bJe(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,l_e);return l(o)||(o=new U),o.x=s.longitude/D.PI,o.y=s.latitude/D.PI_OVER_TWO,o}return ul.fromCartesian(r,o)};let i=Vs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function xJe(e,t,n,i){return(r,o)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?ti.splitPolygonsOnEquator(r,t,n,o):r}function TJe(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,r_e);let r=e,o=Vs.fromPoints(r,n);return ti.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,r_e)}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=ti.polygonsFromHierarchy(o,d,AJe(g,p,n),!s,n,xJe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(P){return P},x=d?ti.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=TJe(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:yJe(g,T,n).plane.normal,projectTo2d:bJe(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=lJe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),M;a&&c?(M=P.topAndBottom,O.geometry=ti.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=kJ(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=ti.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=kJ(O),v.push(B)}}else for(L=0;L<A.length;L++){let P=new Bt({geometry:ti.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=kJ(O),l(e._offsetAttribute)){let M=P.geometry.attributes.position.values.length,F=e._offsetAttribute===gn.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 _=Gn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new St({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 EJe(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(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=EJe(this)),this._textureCoordinateRotationPoints}}});var Jp=Gd;function yS(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=bH(e.positions),this._holes=l(e.holes)?e.holes.map(bH):[],this._rectangle=Jp.computeRectangleFromPositions(this._positions,this._ellipsoid),UJ(this._positions),u_e(this._holes)}function bH(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 UJ(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function u_e(e){for(let t=0;t<e.length;t++)UJ(e[t]);return Object.freeze(e)}function CJe(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 vJe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!CJe(e[n],t[n]))return!1;return!0}Object.defineProperties(yS.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}}});yS.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=bH(e.positions),t._holes=e.holes.map(bH),t._rectangle=Jp.computeRectangleFromPositions(t._positions,t._ellipsoid),UJ(t._positions),u_e(t._holes),t):new yS({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};yS.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&vJe(e.holes,t.holes)};yS.prototype.computeRectangle=function(e){return qr("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 AS=yS;var f_e=16,SJe=.35,d_e=new Aa,wJe=new Of,h_e=new Oo,IJe=new Rf,PJe=new h,DJe=new h,RJe=new he,OJe=new U,MJe=new U,bN=new z,VJ=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=b_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,d_e),m=g.getMaterial(wJe);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),m_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,d_e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(D.EPSILON3,p_e(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,OJe),y=U.fromArray(a,(d+g+1)*2,MJe);NJe(m,y,i,o),LJe(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/f_e))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=SJe/r,c=xH(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,p_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=hA(Math.floor(T*r),r),R=hA(Math.floor(E*r),r),O=hA(Math.floor(v*r),r),L=hA(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]=TH(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=b_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,h_e),g=p.getMaterial(IJe);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),m_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,h_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=FJe(a,f+m,A,i,o),x=y_e(b,A,-D.EPSILON3,1+D.EPSILON3,-D.EPSILON3,1+D.EPSILON3,__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/f_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=hA(Math.floor(T*o),o),R=hA(Math.floor(v*o),o),O=hA(Math.floor(E*o),o),L=hA(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=y_e(A,x,C/o-D.EPSILON5,(C+1)/o+D.EPSILON5,_/o-D.EPSILON5,(_+1)/o+D.EPSILON5,__e),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]=TH(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]=TH(n.primitiveCount),o=new Float32Array(i*r);o.set(xH(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(xH(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(xH(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=A_e(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=A_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 m_e(e,t,n){z.fromRgba(n,bN),e[t*4]=z.floatToByte(bN.red),e[t*4+1]=z.floatToByte(bN.green),e[t*4+2]=z.floatToByte(bN.blue),e[t*4+3]=z.floatToByte(bN.alpha)}function p_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 NJe(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 LJe(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 hA(e,t){return Math.max(0,Math.min(t-1,e))}var zJ=new Float64Array(512),g_e=new Float64Array(512),__e={positions:new Float64Array(512),vertexCount:0};function FJe(e,t,n,i,r){zJ.length<n*2&&(zJ=new Float64Array(n*4));let o=zJ,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 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?g_e:s.positions;y.length<g&&(y=new Float64Array(g*2),m?g_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 TH(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 A_e(e,t){let[n,i]=TH(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 b_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,PJe),a=N.multiplyByPoint(r,s,DJe),c=t.cartesianToCartographic(a,RJe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function xH(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 Ss=VJ;var GJ=new Oo,jJ="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.",HJ="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.",BJe="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.",kJe="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 fl(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 Ua({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(T_e(t[r]),GJ),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&qr("ClippingPolygonCollection.debugShowDistanceTexture",HJ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&qr("ClippingPolygonCollection.quality",jJ),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=Ss.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(fl.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return qr("ClippingPolygonCollection.debugShowDistanceTexture",HJ),this._debugShowDistanceTexture},set:function(e){qr("ClippingPolygonCollection.debugShowDistanceTexture",HJ),this._debugShowDistanceTexture=e}},quality:{get:function(){return qr("ClippingPolygonCollection.quality",jJ),this._quality},set:function(e){qr("ClippingPolygonCollection.quality",jJ),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function T_e(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 UJe(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=Ua.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 E_e(e,t){e._bufferPolygonCollection.get(t.bufferIndex,GJ).show=!1,t.bufferIndex=-1}fl.prototype.add=function(e){let t=this._polygons.length,n=UJe(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(T_e(e),GJ),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};fl.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};fl.prototype.contains=function(e){return this._polygons.some(t=>AS.equals(t.clippingPolygon,e))};fl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>AS.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return E_e(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};fl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];E_e(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};fl.prototype.update=function(e){if(!fl.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Ss.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var x_e=new ie,zJe=new ie;fl.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,x_e)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,x_e));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,zJe);if(l(c))return $t.INTERSECTING}return r};fl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};fl.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Ss.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Ss.packPolygonGrid(n),Ss.packPolygonTextures(t,n)),n};fl.releaseRectangleData=function(e){Ss.freeResources(e)};fl.isSupported=function(e){return e?.context.webgl2};fl.prototype.isDestroyed=function(){return qr("ClippingPolygonCollection.isDestroyed",BJe),!1};fl.prototype.destroy=function(){return qr("ClippingPolygonCollection.destroy",kJe),le(this)};var Nc=fl;function C_e(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}C_e.prototype.execute=function(e){e.execute(this)};var Bf=C_e;var VJe=new h;function kf(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"}kf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new kf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};kf.fromAxisAlignedBoundingBox=function(e){return new kf({minimum:e.minimum,maximum:e.maximum})};kf.packedLength=2*h.packedLength+Be.packedLength+1;kf.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 S_e=new h,w_e=new h,I_e=new Be,v_e={minimum:S_e,maximum:w_e,vertexFormat:I_e,offsetAttribute:void 0};kf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,S_e),r=h.unpack(e,t+h.packedLength,w_e),o=Be.unpack(e,t+2*h.packedLength,I_e),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):(v_e.offsetAttribute=s===-1?void 0:s,new kf(v_e))};kf.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,VJe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===gn.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 ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var WJ;kf.getUnitBox=function(){return l(WJ)||(WJ=kf.createGeometry(kf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),WJ};var Lc=kf;function xN(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(xN.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});xN.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)};xN.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};xN.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 TN=xN;function No(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 TN(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,P_e(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 No.faceNames())qJ(this[T],n?.[T],0);m.bindTexture(y,null)}No.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new gs({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};No.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*jJe(){yield No.FaceName.POSITIVEX,yield No.FaceName.NEGATIVEX,yield No.FaceName.POSITIVEY,yield No.FaceName.NEGATIVEY,yield No.FaceName.POSITIVEZ,yield No.FaceName.NEGATIVEZ}No.faceNames=function(){return jJe()};function qJ(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))}No.loadFace=qJ;Object.defineProperties(No.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){P_e(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}}});No.getDirection=function(e,t){switch(e){case No.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case No.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case No.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case No.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case No.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case No.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function P_e(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=$n.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)}No.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 No.faceNames())qJ(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};No.prototype.generateMipmap=function(e){e=e??vd.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)};No.createVertexArray=function(e){let t=Lc.createGeometry(Lc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Gn.createAttributeLocations(t);return zn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};No.prototype.isDestroyed=function(){return!1};No.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var rs=No;var am=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +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,vy.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 eS=(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},yXe=e=>1/(1+Math.exp(-e)),AXe=e=>t=>t*e+.5,bXe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:eS(e,t.positions),scales:eS(e,t.scales,Math.exp),rotations:eS(e,t.rotations),alphas:eS(e,t.alphas,yXe),colors:eS(e,t.colors,AXe(i)),sh:eS(e,t.sh)}},xXe=(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))},N0e=async(e,t)=>{var n;let i=await _Xe(),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=bXe(i,a,t);return xXe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var TXe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var EXe=[0,9,24,45],CXe=14,vXe=1.6*1024*1024*1024;function SXe(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 wXe(e,t){let n=CXe+(EXe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var F$=class extends nr{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=IXe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._spzError)&&B$(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=SXe(this._gltf,this._primitive);if(l(n)){let r=wXe(n.numPoints,n.shDegree);if(r>vXe){let o=Math.round(r/1048576);return B$(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=N0e(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=PXe(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 IXe(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;B$(e,n)}}function B$(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load SPZ",t)}async function PXe(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 fN=F$;function dN(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)}dN.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=Vp.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new dN({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(dN.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}}});dN.BATCH_TABLE_CLASS_NAME="_batchTable";var am=dN;function Y6(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)}Y6.fromJson=function(e){return new Y6({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Y6.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 hN=Y6;function X6(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)}X6.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return hN.fromJson(r)});return new X6({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(X6.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 mN=X6;function K6(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)}K6.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=mN.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]=am.fromJson({id:i,class:e.classes[i],enums:t}));return new K6({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(K6.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 $l=K6;var k$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?$l.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=DXe(this),this._promise)}unload(){this._schema=void 0}};async function DXe(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=$l.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 aA=k$;var kd={};function tS(e){return Td(e.url)}function pN(e){let{byteOffset:t,byteLength:n}=e,i=tA(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function RXe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function L0e(e,t){return`${tS(e)}-buffer-id-${t}`}function nS(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return tS(r)}return L0e(n,t)}function U$(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=nS(a,s,n,i),u=pN(o);return`${c}-range-${u}`}function F0e(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=nS(a,s,n,i),u=pN(o);return`${c}-range-${u}`}function B0e(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 tS(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=nS(u,c,n,i),d=pN(a);return`${f}-range-${d}`}function OXe(e,t){let n=ju.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}kd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${tS(n)}`};kd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${tS(t)}`};kd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${L0e(t,n)}`};kd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${tS(t)}`};kd.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=tA(o);l(c)&&(s=c.buffer);let u=nS(a,s,i,r),f=pN(o);return`buffer-view:${u}-range-${f}`};kd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${U$(t,n,i,r)}`};kd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${F0e(t,n,i,r)}`};kd.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:${F0e(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${U$(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=nS(y,m,n,i),b=pN(g);return`vertex-buffer:${A}-range-${b}${p}`};kd.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:${U$(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=nS(m,g,i,r),A=RXe(f,p);return`index-buffer:${y}-accessor-${A}${u}`};kd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${B0e(t,n,i,r)}`};kd.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=ju.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=B0e(t,c,i,r),f=OXe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Jl=kd;function gN(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}gN.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};gN.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};gN.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};gN.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 _N=gN;function Nn(){}Nn.cacheEntries={};Nn.statistics=new _N;function MXe(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 MXe(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=Jl.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new aA({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=Jl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new Zx({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=Jl.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new Zx({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=Jl.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new Xv({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=Jl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new Hv({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=Jl.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new Gv({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=Jl.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new fN({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=Jl.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 Qv({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=Jl.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 qv({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=Jl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new Wv({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=Jl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new Zv({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[Qv,qv,Gv,Zv,Wv,Hv,Zx,aA,Xv],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===Gs.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=NXe(n);let a=s.json;o._subtreeJson=a;let c;if(tr(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 KM({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],tr(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=LXe(a.buffers),y=FXe(a.bufferViews,m);BXe(a,y),l(c)&&k0e(c,y);for(let x=0;x<u.length;x++){let T=u[x];k0e(T,y)}let A=await kXe(o,m,s.binary),b=zXe(y,A);return VXe(o,a,i,b),l(c)&&(jXe(o,i,b),GXe(o)),HXe(o,i,b),WXe(o),o._ready=!0,o};function NXe(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 LXe(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 FXe(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 BXe(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 k0e(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 kXe(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=UXe(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 UXe(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 zXe(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 VXe(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=tr(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=z$(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=z$(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=z$(t.childSubtreeAvailability,i,a)}function z$(e,t,n,i){if(l(e.constant))return new Vv({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 Vv({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function jXe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new Fd({class:a,count:r,properties:i.properties,bufferViews:n})}function HXe(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 Fd({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function U0e(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 GXe(e){let t=U0e(e._tileAvailability);e._tileJumpBuffer=t}function WXe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=U0e(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 qXe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function YXe(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=qXe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new jv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};fc.prototype.getContentMetadataView=function(e,t){let n=YXe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new jv({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),le(this)};var Lg=fc;var z0e={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(z0e);var Ud=z0e;var cA={};cA.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:cA.parseBoundingVolumeSemantic(e,t),minimumHeight:cA._parseMinimumHeight(e,t),maximumHeight:cA._parseMaximumHeight(e,t)}};cA.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}};cA._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};cA._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var lA=cA;var iS=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 Lg.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,XXe(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(),le(this)}};function XXe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=$Xe(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=KXe(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=oKe(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function KXe(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 $Xe(e,t,n,i){let s=V0e(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=V0e(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function j0e(e,t,n){let i=Ud.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function V0e(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=QXe(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=eKe(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=j0e(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=Y0e(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function $6(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(tr(e,"3DTILES_bounding_volume_S2")||l(e.region))}function j$(e,t){l(t)&&(tr(e,"3DTILES_bounding_volume_S2")?ZXe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&JXe(e.region,t.minimumHeight,t.maximumHeight))}function JXe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function ZXe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function QXe(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!$6(o.boundingVolume,o)&&$6(e.boundingVolume,o)?s=H0e(e,t,n,i??!1,r):s=o.boundingVolume,j$(s,o),s}function eKe(e,t){let n;return l(t)&&(n=t.boundingVolume),$6(n,t)?j$(n,t):$6(e,t)&&(n=Je(e,!0),j$(n,t)),n}function H0e(e,t,n,i,r){let o=e.boundingVolume;return tr(o,"3DTILES_bounding_volume_S2")?G0e(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:q0e(o.region,t.level,t.x,t.y,t.z)}:{box:W0e(o.box,t.level,t.x,t.y,t.z)}}function G0e(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Pg.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?Uv.encode2D(i,r,o):Uv.encode2D(i,o,r),f=Pg.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:Pg.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var tKe=new h,nKe=new h,V$=new h,iKe=new $;function W0e(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,nKe),s=$.unpack(e,3,iKe),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,tKe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,V$);p=$.multiplyByVector(s,p,V$),p=h.add(p,o,V$);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 rKe=new ie;function q0e(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,rKe),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 oKe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=H0e(i,r,n,!1,t),s=j0e(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Y0e(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Y0e(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}iS._deriveBoundingBox=W0e;iS._deriveBoundingRegion=q0e;iS._deriveBoundingVolumeS2=G0e;var rS=iS;var X0e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(X0e);var Hu=X0e;function oS(e,t){this._distance=t,this._normal=new K0e(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(oS.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)}}});oS.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new oS(e.normal,e.distance),t};oS.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new oS(e.normal,e.distance)};function K0e(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(K0e.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 ia=oS;function sl(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?ege:tge,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 ege(e){return e===$t.OUTSIDE}function tge(e){return e===$t.INSIDE}Object.defineProperties(sl.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?ege:tge)}},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 $0e(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}sl.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){$0e(n,i)},e.index=t,$0e(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};sl.prototype.get=function(e){return this._planes[e]};function nge(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}sl.prototype.contains=function(e){return nge(this._planes,e)!==-1};sl.prototype.remove=function(e){let t=this._planes,n=nge(t,e);if(n===-1)return!1;e instanceof ia&&(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 ia&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};sl.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ia&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var sKe=new se,aKe=new se;function J0e(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,aKe);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,sKe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function Z0e(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 ige(e,t){let n=Ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var cKe=new U;sl.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=sl.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=ige(r,cKe);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.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:Ke.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?(Z0e(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(J0e(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),Z0e(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),J0e(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 lKe=new N,Q0e=new sn(h.UNIT_X,0);sl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=N.multiply(t,r,lKe));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,Q0e);let c=e.intersectPlane(Q0e);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};sl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};sl.useFloatTexture=function(e){return e.floatingPointTexture};sl.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=sl.useFloatTexture(t)?e.length:e.length*2,o=ige(r,n);return o.y*=2,o};sl.prototype.isDestroyed=function(){return!1};sl.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var bs=sl;function W$(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=oge(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=mKe(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 AN(o,s,n,a,c,u,0),s}function oge(e,t,n,i,r){let o;if(r===vKe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=rge(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=rge(s/i|0,e[s],e[s+1],o);return o&&sS(o,o.next)&&(xN(o),o=o.next),o}function sT(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(sS(n,n.next)||xs(n.prev,n,n.next)===0)){if(xN(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function AN(e,t,n,i,r,o,s){if(!e)return;!s&&o&&AKe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?fKe(e,i,r,o):uKe(e)){t.push(c.i,e.i,u.i),xN(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=dKe(sT(e),t),AN(e,t,n,i,r,o,2)):s===2&&hKe(e,t,n,i,r,o):AN(sT(e),t,n,i,r,o,1);break}}}function uKe(e){let t=e.prev,n=e,i=e.next;if(xs(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&&yN(r,a,o,c,s,u,m.x,m.y)&&xs(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function fKe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(xs(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=H$(g,m,t,n,i),x=H$(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&&yN(a,f,c,d,u,p,T.x,T.y)&&xs(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&&yN(a,f,c,d,u,p,E.x,E.y)&&xs(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&&yN(a,f,c,d,u,p,T.x,T.y)&&xs(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&&yN(a,f,c,d,u,p,E.x,E.y)&&xs(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function dKe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!sS(i,r)&&age(i,n,n.next,r)&&bN(i,r)&&bN(r,i)&&(t.push(i.i,n.i,r.i),xN(n),xN(n.next),n=e=r),n=n.next}while(n!==e);return sT(n)}function hKe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&TKe(s,a)){let c=cge(s,a);s=sT(s,s.next),c=sT(c,c.next),AN(s,t,n,i,r,o,0),AN(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function mKe(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=oge(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(xKe(u))}r.sort(pKe);for(let o=0;o<r.length;o++)n=gKe(r[o],n);return n}function pKe(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 gKe(e,t){let n=_Ke(e,t);if(!n)return t;let i=cge(n,e);return sT(i,i.next),sT(n,n.next)}function _Ke(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(sS(e,n))return n;do{if(sS(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&&sge(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);bN(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&yKe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function yKe(e,t){return xs(e.prev,e,t.prev)<0&&xs(t.next,e,e.next)<0}function AKe(e,t,n,i){let r=e;do r.z===0&&(r.z=H$(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,bKe(r)}function bKe(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 H$(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 xKe(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 sge(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 yN(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&sge(e,t,n,i,r,o,s,a)}function TKe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!EKe(e,t)&&(bN(e,t)&&bN(t,e)&&CKe(e,t)&&(xs(e.prev,e,t.prev)||xs(e,t.prev,t))||sS(e,t)&&xs(e.prev,e,e.next)>0&&xs(t.prev,t,t.next)>0)}function xs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function sS(e,t){return e.x===t.x&&e.y===t.y}function age(e,t,n,i){let r=Z6(xs(e,t,n)),o=Z6(xs(e,t,i)),s=Z6(xs(n,i,e)),a=Z6(xs(n,i,t));return!!(r!==o&&s!==a||r===0&&J6(e,n,t)||o===0&&J6(e,i,t)||s===0&&J6(n,e,i)||a===0&&J6(n,t,i))}function J6(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 Z6(e){return e>0?1:e<0?-1:0}function EKe(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&&age(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function bN(e,t){return xs(e.prev,e,e.next)<0?xs(e,t,e.next)>=0&&xs(e,e.prev,t)>=0:xs(e,t,e.prev)<0||xs(e,e.next,t)<0}function CKe(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 cge(e,t){let n=G$(e.i,e.x,e.y),i=G$(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 rge(e,t,n,i){let r=G$(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 xN(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 G$(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vKe(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 SKe=new h,wKe=new h,uA={};uA.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};uA.computeWindingOrder2D=function(e){return uA.computeArea2D(e)>0?ea.COUNTER_CLOCKWISE:ea.CLOCKWISE};uA.triangulate=function(e,t){let n=U.packArray(e);return W$(n,t,2)};var dge=new h,hge=new h,mge=new h,lge=new h,uge=new h,fge=new h,Fg=new h,pge=new U,gge=new U,_ge=new U,aS=new U;uA.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,dge),I=h.fromArray(u,E*3,hge),R=h.fromArray(u,T*3,mge),O,L,_;o&&(O=U.fromArray(f,v*2,pge),L=U.fromArray(f,E*2,gge),_=U.fromArray(f,T*2,_ge));let C=h.multiplyByScalar(h.normalize(S,lge),y,lge),w=h.multiplyByScalar(h.normalize(I,uge),y,uge),P=h.multiplyByScalar(h.normalize(R,fge),y,fge),M=h.magnitudeSquared(h.subtract(C,w,Fg)),F=h.magnitudeSquared(h.subtract(w,P,Fg)),V=h.magnitudeSquared(h.subtract(P,C,Fg)),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,Fg),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,aS),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,Fg),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,_,aS),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,Fg),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,aS),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 IKe=new he,PKe=new he,DKe=new he,q$=new he;uA.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 Dc(void 0,void 0,e),x=new Dc(void 0,void 0,e),T=new Dc(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,dge),O=h.fromArray(u,S*3,hge),L=h.fromArray(u,v*3,mge),_,C,w;o&&(_=U.fromArray(f,I*2,pge),C=U.fromArray(f,S*2,gge),w=U.fromArray(f,v*2,_ge));let P=e.cartesianToCartographic(R,IKe),M=e.cartesianToCartographic(O,PKe),F=e.cartesianToCartographic(L,DKe);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,q$),Q=(P.height+M.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Fg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,aS),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,q$),Q=(M.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Fg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,aS),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,q$),Q=(F.height+P.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Fg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,aS),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)};uA.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=SKe,o=wKe;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 fi=uA;function fA(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(fA.prototype,{length:{get:function(){return this._length}}});fA.prototype.enqueue=function(e){this._array.push(e),this._length++};fA.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};fA.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};fA.prototype.contains=function(e){return this._array.indexOf(e)!==-1};fA.prototype.clear=function(){this._array.length=this._offset=this._length=0};fA.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var dA=fA;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 aT=new U;function bge(e,t,n,i){return U.subtract(t,e,aT),U.multiplyByScalar(aT,n/i,aT),U.add(e,aT,aT),[aT.x,aT.y]}var hA=new h;function RKe(e,t,n,i){return h.subtract(t,e,hA),h.multiplyByScalar(hA,n/i,hA),h.add(e,hA,hA),[hA.x,hA.y,hA.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 eH=new he,tH=new he,OKe=new he,MKe=new h,Q6=new Dc;Oo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,eH),o=e.cartesianToCartographic(n,tH),a=new Dc(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=bge(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=RKe(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,eH),c=n.cartesianToCartographic(r,tH);Q6.setEndPoints(a,c);let u=Q6.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=bge(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,eH),s=e.cartesianToCartographic(n,tH),a=new Dc(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,OKe),A=e.cartographicToCartesian(y,MKe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var NKe=new h,LKe=new h,FKe=new h,BKe=new h;Oo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=NKe,s=LKe,a=FKe,c=BKe;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 dA;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 kKe=new he;function UKe(e,t,n){let i=n.cartesianToCartographic(e,eH),r=n.cartesianToCartographic(t,tH);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;Q6.setEndPoints(i,r);let o=Q6.findIntersectionWithLatitude(0,kKe);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 zKe(e,t,n,i){if(i===ln.RHUMB)return UKe(e,t,n);let r=_i.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var VKe=new he;function jKe(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,VKe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=zKe(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 xge(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=xge(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=jKe(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=xge(i,r,s,a,1,0,c)}return i};Oo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new dA;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=fi.computeWindingOrder2D(y);if(b===ea.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 Rc(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=fi.computeWindingOrder2D(R),b===ea.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 HKe=new U,GKe=new h,WKe=new Le,qKe=new $;Oo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,WKe),s=$.fromQuaternion(o,qKe),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],GKe);$.multiplyByVector(s,g,g);let m=t(g,HKe);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=fi.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?Gn.computeNormal(y):y}if(s===ln.GEODESIC)return fi.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return fi.computeRhumbLineSubdivision(e,c,a,f,i)};var yge=[],Age=[],YKe=new h,XKe=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,Age),x&&(_=Oo.subdivideTexcoordLine(d,p,u,f,R,yge))):o===ln.RHUMB&&(L=Oo.subdivideRhumbLine(n,u,f,R,Age),x&&(_=Oo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,yge)));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,YKe),f=h.fromArray(s,O*3,XKe),!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 ni=Oo;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,KKe=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,KKe);return e.cartesianToCartographic(t,cS),cS.latitude};var $Ke=new pn,JKe=new h,ZKe=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=$Ke;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,JKe),h.normalize(o.direction,o.direction);let s=_i.rayPlane(o,i.plane,ZKe),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 al=Ts;var QKe=new he,Tge=new he;function e$e(e,t,n,i){let o=i.cartesianToCartographic(e,QKe).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,t$e=new h,n$e=new h,i$e=new h,r$e=new h,o$e=new h,s$e=new h,nH=new h,Wp=new h,lS=new h,a$e=new U,c$e=new U,l$e=new h,Cge=new Le,u$e=new $,f$e=new $;function Y$(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=a$e;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=n$e,O=i$e,L=r$e,_=!0,C=u$e,w=f$e;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 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,l$e);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,t$e);B=g.scaleToGeodeticSurface(B,B);let j=p([B],c$e)[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,o$e);if(_){let G=h.fromArray(r,F+s,s$e);y&&e$e(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&&(nH=h.fromArray(x,I,nH),Wp=h.cross(h.UNIT_Z,nH,Wp),Wp=h.normalize($.multiplyByVector(w,Wp,Wp),Wp),t.bitangent&&(lS=h.normalize(h.cross(nH,Wp,lS),lS))),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]=Wp.x,T[B]=Wp.y,T[j]=Wp.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]=lS.x,E[B]=lS.y,E[j]=lS.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 vge=[];function d$e(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ni.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,vge),y=fi.computeWindingOrder2D(m);y===ea.CLOCKWISE&&(p=p.slice().reverse());let A=ni.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,vge),y=fi.computeWindingOrder2D(m),y===ea.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ni.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Ft({geometry:A}))}return f}function Vd(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=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ni.computeHierarchyPackedLength(s,U):1)+12}Vd.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 Vd(t)};Vd.pack=function(e,t,n){return n=n??0,n=ni.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=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var h$e=ee.clone(ee.UNIT_SPHERE),m$e=new Be,p$e={polygonHierarchy:{}};Vd.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,h$e);t+=ee.packedLength;let o=Be.unpack(e,t,m$e);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:ni.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new Vd(p$e)),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 g$e=new U,_$e=new U,y$e=new al;function Sge(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,g$e),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),_$e),y=al.clone(t,y$e);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 al,A$e=new al,zd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Vd.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,zd.northAngle=0,zd.southAngle=0,zd.westOverIdl=Number.POSITIVE_INFINITY,zd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=al.fromCartesian(e[0],A$e);for(let s=1;s<r;s++){let a=al.fromCartesian(e[s],wge);Sge(a,o,t,n,zd,i),o=al.clone(a,o)}return Sge(al.fromCartesian(e[0],wge),o,t,n,zd,i),i.east-i.west>zd.eastOverIdl-zd.westOverIdl&&(i.west=zd.westOverIdl,i.east=zd.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(zd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(zd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var b$e=new al;function x$e(e,t,n){return e.height>=D.PI||e.width>=D.PI?al.fromCartesian(t[0],b$e).tangentPlane:Vs.fromPoints(t,n)}var Ige=new he;function T$e(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],Ige);r[s]=new U(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return r.length=i.length,r}return al.fromCartesianArray(i,r)}return Vs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function E$e(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,Ige);return l(o)||(o=new U),o.x=s.longitude/D.PI,o.y=s.latitude/D.PI_OVER_TWO,o}return al.fromCartesian(r,o)};let i=Vs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function C$e(e,t,n,i){return(r,o)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?ni.splitPolygonsOnEquator(r,t,n,o):r}function v$e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,Ege);let r=e,o=Vs.fromPoints(r,n);return ni.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,Ege)}Vd.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=ni.polygonsFromHierarchy(o,d,T$e(g,p,n),!s,n,C$e(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(P){return P},x=d?ni.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=v$e(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:x$e(g,T,n).plane.normal,projectTo2d:E$e(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=d$e(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),M;a&&c?(M=P.topAndBottom,O.geometry=ni.scaleToGeodeticHeightExtruded(M.geometry,S,I,n,s)):a?(M=P.topAndBottom,M.geometry.attributes.position.values=fi.scaleToGeodeticHeight(M.geometry.attributes.position.values,S,n,!s),O.geometry=M.geometry):c&&(M=P.topAndBottom,M.geometry.attributes.position.values=fi.scaleToGeodeticHeight(M.geometry.attributes.position.values,I,n,!0),O.geometry=M.geometry),(a||c)&&(O.wall=!1,M.geometry=Y$(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=ni.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=Y$(O),v.push(B)}}else for(L=0;L<A.length;L++){let P=new Ft({geometry:ni.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(P.geometry.attributes.position.values=fi.scaleToGeodeticHeight(P.geometry.attributes.position.values,S,n,!s),O.geometry=P.geometry,P.geometry=Y$(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 _=Gn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new St({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};Vd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Vd({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 S$e(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(Vd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Vd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=S$e(this)),this._textureCoordinateRotationPoints}}});var qp=Vd;function uS(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=iH(e.positions),this._holes=l(e.holes)?e.holes.map(iH):[],this._rectangle=qp.computeRectangleFromPositions(this._positions,this._ellipsoid),X$(this._positions),Pge(this._holes)}function iH(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 X$(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function Pge(e){for(let t=0;t<e.length;t++)X$(e[t]);return Object.freeze(e)}function w$e(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 I$e(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!w$e(e[n],t[n]))return!1;return!0}Object.defineProperties(uS.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}}});uS.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=iH(e.positions),t._holes=e.holes.map(iH),t._rectangle=qp.computeRectangleFromPositions(t._positions,t._ellipsoid),X$(t._positions),Pge(t._holes),t):new uS({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};uS.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&I$e(e.holes,t.holes)};uS.prototype.computeRectangle=function(e){return qr("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 fS=uS;var Dge={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(Dge);var Fi=Dge;var TN=class TN{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=ue.clone(t.boundingVolume??new ue,new ue),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??TN.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??TN.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)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.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&&!_s(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(TN,"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 rH=TN;rH.DEFAULT_CAPACITY=1024;var ra=rH;var cm=class cm{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(cm.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(cm.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(cm.Layout.SHOW_U8)===1}set show(t){this._setUint8(cm.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(cm.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+cm.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(cm.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(cm.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(cm,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var K$=cm,ss=K$;var{ERR_CAPACITY:d1n,ERR_RESIZE:h1n,ERR_OUT_OF_RANGE:m1n}=ra.Error,jd=class jd extends ss{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(jd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(jd.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(jd.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(jd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(jd.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(jd.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(jd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(jd.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(jd.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(jd,"Layout",{...ss.Layout,POSITION_OFFSET_U32:ss.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ss.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ss.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ss.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ss.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ss.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ss.Layout.__BYTE_LENGTH+24});var $$=jd,Mo=$$;var EN=`#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 CN=`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 vN=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(vN,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(vN,"DEFAULT_MATERIAL");var Zl=vN;var oH=class oH extends Zl{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(oH,"DEFAULT_MATERIAL",Object.freeze(new oH));var J$=oH,Of=J$;var Z$={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},Rge={position:0,pickColor:1,showColorAlpha:2},_a=new Mo,Q$=new Of,SN=new z,Oge=new h,eJ=new Sn;function P$e(e,t,n){let i=t.context;n=n||{destroy:R$e};let r=e._positionDatatype===Y.DOUBLE,o=r?Z$:Rge;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,_a),!_a._dirty)continue;let x=_a.triangleOffset,T=_a.vertexOffset,E=_a.getTriangles();for(let R=0,O=_a.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=_a.show,S=r?_a.getPositions():null;_a.getMaterial(Q$);let I=cn.encodeRGB8(Q$.color);z.fromRgba(_a._pickId,SN);for(let R=0,O=_a.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,Oge),Sn.fromCartesian(Oge,eJ),h.pack(eJ.high,d,T*3),h.pack(eJ.low,p,T*3)),m[T*4]=z.floatToByte(SN.red),m[T*4+1]=z.floatToByte(SN.green),m[T*4+2]=z.floatToByte(SN.blue),m[T*4+3]=z.floatToByte(SN.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=Q$.color.alpha,T++;_a._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=D$e(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:nt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:Z$.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Z$.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:Rge.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.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=en.fromCache({context:i,vertexShaderSource:new Ye({sources:[EN],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[CN]}),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 D$e(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,_a);let i=_a.vertexOffset,r=_a.triangleOffset*3;e.get(t+n-1,_a);let o=_a.vertexOffset+_a.vertexCount-i,s=(_a.triangleOffset+_a.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function R$e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var wN=P$e;var{ERR_CAPACITY:iRn}=ra.Error,tJ=class e extends ra{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??ra.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??ra.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Mo}_getMaterialClass(){return Of}_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 Mo){super.add(t,n);let i=this._positionCount;n._setUint32(Mo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Mo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Mo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Mo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Mo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Mo.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=wN(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}},Ua=tJ;var{ERR_RESIZE:cRn,ERR_CAPACITY:lRn}=ra.Error,dS=class dS extends ss{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(dS.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(dS.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(dS.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(dS,"Layout",{...ss.Layout,POSITION_OFFSET_U32:ss.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ss.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ss.Layout.__BYTE_LENGTH+8});var nJ=dS,ya=nJ;var IN=class IN extends Zl{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(IN,"Layout",{...Zl.Layout,WIDTH_F32:Zl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Zl.Layout.__BYTE_LENGTH+4}),ut(IN,"DEFAULT_MATERIAL",Object.freeze(new IN));var iJ=IN,Mf=iJ;var Mge=16,O$e=.35,Nge=new ya,M$e=new Mf,Lge=new Mo,N$e=new Of,L$e=new h,F$e=new h,B$e=new he,k$e=new U,U$e=new U,PN=new z,oJ=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=jge(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,Nge),m=g.getMaterial(M$e);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),Fge(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,Nge);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(D.EPSILON3,Bge(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,k$e),y=U.fromArray(a,(d+g+1)*2,U$e);z$e(m,y,i,o),V$e(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/Mge))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=O$e/r,c=sH(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,Bge(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=mA(Math.floor(T*r),r),R=mA(Math.floor(E*r),r),O=mA(Math.floor(v*r),r),L=mA(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]=aH(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=jge(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,Lge),g=p.getMaterial(N$e);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),Fge(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,Lge);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=j$e(a,f+m,A,i,o),x=zge(b,A,-D.EPSILON3,1+D.EPSILON3,-D.EPSILON3,1+D.EPSILON3,Uge);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/Mge))),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=mA(Math.floor(T*o),o),R=mA(Math.floor(v*o),o),O=mA(Math.floor(E*o),o),L=mA(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=zge(A,x,C/o-D.EPSILON5,(C+1)/o+D.EPSILON5,_/o-D.EPSILON5,(_+1)/o+D.EPSILON5,Uge),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]=aH(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]=aH(n.primitiveCount),o=new Float32Array(i*r);o.set(sH(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:Ke.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(sH(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:Ke.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(sH(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:Ke.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:Ke.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:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=Vge(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:Ht.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:Ht.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=Vge(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 Fge(e,t,n){z.fromRgba(n,PN),e[t*4]=z.floatToByte(PN.red),e[t*4+1]=z.floatToByte(PN.green),e[t*4+2]=z.floatToByte(PN.blue),e[t*4+3]=z.floatToByte(PN.alpha)}function Bge(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 z$e(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 V$e(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 mA(e,t){return Math.max(0,Math.min(t-1,e))}var rJ=new Float64Array(512),kge=new Float64Array(512),Uge={positions:new Float64Array(512),vertexCount:0};function j$e(e,t,n,i,r){rJ.length<n*2&&(rJ=new Float64Array(n*4));let o=rJ,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 zge(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?kge:s.positions;y.length<g&&(y=new Float64Array(g*2),m?kge=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 aH(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 Vge(e,t){let[n,i]=aH(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:Ht.NEAREST,flipY:!1})}function jge(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,L$e),a=N.multiplyByPoint(r,s,F$e),c=t.cartesianToCartographic(a,B$e);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function sH(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 Es=oJ;var cJ=new Mo,sJ="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.",aJ="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.",H$e="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.",G$e="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 cl(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 Ua({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(Gge(t[r]),cJ),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&qr("ClippingPolygonCollection.debugShowDistanceTexture",aJ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&qr("ClippingPolygonCollection.quality",sJ),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=Es.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(cl.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return qr("ClippingPolygonCollection.debugShowDistanceTexture",aJ),this._debugShowDistanceTexture},set:function(e){qr("ClippingPolygonCollection.debugShowDistanceTexture",aJ),this._debugShowDistanceTexture=e}},quality:{get:function(){return qr("ClippingPolygonCollection.quality",sJ),this._quality},set:function(e){qr("ClippingPolygonCollection.quality",sJ),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function Gge(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 W$e(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=Ua.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 Wge(e,t){e._bufferPolygonCollection.get(t.bufferIndex,cJ).show=!1,t.bufferIndex=-1}cl.prototype.add=function(e){let t=this._polygons.length,n=W$e(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(Gge(e),cJ),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};cl.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};cl.prototype.contains=function(e){return this._polygons.some(t=>fS.equals(t.clippingPolygon,e))};cl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>fS.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return Wge(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};cl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];Wge(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};cl.prototype.update=function(e){if(!cl.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Es.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var Hge=new ie,q$e=new ie;cl.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,Hge)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,Hge));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,q$e);if(l(c))return $t.INTERSECTING}return r};cl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};cl.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Es.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Es.packPolygonGrid(n),Es.packPolygonTextures(t,n)),n};cl.releaseRectangleData=function(e){Es.freeResources(e)};cl.isSupported=function(e){return e?.context.webgl2};cl.prototype.isDestroyed=function(){return qr("ClippingPolygonCollection.isDestroyed",H$e),!1};cl.prototype.destroy=function(){return qr("ClippingPolygonCollection.destroy",G$e),le(this)};var Mc=cl;function qge(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}qge.prototype.execute=function(e){e.execute(this)};var Nf=qge;var hS={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};hS.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?hS.SUNLIGHT:hS.SCENE_LIGHT:hS.NONE};Object.freeze(hS);var Bg=hS;function Yge(){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=Bg.NONE}Yge.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 cT=Yge;var lm=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; uniform float u_atmosphereMieScaleHeight; @@ -5179,3543 +4523,4849 @@ out vec3 rayleighColor, out vec3 mieColor, out float opacity ) { -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; +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; +} +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(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); +for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { +if (i >= PRIMARY_STEPS) { +break; +} +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; +} +vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); +float lightHeight = length(lightPosition) - atmosphereInnerRadius; +lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; +lightPositionLength += lightStepLength; +} +vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); +rayleighAccumulation += sampleDensity.x * attenuation; +mieAccumulation += sampleDensity.y * attenuation; +rayPositionLength += (rayStepLength += rayStepLengthIncrease); +} +rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; +mieColor = u_atmosphereMieCoefficient * mieAccumulation; +opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); +} +vec4 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 = u_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) * u_atmosphereLightIntensity; +return vec4(color, opacity); +} +`;var DN=`uniform samplerCube u_radianceMap; +in vec2 v_textureCoordinates; +const float twoSqrtPi = 2.0 * sqrt(czm_pi); +float computeShBasis(int index, vec3 s) { +if (index == 0) { +return 1.0 / twoSqrtPi; +} +if (index == 1) { +return -sqrt(3.0) * s.y / twoSqrtPi; +} +if (index == 2) { +return sqrt(3.0) * s.z / twoSqrtPi; +} +if (index == 3) { +return -sqrt(3.0) * s.x / twoSqrtPi; +} +if (index == 4) { +return sqrt(15.0) * s.y * s.x / twoSqrtPi; +} +if (index == 5) { +return -sqrt(15.0) * s.y * s.z / twoSqrtPi; +} +if (index == 6) { +return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; +} +if (index == 7) { +return -sqrt(15.0) * s.x * s.z / twoSqrtPi; +} +if (index == 8) { +return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; +} +return 0.0; +} +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +const int samples = 256; +const float solidAngle = 1.0 / float(samples); +void main() { +vec2 uv = v_textureCoordinates.xy * 3.0; +int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); +for (int i = 0; i < samples; ++i) { +vec2 xi = hammersley2D(i, samples); +float phi = czm_twoPi * xi.x; +float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); +float Ylm = computeShBasis(coefficientIndex, direction); +vec3 lookupDirection = -direction.xyz; +lookupDirection.z = -lookupDirection.z; +vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); +out_FragColor += Ylm * color * solidAngle * sinTheta; +} +} +`;var RN=`precision highp float; +in vec2 v_textureCoordinates; +uniform vec3 u_faceDirection; +uniform vec3 u_positionWC; +uniform mat4 u_enuToFixedFrame; +uniform vec4 u_brightnessSaturationGammaIntensity; +uniform vec4 u_groundColor; +vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { +vec2 scaledUV = uv * 2.0 - 1.0; +if (faceDir.x != 0.0) { +return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); +} else if (faceDir.y != 0.0) { +return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); +} else { +return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); +} +} +void main() { +float height = length(u_positionWC); +float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; +float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); +vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); +float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; +float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; +vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; +vec3 normalizedDirection = normalize(direction); +czm_ray ray = czm_ray(positionWC, normalizedDirection); +czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); +if (!czm_isEmpty(intersection)) { +intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); +} +bool onEllipsoid = intersection.start >= 0.0; +float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); +vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; +float lightEnum = u_radiiAndDynamicAtmosphereColor.z; +vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); +vec3 mieColor; +vec3 rayleighColor; +float opacity; +czm_computeScattering( +ray, +rayLength, +lightDirectionWC, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); +#ifdef ATMOSPHERE_COLOR_CORRECT +const bool ignoreBlackPixels = true; +atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); +#endif +vec3 lookupDirection = -normalizedDirection; +lookupDirection.x = -lookupDirection.x; +lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); +lookupDirection.x = -lookupDirection.x; +float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); +skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); +float intensity = u_brightnessSaturationGammaIntensity.w; +vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); +vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); +vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); +vec3 up = normalize(positionWC); +float occlusion = max(dot(lightDirectionWC, up), 0.05); +vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); +vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); +vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); +float brightness = u_brightnessSaturationGammaIntensity.x; +float saturation = u_brightnessSaturationGammaIntensity.y; +float gamma = u_brightnessSaturationGammaIntensity.z; +#ifdef ENVIRONMENT_COLOR_CORRECT +color.rgb = mix(vec3(0.0), color.rgb, brightness); +color.rgb = czm_saturation(color.rgb, saturation); +#endif +color.rgb = pow(color.rgb, vec3(gamma)); +color.rgb = czm_gammaCorrect(color.rgb); +out_FragColor = color; +} +`;var ON=`precision highp float; +in vec3 v_textureCoordinates; +uniform float u_roughness; +uniform samplerCube u_radianceTexture; +uniform vec3 u_faceDirection; +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float phi = czm_twoPi * xi.x; +float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); +vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); +vec3 tangentX = normalize(cross(upVector, N)); +vec3 tangentY = cross(N, tangentX); +return tangentX * H.x + tangentY * H.y + N * H.z; +} +const int samples = 128; +void main() { +vec3 normal = u_faceDirection; +vec3 V = normalize(v_textureCoordinates); +float roughness = u_roughness; +vec4 color = vec4(0.0); +float weight = 0.0; +for (int i = 0; i < samples; ++i) { +vec2 xi = hammersley2D(i, samples); +vec3 H = importanceSampleGGX(xi, roughness, V); +vec3 L = 2.0 * dot(V, H) * H - V; +float NdotL = max(dot(V, L), 0.0); +if (NdotL > 0.0) { +color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; +weight += NdotL; +} +} +out_FragColor = color / weight; +} +`;var MN=`in vec3 position; +out vec3 v_textureCoordinates; +uniform vec3 u_faceDirection; +vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { +vec2 scaledUV = uv; +if (faceDir.x != 0.0) { +return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); +} else if (faceDir.y != 0.0) { +return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); +} else { +return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); +} +} +void main() +{ +v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); +v_textureCoordinates.y = -v_textureCoordinates.y; +v_textureCoordinates.z = -v_textureCoordinates.z; +gl_Position = vec4(position, 1.0); +} +`;function 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(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=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(Ut.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 Y$e=new h,X$e=new h;function K$e(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,X$e),s=1.025,a=Y$e,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 Xge=new h,$$e=new N,J$e=new se,Z$e=new z;function Q$e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ts({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:[lm,RN]}),e._radianceMapFS=r),cT.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,$$e),u=J$e;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 ts.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 Nf({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ts.getDirection(d,Xge),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Z$e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ci._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new ys({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 eJe(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){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 ts.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=ts.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=en.fromCache({context:a,vertexShaderSource:MN,fragmentShaderSource:ON,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new Nf({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ts.getDirection(g,Xge)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ci._queueCommand(b,t),++d}o/=2,s/=2}u()}var Kge=new U(3,3);function tJe(e,t){let n=t.context,i=Kge,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:[DN]}),e._irradianceMapFS=o);let s=new Nf({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 nJe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new ys({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=Kge,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=K$e(this,e)||i===Bg.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&&(Q$e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(eJe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(tJe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){nJe(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(),le(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 kg=Ci;var mS={HIGHLIGHT:0,REPLACE:1,MIX:2};mS.getColorBlend=function(e,t){if(e===mS.HIGHLIGHT)return 0;if(e===mS.REPLACE)return 1;if(e===mS.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(mS);var ll=mS;var $ge={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze($ge);var Hd=$ge;var Jge={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(Jge);var ul=Jge;var Zge={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(Zge);var um=Zge;var Qge={};function NN(e){this._count=e.count,this._properties=Je(e.properties,!0)}NN.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,Qge)};NN.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,Qge,e)};NN.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Je(n[e],!0)};NN.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 Ug=NN;function Nc(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(Nc.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}}});Nc.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))};Nc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Nc.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))};Nc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var lJ=[];Nc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(lJ);ti(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,lJ);ti(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(lJ);ti(t,n)}return t};Nc.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};Nc.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 Ug({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Nc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Nc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Nc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Nc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Nc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Nc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Nc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Nc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var Ql=Nc;function e_e(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=ju.createModelTextureReader({textureInfo:o,channels:iJe(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(e_e.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 iJe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var LN=e_e;function uJ(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 LN({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(uJ.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}}});uJ.prototype.getProperty=function(e){return this._properties[e]};var zg=uJ;function t_e(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(t_e.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 FN=t_e;function fJ(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 FN({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(fJ.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}}});fJ.prototype.getProperty=function(e){return this._properties[e]};var lT=fJ;function pS(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(pS.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}}});pS.prototype.getPropertyTable=function(e){return this._propertyTables[e]};pS.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};pS.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};pS.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var za=pS;function rJe(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=oJe(a,e.bufferViews,c,e.context),f=new Fd({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Ql({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 zg({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 lT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new za({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var BN=4;function oJe(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=sJe(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){_t("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Ut.maximumTextureSize}.`);return}let c=cJe(s,o),u=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.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 sJe(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(BN))continue;let c=e[s],u=l(c)?t[c.values]:aJe(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 aJe(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 cJe(e,t){let n=e.length,i=new Uint8Array(n*t*BN),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*BN,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){uJe(s,r,c);continue}lJe(s,i,c)}return i}function lJe(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*BN;t.set(i.subarray(a,a+r),c)}}function uJe(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*BN,A=f.get(m);d.set(y,p(A))}}var kN=rJe;function fJe(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 Fd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Ql({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 zg({id:a,propertyTexture:dJe(c),class:n.classes[c.class],textures:e.textures}))}return new za({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function dJe(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:hJe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function hJe(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 UN=fJe;var dJ=class extends nr{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=mJe(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=kN({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=UN({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),n_e(this),this._state=Tt.READY,!0}unload(){n_e(this),SJe(this),l(this._schemaLoader)&&Li.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function mJe(e){try{let t=AJe(e),n=CJe(e),i=vJe(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 pJe(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 gJe(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 _Je(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];pJe(r.properties,n)}return n}function yJe(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)&&gJe(o,n)}}return n}async function AJe(e){let t;l(e._extension)?t=_Je(e._extension):t=yJe(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 bJe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&xJe(o,t)}return t}function xJe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function TJe(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)&&EJe(o,t)}}return t}function EJe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function CJe(e){let t;l(e._extension)?t=bJe(e._extension):t=TJe(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 vJe(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 n_e(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 SJe(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 zN=dJ;var uT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};uT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return uT.TRANSLATION;case"ROTATION":return uT.ROTATION;case"SCALE":return uT.SCALE;case"_FEATURE_ID":return uT.FEATURE_ID}};Object.freeze(uT);var No=uT;var wJe=65534,IJe=255;function cH(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 o_e(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],PJe(this)}Object.defineProperties(cH.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function PJe(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=i_e(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>wJe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>IJe&&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=i_e(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function i_e(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=hJ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=hJ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=hJ(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=mJ(f),_=mJ(m),C=mJ(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 hJ(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 mJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}cH.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};cH.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=r_e(i),o=[];for(;i>1;)i>>=1,o.push(r_e(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:Ke.LUMINANCE,sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Zn.LINEAR})});return t.outlineTexture=s,s};function r_e(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 o_e(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)}}o_e.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 fT=cH;function s_e(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function DJe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function lH(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}lH.prototype.postProcess=function(e){this.needsOutlines&&(RJe(this),NJe(this,e)),this.needsGaussianSplats&&MJe(this,e)};function RJe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new fT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=OJe(r.outlineCoordinates),s=new s_e(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 OJe(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 MJe(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 NJe(e,t){LJe(e.attributePlans,t),l(e.indicesPlan)&&FJe(e.indicesPlan,t)}function LJe(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=nt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function FJe(e,t){let n=e.indices;if(e.loadBuffer){let i=nt.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)}lH.AttributeLoadPlan=s_e;lH.IndicesLoadPlan=DJe;var dT=lH;function BJe(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var VN=BJe;function a_e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(a_e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var jN=a_e;function c_e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(c_e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var HN=c_e;function l_e(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(l_e.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var GN=l_e;var u_e={Direct:"Direct",Indirect:"Indirect"};Object.freeze(u_e);var pA=u_e;function f_e(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(f_e.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 gS=f_e;function d_e(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(d_e.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 WN=d_e;function _S(){}function h_e(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function kJe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new jN({position:t,adjustmentParams:n})}function UJe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=h_e(e.covarianceMatrix);return new HN({position:t,adjustmentParams:n,covarianceMatrix:i})}function zJe(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new WN({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new GN({groupFlags:t,rotationThetas:n,params:i})}_S.load=function(e){let t=e.storageType;if(t===pA.Direct)return _S.loadDirect(e);if(t===pA.Indirect)return _S.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};_S.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=kJe(o);t.push(s)}let i=h_e(e.covarianceDirectUpperTriangle);return new gS({storageType:pA.Direct,anchorPointsDirect:t,covarianceDirect:i})};_S.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=UJe(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=zJe(s);r.push(a)}return new gS({storageType:pA.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var qN=_S;function m_e(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(m_e.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 YN=m_e;function p_e(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(p_e.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var XN=p_e;function g_e(e){this._ppeTextures=e}Object.defineProperties(g_e.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var KN=g_e;function as(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)&&(as.prototype=Object.create(nr.prototype),as.prototype.constructor=as);Object.defineProperties(as.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});as.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)}};as.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=this._loadResources(this),this._promise)};function VJe(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}as.prototype._loadTextures=function(){let e;l(this._extension)&&(e=VJe(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)};as.ppeTexturesMetadataSchemaCache=new Map;as._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}}}};as._obtainPpeTexturesMetadataSchema=function(e){let n=as._collectPpeTexturePropertyIdentifiers(e).toString(),i=as.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${as.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=as._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=$l.fromJson(o),as.ppeTexturesMetadataSchemaCache.set(n,i),i};as._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=as._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};as._convertToStructuralMetadata=function(e,t){let n=[],i=as._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 zg({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new za({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};as.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 XN({min:d.min,max:d.max,source:d.source}),g=new YN({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new KN(o);this._meshPrimitiveGpmLocal=a;let c=as._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Tt.READY,!0};as.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};as.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var $N=as;function jJe(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];ti(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 JN=jJe;var{Attribute:HJe,Indices:GJe,FeatureIdAttribute:y_e,FeatureIdTexture:A_e,FeatureIdImplicitRange:b_e,MorphTarget:WJe,Primitive:qJe,Instances:YJe,Skin:XJe,Node:KJe,AnimatedPropertyType:$Je,AnimationSampler:JJe,AnimationTarget:ZJe,AnimationChannel:QJe,Animation:eZe,ArticulationStage:tZe,Articulation:nZe,Asset:iZe,Scene:rZe,Components:oZe,MetallicRoughness:sZe,SpecularGlossiness:aZe,Specular:cZe,Anisotropy:pJ,Clearcoat:gJ,PlanarFill:lZe,LineStyle:uZe,Material:fZe,Vector:dZe,Polygon:hZe}=Cn,so={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},_J=class extends nr{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=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=mZe(this),this._promise)}_process(t){return this._state===so.READY?!0:(this._state===so.PROCESSING&&gZe(this,t),this._resourcesLoaded&&this._state===so.POST_PROCESSING&&(_Ze(this,t.context),this._state=so.PROCESSED),this._resourcesLoaded&&this._state===so.PROCESSED?(__e(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=pZe(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,uH(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,uH(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=so.FAILED,uH(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,PQe(this),__e(this),DQe(this),RQe(this),OQe(this),MQe(this),this._components=void 0,this._typedArray=void 0,this._state=so.UNLOADED}};async function mZe(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,uH(e,t)}}async function pZe(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new VN({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=IQe(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 uH(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function gZe(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 _Ze(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)&&yZe(e,r)}}function yZe(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 AZe(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 bZe(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 x_e(e,t){let n=Li.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function yJ(e,t,n){let i=t.byteOffset,r=Vu(e,t),o=t.count,s=Rf(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=Ng(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 xZe(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 TZe(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 EZe(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=yJ(o,n,t.typedArray);i=i??!1,TZe(n,s,r,i)}function ZN(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=x_e(e,r),s=EZe(e,o,t,n,i);return e._loaderPromises.push(s),i}return xZe(t,i)}function fm(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=x_e(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=yJ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Gu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function CZe(e){return e===Number?0:new e}function vZe(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 SZe={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function wZe(e,t){let n=vZe(e.componentDatatype),i=SZe[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 IZe(e,t,n){let i=e.decodeMatrix,r=Gu(n,e.decodedMin),o=Gu(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 PZe(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new HJe;c.name=n,c.semantic=i,c.setIndex=r,c.constant=CZe(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Gu(s,o.min),c.max=Gu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=Vu(e,o),tr(o,"WEB3D_quantized_attributes")&&IZe(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&&wZe(c,s),c}function T_e(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var DZe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function AJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=DZe;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function RZe(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function OZe(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 MZe(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 NZe(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=yJ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function E_e(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)?T_e(g):void 0,b=PZe(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=AZe(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])?OZe(b,x,s,a):l(o)?MZe(b,x,s,a):NZe(u,f,b,x,s,a)},b}function C_e(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=E_e(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new dT.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function LZe(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=AJ(e,No,i),u=c.modelSemantic,f=u===No.TRANSLATION||u===No.ROTATION||u===No.SCALE,d=u===No.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return E_e(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function FZe(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 GJe;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=bZe(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 dT.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function BZe(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 eu(e,t,n,i,r){let o=e.gltfJson,s=ju.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=ju.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=BZe(d.sampler,i,r))},c}function kZe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new aZe;return l(i)&&(c.diffuseTexture=eu(e,i,n)),l(r)&&(c.specularGlossinessTexture=eu(e,r,n)),c.diffuseFactor=Gu(se,o),c.specularFactor=Gu(h,s),c.glossinessFactor=a,c}function UZe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new sZe;return l(i)&&(c.baseColorTexture=eu(e,i,n)),l(r)&&(c.metallicRoughnessTexture=eu(e,r,n)),c.baseColorFactor=Gu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function zZe(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new cZe;return l(r)&&(a.specularTexture=eu(e,r,n)),l(s)&&(a.specularColorTexture=eu(e,s,n)),a.specularFactor=i,a.specularColorFactor=Gu(h,o),a}function VZe(e,t,n){let{anisotropyStrength:i=pJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=pJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new pJ;return l(o)&&(s.anisotropyTexture=eu(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function jZe(e,t,n){let{clearcoatFactor:i=gJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=gJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new gJ;return l(r)&&(c.clearcoatTexture=eu(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=eu(e,s,n)),l(a)&&(c.clearcoatNormalTexture=eu(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function HZe(e){return new lZe(e)}function GZe(e){if(!l(e))return;let t=new uZe;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 WZe(e,t,n){let i=new fZe,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=kZe(e,o,n):(l(u)&&(i.metallicRoughness=UZe(e,u,n)),l(s)&&!i.unlit&&(i.specular=zZe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=VZe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=jZe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=eu(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=eu(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=eu(e,t.occlusionTexture,n)),i.emissiveFactor=Gu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=HZe(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=GZe(r.BENTLEY_materials_line_style),i}function v_e(e,t){let n=new y_e;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 S_e(e,t,n,i){let r=new y_e,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=T_e(o.attribute),r.positionalLabel=i,r}function w_e(e,t){let n=new b_e;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 I_e(e,t,n,i){let r=new b_e,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 qZe(e,t,n,i){let r=new A_e;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=eu(e,o,n,Wt.NEAREST,Zn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function YZe(e,t,n,i,r,o){let s=new A_e,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=eu(e,c,i,Wt.NEAREST,Zn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function XZe(e,t,n,i,r){let o=new WJe,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=AJ(e,ct,f),g=C_e(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function KZe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function P_e(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=Gu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function $Ze(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 JZe(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=fm(e,a),u=$Ze(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:P_e(e,f)}}return i}function ZZe(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=fm(e,r)}if(n.materialColor=P_e(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=fm(e,r))}return l(t.lineStrings)&&(n.lineStrings=JZe(e,t.lineStrings,t.material)),n}function QZe(e,t,n,i){let r=new qJe,o=new dT(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=WZe(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=tQe(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=nQe(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=eQe(e,d,o)),r.edgeVisibility=ZZe(e,a.EXT_mesh_primitive_edge_visibility);let p=KZe(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],_=AJ(e,ct,O),C=_.modelSemantic;if(g&&!RZe(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=C_e(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(XZe(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=FZe(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)?iQe(e,r,E,i):S&&rQe(e,r,v,i),l(T)?oQe(r,T):S&&sQe(e,r,v),l(I)&&aQe(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 eQe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return ZN(e,i,!1)}function tQe(e,t,n){let i=new hZe,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=fm(e,r[t.indices]),i.loopIndicesOffsets=fm(e,r[n.indicesOffsets]),i.triangleIndices=fm(e,r[n.triangleIndices]),i.triangleIndicesOffsets=fm(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=fm(e,r[n.loopIndices]),i.loopIndicesOffsets=fm(e,r[n.loopIndicesOffsets]),i.triangleIndices=fm(e,r[t.indices]),i.triangleIndicesOffsets=fm(e,r[n.indicesOffsets])),i}function nQe(e,t){if(!l(t))return;let n=new dZe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return ZN(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 iQe(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=qZe(e,s,i,a):l(s.attribute)?c=v_e(s,a):c=w_e(s,a),t.featureIds.push(c)}}function rQe(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=S_e(u,d,p,g):m=I_e(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=YZe(e,u,d,i,p,g);t.featureIds.push(m)}}function oQe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function sQe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function aQe(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function cQe(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new YJe,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(LZe(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)?lQe(r,a):l(c)&&uQe(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function lQe(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=v_e(r,o):s=w_e(r,o),e.featureIds.push(s)}}function uQe(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=S_e(a,u,f,d):p=I_e(a,u,f,d),t.featureIds.push(p)}}function fQe(e,t,n){let i=new KJe;i.name=t.name,i.matrix=Gu(N,t.matrix),i.translation=Gu(h,t.translation),i.rotation=Gu(Le,t.rotation),i.scale=Gu(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=cQe(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=JN(u);for(let g=0;g<f.length;++g)i.primitives.push(QZe(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 dQe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=fQe(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 hQe(e,t,n){let i=new XJe,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=ZN(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(N.IDENTITY);return i}function mQe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=hQe(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 pQe(e,t,n,i){let r=new zN({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 gQe(e,t,n,i){let r=new $N({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 _Qe(e,t){let n=new JJe,i=e.gltfJson.accessors,r=i[t.input];n.input=ZN(e,r);let o=t.interpolation;n.interpolation=um[o]??um.LINEAR;let s=i[t.output];return n.output=ZN(e,s,!0),n}function yQe(e,t){let n=new ZJe,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=$Je[r],n}function AQe(e,t,n){let i=new QJe,r=e.sampler;return i.sampler=t[r],i.target=yQe(e.target,n),i}function bQe(e,t,n){let i=new eZe;i.name=t.name;let r=t.samplers.map(function(s,a){let c=_Qe(e,s);return c.index=a,c}),o=t.channels.map(function(s){return AQe(s,r,n)});return i.samplers=r,i.channels=o,i}function xQe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=bQe(e,r,t);return s.index=o,s})}function TQe(e){let t=new tZe;t.name=e.name;let n=e.type.toUpperCase();return t.type=ul[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function EQe(e){let t=new nZe;return t.name=e.name,t.stages=e.stages.map(TQe),t}function CQe(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(EQe):[]}function vQe(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 SQe(e,t){let n=new rZe,i=vQe(e);return n.nodes=i.map(function(r){return t[r]}),n}var wQe=new h;function IQe(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=dQe(e,t),c=mQe(e,a),u=xQe(e,a),f=CQe(n),d=SQe(n,a),p=new oZe,g=new iZe,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,wQe);p.transform=N.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=pQe(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=qN.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=gQe(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return ti(b,e._loaderPromises),e._incrementallyLoadTextures||ti(b,e._texturesPromises),Promise.all(b)}function PQe(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 __e(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 DQe(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 RQe(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 OQe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function MQe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Lf=_J;function yS(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 ys({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new ys({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}yS.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};yS.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};yS.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)};yS.prototype.isDestroyed=function(){return!1};yS.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var QN=yS;var tu={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===tu.RGBA4||e===tu.RGBA8||e===tu.RGBA16F||e===tu.RGBA32F||e===tu.RGB5_A1||e===tu.RGB565||e===tu.DEPTH_COMPONENT16||e===tu.STENCIL_INDEX8||e===tu.DEPTH_STENCIL||e===tu.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?tu.RGBA32F:e===te.HALF_FLOAT_OES?tu.RGBA16F:tu.RGBA8}};Object.freeze(tu);var nu=tu;function eL(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumRenderbufferSize,r=e.format??nu.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(eL.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});eL.prototype._getRenderbuffer=function(){return this._renderbuffer};eL.prototype.isDestroyed=function(){return!1};eL.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var Ff=eL;function Aa(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(Aa.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}}});Aa.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])};Aa.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:Ht.NEAREST}),this._numSamples>1){let a=nu.getColorFormat(r);this._colorRenderbuffers[s]=new Ff({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:Ht.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Ff({context:e,width:t,height:n,format:nu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Ff({context:e,width:t,height:n,format:nu.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:Ht.NEAREST}):this._depthRenderbuffer=new Ff({context:e,width:t,height:n,format:nu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new QN({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 ys({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Aa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};Aa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Aa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};Aa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Aa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Aa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Aa.prototype.getDepthTexture=function(){return this._depthTexture};Aa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Aa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Aa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Aa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Aa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Aa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Aa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Aa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Aa.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=Aa;var tL=`uniform sampler2D u_pointCloud_colorGBuffer; +uniform sampler2D u_pointCloud_depthGBuffer; +uniform vec2 u_distanceAndEdlStrength; +in vec2 v_textureCoordinates; +vec2 neighborContribution(float log2Depth, vec2 offset) +{ +float dist = u_distanceAndEdlStrength.x; +vec2 texCoordOrig = v_textureCoordinates + offset * dist; +vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); +vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); +float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); +float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); +if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { +return vec2(0.0); +} +float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); +return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +} +void main() +{ +float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); +eyeCoordinate /= eyeCoordinate.w; +float log2Depth = log2(-eyeCoordinate.z); +if (depthOrLogDepth == 0.0) +{ +discard; +} +vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); +vec2 texelSize = 1.0 / czm_viewport.zw; +vec2 responseAndCount = vec2(0.0); +responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); +responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); +responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); +responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); +float response = responseAndCount.x / responseAndCount.y; +float strength = u_distanceAndEdlStrength.y; +float shade = exp(-response * 300.0 * strength); +color.rgb *= shade; +out_FragColor = vec4(color); +gl_FragDepth = depthOrLogDepth; +} +`;function AS(){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(AS.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 NQe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var bJ=new U;function LQe(e,t){let n=new Ye({defines:["LOG_DEPTH_WRITE"],sources:[tL]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return bJ.x=e._radius,bJ.y=e._strength,bJ}},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 ui({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function FQe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),LQe(e,t)}function D_e(e){return e.drawBuffers&&e.fragmentDepth}AS.isSupported=D_e;function BQe(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 + czm_writeLogDepth(); + out_FragData_1 = czm_packDepth(gl_FragDepth); +#else + out_FragData_1 = czm_packDepth(gl_FragCoord.z); +#endif +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}AS.prototype.update=function(e,t,n,i){if(!D_e(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,FQe(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=BQe(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)};AS.prototype.isDestroyed=function(){return!1};AS.prototype.destroy=function(){return NQe(this),le(this)};var Vg=AS;function R_e(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}R_e.isSupported=function(e){return Vg.isSupported(e.context)};var Yp=R_e;var Lc={},kQe=new se(0,0,0,1),fl=new se,UQe=new et,xJ=new U,TJ=new U;Lc.worldToWindowCoordinates=function(e,t,n){return Lc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var O_e=new se,M_e=new h;function nL(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,O_e),O_e),s=h.multiplyComponents(t,h.normalize(o,M_e),M_e);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 zQe=new he(Math.PI,D.PI_OVER_TWO),VQe=new h,jQe=new h;Lc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Lc.computeActualEllipsoidPosition(r,t,kQe);if(!l(o))return;let s=e.canvas,a=UQe;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=zQe,p=f.project(d,VQe),g=h.clone(c.position,jQe),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,fl=nL(o,n,c,fl),Lc.clipToGLWindowCoordinates(a,fl,xJ),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,fl=nL(o,n,c,fl),Lc.clipToGLWindowCoordinates(a,fl,TJ)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,fl=nL(o,n,c,fl),Lc.clipToGLWindowCoordinates(a,fl,xJ),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,fl=nL(o,n,c,fl),Lc.clipToGLWindowCoordinates(a,fl,TJ)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(xJ,i),(i.x<0||i.x>s.clientWidth)&&(i.x=TJ.x)}}if(r.mode!==re.SCENE2D||u){if(fl=nL(o,n,c,fl),fl.z<0&&!(c.frustum instanceof gn)&&!(c.frustum instanceof As))return;i=Lc.clipToGLWindowCoordinates(a,fl,i)}return i.y=s.clientHeight-i.y,i};Lc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Lc.worldToWindowCoordinates(e,t,n),!!l(n))return Lc.transformWindowToDrawingBuffer(e,n,n)};var jg=new h,HQe=new he;Lc.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,HQe);if(!l(o))return;if(r.project(o,jg),i===re.COLUMBUS_VIEW)return h.fromElements(jg.z,jg.x,jg.y,n);if(i===re.SCENE2D)return h.fromElements(0,jg.x,jg.y,n);let s=e.morphTime;return h.fromElements(D.lerp(jg.z,t.x,s),D.lerp(jg.x,t.y,s),D.lerp(jg.y,t.z,s),n)};var N_e=new h,L_e=new h,F_e=new N;Lc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,N_e),N.computeViewportTransformation(e,0,1,F_e),N.multiplyByPoint(F_e,N_e,L_e),U.fromCartesian3(L_e,n)};Lc.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 GQe=new se,B_e=new se;Lc.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,GQe);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,B_e);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=B_e,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 dr=Lc;var bS={};bS._deprecationWarning=qr;var Hg=Uint32Array.BYTES_PER_ELEMENT;bS.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Hg;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+=Hg;let s=r.getUint32(t,!0);t+=Hg;let a=r.getUint32(t,!0);t+=Hg;let c=r.getUint32(t,!0);t+=Hg;let u=r.getUint32(t,!0);t+=Hg;let f=r.getUint32(t,!0);t+=Hg;let d;u>=570425344?(t-=Hg*2,d=a,u=c,f=0,a=0,c=0,bS._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-=Hg,d=u,u=a,f=c,a=0,c=0,bS._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):(bS._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 iL=bS;function rL(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function k_e(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 WQe(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}rL.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,k_e(this,e,t,n,1,i.byteOffset)):i};rL.prototype.hasProperty=function(e){return l(this.json[e])};rL.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)),k_e(this,e,t,n,this.featuresLength,i.byteOffset)):WQe(this,e,t,i)};rL.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 dm=rL;function oL(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=qQe(n),a;l(s.jsonProperties)&&(a=new Ug({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new qx({extension:s.hierarchy,binaryBody:i}));let u=am.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=XQe(t,u,f,i,o);g=A.transcodedSchema,p=[new lT({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=YQe(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new Fd({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 Ql({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 za(y)}function qQe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(oL._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 YQe(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=Nd(p);o[d]={bufferView:a},r[d]=U_e(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=$l.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function XQe(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=U_e(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Nd(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)&&(oL._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=$l.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function U_e(e){let t=KQe(e.componentType);return{type:e.type,componentType:t}}function KQe(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"}}oL._deprecationWarning=qr;oL._oneTimeWarning=_t;var Gg=oL;var hT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},$Qe=Cn.FeatureIdAttribute,EJ=class extends nr{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=hT.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=iL.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new dm(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 Lf({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=hT.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=hT.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return JQe(f,d)}),this._promise}process(t){if(this._state===hT.READY)return!0;if(this._state!==hT.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=N.multiplyTransformation(this._transform,i.transform,i.transform),ZQe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=hT.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function JQe(e,t){return e.unload(),e._state=hT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function ZQe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Gg({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Ql({name:am.BATCH_TABLE_CLASS_NAME,count:i});r=new za({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)z_e(o[a]);t.structuralMetadata=r}function z_e(e){let t=e.children.length;for(let i=0;i<t;i++)z_e(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 $Qe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var sL=EJ;var CJ=class extends nr{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=det(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function QQe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function eet(){this.features=[]}function vJ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function SJ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=vJ(e[r]);return[n]}function tet(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=SJ(e[i])[0];return n}function V_e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=SJ(e[i])[0];return n}function net(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=V_e(e[i]);ti(n,r)}return n}function iet(e){return[vJ(e)]}function ret(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=vJ(e[i]);return n}var oet={LineString:SJ,MultiLineString:tet,MultiPolygon:net,Polygon:V_e,MultiPoint:ret,Point:iet},set={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function j_e(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=oet[n],r=set[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new QQe;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function aet(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)j_e(n[r],t)}var cet={FeatureCollection:aet,Feature:j_e},fH=new h;function uet(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,fH),B=N.multiplyByPoint(t,V,fH);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=nt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=nt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=nt.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 fet(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,fH),O=N.multiplyByPoint(t,R,fH);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=nt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=nt.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 det(e,t){let n=new eet,i=cet[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 Ug({count:o,properties:s}),u=[new Ql({id:0,count:o,jsonMetadataTable:a})],f=$l.fromJson({}),d=new za({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(uet(r,T,t)),y&&E.push(fet(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 aL=CJ;var dH={};dH._deprecationWarning=qr;var gA=Uint32Array.BYTES_PER_ELEMENT;dH.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=gA;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+=gA;let s=r.getUint32(t,!0);t+=gA;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=gA;let c=r.getUint32(t,!0);t+=gA;let u=r.getUint32(t,!0);t+=gA;let f=r.getUint32(t,!0);t+=gA;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+=gA;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):(dH._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 cL=dH;var Wg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},hH=Cn.Attribute,het=Cn.FeatureIdAttribute,G_e=Cn.Instances,wJ=class extends nr{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=Wg.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=cL.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new dm(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=ku(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 Lf(f);return this._gltfLoader=d,this._state=Wg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=Wg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw met(this,p)}),this._promise}process(t){if(this._state===Wg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Wg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=N.multiplyTransformation(this._transform,r.transform,r.transform),_et(this,r,t),pet(this,r),this._components=r,this._arrayBuffer=void 0,this._state=Wg.READY,!0}isUnloaded(){return this._state===Wg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Tet(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Wg.UNLOADED}};function met(e,t){return e.unload(),e._state=Wg.FAILED,e.getError("Failed to load i3dm",t)}function pet(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Gg({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Ql({name:am.BATCH_TABLE_CLASS_NAME,count:i});r=new za({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var mH=new h,IJ=new Array(4),get=new N;function _et(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=Aet(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=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,mH),f[3*i+0]=mH.x,f[3*i+1]=mH.y,f[3*i+2]=mH.z;let j=N.fromTranslation(B.center,get);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&&(bet(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&&(xet(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 G_e;O.transformInWorldSpace=!0;let L=e._buffers,_=new hH;if(_.name="Instance Translation",_.semantic=No.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=nt.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 hH;B.name="Instance Rotation",B.semantic=No.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new hH;if(B.name="Instance Scale",B.semantic=No.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=nt.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 hH;C.name="Instance Feature ID",C.setIndex=0,C.semantic=No.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=nt.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 het;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?yet(O):O,V=!0)}}function yet(e){let t=new G_e;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 Aet(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 H_e=new Array(4);function bet(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,IJ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,H_e),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,IJ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,H_e);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 xet(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,IJ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Tet(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 lL=wJ;var W_e={STOPPED:0,ANIMATING:1};Object.freeze(W_e);var hm=W_e;function xS(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}xS.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};xS.prototype.evaluate=pe.throwInstantiationError;xS.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};xS.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};xS.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Dr=xS;function TS(e){this._value=e,this._valueType=Dr.getPointType(e)}Object.defineProperties(TS.prototype,{value:{get:function(){return this._value}}});TS.prototype.findTimeInterval=function(e){};TS.prototype.wrapTime=function(e){return 0};TS.prototype.clampTime=function(e){return 0};TS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var uL=TS;function ES(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ES.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ES.prototype.findTimeInterval=Dr.prototype.findTimeInterval;ES.prototype.wrapTime=Dr.prototype.wrapTime;ES.prototype.clampTime=Dr.prototype.clampTime;ES.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 _A=ES;var q_e={};q_e.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 CS=q_e;var Y_e=[],X_e=[],K_e=[],$_e=[];function Eet(e,t,n){let i=Y_e,r=K_e,o=X_e,s=$_e;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),CS.solve(i,o,r,s)}function Cet(e){let t=Y_e,n=K_e,i=X_e,r=$_e;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),CS.solve(t,i,n,r)}function Wu(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=Dr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Wu.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}}});Wu.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 Wu({times:t,points:n,inTangents:o,outTangents:r})};Wu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new _A({points:n,times:t});let i=Cet(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Wu({times:t,points:n,inTangents:o,outTangents:r})};Wu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Dr.getPointType(n[0]);if(n.length<3)return new _A({points:n,times:t});let s=Eet(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Wu({times:t,points:n,inTangents:c,outTangents:a})};Wu.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Wu.prototype.findTimeInterval=Dr.prototype.findTimeInterval;var vet=new se,vS=new h;Wu.prototype.wrapTime=Dr.prototype.wrapTime;Wu.prototype.clampTime=Dr.prototype.clampTime;Wu.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=vet;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=N.multiplyByVector(Wu.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,vS),d.add(t,vS,t),d.multiplyByScalar(o[s],f.z,vS),d.add(t,vS,t),d.multiplyByScalar(r[s],f.w,vS),d.add(t,vS,t))};var yA=Wu;function SS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(SS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});SS.prototype.findTimeInterval=Dr.prototype.findTimeInterval;SS.prototype.wrapTime=Dr.prototype.wrapTime;SS.prototype.clampTime=Dr.prototype.clampTime;SS.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 fL=SS;function wet(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 wS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=wet(this),this._lastTimeIndex=0}Object.defineProperties(wS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});wS.prototype.findTimeInterval=Dr.prototype.findTimeInterval;wS.prototype.wrapTime=Dr.prototype.wrapTime;wS.prototype.clampTime=Dr.prototype.clampTime;wS.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var dL=wS;var IS=Cn.AnimatedPropertyType;function PJ(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,Oet(this)}Object.defineProperties(PJ.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 Iet(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 yA({times:e,points:n,inTangents:i,outTangents:r})}function J_e(e,t,n,i){if(e.length===1&&t.length===1)return new uL(t[0]);switch(n){case um.STEP:return new fL({times:e,points:t});case um.CUBICSPLINE:return Iet(e,t);case um.LINEAR:return i===IS.ROTATION?new dL({times:e,points:t}):new _A({times:e,points:t})}}function Pet(e,t,n,i,r){let o=[];if(i===IS.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===um.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(J_e(e,f,n,i))}}else o.push(J_e(e,t,n,i));return o}var Det=new h,Ret=new Le;function Oet(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=Pet(i,r,o,a,u);e._splines=f,e._path=a}PJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===IS.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===IS.TRANSLATION||n===IS.SCALE?r[n]=o.evaluate(s,Det):n===IS.ROTATION&&(r[n]=o.evaluate(s,Ret))}}};var hL=PJ;function DJ(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??Hu.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=hm.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,Met(this)}Object.defineProperties(DJ.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 Met(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 hL({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}DJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var mL=DJ;function qg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(qg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function RJ(e,t,n){let i=e._model,r=new mL(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}qg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return RJ(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 RJ(this,n[i],e)};qg.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=RJ(this,n[o],e);i.push(s)}return i};qg.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};qg.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])};qg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};qg.prototype.get=function(e){return this._runtimeAnimations[e]};var pH=[];function Net(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}qg.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===Hu.REPEAT||a.loop===Hu.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===hm.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===hm.ANIMATING){if(y&&a._state===hm.STOPPED&&(a._state=hm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Hu.REPEAT)g=g-Math.floor(g);else if(a.loop===Hu.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=hm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&pH.push(a))}}n=pH.length;for(let s=0;s<n;++s){let a=pH[s];t.splice(t.indexOf(a),1),e.afterRender.push(Net(this,o,a))}return pH.length=0,i};var pL=qg;function mT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(mT.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}}});mT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};mT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};mT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};mT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};mT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var gL=mT;var PS={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};PS.getStyleCommandsNeeded=function(e,t){return t===0?PS.ALL_OPAQUE:t===e?PS.ALL_TRANSLUCENT:PS.OPAQUE_AND_TRANSLUCENT};Object.freeze(PS);var mm=PS;var Yg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Yg.is3DTiles=function(e){switch(e){case Yg.TILE_GLTF:case Yg.TILE_B3DM:case Yg.TILE_I3DM:case Yg.TILE_PNTS:case Yg.TILE_GEOJSON:return!0;case Yg.GLTF:return!1}};Object.freeze(Yg);var Wo=Yg;function Cs(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=mm.ALL_OPAQUE,Let(this)}Object.defineProperties(Cs.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 Let(e){let t=e._model,n=Wo.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 na(s,r)}else for(r=0;r<i;r++)o[r]=new gL({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Kl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Cs.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=mm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Cs.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Cs.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Cs.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Cs.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Cs.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Cs.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Cs.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Cs.prototype.getFeature=function(e){return this._features[e]};Cs.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Cs.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Cs.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Cs.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Cs.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Cs.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Cs.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Cs.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Cs.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Fet=new z;Cs.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Kl.DEFAULT_COLOR_VALUE),this.setAllShow(Kl.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,Fet)??Kl.DEFAULT_COLOR_VALUE:Kl.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Kl.DEFAULT_SHOW_VALUE:Kl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var _L=Cs;var AA={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};AA.includesVertexShader=function(e){return(e&AA.VERTEX)!==0};AA.includesFragmentShader=function(e){return(e&AA.FRAGMENT)!==0};AA.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};AA.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(AA);var de=AA;var Z_e={name:"TilesetPipelineStage"};Z_e.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 yL=Z_e;var AL=`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; +vec2 tTrigs = vec2(0.70710678118); +vec2 v = radii * tTrigs; +vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; +vec2 q = normalize(p - evolute) * length(v - evolute); +tTrigs = (q + evolute) * inverseRadii; +tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); +v = radii * tTrigs; +return v * sign(pos); +} +vec3 computeEllipsoidPositionWC(vec3 positionMC) { +vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; +vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); +vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); +return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); +} +void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { +vec3 fogColor = groundAtmosphereColor.rgb; +const float NONE = 0.0; +if (czm_atmosphereDynamicLighting != NONE) { +float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); +fogColor *= darken; +} +#ifndef HDR +fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); +fogColor.rgb = czm_inverseGamma(fogColor.rgb); +#endif +vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); +color = vec4(withFog, color.a); +} +void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { +vec3 rayleighColor; +vec3 mieColor; +float opacity; +vec3 positionWC; +vec3 lightDirection; +if (false) { +positionWC = computeEllipsoidPositionWC(attributes.positionMC); +lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); +czm_computeGroundAtmosphereScattering( +positionWC, +lightDirection, +rayleighColor, +mieColor, +opacity +); +} else { +positionWC = attributes.positionWC; +lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); +rayleighColor = v_atmosphereRayleighColor; +mieColor = v_atmosphereMieColor; +opacity = v_atmosphereOpacity; +} +const bool ignoreBlackPixels = true; +rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); +mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); +vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); +if (u_isInFog) { +float distanceToCamera = length(attributes.positionEC); +applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); +} else { +} +} +`;var bL=`void atmosphereStage(ProcessedAttributes attributes) { +vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); +czm_computeGroundAtmosphereScattering( +v_positionWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); +} +`;var Q_e={name:"AtmospherePipelineStage"};Q_e.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([bL]),i.addFragmentLines([AL]),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 xL=Q_e;var TL=`#ifdef DIFFUSE_IBL +vec3 sampleDiffuseEnvironment(vec3 cubeDir) +{ +#ifdef CUSTOM_SPHERICAL_HARMONICS +return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); +#else +return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); +#endif +} +#endif +#ifdef SPECULAR_IBL +vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +{ +#ifdef CUSTOM_SPECULAR_IBL +float lod = roughness * model_specularEnvironmentMapsMaximumLOD; +return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; +#else +float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; +return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; +#endif +} +vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +{ +vec3 f90 = max(vec3(1.0 - roughness), f0); +vec3 F = fresnelSchlick2(f0, f90, NdotV); +vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; +vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); +return specularSample * (F * brdfLut.x + brdfLut.y); +} +#endif +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { +vec3 f0 = material.specular; +float roughness = material.roughness; +float specularWeight = 1.0; +#ifdef USE_SPECULAR +specularWeight = material.specularWeight; +#endif +float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); +vec3 f90 = max(vec3(1.0 - roughness), f0); +vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); +vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; +vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); +#ifdef DIFFUSE_IBL +vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); +vec3 irradiance = sampleDiffuseEnvironment(normalMC); +vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; +float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); +vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); +vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; +vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; +#else +vec3 diffuseContribution = vec3(0.0); +#endif +#ifdef USE_ANISOTROPY +vec3 anisotropyDirection = material.anisotropicB; +vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); +vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); +float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); +float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; +vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); +vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); +#else +vec3 reflectEC = reflect(-viewDirectionEC, normalEC); +#endif +#ifdef SPECULAR_IBL +vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); +vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); +vec3 specularContribution = radiance * FssEss * model_iblFactor.y; +#else +vec3 specularContribution = vec3(0.0); +#endif +return diffuseContribution + specularContribution; +} +#endif +`;var eye={name:"ImageBasedLightingPipelineStage"},Bet=new U;eye.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),nm.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(TL);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Bet)},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 EL=eye;var ket=D.EPSILON16;function MJ(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(MJ.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,ket)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Uet=new h,OJ=new $;MJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Uet,r;switch(t){case ul.XROTATE:r=$.fromRotationX(D.toRadians(n),OJ),e=N.multiplyByMatrix3(e,r,e);break;case ul.YROTATE:r=$.fromRotationY(D.toRadians(n),OJ),e=N.multiplyByMatrix3(e,r,e);break;case ul.ZROTATE:r=$.fromRotationZ(D.toRadians(n),OJ),e=N.multiplyByMatrix3(e,r,e);break;case ul.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ul.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ul.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case ul.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case ul.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case ul.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case ul.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};var CL=MJ;function gH(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,zet(this)}Object.defineProperties(gH.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 zet(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 CL({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}gH.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Vet=new N,jet=new N;gH.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,Vet),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,jet);s.transform=a}};var vL=gH;var SL=`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 DS={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};DS.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(SL);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",DS.COLOR_UNIFORM_NAME,de.FRAGMENT),r[DS.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",DS.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[DS.COLOR_BLEND_UNIFORM_NAME]=function(){return ll.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var bA=DS;var wL=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +vec4 getClippingPlane( +highp sampler2D packedClippingPlanes, +int clippingPlaneNumber, +mat4 transform +) { +int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; +int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); +float u = (float(pixX) + 0.5) * pixelWidth; +float v = (float(pixY) + 0.5) * pixelHeight; +vec4 plane = texture(packedClippingPlanes, vec2(u, v)); +return czm_transformPlane(plane, transform); +} +#else +vec4 getClippingPlane( +highp sampler2D packedClippingPlanes, +int clippingPlaneNumber, +mat4 transform +) { +int clippingPlaneStartIndex = clippingPlaneNumber * 2; +int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; +int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); +float u = (float(pixX) + 0.5) * pixelWidth; +float v = (float(pixY) + 0.5) * pixelHeight; +vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; +vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); +vec4 plane; +plane.xyz = czm_octDecode(oct, 65535.0); +plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); +return czm_transformPlane(plane, transform); +} +#endif +float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { +vec4 position = czm_windowToEyeCoordinates(fragCoord); +vec3 clipNormal = vec3(0.0); +vec3 clipPosition = vec3(0.0); +float pixelWidth = czm_metersPerPixel(position); +#ifdef UNION_CLIPPING_REGIONS +float clipAmount; +#else +float clipAmount = 0.0; +bool clipped = true; +#endif +for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { +vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); +clipNormal = clippingPlane.xyz; +clipPosition = -clippingPlane.w * clipNormal; +float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; +#ifdef UNION_CLIPPING_REGIONS +clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); +if (amount <= 0.0) { +discard; +} +#else +clipAmount = max(amount, clipAmount); +clipped = clipped && (amount <= 0.0); +#endif +} +#ifndef UNION_CLIPPING_REGIONS +if (clipped) { +discard; +} +#endif +return clipAmount; +} +void modelClippingPlanesStage(inout vec4 color) +{ +float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); +vec4 clippingPlanesEdgeColor = vec4(1.0); +clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; +float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; +if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { +color = clippingPlanesEdgeColor; +} +} +`;var tye={name:"ModelClippingPlanesPipelineStage"},Het=new U,Get=new N,Wet=new N;tye.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),bs.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=bs.getTextureResolution(i,r,Het);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(wL);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,Get);return N.multiply(c,t._clippingPlanesMatrix,Wet)}};e.uniformMap=Ot(a,e.uniformMap)};var IL=tye;var PL=`void modelClippingPolygonsStage() +{ +bool insideAny = vectorClip(v_clippingUv); +#ifdef CLIPPING_INVERSE +if (!insideAny) +{ +discard; +} +#else +if (insideAny) +{ +discard; +} +#endif +} +`;var DL=`void modelClippingPolygonsStage() +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; +} +`;var Xg=`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; +} +} +return inside; +} +`;var iye={name:"ModelClippingPolygonsPipelineStage"},qet=new U,Yet=new U,nye=ie.MAX_VALUE;iye.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(DL),r.addFragmentLines(Xg),r.addFragmentLines(PL);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??nye,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,qet)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??nye;return U.fromElements(1/s.width,1/s.height,Yet)},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 RL=iye;var OL=`void modelVectorLookupStage(ProcessedAttributes attributes) +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; +} +`;var ML=`void modelVectorLookupStage(inout vec4 color) +{ +color = vectorPolygonRender(v_vectorUv, color); +color = vectorPolylineRender(v_vectorUv, color); +} +`;var Xet={name:"ModelVectorLookupPipelineStage",process:Jet},Ket=new U,$et=new U;function Jet(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(OL),i.addFragmentLines(Xg),i.addFragmentLines(ML);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,Ket)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,$et)},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 NL=Xet;function rye(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(rye.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 LL=rye;var FL=`mat4 getInstancingTransform() +{ +mat4 instancingTransform; +#ifdef HAS_INSTANCE_MATRICES +instancingTransform = mat4( +a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, +a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, +a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, +a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 +); +#else +vec3 translation = vec3(0.0, 0.0, 0.0); +vec3 scale = vec3(1.0, 1.0, 1.0); +#ifdef HAS_INSTANCE_TRANSLATION +translation = a_instanceTranslation; +#endif +#ifdef HAS_INSTANCE_SCALE +scale = a_instanceScale; +#endif +instancingTransform = mat4( +scale.x, 0.0, 0.0, 0.0, +0.0, scale.y, 0.0, 0.0, +0.0, 0.0, scale.z, 0.0, +translation.x, translation.y, translation.z, 1.0 +); +#endif +return instancingTransform; +} +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ +mat4 instancingTransform2D; +#ifdef HAS_INSTANCE_MATRICES +instancingTransform2D = mat4( +a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, +a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, +a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, +a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 +); +#else +vec3 translation2D = vec3(0.0, 0.0, 0.0); +vec3 scale = vec3(1.0, 1.0, 1.0); +#ifdef HAS_INSTANCE_TRANSLATION +translation2D = a_instanceTranslation2D; +#endif +#ifdef HAS_INSTANCE_SCALE +scale = a_instanceScale; +#endif +instancingTransform2D = mat4( +scale.x, 0.0, 0.0, 0.0, +0.0, scale.y, 0.0, 0.0, +0.0, 0.0, scale.z, 0.0, +translation2D.x, translation2D.y, translation2D.z, 1.0 +); +#endif +return instancingTransform2D; } -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(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); -for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { -if (i >= PRIMARY_STEPS) { -break; +#endif +`;var BL=`void instancingStage(inout ProcessedAttributes attributes) +{ +vec3 positionMC = attributes.positionMC; +mat4 instancingTransform = getInstancingTransform(); +attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; +#endif +#ifdef USE_2D_INSTANCING +mat4 instancingTransform2D = getInstancingTransform2D(); +attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#endif } -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 kL=`void legacyInstancingStage( +inout ProcessedAttributes attributes, +out mat4 instanceModelView, +out mat3 instanceModelViewInverseTranspose) +{ +vec3 positionMC = attributes.positionMC; +mat4 instancingTransform = getInstancingTransform(); +mat4 instanceModel = instancingTransform * u_instance_nodeTransform; +instanceModelView = u_instance_modifiedModelView; +instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); +attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; +#ifdef USE_2D_INSTANCING +mat4 instancingTransform2D = getInstancingTransform2D(); +attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#endif } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +`;var _H=new N,Zet=new N,Qet=new N,sye={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:fye,_transformsToTypedArray:LJ};sye.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(FL);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=[];mtt(e,n,i,d,u,f),_tt(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,_H);return u?N.multiplyTransformation(n.context.uniformState.view3D,g,_H):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,_H)),N.multiplyTransformation(n.context.uniformState.view,g,_H))},p.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,Zet)},o.addVertexLines(kL)):o.addVertexLines(BL),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,Qet)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,ti(e.attributes,d)};var UL=new N,ett=new h;function ttt(e,t,n,i,r){let o=N.multiplyTransformation(t,e,UL);return o=N.multiplyTransformation(o,n,UL),r=At.basisTo2D(i.mapProjection,o,r),r}function ntt(e,t,n,i,r){let o=N.fromTranslation(e,UL),s=N.multiplyTransformation(t,o,UL);s=N.multiplyTransformation(s,n,UL);let a=N.getTranslation(s,ett);return r=dr.computeActualEllipsoidPosition(i,a,r),r}function aye(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 cye=new N,lye=new N,itt=new N,rtt=new h;function ott(e,t,n,i){let r=cye,o=lye;aye(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=ttt(f,r,o,n,itt),p=N.getTranslation(d,rtt),g=h.subtract(p,a,p);i[u]=N.setTranslation(d,g,i[u])}return i}function stt(e,t,n,i){let r=cye,o=lye;aye(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=ntt(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var att=new h,ctt=new h;function uye(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=N.multiplyByPoint(i,n.instancingTranslationMin,att),o=dr.computeActualEllipsoidPosition(t,r,r),s=N.multiplyByPoint(i,n.instancingTranslationMax,ctt),a=dr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function LJ(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 ltt(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 utt=new h,ftt=new Le,dtt=new h;function fye(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,No.TRANSLATION),o=xt.getAttributeBySemantic(e,No.ROTATION),s=xt.getAttributeBySemantic(e,No.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],utt);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,ftt),T=new h(m[A*3],m[A*3+1],m[A*3+2],dtt),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 htt(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 FJ(e,t){let n=nt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function mtt(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,No.ROTATION);l(s)||o?ptt(e,n,i,t,r,o):gtt(e,n,i,t,r)}function ptt(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=fye(t,a,e);let A=LJ(d);p=FJ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(oye(e,p,n,f),!r)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,uye(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=ott(d,e,g,d),b=LJ(A);m=FJ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}oye(e,m,n,"Transform2D")}function gtt(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,No.TRANSLATION),u=xt.getAttributeBySemantic(t,No.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),NJ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=htt(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),NJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,uye(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=stt(f,e,g,f),T=ltt(x);o&&(a.transformsTypedArray=T),m=FJ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;NJ(e,m,0,void 0,n,"Translation2D")}function oye(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`),ti(n,a)}function NJ(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 _tt(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===No.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 zL=sye;var dye=[],BJ={};BJ.name="ModelMatrixUpdateStage";BJ.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;hye(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function ytt(e,t,n){e.modelMatrix=N.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function hye(e,t,n,i,r){let o,s=dye[r];l(s)||(s=dye[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];ytt(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}hye(u,t,n,i,r+1),u._transformDirty=!1}}var VL=BJ;var mye={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:pye,_countGeneratedBuffers:gye};mye.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;pye(i,r),gye(i,o)};function pye(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 gye(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 jL=mye;function RS(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,Att(this)}Object.defineProperties(RS.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),kJ(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),kJ(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),kJ(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 Att(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 Gy(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 kJ(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}RS.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};RS.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(zL),t.push(jL),n.push(VL)};RS.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};RS.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 HL=RS;var _ye={name:"AlphaPipelineStage"};_ye.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 GL=_ye;var yye={name:"BatchTexturePipelineStage"};yye.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 WL=yye;var Aye={name:"ClassificationPipelineStage"};Aye.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||btt(t,r)};function btt(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 qL=Aye;var YL=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +{ +bool styleTranslucent = (featureColor.a != 1.0); +if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) +{ +#ifdef HAS_SILHOUETTE +positionMC *= float(model_silhouettePass); +#else +positionMC *= 0.0; +#endif } -vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); -rayleighAccumulation += sampleDensity.x * attenuation; -mieAccumulation += sampleDensity.y * attenuation; -rayPositionLength += (rayStepLength += rayStepLengthIncrease); +else if (czm_pass != czm_passTranslucent && styleTranslucent) +{ +positionMC *= 0.0; } -rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = u_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); } -vec4 computeAtmosphereColor( -vec3 positionWC, -vec3 lightDirection, -vec3 rayleighColor, -vec3 mieColor, -float opacity +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) +{ +float show = ceil(feature.color.a); +positionMC *= show; +#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) +filterByPassType(positionMC, feature.color); +#endif +} +`;var XL=`void filterByPassType(vec4 featureColor) +{ +bool styleTranslucent = (featureColor.a != 1.0); +if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) +{ +#ifdef HAS_SILHOUETTE +if(!model_silhouettePass) { +discard; +} +#else +discard; +#endif +} +else if (czm_pass != czm_passTranslucent && styleTranslucent) +{ +discard; +} +} +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ +vec4 featureColor = feature.color; +if (featureColor.a == 0.0) +{ +discard; +} +#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) +filterByPassType(featureColor); +#endif +featureColor = czm_gammaCorrect(featureColor); +#ifdef HAS_CLASSIFICATION +material.diffuse = featureColor.rgb * featureColor.a; +#else +float highlight = ceil(model_colorBlend); +material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); +#endif +material.alpha *= featureColor.a; +} +`;var bye={name:"CPUStylingPipelineStage"};bye.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(YL),r.addFragmentLines(XL),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",bA.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[bA.COLOR_BLEND_UNIFORM_NAME]=function(){return ll.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var KL=bye;var UJ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};UJ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(UJ);var Kg=UJ;var $L=`void customShaderStage( +inout czm_modelVertexOutput vsOutput, +inout ProcessedAttributes attributes, +FeatureIds featureIds, +Metadata metadata, +MetadataClass metadataClass, +MetadataStatistics metadataStatistics ) { -vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; -vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -float cosAngle = dot(cameraToPositionWCDirection, lightDirection); -float cosAngleSq = cosAngle * cosAngle; -float G = u_atmosphereMieAnisotropy; -float GSq = G * G; -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) * u_atmosphereLightIntensity; -return vec4(color, opacity); +VertexInput vsInput; +initializeInputStruct(vsInput, attributes); +vsInput.featureIds = featureIds; +vsInput.metadata = metadata; +vsInput.metadataClass = metadataClass; +vsInput.metadataStatistics = metadataStatistics; +vertexMain(vsInput, vsOutput); +attributes.positionMC = vsOutput.positionMC; } -`;var EN=`uniform samplerCube u_radianceMap; -in vec2 v_textureCoordinates; -const float twoSqrtPi = 2.0 * sqrt(czm_pi); -float computeShBasis(int index, vec3 s) { -if (index == 0) { -return 1.0 / twoSqrtPi; +`;var JL=`void customShaderStage( +inout czm_modelMaterial material, +ProcessedAttributes attributes, +FeatureIds featureIds, +Metadata metadata, +MetadataClass metadataClass, +MetadataStatistics metadataStatistics +) { +FragmentInput fsInput; +initializeInputStruct(fsInput, attributes); +fsInput.featureIds = featureIds; +fsInput.metadata = metadata; +fsInput.metadataClass = metadataClass; +fsInput.metadataStatistics = metadataStatistics; +fragmentMain(fsInput, material); } -if (index == 1) { -return -sqrt(3.0) * s.y / twoSqrtPi; +`;var ZL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { +initializeFeatureIds(featureIds, attributes); +initializeFeatureIdAliases(featureIds); } -if (index == 2) { -return sqrt(3.0) * s.z / twoSqrtPi; +`;var QL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ +initializeFeatureIds(featureIds, attributes); +initializeFeatureIdAliases(featureIds); +setFeatureIdVaryings(); } -if (index == 3) { -return -sqrt(3.0) * s.x / twoSqrtPi; +`;var hr={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()"};hr.process=function(e,t,n){let i=e.shaderBuilder;xtt(i);let r=e.runtimeNode.node.instances;l(r)&&Ttt(e,r,n),Ett(e,t,n),i.addVertexLines(QL),i.addFragmentLines(ZL)};function xtt(e){e.addStruct(hr.STRUCT_ID_FEATURE_IDS_VS,hr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(hr.STRUCT_ID_FEATURE_IDS_FS,hr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,hr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function Ttt(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?Ctt(e,s,a):xye(e,s,a,r,1,n);let c=s.label;l(c)&&Tye(e,a,c,de.BOTH)}}function Ett(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?vtt(e,a,c):a instanceof Cn.FeatureIdImplicitRange?xye(e,a,c,o,void 0,n):(Stt(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&Tye(e,c,f,u)}}function Ctt(e,t,n){let i=e.shaderBuilder;i.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(hr.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(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function vtt(e,t,n){let i=e.shaderBuilder;i.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(hr.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(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function xye(e,t,n,i,r,o){wtt(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(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Stt(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(hr.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(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Tye(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function wtt(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=Itt(t,n);s=nt.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 Itt(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 xA=hr;var eF=`void metadataStage( +FeatureIds featureIds, +out Metadata metadata, +out MetadataClass metadataClass, +out MetadataStatistics metadataStatistics, +ProcessedAttributes attributes +) +{ +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); } -if (index == 4) { -return sqrt(15.0) * s.y * s.x / twoSqrtPi; +`;var tF=`void metadataStage( +FeatureIds featureIds, +out Metadata metadata, +out MetadataClass metadataClass, +out MetadataStatistics metadataStatistics, +ProcessedAttributes 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(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=Ytt(r,t),f=Ptt(o.propertyAttributes,t,a),d=Rtt(o.propertyTextures,a),p=Ntt(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);Btt(i,g),ztt(i),i.addVertexLines(tF),i.addFragmentLines(eF);for(let m=0;m<f.length;m++){let y=f[m];Vtt(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Htt(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Wtt(e,y,c)}};function Ptt(e,t,n){return l(e)?e.flatMap(i=>Dtt(i,t,n)):[]}function Dtt(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 Rtt(e,t){return l(e)?e.flatMap(n=>Ott(n,t)):[]}function Ott(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 Mtt=4;function Ntt(e,t,n,i,r){if(!l(e))return[];let o=Ftt(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Ltt(s,o,i,r))}function Ltt(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(Mtt))continue;let y=u[g],A=de.intersection($tt(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 Ftt(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 Btt(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"?Utt(c):c;e.addStructField(a,p,d)}}}var ktt={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Utt(e){let t=ktt[e];return l(t)?t:e}function ztt(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 Vtt(e,t){jtt(e,t),zJ(e.shaderBuilder,t),VJ(e.shaderBuilder,t)}function jtt(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=jJ({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 Htt(e,t,n){Gtt(e,t,n),zJ(e.shaderBuilder,t),VJ(e.shaderBuilder,t)}function Gtt(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=jJ({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 zJ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=Eye(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 VJ(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=Eye(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 Wtt(e,t,n){qtt(e,t,n),zJ(e.shaderBuilder,t),VJ(e.shaderBuilder,t)}function qtt(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=jJ({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 Eye(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 jJ(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 Ytt(e,t){let n=new Set,i=new Set;return Xtt(e,n,i),Ktt(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Xtt(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 Ktt(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 $tt(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 Gd=Di;var Cye={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Cye);var TA=Cye;var Va={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};Va.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===TA.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===TA.OPAQUE&&(o.pass=void 0);let u=rnt(s,t,e);if(!u.customShaderEnabled)return;if(cnt(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=Kg.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 Jtt(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var Ztt={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},Qtt={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 vye(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Ztt[t],i=Qtt[t];if(l(n))return{attributeField:[n,e],value:i}}function ent(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!Iye(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=Sye(t,r,!1),s=wye(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=vye(d);if(!l(p))return Va._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 tnt(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 nnt(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!Iye(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=Sye(t,r,!0),s=wye(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=vye(p);if(!l(g))return Va._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=tnt(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var int={positionWC:!0,positionEC:!0};function Sye(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 wye(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||int.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 rnt(e,t,n){let i=Jtt(t.attributes),r=lnt(t,n.model.structuralMetadata),o=ent(e,i,r),s=nnt(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function ont(e,t){let n=Va.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Va.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=Va.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Va.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Va.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,xA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Gd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Gd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Gd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Va.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Va.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function snt(e,t){let n=Va.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Va.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=Va.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Va.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Va.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,xA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Gd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Gd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Gd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Va.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Va.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var ant=[];function cnt(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=ant;i.enabled&&(ont(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,$L),e.addVertexLines(o)),r.enabled&&(snt(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,JL),e.addFragmentLines(o))}function lnt(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 Iye(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Va._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 nF=Va;var iF={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};iF.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(iF.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,iF.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);fnt(i,p),unt(e,p)}};function unt(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=Pye(u,0),f=Pye(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Pye(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function fnt(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=dnt(n,i):r=hnt(n),e.addFunctionLines(iF.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function dnt(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 hnt(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var rF=iF;var oF=`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; } -if (index == 5) { -return -sqrt(15.0) * s.y * s.z / twoSqrtPi; } -if (index == 6) { -return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; } -if (index == 7) { -return -sqrt(15.0) * s.x * s.z / twoSqrtPi; +`;var Dye={name:"EdgeDetectionPipelineStage"};Dye.process=function(e){e.shaderBuilder.addFragmentLines([oF])};var sF=Dye;var aF=`#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; } -if (index == 8) { -return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; +float edgeTypeInt = v_edgeType * 255.0; +if (edgeTypeInt < 0.5) { +discard; } -return 0.0; +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +if (v_shouldDiscard > 0.5) { +discard; } -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); +vec4 finalColor = color; +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +if (v_edgeColor.a >= 0.0) { +finalColor = v_edgeColor; } -return value; +#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; } -vec2 hammersley2D(int i, int N) -{ -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +#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 } -const int samples = 256; -const float solidAngle = 1.0 / float(samples); -void main() { -vec2 uv = v_textureCoordinates.xy * 3.0; -int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); -for (int i = 0; i < samples; ++i) { -vec2 xi = hammersley2D(i, samples); -float phi = czm_twoPi * xi.x; -float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); -float Ylm = computeShBasis(coefficientIndex, direction); -vec3 lookupDirection = -direction.xyz; -lookupDirection.z = -lookupDirection.z; -vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); -out_FragColor += Ylm * color * solidAngle * sinTheta; +`;var cF=`#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; } } -`;var CN=`precision highp float; -in vec2 v_textureCoordinates; -uniform vec3 u_faceDirection; -uniform vec3 u_positionWC; -uniform mat4 u_enuToFixedFrame; -uniform vec4 u_brightnessSaturationGammaIntensity; -uniform vec4 u_groundColor; -vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { -vec2 scaledUV = uv * 2.0 - 1.0; -if (faceDir.x != 0.0) { -return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); -} else if (faceDir.y != 0.0) { -return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); +#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 { -return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); +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; } -void main() { -float height = length(u_positionWC); -float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; -float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); -vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); -float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; -float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; -vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; -vec3 normalizedDirection = normalize(direction); -czm_ray ray = czm_ray(positionWC, normalizedDirection); -czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); -if (!czm_isEmpty(intersection)) { -intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); +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; } -bool onEllipsoid = intersection.start >= 0.0; -float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); -vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; -float lightEnum = u_radiiAndDynamicAtmosphereColor.z; -vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); -vec3 mieColor; -vec3 rayleighColor; -float opacity; -czm_computeScattering( -ray, -rayLength, -lightDirectionWC, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); -vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); -#ifdef ATMOSPHERE_COLOR_CORRECT -const bool ignoreBlackPixels = true; -atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); #endif -vec3 lookupDirection = -normalizedDirection; -lookupDirection.x = -lookupDirection.x; -lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); -lookupDirection.x = -lookupDirection.x; -float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); -skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); -float intensity = u_brightnessSaturationGammaIntensity.w; -vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); -vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); -vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); -vec3 up = normalize(positionWC); -float occlusion = max(dot(lightDirectionWC, up), 0.05); -vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); -vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); -vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); -float brightness = u_brightnessSaturationGammaIntensity.x; -float saturation = u_brightnessSaturationGammaIntensity.y; -float gamma = u_brightnessSaturationGammaIntensity.z; -#ifdef ENVIRONMENT_COLOR_CORRECT -color.rgb = mix(vec3(0.0), color.rgb, brightness); -color.rgb = czm_saturation(color.rgb, saturation); +`;var HJ=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,No.TRANSLATION),o=xt.getAttributeBySemantic(t,No.ROTATION),s=xt.getAttributeBySemantic(t,No.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)}}},ba=HJ;var OS=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),Rye={name:"EdgeVisibilityPipelineStage"};Rye.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(aF),i.addVertexLines(cF),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=pnt(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=gnt(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=mnt(p.edgeIndices,p.edgeData,t.edgeVisibility),S=_nt(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 mnt(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!==OS.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 pnt(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===OS.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===OS.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===OS.REPEATED_HARD?OS.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:OS.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function gnt(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=ba.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 _nt(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:ba.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:ba.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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(let nn=0;nn<4;nn++)R[(ht+nn)*3]=bi,R[(ht+nn)*3+1]=Wi,R[(ht+nn)*3+2]=wi,O[(ht+nn)*3]=hi,O[(ht+nn)*3+1]=xi,O[(ht+nn)*3+2]=jn}let q=nt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=nt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=nt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=nt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=nt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=nt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=M?nt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?nt.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=nt.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:ba.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=nt.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 lF=Rye;var uF=`void geometryStage(out ProcessedAttributes attributes) +{ +attributes.positionMC = v_positionMC; +attributes.positionEC = v_positionEC; +#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) +attributes.positionWC = v_positionWC; +#endif +#ifdef HAS_NORMALS +attributes.normalEC = normalize(v_normalEC); +#endif +#ifdef HAS_TANGENTS +attributes.tangentEC = normalize(v_tangentEC); +#endif +#ifdef HAS_BITANGENTS +attributes.bitangentEC = normalize(v_bitangentEC); +#endif +setDynamicVaryings(attributes); +} +`;var fF=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +{ +vec4 computedPosition; +vec3 positionMC = attributes.positionMC; +v_positionMC = positionMC; +v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; +#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) +vec3 position2D = attributes.position2D; +vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; +computedPosition = czm_projection * vec4(positionEC, 1.0); +#else +computedPosition = czm_projection * vec4(v_positionEC, 1.0); +#endif +#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) +v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; +#endif +#ifdef HAS_NORMALS +v_normalEC = normalize(normal * attributes.normalMC); +#endif +#ifdef HAS_TANGENTS +v_tangentEC = normalize(normal * attributes.tangentMC); +#endif +#ifdef HAS_BITANGENTS +v_bitangentEC = normalize(normal * attributes.bitangentMC); +#endif +setDynamicVaryings(attributes); +return computedPosition; +} +`;var MS=`vec2 computeSt(float featureId) +{ +float stepX = model_textureStep.x; +float centerX = model_textureStep.y; +#ifdef MULTILINE_BATCH_TEXTURE +float stepY = model_textureStep.z; +float centerY = model_textureStep.w; +float xId = mod(featureId, model_textureDimensions.x); +float yId = floor(featureId / model_textureDimensions.x); +return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +#else +return vec2(centerX + (featureId * stepX), 0.5); #endif -color.rgb = pow(color.rgb, vec3(gamma)); -color.rgb = czm_gammaCorrect(color.rgb); -out_FragColor = color; } -`;var vN=`precision highp float; -in vec3 v_textureCoordinates; -uniform float u_roughness; -uniform samplerCube u_radianceTexture; -uniform vec3 u_faceDirection; -float vdcRadicalInverse(int i) +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) { -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++) +int featureId = featureIds.SELECTED_FEATURE_ID; +if (featureId < model_featuresLength) { -if (i <= 0) +vec2 featureSt = computeSt(float(featureId)); +feature.id = featureId; +feature.st = featureSt; +feature.color = texture(model_batchTexture, featureSt); +} +else { -break; +feature.id = model_featuresLength + 1; +feature.st = vec2(0.0); +feature.color = vec4(1.0); } -r = mod(float(i), base); -value += r * invBi; -invBi *= invBase; -i = int(float(i) * invBase); +#ifdef HAS_NULL_FEATURE_ID +if (featureId == model_nullFeatureId) { +feature.id = featureId; +feature.st = vec2(0.0); +feature.color = vec4(1.0); } -return value; +#endif } -vec2 hammersley2D(int i, int N) +`;var dF={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};dF.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=ynt(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),Ant(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(MS),i.addFragmentLines(MS)};function Oye(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Mye(e){return e instanceof Cn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function ynt(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:Mye(r),featureIdDefine:Oye(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:Mye(r),featureIdDefine:Oye(r)})}function Ant(e){e.addStructField(dF.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(dF.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(dF.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var EA=dF;var ja={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)"};ja.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(ja.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(ja.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(EA.STRUCT_ID_SELECTED_FEATURE,EA.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(ja.FUNCTION_ID_INITIALIZE_ATTRIBUTES,ja.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(ja.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(ja.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(ja.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,ja.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(ja.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,ja.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Wo.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;bnt(e,f,g,d,o,s,m)}Pnt(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(fF),i.addFragmentLines(uF)};function bnt(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Ent(e,t,n,i):Tnt(e,t,n,u),vnt(a,c,u),Cnt(a,c,s),l(t.semantic)&&xnt(a,t),Snt(a,c,r),wnt(a,c,u),Int(a,c)}function xnt(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 Tnt(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 Ent(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 Cnt(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 vnt(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 Snt(e,t,n){let i=ja.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=ja.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 wnt(e,t,n){let i=ja.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 Int(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=ja.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=ja.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Pnt(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(ja.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(ja.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var hF=ja;var GJ=new he,WJ=new he,Nye=new h,Lye=new h,qJ=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 yi(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,Nye),this._projection.unproject(Nye,GJ),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Lye),this._projection.unproject(Lye,WJ),this._rectangle=new ie(GJ.longitude,GJ.latitude,WJ.longitude,WJ.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)}},Lo=qJ;var YJ,Fye="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",NS={};NS.defaultAccessToken=Fye;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===Fye){if(!l(YJ)){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>';YJ=new It(t,!0)}return YJ}};var Bf=NS;function XJ(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)}XJ.prototype.isReady=function(){return this._isReady};XJ.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 mF=XJ;function KJ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}KJ.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])};KJ.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 pm=KJ;function LS(){pe.throwInstantiationError()}Object.defineProperties(LS.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}});LS.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};LS.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};LS.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Dnt=/\.ktx2$/i;LS.loadImage=function(e,t){let n=De.createIfNeeded(t);return Dnt.test(n.url)?Ou(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var kf=LS;var Bye={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Bye);var gm=Bye;function kye(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new er({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}kye.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 mF({missingImageUrl:Uye(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 Rnt(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 Lo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new er({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 yi,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 Ont(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 Mnt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Rnt(i,t)}catch(i){Ont(e,i)}}function Xp(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 er({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}Xp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case gm.SATELLITE:{n=t.token??Bf.defaultAccessToken,i=De.createIfNeeded(Bf.defaultWorldImageryServer),i.appendForwardSlash();let o=Bf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case gm.OCEANS:{n=t.token??Bf.defaultAccessToken,i=De.createIfNeeded(Bf.defaultWorldOceanServer),i.appendForwardSlash();let o=Bf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case gm.HILLSHADE:{n=t.token??Bf.defaultAccessToken,i=De.createIfNeeded(Bf.defaultWorldHillshadeServer),i.appendForwardSlash();let o=Bf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Xp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function Uye(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(Xp.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}}});Xp.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 Xp(t);i._resource=n;let r=new kye(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Mnt(n,r),r.build(i),i};Xp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Xp.prototype.requestImage=function(e,t,n,i){return kf.loadImage(this,Uye(this,e,t,n,i))};Xp.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 pm;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 yi;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};Xp._metadataCache={};var $g=Xp;function Nnt(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 Kp=Nnt;function yH(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}yH.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 yH(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}": ${Kp(i)}`),c};yH.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zr=yH;var zye={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(zye);var FS=zye;function pF(e){}pF.prototype.isReady=function(){return!0};pF.prototype.shouldDiscardImage=function(e){return pF.EMPTY_IMAGE===e};var AH;Object.defineProperties(pF,{EMPTY_IMAGE:{get:function(){return l(AH)||(AH=new Image,AH.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),AH}}});var BS=pF;function Vye(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}Vye.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 Lnt(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 Fnt(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 Bnt(e,t,n){let i=e.url,r=xa._metadataCache[i];l(r)||(r=e.fetchJson(),xa._metadataCache[i]=r);try{let o=await r;return Lnt(o,t)}catch(o){Fnt(e,o,n)}}function xa(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??FS.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new BS),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${xa.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Lo({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(xa.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)}}});xa.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??FS.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 xa(t);a._resource=r;let c=new Vye(t);return await Bnt(s,c),c.build(a),a};var knt=new ie;xa.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,knt);return Vnt(this._attributionList,n,i)};xa.prototype.requestImage=function(e,t,n,i){let r=kf.loadImage(this,Unt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?BS.EMPTY_IMAGE:Promise.reject(o)})};xa.prototype.pickFeatures=function(e,t,n,i,r){};xa.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};xa.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}};xa._logoUrl=void 0;Object.defineProperties(xa,{logoUrl:{get:function(){return l(xa._logoUrl)||(xa._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),xa._logoUrl},set:function(e){xa._logoUrl=e}}});function Unt(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:xa.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var znt=new ie;function Vnt(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,znt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}xa._metadataCache={};var gF=xa;var jye=/{[^}]+}/g,Hye={x:Wnt,y:Ynt,z:$nt,s:Jnt,reverseX:qnt,reverseY:Xnt,reverseZ:Knt,westDegrees:Znt,southDegrees:Qnt,eastDegrees:eit,northDegrees:tit,westProjected:nit,southProjected:iit,eastProjected:rit,northProjected:oit,width:sit,height:ait},jnt=Ot(Hye,{i:cit,j:lit,reverseI:uit,reverseJ:fit,longitudeDegrees:hit,latitudeDegrees:mit,longitudeProjected:pit,latitudeProjected:git,format:yit});function _F(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 Lo({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(Hye,o),a=Ot(jnt,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(_F.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}}});_F.prototype.getTileCredits=function(e,t,n){};_F.prototype.requestImage=function(e,t,n,i){return kf.loadImage(this,Hnt(this,e,t,n,i))};_F.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=Gnt(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 bH=!1,Uf=new ie,xH=!1,yF=new ie;function Hnt(e,t,n,i,r){bH=!1,xH=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(jye);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 $J=!1,US=new U,JJ=!1;function Gnt(e,t,n,i,r,o,s){bH=!1,xH=!1,$J=!1,JJ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(jye);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 zS(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 Wnt(e,t,n,i){return zS(e,"{x}",t)}function qnt(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return zS(e,"{reverseX}",r)}function Ynt(e,t,n,i){return zS(e,"{y}",n)}function Xnt(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return zS(e,"{reverseY}",r)}function Knt(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return zS(e,"{reverseZ}",o)}function $nt(e,t,n,i){return zS(e,"{z}",i)}function Jnt(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function TH(e,t,n,i){bH||(e.tilingScheme.tileXYToRectangle(t,n,i,Uf),Uf.west=D.toDegrees(Uf.west),Uf.south=D.toDegrees(Uf.south),Uf.east=D.toDegrees(Uf.east),Uf.north=D.toDegrees(Uf.north),bH=!0)}function Znt(e,t,n,i){return TH(e,t,n,i),Uf.west}function Qnt(e,t,n,i){return TH(e,t,n,i),Uf.south}function eit(e,t,n,i){return TH(e,t,n,i),Uf.east}function tit(e,t,n,i){return TH(e,t,n,i),Uf.north}function EH(e,t,n,i){xH||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,yF),xH=!0)}function nit(e,t,n,i){return EH(e,t,n,i),yF.west}function iit(e,t,n,i){return EH(e,t,n,i),yF.south}function rit(e,t,n,i){return EH(e,t,n,i),yF.east}function oit(e,t,n,i){return EH(e,t,n,i),yF.north}function sit(e,t,n,i){return e.tileWidth}function ait(e,t,n,i){return e.tileHeight}function cit(e,t,n,i,r,o,s){return CH(e,t,n,i,r,o),US.x}function lit(e,t,n,i,r,o,s){return CH(e,t,n,i,r,o),US.y}function uit(e,t,n,i,r,o,s){return CH(e,t,n,i,r,o),e.tileWidth-US.x-1}function fit(e,t,n,i,r,o,s){return CH(e,t,n,i,r,o),e.tileHeight-US.y-1}var dit=new ie,kS=new h;function CH(e,t,n,i,r,o,s){if($J)return;ZJ(e,t,n,i,r,o);let a=kS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,dit);US.x=e.tileWidth*(a.x-c.west)/c.width|0,US.y=e.tileHeight*(c.north-a.y)/c.height|0,$J=!0}function hit(e,t,n,i,r,o,s){return D.toDegrees(r)}function mit(e,t,n,i,r,o,s){return D.toDegrees(o)}function pit(e,t,n,i,r,o,s){return ZJ(e,t,n,i,r,o),kS.x}function git(e,t,n,i,r,o,s){return ZJ(e,t,n,i,r,o),kS.y}var _it=new he;function ZJ(e,t,n,i,r,o,s){if(!JJ){if(e.tilingScheme.projection instanceof Ui)kS.x=D.toDegrees(r),kS.y=D.toDegrees(o);else{let a=_it;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,kS)}JJ=!0}}function yit(e,t,n,i,r,o,s){return s}var vs=_F;function Wd(e){vs.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 wp)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(vs.prototype),Wd.prototype.constructor=Wd);function Gye(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 Wye(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 er({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Lo({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 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=Gye(S,v),x=Wye(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 Lo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Gye(a,s);let c=Wye(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 CA=Wd;function qye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}qye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Ait(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 er({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 Lo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function bit(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 xit(e,t,n){try{let i=await e.fetchText();Ait(i,t)}catch(i){bit(i,e,n)}}function qu(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="${qu.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(qu.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}}});qu.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 qye(n);s.channel=t,await xit(o,s);let a=new qu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};qu.prototype.getTileCredits=function(e,t,n){};qu.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 kf.loadImage(this,r)};qu.prototype.pickFeatures=function(e,t,n,i,r){};qu._logoUrl=void 0;Object.defineProperties(qu,{logoUrl:{get:function(){return l(qu._logoUrl)||(qu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),qu._logoUrl},set:function(e){qu._logoUrl=e}}});var AF=qu;var Tit=/\/$/,Yye=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 VS(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();Tit.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=Yye,this._resource=i,this._imageryProvider=new vs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(VS.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}}});VS.prototype.getTileCredits=function(e,t,n){};VS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};VS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};VS._defaultCredit=Yye;var bF=VS;function pT(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 er({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(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 Eit(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 QJ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function QJ(e,t,n){try{return await kf.loadImage(null,e)}catch(i){return Eit(e,i,t,n)}}pT.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await QJ(n);t=t??H.EMPTY_OBJECT;let r=new pT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};pT.prototype.getTileCredits=function(e,t,n){};pT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await QJ(this._resource,this);return this._image=r,Zr.reportSuccess(this._errorEvent),r}return this._image};pT.prototype.pickFeatures=function(e,t,n,i,r){};var xF=pT;function Cit(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=vit:e==="xml"?n=Pit:(e==="html"||e==="text")&&(n=Xye)),this.callback=n}function vit(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new pm;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 eZ="http://www.mapinfo.com/mxp",Sit="http://www.esri.com/wms",wit="http://www.opengis.net/wfs",Iit="http://www.opengis.net/gml";function Pit(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===eZ)return Dit(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Sit)return Rit(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===wit)return Oit(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Mit(e):Nit(e)}function Dit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(eZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(eZ,"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 pm;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Rit(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(vH(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(vH(a,i))}}return n}function Oit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Iit,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};tZ(o,s),t.push(vH(o,s))}return t}function Mit(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={};tZ(s,a),t.push(vH(s,a))}}return t}function tZ(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()&&tZ(r,t)&&(t[r.localName]=r.textContent)}return n}function vH(e,t){let n=new pm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Nit(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new pm;return r.data=e,r.description=n.innerHTML,[r]}var Lit=/<body>\s*<\/body>/im,Fit=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Bit=/<title>([\s\S]*)<\/title>/im;function Xye(e){if(Lit.test(e)||Fit.test(e))return;let t,n=Bit.exec(e);n&&n.length>1&&(t=n[1]);let i=new pm;return i.name=t,i.description=e,i.data=e,[i]}var _m=Cit;function TF(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(TF.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)}}});TF.prototype.getFromCache=function(e,t,n,i){let r=Kye(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};TF.prototype.checkApproachingInterval=function(e,t,n,i){let r=Kye(e,t,n),o=this._tilesRequestedForInterval,s=$ye(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!Jye(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};TF.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=$ye(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Jye(this,c,o),a||s.push(c)}}};function Kye(e,t,n){return`${e}-${t}-${n}`}function kit(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function $ye(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 Jye(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=kit(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 gT=TF;var Uit=[3034,3035,3042,3043,3044],zit=[4471,4559];function ym(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(ym.DefaultParameters,!0),n.setQueryParameters(ym.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Zye(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Zye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new gT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Qye(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 yi?"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&&!zit.includes(a)||Uit.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof yi?"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 vs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new er({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??ym.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Qye(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 Vit(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(ym.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}}});ym.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};ym.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=Qye(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};ym.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Vit(this,e,t,n,i,r,s)};ym.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});ym.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});ym.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new _m("json","application/json")),Object.freeze(new _m("xml","text/xml")),Object.freeze(new _m("text","text/html"))]);function Zye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var EF=ym;function zf(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(zf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(zf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(zf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(eAe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(zf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(eAe(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 gT({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return tAe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new vs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Lo({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??zf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Hit(this)})}function tAe(e,t,n,i,r,o){let s=e._tileProvider;return nAe(e,s._resource,o),s.requestImage(t,n,i,r)}function jit(e,t,n,i,r,o,s){let a=e._tileProvider;return nAe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(zf.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}}});zf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};zf.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=tAe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};zf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return jit(this,e,t,n,i,r,s)};zf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});zf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});zf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new _m("json","application/json")),Object.freeze(new _m("xml","text/xml")),Object.freeze(new _m("text","text/html"))]);function nAe(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 Hit(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 eAe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var CF=zf;var jS={};jS.defaultApiKey=void 0;jS.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});jS.defaultStreetViewStaticApiKey=void 0;jS.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});jS.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ta=jS;var iAe=/\/$/;function Jg(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??Ta.mapTilesApiEndpoint),n=t.getUrlComponent();iAe.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 vs({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(Jg.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}}});Jg.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=rAe(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},nZ(s,o,i)};Jg.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??Ta.mapTilesApiEndpoint,e.key=e.key??Ta.defaultApiKey;let t=e.overlayLayerType,n=await Wit(e);return new Jg({...n,...e,credit:e.credit??Ta.getDefaultCredit()})};Jg.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};Jg.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])};Jg.prototype.pickFeatures=function(e,t,n,i,r){};Jg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Git(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 Git(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 rAe(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 Wit(e){let{language:t,region:n,key:i,url:r}=e,o=rAe(e),s=r.url??r;iAe.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 vF=Jg;var qit=/\/$/;function HS(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();qit.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 vs({...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(HS.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}}});HS.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};HS.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])};HS.prototype.pickFeatures=function(e,t,n,i,r){};HS.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Yit(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 Yit(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 SF=HS;var Xit=async(e,t,n)=>CA.fromUrl(new Ho(t,n)),Kit=async(e,{options:t})=>$g.fromUrl(e,t),$it=async(e,{options:t})=>gF.fromUrl(e,t),Jit=async(e,{options:t})=>{let n=t.channel;return delete t.channel,AF.fromUrl(e,n,t)},Zit=async(e,{options:t})=>new bF({url:e,...t}),Qit=async(e,{options:t})=>xF.fromUrl(e,t),ert=async(e,{options:t})=>CA.fromUrl(e,t),trt=async(e,{options:t})=>new vs({url:e,...t}),nrt=async(e,{options:t})=>new EF({url:e,...t}),irt=async(e,{options:t})=>new CF({url:e,...t}),nZ=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 vF({...t.options,url:i})},rrt=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 SF({...t.options,url:i})},ort={ARCGIS_MAPSERVER:Kit,BING:$it,GOOGLE_EARTH:Jit,MAPBOX:Zit,SINGLE_TILE:Qit,TMS:ert,URL_TEMPLATE:trt,WMS:nrt,WMTS:irt,GOOGLE_2D_MAPS:nZ,AZURE_MAPS:rrt,defaultFactoryCallback:Xit},GS=Object.freeze(ort);function $p(){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($p.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(){}}});$p.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Ho._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=$p._endpointCache[i];l(r)||(r=n.fetchJson(),$p._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=GS.defaultFactoryCallback;o=Je(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=GS[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new $p(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Ho.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};$p.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};$p.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};$p.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};$p._endpointCache={};var iu=$p;var oAe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(oAe);var Zg=oAe;function srt(e){e=e??H.EMPTY_OBJECT;let t=e.style??Zg.AERIAL;return iu.fromAssetId(t)}var Qg=srt;function Ws(){pe.throwInstantiationError()}Object.defineProperties(Ws.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 sAe=[];Ws.getRegularGridIndices=function(e,t){let n=sAe[e];l(n)||(sAe[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),uAe(e,t,i,0)),i};var aAe=[];Ws.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=aAe[e];l(n)||(aAe[e]=n=[]);let i=n[t];if(!l(i)){let r=Ws.getRegularGridIndices(e,t),o=lAe(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 cAe=[];Ws.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=cAe[e];l(n)||(cAe[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=lAe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);uAe(e,t,y,0),Ws.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};Ws.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ws.getSkirtIndexCount=function(e){return(e-4)*2*3};Ws.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ws.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=SH(e,a,o,s),a+=e.length,s=SH(t,a,o,s),a+=t.length,s=SH(n,a,o,s),a+=n.length,SH(i,a,o,s)};Ws.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Ws.addSkirtIndices(e,t,n,i,r,o,s);let a=Ws.getSkirtVertexCount(e,t,n,i),c=Ws.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 lAe(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 uAe(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 SH(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}Ws.heightmapTerrainQuality=.25;Ws.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ws.heightmapTerrainQuality/(t*n)};Ws.prototype.requestTileGeometry=pe.throwInstantiationError;Ws.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Ws.prototype.getTileDataAvailable=pe.throwInstantiationError;Ws.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Ws;var wF=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() { -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +out_FragColor = texture(u_texture, v_textureCoordinates); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +`;var IF=`in vec4 position; +in float webMercatorT; +uniform vec2 u_textureDimensions; +out vec2 v_textureCoordinates; +void main() { -float alphaRoughnessSquared = alphaRoughness * alphaRoughness; -float phi = czm_twoPi * xi.x; -float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); -vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); -vec3 tangentX = normalize(cross(upVector, N)); -vec3 tangentY = cross(N, tangentX); -return tangentX * H.x + tangentY * H.y + N * H.z; +v_textureCoordinates = vec2(position.x, webMercatorT); +gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); } -const int samples = 128; -void main() { -vec3 normal = u_faceDirection; -vec3 V = normalize(v_textureCoordinates); -float roughness = u_roughness; -vec4 color = vec4(0.0); -float weight = 0.0; -for (int i = 0; i < samples; ++i) { -vec2 xi = hammersley2D(i, samples); -vec3 H = importanceSampleGGX(xi, roughness, V); -vec3 L = 2.0 * dot(V, H) * H - V; -float NdotL = max(dot(V, L), 0.0); -if (NdotL > 0.0) { -color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; -weight += NdotL; +`;var fAe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(fAe);var Vn=fAe;function WS(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}WS.createPlaceholder=function(e){let t=new WS(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};WS.prototype.addReference=function(){++this.referenceCount};WS.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(),le(this),0):this.referenceCount};WS.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 qS=WS;function iZ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}iZ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};iZ.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 YS=iZ;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 YS(qS.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=Vo.NONE;Gi.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Gi.DEFAULT_MAGNIFICATION_FILTER=Zn.LINEAR;Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Gi.fromProviderAsync=function(e,t){let n=new Gi(void 0,t);return frt(n,Promise.resolve(e)),n};Gi.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Gi.fromProviderAsync(Qg({style:e.style}),e)};Gi.prototype.isBaseLayer=function(){return this._isBaseLayer};Gi.prototype.isDestroyed=function(){return!1};Gi.prototype.destroy=function(){return le(this)};var mAe=new ie,dAe=new ie,rZ=new ie,pAe=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 yi&&e.rectangle.north<yi.MaximumLatitude&&e.rectangle.south>-yi.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,mAe),a=ie.intersection(e.rectangle,s,dAe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,P=e.rectangle;a=dAe,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=lrt(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,pAe),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,rZ),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,rZ),!!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,rZ),!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 YS(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,mAe),i=c.rectangleToNativeRectangle(i,pAe)}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,Zr.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=Zr.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 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?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 yi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function hAe(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===Zn.LINEAR&&!Ke.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=Ut.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=hAe(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(Pd.NICEST),t.sampler=u}else{let o=hAe(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}};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 Nf({persists:!0,owner:this,preExecute:function(c){crt(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=gAe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new qS(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Gi.prototype.removeImageryFromCache=function(e){let t=gAe(e.x,e.y,e.level);delete this._imageryCache[t]};function gAe(e,t,n){return JSON.stringify([e,t,n])}var wH={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},art=dn.supportsTypedArrays()?new Float32Array(128):void 0;function crt(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=Xr.getRegularGridIndices(2,64),E=nt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new zn({context:t,attributes:[{index:x.position,vertexBuffer:nt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:nt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Ye({sources:[IF]});r.shaderProgram=en.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:wF,attributeLocations:x}),r.sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;wH.textureDimensions.x=o,wH.textureDimensions.y=s,wH.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=art,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=wH,e.vertexArray=r.vertexArray}function lrt(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 urt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function frt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){urt(e._errorEvent,i)}}var Ss=Gi;var oZ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},PF=oZ;var sZ=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}},XS=sZ;var drt=new ie,_Ae=new ie,hrt=new ie,mrt=new ie,prt=new ie,grt=new ie,aZ=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,drt),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=mrt;a.rectangleToNativeRectangle(t,u);let f=prt;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,hrt);if(!l(b))return;let x=grt;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 XS;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,_Ae);return l(i)?i:e._clampRectangle(t,n,_Ae)}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 XS);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}},KS=aZ;var cZ=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=ba.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}}},_T=cZ;var lZ=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}},DF=lZ;var uZ=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=nt.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=_T.createCartographicPositions(r,s,d),g=_T.computeCartographicBoundingRectangle(p),m=new DF(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=_T.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 KS.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 KS._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(),le(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}},yT=uZ;var fZ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},RF=fZ;var _rt=!1,yrt=new ie,Art=new ie,dZ=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=yT._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 PF;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ss.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ss.DEFAULT_CONTRAST,n.hue|=r.hue!==Ss.DEFAULT_HUE,n.saturation|=r.saturation!==Ss.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ss.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));"]),_rt&&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 RF(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,yrt),s=r.rectangleToNativeRectangle(i,Art);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}},OF=dZ;var MF=`#ifdef USE_IBL_LIGHTING +vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 viewDirection = -normalize(position); +vec3 iblColor = textureIBL(viewDirection, normal, material); +return iblColor; +#endif +return vec3(0.0); } +#endif +#ifdef USE_CLEARCOAT +vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ +vec3 viewDirection = -normalize(position); +vec3 halfwayDirection = normalize(viewDirection + lightDirection); +vec3 normal = material.clearcoatNormal; +float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); +vec3 f0 = vec3(0.04); +vec3 f90 = vec3(1.0); +float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); +vec3 F = fresnelSchlick2(f0, f90, NdotV); +float roughness = material.clearcoatRoughness; +float alphaRoughness = roughness * roughness; +float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); +vec3 directReflection = F * directStrength * NdotL; +vec3 color = lightColorHdr * directReflection; +#ifdef SPECULAR_IBL +vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); +vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); +color += iblColor * material.occlusion; +#endif +float clearcoatFactor = material.clearcoatFactor; +vec3 clearcoatColor = color * clearcoatFactor; +return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; } -out_FragColor = color / weight; +#endif +#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) +vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +{ +#ifdef USE_CUSTOM_LIGHT_COLOR +vec3 lightColorHdr = model_lightColorHdr; +#else +vec3 lightColorHdr = czm_lightColorHdr; +#endif +vec3 viewDirection = -normalize(position); +vec3 normal = material.normalEC; +vec3 lightDirection = normalize(czm_lightDirectionEC); +vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); +vec3 directColor = lightColorHdr * directLighting; +vec3 color = directColor + material.emissive; +#ifdef USE_IBL_LIGHTING +color += computeIBL(position, normal, lightDirection, lightColorHdr, material); +#endif +#ifdef USE_CLEARCOAT +color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); +#endif +return color; } -`;var SN=`in vec3 position; -out vec3 v_textureCoordinates; -uniform vec3 u_faceDirection; -vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { -vec2 scaledUV = uv; -if (faceDir.x != 0.0) { -return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); -} else if (faceDir.y != 0.0) { -return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); -} else { -return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); +#endif +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ +#ifdef LIGHTING_PBR +#ifdef HAS_NORMALS +vec3 color = computePbrLighting(material, attributes.positionEC); +#else +vec3 color = material.diffuse * material.occlusion + material.emissive; +#endif +#ifndef HDR +color = czm_pbrNeutralTonemapping(color); +#endif +#else // unlit +vec3 color = material.diffuse; +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +color = czm_gammaCorrect(color); +#elif !defined(HDR) +color = czm_linearToSrgb(color); +#endif +material.diffuse = color; +} +`;var yAe={UNLIT:0,PBR:1};Object.freeze(yAe);var Jp=yAe;var AAe={name:"LightingPipelineStage"};AAe.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===Jp.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(MF)};var NF=AAe;var LF=`bool isDefaultStyleColor(vec3 color) +{ +return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +{ +vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); +vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; +return color; +} +#ifdef HAS_NORMAL_TEXTURE +vec2 getNormalTexCoords() +{ +vec2 texCoord = TEXCOORD_NORMAL; +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); +#endif +return texCoord; } +#endif +#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) +vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +{ +vec2 tex_dx = dFdx(normalTexCoords); +vec2 tex_dy = dFdy(normalTexCoords); +float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; +vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); +return tangent / determinant; +} +#endif +#ifdef USE_ANISOTROPY +struct NormalInfo { +vec3 tangent; +vec3 bitangent; +vec3 normal; +vec3 geometryNormal; +}; +NormalInfo getNormalInfo(ProcessedAttributes attributes) +{ +vec3 geometryNormal = attributes.normalEC; +#ifdef HAS_NORMAL_TEXTURE +vec2 normalTexCoords = getNormalTexCoords(); +#endif +#ifdef HAS_BITANGENTS +vec3 tangent = attributes.tangentEC; +vec3 bitangent = attributes.bitangentEC; +#else // Assume HAS_NORMAL_TEXTURE +vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); +tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); +vec3 bitangent = normalize(cross(geometryNormal, tangent)); +#endif +#ifdef HAS_NORMAL_TEXTURE +mat3 tbn = mat3(tangent, bitangent, geometryNormal); +vec3 normalSample; +#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; +#endif +vec3 normal = normalize(tbn * normalSample); +#else +vec3 normal = geometryNormal; +#endif +#ifdef HAS_DOUBLE_SIDED_MATERIAL +if (czm_backFacing()) { +tangent *= -1.0; +bitangent *= -1.0; +normal *= -1.0; +geometryNormal *= -1.0; +} +#endif +NormalInfo normalInfo; +normalInfo.tangent = tangent; +normalInfo.bitangent = bitangent; +normalInfo.normal = normal; +normalInfo.geometryNormal = geometryNormal; +return normalInfo; } -void main() +#endif +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) { -v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); -v_textureCoordinates.y = -v_textureCoordinates.y; -v_textureCoordinates.z = -v_textureCoordinates.z; -gl_Position = vec4(position, 1.0); +vec2 normalTexCoords = getNormalTexCoords(); +#ifdef HAS_BITANGENTS +vec3 t = attributes.tangentEC; +vec3 b = attributes.bitangentEC; +#else +vec3 t = computeTangent(attributes.positionEC, normalTexCoords); +t = normalize(t - geometryNormal * dot(geometryNormal, t)); +vec3 b = normalize(cross(geometryNormal, t)); +#endif +mat3 tbn = mat3(t, b, geometryNormal); +vec3 normalSample; +#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; +#endif +return normalize(tbn * normalSample); } -`;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 HJe=new h,GJe=new h;function WJe(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,GJe),s=1.025,a=HJe,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 D_e=new h,qJe=new N,YJe=new se,XJe=new z;function KJe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new rs({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:[am,CN]}),e._radianceMapFS=r),fx.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,qJe),u=YJe;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 rs.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:()=>rs.getDirection(d,D_e),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,XJe)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ci._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new gs({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 $Je(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 rs.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=rs.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:SN,fragmentShaderSource:vN,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:()=>rs.getDirection(g,D_e)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ci._queueCommand(b,t),++d}o/=2,s/=2}u()}var R_e=new U(3,3);function JJe(e,t){let n=t.context,i=R_e,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:[EN]}),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 ZJe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new gs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=R_e,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=WJe(this,e)||i===cg.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&&(KJe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&($Je(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(JJe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){ZJe(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(),le(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 Lg=Ci;var bS={HIGHLIGHT:0,REPLACE:1,MIX:2};bS.getColorBlend=function(e,t){if(e===bS.HIGHLIGHT)return 0;if(e===bS.REPLACE)return 1;if(e===bS.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(bS);var dl=bS;var O_e={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(O_e);var Wd=O_e;var M_e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(M_e);var hl=M_e;var N_e={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(N_e);var cm=N_e;var L_e={};function wN(e){this._count=e.count,this._properties=Je(e.properties,!0)}wN.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,L_e)};wN.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,L_e,e)};wN.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Je(n[e],!0)};wN.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 Fg=wN;function Fc(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(Fc.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}}});Fc.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))};Fc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Fc.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))};Fc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var YJ=[];Fc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(YJ);Qn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,YJ);Qn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(YJ);Qn(t,n)}return t};Fc.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};Fc.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 Fg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Fc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Fc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Fc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Fc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Fc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Fc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Fc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Fc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var Zl=Fc;function F_e(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=ju.createModelTextureReader({textureInfo:o,channels:QJe(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(F_e.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 QJe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var IN=F_e;function XJ(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 IN({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(XJ.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}}});XJ.prototype.getProperty=function(e){return this._properties[e]};var Bg=XJ;function B_e(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(B_e.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 PN=B_e;function KJ(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 PN({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(KJ.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}}});KJ.prototype.getProperty=function(e){return this._properties[e]};var $x=KJ;function xS(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(xS.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}}});xS.prototype.getPropertyTable=function(e){return this._propertyTables[e]};xS.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};xS.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};xS.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var Ha=xS;function eZe(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=tZe(a,e.bufferViews,c,e.context),f=new Bd({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Zl({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 Bg({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 $x({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 DN=4;function tZe(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=nZe(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=rZe(s,o),u=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:$n.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 nZe(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(DN))continue;let c=e[s],u=l(c)?t[c.values]:iZe(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 iZe(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 rZe(e,t){let n=e.length,i=new Uint8Array(n*t*DN),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*DN,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){sZe(s,r,c);continue}oZe(s,i,c)}return i}function oZe(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*DN;t.set(i.subarray(a,a+r),c)}}function sZe(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*DN,A=f.get(m);d.set(y,p(A))}}var RN=eZe;function aZe(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 Bd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Zl({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 Bg({id:a,propertyTexture:cZe(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 cZe(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:lZe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function lZe(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 ON=aZe;var $J=class extends er{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=uZe(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=RN({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=ON({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),k_e(this),this._state=Tt.READY,!0}unload(){k_e(this),TZe(this),l(this._schemaLoader)&&Fi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function uZe(e){try{let t=pZe(e),n=bZe(e),i=xZe(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 fZe(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 dZe(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 hZe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];fZe(r.properties,n)}return n}function mZe(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)&&dZe(o,n)}}return n}async function pZe(e){let t;l(e._extension)?t=hZe(e._extension):t=mZe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Fi.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 gZe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&_Ze(o,t)}return t}function _Ze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function yZe(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)&&AZe(o,t)}}return t}function AZe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function bZe(e){let t;l(e._extension)?t=gZe(e._extension):t=yZe(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=Fi.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 xZe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Fi.getSchemaLoader({resource:i})}else n=Fi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function k_e(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Fi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function TZe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Fi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var MN=$J;var Jx={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};Jx.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return Jx.TRANSLATION;case"ROTATION":return Jx.ROTATION;case"SCALE":return Jx.SCALE;case"_FEATURE_ID":return Jx.FEATURE_ID}};Object.freeze(Jx);var Lo=Jx;var EZe=65534,CZe=255;function EH(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 V_e(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],vZe(this)}Object.defineProperties(EH.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function vZe(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=U_e(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>EZe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>CZe&&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=U_e(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function U_e(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=JJ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=JJ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=JJ(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=ZJ(f),_=ZJ(m),C=ZJ(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 JJ(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 ZJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}EH.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};EH.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=z_e(i),o=[];for(;i>1;)i>>=1,o.push(z_e(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:$n.LINEAR})});return t.outlineTexture=s,s};function z_e(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 V_e(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)}}V_e.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 Zx=EH;function j_e(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function SZe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function CH(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}CH.prototype.postProcess=function(e){this.needsOutlines&&(wZe(this),DZe(this,e)),this.needsGaussianSplats&&PZe(this,e)};function wZe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new Zx({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=IZe(r.outlineCoordinates),s=new j_e(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 IZe(e){let t=new Tn.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 PZe(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 DZe(e,t){RZe(e.attributePlans,t),l(e.indicesPlan)&&OZe(e.indicesPlan,t)}function RZe(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 OZe(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)}CH.AttributeLoadPlan=j_e;CH.IndicesLoadPlan=SZe;var Qx=CH;function MZe(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var NN=MZe;function H_e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(H_e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var LN=H_e;function G_e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(G_e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var FN=G_e;function W_e(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(W_e.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var BN=W_e;var q_e={Direct:"Direct",Indirect:"Indirect"};Object.freeze(q_e);var mA=q_e;function Y_e(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Y_e.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 TS=Y_e;function X_e(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(X_e.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 kN=X_e;function ES(){}function K_e(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function NZe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new LN({position:t,adjustmentParams:n})}function LZe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=K_e(e.covarianceMatrix);return new FN({position:t,adjustmentParams:n,covarianceMatrix:i})}function FZe(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new kN({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new BN({groupFlags:t,rotationThetas:n,params:i})}ES.load=function(e){let t=e.storageType;if(t===mA.Direct)return ES.loadDirect(e);if(t===mA.Indirect)return ES.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};ES.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=NZe(o);t.push(s)}let i=K_e(e.covarianceDirectUpperTriangle);return new TS({storageType:mA.Direct,anchorPointsDirect:t,covarianceDirect:i})};ES.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=LZe(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=FZe(s);r.push(a)}return new TS({storageType:mA.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var UN=ES;function $_e(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($_e.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 zN=$_e;function J_e(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(J_e.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var VN=J_e;function Z_e(e){this._ppeTextures=e}Object.defineProperties(Z_e.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var jN=Z_e;function os(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)&&(os.prototype=Object.create(er.prototype),os.prototype.constructor=os);Object.defineProperties(os.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});os.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)}};os.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=this._loadResources(this),this._promise)};function BZe(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}os.prototype._loadTextures=function(){let e;l(this._extension)&&(e=BZe(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=Fi.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)};os.ppeTexturesMetadataSchemaCache=new Map;os._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}}}};os._obtainPpeTexturesMetadataSchema=function(e){let n=os._collectPpeTexturePropertyIdentifiers(e).toString(),i=os.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${os.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=os._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=Kl.fromJson(o),os.ppeTexturesMetadataSchemaCache.set(n,i),i};os._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=os._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};os._convertToStructuralMetadata=function(e,t){let n=[],i=os._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 Bg({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new Ha({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};os.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 VN({min:d.min,max:d.max,source:d.source}),g=new zN({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new jN(o);this._meshPrimitiveGpmLocal=a;let c=os._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Tt.READY,!0};os.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Fi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};os.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var HN=os;function kZe(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Qn(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 GN=kZe;var{Attribute:UZe,Indices:zZe,FeatureIdAttribute:eye,FeatureIdTexture:tye,FeatureIdImplicitRange:nye,MorphTarget:VZe,Primitive:jZe,Instances:HZe,Skin:GZe,Node:WZe,AnimatedPropertyType:qZe,AnimationSampler:YZe,AnimationTarget:XZe,AnimationChannel:KZe,Animation:$Ze,ArticulationStage:JZe,Articulation:ZZe,Asset:QZe,Scene:eQe,Components:tQe,MetallicRoughness:nQe,SpecularGlossiness:iQe,Specular:rQe,Anisotropy:QJ,Clearcoat:eZ,PlanarFill:oQe,LineStyle:sQe,Material:aQe,Vector:cQe,Polygon:lQe}=Tn,oo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},tZ=class extends er{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=Vi.Y,forwardAxis:c=Vi.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=oo.NOT_LOADED,this._textureState=oo.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=uQe(this),this._promise)}_process(t){return this._state===oo.READY?!0:(this._state===oo.PROCESSING&&dQe(this,t),this._resourcesLoaded&&this._state===oo.POST_PROCESSING&&(hQe(this,t.context),this._state=oo.PROCESSED),this._resourcesLoaded&&this._state===oo.PROCESSED?(Q_e(this),this._typedArray=void 0,this._state=oo.READY,!0):!1)}_processTextures(t){if(this._textureState===oo.READY)return!0;if(this._textureState!==oo.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=oo.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===oo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=fQe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=oo.FAILED;let o=this._processError;this._processError=void 0,vH(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===oo.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=oo.FAILED,vH(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=oo.FAILED,vH(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===oo.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Fi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,wet(this),Q_e(this),Iet(this),Pet(this),Det(this),Ret(this),this._components=void 0,this._typedArray=void 0,this._state=oo.UNLOADED}};async function uQe(e){e._state=oo.LOADING,e._textureState=oo.LOADING;try{let t=Fi.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=oo.LOADED,e._textureState=oo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=oo.FAILED,e._textureState=oo.FAILED,vH(e,t)}}async function fQe(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new NN({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=vet(e,t);return e._state=oo.PROCESSING,e._textureState=oo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Fi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function vH(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function dQe(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=oo.POST_PROCESSING)}function hQe(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)&&mQe(e,r)}}function mQe(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 pQe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Fi.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 gQe(e,t,n,i,r,o,s){return Fi.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 iye(e,t){let n=Fi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function nZ(e,t,n){let i=t.byteOffset,r=Vu(e,t),o=t.count,s=Ff(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=Mg(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 _Qe(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 yQe(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 AQe(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=nZ(o,n,t.typedArray);i=i??!1,yQe(n,s,r,i)}function WN(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=iye(e,r),s=AQe(e,o,t,n,i);return e._loaderPromises.push(s),i}return _Qe(t,i)}function lm(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=iye(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=nZ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Gu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function bQe(e){return e===Number?0:new e}function xQe(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 TQe={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function EQe(e,t){let n=xQe(e.componentDatatype),i=TQe[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 CQe(e,t,n){let i=e.decodeMatrix,r=Gu(n,e.decodedMin),o=Gu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);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 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 vQe(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new UZe;c.name=n,c.semantic=i,c.setIndex=r,c.constant=bQe(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Gu(s,o.min),c.max=Gu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=Vu(e,o),ir(o,"WEB3D_quantized_attributes")&&CQe(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&&EQe(c,s),c}function rye(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var SQe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function iZ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=SQe;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function wQe(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function IQe(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 PQe(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 DQe(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=nZ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function oye(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)?rye(g):void 0,b=vQe(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=pQe(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])?IQe(b,x,s,a):l(o)?PQe(b,x,s,a):DQe(u,f,b,x,s,a)},b}function sye(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=oye(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new Qx.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function RQe(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=iZ(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 oye(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function OQe(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 zZe;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=gQe(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 Qx.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function MQe(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 Ql(e,t,n,i,r){let o=e.gltfJson,s=ju.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Fi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=ju.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=oo.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=MQe(d.sampler,i,r))},c}function NQe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new iQe;return l(i)&&(c.diffuseTexture=Ql(e,i,n)),l(r)&&(c.specularGlossinessTexture=Ql(e,r,n)),c.diffuseFactor=Gu(se,o),c.specularFactor=Gu(h,s),c.glossinessFactor=a,c}function LQe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new nQe;return l(i)&&(c.baseColorTexture=Ql(e,i,n)),l(r)&&(c.metallicRoughnessTexture=Ql(e,r,n)),c.baseColorFactor=Gu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function FQe(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new rQe;return l(r)&&(a.specularTexture=Ql(e,r,n)),l(s)&&(a.specularColorTexture=Ql(e,s,n)),a.specularFactor=i,a.specularColorFactor=Gu(h,o),a}function BQe(e,t,n){let{anisotropyStrength:i=QJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=QJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new QJ;return l(o)&&(s.anisotropyTexture=Ql(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function kQe(e,t,n){let{clearcoatFactor:i=eZ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=eZ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new eZ;return l(r)&&(c.clearcoatTexture=Ql(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=Ql(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Ql(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function UQe(e){return new oQe(e)}function zQe(e){if(!l(e))return;let t=new sQe;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 VQe(e,t,n){let i=new aQe,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=NQe(e,o,n):(l(u)&&(i.metallicRoughness=LQe(e,u,n)),l(s)&&!i.unlit&&(i.specular=FQe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=BQe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=kQe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ql(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ql(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ql(e,t.occlusionTexture,n)),i.emissiveFactor=Gu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=UQe(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=zQe(r.BENTLEY_materials_line_style),i}function aye(e,t){let n=new eye;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 cye(e,t,n,i){let r=new eye,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=rye(o.attribute),r.positionalLabel=i,r}function lye(e,t){let n=new nye;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 uye(e,t,n,i){let r=new nye,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 jQe(e,t,n,i){let r=new tye;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=Ql(e,o,n,Wt.NEAREST,$n.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function HQe(e,t,n,i,r,o){let s=new tye,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=Ql(e,c,i,Wt.NEAREST,$n.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function GQe(e,t,n,i,r){let o=new VZe,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=iZ(e,ct,f),g=sye(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function WQe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function fye(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=Gu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function qQe(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 YQe(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=lm(e,a),u=qQe(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:fye(e,f)}}return i}function XQe(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=lm(e,r)}if(n.materialColor=fye(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=lm(e,r))}return l(t.lineStrings)&&(n.lineStrings=YQe(e,t.lineStrings,t.material)),n}function KQe(e,t,n,i){let r=new jZe,o=new Qx(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=VQe(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=JQe(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=ZQe(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=$Qe(e,d,o)),r.edgeVisibility=XQe(e,a.EXT_mesh_primitive_edge_visibility);let p=WQe(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],_=iZ(e,ct,O),C=_.modelSemantic;if(g&&!wQe(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=sye(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(GQe(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=OQe(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)?QQe(e,r,E,i):S&&eet(e,r,v,i),l(T)?tet(r,T):S&&net(e,r,v),l(I)&&iet(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 $Qe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return WN(e,i,!1)}function JQe(e,t,n){let i=new lQe,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=lm(e,r[t.indices]),i.loopIndicesOffsets=lm(e,r[n.indicesOffsets]),i.triangleIndices=lm(e,r[n.triangleIndices]),i.triangleIndicesOffsets=lm(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=lm(e,r[n.loopIndices]),i.loopIndicesOffsets=lm(e,r[n.loopIndicesOffsets]),i.triangleIndices=lm(e,r[t.indices]),i.triangleIndicesOffsets=lm(e,r[n.indicesOffsets])),i}function ZQe(e,t){if(!l(t))return;let n=new cQe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return WN(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 QQe(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=jQe(e,s,i,a):l(s.attribute)?c=aye(s,a):c=lye(s,a),t.featureIds.push(c)}}function eet(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=cye(u,d,p,g):m=uye(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=HQe(e,u,d,i,p,g);t.featureIds.push(m)}}function tet(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function net(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function iet(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function ret(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new HZe,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(RQe(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)?oet(r,a):l(c)&&set(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function oet(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=aye(r,o):s=lye(r,o),e.featureIds.push(s)}}function set(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=cye(a,u,f,d):p=uye(a,u,f,d),t.featureIds.push(p)}}function aet(e,t,n){let i=new WZe;i.name=t.name,i.matrix=Gu(N,t.matrix),i.translation=Gu(h,t.translation),i.rotation=Gu(Le,t.rotation),i.scale=Gu(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=ret(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=GN(u);for(let g=0;g<f.length;++g)i.primitives.push(KQe(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 cet(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=aet(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 uet(e,t,n){let i=new GZe,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=WN(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(N.IDENTITY);return i}function fet(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=uet(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 det(e,t,n,i){let r=new MN({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 het(e,t,n,i){let r=new HN({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 met(e,t){let n=new YZe,i=e.gltfJson.accessors,r=i[t.input];n.input=WN(e,r);let o=t.interpolation;n.interpolation=cm[o]??cm.LINEAR;let s=i[t.output];return n.output=WN(e,s,!0),n}function pet(e,t){let n=new XZe,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=qZe[r],n}function get(e,t,n){let i=new KZe,r=e.sampler;return i.sampler=t[r],i.target=pet(e.target,n),i}function _et(e,t,n){let i=new $Ze;i.name=t.name;let r=t.samplers.map(function(s,a){let c=met(e,s);return c.index=a,c}),o=t.channels.map(function(s){return get(s,r,n)});return i.samplers=r,i.channels=o,i}function yet(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=_et(e,r,t);return s.index=o,s})}function Aet(e){let t=new JZe;t.name=e.name;let n=e.type.toUpperCase();return t.type=hl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function bet(e){let t=new ZZe;return t.name=e.name,t.stages=e.stages.map(Aet),t}function xet(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(bet):[]}function Tet(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 Eet(e,t){let n=new eQe,i=Tet(e);return n.nodes=i.map(function(r){return t[r]}),n}var Cet=new h;function vet(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=cet(e,t),c=fet(e,a),u=yet(e,a),f=xet(n),d=Eet(n,a),p=new tQe,g=new QZe,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,Cet);p.transform=N.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=det(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=UN.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=het(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Qn(b,e._loaderPromises),e._incrementallyLoadTextures||Qn(b,e._texturesPromises),Promise.all(b)}function wet(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Fi.unload(t[n]);e._textureLoaders.length=0}function Q_e(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Fi.unload(t[n]);e._bufferViewLoaders.length=0}function Iet(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Fi.unload(t[n]);e._geometryLoaders.length=0}function Pet(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 Det(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Ret(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Uf=tZ;function eT(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(eT.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}}});eT.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function rZ(e){e._cubeMapBuffers=void 0}eT.prototype.update=function(e){let{context:t}=e;if(!eT.isSupported(t))return;if(l(this._texture)){rZ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(rZ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Ou(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(rs.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 rs({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};eT.prototype.isDestroyed=function(){return!1};eT.prototype.destroy=function(){return rZ(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var um=eT;function qN(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(qN.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 Oet(e,t){if(um.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new um(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}qN.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&&(Oet(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)};qN.prototype.isDestroyed=function(){return!1};qN.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var tT=qN;var YN=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; -vec2 neighborContribution(float log2Depth, vec2 offset) +#endif +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) { -float dist = u_distanceAndEdlStrength.x; -vec2 texCoordOrig = v_textureCoordinates + offset * dist; -vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); -vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); -float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); -float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); -if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { -return vec2(0.0); -} -float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); -return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM +normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); +#endif +#ifdef HAS_BITANGENTS +vec3 t = attributes.tangentEC; +vec3 b = attributes.bitangentEC; +#else +vec3 t = computeTangent(attributes.positionEC, normalTexCoords); +t = normalize(t - geometryNormal * dot(geometryNormal, t)); +vec3 b = normalize(cross(geometryNormal, t)); +#endif +mat3 tbn = mat3(t, b, geometryNormal); +vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; +normalSample = 2.0 * normalSample - 1.0; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE +normalSample.xy *= u_clearcoatNormalTextureScale; +#endif +return normalize(tbn * normalSample); } -void main() -{ -float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); -eyeCoordinate /= eyeCoordinate.w; -float log2Depth = log2(-eyeCoordinate.z); -if (depthOrLogDepth == 0.0) +#endif +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) { -discard; +vec3 normal = attributes.normalEC; +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +normal = getNormalFromTexture(attributes, normal); +#endif +#ifdef HAS_DOUBLE_SIDED_MATERIAL +if (czm_backFacing()) { +normal = -normal; } -vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); -vec2 texelSize = 1.0 / czm_viewport.zw; -vec2 responseAndCount = vec2(0.0); -responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); -responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); -responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); -responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); -float response = responseAndCount.x / responseAndCount.y; -float strength = u_distanceAndEdlStrength.y; -float shade = exp(-response * 300.0 * strength); -color.rgb *= shade; -out_FragColor = vec4(color); -gl_FragDepth = depthOrLogDepth; +#endif +return normal; } -`;function CS(){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(CS.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 Met(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var oZ=new U;function Net(e,t){let n=new Ye({defines:["LOG_DEPTH_WRITE"],sources:[YN]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return oZ.x=e._radius,oZ.y=e._strength,oZ}},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 Let(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Net(e,t)}function dye(e){return e.drawBuffers&&e.fragmentDepth}CS.isSupported=dye;function Fet(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 - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); +#endif +#ifdef HAS_BASE_COLOR_TEXTURE +vec4 getBaseColorFromTexture() +{ +vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; +#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM +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 - out_FragData_1 = czm_packDepth(gl_FragCoord.z); +baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); #endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}CS.prototype.update=function(e,t,n,i){if(!dye(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Let(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=Fet(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)};CS.prototype.isDestroyed=function(){return!1};CS.prototype.destroy=function(){return Met(this),le(this)};var kg=CS;function hye(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}hye.isSupported=function(e){return kg.isSupported(e.context)};var Zp=hye;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 Pn=Wu;function XN(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function mye(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 Bet(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}XN.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,mye(this,e,t,n,1,i.byteOffset)):i};XN.prototype.hasProperty=function(e){return l(this.json[e])};XN.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)),mye(this,e,t,n,this.featuresLength,i.byteOffset)):Bet(this,e,t,i)};XN.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 fm=XN;function KN(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=ket(n),a;l(s.jsonProperties)&&(a=new Fg({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new gx({extension:s.hierarchy,binaryBody:i}));let u=rm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=zet(t,u,f,i,o);g=A.transcodedSchema,p=[new $x({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=Uet(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new Bd({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 Zl({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 ket(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(KN._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 Uet(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=wd(p);o[d]={bufferView:a},r[d]=pye(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=Kl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function zet(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=pye(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=wd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new Tn.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)&&(KN._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=Kl.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function pye(e){let t=Vet(e.componentType);return{type:e.type,componentType:t}}function Vet(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"}}KN._deprecationWarning=qr;KN._oneTimeWarning=_t;var Ug=KN;var nT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},jet=Tn.FeatureIdAttribute,sZ=class extends er{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??Vi.Y,f=t.forwardAxis??Vi.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=nT.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=zD.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new fm(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 Uf({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=nT.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=nT.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return Het(f,d)}),this._promise}process(t){if(this._state===nT.READY)return!0;if(this._state!==nT.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=N.multiplyTransformation(this._transform,i.transform,i.transform),Get(this,i),this._components=i,this._arrayBuffer=void 0,this._state=nT.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Het(e,t){return e.unload(),e._state=nT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function Get(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Ug({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Zl({name:rm.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++)gye(o[a]);t.structuralMetadata=r}function gye(e){let t=e.children.length;for(let i=0;i<t;i++)gye(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 jet;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var $N=sZ;var aZ=class extends er{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=itt(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function Wet(){this.lines=void 0,this.points=void 0,this.properties=void 0}function qet(){this.features=[]}function cZ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function lZ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=cZ(e[r]);return[n]}function Yet(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=lZ(e[i])[0];return n}function _ye(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=lZ(e[i])[0];return n}function Xet(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=_ye(e[i]);Qn(n,r)}return n}function Ket(e){return[cZ(e)]}function $et(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=cZ(e[i]);return n}var Jet={LineString:lZ,MultiLineString:Yet,MultiPolygon:Xet,Polygon:_ye,MultiPoint:$et,Point:Ket},Zet={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function yye(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Jet[n],r=Zet[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new Wet;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function Qet(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)yye(n[r],t)}var ett={FeatureCollection:Qet,Feature:yye},SH=new h;function ttt(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,SH),B=N.multiplyByPoint(t,V,SH);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 Tn.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 Tn.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 Tn.Material;E.unlit=!0;let v=new Tn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new Tn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new Tn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function ntt(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,SH),O=N.multiplyByPoint(t,R,SH);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 Tn.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 Tn.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 Tn.Material;y.unlit=!0;let A=new Tn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new Tn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function itt(e,t){let n=new qet,i=ett[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 Fg({count:o,properties:s}),u=[new Zl({id:0,count:o,jsonMetadataTable:a})],f=Kl.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(ttt(r,T,t)),y&&E.push(ntt(r,T,t));let v=new Tn.Node;v.index=0,v.primitives=E;let S=[v],I=new Tn.Scene;I.nodes=S;let R=new Tn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var JN=aZ;var wH={};wH._deprecationWarning=qr;var pA=Uint32Array.BYTES_PER_ELEMENT;wH.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=pA;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+=pA;let s=r.getUint32(t,!0);t+=pA;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=pA;let c=r.getUint32(t,!0);t+=pA;let u=r.getUint32(t,!0);t+=pA;let f=r.getUint32(t,!0);t+=pA;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+=pA;let p=Do(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Do(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):(wH._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 ZN=wH;var zg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},IH=Tn.Attribute,rtt=Tn.FeatureIdAttribute,bye=Tn.Instances,uZ=class extends er{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??Vi.Y,f=t.forwardAxis??Vi.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=zg.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=ZN.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new fm(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=Lu(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 Uf(f);return this._gltfLoader=d,this._state=zg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=zg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw ott(this,p)}),this._promise}process(t){if(this._state===zg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===zg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=N.multiplyTransformation(this._transform,r.transform,r.transform),ctt(this,r,t),stt(this,r),this._components=r,this._arrayBuffer=void 0,this._state=zg.READY,!0}isUnloaded(){return this._state===zg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),htt(this),this._components=void 0,this._arrayBuffer=void 0,this._state=zg.UNLOADED}};function ott(e,t){return e.unload(),e._state=zg.FAILED,e.getError("Failed to load i3dm",t)}function stt(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Ug({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Zl({name:rm.BATCH_TABLE_CLASS_NAME,count:i});r=new Ha({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var PH=new h,fZ=new Array(4),att=new N;function ctt(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=utt(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=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,PH),f[3*i+0]=PH.x,f[3*i+1]=PH.y,f[3*i+2]=PH.z;let j=N.fromTranslation(B.center,att);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&&(ftt(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&&(dtt(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 bye;O.transformInWorldSpace=!0;let L=e._buffers,_=new IH;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 IH;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 IH;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 IH;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 rtt;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?ltt(O):O,V=!0)}}function ltt(e){let t=new bye;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 utt(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 Aye=new Array(4);function ftt(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,fZ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,Aye),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,fZ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,Aye);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 dtt(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,fZ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function htt(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 QN=uZ;var xye={STOPPED:0,ANIMATING:1};Object.freeze(xye);var dm=xye;function vS(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}vS.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};vS.prototype.evaluate=pe.throwInstantiationError;vS.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};vS.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};vS.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Rr=vS;function SS(e){this._value=e,this._valueType=Rr.getPointType(e)}Object.defineProperties(SS.prototype,{value:{get:function(){return this._value}}});SS.prototype.findTimeInterval=function(e){};SS.prototype.wrapTime=function(e){return 0};SS.prototype.clampTime=function(e){return 0};SS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var eL=SS;function wS(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(wS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});wS.prototype.findTimeInterval=Rr.prototype.findTimeInterval;wS.prototype.wrapTime=Rr.prototype.wrapTime;wS.prototype.clampTime=Rr.prototype.clampTime;wS.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 gA=wS;var Tye={};Tye.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 IS=Tye;var Eye=[],Cye=[],vye=[],Sye=[];function mtt(e,t,n){let i=Eye,r=vye,o=Cye,s=Sye;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),IS.solve(i,o,r,s)}function ptt(e){let t=Eye,n=vye,i=Cye,r=Sye;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),IS.solve(t,i,n,r)}function qu(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(qu.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}}});qu.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 qu({times:t,points:n,inTangents:o,outTangents:r})};qu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new gA({points:n,times:t});let i=ptt(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new qu({times:t,points:n,inTangents:o,outTangents:r})};qu.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 gA({points:n,times:t});let s=mtt(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new qu({times:t,points:n,inTangents:c,outTangents:a})};qu.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);qu.prototype.findTimeInterval=Rr.prototype.findTimeInterval;var gtt=new se,PS=new h;qu.prototype.wrapTime=Rr.prototype.wrapTime;qu.prototype.clampTime=Rr.prototype.clampTime;qu.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=gtt;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=N.multiplyByVector(qu.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,PS),d.add(t,PS,t),d.multiplyByScalar(o[s],f.z,PS),d.add(t,PS,t),d.multiplyByScalar(r[s],f.w,PS),d.add(t,PS,t))};var _A=qu;function DS(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(DS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});DS.prototype.findTimeInterval=Rr.prototype.findTimeInterval;DS.prototype.wrapTime=Rr.prototype.wrapTime;DS.prototype.clampTime=Rr.prototype.clampTime;DS.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 tL=DS;function _tt(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 RS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=_tt(this),this._lastTimeIndex=0}Object.defineProperties(RS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});RS.prototype.findTimeInterval=Rr.prototype.findTimeInterval;RS.prototype.wrapTime=Rr.prototype.wrapTime;RS.prototype.clampTime=Rr.prototype.clampTime;RS.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var nL=RS;var OS=Tn.AnimatedPropertyType;function dZ(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,Ttt(this)}Object.defineProperties(dZ.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 ytt(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 _A({times:e,points:n,inTangents:i,outTangents:r})}function wye(e,t,n,i){if(e.length===1&&t.length===1)return new eL(t[0]);switch(n){case cm.STEP:return new tL({times:e,points:t});case cm.CUBICSPLINE:return ytt(e,t);case cm.LINEAR:return i===OS.ROTATION?new nL({times:e,points:t}):new gA({times:e,points:t})}}function Att(e,t,n,i,r){let o=[];if(i===OS.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===cm.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(wye(e,f,n,i))}}else o.push(wye(e,t,n,i));return o}var btt=new h,xtt=new Le;function Ttt(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=Att(i,r,o,a,u);e._splines=f,e._path=a}dZ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===OS.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===OS.TRANSLATION||n===OS.SCALE?r[n]=o.evaluate(s,btt):n===OS.ROTATION&&(r[n]=o.evaluate(s,xtt))}}};var iL=dZ;function hZ(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??Hu.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=dm.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,Ett(this)}Object.defineProperties(hZ.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 Ett(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 iL({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}hZ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var rL=hZ;function Vg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Vg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function mZ(e,t,n){let i=e._model,r=new rL(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}Vg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return mZ(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 mZ(this,n[i],e)};Vg.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=mZ(this,n[o],e);i.push(s)}return i};Vg.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};Vg.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])};Vg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Vg.prototype.get=function(e){return this._runtimeAnimations[e]};var DH=[];function Ctt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Vg.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===Hu.REPEAT||a.loop===Hu.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===dm.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===dm.ANIMATING){if(y&&a._state===dm.STOPPED&&(a._state=dm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Hu.REPEAT)g=g-Math.floor(g);else if(a.loop===Hu.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=dm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&DH.push(a))}}n=DH.length;for(let s=0;s<n;++s){let a=DH[s];t.splice(t.indexOf(a),1),e.afterRender.push(Ctt(this,o,a))}return DH.length=0,i};var oL=Vg;function iT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(iT.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}}});iT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};iT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};iT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};iT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};iT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var sL=iT;var MS={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};MS.getStyleCommandsNeeded=function(e,t){return t===0?MS.ALL_OPAQUE:t===e?MS.ALL_TRANSLUCENT:MS.OPAQUE_AND_TRANSLUCENT};Object.freeze(MS);var hm=MS;var jg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};jg.is3DTiles=function(e){switch(e){case jg.TILE_GLTF:case jg.TILE_B3DM:case jg.TILE_I3DM:case jg.TILE_PNTS:case jg.TILE_GEOJSON:return!0;case jg.GLTF:return!1}};Object.freeze(jg);var Wo=jg;function ws(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=hm.ALL_OPAQUE,vtt(this)}Object.defineProperties(ws.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 vtt(e){let t=e._model,n=Wo.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 ra(s,r)}else for(r=0;r<i;r++)o[r]=new sL({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Vl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ws.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=hm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ws.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ws.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ws.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ws.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ws.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ws.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ws.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ws.prototype.getFeature=function(e){return this._features[e]};ws.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ws.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ws.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ws.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ws.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ws.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ws.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ws.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ws.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Stt=new z;ws.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Vl.DEFAULT_COLOR_VALUE),this.setAllShow(Vl.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,Stt)??Vl.DEFAULT_COLOR_VALUE:Vl.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Vl.DEFAULT_SHOW_VALUE:Vl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};ws.prototype.isDestroyed=function(){return!1};ws.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var aL=ws;var Iye={name:"TilesetPipelineStage"};Iye.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 cL=Iye;var lL=`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; -vec2 tTrigs = vec2(0.70710678118); -vec2 v = radii * tTrigs; -vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -return v * sign(pos); -} -vec3 computeEllipsoidPositionWC(vec3 positionMC) { -vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; -vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); -vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); -return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); -} -void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { -vec3 fogColor = groundAtmosphereColor.rgb; -const float NONE = 0.0; -if (czm_atmosphereDynamicLighting != NONE) { -float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); -fogColor *= darken; -} -#ifndef HDR -fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); +#else +baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); #endif -vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); -color = vec4(withFog, color.a); -} -void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { -vec3 rayleighColor; -vec3 mieColor; -float opacity; -vec3 positionWC; -vec3 lightDirection; -if (false) { -positionWC = computeEllipsoidPositionWC(attributes.positionMC); -lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); -czm_computeGroundAtmosphereScattering( -positionWC, -lightDirection, -rayleighColor, -mieColor, -opacity -); -} else { -positionWC = attributes.positionWC; -lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); -rayleighColor = v_atmosphereRayleighColor; -mieColor = v_atmosphereMieColor; -opacity = v_atmosphereOpacity; -} -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); -vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); -if (u_isInFog) { -float distanceToCamera = length(attributes.positionEC); -applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); -} else { +#ifdef HAS_BASE_COLOR_FACTOR +baseColorWithAlpha *= u_baseColorFactor; +#endif +return baseColorWithAlpha; } +#endif +#ifdef HAS_EMISSIVE_TEXTURE +vec3 getEmissiveFromTexture() +{ +vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; +#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM +emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); +#endif +vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); +#ifdef HAS_EMISSIVE_FACTOR +emissive *= u_emissiveFactor; +#endif +return emissive; } -`;var uL=`void atmosphereStage(ProcessedAttributes attributes) { -vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); -czm_computeGroundAtmosphereScattering( -v_positionWC, -lightDirection, -v_atmosphereRayleighColor, -v_atmosphereMieColor, -v_atmosphereOpacity -); +#endif +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +void setSpecularGlossiness(inout czm_modelMaterial material) +{ +#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE +vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; +#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM +specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); +#endif +vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); +vec3 specular = specularGlossiness.rgb; +float glossiness = specularGlossiness.a; +#ifdef HAS_LEGACY_SPECULAR_FACTOR +specular *= u_legacySpecularFactor; +#endif +#ifdef HAS_GLOSSINESS_FACTOR +glossiness *= u_glossinessFactor; +#endif +#else +#ifdef HAS_LEGACY_SPECULAR_FACTOR +vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); +#else +vec3 specular = vec3(1.0); +#endif +#ifdef HAS_GLOSSINESS_FACTOR +float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); +#else +float glossiness = 1.0; +#endif +#endif +#ifdef HAS_DIFFUSE_TEXTURE +vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; +#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM +diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); +#endif +vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); +#ifdef HAS_DIFFUSE_FACTOR +diffuse *= u_diffuseFactor; +#endif +#elif defined(HAS_DIFFUSE_FACTOR) +vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); +#else +vec4 diffuse = vec4(1.0); +#endif +material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); +material.alpha = diffuse.a; +material.specular = specular; +material.roughness = 1.0 - glossiness; } -`;var Pye={name:"AtmospherePipelineStage"};Pye.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([uL]),i.addFragmentLines([lL]),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 fL=Pye;var dL=`#ifdef DIFFUSE_IBL -vec3 sampleDiffuseEnvironment(vec3 cubeDir) +#elif defined(LIGHTING_PBR) +float setMetallicRoughness(inout czm_modelMaterial material) { -#ifdef CUSTOM_SPHERICAL_HARMONICS -return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); +#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE +vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; +#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM +metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); +#endif +vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; +float metalness = clamp(metallicRoughness.b, 0.0, 1.0); +float roughness = clamp(metallicRoughness.g, 0.0, 1.0); +#ifdef HAS_METALLIC_FACTOR +metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); +#endif +#ifdef HAS_ROUGHNESS_FACTOR +roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); +#endif #else -return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); +#ifdef HAS_METALLIC_FACTOR +float metalness = clamp(u_metallicFactor, 0.0, 1.0); +#else +float metalness = 1.0; #endif -} +#ifdef HAS_ROUGHNESS_FACTOR +float roughness = clamp(u_roughnessFactor, 0.0, 1.0); +#else +float roughness = 1.0; #endif -#ifdef SPECULAR_IBL -vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +#endif +const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); +vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); +material.specular = f0; +material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); +material.roughness = roughness; +return metalness; +} +#ifdef USE_SPECULAR +void setSpecular(inout czm_modelMaterial material, in float metalness) { -#ifdef CUSTOM_SPECULAR_IBL -float lod = roughness * model_specularEnvironmentMapsMaximumLOD; -return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; +#ifdef HAS_SPECULAR_TEXTURE +vec2 specularTexCoords = TEXCOORD_SPECULAR; +#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM +specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); +#endif +float specularWeight = texture(u_specularTexture, specularTexCoords).a; +#ifdef HAS_SPECULAR_FACTOR +specularWeight *= u_specularFactor; +#endif #else -float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; -return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; +#ifdef HAS_SPECULAR_FACTOR +float specularWeight = u_specularFactor; +#else +float specularWeight = 1.0; +#endif +#endif +#ifdef HAS_SPECULAR_COLOR_TEXTURE +vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; +#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM +specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); +#endif +vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; +vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); +#ifdef HAS_SPECULAR_COLOR_FACTOR +specularColorFactor *= u_specularColorFactor; +#endif +#else +#ifdef HAS_SPECULAR_COLOR_FACTOR +vec3 specularColorFactor = u_specularColorFactor; +#else +vec3 specularColorFactor = vec3(1.0); +#endif #endif +material.specularWeight = specularWeight; +vec3 f0 = material.specular; +vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); +material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); } -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +#endif +#ifdef USE_ANISOTROPY +void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) { -vec3 f90 = max(vec3(1.0 - roughness), f0); -vec3 F = fresnelSchlick2(f0, f90, NdotV); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); -return specularSample * (F * brdfLut.x + brdfLut.y); +mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); +float anisotropyStrength = u_anisotropy.z; +vec2 direction = vec2(1.0, 0.0); +#ifdef HAS_ANISOTROPY_TEXTURE +vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; +#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM +anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); +#endif +vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; +direction = anisotropySample.rg * 2.0 - vec2(1.0); +anisotropyStrength *= anisotropySample.b; +#endif +direction = rotation * direction; +mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); +vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); +vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); +material.anisotropicT = anisotropicT; +material.anisotropicB = anisotropicB; +material.anisotropyStrength = anisotropyStrength; } #endif -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { -vec3 f0 = material.specular; -float roughness = material.roughness; -float specularWeight = 1.0; -#ifdef USE_SPECULAR -specularWeight = material.specularWeight; +#ifdef USE_CLEARCOAT +void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +{ +#ifdef HAS_CLEARCOAT_TEXTURE +vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; +#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM +clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); +#endif +float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; +#ifdef HAS_CLEARCOAT_FACTOR +clearcoatFactor *= u_clearcoatFactor; #endif -float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); -vec3 f90 = max(vec3(1.0 - roughness), f0); -vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); -#ifdef DIFFUSE_IBL -vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); -vec3 irradiance = sampleDiffuseEnvironment(normalMC); -vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; -float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); -vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); -vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; -vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; #else -vec3 diffuseContribution = vec3(0.0); +#ifdef HAS_CLEARCOAT_FACTOR +float clearcoatFactor = u_clearcoatFactor; +#else +float clearcoatFactor = 0.0; +#endif +#endif +#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE +vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; +#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM +clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); +#endif +float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; +#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR +clearcoatRoughness *= u_clearcoatRoughnessFactor; #endif -#ifdef USE_ANISOTROPY -vec3 anisotropyDirection = material.anisotropicB; -vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); -vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); -float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); -float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; -vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); -vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); #else -vec3 reflectEC = reflect(-viewDirectionEC, normalEC); +#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR +float clearcoatRoughness = u_clearcoatRoughnessFactor; +#else +float clearcoatRoughness = 0.0; #endif -#ifdef SPECULAR_IBL -vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); -vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); -vec3 specularContribution = radiance * FssEss * model_iblFactor.y; +#endif +material.clearcoatFactor = clearcoatFactor; +material.clearcoatRoughness = clearcoatRoughness; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); #else -vec3 specularContribution = vec3(0.0); +material.clearcoatNormal = attributes.normalEC; #endif -return diffuseContribution + specularContribution; } #endif -`;var Dye={name:"ImageBasedLightingPipelineStage"},wtt=new U;Dye.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),um.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(dL);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,wtt)},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 hL=Dye;var Itt=D.EPSILON16;function gZ(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(gZ.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,Itt)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Ptt=new h,pZ=new $;gZ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Ptt,r;switch(t){case hl.XROTATE:r=$.fromRotationX(D.toRadians(n),pZ),e=N.multiplyByMatrix3(e,r,e);break;case hl.YROTATE:r=$.fromRotationY(D.toRadians(n),pZ),e=N.multiplyByMatrix3(e,r,e);break;case hl.ZROTATE:r=$.fromRotationZ(D.toRadians(n),pZ),e=N.multiplyByMatrix3(e,r,e);break;case hl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case hl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case hl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case hl.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case hl.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case hl.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case hl.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};var mL=gZ;function RH(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,Dtt(this)}Object.defineProperties(RH.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 Dtt(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 mL({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}RH.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Rtt=new N,Ott=new N;RH.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,Rtt),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,Ott);s.transform=a}};var pL=RH;var gL=`void modelColorStage(inout czm_modelMaterial material) +#endif +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) { -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 NS={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};NS.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(gL);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",NS.COLOR_UNIFORM_NAME,de.FRAGMENT),r[NS.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",NS.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[NS.COLOR_BLEND_UNIFORM_NAME]=function(){return dl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var yA=NS;var _L=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( -highp sampler2D packedClippingPlanes, -int clippingPlaneNumber, -mat4 transform -) { -int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; -int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); -float u = (float(pixX) + 0.5) * pixelWidth; -float v = (float(pixY) + 0.5) * pixelHeight; -vec4 plane = texture(packedClippingPlanes, vec2(u, v)); -return czm_transformPlane(plane, transform); -} -#else -vec4 getClippingPlane( -highp sampler2D packedClippingPlanes, -int clippingPlaneNumber, -mat4 transform -) { -int clippingPlaneStartIndex = clippingPlaneNumber * 2; -int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; -int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); -float u = (float(pixX) + 0.5) * pixelWidth; -float v = (float(pixY) + 0.5) * pixelHeight; -vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; -vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); -vec4 plane; -plane.xyz = czm_octDecode(oct, 65535.0); -plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); -return czm_transformPlane(plane, transform); -} +#ifdef USE_ANISOTROPY +NormalInfo normalInfo = getNormalInfo(attributes); +material.normalEC = normalInfo.normal; +#elif defined(HAS_NORMALS) +material.normalEC = computeNormal(attributes); +#endif +vec4 baseColorWithAlpha = vec4(1.0); +#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) +vec4 color = attributes.color_0; +#ifdef HAS_SRGB_COLOR +color = czm_srgbToLinear(color); +#endif +baseColorWithAlpha *= color; +#endif +#ifdef USE_CPU_STYLING +baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); #endif -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -vec4 position = czm_windowToEyeCoordinates(fragCoord); -vec3 clipNormal = vec3(0.0); -vec3 clipPosition = vec3(0.0); -float pixelWidth = czm_metersPerPixel(position); -#ifdef UNION_CLIPPING_REGIONS -float clipAmount; -#else -float clipAmount = 0.0; -bool clipped = true; +material.baseColor = baseColorWithAlpha; +material.diffuse = baseColorWithAlpha.rgb; +material.alpha = baseColorWithAlpha.a; +#ifdef HAS_OCCLUSION_TEXTURE +vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; +#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM +occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif -for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { -vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); -clipNormal = clippingPlane.xyz; -clipPosition = -clippingPlane.w * clipNormal; -float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; -#ifdef UNION_CLIPPING_REGIONS -clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); -if (amount <= 0.0) { -discard; -} -#else -clipAmount = max(amount, clipAmount); -clipped = clipped && (amount <= 0.0); +material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; #endif -} -#ifndef UNION_CLIPPING_REGIONS -if (clipped) { -discard; -} +#ifdef HAS_EMISSIVE_TEXTURE +material.emissive = getEmissiveFromTexture(); +#elif defined(HAS_EMISSIVE_FACTOR) +material.emissive = u_emissiveFactor; #endif -return clipAmount; -} -void modelClippingPlanesStage(inout vec4 color) -{ -float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; -if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { -color = clippingPlanesEdgeColor; -} -} -`;var Rye={name:"ModelClippingPlanesPipelineStage"},Mtt=new U,Ntt=new N,Ltt=new N;Rye.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),Ts.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Ts.getTextureResolution(i,r,Mtt);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(_L);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,Ntt);return N.multiply(c,t._clippingPlanesMatrix,Ltt)}};e.uniformMap=Ot(a,e.uniformMap)};var yL=Rye;var AL=`void modelClippingPolygonsStage() -{ -bool insideAny = vectorClip(v_clippingUv); -#ifdef CLIPPING_INVERSE -if (!insideAny) -{ -discard; -} -#else -if (insideAny) -{ -discard; -} +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +setSpecularGlossiness(material); +#elif defined(LIGHTING_PBR) +float metalness = setMetallicRoughness(material); +#ifdef USE_SPECULAR +setSpecular(material, metalness); #endif -} -`;var bL=`void modelClippingPolygonsStage() -{ -vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; -v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; -} -`;var Hg=`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; +#ifdef USE_ANISOTROPY +setAnisotropy(material, normalInfo); #endif +#ifdef USE_CLEARCOAT +setClearcoat(material, attributes); #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); +`;var FF=`#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 BF=`#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); } -ivec2 vectorIndexToUv(int index, ivec2 size) -{ -int v = index / size.x; -int u = index - v * size.x; -return ivec2(u, v); +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); } -ivec2 vectorCellRange(vec2 uv, highp sampler2D gridCellIndicesTexture) -{ -ivec2 headerSize = textureSize(gridCellIndicesTexture, 0); -if (headerSize.x * headerSize.y < 3) -{ -return ivec2(0); +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); } -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); +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); } -#ifdef VECTOR_ANTIALIAS -const float vectorCoverageRadius = 0.5; -#else -const float vectorCoverageRadius = 0.0; #endif -vec4 vectorPolylineRender(vec2 vectorUv, vec4 baseColor) +`;var{Material:brt,MetallicRoughness:hZ,SpecularGlossiness:mZ,Specular:bAe,Clearcoat:xAe}=Cn,TAe={name:"MaterialPipelineStage",_processTexture:Yu,_processTextureTransform:EAe};TAe.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;vrt(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Srt(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&wrt(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&Prt(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&Drt(i.clearcoat,o,s,u,c),Rrt(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&xrt(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=Jp.UNLIT:y.lightingModel=Jp.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===Gp.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===Gp.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)&&Ert(i.lineStyle,t,n,o,s),s.addFragmentLines(LF),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function xrt(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 Trt(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(BF);let u=FF.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 Ert(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) { -#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))); + float cumDist = attributes.${u}; +#ifdef LINE_CUM_DIST_NORMALIZED + cumDist *= u_cumulativeDistanceMax; #endif -ivec2 headerSize = textureSize(u_vectorGridCellIndicesTexture, 0); -if (headerSize.x * headerSize.y < 3) -{ -return baseColor; + const float textureCoordinateBase = 8192.0; + v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; } -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) +`)}else l(s)&&r.addVertexLines(` +#ifdef HAS_LINE_PATTERN +void lineStyleStageVS(in ProcessedAttributes attributes) { -nearestEdgeDistance = edgeDistance; -nearestPrimitiveIndex = primitiveIndex; + 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; + } } -if (nearestEdgeDistance <= -vectorCoverageRadius) +#endif +`)}function EAe(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 Crt(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 Yu(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)&&EAe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Crt(e,t,n,i,r),Trt(e,t,n,i,r,s)}function vrt(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,brt.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&&Yu(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),Yu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Yu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Srt(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&&Yu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,mZ.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&&Yu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,mZ.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!==mZ.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 wrt(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&&Yu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==bAe.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&&Yu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,bAe.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 Irt=new h;function Prt(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Yu(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,Irt)}}function Drt(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!==xAe.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&&Yu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==xAe.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&&Yu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Yu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Rrt(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Yu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,hZ.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&&Yu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==hZ.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!==hZ.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 kF=TAe;var ru={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"};ru.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ru.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(ru.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(ru.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",[`${ru.METADATA_PICKING_VALUE_TYPE} value = ${ru.METADATA_PICKING_VALUE_TYPE}(${ru.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ru.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ru.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ru.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ru.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Vf=ru;var UF=`void morphTargetsStage(inout ProcessedAttributes attributes) { -break; +vec3 positionMC = attributes.positionMC; +attributes.positionMC = getMorphedPosition(positionMC); +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = getMorphedNormal(normalMC); +#endif +#ifdef HAS_TANGENTS +vec3 tangentMC = attributes.tangentMC; +attributes.tangentMC = getMorphedTangent(tangentMC); +#endif +} +`;var Fc={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)"};Fc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Brt(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||(Mrt(e,d,e.attributeIndex,a),e.attributeIndex++)}}krt(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(UF);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var Ort={attributeString:void 0,functionId:void 0};function Mrt(e,t,n,i){let r=e.shaderBuilder;Nrt(e,t,n);let o=Lrt(t,Ort);Frt(r,o,i)}function Nrt(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 Lrt(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Fc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Fc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Fc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Frt(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 Brt(e){e.addFunction(Fc.FUNCTION_ID_GET_MORPHED_POSITION,Fc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Fc.FUNCTION_ID_GET_MORPHED_NORMAL,Fc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Fc.FUNCTION_ID_GET_MORPHED_TANGENT,Fc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function krt(e){e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Fc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var zF=Fc;var CAe={name:"PickingPipelineStage"};function pZ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}CAe.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)Urt(e,t,a,i);else if(l(a))zrt(e,i);else{let c=vAe(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=pZ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function vAe(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(Wo.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 Urt(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=pZ(e.pickId)}function zrt(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=vAe(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=nt.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=pZ(e.pickId)}var VF=CAe;var SAe={ADD:0,REPLACE:1};Object.freeze(SAe);var yo=SAe;var jF=`float getPointSizeFromAttenuation(vec3 positionEC) { +float pointSize = model_pointCloudParameters.x; +float geometricError = model_pointCloudParameters.y; +float depthMultiplier = model_pointCloudParameters.z; +float depth = -positionEC.z; +return min((geometricError / depth) * depthMultiplier, pointSize); +} +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); } +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); } -if (nearestEdgeDistance > vectorCoverageRadius) -{ -return baseColor; +#endif +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +} +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +return getPointSizeFromAttenuation(v_positionEC); } -#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); +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { +#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) +return step(-v_normalEC.z, 0.0); #else -return baseColor; +return 1.0; #endif } -vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize) -{ -if (!inside || primitiveIndex < 0) -{ -return baseColor; +#endif +`;var Vrt=new se,IAe={name:"PointCloudStylingPipelineStage"};IAe.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=Wrt(a),A=qrt(o,y);Yrt(i,A);let x=Xrt(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;Wo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===yo.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(jF);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Vrt,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=jrt(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 wAe=new h;function jrt(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,wAe);a=N.multiplyByPointAsVector(s,a,wAe);let c=a.x*a.y*a.z;return D.cbrt(c/o)}var Hrt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Grt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Wrt(e){let t=Je(Grt);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 gZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function qrt(e,t){let n=Hrt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${gZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${gZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${gZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Yrt(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 _Z(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 Xrt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&_Z(t,r),l(n)&&_Z(n,r),l(i)&&_Z(i,r),r}var HF=IAe;var GF=`void primitiveOutlineStage() { +v_outlineCoordinates = a_outlineCoordinates; } -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); +`;var WF=`void primitiveOutlineStage(inout czm_modelMaterial material) { +if (!model_showOutline) { +return; } -bool vectorEdgeCrossesRay(vec4 edge, vec2 p) -{ -if ((edge.y > p.y) == (edge.w > p.y)) +float outlineX = +texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; +float outlineY = +texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; +float outlineZ = +texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; +float outlineness = max(outlineX, max(outlineY, outlineZ)); +material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} +`;var PAe={name:"PrimitiveOutlinePipelineStage"};PAe.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=fT.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(GF),i.addFragmentLines(WF)};var qF=PAe;var DAe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:RAe,_count2DPositions:OAe,_countMorphTargetAttributes:MAe,_countMaterialTextures:NAe,_countFeatureIdTextures:LAe,_countBinaryMetadata:FAe};DAe.process=function(e,t,n){let i=e.model,r=i.statistics;RAe(r,t),OAe(r,e.runtimePrimitive),MAe(r,t),NAe(r,t.material),LAe(r,t.featureIds),FAe(r,i)};function RAe(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+=Krt(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 Krt(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 OAe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function MAe(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 NAe(e,t){let n=$rt(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 $rt(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 LAe(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 FAe(e,t){let n=t.structuralMetadata;l(n)&&(Jrt(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 Jrt(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 YF=DAe;var Zrt=new N,Qrt=new N,BAe={name:"SceneMode2DPipelineStage"};BAe.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,Zrt),u=not(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=oot(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,Qrt)}};e.uniformMap=Ot(m,e.uniformMap)};var eot=new h,tot=new h;function not(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,eot),r=dr.computeActualEllipsoidPosition(n,i,i),o=N.multiplyByPoint(t,e.positionMax,tot),s=dr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var kAe=new h;function iot(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,kAe),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 rot(e,t,n,i){let r;l(e.quantization)?r=iot(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,kAe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=N.multiplyByPoint(t,u,u),d=dr.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 oot(e,t,n,i){let r=Je(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=rot(e,t,o,r),a=nt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var XF=BAe;var KF=`void skinningStage(inout ProcessedAttributes attributes) { -return false; +mat4 skinningMatrix = getSkinningMatrix(); +mat3 skinningMatrixMat3 = mat3(skinningMatrix); +vec4 positionMC = vec4(attributes.positionMC, 1.0); +attributes.positionMC = vec3(skinningMatrix * positionMC); +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = skinningMatrixMat3 * normalMC; +#endif +#ifdef HAS_TANGENTS +vec3 tangentMC = attributes.tangentMC; +attributes.tangentMC = skinningMatrixMat3 * tangentMC; +#endif } -float t = (p.y - edge.y) / (edge.w - edge.y); -float xIntersect = edge.x + t * (edge.z - edge.x); -return p.x < xIntersect; +`;var AT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};AT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),aot(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(KF);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function sot(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 aot(e,t){e.addFunction(AT.FUNCTION_ID_GET_SKINNING_MATRIX,AT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(AT.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=sot(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(AT.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(AT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var $F=AT;var JF=`void verticalExaggerationStage( +inout ProcessedAttributes attributes +) { +vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); +vec2 vertexAzimuth = normalize(vertexPositionENU.xy); +float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); +float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; +vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; +vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; +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, vertexEllipsoidNormalEC); +float smallAngleVersine = 0.5 * sinTheta * sinTheta; +float versine = isSmallAngle ? smallAngleVersine : exactVersine; +float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; +float vertexHeight = czm_eyeHeight + dHeight; +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 * exaggerationDirectionScaledMC; } -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; +`;var UAe={name:"VerticalExaggerationPipelineStage"},cot=new U;UAe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(JF),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,cot)}};var ZF=UAe;var yZ={};function lot(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 uot(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 fot(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 dot(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 hot(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 mot(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}yZ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?uot(t,n):lot(t);if(e===Oe.TRIANGLE_STRIP)return i?dot(t,n):fot(t);if(e===Oe.TRIANGLE_FAN)return i?mot(t,n):hot(t)};yZ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var $S=yZ;var zAe={name:"WireframePipelineStage"};zAe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=pot(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=$S.getWireframeIndicesCount(a,c)};function pot(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=$S.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return nt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var QF=zAe;function VAe(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=[]}VAe.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!==Kg.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=got(r,i,n),L=l(r.classificationType);u&&t.push(XF),t.push(hF),x&&t.push(QF),L&&t.push(qL),d&&t.push(zF),p&&t.push($F),S&&t.push(HF),b&&t.push(rF),g&&(I?_t("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(OF)),A&&t.push(kF),t.push(xA),t.push(Gd),t.push(Vf),O.hasPropertyTable&&(t.push(EA),t.push(WL),t.push(KL)),f&&t.push(ZF),m&&t.push(nF),t.push(NF),r.allowPicking&&t.push(VF),I&&t.push(qF),R&&(e.edgeVisibilityRequested=!0,t.push(lF),t.push(sF)),t.push(GL),t.push(YF)};function got(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 eB=VAe;function AZ(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=[],_ot(this)}Object.defineProperties(AZ.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 _ot(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=jAe(f,d,new N);a.push(p)}}function jAe(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}AZ.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]=jAe(i,r,e[n])}};var tB=AZ;function yot(){this.pass=void 0,this.alphaCutoff=void 0}var bT=yot;function bZ(e){this.name=e,this.fields=[]}bZ.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};bZ.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var nB=bZ;function xZ(e){this.signature=e,this.body=[]}xZ.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}`)};xZ.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var iB=xZ;function ou(){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(ou.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});ou.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)};ou.prototype.addStruct=function(e,t,n){this._structs[e]=new nB(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};ou.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};ou.prototype.addFunction=function(e,t,n){this._functions[e]=new iB(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};ou.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};ou.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)};ou.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};ou.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+=bot(e),i};ou.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}`)};ou.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?ti(t,e):t.push(e)};ou.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?ti(t,e):t.push(e)};ou.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=Aot(this),i=xot(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 en.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};ou.prototype.clone=function(){return Je(this,!0)};function Aot(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(),ti(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),ti(n,a);return{vertexLines:t,fragmentLines:n}}function bot(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function xot(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(),ti(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),ti(n,a);return{vertexLines:t,fragmentLines:n}}var e_=ou;function Tot(e){this.shaderBuilder=new e_,this.model=e,this.uniformMap={},this.alphaOptions=new bT,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var rB=Tot;var oB=`void silhouetteStage(inout vec4 color) { +if(model_silhouettePass) { +color = czm_gammaCorrect(model_silhouetteColor); } -if (vectorEdgeCrossesRay(edge, vectorUv)) -{ -inside = !inside; } +`;var sB=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +#ifdef HAS_NORMALS +if(model_silhouettePass) { +vec3 normal = normalize(czm_normal3D * attributes.normalMC); +normal.x *= czm_projection[0][0]; +normal.y *= czm_projection[1][1]; +positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; } -baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); -return baseColor; -#else -return baseColor; #endif } -vec4 vectorPickColorOver(vec4 surfacePickColor) -{ -if (vectorPickPrimitiveIndex < 0) +`;var IH={name:"ModelSilhouettePipelineStage"};IH.silhouettesLength=0;IH.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++IH.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(sB),i.addFragmentLines(oB),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 aB=IH;var cB=`void modelSplitterStage() { -return surfacePickColor; +#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 } -ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0); -return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0); +`;var PH={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};PH.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(cB);let r={};i.addUniform("float",PH.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[PH.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var lB=PH;function Eot(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 uB=Eot;function Cot(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Jp.UNLIT}var fB=Cot;function vot(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=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new fB,this.pickId=void 0,this.snapId=void 0}var dB=vot;function EZ(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!==Qn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Qn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Pot(this)}function Sot(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:ac.LESS_OR_EQUAL},depthMask:!1}}var wot={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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},Iot={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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},WAe=[];function Pot(e){let t=e._command,n=WAe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=hB(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=TZ(t,o),a=HAe(t,o);n.length=0,n.push(s,a),e._commandListTerrain=hB(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=GAe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=TZ(t,o),a=HAe(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=hB(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=GAe(e,n,e._commandList3DTilesPicking))}}function hB(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 TZ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ei.ALWAYS:ei.EQUAL,r=Sot(i);return n.renderState=Ge.fromCache(r),n}function HAe(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(wot),n}var Dot=[];function GAe(e,t,n){let i=Ge.fromCache(Iot),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=Dot;return c.length=0,c.push(s,a),hB(e,c,n)}Object.defineProperties(EZ.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=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}}});EZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ti(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ti(t,this._commandListTerrain),this._classifies3DTiles&&ti(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=TZ(this._command,r),s=WAe;s.length=0,s.push(o),this._commandListIgnoreShow=hB(this,s,this._commandListIgnoreShow)}ti(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ti(t,this._commandListTerrainPicking),this._classifies3DTiles&&ti(t,this._commandList3DTilesPicking)),t};var mB=EZ;function JS(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=ue.clone(t.boundingVolume),this._modelMatrix2D=new N,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=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,Rot(this)}function qd(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}qd.clone=function(e){return new qd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Rot(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 qd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new qd({command:kot(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new qd({command:Wot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new qd({command:qot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new qd({command:Uot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new qd({command:zot(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 qd({command:qAe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new qd({command:qAe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new qd({command:Vot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(JS.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=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,Mot(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Not(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Lot(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Fot(this))}}});function Oot(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=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Mot(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 Not(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 Lot(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 Fot(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}}}JS.prototype.pushCommands=function(e,t){let n=DH(this,e);n&&!this._has2DCommands&&(Bot(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Oot(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==mm.ALL_OPAQUE&&Zp(t,this._translucentCommand,n),i===mm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Zp(r._backfaceCommands,this._skipLodBackfaceCommand,n),jot(this,o,n),Zp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Zp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Hd.EDGES_ONLY&&this._needsEdgeCommands||Zp(t,this._originalCommand,n),t}};JS.prototype.pushSilhouetteCommands=function(e,t){let n=DH(this,e);return Zp(t,this._silhouetteColorCommand,n),t};JS.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=DH(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),Zp(t,s,r),t}if(i.pick){if(n!==Hd.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),Zp(t,s,r),t}if(n===Hd.SURFACES_ONLY)return t;let o=n===Hd.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),Zp(t,this._edgeCommand,r),t};JS.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=DH(this,e);return Zp(t,this._planarFillIdCommand,n),t};function Zp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function DH(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=qd.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 Bot(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 kot(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 Uot(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 zot(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 qAe(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 Vot(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 jot(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=Hot(r);if(o!==s){let a=Got(o),c=Je(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Hot(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function Got(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function Wot(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 qot(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=ei.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ei.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 pB=JS;var gB=`precision highp float; +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { +czm_modelVertexOutput vsOutput; +vsOutput.positionMC = positionMC; +vsOutput.pointSize = 1.0; +return vsOutput; } -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++) +void main() { -ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); -int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r); -if (primitiveIndex != currentPrimitive) +ProcessedAttributes attributes; +initializeAttributes(attributes); +#ifdef HAS_IMAGERY +initializeImageryAttributes(); +#endif +#ifdef USE_DEQUANTIZATION +dequantizationStage(attributes); +#endif +#ifdef HAS_MORPH_TARGETS +morphTargetsStage(attributes); +#endif +#ifdef HAS_SKINNING +skinningStage(attributes); +#endif +#ifdef HAS_PRIMITIVE_OUTLINE +primitiveOutlineStage(); +#endif +#ifdef HAS_BITANGENTS +attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); +#endif +FeatureIds featureIds; +featureIdStage(featureIds, attributes); +#ifdef HAS_SELECTED_FEATURE_ID +SelectedFeature feature; +selectedFeatureIdStage(feature, featureIds); +cpuStylingStage(attributes.positionMC, feature); +#endif +#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) +mat4 modelView = czm_modelView3D; +mat3 normal = czm_normal3D; +#else +mat4 modelView = czm_modelView; +mat3 normal = czm_normal; +#endif +#ifdef HAS_INSTANCING +#ifdef USE_LEGACY_INSTANCING +mat4 instanceModelView; +mat3 instanceModelViewInverseTranspose; +legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); +modelView = instanceModelView; +normal = instanceModelViewInverseTranspose; +#else +instancingStage(attributes); +#endif +#ifdef USE_PICKING +v_pickColor = a_pickColor; +#endif +#endif +Metadata metadata; +MetadataClass metadataClass; +MetadataStatistics metadataStatistics; +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); +#ifdef HAS_VERTICAL_EXAGGERATION +verticalExaggerationStage(attributes); +#endif +#ifdef HAS_CUSTOM_VERTEX_SHADER +czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); +customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); +#endif +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 HAS_VECTOR_LOOKUP +modelVectorLookupStage(attributes); +#endif +#ifdef HAS_SILHOUETTE +silhouetteStage(attributes, positionClip); +#endif +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float show = pointCloudShowStylingStage(attributes, metadata); +#else +float show = 1.0; +#endif +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +show *= pointCloudBackFaceCullingStage(); +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); +#endif +#ifdef PRIMITIVE_TYPE_POINTS +#ifdef HAS_CUSTOM_VERTEX_SHADER +gl_PointSize = vsOutput.pointSize; +#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) +gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); +#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 _B=`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() { -if (inside) +czm_modelMaterial material; +material.diffuse = vec3(0.0); +material.specular = vec3(1.0); +material.roughness = 1.0; +material.occlusion = 1.0; +material.normalEC = vec3(0.0, 0.0, 1.0); +material.emissive = vec3(0.0); +material.alpha = 1.0; +return material; +} +vec4 handleAlpha(vec3 color, float alpha) { -return true; +#ifdef ALPHA_MODE_MASK +if (alpha < u_alphaCutoff) { +discard; } -currentPrimitive = primitiveIndex; -inside = false; +#endif +return vec4(color, alpha); } -vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0); -if (vectorEdgeCrossesRay(edge, uv)) +void lineStyleStage() { -inside = !inside; -} +#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; } -return inside; +#endif } -`;var Mye={name:"ModelClippingPolygonsPipelineStage"},Ftt=new U,Btt=new U,Oye=ie.MAX_VALUE;Mye.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(bL),r.addFragmentLines(Hg),r.addFragmentLines(AL);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??Oye,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,Ftt)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??Oye;return U.fromElements(1/s.width,1/s.height,Btt)},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 xL=Mye;var TL=`void modelVectorLookupStage(ProcessedAttributes attributes) +SelectedFeature selectedFeature; +bool isEdge = false; +void main() { -vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; -v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; +#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER) +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +if (distanceToCenter > 0.5) { +discard; } -`;var EL=`void modelVectorLookupStage(inout vec4 color) +#endif +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +if (v_pointCloudShow == 0.0) { -color = vectorPolygonRender(v_vectorUv, color); -color = vectorPolylineRender(v_vectorUv, color); +discard; } -`;var ktt={name:"ModelVectorLookupPipelineStage",process:Vtt},Utt=new U,ztt=new U;function Vtt(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(TL),i.addFragmentLines(Hg),i.addFragmentLines(EL);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,Utt)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,ztt)},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 CL=ktt;function Nye(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Nye.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 vL=Nye;var jtt=new h(1,1,1),Htt=h.ZERO,Gtt=Le.IDENTITY;function Lye(e,t,n){this.translation=h.clone(e??Htt),this.rotation=Le.clone(t??Gtt),this.scale=h.clone(n??jtt)}Lye.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 AA=Lye;var SL=`mat4 getInstancingTransform() -{ -mat4 instancingTransform; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform = mat4( -a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, -a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, -a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, -a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 -); -#else -vec3 translation = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation = a_instanceTranslation; #endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; +#ifdef HAS_MODEL_SPLITTER +modelSplitterStage(); #endif -instancingTransform = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation.x, translation.y, translation.z, 1.0 -); +czm_modelMaterial material = defaultModelMaterial(); +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 instancingTransform; +return; } -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ -mat4 instancingTransform2D; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform2D = mat4( -a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, -a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, -a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, -a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 -); -#else -vec3 translation2D = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation2D = a_instanceTranslation2D; #endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; +Metadata metadata; +MetadataClass metadataClass; +MetadataStatistics metadataStatistics; +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); +#ifndef METADATA_PICKING_ENABLED +#ifdef HAS_SELECTED_FEATURE_ID +selectedFeatureIdStage(selectedFeature, featureIds); #endif -instancingTransform2D = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation2D.x, translation2D.y, translation2D.z, 1.0 -); +#ifndef CUSTOM_SHADER_REPLACE_MATERIAL +materialStage(material, attributes, selectedFeature); #endif -return instancingTransform2D; -} +#ifdef HAS_CUSTOM_FRAGMENT_SHADER +customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); #endif -`;var wL=`void instancingStage(inout ProcessedAttributes attributes) -{ -vec3 positionMC = attributes.positionMC; -mat4 instancingTransform = getInstancingTransform(); -attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; +lightingStage(material, attributes); +#ifdef HAS_SELECTED_FEATURE_ID +cpuStylingStage(material, selectedFeature); #endif -#ifdef USE_2D_INSTANCING -mat4 instancingTransform2D = getInstancingTransform2D(); -attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#ifdef HAS_MODEL_COLOR +modelColorStage(material); #endif -} -`;var IL=`void legacyInstancingStage( -inout ProcessedAttributes attributes, -out mat4 instanceModelView, -out mat3 instanceModelViewInverseTranspose) -{ -vec3 positionMC = attributes.positionMC; -mat4 instancingTransform = getInstancingTransform(); -mat4 instanceModel = instancingTransform * u_instance_nodeTransform; -instanceModelView = u_instance_modifiedModelView; -instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); -attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; -#ifdef USE_2D_INSTANCING -mat4 instancingTransform2D = getInstancingTransform2D(); -attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#ifdef HAS_PRIMITIVE_OUTLINE +primitiveOutlineStage(material); #endif -} -`;var OH=new N,Wtt=new N,qtt=new N,Bye={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:jye,_transformsToTypedArray:yZ};Bye.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(SL);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=[];ant(e,n,i,d,u,f),unt(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,OH);return u?N.multiplyTransformation(n.context.uniformState.view3D,g,OH):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,OH)),N.multiplyTransformation(n.context.uniformState.view,g,OH))},p.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,Wtt)},o.addVertexLines(IL)):o.addVertexLines(wL),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,qtt)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Qn(e.attributes,d)};var PL=new N,Ytt=new h;function Xtt(e,t,n,i,r){let o=N.multiplyTransformation(t,e,PL);return o=N.multiplyTransformation(o,n,PL),r=At.basisTo2D(i.mapProjection,o,r),r}function Ktt(e,t,n,i,r){let o=N.fromTranslation(e,PL),s=N.multiplyTransformation(t,o,PL);s=N.multiplyTransformation(s,n,PL);let a=N.getTranslation(s,Ytt);return r=fr.computeActualEllipsoidPosition(i,a,r),r}function kye(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 Uye=new N,zye=new N,$tt=new N,Jtt=new h;function Ztt(e,t,n,i){let r=Uye,o=zye;kye(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Xtt(f,r,o,n,$tt),p=N.getTranslation(d,Jtt),g=h.subtract(p,a,p);i[u]=N.setTranslation(d,g,i[u])}return i}function Qtt(e,t,n,i){let r=Uye,o=zye;kye(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Ktt(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var ent=new h,tnt=new h;function Vye(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=N.multiplyByPoint(i,n.instancingTranslationMin,ent),o=fr.computeActualEllipsoidPosition(t,r,r),s=N.multiplyByPoint(i,n.instancingTranslationMax,tnt),a=fr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function yZ(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 nnt(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 int=new h,rnt=new Le,ont=new h;function jye(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],int);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,rnt),T=new h(m[A*3],m[A*3+1],m[A*3+2],ont),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 snt(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 AZ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function ant(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Lo.ROTATION);l(s)||o?cnt(e,n,i,t,r,o):lnt(e,n,i,t,r)}function cnt(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=jye(t,a,e);let A=yZ(d);p=AZ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(Fye(e,p,n,f),!r)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,Vye(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=Ztt(d,e,g,d),b=yZ(A);m=AZ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Fye(e,m,n,"Transform2D")}function lnt(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"),_Z(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=snt(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),_Z(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,Vye(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=Qtt(f,e,g,f),T=nnt(x);o&&(a.transformsTypedArray=T),m=AZ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;_Z(e,m,0,void 0,n,"Translation2D")}function Fye(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`),Qn(n,a)}function _Z(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 unt(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 DL=Bye;var Hye=[],bZ={};bZ.name="ModelMatrixUpdateStage";bZ.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;Gye(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function fnt(e,t,n){e.modelMatrix=N.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function Gye(e,t,n,i,r){let o,s=Hye[r];l(s)||(s=Hye[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];fnt(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}Gye(u,t,n,i,r+1),u._transformDirty=!1}}var RL=bZ;var Wye={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:qye,_countGeneratedBuffers:Yye};Wye.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;qye(i,r),Yye(i,o)};function qye(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 Yye(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 OL=Wye;function LS(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,dnt(this)}Object.defineProperties(LS.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),xZ(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),xZ(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),xZ(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 dnt(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 AA(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 xZ(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}LS.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};LS.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(DL),t.push(OL),n.push(RL)};LS.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};LS.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 ML=LS;var Xye={name:"AlphaPipelineStage"};Xye.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 NL=Xye;var Kye={name:"BatchTexturePipelineStage"};Kye.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 LL=Kye;var $ye={name:"ClassificationPipelineStage"};$ye.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||hnt(t,r)};function hnt(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 FL=$ye;var BL=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) -{ -bool styleTranslucent = (featureColor.a != 1.0); -if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) -{ -#ifdef HAS_SILHOUETTE -positionMC *= float(model_silhouettePass); +vec4 color = handleAlpha(material.diffuse, material.alpha); #else -positionMC *= 0.0; +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); #endif +#ifdef HAS_ATMOSPHERE +atmosphereStage(color, attributes); +#endif +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStage(color, featureIds); +edgeDetectionStage(color, featureIds); +if (u_isEdgePass) { +isEdge = true; } -else if (czm_pass != czm_passTranslucent && styleTranslucent) +#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 { -positionMC *= 0.0; +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; } } -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ -float show = ceil(feature.color.a); -positionMC *= show; -#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) -filterByPassType(positionMC, feature.color); #endif } -`;var kL=`void filterByPassType(vec4 featureColor) -{ -bool styleTranslucent = (featureColor.a != 1.0); -if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) -{ -#ifdef HAS_SILHOUETTE -if(!model_silhouettePass) { -discard; -} -#else -discard; +`;function YAe(){}YAe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=Yot(e,n,t),r=Xot(e,i,t),o=e.model;return l(o.classificationType)?new mB({primitiveRenderResources:e,command:r}):new pB({primitiveRenderResources:e,command:r})};function Yot(e,t,n){t.addVertexLines(gB),t.addFragmentLines(_B);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Xot(e,t,n){let i=Kot(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=ue.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 Kot(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var yB=YAe;function dl(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={},$ot(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 $ot(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;XAe(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 vL({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=KAe(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 tB({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 XAe(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 Jot=new h;function Zot(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,Jot);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=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function KAe(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=KAe(e,d,p);i.push(g)}let s=new HL({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 eB({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 LL(f,s);f._nodesByName[u]=d}return c}var Qot=new h,est=new h,tst=new h,nst=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 rB(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 uB(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 dB(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.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,Qot),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,est);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=ue.clone(f.boundingSphere,new ue);let d=N.multiplyByPoint(a,f.positionMin,tst),p=N.multiplyByPoint(a,f.positionMax,nst);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=ue.fromCornerPoints(n,i,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};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 r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=yB.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(bA),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(EL),n.isClippingEnabled()&&t.push(IL);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(RL),n.hasDrapedVectors()&&t.push(NL),n.hasSilhouette(e)&&t.push(aB),l(n.splitDirection)&&n.splitDirection!==Vo.NONE&&t.push(lB),Wo.is3DTiles(n.type)&&t.push(yL),i&&t.push(xL)};dl.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)}}};dl.prototype.updateModelMatrix=function(e,t){XAe(this,e),t.mode!==re.SCENE3D&&Zot(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._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 $Ae(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);$Ae(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 RH(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];$Ae(e,c,t,n,i)}}var ist={backFaceCulling:void 0};dl.prototype.updateBackFaceCulling=function(e){let t=ist;t.backFaceCulling=e,RH(this,!1,rst,t)};function rst(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var ost={shadowMode:void 0};dl.prototype.updateShadows=function(e){let t=ost;t.shadowMode=e,RH(this,!1,sst,t)};function sst(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var ast={debugShowBoundingVolume:void 0};dl.prototype.updateShowBoundingVolume=function(e){let t=ast;t.debugShowBoundingVolume=e,RH(this,!1,cst,t)};function cst(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var JAe=[],ZAe=[],QAe=[],lst={frameState:void 0,hasSilhouette:void 0};dl.prototype.pushDrawCommands=function(e){let t=JAe;t.length=0;let n=ZAe;n.length=0;let i=QAe;i.length=0;let r=lst;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,RH(this,!0,ust,r),ti(e.commandList,t),ti(e.commandList,n),ti(e.commandList,i)};function ust(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=JAe,s=ZAe,a=QAe,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)}dl.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)};dl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var AB=dl;function vA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new kt}Object.defineProperties(vA.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}}});vA.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()};vA.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};vA.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};vA.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};vA.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};vA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var bB=vA;var ibe=Qo(gj(),1);var ebe={},xT=Uint32Array.BYTES_PER_ELEMENT;ebe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=xT;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+=xT,t+=xT;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=xT;let s=i.getUint32(t,!0);t+=xT;let a=i.getUint32(t,!0);t+=xT;let c=i.getUint32(t,!0);t+=xT;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 dm(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=dst(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=hst(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=pst(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=mst(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=gst(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),fst(A),A};function fst(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 dst(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 hst(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 mst(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 pst(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 gst(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 TT=ebe;var _st=Cn.Components,yst=Cn.Scene,Ast=Cn.Node,bst=Cn.Primitive,xst=Cn.Attribute,tbe=Cn.Quantization,Tst=Cn.FeatureIdAttribute,Est=Cn.Material,Cst=Cn.MetallicRoughness,CZ=class extends nr{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=TT.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=vst(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 vst(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=Og.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Sst(e,i,o),Bst(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 Sst(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:wst(u.componentsPerAttribute),componentType:Ist(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function wst(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Ist(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 xB(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new tbe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new tbe;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 xst;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=nt.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 nbe,OH;function Pst(e){if(!l(OH)){nbe=new ibe.default(0),OH=new Array(e);for(let t=0;t<e;++t)OH[t]=nbe.random()}return OH}var Dst=new h,Rst=new h,Ost=new h;function Mst(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Pst(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Dst),u=h.fromElements(a,a,a,Rst),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,Ost),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Nst={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Lst(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Mst(o),r=xB(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=xB(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=xB(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=xB(e,Nst,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=xB(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Fst(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?Gg({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new za({schema:{},propertyTables:[]})}function Bst(e,t){let n=e._parsedContent,i=new Cst;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Est;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Gp.BLEND);let s=!l(n.normals);r.unlit=s;let a=new bst;if(a.attributes=Lst(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new Tst;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Ast;c.index=0,c.primitives=[a];let u=new yst;u.nodes=[c],u.upAxis=Hi.Z,u.forwardAxis=Hi.X;let f=new _st;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Fst(n,d),d.length>0&&kst(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 kst(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=nt.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 TB=CZ;var MH=new h,rbe=new h,obe=new h,EB=new h,Ust=new h,zst=new h,Vst=new he,jst=new ue;function NH(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 Hst=32,vZ=new Map,SZ=[];function Gst(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 ZS(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(ba.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,jst),E=_i.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=vZ.get(f);l(A)||(A={},l(y)&&(A.vertices=ba.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=ba.readIndicesAsTypedArray(f.indices)),vZ.set(f,A),SZ.push(f),SZ.length>Hst&&vZ.delete(SZ.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++)NH(g,O,m,MH),N.multiplyByPoint(T,MH,EB),R[O*3]=EB.x,R[O*3+1]=EB.y,R[O*3+2]=EB.z;A.world=R,A.worldTransform=N.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Gst(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];NH(g,E,m,MH),NH(g,v,m,rbe),NH(g,S,m,obe);for(let I of d){let R=N.multiplyByPoint(I.transform,MH,EB),O=N.multiplyByPoint(I.transform,rbe,Ust),L=N.multiplyByPoint(I.transform,obe,zst);i!==1&&(Ar.getPosition(R,o,i,r,R),Ar.getPosition(O,o,i,r,O),Ar.getPosition(L,o,i,r,L));let _=_i.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,Vst);f.cartographicToCartesian(d,s)}return s}}var wZ=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}},CB=wZ;var IZ=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 yT(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 CB(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},vB=IZ;function Cr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Wo.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 pL(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??ll.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 ue,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 Yp(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?bs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Mc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,cbe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new vB(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Gx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new kg(e.environmentMapOptions);kg.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??Hd.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Wo.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??Vo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new bB,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 PZ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Wst(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 _L({model:e,propertyTable:s});n.push(a)}return n}function qst(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 OZ(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=jt.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){OZ(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=OZ(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 ube(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===Wo.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&&(bs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Mc.setOwner(e,this,"_clippingPolygons"),cbe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Mc.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&&(kg.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 Yst=new N,Xst=new $,Kst=new N;Cr.prototype.update=function(e){let t=!1;try{t=$st(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")PZ(this,i);else{let r=xt.getError("model",this._resource,i);PZ(this,r)}}if(Jst(this,e),Zst(this,e),Qst(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."));PZ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Wst(this,r);let o=new AB({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(eat(this),tat(this),nat(this,e),iat(this),rat(this,e),oat(this,e),sat(this,e),aat(this,e),uat(this,e),fat(this,e),dat(this,e),hat(this,e),this._defaultTexture=e.context.defaultTexture,mat(this,e),gat(this,e),Aat(this),bat(this,e),Cat(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)),Tat(this),vat(this,e),Sat(this),Iat(this,e)}};function $st(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Jst(e,t){l(e._customShader)&&e._customShader.update(t)}function Zst(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 Qst(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function eat(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=qst(t,e),e._styleDirty=!0,e.resetDrawCommands())}function tat(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function nat(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&&abe(e)}function abe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=mm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function iat(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 rat(e,t){e._silhouetteDirty&&(dbe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function oat(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function sat(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 cbe(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 aat(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)&&(Mc.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 cat=new ie;function lbe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function lat(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function uat(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,cat);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 lbe(e);let r=lat(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function fat(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function dat(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function hat(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 mat(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function pat(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function MZ(e,t){if(!l(e)||!l(t))return N.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function gat(e,t){pat(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=MZ(e.modelMatrix,e._modelMatrix))}var SA=new h,DZ=new he,_at=new he,yat=200,sbe=30;function Aat(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=sbe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;SA.x=r[12],SA.y=r[13],SA.z=r[14];let o=i.cartesianToCartographic(SA,_at);l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<sbe,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+yat,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Nat(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,DZ),DZ.height=m,fbe(e,i,o,DZ)):MZ(r,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function bat(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;ube(e,n),xat(e,n,t)}function ube(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=ue.transform(e._boundingSphere,t,e._boundingSphere)}function xat(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,SA),e._sceneMode!==re.SCENE3D&&dr.computeActualEllipsoidPosition(n,SA,SA);let s=e._boundingSphere.radius,a=Pat(SA,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 Tat(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 Eat=new $(1,0,0,0,0,1,0,-1,0);function Cat(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=Xst,s=Yst;if(s=N.multiply(r.uniformState.view3D,i,s),o=N.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(Eat,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=N.multiply(i,e._clippingPlanes.modelMatrix,Kst);e._clippingPlanesMatrix=N.inverseTranspose(a,e._clippingPlanesMatrix)}}function vat(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 Sat(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 wat(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Iat(e,t){let n=Fat(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!wat(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Bat(e,t),e._sceneGraph.pushDrawCommands(t))}var RZ=new ue;function Pat(e,t,n){return RZ.center=e,RZ.radius=t,n.camera.getPixelSize(RZ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var LH=new h,Dat=new h,FH=new h,Rat=new h,Oat=new N;function Mat(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,Rat),a=N.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Oat),c=e.scale,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,Dat);h.multiplyByScalar(p,c,p),N.multiplyByPoint(a,p,FH),N.multiplyByPointAsVector(u,FH,FH);let g=h.dot(FH,s);g<f&&(f=g)}return-f}function fbe(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Mat(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else Fy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,LH);let r=e._clampedModelMatrix;MZ(e.modelMatrix,r),r[12]=LH.x,r[13]=LH.y,r[14]=LH.z,e._heightDirty=!0}function Nat(e,t,n){return function(i){fbe(e,t,n,i)}}var Lat=new h;function Fat(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,Lat);dr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Bat(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 dbe(e){return e.context.stencilBuffer}Cr.prototype.hasSilhouette=function(e){return dbe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Cr.prototype.hasSkipLevelOfDetail=function(e){if(!Wo.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 ZS(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(),lbe(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)&&Mc.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,le(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 Lf(n),a=l(e.content)?Wo.TILE_GLTF:Wo.GLTF,c=n.gltfResource,u=SB(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 sL(t);try{await n.load();let i=SB(n,Wo.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 TB(t);try{await n.load();let i=SB(n,Wo.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 lL(t);try{await n.load();let i=SB(n,Wo.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 aL(t),i=SB(n,Wo.TILE_GEOJSON,e);return new Cr(i)};var kat=new z;Cr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,kat),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,OZ(t,this._color)&&this.resetDrawCommands()};Cr.prototype.applyStyle=function(e){let t=this.type===Wo.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),abe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function SB(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 jf=Cr;var NZ=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:Hu.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=wB(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await jf.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=wB(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await jf.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=wB(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await jf.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=wB(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await jf.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=wB(t,n,o,{geoJson:r,resource:i}),c=await jf.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 wB(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 Hf=NZ;var LZ=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 le(this)}},IB=LZ;function Ha(e,t,n,i){let r=Ha._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=Ha._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ha._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)}Ha._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};Ha._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};Ha._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};Ha.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];Ha._resize(r,this._size),Ha._appendWriters(this.writers,r)}FZ(this)};Ha._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 Uat=[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}}];Ha._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]=Uat[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Ha.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=zat(this,i)||t;if(t||!l(this.va)){FZ(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);Ha._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 zat(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=nt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ha._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})}};Ha.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)Vat(n[i],e,t)};function Vat(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)}}Ha.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function FZ(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}Ha.prototype.isDestroyed=function(){return!1};Ha.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 FZ(this),le(this)};var n_=Ha;var PB=`uniform sampler2D u_atlas; +uniform float u_coarseDepthTestDistance; +uniform float u_threePointDepthTestDistance; +#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; #endif -} -else if (czm_pass != czm_passTranslucent && styleTranslucent) -{ -discard; -} -} -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +in vec2 v_textureCoordinates; +in vec4 v_pickColor; +in vec4 v_color; +flat in vec2 v_splitDirectionAndEllipsoidDepthEC; +#ifdef SDF +in vec4 v_outlineColor; +in float v_outlineWidth; +#endif +in vec4 v_compressed; +const float SHIFT_LEFT1 = 2.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; +float getGlobeDepthAtCoords(vec2 st) { -vec4 featureColor = feature.color; -if (featureColor.a == 0.0) +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); +if (logDepthOrDepth == 0.0) { -discard; -} -#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) -filterByPassType(featureColor); -#endif -featureColor = czm_gammaCorrect(featureColor); -#ifdef HAS_CLASSIFICATION -material.diffuse = featureColor.rgb * featureColor.a; -#else -float highlight = ceil(model_colorBlend); -material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); -#endif -material.alpha *= featureColor.a; -} -`;var Jye={name:"CPUStylingPipelineStage"};Jye.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(BL),r.addFragmentLines(kL),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",yA.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[yA.COLOR_BLEND_UNIFORM_NAME]=function(){return dl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var UL=Jye;var zL=`void customShaderStage( -inout czm_modelVertexOutput vsOutput, -inout ProcessedAttributes attributes, -FeatureIds featureIds, -Metadata metadata, -MetadataClass metadataClass, -MetadataStatistics metadataStatistics -) { -VertexInput vsInput; -initializeInputStruct(vsInput, attributes); -vsInput.featureIds = featureIds; -vsInput.metadata = metadata; -vsInput.metadataClass = metadataClass; -vsInput.metadataStatistics = metadataStatistics; -vertexMain(vsInput, vsOutput); -attributes.positionMC = vsOutput.positionMC; -} -`;var VL=`void customShaderStage( -inout czm_modelMaterial material, -ProcessedAttributes attributes, -FeatureIds featureIds, -Metadata metadata, -MetadataClass metadataClass, -MetadataStatistics metadataStatistics -) { -FragmentInput fsInput; -initializeInputStruct(fsInput, attributes); -fsInput.featureIds = featureIds; -fsInput.metadata = metadata; -fsInput.metadataClass = metadataClass; -fsInput.metadataStatistics = metadataStatistics; -fragmentMain(fsInput, material); +return 0.0; } -`;var jL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { -initializeFeatureIds(featureIds, attributes); -initializeFeatureIdAliases(featureIds); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +return eyeCoordinate.z / eyeCoordinate.w; } -`;var HL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +#ifdef SDF +float getDistance(vec2 position) { -initializeFeatureIds(featureIds, attributes); -initializeFeatureIdAliases(featureIds); -setFeatureIdVaryings(); +return texture(u_atlas, position).r; } -`;var hr={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()"};hr.process=function(e,t,n){let i=e.shaderBuilder;mnt(i);let r=e.runtimeNode.node.instances;l(r)&&pnt(e,r,n),gnt(e,t,n),i.addVertexLines(HL),i.addFragmentLines(jL)};function mnt(e){e.addStruct(hr.STRUCT_ID_FEATURE_IDS_VS,hr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(hr.STRUCT_ID_FEATURE_IDS_FS,hr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,hr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function pnt(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 Tn.FeatureIdAttribute?_nt(e,s,a):Zye(e,s,a,r,1,n);let c=s.label;l(c)&&Qye(e,a,c,de.BOTH)}}function gnt(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 Tn.FeatureIdAttribute?ynt(e,a,c):a instanceof Tn.FeatureIdImplicitRange?Zye(e,a,c,o,void 0,n):(Ant(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&Qye(e,c,f,u)}}function _nt(e,t,n){let i=e.shaderBuilder;i.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(hr.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(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function ynt(e,t,n){let i=e.shaderBuilder;i.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(hr.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(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Zye(e,t,n,i,r,o){bnt(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(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Ant(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(hr.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(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Qye(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function bnt(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=xnt(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 xnt(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 bA=hr;var GL=`void metadataStage( -FeatureIds featureIds, -out Metadata metadata, -out MetadataClass metadataClass, -out MetadataStatistics metadataStatistics, -ProcessedAttributes attributes -) +vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) { -initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); +float distance = getDistance(position); +if (outlineWidth > 0.0) +{ +float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); +float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); +vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); +float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); +return vec4(sdfColor.rgb, sdfColor.a * alpha); } -`;var WL=`void metadataStage( -FeatureIds featureIds, -out Metadata metadata, -out MetadataClass metadataClass, -out MetadataStatistics metadataStatistics, -ProcessedAttributes attributes -) +else { -initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); -setMetadataVaryings(); +float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); +return vec4(v_color.rgb, v_color.a * alpha); } -`;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=znt(r,t),f=Tnt(o.propertyAttributes,t,a),d=Cnt(o.propertyTextures,a),p=wnt(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);Dnt(i,g),Mnt(i),i.addVertexLines(WL),i.addFragmentLines(GL);for(let m=0;m<f.length;m++){let y=f[m];Nnt(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Fnt(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];knt(e,y,c)}};function Tnt(e,t,n){return l(e)?e.flatMap(i=>Ent(i,t,n)):[]}function Ent(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 Cnt(e,t){return l(e)?e.flatMap(n=>vnt(n,t)):[]}function vnt(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 Snt=4;function wnt(e,t,n,i,r){if(!l(e))return[];let o=Pnt(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Int(s,o,i,r))}function Int(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(Snt))continue;let y=u[g],A=de.intersection(Hnt(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 Pnt(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 Dnt(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"?Ont(c):c;e.addStructField(a,p,d)}}}var Rnt={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Ont(e){let t=Rnt[e];return l(t)?t:e}function Mnt(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 Nnt(e,t){Lnt(e,t),TZ(e.shaderBuilder,t),EZ(e.shaderBuilder,t)}function Lnt(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=CZ({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 Fnt(e,t,n){Bnt(e,t,n),TZ(e.shaderBuilder,t),EZ(e.shaderBuilder,t)}function Bnt(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=CZ({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 TZ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=eAe(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 EZ(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=eAe(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 knt(e,t,n){Unt(e,t,n),TZ(e.shaderBuilder,t),EZ(e.shaderBuilder,t)}function Unt(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(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=CZ({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 eAe(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 CZ(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 znt(e,t){let n=new Set,i=new Set;return Vnt(e,n,i),jnt(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Vnt(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 jnt(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 Hnt(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 qd=Ii;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===Yy.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===Yy.OPAQUE&&(o.pass=void 0);let u=Jnt(s,t,e);if(!u.customShaderEnabled)return;if(tit(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=Tg.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 Gnt(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var Wnt={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},qnt={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 tAe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Wnt[t],i=qnt[t];if(l(n))return{attributeField:[n,e],value:i}}function Ynt(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!rAe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=nAe(t,r,!1),s=iAe(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=tAe(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 Xnt(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 Knt(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!rAe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=nAe(t,r,!0),s=iAe(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=tAe(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=Xnt(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var $nt={positionWC:!0,positionEC:!0};function nAe(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 iAe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||$nt.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 Jnt(e,t,n){let i=Gnt(t.attributes),r=nit(t,n.model.structuralMetadata),o=Ynt(e,i,r),s=Knt(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function Znt(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,bA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,qd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,qd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,qd.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 Qnt(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,bA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,qd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,qd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,qd.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 eit=[];function tit(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=eit;i.enabled&&(Znt(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,zL),e.addVertexLines(o)),r.enabled&&(Qnt(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,VL),e.addFragmentLines(o))}function nit(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 rAe(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 qL=Ga;var YL={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};YL.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(YL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,YL.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);rit(i,p),iit(e,p)}};function iit(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=oAe(u,0),f=oAe(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function oAe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function rit(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=oit(n,i):r=sit(n),e.addFunctionLines(YL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function oit(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 sit(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var XL=YL;var KL=`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; +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; } -`;var sAe={name:"EdgeDetectionPipelineStage"};sAe.process=function(e){e.shaderBuilder.addFragmentLines([KL])};var $L=sAe;var JL=`#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) { +bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; +if (useGlobeDepth && globeDepth == 0.0) { return; } -float edgeTypeInt = v_edgeType * 255.0; -if (edgeTypeInt < 0.5) { +if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { discard; } -if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { -if (v_shouldDiscard > 0.5) { -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); } -vec4 finalColor = color; -#ifdef HAS_EDGE_COLOR_ATTRIBUTE -if (v_edgeColor.a >= 0.0) { -finalColor = v_edgeColor; +czm_writeLogDepth(depthArg); } #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) { +void main() +{ +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 -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); +} +vec4 color = texture(u_atlas, v_textureCoordinates); +#ifdef SDF +float outlineWidth = v_outlineWidth; +vec4 outlineColor = v_outlineColor; +float distance = getDistance(v_textureCoordinates); +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) +float smoothing = fwidth(distance); +vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); +vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); +vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); +color = (center + color1 + color2 + color3 + color4)/5.0; #else -out_id.g = 0.0; -#endif -out_edgeDepth = czm_packDepth(gl_FragCoord.z); +float smoothing = 1.0/32.0; +color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); #endif +color = czm_gammaCorrect(color); +#else +color = czm_gammaCorrect(color); +color *= czm_gammaCorrect(v_color); #endif +#if !defined(OPAQUE) && !defined(TRANSLUCENT) +if (color.a < 0.005) +{ +discard; } -`;var ZL=`#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; +#else +#ifdef OPAQUE +if (color.a < 0.995) +{ +discard; } +#else +if (color.a >= 0.995) +{ +discard; } -#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; +#ifdef VECTOR_TILE +color *= u_highlightColor; +#endif +out_FragColor = color; } +`;var DB=`uniform float u_threePointDepthTestDistance; +in vec2 direction; +in vec4 positionHighAndScale; +in vec4 positionLowAndRotation; +in vec4 compressedAttribute0; +in vec4 compressedAttribute1; +in vec4 compressedAttribute2; +in vec4 eyeOffset; +in vec4 scaleByDistance; +in vec4 pixelOffsetScaleByDistance; +in vec4 compressedAttribute3; +in vec2 sdf; +in float splitDirection; +#ifdef VS_THREE_POINT_DEPTH_CHECK +in vec4 textureCoordinateBoundsOrLabelTranslate; #endif +#ifdef VECTOR_TILE +in float a_batchId; #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; +out vec2 v_textureCoordinates; +out vec4 v_compressed; +out vec4 v_pickColor; +out vec4 v_color; +flat out vec2 v_splitDirectionAndEllipsoidDepthEC; +#ifdef SDF +out vec4 v_outlineColor; +out float v_outlineWidth; +#endif +const float UPPER_BOUND = 32768.0; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_LEFT7 = 128.0; +const float SHIFT_LEFT5 = 32.0; +const float SHIFT_LEFT3 = 8.0; +const float SHIFT_LEFT2 = 4.0; +const float SHIFT_LEFT1 = 2.0; +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_RIGHT7 = 1.0 / 128.0; +const float SHIFT_RIGHT5 = 1.0 / 32.0; +const float SHIFT_RIGHT3 = 1.0 / 8.0; +const float SHIFT_RIGHT2 = 1.0 / 4.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; +vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +{ +vec2 halfSize = imageSize * scale * 0.5; +halfSize *= ((direction * 2.0) - 1.0); +vec2 originTranslate = origin * abs(halfSize); +#if defined(ROTATION) || defined(ALIGNED_AXIS) +if (validAlignedAxis || rotation != 0.0) +{ +float angle = rotation; +if (validAlignedAxis) +{ +vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); +angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / +(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); } -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; +float cosTheta = cos(angle); +float sinTheta = sin(angle); +rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); +halfSize = rotationMatrix * halfSize; } -gl_Position = posClip; +else +{ +rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } #endif -`;var vZ=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)}}},xa=vZ;var FS=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),aAe={name:"EdgeVisibilityPipelineStage"};aAe.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(JL),i.addVertexLines(ZL),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=cit(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=lit(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=ait(p.edgeIndices,p.edgeData,t.edgeVisibility),S=uit(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 ait(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!==FS.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 cit(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===FS.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===FS.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===FS.REPEATED_HARD?FS.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:FS.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function lit(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=xa.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 uit(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:xa.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:xa.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,bi=g[Xn],Wi=g[Xn+1],wi=g[Xn+2],hi=g[Xn+3],xi=g[Xn+4],jn=g[Xn+5];for(let nn=0;nn<4;nn++)R[(ht+nn)*3]=bi,R[(ht+nn)*3+1]=Wi,R[(ht+nn)*3+2]=wi,O[(ht+nn)*3]=hi,O[(ht+nn)*3+1]=xi,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:xa.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 QL=aAe;var eF=`void geometryStage(out ProcessedAttributes attributes) +mpp = czm_metersPerPixel(positionEC); +positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); +positionEC.xy += (translate + pixelOffset) * mpp; +return positionEC; +} +#ifdef VS_THREE_POINT_DEPTH_CHECK +float getGlobeDepth(vec4 positionEC) { -attributes.positionMC = v_positionMC; -attributes.positionEC = v_positionEC; -#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) -attributes.positionWC = v_positionWC; +vec4 posWC = czm_eyeToWindowCoordinates(positionEC); +float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); +if (globeDepth == 0.0) +{ +return 0.0; +} +vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); +return eyeCoordinate.z / eyeCoordinate.w; +} #endif -#ifdef HAS_NORMALS -attributes.normalEC = normalize(v_normalEC); +void main() +{ +vec3 positionHigh = positionHighAndScale.xyz; +vec3 positionLow = positionLowAndRotation.xyz; +float scale = positionHighAndScale.w; +#if defined(ROTATION) || defined(ALIGNED_AXIS) +float rotation = positionLowAndRotation.w; +#else +float rotation = 0.0; #endif -#ifdef HAS_TANGENTS -attributes.tangentEC = normalize(v_tangentEC); +float compressed = compressedAttribute0.x; +vec2 pixelOffset; +pixelOffset.x = floor(compressed * SHIFT_RIGHT7); +compressed -= pixelOffset.x * SHIFT_LEFT7; +pixelOffset.x -= UPPER_BOUND; +vec2 origin; +origin.x = floor(compressed * SHIFT_RIGHT5); +compressed -= origin.x * SHIFT_LEFT5; +origin.y = floor(compressed * SHIFT_RIGHT3); +compressed -= origin.y * SHIFT_LEFT3; +origin -= vec2(1.0); +float show = floor(compressed * SHIFT_RIGHT2); +compressed -= show * SHIFT_LEFT2; +vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); +vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); +vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; +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 EYE_DISTANCE_TRANSLUCENCY +vec4 translucencyByDistance; +translucencyByDistance.x = compressedAttribute1.z; +translucencyByDistance.z = compressedAttribute1.w; +translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +temp = compressedAttribute1.y * SHIFT_RIGHT8; +translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -#ifdef HAS_BITANGENTS -attributes.bitangentEC = normalize(v_bitangentEC); +#ifdef VS_THREE_POINT_DEPTH_CHECK +temp = compressedAttribute3.w; +temp = temp * SHIFT_RIGHT12; +vec2 dimensions; +dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; +dimensions.x = floor(temp); #endif -setDynamicVaryings(attributes); +#ifdef ALIGNED_AXIS +vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); +temp = compressedAttribute2.z * SHIFT_RIGHT5; +bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; +#else +vec3 alignedAxis = vec3(0.0); +bool validAlignedAxis = false; +#endif +vec4 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.a /= 255.0; +color.a = floor(temp); +color.a /= 255.0; +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); +positionEC.xyz *= show; +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) +{ +lengthSq = czm_eyeHeight2D.y; } -`;var tF=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +else { -vec4 computedPosition; -vec3 positionMC = attributes.positionMC; -v_positionMC = positionMC; -v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; -#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) -vec3 position2D = attributes.position2D; -vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; -computedPosition = czm_projection * vec4(positionEC, 1.0); -#else -computedPosition = czm_projection * vec4(v_positionEC, 1.0); +lengthSq = dot(positionEC.xyz, positionEC.xyz); +} #endif -#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) -v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; +#ifdef EYE_DISTANCE_SCALING +float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); +scale *= distanceScale; +translate *= distanceScale; +if (scale == 0.0) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef HAS_NORMALS -v_normalEC = normalize(normal * attributes.normalMC); +float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY +translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); +if (translucency == 0.0) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef HAS_TANGENTS -v_tangentEC = normalize(normal * attributes.tangentMC); +#ifdef EYE_DISTANCE_PIXEL_OFFSET +float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); +pixelOffset *= pixelOffsetScale; #endif -#ifdef HAS_BITANGENTS -v_bitangentEC = normalize(normal * attributes.bitangentMC); +#ifdef DISTANCE_DISPLAY_CONDITION +float nearSq = compressedAttribute3.x; +float farSq = compressedAttribute3.y; +if (lengthSq < nearSq || lengthSq > farSq) +{ +positionEC.xyz = vec3(0.0); +} #endif -setDynamicVaryings(attributes); -return computedPosition; +mat2 rotationMatrix; +float mpp; +float enableDepthCheck = 1.0; +#ifdef DISABLE_DEPTH_DISTANCE +float disableDepthTestDistanceSq = compressedAttribute3.z; +if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; } -`;var BS=`vec2 computeSt(float featureId) +if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) { -float stepX = model_textureStep.x; -float centerX = model_textureStep.y; -#ifdef MULTILINE_BATCH_TEXTURE -float stepY = model_textureStep.z; -float centerY = model_textureStep.w; -float xId = mod(featureId, model_textureDimensions.x); -float yId = floor(featureId / model_textureDimensions.x); -return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -#else -return vec2(centerX + (featureId * stepX), 0.5); +enableDepthCheck = 0.0; +} #endif +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; } -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +v_compressed.y = enableDepthCheck; +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) { +float depthsilon = 10.0; +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) { -int featureId = featureIds.SELECTED_FEATURE_ID; -if (featureId < model_featuresLength) +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) { -vec2 featureSt = computeSt(float(featureId)); -feature.id = featureId; -feature.st = featureSt; -feature.color = texture(model_batchTexture, featureSt); +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) +{ +positionEC.xyz = vec3(0.0); } -else +} +} +} +#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; +#ifdef LOG_DEPTH +czm_vertexLogDepth(); +#endif +#ifdef DISABLE_DEPTH_DISTANCE +if (disableDepthTestDistanceSq != 0.0) { -feature.id = model_featuresLength + 1; -feature.st = vec2(0.0); -feature.color = vec4(1.0); +float zclip = gl_Position.z / gl_Position.w; +bool clipped = (zclip < -1.0 || zclip > 1.0); +if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) +{ +gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = 1.0; +#endif } -#ifdef HAS_NULL_FEATURE_ID -if (featureId == model_nullFeatureId) { -feature.id = featureId; -feature.st = vec2(0.0); -feature.color = vec4(1.0); } #endif +#ifdef SDF +vec4 outlineColor = czm_decodeRGB8(sdf.x); +float outlineWidth; +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.a /= 255.0; +v_outlineWidth = outlineWidth / 255.0; +v_outlineColor = outlineColor; +v_outlineColor.a *= translucency; +#endif +v_pickColor = pickColor; +v_color = color; +v_color.a *= translucency; +v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; } -`;var nF={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};nF.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=fit(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),dit(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(BS),i.addFragmentLines(BS)};function cAe(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function lAe(e){return e instanceof Tn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function fit(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:lAe(r),featureIdDefine:cAe(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:lAe(r),featureIdDefine:cAe(r)})}function dit(e){e.addStructField(nF.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(nF.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(nF.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var xA=nF;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(xA.STRUCT_ID_SELECTED_FEATURE,xA.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===Wo.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;hit(e,f,g,d,o,s,m)}Tit(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(tF),i.addFragmentLines(eF)};function hit(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?git(e,t,n,i):pit(e,t,n,u),yit(a,c,u),_it(a,c,s),l(t.semantic)&&mit(a,t),Ait(a,c,r),bit(a,c,u),xit(a,c)}function mit(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 pit(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 git(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 _it(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 yit(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 Ait(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 bit(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 xit(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 Tit(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 iF=Wa;function Yd(e){_s.call(this,e)}Yd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Yd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof Ip)return Yd._metadataFailure(e,t);throw r}};Yd.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 Yd._requestMetadata(t,i,r);return new Yd(o)};l(Object.create)&&(Yd.prototype=Object.create(_s.prototype),Yd.prototype.constructor=Yd);function uAe(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 fAe(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}Yd._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)&&Jr.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 Po({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&Jr.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 zi||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=uAe(S,v),x=fAe(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}};Yd._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 Po({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=uAe(a,s);let c=fAe(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 TA=Yd;function dAe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}dAe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Eit(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 Po({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Cit(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Jr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function vit(e,t,n){try{let i=await e.fetchText();Eit(i,t)}catch(i){Cit(i,e,n)}}function Yu(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="${Yu.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(Yu.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}}});Yu.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 dAe(n);s.channel=t,await vit(o,s);let a=new Yu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Yu.prototype.getTileCredits=function(e,t,n){};Yu.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 Sf.loadImage(this,r)};Yu.prototype.pickFeatures=function(e,t,n,i,r){};Yu._logoUrl=void 0;Object.defineProperties(Yu,{logoUrl:{get:function(){return l(Yu._logoUrl)||(Yu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Yu._logoUrl},set:function(e){Yu._logoUrl=e}}});var rF=Yu;var Sit=/\/$/,hAe=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 kS(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();Sit.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=hAe,this._resource=i,this._imageryProvider=new _s({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(kS.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}}});kS.prototype.getTileCredits=function(e,t,n){};kS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};kS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};kS._defaultCredit=hAe;var oF=kS;function rT(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(rT.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 wit(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Jr.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return SZ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function SZ(e,t,n){try{return await Sf.loadImage(null,e)}catch(i){return wit(e,i,t,n)}}rT.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await SZ(n);t=t??H.EMPTY_OBJECT;let r=new rT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};rT.prototype.getTileCredits=function(e,t,n){};rT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await SZ(this._resource,this);return this._image=r,Jr.reportSuccess(this._errorEvent),r}return this._image};rT.prototype.pickFeatures=function(e,t,n,i,r){};var sF=rT;function Iit(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=Pit:e==="xml"?n=Mit:(e==="html"||e==="text")&&(n=mAe)),this.callback=n}function Pit(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Hh;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 wZ="http://www.mapinfo.com/mxp",Dit="http://www.esri.com/wms",Rit="http://www.opengis.net/wfs",Oit="http://www.opengis.net/gml";function Mit(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===wZ)return Nit(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Dit)return Lit(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Rit)return Fit(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Bit(e):kit(e)}function Nit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(wZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(wZ,"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 Hh;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Lit(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(MH(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(MH(a,i))}}return n}function Fit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Oit,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};IZ(o,s),t.push(MH(o,s))}return t}function Bit(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={};IZ(s,a),t.push(MH(s,a))}}return t}function IZ(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()&&IZ(r,t)&&(t[r.localName]=r.textContent)}return n}function MH(e,t){let n=new Hh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function kit(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Hh;return r.data=e,r.description=n.innerHTML,[r]}var Uit=/<body>\s*<\/body>/im,zit=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Vit=/<title>([\s\S]*)<\/title>/im;function mAe(e){if(Uit.test(e)||zit.test(e))return;let t,n=Vit.exec(e);n&&n.length>1&&(t=n[1]);let i=new Hh;return i.name=t,i.description=e,i.data=e,[i]}var mm=Iit;function aF(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(aF.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)}}});aF.prototype.getFromCache=function(e,t,n,i){let r=pAe(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};aF.prototype.checkApproachingInterval=function(e,t,n,i){let r=pAe(e,t,n),o=this._tilesRequestedForInterval,s=gAe(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!_Ae(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};aF.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=gAe(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=_Ae(this,c,o),a||s.push(c)}}};function pAe(e,t,n){return`${e}-${t}-${n}`}function jit(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function gAe(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 _Ae(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=jit(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 oT=aF;var Hit=[3034,3035,3042,3043,3044],Git=[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(yAe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(yAe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new oT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return AAe(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 _i?"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&&!Git.includes(a)||Hit.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof _i?"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 _s({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 AAe(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 Wit(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=AAe(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 Wit(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 mm("json","application/json")),Object.freeze(new mm("xml","text/xml")),Object.freeze(new mm("text","text/html"))]);function yAe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var cF=pm;function zf(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(zf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(zf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(zf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(bAe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(zf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(bAe(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 oT({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return xAe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new _s({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Po({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??zf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Yit(this)})}function xAe(e,t,n,i,r,o){let s=e._tileProvider;return TAe(e,s._resource,o),s.requestImage(t,n,i,r)}function qit(e,t,n,i,r,o,s){let a=e._tileProvider;return TAe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(zf.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}}});zf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};zf.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=xAe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};zf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return qit(this,e,t,n,i,r,s)};zf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});zf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});zf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new mm("json","application/json")),Object.freeze(new mm("xml","text/xml")),Object.freeze(new mm("text","text/html"))]);function TAe(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 Yit(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 bAe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var lF=zf;var US={};US.defaultApiKey=void 0;US.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});US.defaultStreetViewStaticApiKey=void 0;US.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});US.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ta=US;var EAe=/\/$/;function Gg(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 jo?e.url:De.createIfNeeded(e.url??Ta.mapTilesApiEndpoint),n=t.getUrlComponent();EAe.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 _s({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(Gg.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}}});Gg.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=CAe(e),i=jo._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},PZ(s,o,i)};Gg.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??Ta.mapTilesApiEndpoint,e.key=e.key??Ta.defaultApiKey;let t=e.overlayLayerType,n=await Kit(e);return new Gg({...n,...e,credit:e.credit??Ta.getDefaultCredit()})};Gg.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};Gg.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])};Gg.prototype.pickFeatures=function(e,t,n,i,r){};Gg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Xit(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 Xit(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 CAe(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 Kit(e){let{language:t,region:n,key:i,url:r}=e,o=CAe(e),s=r.url??r;EAe.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 uF=Gg;var $it=async(e,t,n)=>TA.fromUrl(new jo(t,n)),Jit=async(e,{options:t})=>ag.fromUrl(e,t),Zit=async(e,{options:t})=>FO.fromUrl(e,t),Qit=async(e,{options:t})=>{let n=t.channel;return delete t.channel,rF.fromUrl(e,n,t)},ert=async(e,{options:t})=>new oF({url:e,...t}),trt=async(e,{options:t})=>sF.fromUrl(e,t),nrt=async(e,{options:t})=>TA.fromUrl(e,t),irt=async(e,{options:t})=>new _s({url:e,...t}),rrt=async(e,{options:t})=>new cF({url:e,...t}),ort=async(e,{options:t})=>new lF({url:e,...t}),PZ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new jo(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 uF({...t.options,url:i})},srt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new jo(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 BD({...t.options,url:i})},art={ARCGIS_MAPSERVER:Jit,BING:Zit,GOOGLE_EARTH:Qit,MAPBOX:ert,SINGLE_TILE:trt,TMS:nrt,URL_TEMPLATE:irt,WMS:rrt,WMTS:ort,GOOGLE_2D_MAPS:PZ,AZURE_MAPS:srt,defaultFactoryCallback:$it},zS=Object.freeze(art);function Qp(){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(Qp.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(){}}});Qp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=jo._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Qp._endpointCache[i];l(r)||(r=n.fetchJson(),Qp._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=zS.defaultFactoryCallback;o=Je(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=zS[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new Qp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=jo.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Qp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};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._endpointCache={};var eu=Qp;var vAe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(vAe);var Wg=vAe;function crt(e){e=e??H.EMPTY_OBJECT;let t=e.style??Wg.AERIAL;return eu.fromAssetId(t)}var qg=crt;function Gs(){pe.throwInstantiationError()}Object.defineProperties(Gs.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 SAe=[];Gs.getRegularGridIndices=function(e,t){let n=SAe[e];l(n)||(SAe[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),DAe(e,t,i,0)),i};var wAe=[];Gs.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=wAe[e];l(n)||(wAe[e]=n=[]);let i=n[t];if(!l(i)){let r=Gs.getRegularGridIndices(e,t),o=PAe(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 IAe=[];Gs.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=IAe[e];l(n)||(IAe[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=PAe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);DAe(e,t,y,0),Gs.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};Gs.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Gs.getSkirtIndexCount=function(e){return(e-4)*2*3};Gs.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Gs.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=NH(e,a,o,s),a+=e.length,s=NH(t,a,o,s),a+=t.length,s=NH(n,a,o,s),a+=n.length,NH(i,a,o,s)};Gs.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Gs.addSkirtIndices(e,t,n,i,r,o,s);let a=Gs.getSkirtVertexCount(e,t,n,i),c=Gs.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 PAe(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 DAe(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 NH(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}Gs.heightmapTerrainQuality=.25;Gs.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Gs.heightmapTerrainQuality/(t*n)};Gs.prototype.requestTileGeometry=pe.throwInstantiationError;Gs.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Gs.prototype.getTileDataAvailable=pe.throwInstantiationError;Gs.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Gs;var fF=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; +`;var jat=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),qs=jat;function Am(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(Am.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}}});Am.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)};Am.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){Am.clone(s,this);return}l(s)||(s=new Am(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)};Am.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)};Am.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))};Am.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}};Am.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Am.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 i_=Am;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=jt.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??Hn.CENTER,this._horizontalOrigin=e.horizontalOrigin??zi.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 i_(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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!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??Vo.NONE,this._positionFromParent=!1}var hbe=Ni.SHOW_INDEX=0,kH=Ni.POSITION_INDEX=1,Tbe=Ni.PIXEL_OFFSET_INDEX=2,Hat=Ni.EYE_OFFSET_INDEX=3,Gat=Ni.HORIZONTAL_ORIGIN_INDEX=4,Wat=Ni.VERTICAL_ORIGIN_INDEX=5,qat=Ni.SCALE_INDEX=6,mbe=Ni.IMAGE_INDEX_INDEX=7,pbe=Ni.COLOR_INDEX=8,Yat=Ni.ROTATION_INDEX=9,Xat=Ni.ALIGNED_AXIS_INDEX=10,Kat=Ni.SCALE_BY_DISTANCE_INDEX=11,$at=Ni.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Jat=Ni.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Zat=Ni.DISTANCE_DISPLAY_CONDITION=14,Qat=Ni.DISABLE_DEPTH_DISTANCE=15;Ni.TEXTURE_COORDINATE_BOUNDS=16;var gbe=Ni.SDF_INDEX=17,ect=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)}function BZ(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function ET(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Ni.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Fo(this,hbe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;BZ(t,e)||(ET(e,t),ET(e,this._actualPosition),this._updateClamping(),Fo(this,kH))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Fo(this,kH))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Fo(this,Tbe))}},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,Kat))}},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,$at))}},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,Jat))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Fo(this,Hat))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Fo(this,Gat))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Fo(this,Wat))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Fo(this,qat))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Fo(this,pbe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Fo(this,Yat))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Fo(this,Xat))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Fo(this,mbe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Fo(this,mbe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Fo(this,pbe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),Fo(this,Zat))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Fo(this,Qat))}},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=ET(e,this._actualClampedPosition),Fo(this,kH)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Fo(this,hbe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Fo(this,gbe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Fo(this,gbe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Fo(this,ect))}}});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 UH=new he,tct=new he,_be=200,ybe=30;function Abe(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);Fy(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}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;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<ybe){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+_be){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,tct);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=ET(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<ybe,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+_be,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,Abe(t,i,A,b)},t._heightReference)}he.clone(a,UH);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(UH.height=y),Abe(t,i,a,UH)};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){i_.clone(e,this._imageTexture)};var bbe=512;Ni.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=$n();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??$n(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&nct(n)&&(this._imageWidth=Math.min(this._width,bbe),this._imageHeight=Math.min(this._height,bbe))};function nct(e){return l(e)?Uh(e)?e.startsWith("data:image/svg+xml"):ng(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,Tbe))};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,kH)};var xbe=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,xbe),dr.computeActualEllipsoidPosition(n,xbe))};var Ebe=new h;Ni._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,Ebe),a=dr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var BH=new U(0,0);Ni.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,BH),U.add(BH,this._translate,BH);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,UH);r=a.cartographicToCartesian(c,Ebe),i=N.IDENTITY}return Ni._computeScreenSpacePosition(i,r,this._eyeOffset,BH,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===zi.RIGHT?s-=i:e.horizontalOrigin===zi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Hn.BOTTOM||e.verticalOrigin===Hn.BASELINE?a-=r:e.verticalOrigin===Hn.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)&&jt.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 ict={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ga=Object.freeze(ict);function RB({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 kZ({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new RB({x:n,y:n,width:e-2*n,height:t-2*n})}kZ.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};kZ.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 RB({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new RB({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new RB({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new RB({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 QS=kZ;var Cbe=16;function su(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(Cbe,Cbe);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=$n(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(su.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}}});su.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};su.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 ys({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};su.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 vbe({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 QS({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=$n()};su.prototype.getImageIndex=function(e){return this._indexById.get(e)};su.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 vbe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}su.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new vbe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};su.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};su.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 QS({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function rct(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}su.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 rct(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)};su.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};su.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}))};su.prototype.isDestroyed=function(){return!1};su.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var CT=su;var oct=Br.SHOW_INDEX,OB=Br.POSITION_INDEX,wbe=Br.PIXEL_OFFSET_INDEX,Ibe=Br.EYE_OFFSET_INDEX,sct=Br.HORIZONTAL_ORIGIN_INDEX,act=Br.VERTICAL_ORIGIN_INDEX,cct=Br.SCALE_INDEX,vT=Br.IMAGE_INDEX_INDEX,Pbe=Br.COLOR_INDEX,lct=Br.ROTATION_INDEX,uct=Br.ALIGNED_AXIS_INDEX,Dbe=Br.SCALE_BY_DISTANCE_INDEX,Rbe=Br.TRANSLUCENCY_BY_DISTANCE_INDEX,Obe=Br.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Mbe=Br.DISTANCE_DISPLAY_CONDITION,fct=Br.DISABLE_DEPTH_DISTANCE,dct=Br.TEXTURE_COORDINATE_BOUNDS,Nbe=Br.SDF_INDEX,Lbe=Br.SPLIT_DIRECTION_INDEX,GZ=Br.NUMBER_OF_PROPERTIES,zr={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 Xd(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new CT),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(GZ),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=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(Xd.prototype,{length:{get:function(){return WZ(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 Fbe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Xd.prototype.add=function(e){let t=new Br(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Xd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Xd.prototype.removeAll=function(){Fbe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function WZ(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}}Xd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Xd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Xd.prototype.get=function(e){return WZ(this),this._billboards[e]};function Sbe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=nt.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 hct(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=nt.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}Xd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<GZ;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function mct(e,t,n,i,r){let o=[{index:zr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[OB]},{index:zr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[OB]},{index:zr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[wbe]},{index:zr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Rbe]},{index:zr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Pbe]},{index:zr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Ibe]},{index:zr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Dbe]},{index:zr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Obe]},{index:zr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Mbe]},{index:zr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dct]},{index:zr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[Lbe]},{index:zr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:hct(e)}];return l(i)&&o.push({index:zr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:zr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[Nbe]}),new n_(e,o,t,!0)}var UZ=new Sn;function Bbe(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function kbe(e,t,n,i){let r=n[zr.positionHighAndScale],o=n[zr.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(Bbe(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,UZ);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=UZ.high,f=UZ.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,Yd=32768,qZ=65536,zZ=4096,ST=256,pct=128,gct=32,_ct=8,zH=4,yct=1/256,Ube=new et;function zbe(e,t,n,i){let r=n[zr.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===Hn.BASELINE&&(p=Hn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===zi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Hn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(Ube);m=I.x,y=I.y}let A=Math.floor(D.clamp(s,-Yd,Yd)+Yd)*pct;A+=(d+1)*gct,A+=(p+1)*_ct,A+=(g?1:0)*zH;let b=Math.floor(D.clamp(a,-Yd,Yd)+Yd)*ST,x=Math.floor(D.clamp(u*zH,-Yd,Yd)+Yd)*ST,T=(D.clamp(f*zH,-Yd,Yd)+Yd)*yct,E=Math.floor(T),v=Math.floor((T-E)*ST);b+=E,x+=v,wA.x=m,wA.y=y;let S=cn.compressTextureCoordinates(wA);r(i._index,A,b,x,S)}function Vbe(e,t,n,i){let r=n[zr.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,qZ),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*ST+a,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*ST+u,r(i._index,p,g,s,c)}function jZ(e,t,n,i){let r=n[zr.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)*qZ+z.floatToByte(s.alpha)*ST+(a*2+f),A=d*zH+p;r(i._index,g,m,y,A)}function HZ(e,t,n,i){let r=n[zr.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(Ube);wA.x=c.width,wA.y=c.height}let a=cn.compressTextureCoordinates(wA);r(i._index,o.x,o.y,s,a)}function jbe(e,t,n,i){let r=n[zr.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 Hbe(e,t,n,i){let r=n[zr.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 Gbe(e,t,n,i){let r=n[zr.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=_s(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,zZ)),g=Math.floor(D.clamp(f,0,zZ)),m=p*zZ+g;r(i._index,o,s,c,m)}function Wbe(e,t,n,i){if(_s(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[zr.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function Act(e,t,n,i){if(!l(e._batchTable))return;let r=n[zr.a_batchId],o=i._batchIndex;r(i._index,o)}function qbe(e,t,n,i){if(!e._sdf)return;let r=n[zr.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/Ga.RADIUS,u=z.floatToByte(o.alpha)*qZ+z.floatToByte(c)*ST;r(i._index,a,u)}function Ybe(e,t,n,i){let r=n[zr.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function bct(e,t,n,i){kbe(e,t,n,i),zbe(e,t,n,i),Vbe(e,t,n,i),jZ(e,t,n,i),HZ(e,t,n,i),jbe(e,t,n,i),Hbe(e,t,n,i),Gbe(e,t,n,i),Wbe(e,t,n,i),Act(e,t,n,i),qbe(e,t,n,i),Ybe(e,t,n,i)}function VZ(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):Bbe(s,d))}o&&ue.fromPoints(a,s)}function xct(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)&&VZ(e,i,i.length,t,o,!0)):n===re.MORPHING?VZ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&VZ(e,r,e._billboardsToUpdateIndex,t,o,!1)}function Tct(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 Ect(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=Ie.OVERLAY,i}var Cct=[];Xd.prototype.update=function(e){if(WZ(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,vT),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;xct(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<GZ;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=mct(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,bct(this,e,d,R)}this._vaf.commit(Sbe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=Cct;I.length=0,(c[OB]||c[lct]||c[cct])&&I.push(kbe),(c[vT]||c[wbe]||c[sct]||c[act]||c[oct])&&(I.push(zbe),I.push(HZ)),(c[vT]||c[uct]||c[Rbe])&&(I.push(Vbe),I.push(jZ)),(c[vT]||c[Pbe])&&I.push(jZ),(c[vT]||c[Ibe])&&I.push(HZ),c[Dbe]&&I.push(jbe),c[Obe]&&I.push(Hbe),(c[Mbe]||c[fct]||c[vT]||c[OB])&&I.push(Gbe),(c[vT]||c[OB])&&I.push(Wbe),c[Nbe]&&I.push(qbe),c[Lbe]&&I.push(Ybe);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(Sbe(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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=N.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),Tct(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=DB,x=PB,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-Ga.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=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr}),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=en.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr})),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=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr})),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=en.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr})),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=Ect(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};Xd.prototype.isDestroyed=function(){return!1};Xd.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(),Fbe(this._billboards),le(this)};var Gf=Xd;function vct(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 wT=vct;var Sct=new he,bm=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),ew(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),ew(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,ew(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),ew(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,ew(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,Sct);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&&ew(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 na.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(bm,"defaultColor",z.WHITE),ut(bm,"defaultPointOutlineColor",z.BLACK),ut(bm,"defaultPointOutlineWidth",0),ut(bm,"defaultPointSize",8);function ew(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??bm.defaultColor,i=e._pointOutlineColor??bm.defaultPointOutlineColor,r=e._pointOutlineWidth??bm.defaultPointOutlineWidth,o=e._pointSize??bm.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,wT(f,d,p,r,o))}var r_=bm;function wct(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 IT;function Ict(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(IT)||(l(f.imageSmoothingEnabled)?IT="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?IT="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?IT="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(IT="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[IT]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=wct(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[IT]=!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 PT=Ict;var sxe=Qo(Jbe(),1);var Zbe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Zbe);var Ao=Zbe;var Qbe={},exe=0,Dct=256,Rct=new z(.165,.165,.165,.8),Oct=new U(7,5),oa=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function DT(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function NB(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function LB(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function nxe(e){let t=Qbe[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(LB(n,"line-height"));isNaN(i)&&(i=void 0),t={family:LB(n,"font-family"),size:LB(n,"font-size").replace("px",""),style:LB(n,"font-style"),weight:LB(n,"font-weight"),lineHeight:i},document.body.removeChild(n),exe<Dct&&(Qbe[e._font]=t,exe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function xm(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=jt.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??Rct),this._backgroundPadding=U.clone(e.backgroundPadding??Oct),this._style=e.style??Ao.FILL,this._verticalOrigin=e.verticalOrigin??Hn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??zi.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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,nxe(this),this._updateClamping()}Object.defineProperties(xm.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(!BZ(t,e)){ET(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),NB(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=xm.filterUnsupportedCharacters(e);this._renderedText=xm.enableRightToLeftDetection?kct(t):t,DT(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,DT(this),nxe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),DT(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),DT(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,DT(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,DT(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),NB(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,DT(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,NB(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),NB(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),NB(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!jt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=jt.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=ET(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}}});xm.prototype._updateClamping=function(){Br._updateClamping(this._labelCollection,this)};xm.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)};xm.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===Hn.BOTTOM||e.verticalOrigin===Hn.BASELINE?r-=s:e.verticalOrigin===Hn.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===Hn.BOTTOM||e.verticalOrigin===Hn.BASELINE?b-=T:e.verticalOrigin===Hn.CENTER&&(b-=T*.5),e._verticalOrigin===Hn.TOP?b+=Ga.PADDING*a:(e._verticalOrigin===Hn.BOTTOM||e._verticalOrigin===Hn.BASELINE)&&(b-=Ga.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};xm.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};xm.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)&&jt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};xm.prototype.isDestroyed=function(){return!1};xm.enableRightToLeftDetection=!1;function Mct(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=oa.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=oa.RTL:n.test(f)?a=oa.LTR:i.test(f)?a=oa.BRACKETS:a=oa.WEAK,u===0&&(s=a),s===a&&a!==oa.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function Nct(e){return e.split("").reverse().join("")}function FB(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Lct(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Fct="\u05D0-\u05EA",Bct="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",txe=new RegExp(`[${Fct}${Bct}]`);function kct(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=txe.test(r.charAt(0)),s=Mct(r,txe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===oa.BRACKETS?Lct(f.Word):Nct(f.Word);o?f.Type===oa.RTL?(c=d+c,a=0):f.Type===oa.LTR?(c=FB(c,a,f.Word),a+=f.Word.length):(f.Type===oa.WEAK||f.Type===oa.BRACKETS)&&(f.Type===oa.WEAK&&s[u-1].Type===oa.BRACKETS?c=d+c:s[u-1].Type===oa.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===oa.RTL?(c=d+c,a=0):(c=FB(c,a,f.Word),a+=f.Word.length):c=FB(c,0,d)):f.Type===oa.RTL?c=FB(c,a,d):f.Type===oa.LTR?(c+=f.Word,a=c.length):(f.Type===oa.WEAK||f.Type===oa.BRACKETS)&&(u>0&&s[u-1].Type===oa.RTL?s.length>u+1?s[u+1].Type===oa.RTL?c=FB(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 IA=xm;var axe=Qo(ixe(),1);function zct(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Vct=1.2,rxe="ID_WHITE_PIXEL",YZ=new U(4,4),jct=new et(1,1,1,1);function Hct(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=YZ.x,r.height=YZ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(rxe,r),n.addImageSubRegion(rxe,jct)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var o_={};function Gct(e,t,n,i,r,o){return o_.font=t,o_.fillColor=n,o_.strokeColor=i,o_.strokeWidth=r,o_.padding=Ga.PADDING,o_.fill=o===Ao.FILL||o===Ao.FILL_AND_OUTLINE,o_.stroke=o===Ao.OUTLINE||o===Ao.FILL_AND_OUTLINE,o_.backgroundColor=z.BLACK,PT(e,o_)}function XZ(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 Wct=new axe.default,qct=/\s/;function Yct(e,t){let n=t._renderedText,i=Wct.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/Ga.FONT_SIZE,r<s)for(let p=r;p<s;++p)XZ(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=Hct(c,e),t._backgroundBillboard=a),Xct(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 i_(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${Ga.FONT_SIZE}px ${t._fontFamily}`,S=Gct(g,v,z.WHITE,z.WHITE,0,Ao.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!qct.test(g)){let I=(0,sxe.default)(S,{cutoff:Ga.CUTOFF,radius:Ga.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 zct,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){XZ(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=zi.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===Ao.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Ao.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Ao.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Xct(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=zi.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 oxe(e,t,n){return t===zi.CENTER?-e/2:t===zi.RIGHT?-(e+n.x):n.x}var qo=new U,Kct=new U;function $ct(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,Kct);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=oxe(b,m,d),T=(l(e._lineHeight)?e._lineHeight:Vct*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),qo.x=x*g,qo.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=oxe(b,m,d),qo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Hn.TOP?(qo.y=_.height-a-d.y,qo.y+=Ga.PADDING):y===Hn.CENTER?qo.y=(E+_.height-a)/2:y===Hn.BASELINE?(qo.y=E,qo.y-=Ga.PADDING):(qo.y=E+s+d.y,qo.y-=Ga.PADDING),qo.y=(qo.y-_.descent-R)*g,I&&(qo.x-=Ga.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(qo),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,_s(e.heightReference)&&(L.billboard._labelTranslate=U.clone(qo,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];qo.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` +`).join("").length>0&&(m===zi.CENTER?x=-r/2-d.x:m===zi.RIGHT?x=-(r+d.x*2):x=0,qo.x=x*g,y===Hn.TOP?qo.y=p-a-s:y===Hn.CENTER?qo.y=(p-a)/2-s:y===Hn.BASELINE?qo.y=-d.y-s:qo.y=0,qo.y=qo.y*g,f.width=v,f.height=S,f._setTranslate(qo),f._labelTranslate=U.clone(qo,f._labelTranslate))}function cxe(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)XZ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function Qp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Gf({scene:this._scene,textureAtlas:new CT({initialSize:YZ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new i_(t),this._glyphBillboardCollection=new Gf({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(Qp.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}}});Qp.prototype.add=function(e){let t=new IA(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Qp.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),cxe(this,e),!0}return!1};Qp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)cxe(this,e[t]);e.length=0};Qp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Qp.prototype.get=function(e){return this._labels[e]};Qp.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&&(Yct(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&($ct(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)};Qp.prototype.isDestroyed=function(){return!1};Qp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var e0=Qp;var BB=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; void main() { -out_FragColor = texture(u_texture, v_textureCoordinates); +float texCoord = texCoordExpandAndBatchIndex.x; +float expandDir = texCoordExpandAndBatchIndex.y; +bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; +float batchTableIndex = texCoordExpandAndBatchIndex.w; +vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); +float width = widthAndShow.x + 0.5; +float show = widthAndShow.y; +if (width < 1.0) +{ +show = 0.0; } -`;var dF=`in vec4 position; -in float webMercatorT; -uniform vec2 u_textureDimensions; -out vec2 v_textureCoordinates; -void main() +vec4 pickColor = batchTable_getPickColor(batchTableIndex); +vec4 p, prev, next; +if (czm_morphTime == 1.0) { -v_textureCoordinates = vec2(position.x, webMercatorT); -gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); +prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); +next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); } -`;var RAe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(RAe);var Vn=RAe;function VS(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}VS.createPlaceholder=function(e){let t=new VS(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};VS.prototype.addReference=function(){++this.referenceCount};VS.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(),le(this),0):this.referenceCount};VS.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 jS=VS;function DZ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}DZ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};DZ.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 HS=DZ;function Hi(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??Hi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Hi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Hi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Hi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Hi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Hi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Hi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Hi.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 HS(jS.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??Hi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Hi.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}}});Hi.DEFAULT_BRIGHTNESS=1;Hi.DEFAULT_CONTRAST=1;Hi.DEFAULT_HUE=0;Hi.DEFAULT_SATURATION=1;Hi.DEFAULT_GAMMA=1;Hi.DEFAULT_SPLIT=Ho.NONE;Hi.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Hi.DEFAULT_MAGNIFICATION_FILTER=$n.LINEAR;Hi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Hi.fromProviderAsync=function(e,t){let n=new Hi(void 0,t);return hrt(n,Promise.resolve(e)),n};Hi.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Hi.fromProviderAsync(qg({style:e.style}),e)};Hi.prototype.isBaseLayer=function(){return this._isBaseLayer};Hi.prototype.isDestroyed=function(){return!1};Hi.prototype.destroy=function(){return le(this)};var NAe=new ie,OAe=new ie,RZ=new ie,LAe=new ie;Hi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Hi.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 _i&&e.rectangle.north<_i.MaximumLatitude&&e.rectangle.south>-_i.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,NAe),a=ie.intersection(e.rectangle,s,OAe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,P=e.rectangle;a=OAe,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=frt(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,LAe),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,RZ),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,RZ),!!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,RZ),!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 HS(F,M,o)),++n}}return!0};Hi.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,NAe),i=c.rectangleToNativeRectangle(i,LAe)}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)};Hi.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,Jr.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=Jr.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()};Hi.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})};Hi.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 _i?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function MAe(e,t,n){return`${e}:${t}:${n}`}Hi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===$n.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=MAe(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(vd.NICEST),t.sampler=u}else{let o=MAe(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}};Hi.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 zi)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new Bf({persists:!0,owner:this,preExecute:function(c){urt(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};Hi.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};Hi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Hi.prototype.getImageryFromCache=function(e,t,n,i){let r=FAe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new jS(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Hi.prototype.removeImageryFromCache=function(e){let t=FAe(e.x,e.y,e.level);delete this._imageryCache[t]};function FAe(e,t,n){return JSON.stringify([e,t,n])}var LH={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},lrt=dn.supportsTypedArrays()?new Float32Array(128):void 0;function urt(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=Xr.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:[dF]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:fF,attributeLocations:x}),r.sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:$n.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;LH.textureDimensions.x=o,LH.textureDimensions.y=s,LH.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(vd.NICEST);let p=i.south,g=i.north,m=lrt,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=LH,e.vertexArray=r.vertexArray}function frt(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof zi?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 drt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function hrt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){drt(e._errorEvent,i)}}var Is=Hi;var OZ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},hF=OZ;var MZ=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}},GS=MZ;var mrt=new ie,BAe=new ie,prt=new ie,grt=new ie,_rt=new ie,yrt=new ie,NZ=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,mrt),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=grt;a.rectangleToNativeRectangle(t,u);let f=_rt;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,prt);if(!l(b))return;let x=yrt;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 GS;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,BAe);return l(i)?i:e._clampRectangle(t,n,BAe)}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 GS);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}},WS=NZ;var LZ=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=xa.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}}},sT=LZ;var FZ=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}},mF=FZ;var BZ=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=sT.createCartographicPositions(r,s,d),g=sT.computeCartographicBoundingRectangle(p),m=new mF(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=sT.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 WS.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 WS._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(),le(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}},aT=BZ;var kZ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},pF=kZ;var Art=!1,brt=new ie,xrt=new ie,UZ=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=aT._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 hF;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Is.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Is.DEFAULT_CONTRAST,n.hue|=r.hue!==Is.DEFAULT_HUE,n.saturation|=r.saturation!==Is.DEFAULT_SATURATION,n.gamma|=r.gamma!==Is.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));"]),Art&&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 pF(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,brt),s=r.rectangleToNativeRectangle(i,xrt);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}},gF=UZ;var _F=`#ifdef USE_IBL_LIGHTING -vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +else if (czm_morphTime == 0.0) { -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 viewDirection = -normalize(position); -vec3 iblColor = textureIBL(viewDirection, normal, material); -return iblColor; -#endif -return vec3(0.0); +p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); +prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); +next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } -#endif -#ifdef USE_CLEARCOAT -vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +else { -vec3 viewDirection = -normalize(position); -vec3 halfwayDirection = normalize(viewDirection + lightDirection); -vec3 normal = material.clearcoatNormal; -float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); -vec3 f0 = vec3(0.04); -vec3 f90 = vec3(1.0); -float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); -vec3 F = fresnelSchlick2(f0, f90, NdotV); -float roughness = material.clearcoatRoughness; -float alphaRoughness = roughness * roughness; -float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); -vec3 directReflection = F * directStrength * NdotL; -vec3 color = lightColorHdr * directReflection; -#ifdef SPECULAR_IBL -vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); -vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); -color += iblColor * material.occlusion; -#endif -float clearcoatFactor = material.clearcoatFactor; -vec3 clearcoatColor = color * clearcoatFactor; -return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; +p = czm_columbusViewMorph( +czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), +czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), +czm_morphTime); +prev = czm_columbusViewMorph( +czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), +czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), +czm_morphTime); +next = czm_columbusViewMorph( +czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), +czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), +czm_morphTime); } -#endif -#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) -vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +#ifdef DISTANCE_DISPLAY_CONDITION +vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); +vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); +vec3 centerLow = centerLowAndRadius.xyz; +float radius = centerLowAndRadius.w; +vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) { -#ifdef USE_CUSTOM_LIGHT_COLOR -vec3 lightColorHdr = model_lightColorHdr; -#else -vec3 lightColorHdr = czm_lightColorHdr; -#endif -vec3 viewDirection = -normalize(position); -vec3 normal = material.normalEC; -vec3 lightDirection = normalize(czm_lightDirectionEC); -vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); -vec3 directColor = lightColorHdr * directLighting; -vec3 color = directColor + material.emissive; -#ifdef USE_IBL_LIGHTING -color += computeIBL(position, normal, lightDirection, lightColorHdr, material); -#endif -#ifdef USE_CLEARCOAT -color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); -#endif -return color; +lengthSq = czm_eyeHeight2D.y; } -#endif -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +else { -#ifdef LIGHTING_PBR -#ifdef HAS_NORMALS -vec3 color = computePbrLighting(material, attributes.positionEC); -#else -vec3 color = material.diffuse * material.occlusion + material.emissive; -#endif -#ifndef HDR -color = czm_pbrNeutralTonemapping(color); -#endif -#else // unlit -vec3 color = material.diffuse; -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -color = czm_gammaCorrect(color); -#elif !defined(HDR) -color = czm_linearToSrgb(color); +vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); +lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); +} +float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; +float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; +if (lengthSq < nearSq || lengthSq > farSq) +{ +show = 0.0; +} #endif -material.diffuse = color; +float polylineAngle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); +gl_Position = czm_viewportOrthographic * positionWC * show; +v_st.s = texCoord; +v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); +v_width = width; +v_pickColor = pickColor; +v_polylineAngle = polylineAngle; } -`;var kAe={UNLIT:0,PBR:1};Object.freeze(kAe);var e0=kAe;var UAe={name:"LightingPipelineStage"};UAe.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===e0.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(_F)};var yF=UAe;var AF=`bool isDefaultStyleColor(vec3 color) +`;var au={};au.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};au.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 Jct=new he;au.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,Jct).height}return i};var Zct=new N,Qct=new h,lxe=new h,elt=new sn(h.UNIT_X,0),uxe=new h,tlt=new sn(h.UNIT_X,0),nlt=new h,ilt=new h,$Z=[];function dxe(e,t,n){let i=$Z;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 HH=new he,jH=new he,PA=new h,JZ=new h,rlt=new h,KZ=new _g,kB=new Dc;function olt(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,JZ),u=i.scaleToGeodeticSurface(t,rlt),f=au.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,HH),p=i.cartesianToCartographic(u,jH),g=dxe(f,r,o);KZ.setEndPoints(d,p);let m=KZ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,PA);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=KZ.interpolateUsingSurfaceDistance(b*m,jH);x.height=g[b],A=i.cartographicToCartesian(x,PA),h.pack(A,s,y),y+=3}return y}function slt(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,HH),u=i.cartesianToCartographic(t,jH),f=au.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=dxe(f,r,o);kB.ellipsoid.equals(i)||(kB=new Dc(void 0,void 0,i)),kB.setEndPoints(c,u);let p=kB.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,PA);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=kB.interpolateUsingSurfaceDistance(y*p,jH);A.height=d[y],m=i.cartographicToCartesian(A,PA),h.pack(m,s,g),g+=3}return g}au.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??N.IDENTITY;let r=N.inverseTransformation(t,Zct),o=N.multiplyByPoint(r,h.ZERO,Qct),s=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_Y,lxe),lxe),a=sn.fromPointNormal(o,s,elt),c=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_X,uxe),uxe),u=sn.fromPointNormal(o,c,tlt),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=_i.lineSegmentPlane(d,m,a,nlt);if(l(y)){let A=h.multiplyByScalar(s,5e-9,ilt);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}};au.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],JZ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,PA);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+=au.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=olt(y,A,s,i,b,x,f,d)}$Z.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,HH);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,PA);return h.pack(m,f,u-3),f};var fxe=new he,alt=new he;au.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],JZ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,PA);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],fxe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],alt),a+=au.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,fxe);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=slt(b,x,s,i,T,E,p,g)}$Z.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,HH);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,PA);return h.pack(A,p,d-3),p};au.generateCartesianArc=function(e){let t=au.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};au.generateCartesianRhumbArc=function(e){let t=au.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=au;function Wf(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=Qi.fromType(Qi.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(mxe),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 hxe=Wf.POSITION_INDEX=0,clt=Wf.SHOW_INDEX=1,llt=Wf.WIDTH_INDEX=2,ult=Wf.MATERIAL_INDEX=3,UB=Wf.POSITION_SIZE_INDEX=4,flt=Wf.DISTANCE_DISPLAY_CONDITION=5,mxe=Wf.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(Wf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,s_(this,clt))}},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,UB),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),s_(this,hxe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,s_(this,ult))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,s_(this,llt))}},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,UB)}}},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){jt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),s_(this,flt))}}});Wf.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[hxe]>0||this._propertiesChanged[UB]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=ir.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)s_(this,UB);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){s_(this,UB);break}}};Wf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Wf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<mxe-1;++t)e[t]=0};Wf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Kd=Wf;var dlt=Kd.SHOW_INDEX,hlt=Kd.WIDTH_INDEX,QZ=Kd.POSITION_INDEX,mlt=Kd.MATERIAL_INDEX,pxe=Kd.POSITION_SIZE_INDEX,plt=Kd.DISTANCE_DISPLAY_CONDITION,Txe=Kd.NUMBER_OF_PROPERTIES,Xu={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 Tm(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(Txe),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(Tm.prototype,{length:{get:function(){return eQ(this),this._polylines.length}}});Tm.prototype.add=function(e){let t=new Kd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Tm.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};Tm.prototype.removeAll=function(){tQ(this),wxe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Tm.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Tm.prototype.get=function(e){return eQ(this),this._polylines[e]};function glt(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 xx(t,n,e._polylines.length)}var Exe=new Sn,Cxe=new se,vxe=new U;Tm.prototype.update=function(e){if(eQ(this),this._polylines.length===0||!this.show)return;Tlt(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.");glt(this,t),this._createBatchTable=!1}if(this._createVertexArray||ylt(this))yxe(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[pxe]||r[mlt])yxe(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[QZ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[dlt]||r[hlt])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[QZ]||r[pxe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,Exe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,Cxe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[plt]){let m=vxe;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<Txe;++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;_lt(this,e,c,o)}};var zB=new ue,gxe=new ue;function _lt(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=blt(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=ue.clone(zB,_.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=ue.clone(P._boundingVolume2D,gxe),B.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(B=ue.union(P._boundingVolumeWC,P._boundingVolume2D,gxe)),c?(c=!1,ue.clone(B,zB)):ue.union(B,zB,zB)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(zB,_.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}Tm.prototype.isDestroyed=function(){return!1};Tm.prototype.destroy=function(){return Sxe(this),tQ(this),wxe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function ylt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[QZ]?(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 _xe=[0,0,0];function yxe(e,t,n){e._createVertexArray=!1,tQ(e),Sxe(e),xlt(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=nt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=nt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=nt.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=nt.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:Xu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Xu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Xu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Xu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Xu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Xu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Xu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Xu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Xu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Xu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Xu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Xu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Xu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=_xe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=_xe,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 Alt(e,t){return t instanceof Dt?t.id:t}var GH=[];function blt(e){let t=Qi._uniformList[e.type],n=t.length;GH.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];GH[i]=o,GH[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(GH,Alt)}`}function xlt(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 t0(c,t,n)),u.addPolyline(a)}}}function Tlt(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 eQ(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 tQ(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 Sxe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Tm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function wxe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function ZZ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function t0(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}t0.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};t0.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,wx]}),o=t.getVertexShaderCallback()(BB),s=new Ye({defines:i,sources:[Hl,o]});this.shaderProgram=en.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Xu})};function Ixe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}t0.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!Ixe(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 Ea=new h,$d=new h,Jd=new h,WH=new h,Elt=new se,Clt=new U;t0.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=WH,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,$d),h.clone(x[V],Ea),V===E-1?g._loop?R=x[1]:(R=WH,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,Jd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&($d.z=0,Ea.z=0,Jd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(Ea.x)<1&&((Ea.x<0&&$d.x>0||Ea.x>0&&$d.x<0)&&h.clone(Ea,$d),(Ea.x<0&&Jd.x>0||Ea.x>0&&Jd.x<0)&&h.clone(Ea,Jd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(Ea,e,n),Sn.writeElements($d,e,n+6),Sn.writeElements(Jd,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=Elt;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=Clt;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,Exe),w=C.high,P=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,Cxe),M=vxe;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 vlt=new h,Slt=new h,wlt=new h,Axe=new h;t0.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=Axe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,Slt);let m=N.multiplyByPoint(n,a[p],vlt),y;p===u-1?s._loop?y=a[1]:(y=Axe,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,wlt);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 Ilt=new Array(1);t0.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new ZZ(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=Ilt;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 ZZ(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 ZZ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};t0.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 tw={positions:void 0,lengths:void 0},bxe=new Array(1),Plt=new h,Dlt=new he;t0.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return bxe[0]=n.length,tw.positions=n,tw.lengths=bxe,tw;Ixe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Plt;for(let u=0;u<s;++u)a=n[u],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,Dlt)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return tw.positions=r,tw.lengths=e._segments.lengths,tw};var xxe;t0.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=xxe,c=6*s*3;!l(a)||a.length<c?a=xxe=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=WH,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,$d),h.clone(f[A],Ea),A===s-1?t._loop?y=f[1]:(y=WH,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,Jd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&($d.z=0,Ea.z=0,Jd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(Ea.x)<1&&((Ea.x<0&&$d.x>0||Ea.x>0&&$d.x<0)&&h.clone(Ea,$d),(Ea.x<0&&Jd.x>0||Ea.x>0&&Jd.x<0)&&h.clone(Ea,Jd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(Ea,a,p),Sn.writeElements($d,a,p+6),Sn.writeElements(Jd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Em=Tm;function DA(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 Gf({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new e0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Em,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(DA.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 Rlt(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 Olt=new Jn("createVectorTilePoints",5),Mlt=new h;function Nlt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Rlt(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=Olt.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,Mlt),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)})}DA.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 r_(e,c,u,f,d)}};DA.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 Llt(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=r_.defaultPointSize,s.color=r_.defaultColor,s.pointOutlineColor=r_.defaultPointOutlineColor,s.pointOutlineWidth=r_.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Ao.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=zi.CENTER,s.verticalOrigin=Hn.CENTER,s.labelHorizontalOrigin=zi.RIGHT,s.labelVerticalOrigin=Hn.BASELINE}}var Flt=new z,Blt=new z,klt=new z,Ult=new z,zlt=new z,Vlt=new z,VB=new qt,jB=new qt,nQ=new jt;DA.prototype.applyStyle=function(e,t){if(!l(e)){Llt(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,Flt)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Blt)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,klt)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Ult)),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,zlt)),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)?(VB.near=a.x,VB.nearValue=a.y,VB.far=a.z,VB.farValue=a.w,s.scaleByDistance=VB):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(jB.near=a.x,jB.nearValue=a.y,jB.far=a.z,jB.farValue=a.w,s.translucencyByDistance=jB):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(nQ.near=a.x,nQ.far=a.y,s.distanceDisplayCondition=nQ):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,Vlt)),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))}};DA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Nlt(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)};DA.prototype.isDestroyed=function(){return!1};DA.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(),le(this)};var HB=DA;function a_(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=Qn.BOTH}Object.defineProperties(a_.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 jlt(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 Hlt(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=Qt.unpack(t,n),n+=Qt.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 zp({color:c,offset:u,count:f,batchIds:p})}}var Glt=new Jn("createVectorTilePolygons",5),Wlt=new z;function qlt(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,Wlt);s[y]=A.toRgba()}a=e._packedBuffer=jlt(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=Glt.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];Hlt(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),Ylt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function Ylt(e){l(e._primitive)||(e._primitive=new Kx({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)}a_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};a_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};a_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};a_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};a_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=qlt(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)};a_.prototype.isDestroyed=function(){return!1};a_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var GB=a_;var WB=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; +uniform mat4 u_modifiedModelView; +void main() { -return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = u_modifiedModelView * currentPosition; +vec4 prev = u_modifiedModelView * previousPosition; +vec4 next = u_modifiedModelView * nextPosition; +float angle; +vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; } -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +`;function Cm(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(Cm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Xlt(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 Klt=new Jn("createVectorTilePolylines",5),nw={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function $lt(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=Xlt(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=Klt.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),Jlt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Jlt(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=nt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=nt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=nt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=nt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=nt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=nt.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 qB=new N,Pxe=new h;function Zlt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,qB),N.multiplyByPoint(qB,e._center,Pxe),N.setTranslation(qB,Pxe,qB),qB},u_highlightColor:function(){return e._highlightColor}})}function Qlt(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 eut=`uniform vec4 u_highlightColor; +void main() { -vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); -vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; -return color; + out_FragColor = u_highlightColor; } -#ifdef HAS_NORMAL_TEXTURE -vec2 getNormalTexCoords() +`;function tut(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(WB),r=n.getFragmentShaderCallback(!1,void 0,!1)(eut),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Hl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=en.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:nw})}function nut(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)}Cm.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};Cm.prototype.getPositions=function(e){return Cm.getPolylinePositions(this,e)};Cm.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 na(e,o)}};Cm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function iut(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 rut=new z,out=z.WHITE,sut=!0;Cm.prototype.applyStyle=function(e,t){if(!l(e)){iut(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,rut):out,s.show=l(e.show)?e.show.evaluate(s):sut}};Cm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=$lt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Zlt(this,t),tut(this,t),Qlt(this);let n=e.passes;(n.render||n.pick)&&nut(this,e)};Cm.prototype.isDestroyed=function(){return!1};Cm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var RT=Cm;var YB=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; +void main() { -vec2 texCoord = TEXCOORD_NORMAL; -#ifdef HAS_NORMAL_TEXTURE_TRANSFORM -texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); -#endif -return texCoord; +float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); +float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); +vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; +vec3 right = normalize(cross(forward, startEllipsoidNormal)); +vec4 position = vec4(startPositionAndHeight.xyz, 1.0); +position.xyz += forward * isEnd; +v_volumeUpEC = czm_normal * normalize(cross(right, forward)); +float offset; +vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); +offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); +offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; +position.xyz += offset * ellipsoidNormal; +position = u_modifiedModelView * position; +right = czm_normal * right; +vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); +scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); +vec3 miterPushNormal = czm_normal * normalize(scratchNormal); +offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); +offset = offset / dot(miterPushNormal, right); +position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); +gl_Position = czm_depthClamp(czm_projection * position); +position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); +vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; +v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); +v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); +position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); +vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; +v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); +v_halfWidth = endFaceNormalAndHalfWidth.w; } -#endif -#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) -vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +`;var XB=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; +uniform vec4 u_highlightColor; +void main() { -vec2 tex_dx = dFdx(normalTexCoords); -vec2 tex_dy = dFdy(normalTexCoords); -float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; -vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); -return tangent / determinant; +float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); +if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -#endif -#ifdef USE_ANISOTROPY -struct NormalInfo { -vec3 tangent; -vec3 bitangent; -vec3 normal; -vec3 geometryNormal; -}; -NormalInfo getNormalInfo(ProcessedAttributes attributes) -{ -vec3 geometryNormal = attributes.normalEC; -#ifdef HAS_NORMAL_TEXTURE -vec2 normalTexCoords = getNormalTexCoords(); -#endif -#ifdef HAS_BITANGENTS -vec3 tangent = attributes.tangentEC; -vec3 bitangent = attributes.bitangentEC; -#else // Assume HAS_NORMAL_TEXTURE -vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); -tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); -vec3 bitangent = normalize(cross(geometryNormal, tangent)); -#endif -#ifdef HAS_NORMAL_TEXTURE -mat3 tbn = mat3(tangent, bitangent, geometryNormal); -vec3 normalSample; -#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; -#endif -vec3 normal = normalize(tbn * normalSample); -#else -vec3 normal = geometryNormal; -#endif -#ifdef HAS_DOUBLE_SIDED_MATERIAL -if (czm_backFacing()) { -tangent *= -1.0; -bitangent *= -1.0; -normal *= -1.0; -geometryNormal *= -1.0; +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +eyeCoordinate /= eyeCoordinate.w; +float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); +halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); +float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); +float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); +float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); +if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -#endif -NormalInfo normalInfo; -normalInfo.tangent = tangent; -normalInfo.bitangent = bitangent; -normalInfo.normal = normal; -normalInfo.geometryNormal = geometryNormal; -return normalInfo; +out_FragColor = u_highlightColor; +czm_writeDepthClamp(); } -#endif -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ -vec2 normalTexCoords = getNormalTexCoords(); -#ifdef HAS_BITANGENTS -vec3 t = attributes.tangentEC; -vec3 b = attributes.bitangentEC; -#else -vec3 t = computeTangent(attributes.positionEC, normalTexCoords); -t = normalize(t - geometryNormal * dot(geometryNormal, t)); -vec3 b = normalize(cross(geometryNormal, t)); -#endif -mat3 tbn = mat3(t, b, geometryNormal); -vec3 normalSample; -#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 +`;function c_(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=Qt.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(c_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function aut(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;Qt.fromRectangle(c,r,o,n,a)}function cut(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 lut=new Jn("createVectorTileClampedPolylines"),RA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function uut(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=cut(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=lut.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),fut(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function fut(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=nt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=nt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=nt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=nt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=nt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=nt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=nt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=nt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:RA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:RA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:RA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:RA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:RA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:RA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:RA.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 KB=new N,Dxe=new h;function dut(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,KB),N.multiplyByPoint(KB,e._center,Dxe),N.setTranslation(KB,Dxe,KB),KB},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Rxe(e){return Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function hut(e){l(e._rs)||(e._rs=Rxe(!1),e._rs3DTiles=Rxe(!0))}function mut(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(YB),r=n.getFragmentShaderCallback(!1,void 0,!0)(XB),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Hl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=en.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:RA})}function put(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===Qn.TERRAIN||i===Qn.BOTH)&&t.commandList.push(n),(i===Qn.CESIUM_3D_TILE||i===Qn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}c_.prototype.getPositions=function(e){return RT.getPolylinePositions(this,e)};c_.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 na(e,o)}};c_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function gut(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 _ut=new z,yut=z.WHITE,Aut=!0;c_.prototype.applyStyle=function(e,t){if(!l(e)){gut(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,_ut):yut,s.show=l(e.show)?e.show.evaluate(s):Aut}};function but(e){return Mi.initialize().then(function(){aut(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}c_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=but(this).then(uut(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}dut(this,t),mut(this,t),hut(this);let n=e.passes;(n.render||n.pick)&&put(this,e)};c_.prototype.isDestroyed=function(){return!1};c_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var $B=c_;var iQ=32767,xut=new he,Tut=new h;function Eut(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/iQ),y=D.lerp(t.south,t.north,p/iQ),A=D.lerp(n,i,g/iQ),b=he.fromRadians(m,y,A,xut),x=r.cartographicToCartesian(b,Tut);h.pack(x,u,f*3)}return u}var JB=Eut;var oQ=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,Iut(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)||rQ(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)||rQ(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)||rQ(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(),le(this)}};function Cut(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function vut(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 vm=Uint32Array.BYTES_PER_ELEMENT;function Sut(e){return new RT(e)}function wut(e){return new $B(e)}function Iut(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=vm;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=vm;let s=r.getUint32(n,!0);if(n+=vm,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=vm,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=vm;let u=r.getUint32(n,!0);n+=vm;let f=r.getUint32(n,!0);n+=vm;let d=r.getUint32(n,!0);n+=vm;let p=r.getUint32(n,!0);n+=vm;let g=r.getUint32(n,!0);n+=vm,n+=vm;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 rm(e,v,A,b,Cut(e));if(e._batchTable=S,v===0)return;let I=new dm(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=vut(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 GB({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=JB(new Uint16Array(j),O,L,_,ee.WGS84);Put(q,F,P.polylines,S,e.url,k)}let G=Sut;l(M.classificationType)&&(G=wut),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 HB({positions:F,batchIds:P.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:M.heightReference,scene:M.scene})}}function rQ(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 Put(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 ZB=oQ;var{ERR_CAPACITY:Cti}=ra.Error,Dut=new h,qH=class qH extends ss{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Dut)),i}get vertexOffset(){return this._getUint32(qH.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(qH,"Layout",{...ss.Layout,POSITION_OFFSET_U32:ss.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ss.Layout.__BYTE_LENGTH+4});var sQ=qH,Bc=sQ;var QB=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; #else -normalSample = texture(u_normalTexture, normalTexCoords).rgb; -#endif -normalSample = 2.0 * normalSample - 1.0; -#ifdef HAS_NORMAL_TEXTURE_SCALE -normalSample.xy *= u_normalTextureScale; -#endif -return normalize(tbn * normalSample); -} +in vec3 position; #endif -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +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() { -vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM -normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); -#endif -#ifdef HAS_BITANGENTS -vec3 t = attributes.tangentEC; -vec3 b = attributes.bitangentEC; +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 -vec3 t = computeTangent(attributes.positionEC, normalTexCoords); -t = normalize(t - geometryNormal * dot(geometryNormal, t)); -vec3 b = normalize(cross(geometryNormal, t)); -#endif -mat3 tbn = mat3(t, b, geometryNormal); -vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; -normalSample = 2.0 * normalSample - 1.0; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE -normalSample.xy *= u_clearcoatNormalTextureScale; +vec4 positionEC = czm_modelView * vec4(position, 1.0); #endif -return normalize(tbn * normalSample); +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; } -#endif -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) +`;var e2=`in vec4 v_pickColor; +in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerRadiusFrac; +void main() { -vec3 normal = attributes.normalEC; -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -normal = getNormalFromTexture(attributes, normal); -#endif -#ifdef HAS_DOUBLE_SIDED_MATERIAL -if (czm_backFacing()) { -normal = -normal; +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; } -#endif -return normal; +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); } +`;var t2=class t2 extends Zl{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(t2,"Layout",{...Zl.Layout,SIZE_U8:Zl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Zl.Layout.__BYTE_LENGTH+4}),ut(t2,"DEFAULT_MATERIAL",Object.freeze(new t2));var aQ=t2,Sm=aQ;var cQ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},Oxe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},OT=new Bc,wm=new Sm,n2=new z,Mxe=new h,lQ=new Sn;function Rut(e,t,n){let i=t.context;n=n||{destroy:Out};let r=e._positionDatatype===Y.DOUBLE,o=r?cQ:Oxe;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,OT),OT._dirty&&(r&&(OT.getPosition(Mxe),Sn.fromCartesian(Mxe,lQ),h.pack(lQ.high,c,y*3),h.pack(lQ.low,u,y*3)),OT.getMaterial(wm),z.fromRgba(OT._pickId,n2),f[y*4]=z.floatToByte(n2.red),f[y*4+1]=z.floatToByte(n2.green),f[y*4+2]=z.floatToByte(n2.blue),f[y*4+3]=z.floatToByte(n2.alpha),d[y*4]=OT.show?1:0,d[y*4+1]=wm.size,d[y*4+2]=cn.encodeRGB8(wm.color),d[y*4+3]=wm.color.alpha,p[y*3]=wm.outlineWidth,p[y*3+1]=cn.encodeRGB8(wm.outlineWidth>0?wm.outlineColor:wm.color),p[y*3+2]=wm.outlineWidth>0?wm.outlineColor.alpha:wm.color.alpha,OT._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:cQ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:cQ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:Oxe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.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=en.fromCache({context:i,vertexShaderSource:new Ye({sources:[QB],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[e2]}),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 Out(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var i2=Rut;var uQ=class e extends ra{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Bc}_getMaterialClass(){return Sm}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Bc){return super.add(t,n),n._setUint32(Bc.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=i2(this,t,this._renderContext))}},Ku=uQ;var r2=`#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 -#ifdef HAS_BASE_COLOR_TEXTURE -vec4 getBaseColorFromTexture() +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() { -vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; -#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM -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)); +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 -baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); +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 -baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); -#endif -#ifdef HAS_BASE_COLOR_FACTOR -baseColorWithAlpha *= u_baseColorFactor; +vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); #endif -return baseColorWithAlpha; +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; } -#endif -#ifdef HAS_EMISSIVE_TEXTURE -vec3 getEmissiveFromTexture() +`;var o2=`in vec4 v_pickColor; +in vec4 v_color; +void main() { -vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; -#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM -emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); -#endif -vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); -#ifdef HAS_EMISSIVE_FACTOR -emissive *= u_emissiveFactor; -#endif -return emissive; -} -#endif -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -void setSpecularGlossiness(inout czm_modelMaterial material) +if (v_color.a < 0.005) { -#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE -vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; -#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM -specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); -#endif -vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); -vec3 specular = specularGlossiness.rgb; -float glossiness = specularGlossiness.a; -#ifdef HAS_LEGACY_SPECULAR_FACTOR -specular *= u_legacySpecularFactor; -#endif -#ifdef HAS_GLOSSINESS_FACTOR -glossiness *= u_glossinessFactor; -#endif -#else -#ifdef HAS_LEGACY_SPECULAR_FACTOR -vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); -#else -vec3 specular = vec3(1.0); -#endif -#ifdef HAS_GLOSSINESS_FACTOR -float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); -#else -float glossiness = 1.0; -#endif -#endif -#ifdef HAS_DIFFUSE_TEXTURE -vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; -#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM -diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); -#endif -vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); -#ifdef HAS_DIFFUSE_FACTOR -diffuse *= u_diffuseFactor; -#endif -#elif defined(HAS_DIFFUSE_FACTOR) -vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); -#else -vec4 diffuse = vec4(1.0); -#endif -material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); -material.alpha = diffuse.a; -material.specular = specular; -material.roughness = 1.0 - glossiness; +discard; } -#elif defined(LIGHTING_PBR) -float setMetallicRoughness(inout czm_modelMaterial material) +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var MT={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},YH={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},hl=new ya,s2=new Mf,a2=new z,Nxe=new h,Lxe=new h,Fxe=new h,fQ=new Sn,dQ=new Sn,hQ=new Sn;function Mut(e,t,n){let i=t.context;n=n||{destroy:Fut};let r=e._positionDatatype===Y.DOUBLE,o=r?MT:YH;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,hl),!hl._dirty)continue;hl.getMaterial(s2);let L=cn.encodeRGB8(s2.color),_=s2.color.alpha,C=f?-s2.width:s2.width;z.fromRgba(hl._pickId,a2);let w=hl.show,P=hl.vertexOffset*2,M=(hl.vertexOffset-R)*6,F=e._positionView,V=hl.vertexOffset*3;for(let B=0,j=hl.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,Nxe),h.fromElements(J,Z,ae,Lxe),h.fromElements(Ae,fe,xe,Fxe),Sn.fromCartesian(Nxe,fQ),Sn.fromCartesian(Lxe,dQ),Sn.fromCartesian(Fxe,hQ));for(let ge=0;ge<2;ge++)r?(h.pack(fQ.high,x,P*3),h.pack(fQ.low,T,P*3),h.pack(dQ.high,E,P*3),h.pack(dQ.low,v,P*3),h.pack(hQ.high,S,P*3),h.pack(hQ.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(a2.red),p[P*4+1]=z.floatToByte(a2.green),p[P*4+2]=z.floatToByte(a2.blue),p[P*4+3]=z.floatToByte(a2.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++}hl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Lut(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:nt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:MT.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:MT.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:MT.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:MT.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:MT.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:MT.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:YH.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:YH.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:YH.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:nt.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=en.fromCache({context:i,vertexShaderSource:new Ye({sources:[Hl,r2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[o2]}),attributeLocations:o}));let s=Nut(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 Nut(e){return(e.vertexCount-e.primitiveCount)*6}function Lut(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,hl);let i=hl.vertexOffset*2,o=(hl.vertexOffset-t)*6;e.get(t+n-1,hl);let s=(hl.vertexOffset+hl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function Fut(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var c2=Mut;var mQ=class e extends ra{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 ya}_getMaterialClass(){return Mf}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new ya){super.add(t,n);let i=this._positionCount;return n._setUint32(ya.Layout.POSITION_OFFSET_U32,i),n._setUint32(ya.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=c2(this,t,this._renderContext))}},ml=mQ;function iw(e,t){this._conditionsExpression=Je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,kut(this,t)}Object.defineProperties(iw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function But(e,t){this.condition=e,this.expression=t}function kut(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 But(new Ld(a,t),new Ld(c,t)))}e._runtimeConditions=n}iw.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)}};iw.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)}};iw.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} { -#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE -vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; -#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM -metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); -#endif -vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; -float metalness = clamp(metallicRoughness.b, 0.0, 1.0); -float roughness = clamp(metallicRoughness.g, 0.0, 1.0); -#ifdef HAS_METALLIC_FACTOR -metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); -#endif -#ifdef HAS_ROUGHNESS_FACTOR -roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); -#endif -#else -#ifdef HAS_METALLIC_FACTOR -float metalness = clamp(u_metallicFactor, 0.0, 1.0); -#else -float metalness = 1.0; -#endif -#ifdef HAS_ROUGHNESS_FACTOR -float roughness = clamp(u_roughnessFactor, 0.0, 1.0); -#else -float roughness = 1.0; -#endif -#endif -const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); -vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); -material.specular = f0; -material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); -material.roughness = roughness; -return metalness; +${o} return ${i}(1.0); +} +`,o};iw.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];ti(e,r.condition.getVariables()),ti(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var l2=iw;function OA(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,Uut(this,e)}function Uut(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 Ld(r[o],i))}e._meta=n,e._ready=!0}function bo(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Ld(String(t));if(typeof t=="string")return new Ld(t,n);if(l(t.conditions))return new l2(t,n)}else return;return t}function xo(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(OA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=bo(this,e),this._style.show=xo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=bo(this,e),this._style.color=xo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=bo(this,e),this._style.pointSize=xo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=bo(this,e),this._style.pointOutlineColor=xo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=bo(this,e),this._style.pointOutlineWidth=xo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=bo(this,e),this._style.labelColor=xo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=bo(this,e),this._style.labelOutlineColor=xo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=bo(this,e),this._style.labelOutlineWidth=xo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=bo(this,e),this._style.font=xo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=bo(this,e),this._style.labelStyle=xo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=bo(this,e),this._style.labelText=xo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=bo(this,e),this._style.backgroundColor=xo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=bo(this,e),this._style.backgroundPadding=xo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=bo(this,e),this._style.backgroundEnabled=xo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=bo(this,e),this._style.scaleByDistance=xo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=bo(this,e),this._style.translucencyByDistance=xo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=bo(this,e),this._style.distanceDisplayCondition=xo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=bo(this,e),this._style.heightOffset=xo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=bo(this,e),this._style.anchorLineEnabled=xo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=bo(this,e),this._style.anchorLineColor=xo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=bo(this,e),this._style.image=xo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=bo(this,e),this._style.disableDepthTestDistance=xo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=bo(this,e),this._style.horizontalOrigin=xo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=bo(this,e),this._style.verticalOrigin=xo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=bo(this,e),this._style.labelHorizontalOrigin=xo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=bo(this,e),this._style.labelVerticalOrigin=xo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=bo(this,e),this._style.lineWidth=xo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});OA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new OA(n)})};OA.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)};OA.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)};OA.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)};OA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ti(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ti(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ti(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var l_=OA;var Uxe=new ie,Bxe=new ie,pQ=new ie,XH=new Map;XH.set(ml,{packCollectionData:Es.packPolylineCollectionData,packTilePrimitives:Es.packPolylineSegments});XH.set(Ua,{packCollectionData:Es.packPolygonCollectionData,packTilePrimitives:Es.packPolygonRings});var gQ=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 XH.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,Uxe);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:zut(t,r.ellipsoid)};for(let[u,f]of o){if(!kxe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,Bxe);if(!!!ie.intersection(t,d,pQ))continue;let g=XH.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&&(Es.packPolylineGrid(s),Es.packPolylineTextures(n,s)),c&&(Es.packPolygonGrid(s),Es.packPolygonTextures(n,s)),Es.packPrimitiveTextures(n,s),s)}releaseTileData(t){Es.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Vut(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(!kxe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,Bxe),f=!!ie.intersection(n,u,pQ),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 kxe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function zut(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 Vut(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,Uxe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],pQ))return!0;return!1}var u_=gQ;var zxe=new Bc,Vxe=new ya,jxe=new Mo,jut=new Sm,Hut=new Mf,Gut=new Of,_Q=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 na.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(Ku,zxe),yield*this._iteratePrimitivesWith(ml,Vxe),yield*this._iteratePrimitivesWith(Ua,jxe)}*_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(Ku,zxe,jut)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ml,Vxe,Hut)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Ua,jxe,Gut)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},NT=_Q;var Hxe=new h,Wut=new Bc,qut=new ya,Wxe=new Mo;function Yut(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)qxe(e,n[r],N.IDENTITY,i);return i}function KH(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function Xut(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?ba.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:Gxe(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=Gxe(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 Gxe(e){let t=KH(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Kut(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?ba.readAttributeAsRawCompactTypedArray(o):ba.readAttributeAsTypedArray(o)),a=t.indices?ba.readIndicesAsTypedArray(t.indices):void 0,c=$ut(e,t,r);n instanceof Ku?Jut(n,i,s,a,c):n instanceof ml?Zut(n,i,s,a,c):n instanceof Ua&&(l(t.vector)?Qut(n,i,s,a,c,t.vector):eft(n,i,s,c,t.polygon))}function $ut(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??ba.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new NT(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function Jut(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,Hxe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:Hxe,pickObject:u,featureId:u?.featureId},Wut)}}function Zut(e,t,n,i,r){let o=KH(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=Yxe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},qut),s=u+1,a=0,c++}}function Qut(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},Wxe)}}function eft(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=KH(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=Yxe(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},Wxe)}}function qxe(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=Xut(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new Ku({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new ml({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new Ua({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),Kut(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)qxe(e,a[c],o,i)}function Yxe(e,t,n,i){let r=KH(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 u2=Yut;var $H=new Bc,JH=new ya,ZH=new Mo,f2=new Sm,yQ=new Mf,Xxe=new Of,Kxe=new N,AQ=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 Ku).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Ua?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 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 l_({color:i}))}applyStyle(t){let n=o=>o instanceof Ku,i=o=>o instanceof ml,r=o=>o instanceof Ua;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,$H);let u=this.getFeature($H.featureId,s);l(t.show)&&($H.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,f2.color),l(t.pointSize)&&(f2.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(f2.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,f2.outlineColor),$H.setMaterial(f2)}}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,JH);let u=this.getFeature(JH.featureId,s);l(t.show)&&(JH.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,yQ.color),l(t.lineWidth)&&(yQ.width=t.lineWidth.evaluate(u)),JH.setMaterial(yQ)}}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,ZH);let u=this.getFeature(ZH.featureId,s);l(t.show)&&(ZH.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Xxe.color),ZH.setMaterial(Xxe)}}}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&&(nft(this),this._ready=!0)}N.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,Kxe);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(Kxe,this._collectionLocalMatrices[s],a.modelMatrix),!_s(i._heightReference)||!u_.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,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=tft(t,n,o,r),a=await jf.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function tft(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 nft(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=u2(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var MA=AQ;function dc(){}dc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);dc._sorterTaskProcessor=void 0;dc._taskProcessorReady=!1;dc._error=void 0;dc._getSorterTaskProcessor=function(){if(!l(dc._sorterTaskProcessor)){let e=new Jn("gaussianSplatSorter",dc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?dc._taskProcessorReady=!0:dc._error=new oe("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 LT=dc;function hc(){}hc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);hc._textureTaskProcessor=void 0;hc._taskProcessorReady=!1;hc._error=void 0;hc._getTextureTaskProcessor=function(){if(!l(hc._textureTaskProcessor)){let e=new Jn("gaussianSplatTextureGenerator",hc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?hc._taskProcessorReady=!0:hc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{hc._error=t}),hc._textureTaskProcessor=e}return hc._textureTaskProcessor};hc.generateFromAttributes=function(e){let t=hc._getTextureTaskProcessor();if(l(hc._error))throw hc._error;if(!hc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var d2=hc;function ift(e){let t=new e_;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:ac.LESS_OR_EQUAL}})),this.alphaOptions=new bT,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var h2=ift;var m2=`#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; } -#ifdef USE_SPECULAR -void setSpecular(inout czm_modelMaterial material, in float metalness) -{ -#ifdef HAS_SPECULAR_TEXTURE -vec2 specularTexCoords = TEXCOORD_SPECULAR; -#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM -specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); -#endif -float specularWeight = texture(u_specularTexture, specularTexCoords).a; -#ifdef HAS_SPECULAR_FACTOR -specularWeight *= u_specularFactor; -#endif -#else -#ifdef HAS_SPECULAR_FACTOR -float specularWeight = u_specularFactor; -#else -float specularWeight = 1.0; -#endif -#endif -#ifdef HAS_SPECULAR_COLOR_TEXTURE -vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; -#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM -specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); -#endif -vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; -vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); -#ifdef HAS_SPECULAR_COLOR_FACTOR -specularColorFactor *= u_specularColorFactor; -#endif -#else -#ifdef HAS_SPECULAR_COLOR_FACTOR -vec3 specularColorFactor = u_specularColorFactor; -#else -vec3 specularColorFactor = vec3(1.0); -#endif -#endif -material.specularWeight = specularWeight; -vec3 f0 = material.specular; -vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); -material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); +} +} +return result; } #endif -#ifdef USE_ANISOTROPY -void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) -{ -mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); -float anisotropyStrength = u_anisotropy.z; -vec2 direction = vec2(1.0, 0.0); -#ifdef HAS_ANISOTROPY_TEXTURE -vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; -#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM -anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); -#endif -vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; -direction = anisotropySample.rg * 2.0 - vec2(1.0); -anisotropyStrength *= anisotropySample.b; -#endif -direction = rotation * direction; -mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); -vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); -vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); -material.anisotropicT = anisotropicT; -material.anisotropicB = anisotropicB; -material.anisotropyStrength = anisotropyStrength; +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 -#ifdef USE_CLEARCOAT -void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +v_splitDirection = u_splitDirection; +} +`;var p2=`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 FT=new N,tTe=new N,g2=new N,vi=new $,_2=new Le,rft=new h,oft=new Le,sft=new h,aft=1e-12,QH=1e-5,bQ=1e-7,Wa={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"},cft=2,lft=30,uft=3,fft=.008726646259971648,dft=1;function hft(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<uft)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=dft?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=fft:!1}function $xe(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 mft(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 Jxe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function xQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function Zxe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function pft(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 gft(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function _ft(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=gft(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 yft(e,t){return e.length===t?e:e.subarray(0,t)}function Aft(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&&Zxe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&Zxe(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=Wa.IDLE,e._dirty=!1}async function bft(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=Ys.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=eTe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=eTe(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=Tft(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 xft(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,Aft(e,c,t),e._pendingSnapshot=void 0,cu.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=Wa.ERROR,e._sorterError=r}}async function Qxe(e,t,n){try{let i=await n,r=Jxe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Wa.IDLE);return}e._indexes=i,e._sorterState=Wa.SORTED}catch(i){if(!Jxe(e,t))return;e._sorterState=Wa.ERROR,e._sorterError=i}}function Tft(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:Ht.NEAREST})}function eTe(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:Ht.NEAREST})}function cu(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=Vo.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(Hi.Y,Hi.X,new N),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Wa.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(cu.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)}}});cu.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)};cu.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,xQ(this._pendingSnapshot),xQ(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),le(this)};cu.prototype.isDestroyed=function(){return this._isDestroyed};cu.prototype.onTileLoad=function(e){this._dirty=!0};cu.prototype.onTileVisible=function(e){};cu.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,FT);N.multiplyTransformation(o,e.content.worldTransform,o);let s=N.inverse(r,tTe),a=N.multiplyTransformation(s,o,FT),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&N.equalsEpsilon(a,c,aft))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)<=bQ&&Math.abs(g-1)<=bQ&&Math.abs(m-1)<=bQ,T=Math.abs(y)<=QH&&Math.abs(A)<=QH&&Math.abs(b)<=QH,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)<=QH;Le.fromRotationMatrix(vi,_2),Le.normalize(_2,_2);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=rft,L=oft,_=sft;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(_2,L,L),Le.normalize(L,L)):(N.fromTranslationQuaternionRotationScale(O,L,_,g2),N.multiplyTransformation(a,g2,g2),N.getTranslation(g2,O),N.getScale(g2,_),Le.multiply(_2,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};cu.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ys.BUILDING)return;n.state=Ys.TEXTURE_PENDING;let i=d2.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}bft(e,t,n,i)};cu.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new h2(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(m2),r.addFragmentLines(p2);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 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 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};cu.prototype.update=function(e){let t=this._tileset;if(pft(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===Wa.IDLE){let r=t._selectedTiles.length!==0&&mft(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>=cft,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>=lft;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=Wa.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&xQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=N.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,tTe);N.multiplyTransformation(v,E.content.worldTransform??N.IDENTITY,v),N.getRotation(N.inverse(v,v),this._shInverseRotation)}for(let E of u)cu.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=_ft(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 yft(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){cu.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,FT),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=LT.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(FT),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;xft(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,FT),!l(this._sorterPromise)){if(!hft(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=LT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(FT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){$xe(this,e);let g=this._activeSort;this._sorterState=Wa.SORTING,Qxe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Wa.WAITING;return}this._sorterState=Wa.SORTING;return}else if(this._sorterState===Wa.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=LT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(FT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){$xe(this,e);let c=this._activeSort;this._sorterState=Wa.SORTING,Qxe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Wa.WAITING;return}this._sorterState=Wa.SORTING;return}else{if(this._sorterState===Wa.SORTING)return;if(this._sorterState===Wa.SORTED)cu.buildGSplatDrawCommand(this,e),this._sorterState=Wa.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Wa.ERROR)throw this._sorterError}this._dirty=!1}};var y2=cu;var EQ=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 y2({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")&&qr("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 Lf(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}=Cft(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Ift(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),le(this)}};function Eft(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Cft(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 nTe=new ArrayBuffer(4),vft=new Float32Array(nTe),Sft=new Uint32Array(nTe);function TQ(e){vft[0]=e;let t=Sft[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 wft(e){let t=Eft(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 Ift(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}=wft(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]=TQ(o[u].typedArray[y])|TQ(o[u].typedArray[y+1])<<16,r[m+1]=TQ(o[u].typedArray[y+2])}}return r}var NA=EQ;var iTe={b3dm:function(e,t,n,i,r){return Hf.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Hf.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Hf.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return GM.fromTileType(e,t,n,i,r,iTe)},externalTileset:function(e,t,n,i){return IB.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new YM(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new ZB(e,t,n,i,r)},subt:function(e,t,n,i,r){return rS.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return rS.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 NA.tilesetRequiresGaussianSplattingExt(e)?NA.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?MA.fromGltf(e,t,n,c):Hf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return NA.tilesetRequiresGaussianSplattingExt(e)?NA.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?MA.fromGltf(e,t,n,i):Hf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Hf.fromGeoJson(e,t,n,i)}},BT=iTe;var rTe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(rTe);var Rr=rTe;var Zd={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"};Zd.isBinaryFormat=function(e){switch(e){case Zd.BATCHED_3D_MODEL:case Zd.INSTANCED_3D_MODEL:case Zd.COMPOSITE:case Zd.POINT_CLOUD:case Zd.VECTOR:case Zd.GEOMETRY:case Zd.IMPLICIT_SUBTREE:case Zd.VOXEL_BINARY:case Zd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Zd);var Ca=Zd;var oTe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(oTe);var Qd=oTe;var va={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},f_=new Array(va.NUMBER_OF_PASSES);f_[va.RENDER]=Object.freeze({pass:va.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});f_[va.PICK]=Object.freeze({pass:va.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});f_[va.SHADOW]=Object.freeze({pass:va.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});f_[va.PRELOAD]=Object.freeze({pass:va.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});f_[va.PRELOAD_FLIGHT]=Object.freeze({pass:va.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});f_[va.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:va.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});f_[va.MOST_DETAILED_PRELOAD]=Object.freeze({pass:va.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});f_[va.MOST_DETAILED_PICK]=Object.freeze({pass:va.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});va.getPassOptions=function(e){return f_[e]};Object.freeze(va);var ao=va;var CQ=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 le(this)}},n0=CQ;function d_(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(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 Yn.hasProperty(e,this._properties,this._class)};d_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};d_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};d_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};d_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};d_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};d_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var A2=d_;function vQ(e,t){let n=tr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){vQ._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 A2({content:n,class:r})}}vQ._oneTimeWarning=_t;var kT=vQ;function Pft(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=tr(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 UT=Pft;function h_(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(h_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});h_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};h_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};h_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};h_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};h_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};h_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};h_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var b2=h_;function SQ(e,t){let n=tr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){SQ._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 b2({tile:n,class:r})}}SQ._oneTimeWarning=_t;var x2=SQ;function Dft(e){let t=new Uint8Array(e),n=im(t);if(n==="glTF"&&(n="glb"),Ca.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Rft(t);if(l(i.root))return{contentType:Ca.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ca.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ca.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ca.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ca.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Rft(e){let t;try{t=Ro(e)}catch{throw new oe("Invalid tile content.")}return t}var m_=Dft;var wQ=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(!Oft(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;IQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Mft(this,i,n,this._tile._contentState);return Nft(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 le(this)}};function IQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function sTe(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 Oft(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 Mft(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){sTe(e,i);return}return IQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){sTe(e,i);return}IQ(e,-1),aTe(e,t,f)}})}async function Nft(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>Lft(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 Lft(e,t,n){if(l(t))try{let i=m_(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===Ca.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ca.GEOMETRY||i.contentType===Ca.VECTOR;let a,c=BT[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=kT(r,u));let f=UT(r,u);return l(f)&&(a.group=new Wx({metadata:f})),a}catch(i){aTe(e,n,i)}}function aTe(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 T2=wQ;var cTe=Math.cos,lTe=Math.sin,Fft=Math.sqrt,PQ={};PQ.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=cTe(f),p=lTe(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*cTe(m),A=d*lTe(m),b=a.x*y,x=a.y*A,T=Fft(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 Bft=new Xi,eh=new h,kft=new he,eG=new h,E2=new Ui;function uTe(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;E2._ellipsoid=ee.default,eh=E2.project(e,eh),eh=h.subtract(eh,eG,eh);let g=Xi.fromRotation(t,Bft);eh=Xi.multiplyByVector(g,eh,eh),eh=h.add(eh,eG,eh),e=E2.unproject(eh,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}}PQ.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,kft);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=D.TWO_PI),E2._ellipsoid=ee.default,eG=E2.project(E,eG));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 _=uTe(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=uTe(_,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 Sa=PQ;var Uft=new ue,zft=new ue,Vft=new h,jft=new ie;function fTe(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=Vft;if(o)Sa.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++)Sa.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++)Sa.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--)Sa.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--)Sa.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 Hft(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=fTe(e,t),s=t.height,a=t.width,c=fi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=fi.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 ow(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"}ow.packedLength=ie.packedLength+ee.packedLength+5;ow.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 dTe=new ie,hTe=ee.clone(ee.UNIT_SPHERE),rw={rectangle:dTe,ellipsoid:hTe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};ow.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,dTe);t+=ie.packedLength;let r=ee.unpack(e,t,hTe);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):(rw.granularity=o,rw.height=s,rw.rotation=a,rw.extrudedHeight=c,rw.offsetAttribute=u===-1?void 0:u,new ow(rw))};var Gft=new he;ow.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Sa.computeOptions(t,e._granularity,e._rotation,0,jft,Gft),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=Hft(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=ue.fromRectangle3D(t,n,s,zft),d=ue.fromRectangle3D(t,n,a,Uft);o=ue.union(f,d)}else{if(r=fTe(e,i),r.attributes.position.values=fi.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=ue.fromRectangle3D(t,n,s)}return new St({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var zT=ow;function aw(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;Kft(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(aw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});aw.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Qt.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var mTe=new h,tG=new h,pTe=new h,Wft=new h,qft=new h,Yft=new h,Xft=new h,th=new he,gTe=new sn(h.UNIT_X,0),sw=new pn;function Kft(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),th.longitude=t.west,th.latitude=(t.south+t.north)*.5,th.height=0;let i=n.cartographicToCartesian(th,Yft),r=h.cross(i,h.UNIT_Z,Wft);h.normalize(r,e.westNormal),th.longitude=t.east;let o=n.cartographicToCartesian(th,Xft),s=h.cross(h.UNIT_Z,o,mTe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,mTe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,qft),u=t.south,f;if(u>0){th.longitude=(t.west+t.east)*.5,th.latitude=u;let y=n.cartographicToCartesian(th,sw.origin);h.clone(c,sw.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,gTe);_i.rayPlane(sw,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,tG)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),tG);let d=h.cross(f,a,pTe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){th.longitude=(t.west+t.east)*.5,th.latitude=p;let y=n.cartographicToCartesian(th,sw.origin);h.negate(c,sw.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,gTe);_i.rayPlane(sw,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,tG)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),tG);let m=h.cross(a,g,pTe);h.normalize(m,e.northNormal)}var $ft=new h,Jft=new h,Zft=new h(0,-1,0),Qft=new h(0,0,-1),_Te=new h;function edt(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),$ft),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),Jft),f.z=f.y,f.y=f.x,f.x=0,d=Zft,g=h.UNIT_Y,p=Qft,m=h.UNIT_Z);let y=h.subtract(i,u,_Te),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,_Te),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)}aw.prototype.distanceToCamera=function(e){let t=edt(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};aw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};aw.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new zT({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 On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var qf=aw;var C2={},tdt=new h,yTe=new h,ATe=new h,bTe=new h,xTe=new Qt;C2.validOutline=function(e){let n=Qt.fromPoints(e,xTe).halfAxes,i=$.getColumn(n,0,yTe),r=$.getColumn(n,1,ATe),o=$.getColumn(n,2,bTe),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};C2.computeProjectTo2DArguments=function(e,t,n,i){let r=Qt.fromPoints(e,xTe),o=r.halfAxes,s=$.getColumn(o,0,yTe),a=$.getColumn(o,1,ATe),c=$.getColumn(o,2,bTe),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 TTe(e,t,n,i,r){let o=h.subtract(e,t,tdt),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}C2.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=TTe(i[o],e,t,n);return r}};C2.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return TTe(i,e,t,n,r)}};var p_=C2;function ndt(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 VT(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+1}VT.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new VT(t)};VT.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var idt={polygonHierarchy:{}};VT.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new VT(idt)),n._polygonHierarchy=i,n.packedLength=r,n};VT.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Fr(n,h.equalsEpsilon,!0),n.length<3||!p_.validOutline(n))return;let r=ni.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Ft({geometry:ndt(r[c])});o.push(u)}let s=Gn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new St({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var nh=VT;var nG=new he;function v2(e){let t=Pg.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=ddt(t,n,i,r);this._boundingPlanes=o;let s=gdt(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=BQ(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]=BQ(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=BQ(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();nG=r.cartesianToCartographic(c,nG),nG.height=(i+n)/2,this.center=r.cartographicToCartesian(nG,c),this._boundingSphere=ue.fromPoints(s)}var rdt=new h,odt=new he,sdt=new h,adt=new he,cdt=new h,ldt=new h,udt=new h,fdt=new h;function ddt(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,rdt),a=i.cartesianToCartographic(o,odt);a.height=n;let c=i.cartographicToCartesian(a,sdt),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,adt),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,cdt));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,ldt),x=h.subtract(A,g,fdt),T=h.cross(x,b,udt);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var jT=new h,HT=new h,GT=new h,DQ=new h,RQ=new h,OQ=new h,hdt=new h,mdt=new h,pdt=new h,MQ=new h,NQ=new h,LQ=new h,LA=new h,i0=new $;function ETe(e,t,n){jT=e.normal,HT=t.normal,GT=n.normal,DQ=h.multiplyByScalar(e.normal,-e.distance,DQ),RQ=h.multiplyByScalar(t.normal,-t.distance,RQ),OQ=h.multiplyByScalar(n.normal,-n.distance,OQ),MQ=h.multiplyByScalar(h.cross(HT,GT,hdt),h.dot(DQ,jT),MQ),NQ=h.multiplyByScalar(h.cross(GT,jT,mdt),h.dot(RQ,HT),NQ),LQ=h.multiplyByScalar(h.cross(jT,HT,pdt),h.dot(OQ,GT),LQ),i0[0]=jT.x,i0[1]=HT.x,i0[2]=GT.x,i0[3]=jT.y,i0[4]=HT.y,i0[5]=GT.y,i0[6]=jT.z,i0[7]=HT.z,i0[8]=GT.z;let i=$.determinant(i0);return LA=h.add(MQ,NQ,LA),LA=h.add(LA,LQ,LA),new h(LA.x/i,LA.y/i,LA.z/i)}function gdt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=ETe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=ETe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var FQ=new h,cw=new h;function BQ(e,t){let n=[];for(let i=0;i<4;i++)FQ=h.subtract(t[(i+1)%4],t[i],FQ),cw=h.cross(e.normal,FQ,cw),cw=h.normalize(cw,cw),n[i]=h.clone(cw);return n}Object.defineProperties(v2.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var kQ=new h;v2.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=UQ(sn.projectPointOntoPlane(c,t,kQ),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=CTe(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=UQ(sn.projectPointOntoPlane(c,t,kQ),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=UQ(sn.projectPointOntoPlane(this._boundingPlanes[1],t,kQ),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 _dt=new h,ydt=new h;function CTe(e,t,n){let i=h.subtract(n,t,_dt),r=h.subtract(e,t,ydt),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 Adt=new sn(h.UNIT_X,0);function UQ(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],Adt);sn.getPointDistance(u,e)<0||(a=CTe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}v2.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};v2.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new nh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=nh.createGeometry(n),r=new Ft({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new nh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=nh.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 nh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=nh.createGeometry(f);c[u]=new Ft({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new On({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var S2=v2;var bdt=new h(1,1,1),iG=Math.cos,rG=Math.sin;function lw(e){e=e??H.EMPTY_OBJECT;let t=e.radii??bdt,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"}lw.packedLength=2*h.packedLength+8;lw.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 vTe=new h,STe=new h,g_={radii:vTe,innerRadii:STe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};lw.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,vTe);t+=h.packedLength;let r=h.unpack(e,t,STe);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):(g_.minimumClock=o,g_.maximumClock=s,g_.minimumCone=a,g_.maximumCone=c,g_.stackPartitions=u,g_.slicePartitions=f,g_.subdivisions=d,g_.offsetAttribute=p===-1?void 0:p,new lw(g_))};lw.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]=rG(I),L[E]=iG(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=rG(S),C[E]=iG(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]=rG(I),L[E]=iG(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=rG(S),C[E]=iG(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:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Yf=lw;function uw(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 Yf(i),this._workerName="createSphereOutlineGeometry"}uw.packedLength=Yf.packedLength;uw.pack=function(e,t,n){return Yf.pack(e._ellipsoidGeometry,t,n)};var xdt=new Yf,WT={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};uw.unpack=function(e,t,n){let i=Yf.unpack(e,t,xdt);return WT.stackPartitions=i._stackPartitions,WT.slicePartitions=i._slicePartitions,WT.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,WT.radii),n._ellipsoidGeometry=new Yf(WT),n):(WT.radius=i._radii.x,new uw(WT))};uw.createGeometry=function(e){return Yf.createGeometry(e._ellipsoidGeometry)};var __=uw;function fw(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(fw.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}}});fw.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};fw.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};fw.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};fw.prototype.createDebugVolume=function(e){let t=new __({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 On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var y_=fw;var Tdt=new h,Edt=new h,Cdt=new h,vdt=new h;function qT(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function zQ(e,t){let n=h.normalize(e,vdt),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return qT(e,i,t)}function wTe(e){let t=$.getColumn(e,0,Tdt),n=$.getColumn(e,1,Edt),i=$.getColumn(e,2,Cdt),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=qT(n,i,t):!r&&o&&!s?n=qT(t,i,n):!r&&!o&&s?i=qT(n,t,i):r?o?s||(t=zQ(i,t),n=qT(i,t,n)):(t=zQ(n,t),i=qT(n,t,i)):(n=zQ(t,n),i=qT(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function dw(e,t){t=wTe(t),this._orientedBoundingBox=new Qt(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(dw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});dw.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};dw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};dw.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=wTe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};dw.prototype.createDebugVolume=function(e){let t=new Hh({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 On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var $u=dw;function co(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||tr(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=x2(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"?yo.REPLACE:yo.ADD):l(i)?p=i.refine:p=yo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(o)y=Rr.UNLOADED,A=De.createIfNeeded(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 n0(e,this),m=!0,y=Rr.READY):(y=Rr.UNLOADED,b=v)}else g=new n0(e,this),m=!0,y=Rr.READY;this._content=g,this._contentResourceValue=A,this._contentBaseResource=l(b)?t:void 0,this._contentUri=b,this._contentState=y,this._expiredContent=void 0,this._serverKeyValue=void 0,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=Qd.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=qr;function ITe(e){let t=De.createIfNeeded(e._contentBaseResource).getDerivedResource({url:e._contentUri});e._contentResourceValue=t,e._serverKeyValue=Kc.getServerKey(t.getUrlComponent()),e._contentBaseResource=void 0,e._contentUri=void 0}Object.defineProperties(co.prototype,{_contentResource:{get:function(){return l(this._contentUri)&&ITe(this),this._contentResourceValue},set:function(e){this._contentResourceValue=e,this._contentBaseResource=void 0,this._contentUri=void 0}},_serverKey:{get:function(){return l(this._contentUri)&&ITe(this),this._serverKeyValue},set:function(e){this._serverKeyValue=e}},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 FA=new h;function Sdt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,FA),c=h.add(s.positionWC,a,FA),u=h.subtract(c,o,FA);if(h.magnitude(u)>r){let E=h.normalize(u,FA),v=h.multiplyByScalar(E,r,FA),S=h.add(o,v,FA),I=h.subtract(S,s.positionWC,FA),R=h.normalize(I,FA);e._foveatedFactor=1-Math.abs(h.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===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 NTe=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 wdt(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 Idt(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=Idt(n,this),this._priorityProgressiveResolution=wdt(n,this),this.priorityDeferred=Sdt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};co.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(NTe);K.lessThan(this.expireDate,e)&&(this._contentState=Rr.EXPIRED,this._expiredContent=this._content)}};function Pdt(e){if(!l(e.expireDuration))return;let t=K.now(NTe);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 Ddt(e){return function(){return e._priority}}co.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Rdt(this):Mdt(this)};function Rdt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=tr(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new T2(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 Odt(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(LTe(e,a))return i&&(e.expireDate=void 0),e._content=new n0(t,e),PTe(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 Ndt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof n0&&PTe(e),e._contentState=Rr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Rr.FAILED,a}}function Mdt(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:Ddt(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 Odt(e,r,i,n,o)}function LTe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function PTe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}co._isEmptyTile=LTe;async function Ndt(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===Ca.GEOMETRY||r.contentType===Ca.VECTOR,(r.contentType===Ca.IMPLICIT_SUBTREE||r.contentType===Ca.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===Ca.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=BT[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=kT(n,a));let c=UT(n,a);return l(c)&&(o.group=new Wx({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 FTe=new ue;function jQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,FTe);e._boundingVolume2D=new y_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Ldt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,FTe);e._contentBoundingVolume2D=new y_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}co.prototype.visibility=function(e,t){let n=e.cullingVolume,i=jQ(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=Ldt(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 jQ(this,e).distanceToCamera(e)};var Fdt=new h;co.prototype.distanceToTileCenter=function(e){let n=jQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Fdt);return h.dot(e.camera.directionWC,i)};co.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var BTe=new $,kTe=new h,Bdt=new $,HQ=new h,UTe=new ie,zTe=new Qt,VQ=new N;function kdt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],HQ),r=$.fromArray(e,3,Bdt);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,BTe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new $u(i,r)}function DTe(e,t,n,i){let r=ie.unpack(e,0,UTe),o=e[4],s=e[5],a=Qt.fromRectangle(r,o,s,ee.WGS84,zTe),c=a.center,u=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,VQ),VQ),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,BTe);return u=$.multiply(f,u,u),l(i)&&i instanceof $u?(i.update(c,u),i):new $u(c,u)}function Udt(e,t,n,i){if(!N.equalsEpsilon(t,n,D.EPSILON8))return i instanceof $u?DTe(e,t,n,i):DTe(e,t,n,void 0);let r=ie.unpack(e,0,UTe);return i instanceof qf?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new qf({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function zdt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],HQ),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,kTe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new y_(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(tr(e,"3DTILES_bounding_volume_S2"))return new S2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=kdt(o,t,n);return this._verticalExaggeration!==1&&RTe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Udt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof $u?RTe(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=zdt(a,t,n);if(this._verticalExaggeration!==1){let u=Ar.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,HQ),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var Vdt=h.unpackArray(new Array(24).fill(0));function RTe(e,t,n){let i=e.boundingVolume.computeCorners(Vdt).map(o=>Ar.getPosition(o,ee.WGS84,t,n,o)),r=Qt.fromPoints(i,zTe);e.update(r.center,r.halfAxes)}co.prototype.updateTransform=function(e,t){e=e??N.IDENTITY;let n=N.multiplyTransformation(e,this.transform,VQ),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,kTe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function jdt(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 Hdt(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 Gdt(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 Wdt(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;Gdt(this,e),Wdt(this,e),jdt(this,e,t,n),Hdt(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 OTe=[];co.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Pdt(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=OTe;try{this._content.update(e,t)}catch(i){throw this._contentState=Rr.FAILED,i}OTe.length=0,t.commandList=n};function MTe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function oG(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=oG(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===yo.REPLACE?oG(this._priorityHolder._distanceToCamera,n.distance,i.distance):oG(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=MTe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=oG(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=MTe(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(),le(this)};var ih=co;function A_(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(A_.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}}});A_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};A_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};A_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};A_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};A_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};A_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};A_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var hw=A_;function b_(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(b_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});b_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};b_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};b_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};b_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};b_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};b_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};b_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var w2=b_;function VTe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new w2({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 hw({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 hw({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(VTe.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 YT=VTe;var jTe={},qdt=new h;jTe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof $u||i instanceof qf){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=Qd.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof $u||a instanceof qf)){e._optimChildrenWithinParent=Qd.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,qdt),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=Qd.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Qd.USE_OPTIMIZATION};var I2=jTe;function P2(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(P2.prototype,{length:{get:function(){return this._length}}});function Ydt(e,t,n){this.item=e,this.previous=t,this.next=n}P2.prototype.add=function(e){let t=new Ydt(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 HTe(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}P2.prototype.remove=function(e){l(e)&&(HTe(this,e),--this._length)};P2.prototype.splice=function(e,t){if(e===t)return;HTe(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 D2=P2;function BA(){this._list=new D2,this._sentinel=this._list.add(),this._trimTiles=!1}BA.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};BA.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};BA.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};BA.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};BA.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};BA.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)}};BA.prototype.trim=function(){this._trimTiles=!0};var R2=BA;function sG(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 WQ(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}sG.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=WQ(e,n),this._referenceMaximum[n]=WQ(t,n)};function Xdt(e,t){let n=e.tilePropertyName;if(l(n)){let i=WQ(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 GQ=[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)];sG.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Xdt(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=GQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=GQ[d],y=GQ[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};sG.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 O2=sG;function mw(){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}mw.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};mw.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])}};mw.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Hf))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])}};mw.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Hf))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])}};mw.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 Im=mw;function M2(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(M2.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});M2.prototype.makeDirty=function(){this._styleDirty=!0};M2.prototype.resetDirty=function(){this._styleDirty=!1};M2.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 N2=M2;function GTe(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}GTe.maximumFrameNumber=15e6;var kA=GTe;function Kdt(e,t,n){let i=tr(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)&&!tr(r,"3DTILES_bounding_volume_S2")&&!tr(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=$dt(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=Jdt(t),this.subdivisionScheme=Gs[i.subdivisionScheme],this.branchingFactor=Gs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function $dt(e){if(tr(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 Jdt(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 r0=Kdt;var L2={};function WTe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function qQ(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function qTe(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 YQ(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}L2.encode2D=function(e,t){return(WTe(e)|WTe(t)<<1)>>>0};L2.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=qTe(e),t[1]=qTe(e>>1),t};L2.encode3D=function(e,t,n){return qQ(e)|qQ(t)<<1|qQ(n)<<2};L2.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=YQ(e),t[1]=YQ(e>>1),t[2]=YQ(e>>2),t};var UA=L2;function To(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===Gs.OCTREE&&(this.z=e.z)}Object.defineProperties(To.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Gs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Gs.OCTREE?UA.encode3D(this.x,this.y,this.z):UA.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Gs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});To.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===Gs.OCTREE){let r=(this.z<<e.level)+e.z;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};To.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===Gs.OCTREE){let o=Math.floor(this.z/t);return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};To.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Gs.OCTREE){let o=e.z%n;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};To.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===Gs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};To.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};To.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};To.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===Gs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};To.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===Gs.OCTREE?this.z===e.z:!0)};To.prototype.isImplicitTilesetRoot=function(){return this.level===0};To.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};To.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};To.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Gs.OCTREE&&(e.z=this.z),e};var YTe=[0,0,0];To.fromMortonIndex=function(e,t,n,i){let r;return e===Gs.OCTREE?(r=UA.decode3D(i,YTe),new To({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=UA.decode2D(i,YTe),new To({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};To.fromTileIndex=function(e,t,n){let i,r,o;return e===Gs.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),To.fromMortonIndex(e,t,i,o)};var o0=To;function x_(){}x_.selectTiles=function(e,t){pe.throwInstantiationError()};x_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};x_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};x_.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)};x_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};x_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};x_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Zdt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Zdt(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}x_.updateTile=function(e,t){XTe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,tht(e),e._shouldSelect=!1,e._finalResolution=!0};function XTe(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];XTe(o,t),e._visible=o._visible;return}if(Qdt(e,t)){e._visible=!1;return}let i=e.refine===yo.REPLACE,r=e._optimChildrenWithinParent===Qd.USE_OPTIMIZATION;if(i&&r&&n&&!eht(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Qdt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==yo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function eht(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 tht(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 qa=x_;function KTe(){}var F2={stack:new Xl,stackMaximumLength:0};KTe.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}=qa,s=F2.stack;for(s.push(i);s.length>0;){F2.stackMaximumLength=Math.max(F2.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===yo.ADD,u=a.refine===yo.REPLACE,f=nht(a);f&&iht(a,s,t),(c||u&&!f)&&(rht(e,a),r(a,t),oht(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return F2.stack.trim(F2.stackMaximumLength),n};function nht(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function iht(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 rht(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function oht(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var B2=KTe;function $Te(){}var k2={stack:new Xl,stackMaximumLength:0},U2={stack:new Xl,stackMaximumLength:0};$Te.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(qa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;aht(n,t),k2.stack.trim(k2.stackMaximumLength),U2.stack.trim(U2.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function XQ(e,t){e.contentAvailable&&qa.selectTile(e,t)}function sht(e,t,n){let i=e.refine===yo.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=qa;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(qa.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=cht(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 aht(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=qa,a=k2.stack;for(a.push(e);a.length>0;){k2.stackMaximumLength=Math.max(k2.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?sht(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===yo.ADD?(XQ(c,t),r(c,t)):c.refine===yo.REPLACE&&(r(c,t),d&&XQ(c,t)):(n._emptyTiles.push(c),r(c,t),d&&XQ(c,t)),o(c,t),s(c,t)}}function cht(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=qa,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=U2.stack;for(c.push(e);c.length>0;){U2.stackMaximumLength=Math.max(U2.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 z2=$Te;function JTe(){}var V2={stack:new Xl,stackMaximumLength:0},j2={stack:new Xl,stackMaximumLength:0},T_={stack:new Xl,stackMaximumLength:0,ancestorStack:new Xl,ancestorStackMaximumLength:0},lht=2;JTe.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(qa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;pht(n,t),ght(n,t),V2.stack.trim(V2.stackMaximumLength),j2.stack.trim(j2.stackMaximumLength),T_.stack.trim(T_.stackMaximumLength),T_.ancestorStack.trim(T_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function uht(e,t){let{updateTile:n,touchTile:i,selectTile:r}=qa,o=j2.stack;for(o.push(e);o.length>0;){j2.stackMaximumLength=Math.max(j2.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<lht&&o.push(u))}}}function aG(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:uht(e,t)}function fht(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 dht(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 hht(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=qa;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(qa.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 mht(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 pht(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}=qa,c=V2.stack;for(c.push(e);c.length>0;){V2.stackMaximumLength=Math.max(V2.stackMaximumLength,c.length);let u=c.pop();fht(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?hht(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===yo.ADD?(aG(u,t),o(u,t)):u.refine===yo.REPLACE&&(mht(u,i)?(o(u,t),p&&aG(u,t)):p?(aG(u,t),o(u,t)):dht(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&aG(u,t)),s(u,t),a(u,t)}}function ght(e,t){let{selectTile:n,canTraverse:i}=qa,{stack:r,ancestorStack:o}=T_,s;for(r.push(e);r.length>0||o.length>0;){if(T_.stackMaximumLength=Math.max(T_.stackMaximumLength,r.length),T_.ancestorStackMaximumLength=Math.max(T_.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===yo.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 H2=JTe;function wa(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(wa.prototype,{length:{get:function(){return this._layers.length}}});wa.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()})};wa.prototype.addImageryProvider=function(e,t){let n=new Ss(e);return this.add(n,t),n};wa.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};wa.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=[]};wa.prototype.contains=function(e){return this.indexOf(e)!==-1};wa.prototype.indexOf=function(e){return this._layers.indexOf(e)};wa.prototype.get=function(e){return this._layers[e]};function cG(e,t){return e.indexOf(t)}function ZTe(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)}wa.prototype.raise=function(e){let t=cG(this._layers,e);ZTe(this,t,t+1)};wa.prototype.lower=function(e){let t=cG(this._layers,e);ZTe(this,t,t-1)};wa.prototype.raiseToTop=function(e){let t=cG(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))};wa.prototype.lowerToBottom=function(e){let t=cG(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 QTe=new ie;function eEe(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=QTe,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)}}wa.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(eEe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var _ht=new ie,yht=new ie,KQ=new U,$Q=new U,Aht=new he,bht=new he;function xht(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,_ht),s=1/1024,a=yht;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;KQ.x=a.west,KQ.y=a.south,$Q.x=a.east,$Q.y=a.north;let u=c.unproject(KQ,Aht),f=c.unproject($Q,bht);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function Tht(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=xht(A,d.textureCoordinateRectangle,g,QTe);ie.contains(b,t)&&n(p)}}}}wa.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)&&eEe(t,r,!0,function(c){a(c)}),l(i)&&Tht(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})};wa.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};wa.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};wa.prototype.isDestroyed=function(){return!1};wa.prototype.destroy=function(){return this.removeAll(!0),le(this)};wa.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 XT=wa;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 R2,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 Xl,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 N2,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Im,this._statisticsLast=new Im,this._statisticsPerPass=new Array(ao.NUMBER_OF_PASSES);for(let r=0;r<ao.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Im;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 O2(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 XT(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=Uu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Yp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Vg,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)&&bs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Mc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),oEe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Gx,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new kg(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??Vo.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??Hd.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){bs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Mc.setOwner(e,this,"_clippingPolygons"),oEe(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 qr("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,uEe(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 Eht(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,uEe(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,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=tEe(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===yo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=tEe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&I2.checkChildrenWithinParent(c)}return s};function tEe(e,t,n,i){if(!(l(n.implicitTiling)||tr(n,"3DTILES_implicit_tiling")))return new ih(e,t,n,i);let o=e.schema,s=new r0(t,n,o),a=new o0({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 ih(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Eht(e,t){let n=tr(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 YT({schema:i.schema,metadataJson:n});return Li.unload(i),r}var nEe=new h,Cht=new he,vht=new N,Sht=new h,wht=new h,Iht=new h,Pht=new h;function Dht(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof qf)n=h.normalize(a.positionWC,nEe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=N.inverseTransformation(c.computedTransform,vht),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=N.multiplyByPoint(y,b.center,Sht);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,Cht);n=h.normalize(a.positionWC,nEe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=N.multiplyByPoint(y,a.positionWC,wht);if(n=h.UNIT_Z,i=N.multiplyByPointAsVector(y,a.directionWC,Iht),i=h.normalize(i,i),r=T.z,u instanceof $u){let E=$.getColumn(b.halfAxes,2,Pht),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof y_){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 Rht(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=>{sEe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?cEe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function rEe(e,t){return e._priority-t._priority}lo.prototype.postPassesUpdate=function(e){l(this._root)&&(Oht(this,e),$ht(this,e),this._cache.unloadTiles(this,lEe),Xht(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function oEe(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;Uht(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&&Dht(this,e),e.newFrame&&this._cache.reset()};function Oht(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 Mht(e){let t=e._requestedTiles;t.sort(rEe);for(let n=0;n<t.length;++n)Rht(e,t[n])}function sEe(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 Nht(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 Lht=new he,Fht=new he,Bht=new h;function kht(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,Lht),f=he.fromCartesian(r.center,c,Fht);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,Bht);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Uht(e,t){Nht(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,sEe(f,e,u)}}e.totalMemoryUsageInBytes<i?Vht(e):a&&n.length>0&&zht(e)}function zht(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(rEe)}function Vht(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var lG=new h,jht={maximumFractionDigits:3};function iEe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,jht):Math.round(t).toLocaleString()}function JQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,lG);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,lG);o=h.multiplyByScalar(o,.75*n,lG),r=h.add(o,i,lG)}return r}function ZQ(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: ${iEe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${iEe(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]}`;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 Hht(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:JQ(e.debugPickedTile),a=ZQ(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];ZQ(a,e,JQ(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&ZQ(a,e,JQ(a))}}e._tileDebugLabels.update(t)}function Ght(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 ui({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),kht(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 e0),Hht(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var aEe=[],Wht=[];function cEe(e,t){let n=t,i=aEe;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&&(Kht(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function lEe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function uG(e,t){let n=e-t;return n<0?n+kA.maximumFrameNumber:n}var qht=64;function Yht(e,t,n){let i=Wht;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(uG(t,r._visitedFrame),uG(t,r._touchedFrame),uG(t,r._selectedFrame),uG(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 Xht(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<qht&&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,!Yht(u,i,r)&&(cEe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function Kht(e,t){e._cache.unloadTile(e,t,lEe),t.destroy()}lo.prototype.trimLoadedTiles=function(){this._cache.trim()};function $ht(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Im.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 Jht(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 Zht(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 Qht(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,Jht(e),Zht(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Mht(e),Ght(e,t,i),Im.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 uEe(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?B2:this.isSkippingLevelOfDetail?H2:z2};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=Qht(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=aEe;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,le(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 emt=new pn,tmt=new h,nmt=new h,imt=new he;lo.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=emt,r=n.cartographicToCartesian(e,tmt),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,nmt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,imt)?.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 rmt=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,rmt);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 Yo=lo;var omt=new N;function zA(e,t){t.collectionChanged.addEventListener(zA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}zA.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,omt),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],smt(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};zA.prototype.isDestroyed=function(){return!1};zA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)QQ(this,e[i],t,n);return le(this)};zA.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?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};zA.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):(QQ(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],QQ(this,o,a,c),s.remove(o.id)};function QQ(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function smt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Yo.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 G2=zA;var amt=z.WHITE,cmt=z.BLACK,lmt=new U(2,2);function pw(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(pw.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")});pw.prototype.getType=function(e){return"Checkerboard"};var umt=new K;pw.prototype.getValue=function(e,t){return l(e)||(e=K.now(umt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,amt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,cmt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,lmt),t};pw.prototype.equals=function(e){return this===e||e instanceof pw&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var gw=pw;var fEe={id:void 0};function W2(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 pl(e){this._owner=e,this._entities=new kt,this._addedEntities=new kt,this._removedEntities=new kt,this._changedEntities=new kt,this._suspendCount=0,this._collectionChanged=new be,this._id=$n(),this._show=!0,this._firing=!1,this._refire=!1}pl.prototype.suspendEvents=function(){this._suspendCount++};pl.prototype.resumeEvents=function(){this._suspendCount--,W2(this)};Object.defineProperties(pl.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}}});pl.prototype.computeAvailability=function(){let e=tt.MAXIMUM_VALUE,t=tt.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(tt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(tt.MAXIMUM_VALUE)&&(t=c)}}return tt.MAXIMUM_VALUE.equals(e)&&(e=tt.MINIMUM_VALUE),tt.MINIMUM_VALUE.equals(t)&&(t=tt.MAXIMUM_VALUE),new En({start:e,stop:t})};pl.prototype.add=function(e){e instanceof Jr||(e=new Jr(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(pl.prototype._onEntityDefinitionChanged,this),W2(this),e};pl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};pl.prototype.contains=function(e){return this._entities.get(e.id)===e};pl.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(pl.prototype._onEntityDefinitionChanged,this),W2(this),!0):!1};pl.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(pl.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),W2(this)};pl.prototype.getById=function(e){return this._entities.get(e)};pl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(fEe.id=e,t=new Jr(fEe),this.add(t)),t};pl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),W2(this)};var Ya=pl;var fG={id:void 0},_w=new Array(2);function eee(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 dEe(e,t,n,i){_w[0]=n,_w[1]=i.id,t[JSON.stringify(_w)]=i.definitionChanged.addEventListener(ws.prototype._onDefinitionChanged,e)}function hEe(e,t,n,i){_w[0]=n,_w[1]=i.id;let r=JSON.stringify(_w);t[r](),t[r]=void 0}function VA(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 Ya(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(ws.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],hEe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(ws.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],dEe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?eee(y):(fG.id=s.id,y=new Jr(fG)),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 ws(e,t){this._owner=t,this._composite=new Ya(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=$n(),this._eventHash={},VA(this),this._shouldRecomposite=!1}Object.defineProperties(ws.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}}});ws.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),VA(this)};ws.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),VA(this),!0):!1};ws.prototype.removeAllCollections=function(){this._collections.length=0,VA(this)};ws.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ws.prototype.contains=function(e){return this._composite.contains(e)};ws.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ws.prototype.getCollection=function(e){return this._collections[e]};ws.prototype.getCollectionsLength=function(){return this._collections.length};function dG(e,t){return e.indexOf(t)}function mEe(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,VA(e)}ws.prototype.raiseCollection=function(e){let t=dG(this._collections,e);mEe(this,t,t+1)};ws.prototype.lowerCollection=function(e){let t=dG(this._collections,e);mEe(this,t,t-1)};ws.prototype.raiseCollectionToTop=function(e){let t=dG(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),VA(this))};ws.prototype.lowerCollectionToBottom=function(e){let t=dG(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),VA(this))};ws.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ws.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(VA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ws.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ws.prototype.getById=function(e){return this._composite.getById(e)};ws.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];hEe(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),eee(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];dEe(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)?eee(u):(fG.id=y,u=new Jr(fG),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};ws.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 tee=ws;function nee(){this._removalFunctions=[]}nee.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)}};nee.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Xo=nee;function oee(e,t){return K.compare(e.start,t.start)}function Is(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(Is.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}}});Is.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Is))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(!En.equals(n[o],i[o],t))return!1;return!0};Is.prototype.get=function(e){return this._intervals[e]};Is.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Is.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Is.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Is.prototype.contains=function(e){return this.indexOf(e)>=0};var iee=new En;Is.prototype.indexOf=function(e){let t=this._intervals;iee.start=e,iee.stop=e;let n=vr(t,iee,oee);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)};Is.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]}};Is.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,oee);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 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):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===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&&(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 En({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 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)};Is.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=vr(t,e,oee);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 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&&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 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&&(K.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};Is.prototype.intersect=function(e,t,n){let i=new Is,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=En.intersect(c,u,new En,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};Is.fromJulianDateArray=function(e,t){l(t)||(t=new Is);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 En({start:tt.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 En({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 En({start:n[i-1],stop:tt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var gl=new Bh,q2=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ree(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,gl);let i=gl.millisecond+t.millisecond,r=gl.second+t.second,o=gl.minute+t.minute,s=gl.hour+t.hour,a=gl.day+t.day,c=gl.month+t.month,u=gl.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),q2[2]=Bl(u)?29:28;a>q2[c]||c>=13;)a>q2[c]&&(a-=q2[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),q2[2]=Bl(u)?29:28;return gl.millisecond=i,gl.second=r,gl.minute=o,gl.hour=s,gl.day=a,gl.month=c,gl.year=u,K.fromGregorianDate(gl,n)}var fmt=new K,dmt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function pEe(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(dmt);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,fmt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var Y2=new Bh;Is.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!pEe(n[2],Y2))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=ree(s,Y2),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return Is.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Is.fromIso8601DateArray=function(e,t){return Is.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)};Is.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)(pEe(i[u],Y2)||u===0)&&(r&&l(a)?s=ree(a,Y2):s=ree(n,Y2),o.push(s),a=s);return Is.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ps=Is;function hmt(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 KT(){this._eventHelper=new Xo,this._definitionChanged=new be,this._intervals=new Ps,this._intervals.changedEvent.addEventListener(KT.prototype._intervalsChanged,this)}Object.defineProperties(KT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var mmt=new K;KT.prototype.getValue=function(e,t){l(e)||(e=K.now(mmt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};KT.prototype.equals=function(e){return this===e||e instanceof KT&&this._intervals.equals(e._intervals,X.equals)};KT.prototype._intervalsChanged=function(){hmt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var _l=KT;function jA(){this._definitionChanged=new be,this._composite=new _l,this._composite.definitionChanged.addEventListener(jA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(jA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});jA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var pmt=new K;jA.prototype.getValue=function(e,t){l(e)||(e=K.now(pmt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};jA.prototype.equals=function(e){return this===e||e instanceof jA&&this._composite.equals(e._composite,X.equals)};jA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var yw=jA;function HA(e){this._referenceFrame=e??ji.FIXED,this._definitionChanged=new be,this._composite=new _l,this._composite.definitionChanged.addEventListener(HA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(HA.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 gmt=new K;HA.prototype.getValue=function(e,t){return l(e)||(e=K.now(gmt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};HA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};HA.prototype.equals=function(e){return this===e||e instanceof HA&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};HA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var mc=HA;var gEe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(gEe);var rr=gEe;var pc=[new h,new h],_mt=new h,ymt=new h,Amt=new h,bmt=new h,xmt=new h,Tmt=new h,Emt=new h,Cmt=new h,vmt=new h,Aw=new h,hG=new h,X2={},see=new he;function Smt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];see=t.cartesianToCartographic(r,see),n[i]=see.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function aee(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 mG=new h,pG=new h;function wmt(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,mG),mG),s=r.projectPointOntoPlane(h.add(n,t,pG),pG),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var Imt=new h(-1,0,0),$T=new N,Pmt=new N,cee=new $,Dmt=$.IDENTITY.clone(),Rmt=new h,Omt=new se,_Ee=new h;function E_(e,t,n,i,r,o,s,a){let c=Rmt,u=Omt;$T=At.eastNorthUpToFixedFrame(e,r,$T),c=N.multiplyByPointAsVector($T,Imt,c),c=h.normalize(c,c);let f=wmt(c,t,e,r);cee=$.fromRotationZ(f,cee),_Ee.z=o,$T=N.multiplyTransformation($T,N.fromRotationTranslation(cee,_Ee,Pmt),$T);let d=Dmt;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($T,u,u),i.push(u.x,u.y,u.z);return i}var Mmt=new h;function lee(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,Mmt);i=E_(c,t,n,i,r,o[a/3],s,1)}return i}function Nmt(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 yEe(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 AEe=new Le,bEe=new h,xEe=new $;function TEe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,Aw),h.subtract(n,e,hG)),d=i===rr.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,Aw),f/(d+1),AEe),xEe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),AEe),xEe);let g,m;if(t=h.clone(t,bEe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,Aw),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,hG),s=E_(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,Aw),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,hG),s=E_(m,g,a,s,o,c,1,1),n=h.clone(n,bEe),g=h.subtract(n,e,Aw),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,hG),s=E_(m,g,a,s,o,c,1,1);return s}X2.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};X2.angleIsGreaterThanPi=function(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,mG),mG),s=r.projectPointOntoPlane(h.add(n,t,pG),pG);return s.x*o.y-s.y*o.x>=0};var Lmt=new h,Fmt=new h;X2.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=Smt(e,o),a=i._granularity,c=i._cornerType,u=r?Nmt(t,n):yEe(t,n),f=r?yEe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=_mt,b=ymt,x=Amt,T=bmt,E=xmt,v=Tmt,S=Emt,I=Cmt,R=vmt,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=E_(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),Lmt);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),Fmt);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,Aw))),Q=X2.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),pc[0]=h.clone(R,pc[0]),pc[1]=h.clone(v,pc[1]),w=aee(pc,_+d,C+d,a),P=ir.generateArc({positions:pc,granularity:a,ellipsoid:o}),m=lee(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===rr.ROUNDED||c===rr.BEVELED?TEe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=E_(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),pc[0]=h.clone(R,pc[0]),pc[1]=h.clone(v,pc[1]),w=aee(pc,_+d,C+d,a),P=ir.generateArc({positions:pc,granularity:a,ellipsoid:o}),m=lee(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===rr.ROUNDED||c===rr.BEVELED?TEe(E,v,S,c,Q,o,m,u,C+d,r):m=E_(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=E_(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}pc[0]=h.clone(R,pc[0]),pc[1]=h.clone(O,pc[1]),w=aee(pc,_+d,C+d,a),P=ir.generateArc({positions:pc,granularity:a,ellipsoid:o}),m=lee(P,I,u,m,o,w,1),r&&(y=E_(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 Pm=X2;var fee={},bw=new h,wEe=new h,Bmt=new h,EEe=new h,lu=[new h,new h],IEe=new h,PEe=new h,DEe=new h,kmt=new h,Umt=new h,zmt=new h,Vmt=new h,jmt=new h,Hmt=new h,Gmt=new h,CEe=new Le,vEe=new $;function gG(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,bw),h.subtract(n,e,wEe)),s=i===rr.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,bw),o/s,CEe),vEe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,CEe),vEe);let f=0;t=h.clone(t,bw);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 Wmt(e){let t=IEe,n=PEe,i=DEe,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=gG(t,n,i,rr.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=gG(t,n,i,rr.ROUNDED,!1);return[o,c]}function SEe(e,t,n,i){let r=bw;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 uee(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,bw),a=h.negate(s,wEe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,Bmt),p=h.add(d,a,EEe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,EEe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}fee.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 qmt=new h,Ymt=new h;fee.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=IEe,c=PEe,u=DEe,f=kmt,d=Umt,p=zmt,g=Vmt,m=jmt,y=Hmt,A=Gmt,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),qmt);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),Ymt);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,bw))),M=Pm.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),lu[0]=h.clone(g,lu[0]),lu[1]=h.clone(A,lu[1]),S=ir.generateArc({positions:lu,granularity:t,ellipsoid:i}),b=uee(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===rr.ROUNDED||o===rr.BEVELED?I.push({leftPositions:gG(m,p,y,o,M)}):I.push({leftPositions:SEe(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),lu[0]=h.clone(g,lu[0]),lu[1]=h.clone(A,lu[1]),S=ir.generateArc({positions:lu,granularity:t,ellipsoid:i}),b=uee(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===rr.ROUNDED||o===rr.BEVELED?I.push({rightPositions:gG(y,p,m,o,M)}):I.push({rightPositions:SEe(E,d,m,M)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),lu[0]=h.clone(g,lu[0]),lu[1]=h.clone(E,lu[1]),S=ir.generateArc({positions:lu,granularity:t,ellipsoid:i}),b=uee(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===rr.ROUNDED&&(L=Wmt(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var mr=fee;var MEe=new h,NEe=new h,_G=new h,yG=new h,Xmt=new h,LEe=new h,GA=new h,xw=new h;function FEe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Dm(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,GA),GA);o.normal&&mr.addAttribute(s,t,i,r),o.tangent&&mr.addAttribute(a,u,i,r),o.bitangent&&mr.addAttribute(c,n,i,r)}function BEe(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=MEe,w=NEe,P,M,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){M=_G,P=yG;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),mr.addAttribute(b,P,S),mr.addAttribute(b,M,void 0,I),Dm(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,GA),GA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,xw),xw),C=h.normalize(h.add(Q,W,C),C),Dm(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,GA),GA),W=n.geodeticSurfaceNormal(h.fromArray(q,g,xw),xw),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=LEe,we=_G,Se=yG;if(C=h.fromArray(a,k,C),l(ae)){for(Dm(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,mr.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),Dm(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),Dm(v,C,w,S,void 0,t),S+=3}else{for(Dm(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,mr.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),Dm(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),Dm(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,GA),GA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,xw),xw),C=h.normalize(h.add(Q,W,C),C),Dm(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),Dm(v,C,w,S,I,t),m){S+=3,I-=3,M=_G,P=yG;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),mr.addAttribute(b,M,void 0,I),mr.addAttribute(b,P,S),Dm(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 Kmt(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=MEe,m=NEe,y=_G,A=yG,b=Xmt,x=LEe,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&&(mr.addAttribute(f,A,E),mr.addAttribute(f,A,E+3),mr.addAttribute(f,A,T),mr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(mr.addAttribute(p,x,E),mr.addAttribute(p,x,E+3),mr.addAttribute(p,x,T),mr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),mr.addAttribute(d,b,E),mr.addAttribute(d,b,E+3),mr.addAttribute(d,b,T),mr.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 dee(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 $mt(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=mr.computePositions(e),o=BEe(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=fi.scaleToGeodeticHeight(f,s,i),m=dee(f,0,m),g=fi.scaleToGeodeticHeight(g,a,i),m=dee(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=Kmt(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=dee(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 REe=new h,K2=new h,oh=new he;function OEe(e,t,n,i,r,o){let s=h.subtract(t,e,REe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,K2),c=h.cross(s,a,REe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,K2),n.cartesianToCartographic(K2,oh);let g=oh.latitude,m=oh.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,K2),n.cartesianToCartographic(K2,oh),g=oh.latitude,m=oh.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 rh=new h,$2=new h,Ju=new he,Zu=new he;function kEe(e,t,n,i,r){e=FEe(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,Zu.latitude=Number.NEGATIVE_INFINITY,Zu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===rr.ROUNDED){let p=o[0];h.subtract(p,o[1],rh),h.normalize(rh,rh),h.multiplyByScalar(rh,a,rh),h.add(p,rh,$2),t.cartesianToCartographic($2,oh),c=oh.latitude,u=oh.longitude,Ju.latitude=Math.min(Ju.latitude,c),Ju.longitude=Math.min(Ju.longitude,u),Zu.latitude=Math.max(Zu.latitude,c),Zu.longitude=Math.max(Zu.longitude,u)}for(let p=0;p<s-1;++p)OEe(o[p],o[p+1],t,a,Ju,Zu);let f=o[s-1];h.subtract(f,o[s-2],rh),h.normalize(rh,rh),h.multiplyByScalar(rh,a,rh),h.add(f,rh,$2),OEe(f,$2,t,a,Ju,Zu),i===rr.ROUNDED&&(t.cartesianToCartographic($2,oh),c=oh.latitude,u=oh.longitude,Ju.latitude=Math.min(Ju.latitude,c),Ju.longitude=Math.min(Ju.longitude,u),Zu.latitude=Math.max(Zu.latitude,c),Zu.longitude=Math.max(Zu.longitude,u));let d=l(r)?r:new ie;return d.north=Zu.latitude,d.south=Ju.latitude,d.east=Zu.longitude,d.west=Ju.longitude,d}function v_(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??rr.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}v_.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 UEe=ee.clone(ee.UNIT_SPHERE),zEe=new Be,C_={positions:void 0,ellipsoid:UEe,vertexFormat:zEe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};v_.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,UEe);t+=ee.packedLength;let s=Be.unpack(e,t,zEe);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):(C_.positions=r,C_.width=a,C_.height=c,C_.extrudedHeight=u,C_.cornerType=f,C_.granularity=d,C_.shadowVolume=p,C_.offsetAttribute=g===-1?void 0:g,new v_(C_))};v_.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??rr.ROUNDED;return kEe(n,r,i,o,t)};v_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=FEe(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=$mt(u,c);else{let g=mr.computePositions(u);if(f=BEe(g,c,i),f.attributes.position.values=fi.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=ue.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})};v_.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new v_({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(v_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=kEe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var JT=v_;var VEe=new h,jEe=new h,Jmt=new h;function Zmt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function HEe(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=VEe,I=jEe;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),mr.addAttribute(A,I,b),mr.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=Jmt;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,mr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===rr.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,mr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===rr.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=VEe,I=jEe;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),mr.addAttribute(A,R,void 0,x),mr.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 Qmt(e){let t=e.ellipsoid,n=mr.computePositions(e),i=HEe(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=fi.scaleToGeodeticHeight(u,o,t),d=fi.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 J2(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??rr.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}J2.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 GEe=ee.clone(ee.UNIT_SPHERE),WA={positions:void 0,ellipsoid:GEe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};J2.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,GEe);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):(WA.positions=r,WA.width=s,WA.height=a,WA.extrudedHeight=c,WA.cornerType=u,WA.granularity=f,WA.offsetAttribute=d===-1?void 0:d,new J2(WA))};J2.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Zmt(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=Qmt(c);else{let p=mr.computePositions(c);if(u=HEe(p,c.cornerType),u.attributes.position.values=fi.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=ue.fromVertices(f.position.values,void 0,3);return new St({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var Z2=J2;var ept=new li(0);function uu(e){Pi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(uu.prototype=Object.create(Pi.prototype),uu.prototype.constructor=uu);Object.defineProperties(uu.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});uu.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Vl.isSupported(this._scene)};uu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};uu.prototype._computeCenter=pe.throwInstantiationError;uu.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??ept,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 em(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ux(this._scene,a,o,s)}};uu.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Pi.prototype.destroy.call(this)};uu.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryHeightReference);return}return _s(t)?0:e};uu.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryExtrudedHeightReference);return}return _s(t)?uu.CLAMP_TO_GROUND:e};uu.CLAMP_TO_GROUND="clamp";uu.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=uu;var WEe=new z,qEe=h.ZERO,YEe=new h,XEe=new ie;function tpt(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 Rm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new tpt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Rm.prototype=Object.create(ii.prototype),Rm.prototype.constructor=Rm);Rm.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:Kn.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,WEe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qEe,YEe))),new Ft({id:t,geometry:new JT(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,WEe),r={show:new Pn(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 l(this._options.offsetAttribute)&&(r.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,qEe,YEe))),new Ft({id:t,geometry:new Z2(this._options),attributes:r})};Rm.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)};Rm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Pi.prototype._isHidden.call(this,e,t)};Rm.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)};Rm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,tt.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(tt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(tt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,tt.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(JT.computeRectangle(s,XEe)).minimumTerrainHeight),s.extrudedHeight=r};Rm.DynamicGeometryUpdater=Tw;function Tw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Tw.prototype=Object.create(Ii.prototype),Tw.prototype.constructor=Tw);Tw.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)};Tw.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(JT.computeRectangle(i,XEe)).minimumTerrainHeight),i.extrudedHeight=s};var Q2=Rm;function AG(){pe.throwInstantiationError()}Object.defineProperties(AG.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}});AG.prototype.update=function(e){pe.throwInstantiationError()};AG.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ds=AG;function s0(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(s0.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 KEe=new h;s0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,KEe);return mee(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};s0.prototype.isScaledSpacePointVisible=function(e){return mee(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var npt=new h;s0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=npt,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),mee(e,r,i)};s0.prototype.computeHorizonCullingPoint=function(e,t,n){return ZEe(this._ellipsoid,e,t,n)};var $Ee=ee.clone(ee.UNIT_SPHERE);s0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=JEe(this._ellipsoid,n,$Ee);return ZEe(r,e,t,i)};s0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return QEe(this._ellipsoid,e,t,n,i,r)};s0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=JEe(this._ellipsoid,r,$Ee);return QEe(s,e,t,n,i,o)};var ipt=[];s0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,ipt),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var rpt=new h;function JEe(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,rpt);e=ee.fromCartesian3(i,n)}return e}function ZEe(e,t,n,i){l(i)||(i=new h);let r=nCe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=eCe(e,c,r);if(u<0)return;o=Math.max(o,u)}return tCe(r,o,i)}var bG=new h;function QEe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=nCe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){bG.x=n[c]+r.x,bG.y=n[c+1]+r.y,bG.z=n[c+2]+r.z;let f=eCe(e,bG,s);if(f<0)return;a=Math.max(a,f)}return tCe(s,a,o)}function mee(e,t,n){let i=t,r=n,o=h.subtract(e,i,KEe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var opt=new h,spt=new h;function eCe(e,t,n){let i=e.transformPositionToScaledSpace(t,opt),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,spt);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 tCe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var hee=new h;function nCe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,hee),h.normalize(hee,hee))}var Om=s0;function cs(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=jt.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??Vo.NONE}var iCe=cs.SHOW_INDEX=0,sCe=cs.POSITION_INDEX=1,apt=cs.COLOR_INDEX=2,cpt=cs.OUTLINE_COLOR_INDEX=3,lpt=cs.OUTLINE_WIDTH_INDEX=4,upt=cs.PIXEL_SIZE_INDEX=5,fpt=cs.SCALE_BY_DISTANCE_INDEX=6,dpt=cs.TRANSLUCENCY_BY_DISTANCE_INDEX=7,hpt=cs.DISTANCE_DISPLAY_CONDITION_INDEX=8,mpt=cs.DISABLE_DEPTH_DISTANCE_INDEX=9,ppt=cs.SPLIT_DIRECTION_INDEX=10;cs.NUMBER_OF_PROPERTIES=11;function Xf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(cs.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Xf(this,iCe))}},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),Xf(this,sCe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Xf(this,fpt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Xf(this,dpt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Xf(this,upt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Xf(this,apt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Xf(this,cpt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Xf(this,lpt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){jt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=jt.clone(e,this._distanceDisplayCondition),Xf(this,hpt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Xf(this,mpt))}},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,Xf(this,iCe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Xf(this,ppt))}}});cs.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};cs.prototype._getActualPosition=function(){return this._actualPosition};cs.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Xf(this,sCe)};var rCe=new se;cs._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(N.multiplyByPoint(n,e,rCe),dr.computeActualEllipsoidPosition(t,rCe))};var oCe=new se;cs._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,oCe),oCe);return dr.worldToWindowCoordinates(n,r,i)};cs.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=cs._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};cs.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};cs.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)&&jt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};cs.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ia=cs;var qA=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; +in float v_splitDirection; +void main() { -#ifdef HAS_CLEARCOAT_TEXTURE -vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; -#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM -clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); -#endif -float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; -#ifdef HAS_CLEARCOAT_FACTOR -clearcoatFactor *= u_clearcoatFactor; -#endif -#else -#ifdef HAS_CLEARCOAT_FACTOR -float clearcoatFactor = u_clearcoatFactor; -#else -float clearcoatFactor = 0.0; -#endif -#endif -#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE -vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; -#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM -clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); -#endif -float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; -#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR -clearcoatRoughness *= u_clearcoatRoughnessFactor; -#endif -#else -#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR -float clearcoatRoughness = u_clearcoatRoughnessFactor; -#else -float clearcoatRoughness = 0.0; -#endif -#endif -material.clearcoatFactor = clearcoatFactor; -material.clearcoatRoughness = clearcoatRoughness; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); +if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; +if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +float maxDistance = max(0.0, 0.5 - v_pixelDistance); +float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); +float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); +vec4 color = mix(v_outlineColor, v_color, innerAlpha); +color.a *= wholeAlpha; +#if !defined(OPAQUE) && !defined(TRANSLUCENT) +if (color.a < 0.005) +{ +discard; +} #else -material.clearcoatNormal = attributes.normalEC; -#endif +#ifdef OPAQUE +if (color.a < 0.995) +{ +discard; } -#endif -#endif -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +#else +if (color.a >= 0.995) { -#ifdef USE_ANISOTROPY -NormalInfo normalInfo = getNormalInfo(attributes); -material.normalEC = normalInfo.normal; -#elif defined(HAS_NORMALS) -material.normalEC = computeNormal(attributes); -#endif -vec4 baseColorWithAlpha = vec4(1.0); -#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) -vec4 color = attributes.color_0; -#ifdef HAS_SRGB_COLOR -color = czm_srgbToLinear(color); -#endif -baseColorWithAlpha *= color; -#endif -#ifdef USE_CPU_STYLING -baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); +discard; +} #endif -material.baseColor = baseColorWithAlpha; -material.diffuse = baseColorWithAlpha.rgb; -material.alpha = baseColorWithAlpha.a; -#ifdef HAS_OCCLUSION_TEXTURE -vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; -#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM -occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif -material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); +} +`;var ek=`uniform float u_maxTotalPointSize; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; +in vec4 compressedAttribute1; +in vec4 scaleByDistance; +in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; +out float v_splitDirection; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +void main() +{ +vec3 positionHigh = positionHighAndSize.xyz; +vec3 positionLow = positionLowAndOutline.xyz; +float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; +float totalSize = positionHighAndSize.w + outlineWidthBothSides; +float outlinePercent = outlineWidthBothSides / totalSize; +totalSize *= czm_pixelRatio; +float temp = compressedAttribute1.x * SHIFT_RIGHT8; +float show = floor(temp); +#ifdef EYE_DISTANCE_TRANSLUCENCY +vec4 translucencyByDistance; +translucencyByDistance.x = compressedAttribute1.z; +translucencyByDistance.z = compressedAttribute1.w; +translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +temp = compressedAttribute1.y * SHIFT_RIGHT8; +translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -#ifdef HAS_EMISSIVE_TEXTURE -material.emissive = getEmissiveFromTexture(); -#elif defined(HAS_EMISSIVE_FACTOR) -material.emissive = u_emissiveFactor; +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) +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) +{ +lengthSq = czm_eyeHeight2D.y; +} +else +{ +lengthSq = dot(positionEC.xyz, positionEC.xyz); +} #endif -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -setSpecularGlossiness(material); -#elif defined(LIGHTING_PBR) -float metalness = setMetallicRoughness(material); -#ifdef USE_SPECULAR -setSpecular(material, metalness); +#ifdef EYE_DISTANCE_SCALING +totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); #endif -#ifdef USE_ANISOTROPY -setAnisotropy(material, normalInfo); +if (totalSize > 0.0) { +totalSize += 3.0; +} +totalSize = min(totalSize, u_maxTotalPointSize); +if (totalSize < 1.0) +{ +positionEC.xyz = vec3(0.0); +totalSize = 1.0; +} +float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY +translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); +if (translucency < 0.004) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef USE_CLEARCOAT -setClearcoat(material, attributes); +#ifdef DISTANCE_DISPLAY_CONDITION +float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; +float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; +if (lengthSq < nearSq || lengthSq > farSq) { +positionEC.xyz = vec3(0.0, 0.0, 1.0); +} #endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +#ifdef DISABLE_DEPTH_DISTANCE +float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; +if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistance = czm_minimumDisableDepthTestDistance; +} +if (disableDepthTestDistance != 0.0) +{ +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))) +{ +gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH +czm_vertexLogDepth(vec4(czm_currentFrustum.x)); #endif } -`;var bF=`#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 xF=`#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); +v_color = color; +v_color.a *= translucency * show; +v_outlineColor = outlineColor; +v_outlineColor.a *= translucency * show; +v_innerPercent = 1.0 - outlinePercent; +v_pixelDistance = 2.0 / totalSize; +gl_PointSize = totalSize * show; +gl_Position *= show; +v_pickColor = pickColor; +v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -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); +`;var gpt=Ia.SHOW_INDEX,_ee=Ia.POSITION_INDEX,aCe=Ia.COLOR_INDEX,_pt=Ia.OUTLINE_COLOR_INDEX,ypt=Ia.OUTLINE_WIDTH_INDEX,Apt=Ia.PIXEL_SIZE_INDEX,cCe=Ia.SCALE_BY_DISTANCE_INDEX,lCe=Ia.TRANSLUCENCY_BY_DISTANCE_INDEX,uCe=Ia.DISTANCE_DISPLAY_CONDITION_INDEX,bpt=Ia.DISABLE_DEPTH_DISTANCE_INDEX,xpt=Ia.SPLIT_DIRECTION_INDEX,yee=Ia.NUMBER_OF_PROPERTIES,yl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function sh(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(yee),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=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(sh.prototype,{length:{get:function(){return Aee(this),this._pointPrimitives.length}}});function fCe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}sh.prototype.add=function(e){let t=new Ia(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};sh.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};sh.prototype.removeAll=function(){fCe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Aee(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}}sh.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};sh.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};sh.prototype.get=function(e){return Aee(this),this._pointPrimitives[e]};sh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<yee;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function Tpt(e,t,n){return new n_(e,[{index:yl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[_ee]},{index:yl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[_ee]},{index:yl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[aCe]},{index:yl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[lCe]},{index:yl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[cCe]},{index:yl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[uCe]}],t)}var pee=new Sn,xG=new z;function dCe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,pee);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[yl.positionHighAndSize],u=pee.high;c(r,u.x,u.y,u.z,s);let f=n[yl.positionLowAndOutline],d=pee.low;f(r,d.x,d.y,d.z,a)}var Ept=256;function hCe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;xG.red=o.alpha,xG.green=s.alpha,xG.blue=a.alpha;let c=n[yl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(xG))}function mCe(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)*Ept+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[yl.compressedAttribute1];g(r,d,p,o,a)}function pCe(e,t,n,i){let r=i._index,o=n[yl.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 gCe(e,t,n,i){let r=i._index,o=n[yl.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 Cpt(e,t,n,i){dCe(e,t,n,i),hCe(e,t,n,i),mCe(e,t,n,i),pCe(e,t,n,i),gCe(e,t,n,i)}function gee(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=Ia._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function vpt(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)&&gee(e,i,i.length,t,o,!0)):n===re.MORPHING?gee(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&gee(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function Spt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var wpt=[];sh.prototype.update=function(e){if(Aee(this),!this.show)return;this._maxTotalPointSize=Ut.maximumAliasedPointSize,vpt(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<yee;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Tpt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,Cpt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=wpt;v.length=0,(o[_ee]||o[ypt]||o[Apt])&&v.push(dCe),(o[aCe]||o[_pt])&&v.push(hCe),(o[gpt]||o[lCe])&&v.push(mCe),o[cCe]&&v.push(pCe),(o[uCe]||o[bpt]||o[xpt])&&v.push(gCe);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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),Spt(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:[ek]}),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:[qA]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl}),y=new Ye({defines:["TRANSLUCENT"],sources:[qA]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl})),this._blendOption===Fi.OPAQUE&&(y=new Ye({sources:[qA]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl})),this._blendOption===Fi.TRANSLUCENT&&(y=new Ye({sources:[qA]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl})),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)}}};sh.prototype.isDestroyed=function(){return!1};sh.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(),fCe(this._pointPrimitives),le(this)};var Ew=sh;var _Ce=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],bee=1,tk=8,ls=new Uint32Array(96),ik=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!==bee)throw new Error(`Got v${r} data when expected v${bee}.`);let o=_Ce[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=_Ce.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,tk,t),this.coords=new i(o,tk+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(tk+a+c+u);this.ids=new this.IndexArrayType(f,tk,t),this.coords=new i(f,tk+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(bee<<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 Tee(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;ls[0]=0,ls[1]=o.length-1,ls[2]=0;let c=3,u=[];for(;c>0;){let f=ls[--c],d=ls[--c],p=ls[--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)&&(ls[c++]=p,ls[c++]=g-1,ls[c++]=1-f),(f===0?i>=m:r>=y)&&(ls[c++]=g+1,ls[c++]=d,ls[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;ls[0]=0,ls[1]=o.length-1,ls[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=ls[--c],p=ls[--c],g=ls[--c];if(p-g<=a){for(let b=g;b<=p;b++)yCe(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];yCe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(ls[c++]=g,ls[c++]=m-1,ls[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(ls[c++]=m+1,ls[c++]=p,ls[c++]=1-d)}return u}};function Tee(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;ACe(e,t,s,i,r,o),Tee(e,t,n,i,s-1,1-o),Tee(e,t,n,s+1,r,1-o)}function ACe(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));ACe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(nk(e,t,i,n),t[2*r+o]>s&&nk(e,t,i,r);a<c;){for(nk(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?nk(e,t,i,c):(c++,nk(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function nk(e,t,n,i){xee(e,n,i),xee(t,2*n,2*i),xee(t,2*n+1,2*i+1)}function xee(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function yCe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function Mm(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 bCe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Ipt=new et;function xCe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=IA.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Br.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Ia.getScreenSpaceBoundingBox(e,t,r)),bCe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&ECe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=IA.getScreenSpaceBoundingBox(s,t,Ipt);bCe(a,n),r=et.union(r,a,r)}return r}function Ppt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&ECe(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 TCe(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 ECe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Eee(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 Dpt=new et,Rpt=new et,Opt=new et;function Mpt(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 e0({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Gf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new Ew;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 Om(y,A),x=[];e._clusterLabels&&Eee(i,x,n,b,e),e._clusterBillboards&&Eee(r,x,n,b,e),e._clusterPoints&&Eee(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,P;if(x.length>0){let M=new ik(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(TCe(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=xCe(V,F.coord,u,e,Dpt);let B=et.clone(S,Rpt);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=xCe(k,L.coord,u,e,Opt);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(TCe(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 Ppt(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}}Mm.prototype._initialize=function(e){this._scene=e;let t=Mpt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Mm.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 vee(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 See(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Mm.prototype.getLabel=vee("_labelCollection",e0,"_unusedLabelIndices","labelIndex");Mm.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,See(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};Mm.prototype.getBillboard=vee("_billboardCollection",Gf,"_unusedBillboardIndices","billboardIndex");Mm.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,See(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};Mm.prototype.getPoint=vee("_pointCollection",Ew,"_unusedPointIndices","pointIndex");Mm.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,See(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Cee(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Npt(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,Cee(e._labelCollection),Cee(e._billboardCollection),Cee(e._pointCollection))}Mm.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,Npt(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)};Mm.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 Kf=Mm;function wee(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 Ya(this),this._entityCluster=new Kf}Object.defineProperties(wee.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){Ds.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}}});wee.prototype.update=function(e){return!0};var rk=wee;var CCe={};CCe.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 ZT=CCe;var Iee=new U,Lpt=new h,Fpt=new h,Bpt=new h,kpt=new h;function S_(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"}S_.packedLength=Be.packedLength+5;S_.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 vCe=new Be,Cw={vertexFormat:vCe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};S_.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,vCe);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):(Cw.length=r,Cw.topRadius=o,Cw.bottomRadius=s,Cw.slices=a,Cw.offsetAttribute=c===-1?void 0:c,new S_(Cw))};S_.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=ZT.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=Lpt;C.z=Math.sin(_);let w=Math.cos(_),P=Bpt,M=Fpt;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,kpt);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})),Iee.x=t*.5,Iee.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(Iee));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 Pee;S_.getUnitCylinder=function(){return l(Pee)||(Pee=S_.createGeometry(new S_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),Pee};var ok=S_;var Dee=new U;function vw(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"}vw.packedLength=6;vw.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 QT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};vw.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):(QT.length=i,QT.topRadius=r,QT.bottomRadius=o,QT.slices=s,QT.numberOfVerticalLines=a,QT.offsetAttribute=c===-1?void 0:c,new vw(QT))};vw.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=ZT.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}),Dee.x=t*.5,Dee.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(Dee));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 sk=vw;var SCe=h.ZERO,wCe=new h,Upt=new h,ICe=new z;function zpt(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 $f(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new zpt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&($f.prototype=Object.create(Pi.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=Kn.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,ICe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,SCe,wCe))),new Ft({id:t,geometry:new ok(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.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,ICe),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,SCe,wCe))),new Ft({id:t,geometry:new sk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.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(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Pi.prototype._isHidden.call(this,e,t)};$f.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)};$f.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,tt.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(tt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(tt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(tt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,tt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,tt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};$f.prototype._onEntityPropertyChanged=vg;$f.DynamicGeometryUpdater=Sw;function Sw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Sw.prototype=Object.create(Ii.prototype),Sw.prototype.constructor=Sw);Sw.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Upt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ii.prototype._isHidden.call(this,e,t,n)};Sw.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 ak=$f;var PCe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(PCe);var Rs=PCe;var DCe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(DCe);var Vr=DCe;var RCe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(RCe);var fu=RCe;var OCe=Qo(xf(),1);function Vpt(e){let t=new OCe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var w_=Vpt;var jpt=D.factorial;function Ree(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+=Ree(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 Hpt=[],Oee=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/jpt(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=Ree(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=Hpt,m=Gpt(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=Ree(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 Gpt(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 ck=Oee;var Mee=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}},lk=Mee;var Nee=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}},YA=Nee;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 uk=Al;var pk=Qo(xf(),1);var Lee;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?Lee=function(){return performance.now()}:Lee=function(){return Date.now()};var xn=Lee;function Fee(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??Rs.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??Vr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(Fee.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Vr.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===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Fee.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Vr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Vr.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===Rs.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===Rs.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 Nm=Fee;function eE(){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(eE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Wl("startTime"),stopTime:Wl("stopTime"),currentTime:Wl("currentTime"),clockRange:Wl("clockRange"),clockStep:Wl("clockStep"),multiplier:Wl("multiplier")});eE.prototype.clone=function(e){return l(e)||(e=new eE),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};eE.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};eE.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};eE.prototype.getValue=function(e){return l(e)||(e=new Nm),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 Lm=eE;var Wpt=z.WHITE,qpt=.1,Ypt=new U(8,8),Xpt=new U(0,0),Kpt=new U(1,1);function ww(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(ww.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")});ww.prototype.getType=function(e){return"Grid"};var $pt=new K;ww.prototype.getValue=function(e,t){return l(e)||(e=K.now($pt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Wpt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,qpt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,Ypt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,Kpt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,Xpt,t.lineOffset),t};ww.prototype.equals=function(e){return this===e||e instanceof ww&&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 Iw=ww;var MCe={WHOLE:0,PORTIONS:1};Object.freeze(MCe);var a0=MCe;function Pw(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Pw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});Pw.prototype.getType=function(e){return"PolylineArrow"};var Jpt=new K;Pw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Jpt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Pw.prototype.equals=function(e){return this===e||e instanceof Pw&&X.equals(this._color,e._color)};var Dw=Pw;var Zpt=z.WHITE,Qpt=z.TRANSPARENT,e0t=16,t0t=255;function Rw(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(Rw.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")});Rw.prototype.getType=function(e){return"PolylineDash"};var n0t=new K;Rw.prototype.getValue=function(e,t){return l(e)||(e=K.now(n0t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Zpt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,Qpt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,e0t,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,t0t,t.dashPattern),t};Rw.prototype.equals=function(e){return this===e||e instanceof Rw&&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 Ow=Rw;var i0t=z.WHITE,r0t=.25,o0t=1;function Mw(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(Mw.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")});Mw.prototype.getType=function(e){return"PolylineGlow"};var s0t=new K;Mw.prototype.getValue=function(e,t){return l(e)||(e=K.now(s0t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,i0t,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,r0t,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,o0t,t.taperPower),t};Mw.prototype.equals=function(e){return this===e||e instanceof Mw&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var Nw=Mw;var a0t=z.WHITE,c0t=z.BLACK,l0t=1;function Lw(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(Lw.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")});Lw.prototype.getType=function(e){return"PolylineOutline"};var u0t=new K;Lw.prototype.getValue=function(e,t){return l(e)||(e=K.now(u0t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,a0t,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,c0t,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,l0t),t};Lw.prototype.equals=function(e){return this===e||e instanceof Lw&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var XA=Lw;function I_(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Xo,this._referenceFrame=t??ji.FIXED,this.setValue(e)}Object.defineProperties(I_.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 f0t=new K;I_.prototype.getValue=function(e,t){return l(e)||(e=K.now(f0t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};I_.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};I_.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,I_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};I_.prototype.equals=function(e){return this===e||e instanceof I_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};I_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var P_=I_;function KA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Xo,this.setValue(e)}Object.defineProperties(KA.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 d0t=new K;KA.prototype.getValue=function(e,t){l(e)||(e=K.now(d0t));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};KA.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,KA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};KA.prototype.equals=function(e){return this===e||e instanceof KA&&X.arrayEquals(this._value,e._value)};KA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Fw=KA;function NCe(e,t,n){let i=new WeakRef(t),r=e.addEventListener(function(){let o=i.deref();l(o)?n.apply(o,arguments):r()});return r}function tE(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}e._removeTargetListener=NCe(n.definitionChanged,e,ah.prototype._onTargetEntityDefinitionChanged),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 ah(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,this._removeTargetListener=void 0,NCe(e.collectionChanged,this,ah.prototype._onCollectionChanged)}Object.defineProperties(ah.prototype,{isConstant:{get:function(){return X.isConstant(tE(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=tE(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 tE(this)}}});ah.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 ah(e,n,i)};var h0t=new K;ah.prototype.getValue=function(e,t){let n=tE(this);return l(e)||(e=K.now(h0t)),l(n)?n.getValue(e,t):void 0};ah.prototype.getValueInReferenceFrame=function(e,t,n){let i=tE(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};ah.prototype.getType=function(e){let t=tE(this);return l(t)?t.getType(e):void 0};ah.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};ah.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};ah.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=tE(this),l(i)&&this._definitionChanged.raiseEvent(this))};var D_=ah;var m0t={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}},ch=m0t;var LCe={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 FCe(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 BCe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var Bee=[],kee=[];function TG(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=BCe(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=BCe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(Bee[p++]=f,o=o+1,s=0;s<r;s++)kee[g++]=i[o],o=o+1;a=f}p>0&&(kee.length=g,FCe(n,u,kee),Bee.length=p,FCe(t,c,Bee))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function lh(e,t){let n=e;n===Number&&(n=LCe);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=LCe);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=YA,this._lastInterpolationAlgorithm=YA,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=fu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=fu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(lh.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 p0t=new K;lh.prototype.getValue=function(e,t){l(e)||(e=K.now(p0t));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===fu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===fu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===fu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===fu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===fu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===fu.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)};lh.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))};lh.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)}TG(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};lh.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)}TG(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};lh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};lh.prototype.addSamplesPackedArray=function(e,t){TG(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};lh.prototype.removeSample=function(e){let t=vr(this._times,e,K.compare);return t<0?!1:(kCe(this,t,1),!0)};function kCe(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)}lh.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,kCe(this,n,i-n)};lh.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};lh._mergeNewSamples=TG;var Jf=lh;function uh(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 Jf(h,n),this._definitionChanged=new be,this._referenceFrame=e??ji.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(uh.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 g0t=new K;uh.prototype.getValue=function(e,t){return l(e)||(e=K.now(g0t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};uh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return $h.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};uh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};uh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};uh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};uh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};uh.prototype.removeSample=function(e){return this._property.removeSample(e)};uh.prototype.removeSamples=function(e){this._property.removeSamples(e)};uh.prototype.equals=function(e){return this===e||e instanceof uh&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var gc=uh;var UCe={HORIZONTAL:0,VERTICAL:1};Object.freeze(UCe);var Fm=UCe;var _0t=Fm.HORIZONTAL,y0t=z.WHITE,A0t=z.BLACK,b0t=0,x0t=1;function Bw(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(Bw.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")});Bw.prototype.getType=function(e){return"Stripe"};var T0t=new K;Bw.prototype.getValue=function(e,t){return l(e)||(e=K.now(T0t)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,_0t)===Fm.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,y0t,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,A0t,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,b0t),t.repeat=X.getValueOrDefault(this._repeat,e,x0t),t};Bw.prototype.equals=function(e){return this===e||e instanceof Bw&&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 kw=Bw;function $A(e){this._definitionChanged=new be,this._intervals=new Ps,this._intervals.changedEvent.addEventListener($A.prototype._intervalsChanged,this),this._referenceFrame=e??ji.FIXED}Object.defineProperties($A.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 E0t=new K;$A.prototype.getValue=function(e,t){return l(e)||(e=K.now(E0t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};$A.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return $h.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};$A.prototype.equals=function(e){return this===e||e instanceof $A&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};$A.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var R_=$A;function nE(){this._definitionChanged=new be,this._intervals=new Ps,this._intervals.changedEvent.addEventListener(nE.prototype._intervalsChanged,this)}Object.defineProperties(nE.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var C0t=new K;nE.prototype.getValue=function(e,t){l(e)||(e=K.now(C0t));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};nE.prototype.equals=function(e){return this===e||e instanceof nE&&this._intervals.equals(e._intervals,X.equals)};nE.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var O_=nE;function Uw(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(Uw.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 v0t=new h,zCe=new h,VCe=new K,S0t=new K,Uee=1/60;Uw.prototype.getValue=function(e,t){return this._getValue(e,t)};Uw.prototype._getValue=function(e,t,n){l(e)||(e=K.now(S0t)),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,v0t),o=i.getValue(K.addSeconds(e,Uee,VCe),zCe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-Uee,VCe),zCe),!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,Uee,t)};Uw.prototype.equals=function(e){return this===e||e instanceof Uw&&X.equals(this._position,e._position)};var M_=Uw;function fk(e,t){this._velocityVectorProperty=new M_(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(fk.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 jCe=new h,w0t=new h,HCe=new $,I0t=new K;fk.prototype.getValue=function(e,t){l(e)||(e=K.now(I0t));let n=this._velocityVectorProperty._getValue(e,w0t,jCe);if(l(n))return At.rotationMatrixFromPositionVelocity(jCe,n,this._ellipsoid,HCe),Le.fromRotationMatrix(HCe,t)};fk.prototype.equals=function(e){return this===e||e instanceof fk&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var dk=fk;var N_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};N_.validate=function(e){return e===N_.COMPLETE||e===N_.BELOW_ELLIPSOID_HORIZON||e===N_.ABOVE_ELLIPSOID_HORIZON};N_.toString=function(e){switch(e){case N_.COMPLETE:return"COMPLETE";case N_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case N_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var zw=N_;function JA(){}JA.packedLength=h.packedLength;JA.unpack=h.unpack;JA.pack=h.pack;var zee;function hk(e,t){return t[0]==="#"&&(t=zee+t),D_.fromString(e,t)}function GCe(e,t,n){if(l(n.reference))return hk(t,n.reference);if(l(n.velocityReference)){let i=hk(t,n.velocityReference);switch(e){case h:case JA:return new M_(i,e===JA);case Le:return new dk(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function P0t(e,t){return new em(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var pr=new h,du=new uk,bl=new he,iE=new En,EG=new Le;function D0t(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 WCe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function R0t(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 O0t(e){let t=e.length;if(du.magnitude=1,t===2)return du.clock=e[0],du.cone=e[1],h.fromSpherical(du,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],du.clock=e[i+1],du.cone=e[i+2],h.fromSpherical(du,pr),n[r+1]=pr.x,n[r+2]=pr.y,n[r+3]=pr.z;return n}function M0t(e){let t=e.length;if(t===3)return du.clock=e[0],du.cone=e[1],du.magnitude=e[2],h.fromSpherical(du,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],du.clock=e[i+1],du.cone=e[i+2],du.magnitude=e[i+3],h.fromSpherical(du,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function N0t(e){let t=e.length;if(t===3)return bl.longitude=e[0],bl.latitude=e[1],bl.height=e[2],ee.default.cartographicToCartesian(bl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bl.longitude=e[i+1],bl.latitude=e[i+2],bl.height=e[i+3],ee.default.cartographicToCartesian(bl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function L0t(e){let t=e.length;if(t===3)return bl.longitude=D.toRadians(e[0]),bl.latitude=D.toRadians(e[1]),bl.height=e[2],ee.default.cartographicToCartesian(bl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bl.longitude=D.toRadians(e[i+1]),bl.latitude=D.toRadians(e[i+2]),bl.height=e[i+3],ee.default.cartographicToCartesian(bl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function Vee(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 O0t(r);let o=e.spherical;if(l(o))return M0t(o);let s=e.cartographicRadians;if(l(s))return N0t(s);let a=e.cartographicDegrees;if(l(a))return L0t(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function qCe(e,t){h.unpack(e,t,pr),h.normalize(pr,pr),h.pack(pr,e,t)}function F0t(e){let t=Vee(e);if(t.length===3)return qCe(t,0),t;for(let n=1;n<t.length;n+=4)qCe(t,n);return t}function YCe(e,t){Le.unpack(e,t,EG),Le.normalize(EG,EG),Le.pack(EG,e,t)}function B0t(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return YCe(t,0),t;for(let n=1;n<t.length;n+=5)YCe(t,n)}return t}function XCe(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")?JA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?Qn:e.hasOwnProperty("colorBlendMode")?ll:e.hasOwnProperty("cornerType")?rr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?zi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?Ao:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?jt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?a0:e.hasOwnProperty("shadowMode")?Dn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Fm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?pk.default:e.hasOwnProperty("verticalOrigin")?Hn:Object}function k0t(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 Vee(t);case JA:return F0t(t);case z:return D0t(t);case Qn:return Qn[t.classificationType??t];case ll:return ll[t.colorBlendMode??t];case rr:return rr[t.cornerType??t];case We:return We[t.heightReference??t];case zi:return zi[t.horizontalOrigin??t];case Image:return WCe(t,n);case K:return K.fromIso8601(t.date??t);case Ao:return Ao[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case jt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case a0:return a0[t.pathMode??t];case Le:return B0t(t);case ch:return t.number??t;case zw:return zw[t.portionToDisplay??t];case Dn:return Dn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Fm:return Fm[t.stripeOrientation??t];case ie:return R0t(t);case pk.default:return WCe(t,n);case Hn:return Hn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var U0t={HERMITE:ck,LAGRANGE:lk,LINEAR:YA};function CG(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:U0t[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=fu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=fu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var KCe={iso8601:void 0};function Ko(e){if(l(e))return KCe.iso8601=e,En.fromIso8601(KCe)}function jee(e){let t=tt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function $Ce(e){let t=new _l;return t.intervals.addInterval(jee(e)),t}function JCe(e){let t=new mc(e.referenceFrame);return t.intervals.addInterval(jee(e)),t}function vG(e,t,n,i,r,o,s){let a=Ko(i.interval);l(r)&&(l(a)?a=En.intersect(a,r,iE):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(tt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return cve(t[n],a)}let g=!1;if(d){if(u=k0t(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!==ch;if(!g&&!p){d?t[n]=new li(m?e.unpack(u,0):u):t[n]=GCe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Jf||(t[n]=y=new Jf(e)),y.addSamplesPackedArray(u,A),CG(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=GCe(e,s,i),l(y)||(t[n]=y=d?new O_:new _l),d&&y instanceof O_?y.intervals.addInterval(a):y instanceof _l?(d&&(a.data=new li(a.data)),y.intervals.addInterval(a)):(t[n]=y=$Ce(y),d&&(a.data=new li(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new _l),y instanceof _l||(t[n]=y=$Ce(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof Jf))&&(x=a.clone(),x.data=new Jf(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),CG(i,x.data)}function cve(e,t){if(e instanceof Jf){e.removeSamples(t);return}else if(e instanceof O_){e.intervals.removeInterval(t);return}else if(e instanceof _l){let n=e.intervals;for(let i=0;i<n.length;++i){let r=En.intersect(n.get(i),t,iE);r.isEmpty||cve(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)vG(e,t,n,i[a],r,o,s);else vG(e,t,n,i,r,o,s)}function ZCe(e,t,n,i,r,o){let s=Ko(n.interval);l(i)&&(l(s)?s=En.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(tt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return lve(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=ji[n.referenceFrame]),g=g??ji.FIXED,u=Vee(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new Gl(h.unpack(u),g):e[t]=hk(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof gc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new gc(g,a)),y.addSamplesPackedArray(u,A),CG(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=hk(o,n.reference),l(y)||(d?y=new R_(g):y=new mc(g),e[t]=y),d&&y instanceof R_&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof mc?(d&&(s.data=new Gl(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=JCe(y),d&&(s.data=new Gl(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof mc||(e[t]=y=JCe(y)):e[t]=y=new mc(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof gc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new gc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),CG(n,x.data)}function lve(e,t){if(e instanceof gc){e.removeSamples(t);return}else if(e instanceof R_){e.intervals.removeInterval(t);return}else if(e instanceof mc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=En.intersect(n.get(i),t,iE);r.isEmpty||lve(r.data,t)}n.removeInterval(t);return}}function uve(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)ZCe(e,t,n[s],i,r,o);else ZCe(e,t,n,i,r,o)}function QCe(e,t,n,i){l(n.references)?SG(e,t,n.references,n.interval,i,Fw,_l):(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 eve(e,t,n,i,r,o){let s=Ko(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,iE):s=i);let a=e[t],c,u;if(l(s)){a instanceof yw||(a=new yw,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 Iw||(c=new Iw),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 Hy||(c=new Hy),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 kw||(c=new kw),f=n.stripe,Ee(Fm,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 XA||(c=new XA),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 Nw||(c=new Nw),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 Dw||(c=new Dw),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof Ow||(c=new Ow),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 Zf(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)eve(e,t,n[s],i,r,o);else eve(e,t,n,i,r,o)}function z0t(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function V0t(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function j0t(e,t,n,i){let r=t.position;l(r)&&uve(e,"position",r,void 0,i,n)}function H0t(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function G0t(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function W0t(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new ql);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)vG(XCe(s[a]),e.properties,o,s[a],void 0,i,n);else vG(XCe(s),e.properties,o,s,void 0,i,n)}}}function SG(e,t,n,i,r,o,s){let a=n.map(function(c){return hk(r,c)});if(l(i)){i=Ko(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(jee(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function tve(e,t,n,i){let r=n.references;l(r)?SG(e,t,r,n.interval,i,Fw,_l):Ee(Array,e,t,n,void 0,void 0,i)}function nve(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)tve(e,t,n[r],i);else tve(e,t,n,i)}function ive(e,t,n,i){let r=n.references;l(r)?SG(e,t,r,n.interval,i,P_,mc):(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 gk(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)ive(e,t,n[r],i);else ive(e,t,n,i)}function q0t(e){return h.unpackArray(e)}function Y0t(e){return h.fromRadiansArrayHeights(e,ee.default)}function X0t(e){return h.fromDegreesArrayHeights(e,ee.default)}function rve(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return SG(a,"positions",s,n.interval,i,P_,mc),a.positions});e[t]=new P_(o)}else l(n.cartesian)?n.array=n.cartesian.map(q0t):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Y0t):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(X0t)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function K0t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)rve(e,t,n[r],i);else rve(e,t,n,i)}function $0t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)QCe(e,t,n[r],i);else QCe(e,t,n,i)}function J0t(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 Ps),o.addInterval(Ko(r[s]));else o=new Ps,o.addInterval(Ko(r));e.availability=o}function Z0t(e,t,n,i,r){l(t)&&Ee(JA,e,"alignedAxis",t,n,i,r)}function Q0t(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Ko(r.interval),s=e.billboard;l(s)||(e.billboard=s=new qc),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(zi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Hn,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(ch,s,"rotation",r.rotation,o,i,n),Z0t(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function egt(e,t,n,i){let r=t.box;if(!l(r))return;let o=Ko(r.interval),s=e.box;l(s)||(e.box=s=new Px),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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function tgt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Ko(r.interval),s=e.corridor;l(s)||(e.corridor=s=new Rx),Ee(Boolean,s,"show",r.show,o,i,n),gk(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(rr,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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function ngt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Ko(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Ox),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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function igt(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 rgt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Ko(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Mx),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(ch,s,"rotation",r.rotation,o,i,n),Ee(ch,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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function ogt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Ko(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Nx),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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function sgt(e,t,n,i){let r=t.label;if(!l(r))return;let o=Ko(r.interval),s=e.label;l(s)||(e.label=s=new Jh),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(Ao,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(zi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Hn,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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function agt(e,t,n,i){let r=t.model;if(!l(r))return;let o=Ko(r.interval),s=e.model;l(s)||(e.model=s=new Tg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(pk.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(ll,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(jt,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)ove(s,u[a],o,i,n);else ove(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)sve(s,f[a],o,i,n);else sve(s,f,o,i,n)}function ove(e,t,n,i,r){let o=Ko(t.interval);l(n)&&(l(o)?o=En.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 ql),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new Lx),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 sve(e,t,n,i,r){let o=Ko(t.interval);l(n)&&(l(o)?o=En.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 ql),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function cgt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Ko(r.interval),s=e.path;l(s)||(e.path=s=new Eg),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),Zf(s,"material",r.material,o,i,n),Ee(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(a0,s,"materialMode",r.materialMode,o,i,n)}function lgt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Ko(r.interval),s=e.point;l(s)||(e.point=s=new Bx),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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function mk(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(mk.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}}});mk.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 Rc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Rc(n,i)};mk.prototype.equals=function(e){return this===e||e instanceof mk&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function ugt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Ko(r.interval),s=e.polygon;l(s)||(e.polygon=s=new Zh),Ee(Boolean,s,"show",r.show,o,i,n),gk(s,"_positions",r.positions,n),K0t(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new mk(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(ch,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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function fgt(e){return e?ln.GEODESIC:ln.NONE}function dgt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Ko(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new el),Ee(Boolean,s,"show",r.show,o,i,n),gk(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Zf(s,"material",r.material,o,i,n),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,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=P0t(a.followSurface,fgt)}}function hgt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Ko(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new kx),gk(s,"positions",r.positions,n),$0t(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(rr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function mgt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Ko(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Qh),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(ch,s,"rotation",r.rotation,o,i,n),Ee(ch,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),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function pgt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Ko(r.interval),s=e.tileset;l(s)||(e.tileset=s=new Fx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(pk.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function ggt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Ko(r.interval),s=e.wall;l(s)||(e.wall=s=new Cg),Ee(Boolean,s,"show",r.show,o,i,n),gk(s,"positions",r.positions,n),nve(s,"minimumHeights",r.minimumHeights,n),nve(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Zf(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(jt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function ave(e,t,n,i,r){let o=e.id;if(l(o)||(o=$n()),zee=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")igt(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)}zee=void 0}function _gt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(tt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Lm,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=Rs.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Lm,t.startTime=tt.MINIMUM_VALUE.clone(),t.stopTime=tt.MAXIMUM_VALUE.clone(),t.currentTime=tt.MINIMUM_VALUE.clone(),t.clockRange=Rs.LOOP_STOP,t.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Ko(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=Rs[n.range]??Rs.LOOP_STOP),l(n.step)&&(t.clockStep=Vr[n.step]??Vr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function fve(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),Ds.setLoading(e,!0),Promise.resolve(r).then(function(a){return ygt(e,a,o,i)}).catch(function(a){return Ds.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function ygt(e,t,n,i){Ds.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new dve,r.removeAll()),sa._processCzml(t,r,n,void 0,e);let o=_gt(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=w_(n.getUrlComponent()),o=!0),Ds.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function dve(){this.name=void 0,this.clock=void 0}function sa(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 dve,this._version=void 0,this._entityCollection=new Ya(this),this._entityCluster=new Kf,this._credit=void 0,this._resourceCredits=[]}sa.load=function(e,t){return new sa().load(e,t)};Object.defineProperties(sa.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}}});sa.updaters=[Q0t,egt,tgt,ngt,rgt,ogt,sgt,agt,z0t,V0t,cgt,lgt,ugt,dgt,hgt,W0t,mgt,j0t,pgt,H0t,ggt,G0t,J0t];sa.registerUpdater=function(e){sa.updaters.includes(e)||sa.updaters.push(e)};sa.unregisterUpdater=function(e){if(sa.updaters.includes(e)){let t=sa.updaters.indexOf(e);sa.updaters.splice(t,1)}};sa.prototype.process=function(e,t){return fve(this,e,t,!1)};sa.prototype.load=function(e,t){return fve(this,e,t,!0)};sa.prototype.update=function(e){return!0};sa.processPacketData=Ee;sa.processPositionPacketData=uve;sa.processMaterialPacketData=Zf;sa._processCzml=function(e,t,n,i,r){if(i=i??sa.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)ave(e[o],t,i,n,r);else ave(e,t,i,n,r)};var _k=sa;function hu(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(hu.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}}});hu.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})};hu.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};hu.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=[]};hu.prototype.contains=function(e){return this.indexOf(e)!==-1};hu.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};hu.prototype.get=function(e){return this._dataSources[e]};hu.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function wG(e,t){return e.indexOf(t)}function hve(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)}hu.prototype.raise=function(e){let t=wG(this._dataSources,e);hve(this,t,t+1)};hu.prototype.lower=function(e){let t=wG(this._dataSources,e);hve(this,t,t-1)};hu.prototype.raiseToTop=function(e){let t=wG(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))};hu.prototype.lowerToBottom=function(e){let t=wG(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};hu.prototype.isDestroyed=function(){return!1};hu.prototype.destroy=function(){return this.removeAll(!0),le(this)};var yk=hu;function _c(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=$n(),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(_c.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});_c.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};_c.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};_c.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};_c.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=[]};_c.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function IG(e,t){return e._primitives.indexOf(t)}_c.prototype.raise=function(e){if(l(e)){let t=IG(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};_c.prototype.raiseToTop=function(e){if(l(e)){let t=IG(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};_c.prototype.lower=function(e){if(l(e)){let t=IG(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};_c.prototype.lowerToBottom=function(e){if(l(e)){let t=IG(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};_c.prototype.get=function(e){return this._primitives[e]};_c.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};_c.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)}};_c.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)}};_c.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)}};_c.prototype.isDestroyed=function(){return!1};_c.prototype.destroy=function(){return this.removeAll(),le(this)};var xl=_c;function c0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(c0.prototype,{length:{get:function(){return this._length}}});c0.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,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};c0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};c0.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};c0.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};c0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};c0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){return this.removeAll(),le(this)};var Ak=c0;function Vw(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new kt}Vw.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};Vw.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};Vw.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};Vw.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};Vw.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var rE=Vw;var Gee={},PG=new h,mve=new h,pve=new Le,gve=new $;function jw(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),PG),h.multiplyByScalar(n,Math.sin(f),mve),h.add(PG,mve,PG);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(PG,m,pve),$.fromQuaternion(pve,gve),$.multiplyByVector(gve,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var _ve=new h,yve=new h,Hee=new h,Agt=new h;Gee.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,_ve);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,yve),y=i.geodeticSurfaceNormal(g,Agt),A=h.multiplyByScalar(y,r,Hee);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 bgt=new h,xgt=new h,Tgt=new h;Gee.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,bgt),g=h.cross(h.UNIT_Z,s,xgt);g=h.normalize(g,g);let m=h.cross(p,g,Tgt),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=_ve,S=yve,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=jw(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=jw(b,o,m,g,c,f,u,d,p,v),S=jw(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,Hee),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=jw(-b,o,m,g,c,f,u,d,p,v),S=jw(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,Hee),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=jw(-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 Qu=Gee;var Hw=new h,Wee=new h,qee=new h,Ave=new h,Pa=new U,bve=new $,Egt=new $,Yee=new Le,xve=new h,Tve=new h,Eve=new h,OG=new he,Cve=new h,vve=new U,Sve=new U;function wve(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=xve,x=Tve,T=Eve,E=new Ui(a),v=E.project(a.cartesianToCartographic(r,OG),Cve),S=a.scaleToGeodeticSurface(r,Hw);a.geodeticSurfaceNormal(S,S);let I=bve,R=Egt;if(c!==0){let M=Le.fromAxisAngle(S,c,Yee);I=$.fromQuaternion(M,I),M=Le.fromAxisAngle(S,-c,Yee),R=$.fromQuaternion(M,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,vve),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Sve),_=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,Hw);if(i.st){let j=$.multiplyByVector(I,B,Wee),k=E.project(a.cartesianToCartographic(j,OG),qee);h.subtract(k,v,k),Pa.x=(k.x+o)/(2*o),Pa.y=(k.y+s)/(2*s),O.x=Math.min(Pa.x,O.x),O.y=Math.min(Pa.y,O.y),L.x=Math.max(Pa.x,L.x),L.y=Math.max(Pa.y,L.y),n&&(d[A+w]=Pa.x,d[A+1+w]=Pa.y),d[A++]=Pa.x,d[A++]=Pa.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=Qu.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 Ive(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 oE=new h;function Cgt(e){let t=e.center;oE=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,oE),e.height,oE),oE=h.add(t,oE,oE);let n=new ue(oE,e.semiMajorAxis),i=Qu.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=wve(r,e,!1),a=Ive(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function vgt(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=xve,E=Tve,v=Eve,S=new Ui(s),I=S.project(s.cartesianToCartographic(i,OG),Cve),R=s.scaleToGeodeticSurface(i,Hw);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,Yee),L=$.fromQuaternion(O,bve),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,vve),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Sve),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,Hw),k;if(n.st){let q=$.multiplyByVector(L,j,Wee),Q=S.project(s.cartesianToCartographic(q,OG),qee);h.subtract(Q,I,Q),Pa.x=(Q.x+r)/(2*r),Pa.y=(Q.y+o)/(2*o),_.x=Math.min(Pa.x,_.x),_.y=Math.min(Pa.y,_.y),C.x=Math.max(Pa.x,C.x),C.y=Math.max(Pa.y,C.y),p[x+P]=Pa.x,p[x+1+P]=Pa.y,p[x++]=Pa.x,p[x++]=Pa.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,Wee),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,Ave);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,Ave);h.subtract(q,j,q);let Q=h.subtract(k,j,qee);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 Sgt(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 DG=new ue,RG=new ue;function wgt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Hw),e.height,Hw);DG.center=h.add(t,r,DG.center),DG.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),RG.center=h.add(t,r,RG.center),RG.radius=i;let o=Qu.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(DG,RG),f=wve(s,e,!0),d=Ive(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=vgt(c,e);d=Sgt(c);let b=je.createTypedArray(c.length*2/3,d),x=new St({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Gn.combineInstances([new Ft({geometry:y}),new Ft({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function Pve(e,t,n,i,r,o,s){let c=Qu.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 u0(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}u0.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;u0.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 Dve=new h,Rve=new ee,Ove=new Be,l0={center:Dve,ellipsoid:Rve,vertexFormat:Ove,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};u0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Dve);t+=h.packedLength;let r=ee.unpack(e,t,Rve);t+=ee.packedLength;let o=Be.unpack(e,t,Ove);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):(l0.height=f,l0.extrudedHeight=p,l0.granularity=d,l0.stRotation=u,l0.rotation=c,l0.semiMajorAxis=s,l0.semiMinorAxis=a,l0.shadowVolume=g,l0.offsetAttribute=m===-1?void 0:m,new u0(l0))};u0.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 Pve(n,r,o,a,s,i,t)};u0.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=wgt(r);else if(o=Cgt(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})};u0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new u0({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 Igt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Qu.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(u0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Pve(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Igt(this)),this._textureCoordinateRotationPoints}}});var mu=u0;var Mve=new h,sE=new h;function Pgt(e){let t=e.center;sE=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,sE),e.height,sE),sE=h.add(t,sE,sE);let n=new ue(sE,e.semiMajorAxis),i=Qu.computeEllipsePositions(e,!1,!0).outerPositions,r=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Qu.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 MG=new ue,NG=new ue;function Dgt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Mve),e.height,Mve);MG.center=h.add(t,r,MG.center),MG.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),NG.center=h.add(t,r,NG.center),NG.radius=i;let o=Qu.computeEllipsePositions(e,!1,!0).outerPositions,s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Qu.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(MG,NG),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 Gw(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"}Gw.packedLength=h.packedLength+ee.packedLength+8;Gw.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 Nve=new h,Lve=new ee,L_={center:Nve,ellipsoid:Lve,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Gw.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Nve);t+=h.packedLength;let r=ee.unpack(e,t,Lve);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):(L_.height=c,L_.extrudedHeight=f,L_.granularity=u,L_.rotation=a,L_.semiMajorAxis=o,L_.semiMinorAxis=s,L_.numberOfVerticalLines=d,L_.offsetAttribute=p===-1?void 0:p,new Gw(L_))};Gw.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=Dgt(r);else if(o=Pgt(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 Qf=Gw;var Fve=new z,Bve=h.ZERO,kve=new h,Uve=new ie;function Rgt(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 Bm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Rgt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Bm.prototype=Object.create(ii.prototype),Bm.prototype.constructor=Bm);Bm.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:Kn.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,Fve)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Bve,kve))),new Ft({id:t,geometry:new mu(this._options),attributes:i})};Bm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Fve),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Bve,kve))),new Ft({id:t,geometry:new Qf(this._options),attributes:o})};Bm.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Bm.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)};Bm.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)};Bm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,tt.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(tt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(tt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(tt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,tt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,tt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,tt.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(mu.computeRectangle(s,Uve)).minimumTerrainHeight),s.extrudedHeight=r};Bm.DynamicGeometryUpdater=Ww;function Ww(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Ww.prototype=Object.create(Ii.prototype),Ww.prototype.constructor=Ww);Ww.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)};Ww.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(mu.computeRectangle(i,Uve)).minimumTerrainHeight),i.extrudedHeight=s};var bk=Bm;var Ogt=new h,Mgt=new h,Ngt=new h,Lgt=new h,Fgt=new h,Bgt=new h(1,1,1),zve=Math.cos,Vve=Math.sin;function F_(e){e=e??H.EMPTY_OBJECT;let t=e.radii??Bgt,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"}F_.packedLength=2*h.packedLength+Be.packedLength+7;F_.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 jve=new h,Hve=new h,Gve=new Be,ZA={radii:jve,innerRadii:Hve,vertexFormat:Gve,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};F_.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,jve);t+=h.packedLength;let r=h.unpack(e,t,Hve);t+=h.packedLength;let o=Be.unpack(e,t,Gve);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):(ZA.minimumClock=s,ZA.maximumClock=a,ZA.minimumCone=c,ZA.maximumCone=u,ZA.stackPartitions=f,ZA.slicePartitions=d,ZA.offsetAttribute=p===-1?void 0:p,new F_(ZA))};F_.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]=Vve(g[f]),j[f]=zve(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=zve(m[d]),k[d]=Vve(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,Ogt),Xe=Se.geodeticSurfaceNormal(He,Mgt);if(L[f]&&h.negate(Xe,Xe),a.st){let $e=U.negate(Xe,Fgt);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=Ngt,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,Lgt);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:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var Xee;F_.getUnitEllipsoid=function(){return l(Xee)||(Xee=F_.createGeometry(new F_({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),Xee};var Xa=F_;var kgt=new Kt(z.WHITE),Kee=h.ZERO,$ee=new h,Ugt=new h,zgt=new h,Jee=new z,Vgt=new h(1,1,1);function jgt(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 ed(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new jgt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(ed.prototype=Object.create(Pi.prototype),ed.prototype.constructor=ed);Object.defineProperties(ed.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ed.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=Kn.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,Jee)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Kee,$ee))),new Ft({id:i,geometry:new Xa(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};ed.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Jee),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:Kn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Kee,$ee))),new Ft({id:i,geometry:new Yf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};ed.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};ed.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Pi.prototype._isHidden.call(this,e,t)};ed.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)};ed.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,tt.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(tt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,tt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,tt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,tt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,tt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,tt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,tt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,tt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};ed.prototype._onEntityPropertyChanged=vg;ed.DynamicGeometryUpdater=xk;function xk(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)&&(xk.prototype=Object.create(Ii.prototype),xk.prototype.constructor=xk);xk.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,Ugt),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,Jee),c=_o.getValue(e,n.material??kgt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,zgt),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,Kee,$ee);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?Vgt: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 On({geometryInstances:P,appearance:w,asynchronous:!1,shadows:I}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new On({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)),jt.equals(O,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=Kn.toValue(O,P.distanceDisplayCondition),M.distanceDisplayCondition=Kn.toValue(O,M.distanceDisplayCondition),jt.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(P.offset=xr.toValue(L,P.offset),M.offset=xr.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 Tk=ed;function qw(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}qw.packedLength=Be.packedLength;qw.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var Wve=new Be,Hgt={vertexFormat:Wve};qw.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,Wve);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new qw(Hgt)};var LG=new h(-.5,-.5,0),FG=new h(.5,.5,0);qw.createGeometry=function(e){let t=e._vertexFormat,n=new Tn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=LG.x,r[1]=LG.y,r[2]=0,r[3]=FG.x,r[4]=LG.y,r[5]=0,r[6]=FG.x,r[7]=FG.y,r[8]=0,r[9]=LG.x,r[10]=FG.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 ue(h.ZERO,Math.sqrt(2))})};var Ek=qw;function Yw(){this._workerName="createPlaneOutlineGeometry"}Yw.packedLength=0;Yw.pack=function(e,t){return t};Yw.unpack=function(e,t,n){return l(n)?n:new Yw};var QA=new h(-.5,-.5,0),BG=new h(.5,.5,0);Yw.createGeometry=function(){let e=new Tn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=QA.x,n[1]=QA.y,n[2]=QA.z,n[3]=BG.x,n[4]=QA.y,n[5]=QA.z,n[6]=BG.x,n[7]=BG.y,n[8]=QA.z,n[9]=QA.x,n[10]=BG.y,n[11]=QA.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 ue(h.ZERO,Math.sqrt(2))})};var Ck=Yw;var Ggt=new h,qve=new z;function Wgt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function fh(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new Wgt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(fh.prototype=Object.create(Pi.prototype),fh.prototype.constructor=fh);fh.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=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,qve)),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=Zee(d,p,f,f),new Ft({id:t,geometry:new Ek(this._options),modelMatrix:f,attributes:i})};fh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,qve),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=Zee(c,u,a,a),new Ft({id:t,geometry:new Ck,modelMatrix:a,attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r)}})};fh.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};fh.prototype._getIsClosed=function(e){return!1};fh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};fh.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(tt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(tt.MINIMUM_VALUE,i.dimensions)};fh.DynamicGeometryUpdater=Xw;function Xw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Xw.prototype=Object.create(Ii.prototype),Xw.prototype.constructor=Xw);Xw.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Ggt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ii.prototype._isHidden.call(this,e,t,n)};Xw.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 qgt=new h,Ygt=new h,Xgt=new h,Kgt=new h,$gt=new $,Jgt=new $,Zgt=new N;function Zee(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,Xgt),a=h.clone(h.UNIT_Z,Ygt);D.equalsEpsilon(Math.abs(h.dot(a,r)),1,D.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,qgt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=$gt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,Kgt),d=$.multiplyByScale(u,f,Jgt),p=N.fromRotationTranslation(d,s,Zgt);return N.multiplyTransformation(n,p,i)}fh.createPrimitiveMatrix=Zee;var vk=fh;var Qgt=new h,e_t=new et,t_t=new U,n_t=new U,i_t=new h,r_t=new h,o_t=new h,Sk=new h,s_t=new h,a_t=new h,Yve=new Le,c_t=new $,l_t=new $,u_t=new h;function f_t(e,t,n,i,r,o,s,a,c){let u=e.positions,f=fi.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=c_t;if(i!==0){let _=Le.fromAxisAngle(s,i,Yve);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,Yve);let C=$.fromQuaternion(_,l_t);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=n_t;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,Qgt),P=o(w,t_t);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 aE(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=ni.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,U):1)+2}aE.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 aE(t)};aE.pack=function(e,t,n){return n=n??0,n=ni.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=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var d_t=ee.clone(ee.UNIT_SPHERE),h_t=new Be,m_t={polygonHierarchy:{}};aE.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,d_t);t+=ee.packedLength;let o=Be.unpack(e,t,h_t);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new aE(m_t)),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};aE.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=i_t,c=r_t,u=o_t,f=s_t,d=a_t;if(!p_.computeProjectTo2DArguments(s,Sk,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(Sk,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(Sk,u_t);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=p_.createProjectPointsTo2DFunction(Sk,f,d),m=p_.createProjectPointTo2DFunction(Sk,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ni.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ni.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ni.computeBoundingRectangle(a,m,s,i,e_t),S=[];for(let O=0;O<b.length;O++){let L=new Ft({geometry:f_t(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Gn.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 wk=aE;var Xve=[],kG=[];function p_t(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,Xve);fi.computeWindingOrder2D(s)===ea.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+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=ni.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=ni.subdivideLine(t[u],t[(u+1)%f],n,kG):r===ln.RHUMB&&(y=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,kG));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 g_t(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,Xve);fi.computeWindingOrder2D(s)===ea.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+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=ni.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=ni.subdivideLine(t[u],t[(u+1)%f],n,kG):r===ln.RHUMB&&(b=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,kG));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 cE(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=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+8}cE.pack=function(e,t,n){return n=n??0,n=ni.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 __t=ee.clone(ee.UNIT_SPHERE),y_t={polygonHierarchy:{}};cE.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,__t);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 cE(y_t)),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};cE.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 cE(t)};cE.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ni.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=g_t(t,s[m],u,r,o),a.geometry=ni.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=p_t(t,s[m],u,r,o),a.geometry.attributes.position.values=fi.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=Gn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new St({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var Ik=cE;var Kve="Entity polygons cannot have both height and perPositionHeight. height will be ignored",$ve="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Jve=new z,Zve=h.ZERO,Qve=new h,eSe=new ie,A_t=[],b_t=new U;function x_t(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 td(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new x_t(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(td.prototype=Object.create(ii.prototype),td.prototype.constructor=td);td.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:Kn.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,Jve)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Zve,Qve)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new wk(i):o=new qp(i),new Ft({id:t,geometry:o,attributes:r})};td.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Jve),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:Kn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Zve,Qve)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new nh(i):a=new Ik(i),new Ft({id:t,geometry:a,attributes:s})};td.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,A_t),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,b_t);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)};td.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Pi.prototype._isHidden.call(this,e,t)};td.prototype._isOnTerrain=function(e,t){let n=ii.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(tt.MINIMUM_VALUE):!0);return n&&!r};td.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)};td.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(tt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,tt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,tt.MINIMUM_VALUE,!1);o=ii.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,_t(Kve)),s!==We.NONE&&u&&(o=void 0,_t($ve))):(l(a)&&!l(o)&&(o=0),f=ii.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,tt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,tt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,tt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,tt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,tt.MINIMUM_VALUE),a=ii.getGeometryExtrudedHeight(a,c),a===ii.CLAMP_TO_GROUND){let d=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,eSe);a=Mi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};td.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)};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){return!l(this._options.polygonHierarchy)||Ii.prototype._isHidden.call(this,e,t,n)};Kw.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(Kve)),o!==We.NONE&&c&&(r=void 0,_t($ve))):(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=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,eSe);a=Mi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var Pk=td;function T_t(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=fi.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:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Gn.computeNormal(E)),i.tangent||i.bitangent){try{E=Gn.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 Rk(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??rr.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}Rk.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 tSe=ee.clone(ee.UNIT_SPHERE),nSe=new Be,Dk={polylinePositions:void 0,shapePositions:void 0,ellipsoid:tSe,vertexFormat:nSe,cornerType:void 0,granularity:void 0};Rk.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,tSe);t+=ee.packedLength;let c=Be.unpack(e,t,nSe);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):(Dk.polylinePositions=o,Dk.shapePositions=s,Dk.cornerType=u,Dk.granularity=f,new Rk(Dk))};var E_t=new et;Rk.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=Pm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===ea.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,E_t),o=Pm.computePositions(n,i,r,e,!0);return T_t(o,i,r,e._vertexFormat)};var Ok=Rk;function C_t(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:ue.fromVertices(e),primitiveType:Oe.LINES})}function Nk(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??rr.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}Nk.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 iSe=ee.clone(ee.UNIT_SPHERE),Mk={polylinePositions:void 0,shapePositions:void 0,ellipsoid:iSe,height:void 0,cornerType:void 0,granularity:void 0};Nk.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,iSe);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):(Mk.polylinePositions=o,Mk.shapePositions=s,Mk.cornerType=c,Mk.granularity=u,new Nk(Mk))};var v_t=new et;Nk.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=Pm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===ea.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,v_t),o=Pm.computePositions(n,i,r,e,!1);return C_t(o,i)};var Lk=Nk;var rSe=new z;function S_t(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 f0(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new S_t(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(f0.prototype=Object.create(Pi.prototype),f0.prototype.constructor=f0);f0.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=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,rSe)),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 Ok(this._options),attributes:i})};f0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,rSe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new Lk(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r)}})};f0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Pi.prototype._isHidden.call(this,e,t)};f0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};f0.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(tt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(tt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(tt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(tt.MINIMUM_VALUE):void 0};f0.DynamicGeometryUpdater=$w;function $w(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&($w.prototype=Object.create(Ii.prototype),$w.prototype.constructor=$w);$w.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)};$w.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 Fk=f0;var Qee=new h,aSe=new h,cSe=new h,lSe=new h,uSe=new ie,w_t=new U,I_t=new ue,P_t=new ue;function fSe(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 D_t(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=lSe,f=cSe,d=aSe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,Qee),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 fSe(t,{positions:e,normals:o,tangents:s,bitangents:a})}var ete=new h,dSe=new h;function R_t(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=lSe,p=cSe,g=aSe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,Qee),A=h.fromArray(e,(m+6)%i,ete);if(f){let b=h.fromArray(e,(m+3)%i,dSe);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 fSe(t,{positions:e,normals:r,tangents:o,bitangents:s})}function hSe(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=Qee,b=w_t,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)Sa.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&&(Sa.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&&(Sa.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=D_t(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 Jw(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 Zw(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 tte=new Be;function O_t(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,tte);Pe.normal=!0,e._vertexFormat=Pe}let d=hSe(e,t);n&&(e._vertexFormat=r);let p=fi.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=fi.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=Jw(G,Z,ge,p,A),Z+=6,r.st&&(W=Zw(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=Jw(G,Z,ge,p,A),Z+=6,r.st&&(W=Zw(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=Jw(G,Z,ge,p,A),Z+=6,r.st&&(W=Zw(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=Jw(G,Z,ge,p,A),Z+=6,r.st&&(W=Zw(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=Jw(G,Z,ge,p,A),Z+=6,r.st&&(W=Zw(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=Jw(G,Z,ge,p,A),Z+=6,r.st&&(W=Zw(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=R_t(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,ete),qe=h.fromArray(G,Xe*3,dSe);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=Gn.combineInstances([new Ft({geometry:d}),new Ft({geometry:we})]),we[0]}var M_t=[new h,new h,new h,new h],mSe=new he,N_t=new he;function nte(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Sa.computeOptions(e,t,n,0,uSe,mSe),s=o.height,a=o.width,c=M_t;return Sa.computePosition(o,i,!1,0,0,c[0]),Sa.computePosition(o,i,!1,0,a-1,c[1]),Sa.computePosition(o,i,!1,s-1,0,c[2]),Sa.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function d0(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}d0.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;d0.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 pSe=new ie,gSe=ee.clone(ee.UNIT_SPHERE),eb={rectangle:pSe,ellipsoid:gSe,vertexFormat:tte,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};d0.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,pSe);t+=ie.packedLength;let r=ee.unpack(e,t,gSe);t+=ee.packedLength;let o=Be.unpack(e,t,tte);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):(eb.granularity=s,eb.height=a,eb.rotation=c,eb.stRotation=u,eb.extrudedHeight=f,eb.shadowVolume=d,eb.offsetAttribute=p===-1?void 0:p,new d0(eb))};d0.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 nte(n,i,o,r,t)};var L_t=new $,oSe=new Le,F_t=new he;d0.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=Sa.computeOptions(t,e._granularity,i,r,uSe,mSe,N_t),a=L_t;if(r!==0||i!==0){let g=ie.center(t,F_t),m=n.geodeticSurfaceNormalCartographic(g,ete);Le.fromAxisAngle(m,-r,oSe),$.fromQuaternion(oSe,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=O_t(e,s);let g=ue.fromRectangle3D(t,n,c,P_t),m=ue.fromRectangle3D(t,n,u,I_t);p=ue.union(g,m)}else{if(d=hSe(e,s),d.attributes.position.values=fi.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=ue.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})};d0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new d0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var sSe=new ie,B_t=[new U,new U,new U],k_t=new Xi,U_t=new he;function z_t(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,sSe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=nte(t,n,r,i,sSe),s=B_t;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,k_t),u=ie.center(a,U_t);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(d0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=nte(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=z_t(this)),this._textureCoordinateRotationPoints}}});var lE=d0;var _Se=new z,ySe=h.ZERO,ASe=new h,bSe=new ie,V_t=new ie,j_t=new he;function H_t(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 km(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new H_t(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(km.prototype=Object.create(ii.prototype),km.prototype.constructor=km);km.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:Kn.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,_Se)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,ySe,ASe))),new Ft({id:t,geometry:new lE(this._options),attributes:i})};km.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,_Se),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=xr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,ySe,ASe))),new Ft({id:t,geometry:new zT(this._options),attributes:o})};km.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,V_t);if(!l(n))return;let i=ie.center(n,j_t);return he.toCartesian(i,ee.default,t)};km.prototype._isHidden=function(e,t){return!l(t.coordinates)||Pi.prototype._isHidden.call(this,e,t)};km.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)};km.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,tt.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(tt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,tt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,tt.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(lE.computeRectangle(a,bSe)).minimumTerrainHeight),a.extrudedHeight=o};km.DynamicGeometryUpdater=Qw;function Qw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Qw.prototype=Object.create(Ii.prototype),Qw.prototype.constructor=Qw);Qw.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ii.prototype._isHidden.call(this,e,t,n)};Qw.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(lE.computeRectangle(i,bSe)).minimumTerrainHeight),i.extrudedHeight=s};var Bk=km;var xSe={};function G_t(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var W_t=new he,q_t=new he;function Y_t(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,W_t);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,q_t);s&&(x.height=n[A]),m=m&&x.height===0,G_t(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 X_t=new Array(2),K_t=new Array(2),$_t={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};xSe.computePositions=function(e,t,n,i,r,o){let s=Y_t(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=$_t;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=X_t,A=K_t;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 uE=xSe;var ite=new h,UG=new h,J_t=new h,TSe=new h,Z_t=new h,Q_t=new h,eyt=new h;function fE(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}fE.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 ESe=ee.clone(ee.UNIT_SPHERE),CSe=new Be,kk={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ESe,vertexFormat:CSe,granularity:void 0};fE.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,ESe);t+=ee.packedLength;let u=Be.unpack(e,t,CSe);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):(kk.positions=o,kk.minimumHeights=s,kk.maximumHeights=a,kk.granularity=f,new fE(kk))};fE.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 fE(c)};fE.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=uE.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=eyt,R=Q_t,O=Z_t,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,ite),k=h.fromArray(c,B,UG);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,TSe),q=h.subtract(j,s.geodeticSurfaceNormal(j,UG),UG);if(_+1<d&&(G=h.fromArray(u,B+3,TSe)),L){let Q=h.subtract(G,j,J_t),W=h.subtract(q,j,ite);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,ite),G=h.fromArray(g,j*3,UG);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:ue.fromVertices(g)})};var Uk=fE;var vSe=new h,SSe=new h;function dE(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}dE.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 wSe=ee.clone(ee.UNIT_SPHERE),zk={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:wSe,granularity:void 0};dE.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,wSe);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):(zk.positions=o,zk.minimumHeights=s,zk.maximumHeights=a,zk.granularity=u,new dE(zk))};dE.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 dE(c)};dE.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=uE.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,vSe),E=h.fromArray(a,x,SSe);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,vSe),v=h.fromArray(d,T*3,SSe);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:ue.fromVertices(d)})};var Vk=dE;var ISe=new z;function tyt(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 Um(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new tyt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Um.prototype=Object.create(Pi.prototype),Um.prototype.constructor=Um);Um.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=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,ISe)),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 Uk(this._options),attributes:i})};Um.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ISe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new Vk(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r)}})};Um.prototype._isHidden=function(e,t){return!l(t.positions)||Pi.prototype._isHidden.call(this,e,t)};Um.prototype._getIsClosed=function(e){return!1};Um.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)};Um.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(tt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(tt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(tt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(tt.MINIMUM_VALUE):void 0};Um.DynamicGeometryUpdater=eI;function eI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(eI.prototype=Object.create(Ii.prototype),eI.prototype.constructor=eI);eI.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ii.prototype._isHidden.call(this,e,t,n)};eI.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 jk=Um;var hE=[NM,ak,Q2,bk,Tk,vk,Pk,Fk,Bk,jk];function mE(e,t){this.entity=e,this.scene=t;let n=new Array(hE.length),i=new be,r=new Xo;for(let o=0;o<n.length;o++){let s=new hE[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(mE.prototype._onEntityPropertyChanged,this)}mE.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)};mE.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};mE.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};mE.registerUpdater=function(e){hE.includes(e)||hE.push(e)};mE.unregisterUpdater=function(e){if(hE.includes(e)){let t=hE.indexOf(e);hE.splice(t,1)}};var pE=mE;var PSe=new z,nyt=new jt,iyt=new jt,ryt=h.ZERO,oyt=new h;function zm(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(zm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}zm.prototype.onMaterialChanged=function(){this.invalidated=!0};zm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};zm.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)}))}};zm.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};zm.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=_o.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 On({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=_o.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,PSe);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,PSe);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,iyt,nyt);jt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,ryt,oyt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=xr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};zm.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()};zm.prototype.contains=function(e){return this.updaters.contains(e.id)};zm.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)};zm.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 tI(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}tI.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 zm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function DSe(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}tI.prototype.remove=function(e){DSe(this._solidItems,e)||DSe(this._translucentItems,e)};function RSe(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 zG(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}tI.prototype.update=function(e){let t=zG(this,this._solidItems,e,!0);t=zG(this,this._translucentItems,e,t)&&t;let n=RSe(this,this._solidItems,e),i=RSe(this,this._translucentItems,e);return(n||i)&&(t=zG(this,this._solidItems,e,t)&&t,t=zG(this,this._translucentItems,e,t)&&t),t};function OSe(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}tI.prototype.getBoundingSphere=function(e,t){let n=OSe(this._solidItems,e,t);return n===Pt.FAILED?OSe(this._translucentItems,e,t):n};function MSe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}tI.prototype.removeAllPrimitives=function(){MSe(this._solidItems),MSe(this._translucentItems)};var dh=tI;var syt=new jt,ayt=new jt,cyt=h.ZERO,lyt=new h;function Vm(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 kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Vm.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt}Vm.prototype.onMaterialChanged=function(){this.invalidated=!0};Vm.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};Vm.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};Vm.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 uyt=new z;Vm.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=_o.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=_o.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 On({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=_o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=_o.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,uyt);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,ayt,syt);jt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,cyt,lyt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=xr.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Vm.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()};Vm.prototype.contains=function(e){return this.updaters.contains(e.id)};Vm.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)};Vm.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 nI(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}nI.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 Vm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};nI.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}}};nI.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};nI.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};nI.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 hh=nI;function VG(e,t,n=0,i=e.length-1,r=fyt){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));VG(e,t,g,m,r)}let o=e[t],s=n,a=i;for(Hk(e,n,t),r(e[i],o)>0&&Hk(e,n,i);s<a;){for(Hk(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?Hk(e,n,a):(a++,Hk(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function Hk(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function fyt(e,t){return e<t?-1:e>t?1:0}var qk=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(!HG(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;HG(t,c)&&(n.leaf?i.push(a):ote(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!HG(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(HG(t,s)){if(n.leaf||ote(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=rI([]),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=dyt(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&ote(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=rI(t.slice(n,i+1)),iI(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=rI([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));NSe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);NSe(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 iI(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=rte(u),d=pyt(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),Wk(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=rI(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,iI(i,this.toBBox),iI(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=rI([t,n]),this.data.height=t.height+1,this.data.leaf=!1,iI(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=Gk(t,0,a,this.toBBox),u=Gk(t,a,i,this.toBBox),f=gyt(c,u),d=rte(c)+rte(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:hyt,o=t.leaf?this.compareMinY:myt,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=Gk(t,0,n,o),a=Gk(t,i-n,i,o),c=jG(s)+jG(a);for(let u=n;u<i-n;u++){let f=t.children[u];Wk(s,t.leaf?o(f):f),c+=jG(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];Wk(a,t.leaf?o(f):f),c+=jG(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)Wk(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():iI(t[n],this.toBBox)}};function dyt(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 iI(e,t){Gk(e,0,e.children.length,t,e)}function Gk(e,t,n,i,r){r||(r=rI(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];Wk(r,e.leaf?i(s):s)}return r}function Wk(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 hyt(e,t){return e.minX-t.minX}function myt(e,t){return e.minY-t.minY}function rte(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function jG(e){return e.maxX-e.minX+(e.maxY-e.minY)}function pyt(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 gyt(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 ote(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function HG(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function rI(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function NSe(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;VG(e,s,t,n,r),o.push(t,s,s,n)}}function GG(){this._tree=new qk}function gE(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}gE.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};GG.prototype.insert=function(e,t){let n=gE.fromRectangleAndId(e,t,new gE);this._tree.insert(n)};function _yt(e,t){return e.id===t.id}var yyt=new gE;GG.prototype.remove=function(e,t){let n=gE.fromRectangleAndId(e,t,yyt);this._tree.remove(n,_yt)};var Ayt=new gE;GG.prototype.collides=function(e){let t=gE.fromRectangleAndId("",e,Ayt);return this._tree.collides(t)};var _E=GG;var byt=new z,xyt=new jt,Tyt=new jt;function B_(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new _E}B_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};B_.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)}))}};B_.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};B_.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 Vl({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,byt);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,Tyt,xyt);jt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(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 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()};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 Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};B_.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 oI(e,t){this._batches=[],this._primitives=e,this._classificationType=t}oI.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 B_(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};oI.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};oI.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};oI.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};oI.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var sI=oI;var Eyt=new jt,Cyt=new jt;function h0(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new _E}h0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};h0.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)};h0.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};h0.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};h0.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=_o.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Vl({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=_o.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,Cyt,Eyt);jt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};h0.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()};h0.prototype.contains=function(e){return this.updaters.contains(e.id)};h0.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)};h0.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 aI(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}aI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Sf.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 h0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};aI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};aI.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};aI.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};aI.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 Yk=aI;var vyt=new z,Syt=new jt,wyt=new jt,Iyt=h.ZERO,Pyt=new h;function k_(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.itemsToRemove=[],this.subscriptions=new kt,this.showsUpdated=new kt}k_.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)}))}};k_.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};k_.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 On({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,vyt);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,wyt,Syt);jt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,Iyt,Pyt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=xr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};k_.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()};k_.prototype.contains=function(e){return this.updaters.contains(e.id)};k_.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)};k_.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 cI(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new kt,this._translucentBatches=new kt}cI.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 k_(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 k_(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};cI.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};cI.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};cI.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};cI.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 lI=cI;var Dyt=[];function ef(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;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=Jr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new lI(n,e,s,!1),this._outlineBatches[r+s]=new lI(n,e,s,!0),this._closedColorBatches[s]=new dh(n,yn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new dh(n,yn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new hh(n,Er,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new hh(n,Er,void 0,!0,s,!1),this._openColorBatches[s]=new dh(n,yn,void 0,!1,s,!0),this._openColorBatches[r+s]=new dh(n,yn,void 0,!1,s,!1),this._openMaterialBatches[s]=new hh(n,Er,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new hh(n,Er,void 0,!1,s,!1);let a=Qn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new Yk(i,s,Er)),c[s]=new sI(i,s);else for(s=0;s<a;++s)c[s]=new sI(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new rE(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new kt,this._updaterSets=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(ef.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Dyt)}ef.registerUpdater=function(e){pE.registerUpdater(e)};ef.unregisterUpdater=function(e){pE.unregisterUpdater(e)};ef.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 pE(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(ef._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 Ryt=[],Oyt=new ue;ef.prototype.getBoundingSphere=function(e,t){let n=Ryt,i=Oyt,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]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ef.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(),le(this)};ef.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};ef.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)};ef._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)};ef.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 Xk=ef;var Myt=1,Nyt="30px sans-serif",Lyt=Ao.FILL,Fyt=z.WHITE,Byt=z.BLACK,kyt=1,Uyt=!1,zyt=new z(.165,.165,.165,.8),Vyt=new U(7,5),jyt=U.ZERO,Hyt=h.ZERO,Gyt=We.NONE,Wyt=zi.CENTER,qyt=Hn.CENTER,Yyt=new h,Xyt=new z,Kyt=new z,$yt=new z,Jyt=new U,Zyt=new h,Qyt=new U,eAt=new qt,tAt=new qt,nAt=new qt,iAt=new jt;function LSe(e){this.entity=e,this.label=void 0,this.index=void 0}function tb(e,t){t.collectionChanged.addEventListener(tb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}tb.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,Yyt),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){ste(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,Gyt);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,Myt),u.font=X.getValueOrDefault(a._font,e,Nyt),u.style=X.getValueOrDefault(a._style,e,Lyt),u.fillColor=X.getValueOrDefault(a._fillColor,e,Fyt,Xyt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,Byt,Kyt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,kyt),u.showBackground=X.getValueOrDefault(a._showBackground,e,Uyt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,zyt,$yt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,Vyt,Jyt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,jyt,Qyt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,Hyt,Zyt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,Wyt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,qyt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,eAt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,tAt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,nAt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,iAt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};tb.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=jh(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=ag(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};tb.prototype.isDestroyed=function(){return!1};tb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(tb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};tb.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 LSe(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 LSe(o)):(ste(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],ste(s.get(o.id),o,a),s.remove(o.id)};function ste(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var Kk=tb;var rAt=1,oAt=!0,sAt=0,aAt=!0,cAt=!0,lAt=Dn.ENABLED,uAt=We.NONE,fAt=z.RED,dAt=0,hAt=z.WHITE,mAt=ll.HIGHLIGHT,pAt=.5,gAt=new U(1,1),FSe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},_At=new N,yAt=new N,BSe=new z,kSe=new Array(4),AAt=new h;function nb(e,t){t.collectionChanged.addEventListener(nb.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}function bAt(e,t){return e instanceof li?e.valueOf():X.getValueOrUndefined(e,t)}function xAt(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function USe(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function TAt(e,t){if(!l(t))return N.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function EAt(e,t,n,i,r){let o=e._primitives,s=e._modelHash,a=s[t.id],c=()=>!e.isDestroyed()&&s[t.id]===a;try{let u=await jf.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(!c()){u.destroy();return}u.id=t,o.add(u),a.modelPrimitive=u,u.errorEvent.addEventListener(f=>{c()&&(console.log(f),f.name!=="TextureError"&&u.incrementallyLoadTextures&&(a.loadFailed=!0))})}catch(u){if(!c())return;console.log(u),a.loadFailed=!0}}nb.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,p;if(f&&(d=s.computeModelMatrix(e,_At),p=bAt(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!xAt(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(USe(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...FSe}},n[s.id]=u,USe(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,aAt),A=X.getValueOrDefault(a._environmentMapOptions,e,FSe,u.environmentMapOptionsScratch);EAt(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,rAt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,oAt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,sAt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=TAt(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,lAt),g.heightReference=X.getValueOrDefault(a._heightReference,e,uAt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,fAt,BSe),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,dAt),g.color=X.getValueOrDefault(a._color,e,hAt,BSe),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,mAt),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,pAt),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,cAt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,gAt);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,kSe,0),m=h.unpack(kSe,0,AAt)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:Hu.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=N.fromTranslationRotationScale(I,yAt);R.matrix=N.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}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._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)ate(this,e[i],t,n);return le(this)};var $k=new h,CAt=new he;nb.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;$k.x=a[12],$k.y=a[13],$k.z=a[14];let c=o.cartesianToCartographic($k,CAt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=jh(r,n,$k,[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):_s(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};nb.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)?(vAt(o,a),s.set(o.id,o)):(ate(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],ate(this,o,a,c),s.remove(o.id)};function ate(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function vAt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Jk=nb;function ib(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(ib.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 SAt=new K;ib.prototype.getValue=function(e,t){return l(e)||(e=K.now(SAt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};ib.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))};ib.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};ib.prototype.equals=function(e){return this===e||e instanceof ib&&this._value===e._value};ib.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var m0=ib;var zSe=new $,VSe=new $,jSe=new $,wAt=new h,HSe=new h,IAt=new h,PAt=new h,WG=new Le,qG=new N,YG=new $;function Qk(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,WG)&&(Le.conjugate(WG,WG),$.fromQuaternion(WG,YG),$.multiplyByVector(YG,r,r));else if(l(ute(e,i.position,qG)))N.inverse(qG,qG),N.getRotation(qG,YG),$.multiplyByVector(YG,r,r);else return;return r}}function ute(e,t,n){let i=t.getValue(e,wAt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,HSe);if(l(o)&&!h.equalsEpsilon(i,o,D.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,zSe),a=At.computeFixedToIcrfMatrix(r,VSe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,jSe),s=$.transpose(c,zSe),a=At.computeTemeToPseudoFixedMatrix(r,VSe),$.transpose(a,a)):c=$.transpose(s,jSe);let u=IAt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,PAt);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,HSe);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 GSe=60,$Se=1,JSe=new En,cte=new En,lte=new En;function WSe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var XG=new h;function DAt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Jr&&(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,XG),g=Qk(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,XG),l(g)&&l(m)&&(g=Qk(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,XG),l(g)&&l(m)&&(g=Qk(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,XG),l(g)&&l(m)&&(g=Qk(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function RAt(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 OAt(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 MAt(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(!En.intersect(d,lte,JSe).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 NAt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function LAt(e,t,n,i,r,o,s,a){cte.start=t,cte.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,cte,JSe).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=ZSe(d.data,m,y,i,r,o,c,a)}}return c}function ZSe(e,t,n,i,r,o,s,a){for(;e instanceof D_;)e=e.resolvedProperty;if(e instanceof gc){let c=e._property._times;s=DAt(e,t,n,c,i,r,o,s,a)}else e instanceof LM?s=RAt(e,t,n,i,r,o,s,a):e instanceof mc?s=LAt(e,t,n,i,r,o,s,a):e instanceof R_?s=MAt(e,t,n,i,r,o,s,a):e instanceof Gl||e instanceof m0&&X.isConstant(e)?s=NAt(e,t,n,i,r,o,s,a):s=OAt(e,t,n,i,r,o,s,a);return s}function fte(e,t,n,i,r,o,s){l(s)||(s=[]);let a=ZSe(e,t,n,i,r,o,0,s);return s.length=a,s}var qSe=new $,YSe=new Le,XSe=new $,Zk=new En,KG=new En,yE=new En;function FAt(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 KSe(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=fte(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=_o.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,$Se),d++}return d}function e3(e,t){this._unusedIndexes=[],this._polylineCollection=new Em,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}e3.prototype.update=function(e){let t=this._referenceFrame;if(t===ji.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,qSe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,qSe)),N.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Jr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,YSe))&&($.fromQuaternion(YSe,XSe),N.fromRotationTranslation(XSe,n,this._polylineCollection.modelMatrix)):ute(e,t.position,this._polylineCollection.modelMatrix)}};e3.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,GSe),d=fte(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=_o.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===a0.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:GSe,y=g.intervals,A=0;if(l(y)){Zk.start=o,Zk.stop=s,Zk.isStartIncluded=!0,Zk.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!En.intersect(x,Zk,KG))continue;let T=KG.start,E=KG.stop;if(K.greaterThanOrEquals(T,E))continue;let v=FAt(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);En.intersect(_,KG,yE)&&(K.greaterThan(yE.start,T)&&K.lessThan(yE.start,E)&&S.push(K.clone(yE.start)),K.greaterThan(yE.stop,T)&&K.lessThan(yE.stop,E)&&S.push(K.clone(yE.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=KSe(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=KSe(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,$Se),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};e3.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};e3.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function p0(e,t){t.collectionChanged.addEventListener(p0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}p0.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 e3(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};p0.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 WSe(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 WSe(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))};p0._subSample=fte;p0._computeVvlhTransform=ute;p0._transformToEntityFrame=Qk;var t3=p0;var QSe=z.WHITE,ewe=z.BLACK,twe=0,nwe=1,iwe=0,rwe=Vo.NONE,owe=new z,BAt=new h,swe=new z,awe=new qt,cwe=new qt,lwe=new jt;function uwe(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 rb(e,t){t.collectionChanged.addEventListener(rb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}rb.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,BAt),d=l(p)),!d){n3(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(n3(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)&&(n3(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,awe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,cwe),c.color=X.getValueOrDefault(a._color,e,QSe,owe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,ewe,swe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,twe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,nwe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,lwe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,iwe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,rwe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,awe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,cwe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,lwe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,iwe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,rwe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,QSe,owe),A=X.getValueOrDefault(a._outlineColor,e,ewe,swe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,twe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,nwe)));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,wT(T,E,v,b,x))}m&&u._updateClamping()}}return!0};rb.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=jh(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=ag(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};rb.prototype.isDestroyed=function(){return!1};rb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(rb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};rb.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 uwe(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 uwe(o)):(n3(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],n3(s.get(o.id),o,a),s.remove(o.id)};function n3(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 i3=rb;var pwe=[];function kAt(e,t,n,i,r){let o=pwe;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 r3(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}r3.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 gwe=ee.clone(ee.UNIT_SPHERE),_we=new Be,AE={positions:void 0,colors:void 0,ellipsoid:gwe,vertexFormat:_we,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};r3.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,gwe);t+=ee.packedLength;let c=Be.unpack(e,t,_we);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):(AE.positions=o,AE.colors=s,AE.width=u,AE.colorsPerVertex=f,AE.arcType=d,AE.granularity=p,new r3(AE))};var fwe=new h,dwe=new h,hwe=new h,mwe=new h;r3.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=kAt(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,pwe.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=fwe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,hwe),h.clone(p[u],dwe),u===g-1?(O=fwe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,mwe);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(dwe,y,v),h.pack(hwe,A,v),h.pack(mwe,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:ue.fromPoints(p),geometryType:Sd.POLYLINES})};var U_=r3;var UAt=new li(0),$G={},ywe=new z,zAt=new Kt(z.WHITE),VAt=new li(!0),jAt=new li(Dn.DISABLED),HAt=new li(new jt),GAt=new li(Qn.BOTH);function WAt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function qAt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function jm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(jm.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 WAt,this._groundGeometryOptions=new qAt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Jr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(jm.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}}});jm.prototype.isOutlineVisible=function(e){return!1};jm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};jm.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=Kn.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,ywe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Ft({id:t,geometry:new vx(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,ywe)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Ft({id:t,geometry:new U_(this._geometryOptions),attributes:s}))};jm.prototype.createOutlineGeometryInstance=function(e){};jm.prototype.isDestroyed=function(){return!1};jm.prototype.destroy=function(){this._entitySubscription(),le(this)};jm.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(tt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??zAt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??VAt,this._shadowsProperty=r.shadows??jAt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??HAt,this._classificationTypeProperty=r.classificationType??GAt,this._fillEnabled=!0,this._zIndex=a??UAt;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(tt.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=js.VERTEX_FORMAT:A=cc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(tt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(tt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(tt.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(tt.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)}};jm.prototype.createDynamicUpdater=function(e,t){return new o3(e,t,this)};var uI={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function o3(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 Awe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=$G[n];!l(i)||i.isDestroyed()?(i=new Em,$G[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}o3.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 js;else{let g=_o.getValue(e,d,this._material);p=new cc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Kh({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=Awe(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)&&(uI.ellipsoid=f,uI.positions=o,uI.granularity=X.getValueOrUndefined(i._granularity,e),uI.height=ir.extractHeights(o,f),c===ln.GEODESIC?o=ir.generateCartesianArc(uI):o=ir.generateCartesianRhumbArc(uI)),a.show=!0,a.positions=o.slice(),a.material=_o.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};o3.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 ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=Awe(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};o3.prototype.isDestroyed=function(){return!1};o3.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=$G[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete $G[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var s3=jm;var YAt=new z,XAt=new jt,KAt=new jt;function Hm(e,t,n,i,r){let o;n instanceof Kt?o=js:o=cc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Hm.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt,this.zIndex=i,this._asynchronous=r}Hm.prototype.onMaterialChanged=function(){this.invalidated=!0};Hm.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)};Hm.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};Hm.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};Hm.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 Kh({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===cc&&(this.material=_o.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===cc&&(this.material=_o.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,YAt);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,KAt,XAt);jt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=jt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Hm.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()};Hm.prototype.contains=function(e){return this.updaters.contains(e.id)};Hm.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)};Hm.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 fI(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}fI.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 Hm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};fI.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}}};fI.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};fI.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};fI.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 a3=fI;var $At=[];function bwe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function xwe(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 g0(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;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 dh(n,js,void 0,!1,r),this._materialBatches[r]=new hh(n,cc,void 0,!1,r),this._colorBatches[r+o]=new dh(n,js,js,!1,r),this._materialBatches[r+o]=new hh(n,cc,js,!1,r),this._colorBatches[r+o*2]=new dh(n,js,cc,!1,r),this._materialBatches[r+o*2]=new hh(n,cc,cc,!1,r);this._dynamicBatch=new rE(n,i);let s=Qn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new a3(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new kt,this._updaters=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(g0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,$At)}g0.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?(bwe(this,f),xwe(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),bwe(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 s3(c,this._scene),this._updaters.set(u,f),xwe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(g0._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 JAt=[],ZAt=new ue;g0.prototype.getBoundingSphere=function(e,t){let n=JAt,i=ZAt,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]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};g0.prototype.isDestroyed=function(){return!1};g0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g0.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(),le(this)};g0._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)};g0.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 c3=g0;function tf(e){Vl.initializeTerrainHeights(),Kh.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??tf.defaultVisualizersCallback;let i=!1,r=new xl,o=new xl;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 rk;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 dI=[];tf.registerVisualizer=function(e){dI.includes(e)||dI.push(e)};tf.unregisterVisualizer=function(e){if(dI.includes(e)){let t=dI.indexOf(e);dI.splice(t,1)}};tf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new TD(t,i),new Xk(e,i,n._primitives,n._groundPrimitives),new Kk(t,i),new Jk(e,i),new G2(e,i),new i3(t,i),new t3(e,i),new c3(e,i,n._primitives,n._groundPrimitives),...dI.map(r=>new r(e,i))]};Object.defineProperties(tf.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}}});tf.prototype.isDestroyed=function(){return!1};tf.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)),le(this)};tf.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};tf.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 QAt=[],ebt=new ue;tf.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=QAt,a=ebt,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]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};tf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new xl),s=r.add(new Ak);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};tf.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};tf.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 l3=tf;function dte(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}dte.clone=function(e,t){if(l(e))return l(t)||(t=new dte),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var mh=dte;var Twe=new $,Ewe=new $,Cwe=new $,tbt=new N,JG=new h,vwe=new h,hte=new h,mte=new h,Swe=new h,wwe=new h,nbt=new Le,ibt=new h,rbt=new $,hI=new K,obt=1.25;function sbt(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,hI);let I=r.getValue(hI,JG);if(l(I)||(K.addSeconds(c,-.001,hI),I=r.getValue(hI,JG),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,Twe),O=At.computeFixedToIcrfMatrix(hI,Ewe),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,Cwe),R=$.transpose(L,Twe),O=At.computeTemeToPseudoFixedMatrix(hI,Ewe),$.transpose(O,O)):L=$.transpose(R,Cwe);let _=$.multiplyByVector(R,d,Swe),C=$.multiplyByVector(O,I,wwe);h.subtract(_,C,mte);let w=h.magnitude(mte)*1e3,P=D.GRAVITATIONALPARAMETER,M=-P/(w*w-2*P/h.magnitude(_));M<0||M>obt*u.maximumRadius?(m=vwe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,hte),y=h.cross(A,m,JG),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,hte),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,D.EPSILON7)||(A=vwe,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,hte),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,A,JG),$.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,mte),x=h.clone(t.direction,Swe),T=h.clone(t.up,wwe));let E=tbt,v;l(s)&&(v=s.getValue(c,nbt));let S=o.getValue(c,ibt);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,rbt);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 u3(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 M_(e.position,!0),this._offset3D=new h}Object.defineProperties(u3,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});u3.defaultOffset3D=new h(-14e3,3500,3500);var ZG=new mh,abt=new h;u3.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)){ZG.pitch=-D.PI_OVER_FOUR,ZG.range=0;let b=a.getValue(e,abt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);ZG.pitch*=x}p.viewBoundingSphere(t,ZG),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(u3._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,sbt(this,p,g,m,a,c,u,s,e,i)};var f3=u3;_0();yc();EE();P5();I3();var rPe={type:"module"},Ute="error",Xbt="messageerror",oPe,kte,sPe,zte=!0;try{zte=typeof structuredClone==Bo&&structuredClone(new DOMException("","AbortError")).code!==Ue}catch{}nPe(Kbt);function Kbt(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=M5(e.workerURI,n,e)}catch{return Fte(e),Bte(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await $bt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return Fte(e),aPe(e),O5(e,t);if(a&&a.codecImportFailed){if(e.reader)return aPe(e),O5(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function $bt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(wE);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}=Jbt(e.writable),f;try{f=Vte({type:$Ie,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(()=>Zbt(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 Jbt(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 aPe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function jte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function M5(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(kte===Ue||oPe!==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=rPe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return M5(e,t,n,i,!1);if(i)throw p;return M5(e,t,n,!0,!1)}}else{i===Ue&&(i=!0),i&&(c=rPe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return M5(e,t,n,!1,r);throw p}}oPe=e,kte=a,sPe=c}else s=new Worker(kte,sPe);return s.addEventListener(KIe,u=>{n.workerAlive=!0,lPe(n),Qbt(u,n)}),s.addEventListener(Ute,u=>cPe(u,n)),s.addEventListener(Xbt,u=>cPe(u,n)),s}function Zbt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(jte(e),e.worker=null,t){let i=new Error(wE);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function lPe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function cPe(e,t){e.preventDefault&&e.preventDefault(),lPe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;jte(t),n||(t.worker=null);let s=e.error||new Error(e.message||Ute);n||(s=Object.assign(new Error(s.message||Ute),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function Vte(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=d5(o),c.push(e.value.buffer)),i&&zte&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{zte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function Qbt({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==JIe){let{value:y,done:A}=await a.read();g()||Vte({type:Ote,value:y,done:A,messageId:r},t)}n==Ote&&(await c.ready,await c.write(new Uint8Array(i)),g()||Vte({type:ZIe,messageId:r},t)),n==QIe&&m(null,o)}}catch(y){g()||(jte(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}lie();yc();_0();vE();I3();B5();j5();Tte();EE();EI();gne();h3();var xie="File already exists",Tie="Zip file comment exceeds 64KB",lDe="Invalid zip file comment (must be a Uint8Array)",uDe="File entry comment exceeds 64KB",fDe="Invalid file entry comment (must be a string)",dDe="Invalid date (must be a valid Date instance)",hDe="File entry name exceeds 64KB",Eie="Version exceeds 65535",mDe="The strength must equal 1, 2, or 3",pDe="Encryption is not supported in USDZ files",gDe="Encryption is not supported when the 'passThrough' option is set",_De="Invalid extra field (must be a Map)",yDe="Invalid extra field type (must be integer 0..65535)",ADe="Invalid extra field data (must be a Uint8Array)",y9="Extra field data exceeds 64KB",yTt="Compression method not supported",bDe=-2147483648,xDe=2147483647,QPe=BigInt(0),eDe=BigInt("0x7fffffffffffffff"),A9="Zip64 is not supported (set the 'zip64' option to 'true')",TDe="Undefined uncompressed size",EDe="Undefined compression method";var CDe="Undefined reader",vDe="Zip file not empty",SDe="Invalid uid (must be integer 0..2^32-1)",wDe="Invalid gid (must be integer 0..2^32-1)",IDe="Invalid UNIX mode (must be integer 0..65535)",PDe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",DDe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",RDe="Invalid msdosAttributesRaw (must be integer 0..255)",ODe="Invalid msdosAttributes (must be an object with boolean flags)",MDe="Invalid level (must be integer 0..9)",NDe="Signature data exceeds 64KB",tDe=new Uint8Array([7,0,2,0,65,69,3,0,0]),ATt=4,bTt=9,xTt=67,TTt=1,gie="infozip",_ie="unix",ETt=9,uie=0,nDe=[],G3=class{constructor(t,n={}){t=new NI(t);let{availableSize:i=bE,maxSize:r=bE}=t,o=i>0&&i!==bE&&r>0&&r!==bE;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[d3]===Ue?t.size||t.writable.size||0:n[d3],initialOffset:n[d3]===Ue?0:n[d3]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:Ue})}prependZip(t){return fie(this,CTt(this,t))}appendZip(t){return fie(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 G_(t),await kc(t),(t.size===Ue||!t.readUint8Array)&&(t=new rf(await b0(t.readable)),await kc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(lie(),KPe)),d=new f(t),p=await d.getEntries();await d.close(),await kc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(xie);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 HTt(t)||(await v0(n.writer,FDe()),n.offset+=4));let y=await GTt(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=LDe(L||gr),A.extraFieldAES&&(O=99);let P=or(L),M=!!R&&R.uncompressedSize!==Ue,F=!!R&&R.compressedSize!==Ue,V=VDe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=zDe({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&&Uc(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=vTt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),fie(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==xE&&(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(lDe);if(or(t)>65535)throw new Error(Tie);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 kTt(i,t,n),!V5(o)&&$i(i,n,s5)||await s.getWriter().close(),o.getData?o.getData():s}};var yie=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function fie(e,t){let n=new yie((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 CTt(e,t){if(e.filenames.size)throw new Error(vDe);await e.appendZipEntries(t)}async function vTt(e,t,n,i){if(i=Object.assign({},i),$i(e,i,PE)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(xie);e.filenames.add(t),uie<V_().maxWorkers?uie++:await new Promise(r=>nDe.push(r));try{return await STt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=nDe.shift();r?r():uie--}}async function STt(e,t,n,i){let r=wTt(e,t,i);({name:t}=r);let o=ITt(e,t,i),{comment:s}=o,a=i[Y5];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 iPe(V_())&&(p.level=0);let g=await PTt(e,n,o,i);({reader:n}=g);let m=W3(e.writer),y=Y_(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[q5],crc32:i.crc32===Ue?i[q5]:i.crc32,offset:e.offset-m,diskNumberStart:y,[pI]:e.options[pI]});let A=MTt(i),b=LTt(i),x=or(A.localHeaderArray,b.dataDescriptorArray);d=await RTt(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,[H5]:d.internalFileAttributes,[G5]:d.externalFileAttributes}),new ub(d)}function wTt(e,t,n){let i=$i(e,n,one),r=$i(e,n,cne,i?20:768),o=$i(e,n,une),s=WI(e,n,"uid"),a=WI(e,n,"gid"),c=WI(e,n,dne),u=$i(e,n,tIe),f=$i(e,n,hne),d=$i(e,n,mne),p=$i(e,n,pne);if(_I(s,4294967295,SDe),_I(a,4294967295,wDe),_I(c,65535,IDe),u!==Ue&&u!==gie&&u!==_ie)throw new Error(PDe);if(u===_ie&&(s!==Ue&&s>65535||a!==Ue&&a>65535))throw new Error(DDe);u===Ue&&(s!==Ue||a!==Ue)&&(u=gie);let g=WI(e,n,ine),m=$i(e,n,rne),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),_I(g,255,RDe),m&&(typeof m!==Iwe||Array.isArray(m)))throw new Error(ODe);if(r>65535)throw new Error(Eie);let b=UDe(e,n,nne,G5),x=b!==Ue;x||(b=0),!n[PE]&&t.endsWith("/")&&(n[PE]=!0);let T=$i(e,n,PE);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}=NTt(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 ITt(e,t,n){let i=Aie(e,n,eIe)||AI,r=i(t,a5);if(r===Ue&&(r=AI(t)),or(r)>65535)throw new Error(hDe);let o=n[M3]||"";if(typeof o!=xE)throw new Error(fDe);let s=i(o,c5);if(s===Ue&&(s=AI(o)),or(s)>65535)throw new Error(uDe);let a=$i(e,n,ane);if(a!==Ue&&a>65535)throw new Error(Eie);let c=pie(e,n,LI,new Date),u=$i(e,n,FI),f=pie(e,n,L3),d=pie(e,n,F3),p=UDe(e,n,tne,H5,0),g=$i(e,n,t5),m=$i(e,n,QG),y=$i(e,n,e5);f5(m,y);let A=WI(e,n,Gwe,3),b=$i(e,n,lne),x=$i(e,n,Wwe,!0),T=$i(e,n,qwe),E=$i(e,n,Ywe,!0),v=$i(e,n,i5),S=$i(e,n,o5),I=$i(e,n,Kwe),R=Aie(e,n,$we),O=$i(e,n,Jwe,!0),L=u5($i(e,n,n5)),_=$i(e,n,Zwe,!0),C=$i(e,n,fne),w=g||C===Ue?Ue:x5(C);if(!g&&C!==Ue&&C!==0&&C!==8&&!w)throw new Error(yTt);let P=WI(e,n,Xwe);if(_I(P,ETt,MDe),e.options[pI]){if(m!==Ue||y!==Ue)throw new Error(pDe);P===Ue&&C===Ue&&(P=0)}g&&(P=Ue);let M=$i(e,n,r5),F=$i(e,n,gte);I&&F===Ue&&(F=!1),(F===Ue||b&&!g)&&(F=!0),P!==Ue&&P!=6&&(M=!1);let V=$i(e,n,W5);if(!b&&(m!==Ue||y!==Ue)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(mDe);let B=die(n[Y5]),j=die(n[nIe]),k=die(n[iIe]);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 die(e){if(!e)return gr;if(!(e instanceof Map))throw new Error(_De);let t=0,n=0;e.forEach((o,s)=>{if(Ate(s,65535,yDe),!(o instanceof Uint8Array))throw new Error(ADe);if(or(o)>65535)throw new Error(y9);t+=4+or(o)});let i=new Uint8Array(t),r=di(i);return e.forEach((o,s)=>{C0(r,n,s),C0(r,n+2,or(o)),X3(i,o,n+4),n+=4+or(o)}),i}async function PTt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!$i(e,i,PE))throw new Error(CDe);let r;return t&&(t=new G_(t),await kc(t),{size:r}=t),Object.assign({reader:t},DTt(e,!!t,r,n,i))}function DTt(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[N3],y===Ue)throw new Error(TDe);if(g===Ue)throw new Error(EDe)}let A=d===!0,b=$i(e,r,sne);if(t&&o&&!b&&or(a,c))throw new Error(gDe);let x=t&&(!!(a&&or(a)||c&&or(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?cDe(y)+T:n):n===Ue?(f=!0,(d||d===Ue)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(bie(g,p)?cDe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!bie(g,p);E&&!s&&$i(e,r,gte)===Ue&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(A9);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 RTt(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:bE}),I.size=0,await kc(s)):(I=s,await R,await O()),await kc(I);let _=W3(s);e.addSplitZipSignature&&!b&&await oDe(e,s),y&&!b&&iDe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=Y_(s),P=q3(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await v0(I,C)),A=await OTt(n,I,A,i,V_(),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 oDe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=Y_(s),A.offset=q3(e,s),y){let M=i.metadataSize;iDe(i,e.offset-W3(s)),A.size+=i.metadataSize-M}BTt(A,d.localHeaderView,r),await v0(s,d.localHeaderArray),await BDe(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(){qI(s,or(d.localHeaderArray))&&await s.closeDisk()}}async function OTt(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,bi={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,hi=0;ht||(wi=0);let{writable:xi}=t;if(e){let jn=Wm(qte(e)),nn=e.size,Wn={options:{codecType:II,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 F5({readable:jn,writable:xi},Wn);if(hi=Zi.outputSize,t.size+=hi,ht||(wi=Zi.inputSize,(!m||j)&&(Wi=Zi.crc32)),!B&&hi>=4294967295||!V&&wi>=4294967295)throw new Error(A9)}catch(Zi){throw Zi.outputSize!==Ue&&(t.size+=Zi.outputSize),Zi}}return FTt({crc32:Wi,compressedSize:hi,uncompressedSize:wi,headerInfo:a,dataDescriptorInfo:c},s),k&&await v0(t,O),Object.assign(bi,{uncompressedSize:wi,compressedSize:hi,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+hi,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:Wi,crc32:m&&!j&&!ht?Ue:Wi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),bi}function MTt(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&&bie(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=id(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=id(or(tDe)+2);xe.writeUint16(39169),xe.writeBytes(tDe),P=xe.array,P[8]=m}else P=gr;let M,F,V;if(y){let xe=p9(n),ge=kDe(xe);if(ge){let Se=9+(r?4:0)+(o?4:0),Re=id(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(sDe(p9(r))),o&&Re.writeUint32(sDe(p9(o))),F=Re.array}else F=gr;if(A===Ue?!ge||!!(r||o):A)try{let Se=mie(n),Re=id(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(Se),Re.writeUint64(r?mie(r):Se),Re.writeUint64(o?mie(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==gie&&(xe!==Ue||ge!==Ue)){let Se=rDe(xe===Ue?0:xe),Re=rDe(ge===Ue?0:ge),Qe=3+Se.length+Re.length,He=id(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==_ie&&(xe!==Ue||ge!==Ue)){let Se=id(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[ATt]=TTt),C0(di(P),bTt,R),R=99);let k=w?or(L):0,G=k+or(P,F,M,B,p,g),q=e[pI]?xTt:0;if(G+q>65535)throw new Error(y9);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=zDe({version:I,bitFlag:VDe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<mI?mI:Q>pte?pte:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=id(30+or(t)+G),Ae=ae.array,fe=di(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||Uc(fe,18,0),T||Uc(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 iDe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+or(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=di(s);C0(a,0,6534),C0(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(or(c)+o),X3(i,c),X3(i,s,or(c));let u=di(i);C0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function rDe(e){let t=new Uint8Array(4);di(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function NTt(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 LTt({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=di(i),n&&(o=4,Uc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function FTt({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&&(Uc(u,10,e),c&&Uc(d,p,e)),o?c&&(Y3(d,p+4,BigInt(t)),Y3(d,p+12,BigInt(n))):(Uc(u,14,t),Uc(u,18,n),c&&(Uc(d,p+4,t),Uc(d,p+8,n)))}function BTt({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)&&Uc(u,14,r),c||Uc(u,18,o),a||Uc(u,22,s)),n&&i){let p=30+or(e)+4;Y3(u,p,BigInt(s)),Y3(u,p+8,BigInt(o))}}async function kTt(e,t,n){let i=UTt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await zTt(e,i,n),a=await VTt(e,s,n);await jTt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function UTt(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=id(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=p9(p);if(f&&kDe(v)){let I=id(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=gr;n.rawExtraFieldExtendedTimestamp=E;let S=or(T,r,s,a,E,c,u);if(S>65535)throw new Error(y9);t+=46+or(i,o)+S}return t}async function zTt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await kc(r);let s=0,a=0,c=Y_(r),u=W3(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=or(y,A,b,x,T,E,v),k=46+or(m,S)+j;qI(r,s+k-a)&&(await v0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=Y_(r),u=W3(r)),L||Uc(O,18,V),_||Uc(O,14,B),(w||C)&&p.version<45&&C0(O,0,45);let G=id(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(or(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),X3(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new ub(p))}catch{}}return await v0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:Y_(r),entriesLength:f},directoryArray:o}}async function VTt(e,t,n){let i=Aie(e,n,cIe);if(i){let r=await i(t),o=or(r);if(o>65535)throw new Error(NDe);let s=id(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return qI(a,or(s.array))&&await a.closeDisk(),await v0(a,s.array),6+o}return 0}async function jTt(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=q3(e,o),p=or(t);if(p>65535)throw new Error(Tie);let g=$i(e,n,W5),m=Y_(r);if(qI(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(A9);g=!0}let y=id(g?98:22);qI(r,or(y.array)+p)&&await r.closeDisk(),m=Y_(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(q3(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),$i(e,n,Qwe,!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 v0(r,y.array),p&&await v0(r,t)}function id(e){let t=new Uint8Array(e),n=di(t),i=0;return{array:t,writeUint8:r=>{YTt(n,i,r),i+=1},writeUint16:r=>{C0(n,i,r),i+=2},writeUint32:r=>{Uc(n,i,r),i+=4},writeUint64:r=>{Y3(n,i,BigInt(r)),i+=8},writeBytes:r=>{X3(t,r,i),i+=or(r)},skip:r=>i+=r}}function Y_(e){let{diskNumber:t=0}=e;return t}function W3(e){let{diskOffset:t=0}=e;return t}function qI(e,t){let{availableSize:n=bE}=e;return t>n}function q3(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function HTt(e){let t=await Uo(e,0,4);return qTt(di(t),0)==134695760}function LDe(e){let t=di(e),n=0;for(;n+4<=or(e);){let i=4+_9(t,n+2);if(_9(t,n)==1)return LDe(ph(e.subarray(0,n),e.subarray(Math.min(n+i,or(e)))));n+=i}return e}async function GTt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>m9(t,c)-m9(t,u)),a=0;for(let c of s){let u=m9(t,c);await hie(e,t,a,u-a),qI(r,await WTt(t,u))&&await r.closeDisk(),o.set(c,{offset:q3(e,r),diskNumberStart:Y_(r)}),a=u}await hie(e,t,a,i-a)}else{let s=e.offset;await hie(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+m9(t,a),diskNumberStart:0}))}return o}async function hie(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await BDe(qte(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 WTt(e,t){let n=await Uo(e,t,30);if(or(n)<30)return 30;let i=di(n);return 30+_9(i,26)+_9(i,28)}function m9(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function FDe(){let e=new Uint8Array(4);return Uc(di(e),0,134695760),e}async function oDe(e,t){delete e.addSplitZipSignature,await v0(t,FDe()),e.offset+=4}async function v0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=or(t),await i.write(t)}finally{i.releaseLock()}}async function BDe(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(or(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function mie(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<QPe?QPe:t>eDe?eDe:t}}function p9(e){return Math.floor(e.getTime()/1e3)}function kDe(e){return e>=bDe&&e<=xDe}function sDe(e){return Math.min(xDe,Math.max(bDe,e))}function $i(e,t,n,i){let r=t[n]===Ue?e.options[n]:t[n];return r===Ue?i:r}function pie(e,t,n,i){let r=$i(e,t,n,i);if(r===null)return i;if(r!==Ue&&(typeof r.getTime!=Bo||Number.isNaN(r.getTime())))throw new Error(dDe);return r}function Aie(e,t,n){return gI($i(e,t,n))}function UDe(e,t,n,i,r){let o=aDe(t,n,i),s=o===Ue?aDe(e.options,n,i):o;return s===Ue?r:s}function aDe(e,t,n){return e[t]===Ue?e[n]:e[t]}function WI(e,t,n,i){return TE($i(e,t,n,i))}function cDe(e){return e+5*(Math.floor(e/16383)+1)}function bie(e,t){return e===Ue?t===Ue||t>0:e!==0}function _9(e,t){return e.getUint16(t,!0)}function qTt(e,t){return e.getUint32(t,!0)}function YTt(e,t,n){e.setUint8(t,n)}function C0(e,t,n){e.setUint16(t,n,!0)}function Uc(e,t,n){e.setUint32(t,n,!0)}function Y3(e,t,n){e.setBigUint64(t,n,!0)}function X3(e,t,n){e.set(t,n)}function or(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function zDe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=id(26),p=d.array,g=di(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===Ue){let m=new Uint32Array(1),y=di(m);C0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),C0(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(or(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function VDe(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}j5();h3();_0();vE();yc();_0();vE();Rte();var dLi=1024*1024;EI();var pLi=1024*1024;var _Li=1024*1024;var yLi=512*1024;var KTt={};try{yI({baseURI:KTt.url})}catch{}_0();var $Tt=[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],JTt=[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],ZTt=[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],QTt=[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],eEt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],$3=new Uint8Array(288);$3.fill(8,0,144),$3.fill(9,144,256),$3.fill(7,256,280),$3.fill(8,280,288);var tEt=new Uint8Array(30).fill(5);function K3(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 rd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function jDe(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+=rd[a>>18&63]+rd[a>>12&63]+rd[a>>6&63]+rd[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=rd[a>>18&63]+rd[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=rd[a>>18&63]+rd[a>>12&63]+rd[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(K3($3),K3(tEt));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=$Tt[T]+f(JTt[T]),v=m(b),S=ZTt[v]+f(QTt[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[eEt[I]]=f(3);let E=K3(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[K3(v.subarray(0,A)),K3(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=rd.indexOf(n[o])<<18|rd.indexOf(n[o+1])<<12|(63&rd.indexOf(n[o+2]))<<6|63&rd.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/YTd8baGe2SRCudqpbGf0qpVGltrLa2FW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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)})}yc();_0();I3();B5();var T9="deflate",b9="deflate-raw",HDe="deflate64-raw",x9="gzip",Ms,YI,X_,J3,GDe;function WDe(e){if(Ms=e,{malloc:YI,free:X_,memory:J3}=Ms,typeof YI!="function"||typeof X_!="function"||!J3)throw Ms=YI=X_=J3=null,new Error("Invalid WASM module")}function qDe(e){GDe=e}function YDe(e,t,n={}){if(!Ms){let a=new Error("WASM module not loaded");throw a.cause=GDe,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=YI(r),this.in=YI(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=Ms.deflate_process,this._last_consumed=Ms.deflate_last_consumed,this._end=Ms.deflate_end,this.streamHandle=Ms.deflate_new(),t===x9?a=Ms.deflate_init_gzip(this.streamHandle,i):t===b9?a=Ms.deflate_init_raw(this.streamHandle,i):a=Ms.deflate_init(this.streamHandle,i)):t===HDe?(this._process=Ms.inflate9_process,this._last_consumed=Ms.inflate9_last_consumed,this._end=Ms.inflate9_end,this.streamHandle=Ms.inflate9_new(),a=Ms.inflate9_init_raw(this.streamHandle)):(this._process=Ms.inflate_process,this._last_consumed=Ms.inflate_last_consumed,this._end=Ms.inflate_end,this.streamHandle=Ms.inflate_new(),t===b9?a=Ms.inflate_init_raw(this.streamHandle):t===x9?a=Ms.inflate_init_gzip(this.streamHandle):a=Ms.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(J3.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&&X_&&(X_(this.in),this.in=0),this.in=YI(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(J3.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&&X_&&X_(a.in),a.in=0,a.out&&X_&&X_(a.out),a.out=0,c}}var FE=class{constructor(t=T9,n){return YDe(!0,t,n)}},BE=class{constructor(t=T9,n){return YDe(!1,t,n)}};FE.requiresModule=!0;BE.requiresModule=!0;FE.supportedFormats=[T9,b9,x9];BE.supportedFormats=[T9,b9,x9,HDe];var XDe=!1;async function KDe(e,{baseURI:t}){if(!XDe)try{await nEt(e,t),XDe=!0}catch(n){throw qDe(n),n}}async function nEt(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=iEt(e);else throw o}let r=await WebAssembly.instantiate(n);WDe(r.instance.exports)}function iEt(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 E9;tPe({initModule:e=>{if(!E9){let{wasmURI:t}=e;typeof t==Bo&&(t=t()),E9=KDe(t,e).catch(n=>{throw E9=null,n})}return E9}});yI({CompressionStreamFallback:FE,DecompressionStreamFallback:BE});jDe(yI);var Cie=32,rEt="http://www.opengis.net/kml/2.2",Xm="http://www.google.com/kml/ext/2.2",oEt="http://www.w3.org/2000/xmlns/";function C9(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var sEt=/^data:image\/([^,;]+)/;C9.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(sEt);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 aEt(e,t){return function(n){e._files[t]=n}}C9.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(aEt(this,o))}return r};Object.defineProperties(C9.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function v9(e){this._time=e}v9.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};v9.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return UE(n)};v9.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function vie(){this._ids={},this._styles={},this._count=0}vie.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};vie.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 ZDe(){this._ids={}}ZDe.prototype.get=function(e){if(!l(e))return this.get($n());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Sie(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Sie._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(oEt,"xmlns:gx",Xm);let a=o.createElement("Document");s.appendChild(a),e1e(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?cEt(f,c.files):{kml:f,externalFiles:c.files}})}async function cEt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");p3({workerURI:n,wasmURI:i});let r=new MI("application/vnd.google-earth.kmz"),o=new G3(r);await o.add("doc.kml",new R3(e));let s=Object.keys(t);return await QDe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function QDe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new rf(n[r])),QDe(e,t,n,i+1)}Sie._createState=function(e){let t=e.entities,n=new vie,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===tt.MINIMUM_VALUE?o.stop===tt.MAXIMUM_VALUE?o=new En:K.addSeconds(o.stop,-10*s,o.start):o.stop===tt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new C9(e.modelCallback);return{kmlDoc:document.implementation.createDocument(rEt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new ZDe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new v9(r),sampleDuration:s,defaultAvailability:new Ps([o])}};function e1e(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=[],lEt(e,p,u,f),uEt(e,p.polyline,u,f),JDe(e,p.rectangle,u,f,c),JDe(e,p.polygon,u,f,c),mEt(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,tt.MINIMUM_VALUE)||g.appendChild(vn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,tt.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),e1e(e,b,A)}}}var sf=new h,gu=new he,Ym=new K;function lEt(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){t1e(e,t,a,n,i);return}s.get(c,void 0,sf);let u=vn(r,"coordinates",kE(sf,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(zE(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof qc?i1e(e,a):n1e(e,a);i.push(p)}function t1e(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof mc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof Tg,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 m0?(x=x._value,T.appendChild(zE(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(zE(e,n.heightReference)):T.appendChild(zE(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,sf);let I=vn(o,"coordinates",kE(sf,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof gc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],ji.FIXED,sf),v.push(kE(sf,s));else if(x instanceof Jf){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,sf),v.push(kE(sf,s))}else{let I=e.sampleDuration;b.start.clone(Ym),b.isStartIncluded||K.addSeconds(Ym,I,Ym);let R=b.stop;for(;K.lessThan(Ym,R);)x.getValue(Ym,sf),E.push(K.toIso8601(Ym)),v.push(kE(sf,s)),K.addSeconds(Ym,I,Ym);b.isStopIncluded&&K.equals(Ym,R)&&(x.getValue(Ym,sf),E.push(K.toIso8601(Ym)),v.push(kE(sf,s)))}let S=o.createElementNS(Xm,"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],Xm);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(r1e(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(Xm,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof qc?i1e(e,n):n1e(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)),wie(e,x,T),r.push(T)}}}function n1e(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/Cie)),r}function i1e(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,Xm)),p.appendChild(vn(n,"y",g.y,Xm)),p.appendChild(vn(n,"w",g.width,Xm)),p.appendChild(vn(n,"h",g.height,Xm))),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,Cie),g=i.get(t.height,Cie),m=i.get(t.horizontalOrigin,zi.CENTER);m===zi.CENTER?u.x-=p*.5:m===zi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Hn.CENTER);y===Hn.TOP?u.y+=g:y===Hn.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 uEt(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",kE(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(vn(r,"drawOrder",m,Xm)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(vn(r,"width",A)),wie(e,t.material,y),i.push(y)}function fEt(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 $De(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 dEt(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($De(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($De(e,p[m].positions,o,s)),a.push(y)}}return a}function JDe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Qh;if(a&&s.getMaterialType(t.material)==="Image"){hEt(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?fEt(e,t,u):dEt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(zE(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)),wie(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 hEt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(zE(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",UE(d.color))),n.push(s)}function r1e(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 mEt(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){t1e(e,t,n,i,r);return}let u=r1e(e,n),f=o.createElement("altitudeMode");f.appendChild(zE(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,sf),he.fromCartesian(sf,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 wie(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=UE(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=UE(o.color);break;case"PolylineOutline":s=UE(o.color),c=UE(o.outlineColor),u=o.outlineWidth,n.appendChild(vn(i,"outerColor",c,Xm)),n.appendChild(vn(i,"outerWidth",u,Xm));break;case"Stripe":s=UE(o.oddColor);break}l(s)&&(n.appendChild(vn(i,"color",s)),n.appendChild(vn(i,"colorMode","normal")))}function zE(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 kE(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 UE(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 Iie=Sie;function Q3(){this._cache={}}Q3.prototype.fromColor=function(e,t){return S9(void 0,void 0,e,t,this._cache)};Q3.prototype.fromUrl=function(e,t,n){return S9(e,void 0,t,n,this._cache)};Q3.prototype.fromMakiIconId=function(e,t,n){return S9(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};Q3.prototype.fromText=function(e,t,n){return S9(void 0,e,t,n,this._cache)};var pEt=new z;function gEt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,pEt).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 o1e(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 Z3=new Array(4);function S9(e,t,n,i,r){Z3[0]=e,Z3[1]=t,Z3[2]=n,Z3[3]=i;let o=JSON.stringify(Z3),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(gEt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return o1e(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=PT(t,{font:`bold ${i}px sans-serif`});o1e(c,u,i)}return r[o]=a,a}var K_=Q3;var c1e=Qo(a1e(),1);function I9(e){return h.fromDegrees(e[0],e[1],e[2])}var Pie={"urn:ogc:def:crs:OGC:1.3:CRS84":I9,"EPSG:4326":I9,"urn:ogc:def:crs:EPSG::4326":I9},l1e={},u1e={},Die=48,Rie,Oie=z.ROYALBLUE,Mie=z.YELLOW,Nie=2,Lie=z.fromBytes(255,255,0,100),Fie=!1,_Et={small:24,medium:48,large:64},yEt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function f1e(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||yEt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${f1e(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 AEt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function bEt(e,t){return new em(AEt(f1e,e,t),!0)}function P9(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=$n();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 li(c):n(o,s))}return r}function Bie(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var d1e={Feature:m1e,FeatureCollection:xEt,GeometryCollection:p1e,LineString:b1e,MultiLineString:x1e,MultiPoint:y1e,MultiPolygon:C1e,Point:_1e,Polygon:E1e,Topology:v1e},h1e={GeometryCollection:p1e,LineString:b1e,MultiLineString:x1e,MultiPoint:y1e,MultiPolygon:C1e,Point:_1e,Polygon:E1e,Topology:v1e};function m1e(e,t,n,i,r){if(t.geometry===null){P9(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=h1e[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function xEt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)m1e(e,o[s],void 0,i,r)}function p1e(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=h1e[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function g1e(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=_Et[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 qc;f.verticalOrigin=new li(Hn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=P9(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Gl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new li(g)}).catch(function(){f.image=new li(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function _1e(e,t,n,i,r){g1e(e,t,i,n.coordinates,r)}function y1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)g1e(e,t,i,o[s],r)}function A1e(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 li(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=P9(t,e._entityCollection,r.describe),u=new el;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new li(Bie(i,n)),u.arcType=ln.RHUMB}function b1e(e,t,n,i,r){A1e(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++)A1e(e,t,i,o[s],r)}function T1e(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 li(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 li(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 Zh;u.outline=new li(!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 Rc(Bie(i[g],n)));let d=i[0];u.hierarchy=new li(new Rc(Bie(d,n),f)),d[0].length>2?u.perPositionHeight=new li(!0):r.clampToGround||(u.height=0);let p=P9(t,e._entityCollection,r.describe);p.polygon=u}function E1e(e,t,n,i,r){T1e(e,t,i,n.coordinates,r)}function C1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)T1e(e,t,i,o[s],r)}function v1e(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=c1e.feature(n,n.objects[o]),a=d1e[s.type];a(e,s,s,i,r)}}function hb(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ya(this),this._promises=[],this._pinBuilder=new K_,this._entityCluster=new Kf,this._credit=void 0,this._resourceCredits=[]}hb.load=function(e,t){return new hb().load(e,t)};Object.defineProperties(hb,{markerSize:{get:function(){return Die},set:function(e){Die=e}},markerSymbol:{get:function(){return Rie},set:function(e){Rie=e}},markerColor:{get:function(){return Oie},set:function(e){Oie=e}},stroke:{get:function(){return Mie},set:function(e){Mie=e}},strokeWidth:{get:function(){return Nie},set:function(e){Nie=e}},fill:{get:function(){return Lie},set:function(e){Lie=e}},clampToGround:{get:function(){return Fie},set:function(e){Fie=e}},crsNames:{get:function(){return Pie}},crsLinkHrefs:{get:function(){return l1e}},crsLinkTypes:{get:function(){return u1e}}});Object.defineProperties(hb.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}}});hb.prototype.load=function(e,t){return S1e(this,e,t,!0)};hb.prototype.process=function(e,t){return S1e(this,e,t,!1)};function S1e(e,t,n,i){Ds.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??bEt,markerSize:n.markerSize??Die,markerSymbol:n.markerSymbol??Rie,markerColor:n.markerColor??Oie,strokeWidthProperty:new li(n.strokeWidth??Nie),strokeMaterialProperty:new Kt(n.stroke??Mie),fillMaterialProperty:new Kt(n.fill??Lie),clampToGround:n.clampToGround??Fie},Promise.resolve(o).then(function(a){return TEt(e,a,n,s,i)}).catch(function(a){throw Ds.setLoading(e,!1),e._error.raiseEvent(e,a),a})}hb.prototype.update=function(e){return!0};function TEt(e,t,n,i,r){let o;l(i)&&(o=w_(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=d1e[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?I9: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=Pie[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=l1e[u.href];if(l(f)||(f=u1e[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=Pie[`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,Ds.setLoading(e,!1),e})})}var mb=hb;function EEt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Ln=EEt;var PRe=Qo(ure(),1);var DRe;typeof DOMParser<"u"&&(DRe=new DOMParser);var FSt=new PRe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),K9=32,xRe=2414016,TRe=1,ERe=16093e3,CRe=.1,BSt=[null,void 0,"http://www.topografix.com/GPX/1/1"],eo={gpx:BSt};function kSt(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 fre(e,t){let n=iU(e,"id");return n=l(n)?n:$n(),t.getOrCreateEntity(n)}function dre(e){let t=vRe(e,"lon"),n=vRe(e,"lat"),i=tU(e,"ele",eo.gpx);return h.fromDegrees(t,n,i)}function vRe(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 iU(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function _b(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 hre(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 tU(e,t,n){let i=_b(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function af(e,t,n){let i=_b(e,t,n);if(l(i))return i.textContent.trim()}function RRe(e){let t=new qc;return t.width=K9,t.height=K9,t.scaleByDistance=new qt(xRe,TRe,ERe,CRe),t.pixelOffsetScaleByDistance=new qt(xRe,TRe,ERe,CRe),t.verticalOrigin=new li(Hn.BOTTOM),t.image=e,t}function USt(){let e=new Jh;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=zi.LEFT,e.font="16px sans-serif",e.style=Ao.FILL_AND_OUTLINE,e}function ORe(e){let t=new el;return t.width=4,t.material=new XA,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var SRe={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"}},nU;typeof document<"u"&&(nU=document.createElement("div"));function mre(e,t){let n,i="",r=Object.keys(SRe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=SRe[f];d.value=af(e,d.tag,eo.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=FSt.link(i),nU.innerHTML=i;let s=nU.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+=`${nU.innerHTML}</div>`,nU.innerHTML="",u}function MRe(e,t,n,i){let r=dre(t),o=fre(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,K9);o.billboard=RRe(s);let a=af(t,"name",eo.gpx);o.name=a,o.label=USt(),o.label.text=a,o.description=mre(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function zSt(e,t,n,i){let r=fre(t,n);r.description=mre(t,r);let o=hre(t,"rtept",eo.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)MRe(e,o[a],n,i),s[a]=dre(o[a]);r.polyline=ORe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function VSt(e,t,n,i){let r=fre(t,n);r.description=mre(t,r);let o=hre(t,"trkseg",eo.gpx),s=[],a=[],c,u=!0,f=new gc;for(let d=0;d<o.length;d++)c=jSt(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,K9);r.billboard=RRe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Ps,r.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}r.polyline=ORe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function jSt(e){let t={positions:[],times:[]},n=hre(e,"trkpt",eo.gpx),i;for(let r=0;r<n.length;r++){let o=dre(n[r]);t.positions.push(o),i=af(n[r],"time",eo.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function HSt(e){let t=_b(e,"metadata",eo.gpx);if(l(t)){let n={name:af(t,"name",eo.gpx),desc:af(t,"desc",eo.gpx),author:GSt(t),copyright:qSt(t),link:NRe(t),time:af(t,"time",eo.gpx),keywords:af(t,"keywords",eo.gpx),bounds:YSt(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 GSt(e){let t=_b(e,"author",eo.gpx);if(l(t)){let n={name:af(t,"name",eo.gpx),email:WSt(t),link:NRe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function WSt(e){let t=_b(e,"email",eo.gpx);if(l(t)){let n=af(t,"id",eo.gpx),i=af(t,"domain",eo.gpx);return`${n}@${i}`}}function NRe(e){let t=_b(e,"link",eo.gpx);if(l(t)){let n={href:iU(t,"href"),text:af(t,"text",eo.gpx),mimeType:af(t,"type",eo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function qSt(e){let t=_b(e,"copyright",eo.gpx);if(l(t)){let n={author:iU(t,"author"),year:af(t,"year",eo.gpx),license:af(t,"license",eo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function YSt(e){let t=_b(e,"bounds",eo.gpx);if(l(t)){let n={minLat:tU(t,"minlat",eo.gpx),maxLat:tU(t,"maxlat",eo.gpx),minLon:tU(t,"minlon",eo.gpx),maxLon:tU(t,"maxlon",eo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var wRe={wpt:MRe,rte:zSt,trk:VSt};function XSt(e,t,n,i){let r=Object.keys(wRe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=wRe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&eo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function IRe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=iU(r,"version"),s=iU(r,"creator"),a,c=HSt(r);l(c)&&(a=c.name),r.localName==="gpx"?XSt(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,tt.MINIMUM_VALUE),m=K.equals(p,tt.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 Lm,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=Rs.LOOP_STOP,u.clockStep=Vr.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),KSt(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),Ds.setLoading(e,!1),e}function KSt(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 $St(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?kSt(o).then(function(s){let a,c;try{a=DRe.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 IRe(e,a,i)}):IRe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function eP(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Ya(this),this._entityCluster=new Kf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new K_}eP.load=function(e,t){return new eP().load(e,t)};Object.defineProperties(eP.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}}});eP.prototype.update=function(e){return!0};eP.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Ds.setLoading(this,!0);let n=this._name,i=this;return $St(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,tt.MINIMUM_VALUE),u=K.equals(a,tt.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 Lm,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=Rs.LOOP_STOP,r.clockStep=Vr.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),Ds.setLoading(i,!1),i}).catch(function(r){return Ds.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var rU=eP;function JSt(e,t){this.position=e,this.headingPitchRoll=t}var oU=JSt;var XRe=Qo(ure(),1),fU=Qo(xf(),1);function ZSt(e,t){this.position=e,this.headingPitchRange=t}var sU=ZSt;function $9(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=[]}$9.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};$9.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;FRe.call(this,e,t,function(i){n.playlistIndex=0,i||LRe(n._activeEntries),n.tourEnd.raiseEvent(i)})};$9.prototype.stop=function(){LRe(this._activeEntries)};function LRe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function FRe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=QSt.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 QSt(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++,FRe.call(this,e,t,n)}}var aU=$9;var sr=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-sr.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?sr.Bounce.In(e*2)*.5:sr.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}}}}),cU=function(){return performance.now()},ewt=(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=cU()),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})(),tP={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=tP.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=tP.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=tP.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=tP.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}}},BRe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),pre=new ewt,kRe=(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=sr.Linear.None,this._interpolationFunction=tP.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=BRe.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=pre,pre.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=cU()),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=cU()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=cU()),!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=sr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=tP.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=cU()),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 U2i=BRe.nextId,D0=pre,z2i=D0.getAll.bind(D0),V2i=D0.removeAll.bind(D0),j2i=D0.add.bind(D0),H2i=D0.remove.bind(D0),G2i=D0.update.bind(D0);var twt={LINEAR_NONE:sr.Linear.None,QUADRATIC_IN:sr.Quadratic.In,QUADRATIC_OUT:sr.Quadratic.Out,QUADRATIC_IN_OUT:sr.Quadratic.InOut,CUBIC_IN:sr.Cubic.In,CUBIC_OUT:sr.Cubic.Out,CUBIC_IN_OUT:sr.Cubic.InOut,QUARTIC_IN:sr.Quartic.In,QUARTIC_OUT:sr.Quartic.Out,QUARTIC_IN_OUT:sr.Quartic.InOut,QUINTIC_IN:sr.Quintic.In,QUINTIC_OUT:sr.Quintic.Out,QUINTIC_IN_OUT:sr.Quintic.InOut,SINUSOIDAL_IN:sr.Sinusoidal.In,SINUSOIDAL_OUT:sr.Sinusoidal.Out,SINUSOIDAL_IN_OUT:sr.Sinusoidal.InOut,EXPONENTIAL_IN:sr.Exponential.In,EXPONENTIAL_OUT:sr.Exponential.Out,EXPONENTIAL_IN_OUT:sr.Exponential.InOut,CIRCULAR_IN:sr.Circular.In,CIRCULAR_OUT:sr.Circular.Out,CIRCULAR_IN_OUT:sr.Circular.InOut,ELASTIC_IN:sr.Elastic.In,ELASTIC_OUT:sr.Elastic.Out,ELASTIC_IN_OUT:sr.Elastic.InOut,BACK_IN:sr.Back.In,BACK_OUT:sr.Back.Out,BACK_IN_OUT:sr.Back.InOut,BOUNCE_IN:sr.Bounce.In,BOUNCE_OUT:sr.Bounce.Out,BOUNCE_IN_OUT:sr.Bounce.InOut},Ls=Object.freeze(twt);function J9(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}J9.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 ue(this.view.position);t.flyToBoundingSphere(r,i)}};J9.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};J9.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ls.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 lU=J9;function gre(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}gre.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};gre.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var uU=gre;var KRe={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=ng(t),KRe[t]}},Sre;typeof DOMParser<"u"&&(Sre=new DOMParser);var nwt=new XRe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),yb=32,URe=2414016,zRe=1,VRe=16093e3,jRe=.1,HRe=[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"],GRe=["http://www.google.com/kml/ext/2.2"],iwt=["http://www.w3.org/2005/Atom"],Ve={kml:HRe,gx:GRe,atom:iwt,kmlgx:HRe.concat(GRe)},wre={Document:oOe,Folder:Twt,Placemark:Ewt,NetworkLink:Owt,GroundOverlay:Pwt,PhotoOverlay:cOe,ScreenOverlay:Iwt,Tour:vwt},xre=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=Z_._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=Z_._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=wre[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||Z_._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function rwt(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 owt(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 $Re(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 JRe(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 swt(e,t){let n=await e.getData(new O3);n=$Re(n),n=JRe(n),t.kml=Sre.parseFromString(n,"application/xml")}async function _re(e,t){let n=KRe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new D3(n));t[e.filename]=i}function sd(e,t,n,i){let r=i.keys,o=new fU.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 fU.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 ad(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=Ire(a,i);l(c)&&s.setAttribute(n,c.url)}}function ZRe(e,t,n){let i=Da(e,"id");i=l(i)&&i.length!==0?i:$n(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=$n(),l(n)&&(i=n+i)),r=t.add(new Jr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new vre),r}function dU(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function t7(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 Z9(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++]=t7(n[s],t);return r}function Ab(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 WRe(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 Zm(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 Qm(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 Ire(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 fU.default(t.getUrlComponent()),s=new fU.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var cf={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Tre(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?(cf.maximumRed=o,cf.red=void 0):(cf.maximumRed=void 0,cf.red=0),r>0?(cf.maximumGreen=r,cf.green=void 0):(cf.maximumGreen=void 0,cf.green=0),i>0?(cf.maximumBlue=i,cf.blue=void 0):(cf.maximumBlue=void 0,cf.blue=0),cf.alpha=n,z.fromRandom(cf)):new z(o,r,i,n)}function qE(e,t,n){let i=Fn(e,t,n);if(l(i))return Tre(i,Fn(e,"colorMode",n)==="random")}function awt(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 Ps;return r.addInterval(new En({start:i,stop:tt.MAXIMUM_VALUE})),r}function cwt(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 Ps,n.addInterval(new En({start:r,stop:s}))}else l(r)?(n=new Ps,n.addInterval(new En({start:r,stop:tt.MAXIMUM_VALUE}))):l(s)&&(n=new Ps,n.addInterval(new En({start:tt.MINIMUM_VALUE,stop:s})));return n}function QRe(){let e=new qc;return e.width=yb,e.height=yb,e.scaleByDistance=new qt(URe,zRe,VRe,jRe),e.pixelOffsetScaleByDistance=new qt(URe,zRe,VRe,jRe),e}function Pre(){let e=new Zh;return e.outline=!0,e.outlineColor=z.WHITE,e}function eOe(){let e=new Jh;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=zi.LEFT,e.font="16px sans-serif",e.style=Ao.FILL_AND_OUTLINE,e}function Dre(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=Ire(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(Tf(e7(d))),l(p)&&s.setQueryParameters(Tf(e7(p)));let g=t._ellipsoid;return Ore(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function lwt(e,t,n,i,r){let o=Si(t,"scale",Ve.kml),s=Si(t,"heading",Ve.kml),a=qE(t,"color",Ve.kml),c=ar(t,"Icon",Ve.kml),u=Dre(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=Ab(m,"x"),A=Ab(m,"y"),b=Da(m,"xunits"),x=Da(m,"yunits"),T=n.billboard;l(T)||(T=QRe(),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-yb)*o:b==="fraction"&&(E=-y*yb*o),E+=yb*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+yb)*o:x==="fraction"&&(v=A*yb*o),v-=yb*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function Q9(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")lwt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=eOe(),n.label=c),c.scale=Si(a,"scale",Ve.kml)??c.scale,c.fillColor=qE(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new el,n.polyline=c),c.width=Si(a,"width",Ve.kml),c.material=qE(a,"color",Ve.kml),l(qE(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(Qm(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=Pre(),n.polygon=c),c.material=qE(a,"color",Ve.kml)??c.material,c.fill=Qm(a,"fill",Ve.kml)??c.fill,c.outline=Qm(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Tre(Fn(a,"bgColor",Ve.kml))??z.WHITE,u=Tre(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 uwt(e,t,n,i,r){let o=new Jr,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")Q9(e,d,o,i,r);else{let p=Zm(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);Q9(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 fwt(e,t,n){return t.fetchXML().then(function(i){return tOe(e,i,n,t,!0)})}function tOe(e,t,n,i,r,o){let s,a,c,u,f=WRe(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 Jr({id:a}),n.add(c),Q9(e,u,c,i,o)))}let d=WRe(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=Zm(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),Q9(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(fwt(e,x,n))}}}return p}function Rre(e,t,n){let i=new D_(e,t.id,["position"]),r=new m0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new el,t.polyline.positions=new P_([i,r])}function nOe(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 dwt(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 m0(e))}function hwt(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 n7(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():eOe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():QRe(),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 iOe(e,t){let n=e.path;l(n)||(n=new Eg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function mwt(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=Qm(n,"extrude",Ve.kml),u=e._ellipsoid,f=t7(o,u);return i.position=f,n7(e,i,r,nOe(s,a)),c&&dU(s,a)&&Rre(t,i,r),!0}function qRe(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=Qm(n,"extrude",Ve.kml),u=Qm(n,"tessellate",Ve.kml),f=dU(s,a),d=Si(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=Z9(o,p),m=r.polyline;if(f&&c){let y=new Cg;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 el;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(tt.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 el,i.polyline=m,m.positions=hwt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function pwt(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=Z9(a,c),f=Qm(n,"extrude",Ve.kml),d=Fn(n,"altitudeMode",Ve.kml),p=Fn(n,"altitudeMode",Ve.gx),g=dU(d,p),m=l(r.polygon)?r.polygon.clone():Pre(),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 Rc(u),b=Zm(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=Zm(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=ar(s[T],"coordinates",Ve.kml),u=Z9(a,c),l(u)&&A.holes.push(new Rc(u))}m.hierarchy=A}return!0}function gwt(e,t,n,i,r){let o=Fn(n,"altitudeMode",Ve.kml),s=Fn(n,"altitudeMode",Ve.gx),a=Zm(n,"coord",Ve.gx),c=Zm(n,"angles",Ve.gx),u=Zm(n,"when",Ve.kml),f=Qm(n,"extrude",Ve.kml),d=dU(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=t7(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new gc;return A.addSamples(y,m),i.position=A,n7(e,i,r,nOe(o,s)),iOe(i,r),i.availability=new Ps,u.length>0&&i.availability.addInterval(new En({start:y[0],stop:y[y.length-1]})),d&&f&&Rre(t,i,r),!0}function YRe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new gc;d.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:dwt(d,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function _wt(e,t,n,i,r){let o=Qm(n,"interpolate",Ve.gx),s=Zm(n,"Track",Ve.gx),a,c,u,f=!1,d=new O_,p=new Ps,g=new mc,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=Zm(b,"when",Ve.kml),T=Zm(b,"coord",Ve.gx),E=Fn(b,"altitudeMode",Ve.kml),v=Fn(b,"altitudeMode",Ve.gx),S=dU(E,v),I=Qm(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=t7(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&YRe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),YRe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,n7(e,i,r),iOe(i,r),f&&(Rre(t,i,r),i.polyline.show=d),!0}var rOe={Point:mwt,LineString:qRe,LinearRing:qRe,Polygon:pwt,Track:gwt,MultiTrack:_wt,MultiGeometry:ywt,Model:Awt};function ywt(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=rOe[f.localName];if(l(d)){let p=ZRe(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 Awt(e,t,n,i,r){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function bwt(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=Zm(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 xwt(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=nwt.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&&(sd(jr,"a","href",i),sd(jr,"link","href",i),sd(jr,"area","href",i),sd(jr,"img","src",i),sd(jr,"iframe","src",i),sd(jr,"video","src",i),sd(jr,"audio","src",i),sd(jr,"source","src",i),sd(jr,"track","src",i),sd(jr,"input","src",i),sd(jr,"embed","src",i),sd(jr,"script","src",i),sd(jr,"video","poster",i)),ad(jr,"a","href",r),ad(jr,"link","href",r),ad(jr,"area","href",r),ad(jr,"img","src",r),ad(jr,"iframe","src",r),ad(jr,"video","src",r),ad(jr,"audio","src",r),ad(jr,"source","src",r),ad(jr,"track","src",r),ad(jr,"input","src",r),ad(jr,"embed","src",r),ad(jr,"script","src",r),ad(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 i7(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=ZRe(t,i,n.context),c=a.kml,u=uwt(e,t,n.styleCollection,o,s),f=Fn(t,"name",Ve.kml);a.name=f,a.parent=r;let d=cwt(t);l(d)||(d=awt(t)),a.availability=d,Mre(a);function p(T){return T?T.show&&p(T.parent):!0}let g=Qm(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),bwt(t,a),xwt(t,a,u,s,o);let x=e._ellipsoid;return aOe(t,a,x),sOe(t,a,x),l(ar(t,"Region",Ve.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function oOe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Twt(e,t,n,i){let r=i7(e,t,n),o=Je(n);o.parentEntity=r.entity,oOe(e,t,o,i)}function Ewt(e,t,n,i){let r=i7(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=rOe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),n7(e,o,s))}var Cwt={FlyTo:wwt,Wait:Swt,SoundCue:yre,AnimatedUpdate:yre,TourControl:yre};function vwt(e,t,n,i){let r=Fn(t,"name",Ve.kml),o=Da(t,"id"),s=new aU(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=Cwt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function yre(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function Swt(e,t){let n=Si(t,"duration",Ve.gx);e.addPlaylistEntry(new uU(n))}function wwt(e,t,n){let i=Si(t,"duration",Ve.gx),r=Fn(t,"flyToMode",Ve.gx),o={kml:{}};aOe(t,o,n),sOe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new lU(i,r,s);e.addPlaylistEntry(a)}function sOe(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 oU(f,d)}}function aOe(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 mh(a,c-D.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new sU(d,f)}}function Iwt(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=Dre(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=Ab(g,"x"),y=Ab(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=Ab(p,"x"),y=Ab(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=Ab(d,"x"),y=Ab(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 Pwt(e,t,n,i){let o=i7(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=Z9(ar(t,"LatLonQuad",Ve.gx),c),f=Si(t,"drawOrder",Ve.kml);if(l(u))s=Pre(),s.hierarchy=new Rc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new Qh,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=Dre(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=qE(t,"color",Ve.kml),s.material.transparent=!0}else s.material=qE(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 cOe(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 bb={INTERVAL:0,EXPIRE:1,STOP:2};function e7(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Dwt=new ie,nP=new he,Are=new U,Rwt=new h;function Ore(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=ix(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??Dwt,l(n)&&(Are.x=n.clientWidth*.5,Are.y=n.clientHeight*.5,u=t.pickEllipsoid(Are,o,Rwt)),l(u)?f=o.cartesianToCartographic(u,nP):(f=ie.center(r,nP),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,nP),c=c.replace("[cameraLon]",D.toDegrees(nP.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(nP.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(nP.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(Tf(c))}function Owt(e,t,n,i){let o=i7(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=Ire(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(Tf(e7(b))),l(x)&&u.setQueryParameters(Tf(e7(x)));let T=e._ellipsoid;Ore(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Ya,y=Cre(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,Mre(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:$n(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Tf(Fn(v,"cookie",Ve.kml)??""),O=Si(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=bb.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=bb.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=bb.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 Mwt(e,t,n,i){let r=wre[t.localName];return l(r)?r(e,t,n,i):cOe(e,t,n,i)}function Ere(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=w_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Z_._DeferredLoading(e),d=new Ya(e);return Promise.all(tOe(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(wre[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(),Mwt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function Nwt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");p3({workerURI:o,wasmURI:s});let a=new ME(new rf(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(_re(d,f)),d=g):u.push(_re(g,f)))}if(l(d)&&u.push(swt(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),Ere(e,t,f.kml,i,f,r)}function Cre(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?rwt(u).then(function(f){return f?Nwt(e,t,u,r,a):owt(u).then(function(d){d=$Re(d),d=JRe(d);let p,g;try{p=Sre.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 Ere(e,t,p,r,o,a,s)})}):Ere(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var Z_=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 Ya(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new K_,this._networkLinks=new kt,this._entityCluster=new Kf,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,Ds.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Cre(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,tt.MINIMUM_VALUE),f=K.equals(c,tt.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 Lm,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=Rs.LOOP_STOP,o.clockStep=Vr.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),Ds.setLoading(r,!1),r}).catch(function(o){return Ds.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;bre.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];bre.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 kt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!bre.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===bb.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===bb.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===bb.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 Ya,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;Ore(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Cre(r,m,y,{context:p.id}).then(Lwt(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 Mre(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 Lwt(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=Tf(Fn(a,"cookie",Ve.kml)??""),u=Si(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===bb.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===bb.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,Mre(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,tt.MINIMUM_VALUE),S=K.equals(E,tt.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 bre=new kt,vre=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}};Z_._DeferredLoading=xre;Z_._getTimestamp=xn;var YE=Z_;function hU(){pe.throwInstantiationError()}hU.prototype.update=pe.throwInstantiationError;hU.prototype.getBoundingSphere=pe.throwInstantiationError;hU.prototype.isDestroyed=pe.throwInstantiationError;hU.prototype.destroy=pe.throwInstantiationError;var Nre=hU;var XE=`in vec4 position; +in vec2 textureCoordinates; +out vec2 v_textureCoordinates; +void main() +{ +gl_Position = position; +v_textureCoordinates = textureCoordinates; +} +`;function r7(e){this._context=e}var mU,Fwt=new at({primitiveType:Oe.TRIANGLES}),Bwt=new ui({color:new z(0,0,0,0)});function kwt(e,t){return new ys({context:e,colorTextures:[t],destroyAttachments:!1})}function Uwt(e,t){return en.fromCache({context:e,vertexShaderSource:XE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function zwt(e,t){return(!l(mU)||mU.viewport.width!==e||mU.viewport.height!==t)&&(mU=Ge.fromCache({viewport:new et(0,0,e,t)})),mU}r7.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:Uwt(r,e.fragmentShaderSource),a=kwt(r,t),c=zwt(n,i),u=e.uniformMap,f=Bwt;f.framebuffer=a,f.renderState=c,f.execute(r);let d=Fwt;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)};r7.prototype.isDestroyed=function(){return!1};r7.prototype.destroy=function(){return le(this)};var pU=r7;function Vwt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Ac=Vwt;var Lre=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)}},gU=Lre;function ep(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(ep.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});ep.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function jwt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}ep.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)?jwt(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 en({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};ep.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){Fre(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};ep.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};ep.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 en({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 Fre(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];Fre(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}ep.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Fre(this,n),--this._numberOfShaders}this._shadersToRelease={}};ep.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};ep.prototype.isDestroyed=function(){return!1};ep.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var _U=ep;function KE(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(KE.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});KE.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};KE.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};KE.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={}};KE.prototype.isDestroyed=function(){return!1};KE.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var yU=KE;var Bre={};function Hwt(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var Gwt=32.184,Wwt=2451545;function wOe(e,t){t=K.addSeconds(e,Gwt,t);let n=K.totalDays(t)-Wwt;return t=K.addSeconds(t,Hwt(n),t),t}var o7=new K(2451545,0,si.TAI),qwt=1e3,bh=D.RADIANS_PER_DEGREE,cd=D.RADIANS_PER_ARCSECOND,zc=14959787e4,lOe=new $;function IOe(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=Xwt(o-i,t),d=Ywt(t,0);Qwt(c,n,u,lOe);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(lOe,s,s)}function Ywt(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function Xwt(e,t){let n=Jwt(e,t);return Zwt(n,t)}var Kwt=50,$wt=D.EPSILON8;function Jwt(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<Kwt&&Math.abs(r-i)>$wt;++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 Zwt(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 Qwt(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 eIt=1.0000010178*zc,tIt=100.46645683*bh,nIt=129597742283429e-5*cd,uOe=16002,fOe=21863,dOe=32004,hOe=10931,mOe=14529,pOe=16368,gOe=15318,_Oe=32794,iIt=64*1e-7*zc,rIt=-152*1e-7*zc,oIt=62*1e-7*zc,sIt=-8*1e-7*zc,aIt=32*1e-7*zc,cIt=-41*1e-7*zc,lIt=19*1e-7*zc,uIt=-11*1e-7*zc,fIt=-150*1e-7*zc,dIt=-46*1e-7*zc,hIt=68*1e-7*zc,mIt=54*1e-7*zc,pIt=14*1e-7*zc,gIt=24*1e-7*zc,_It=-28*1e-7*zc,yIt=22*1e-7*zc,yOe=10,AOe=16002,bOe=21863,xOe=10931,TOe=1473,EOe=32004,COe=4387,vOe=73,AIt=-325*1e-7,bIt=-322*1e-7,xIt=-79*1e-7,TIt=232*1e-7,EIt=-52*1e-7,CIt=97*1e-7,vIt=55*1e-7,SIt=-41*1e-7,wIt=-105*1e-7,IIt=-137*1e-7,PIt=258*1e-7,DIt=35*1e-7,RIt=-116*1e-7,OIt=-88*1e-7,MIt=-112*1e-7,NIt=-80*1e-7,iP=new K(0,0,si.TAI);function LIt(e,t){wOe(e,iP);let i=(iP.dayNumber-o7.dayNumber+(iP.secondsOfDay-o7.secondsOfDay)/kn.SECONDS_PER_DAY)/(kn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=eIt+iIt*Math.cos(uOe*r)+fIt*Math.sin(uOe*r)+rIt*Math.cos(fOe*r)+dIt*Math.sin(fOe*r)+oIt*Math.cos(dOe*r)+hIt*Math.sin(dOe*r)+sIt*Math.cos(hOe*r)+mIt*Math.sin(hOe*r)+aIt*Math.cos(mOe*r)+pIt*Math.sin(mOe*r)+cIt*Math.cos(pOe*r)+gIt*Math.sin(pOe*r)+lIt*Math.cos(gOe*r)+_It*Math.sin(gOe*r)+uIt*Math.cos(_Oe*r)+yIt*Math.sin(_Oe*r),s=tIt+nIt*i+AIt*Math.cos(yOe*r)+wIt*Math.sin(yOe*r)+bIt*Math.cos(AOe*r)+IIt*Math.sin(AOe*r)+xIt*Math.cos(bOe*r)+PIt*Math.sin(bOe*r)+TIt*Math.cos(xOe*r)+DIt*Math.sin(xOe*r)+EIt*Math.cos(TOe*r)+RIt*Math.sin(TOe*r)+CIt*Math.cos(EOe*r)+OIt*Math.sin(EOe*r)+vIt*Math.cos(COe*r)+MIt*Math.sin(COe*r)+SIt*Math.cos(vOe*r)+NIt*Math.sin(vOe*r),a=.0167086342-.0004203654*i,c=102.93734808*bh+11612.3529*cd*i,u=469.97289*cd*i,f=174.87317577*bh-8679.27034*cd*i;return IOe(o,a,u,c,f,s,t)}function POe(e,t){wOe(e,iP);let i=(iP.dayNumber-o7.dayNumber+(iP.secondsOfDay-o7.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*bh,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*bh,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*bh,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*bh,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*bh+cd*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*bh+cd*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*bh+cd*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*bh+cd*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*bh-cd*(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*=qwt;let F=u+f*cd,V=d+p*cd,B=y+A*cd,j=g+m*cd;return IOe(a,c,F,V,j,B,t)}var SOe=.012300034,FIt=SOe/(SOe+1)*-1;function BIt(e,t){return t=POe(e,t),h.multiplyByScalar(t,FIt,t)}var DOe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),AU=new h;Bre.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),AU=LIt(e,AU),t=h.negate(AU,t),BIt(e,AU),h.subtract(t,AU,t),$.multiplyByVector(DOe,t,t),t};Bre.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=POe(e,t),$.multiplyByVector(DOe,t,t),t};var xb=Bre;function kIt(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var Q_=kIt;function rP(){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(rP.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 MOe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return MOe(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 Ure(this),this._view3D}},viewRotation:{get:function(){return Ure(this),this._viewRotation}},viewRotation3D:{get:function(){return Ure(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return FOe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return FOe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return KIt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return $It(this),this._modelView}},modelView3D:{get:function(){return JIt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return iPt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return ZIt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return QIt(this),this._inverseModelView3D}},viewProjection:{get:function(){return ePt(this),this._viewProjection}},inverseViewProjection:{get:function(){return tPt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return nPt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return rPt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return oPt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return sPt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return aPt(this),this._normal}},normal3D:{get:function(){return cPt(this),this._normal3D}},inverseNormal:{get:function(){return lPt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return uPt(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 LOe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return LOe(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 UIt(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 zIt(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function VIt(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function jIt(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var ROe=new h,HIt=new N,OOe=new $;function GIt(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,ROe)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,ROe)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,HIt);e._enuToModel=N.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=N.inverseTransformation(e._enuToModel,e._modelToEnu);let s=N.getRotation(o,OOe),a=$.multiply(e._viewRotation,s,OOe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var kre=new $,WIt=new he;function qIt(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,kre);let n=xb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(kre,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=xb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(kre,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,WIt);i.project(o,e._sunPositionColumbusView)}rP.prototype.updateCamera=function(e){UIt(this,e.viewMatrix),zIt(this,e.inverseViewMatrix),GIt(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};rP.prototype.updateFrustum=function(e){VIt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&jIt(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};rP.prototype.updatePass=function(e){this._pass=e};var YIt=[],XIt=new Q_;rP.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),qIt(this,e);let n=e.light??XIt;n instanceof Q_?(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??YIt,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 MOe(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 KIt(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 $It(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function JIt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function ZIt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function QIt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function ePt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function tPt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function nPt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function iPt(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 rPt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function oPt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function sPt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function aPt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function cPt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function lPt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;N.getMatrix3(e.modelView,t),$.transpose(t,t)}}function uPt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;N.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var NOe=new h;function LOe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,NOe),Sn.fromCartesian(NOe,e._encodedCameraPositionMC))}var fPt=new h,dPt=new h,hPt=new h,mPt=new h,pPt=new he,gPt=new h,_Pt=new N;function yPt(e,t,n,i,r,o,s,a){let c=fPt;c.x=e.y,c.y=e.z,c.z=e.x;let u=dPt;u.x=n.y,u.y=n.z,u.z=n.x;let f=hPt;f.x=i.y,f.y=i.z,f.z=i.x;let d=mPt;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,pPt);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,gPt),y=At.eastNorthUpToFixedFrame(m,g,_Pt);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 Ure(e){e._view3DDirty&&(e._mode===re.SCENE3D?N.clone(e._view,e._view3D):yPt(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 FOe(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var bU=rP;function lf(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):APt(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=$n(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new _U(this),this._textureCache=new yU,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=!!us(f,["OES_standard_derivatives"]),this._blendMinmax=!!us(f,["EXT_blend_minmax"]),this._elementIndexUint=!!us(f,["OES_element_index_uint"]),this._depthTexture=!!us(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!us(f,["EXT_frag_depth"]),this._debugShaders=us(f,["WEBGL_debug_shaders"]),this._textureFloat=!!us(f,["OES_texture_float"]),this._textureHalfFloat=!!us(f,["OES_texture_half_float"]),this._textureFloatLinear=!!us(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!us(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!us(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!us(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!us(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!us(f,["EXT_color_buffer_half_float"]),this._s3tc=!!us(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!us(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!us(f,["WEBGL_compressed_texture_astc"]),this._etc=!!us(f,["WEBG_compressed_texture_etc"]),this._etc1=!!us(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!us(f,["EXT_texture_compression_bptc"]),Ou.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?us(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 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=us(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=us(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=us(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,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 bU,C=new Ac(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<Ut._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 APt(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 bPt(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 xPt(e,t,n,i){let r=`${bPt(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function TPt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(xPt(e,t,n,i))}function EPt(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 CPt(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,EPt(e,r,t))}return i}function us(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var vPt={};Object.defineProperties(lf.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=CPt(this._originalGLContext,e?TPt: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 ts({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 vPt}}});function BOe(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 zre;typeof WebGLRenderingContext<"u"&&(zre=[te.BACK]);function s7(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=zre;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var SPt=new ui;lf.prototype.clear=function(e,t){e=e??SPt,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;BOe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;s7(this,c),n.clear(i)};function wPt(e,t,n,i,r){s7(e,t),BOe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function IPt(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()}lf.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,wPt(this,r,t,n,o),IPt(this,e,n,i)};lf.prototype.beginFrame=function(){};lf.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=zre;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)};lf.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=nt.createPixelBuffer({context:this,sizeInBytes:Ke.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return s7(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};lf.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 s7(this,s),t.readPixels(n,i,r,o,Ke.RGBA,ze.toWebGLConstant(a,this),u),u};var kOe={position:0,textureCoordinates:1};lf.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:kOe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};lf.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:en.fromCache({context:this,vertexShaderSource:XE,fragmentShaderSource:e,attributeLocations:kOe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};lf.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};lf.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 gU(this._pickObjects,t,z.fromRgba(t))};lf.prototype.isDestroyed=function(){return!1};lf.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(),le(this)};var $E=lf;function PPt(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 ts({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var xU=PPt;function a7(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new $E(this._canvas,Je(e?.contextOptions)),this._canvases=[]}a7.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)}}})};a7.prototype.destroy=function(){this._context.destroy(),le(this)};a7.prototype.isDestroyed=function(){return!1};var TU=a7;function JE(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}JE.create=function(e){return new JE(e)};JE.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};JE.prototype.isDestroyed=function(){return!1};JE.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};JE.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 EU=JE;function Tb(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 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===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??$n(),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,VOe(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");UOe(this,n),this._initialized=!0}else zOe(this);m.bindTexture(this._textureTarget,null)}function UOe(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=Vre(y),A=Vre(A),b=Vre(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}Tb.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?(UOe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),zOe(this)),this._initialized=!0),d||DPt(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function DPt(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 Vre(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function zOe(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)}Tb.create=function(e){return new Tb(e)};Object.defineProperties(Tb.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){VOe(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 VOe(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=Zn.NEAREST),Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Zn.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)}Tb.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)};Tb.prototype.isDestroyed=function(){return!1};Tb.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var CU=Tb;var jOe={NONE:0,LERC:1};Object.freeze(jOe);var xh=jOe;var HOe={NONE:0,BITS12:1};Object.freeze(HOe);var $a=HOe;var vU=new h,RPt=new h,Th=new U,OPt=new N,MPt=new N,NPt=Math.pow(2,12);function Vc(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,RPt),A=i-n;Math.max(h.maximumComponent(y),A)<NPt-1?f=$a.BITS12:f=$a.NONE;let x=N.fromScale(y,OPt);x=N.setTranslation(x,g,x);let T=N.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,vU),MPt);T=N.multiplyByTranslation(T,h.negate(g,vU),T),p=N.clone(r,new N);let E=N.getTranslation(r,vU);E=h.subtract(E,e,vU),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()}Vc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===$a.BITS12){n=N.multiplyByPoint(this.toScaledENU,n,vU),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,Th);let p=cn.compressTextureCoordinates(Th);U.fromElements(n.z,d,Th);let g=cn.compressTextureCoordinates(Th);U.fromElements(c,u,Th);let m=cn.compressTextureCoordinates(Th);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Th);let y=cn.compressTextureCoordinates(Th);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 LPt=new h,GOe=new h;Vc.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,LPt),c=n.geodeticSurfaceNormal(a,GOe),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Vc.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]}};Vc.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],Th);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Th);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)};Vc.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,GOe),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};Vc.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)};Vc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+1],Th).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Vc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+3],Th).x:e[t+6]};Vc.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)};Vc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};Vc.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};Vc.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 c7={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},l7={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Vc.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(c7.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(c7.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(c7.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(l7.compressed0,a?4:3),c&&s(l7.compressed1,1),this.hasGeodeticSurfaceNormals&&s(l7.geodeticSurfaceNormal,3)}return o};Vc.prototype.getAttributeLocations=function(){return this.quantization===$a.NONE?c7:l7};Vc.clone=function(e,t){if(l(e))return l(t)||(t=new Vc),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 Co=Vc;var R0={};R0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var jre=new h,FPt=new N,BPt=new h,kPt=new h;R0.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??R0.DEFAULT_STRUCTURE,P=w.heightScale??R0.DEFAULT_STRUCTURE.heightScale,M=w.heightOffset??R0.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??R0.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??R0.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??R0.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??R0.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,FPt),we,Se;R&&(we=yi.geodeticLatitudeToMercatorAngle(T),Se=1/(yi.geodeticLatitudeToMercatorAngle(v)-we));let Re=BPt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=kPt;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,gi;R&&(gi=(yi.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),bd=Bs*n(qi),xp=J*Wc,Nh=Z*bd,Tp=1/i(xp*Wc+Nh*bd+no*Ks),ks=xp*Tp,tc=Nh*Tp,Kb=no*Tp,ri=new h;ri.x=ks+Wc*Bn,ri.y=tc+bd*Bn,ri.z=Kb+Ks*Bn,N.multiplyByPoint(ge,ri,jre),h.minimumByComponent(jre,Re,Re),h.maximumByComponent(jre,Qe,Qe),He=Math.min(He,Bn),qe[Nr]=ri,vt[Nr]=new U(ki,Zi),st[Nr]=Bn,R&&(Gt[Nr]=gi),C&&(lt[Nr]=m.geodeticSurfaceNormal(ri))}}let Bi=ue.fromPoints(qe),Xn;l(b)&&(Xn=Qt.fromRectangle(b,Ae,fe,m));let bi;I&&(bi=new Om(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let Wi=new vf(Re,Qe,S),wi=new Co(S,Wi,He,fe,xe,!1,R,C,O,L),hi=new Float32Array(Pe*wi.stride),xi=0;for(let jn=0;jn<Pe;++jn)xi=wi.encode(hi,xi,qe[jn],vt[jn],st[jn],void 0,Gt[jn],lt[jn]);return{vertices:hi,maximumHeight:fe,minimumHeight:Ae,encoding:wi,boundingSphere3D:Bi,orientedBoundingBox:Xn,occludeePointInScaledSpace:bi}};var oP=R0;function Eb(){pe.throwInstantiationError()}Object.defineProperties(Eb.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});Eb.prototype.interpolateHeight=pe.throwInstantiationError;Eb.prototype.isChildAvailable=pe.throwInstantiationError;Eb.prototype.createMesh=pe.throwInstantiationError;Eb.prototype.upsample=pe.throwInstantiationError;Eb.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;Eb.maximumAsynchronousTasks=5;var uf=Eb;var UPt=3,Gre=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new N,this._needsRebuild=!0,this._rootNode=new Wre}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&jPt(this,n);let s=this._inverseTransform,a=VPt;a.origin=N.multiplyByPoint(s,t.origin,a.origin),a.direction=N.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return qOe(this._rootNode,a,c),YPt(this,c,t,i,r,o)}},zPt=new Jn("incrementallyBuildTerrainPicker"),Wre=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=WOe(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=WOe(n.x,n.y,n.level),this.children[t]=n}},VPt=new pn,u7=[new h,new h,new h];function jPt(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 HPt=new h,GPt=new h;function WOe(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,HPt),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,GPt);return vf.fromCorners(r,o)}function WPt(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 qPt=new Us;function qOe(e,t,n){let i=_i.rayAxisAlignedBoundingBox(t,e.aabb,qPt);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++)qOe(e.children[o],t,n)}function YPt(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=XPt(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 XPt(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>=UPt)&&!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=Hre(a,r,o,t,u,c[3*A],u7[0]),x=Hre(a,r,o,t,u,c[3*A+1],u7[1]),T=Hre(a,r,o,t,u,c[3*A+2],u7[2]),E=_i.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&WPt(g,m,u7,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);$Pt(e._inverseTransform,n,m,g)}return s}var KPt=new he;function Hre(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,KPt);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 $Pt(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=zPt.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 SU=Gre;function wU(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 SU(t,n,p)}wU.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?JPt(this,this._transform):rDt(this,t,this._transform))};function JPt(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=Qt.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return Qt.computeTransformation(s,t),N.getScale(t,qre).z<=D.EPSILON16&&(qre.z=1,N.setScale(t,qre,t)),t}var ZPt=new h,QPt=new h,eDt=new he,tDt=new he,nDt=new h,iDt=new h,qre=new h;function rDt(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,eDt),ZPt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,tDt),QPt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,nDt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,iDt);return N.fromTranslation(d,n),N.setScale(n,f,n),N.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}wU.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};wU.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};wU.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var bc=wU;function ey(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??xh.NONE;let t=oP.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===xh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(ey.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var YOe="createVerticesFromHeightmap",oDt=new Jn(YOe),sDt=new Jn(YOe,uf.maximumAsynchronousTasks);ey.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?sDt:oDt).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=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new bc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Qt.clone(x.orientedBoundingBox),Co.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};ey.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=oP.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=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new bc(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};ey.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===xh.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=XOe(A,b,f,d,e,i,r,t,n)}else y=aDt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};ey.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)),_=XOe(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,cDt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new ey({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};ey.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};ey.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function aDt(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=f7(e,t,n,i,r,m*s+p),T=f7(e,t,n,i,r,m*s+g),E=f7(e,t,n,i,r,y*s+p),v=f7(e,t,n,i,r,y*s+g);return KOe(A,b,x,T,E,v)}function XOe(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 KOe(y,A,b,x,T,E)}function KOe(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function f7(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 cDt(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=ey;function cP(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var ZE=new ie;function lDt(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}cP.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)lDt(e,g,p,s)||s.push(new sP(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,ZE);let a=ZE.west,c=ZE.north;o.tileXYToRectangle(i,r,e,ZE);let u=ZE.east,f=ZE.south,d=new mDt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];Yre(g.extent,d)&&pDt(this._maximumLevel,g,d)}};cP.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(aP(i.extent,e)){t=i;break}}return l(t)?IU(void 0,t,e):-1};var uDt=[],fDt=[],dDt=new ie,hDt=new ie;cP.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=uDt;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,dDt)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,hDt))):t.push(e);let n=fDt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)PU(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 $Oe=new he;cP.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,ZE);return ie.center(i,$Oe),this.computeMaximumLevelAtPosition($Oe)>=e};cP.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 sP(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(sP.prototype,{nw:{get:function(){return this._nw||(this._nw=new sP(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new sP(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new sP(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new sP(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function mDt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function Yre(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 pDt(e,t,n){for(;t.level<e;)if(d7(t.nw.extent,n))t=t.nw;else if(d7(t.ne.extent,n))t=t.ne;else if(d7(t.sw.extent,n))t=t.sw;else if(d7(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,gDt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function gDt(e,t){return e.level-t}function d7(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function aP(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function IU(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&aP(t._nw.extent,n),s=t._ne&&aP(t._ne.extent,n),a=t._sw&&aP(t._sw.extent,n),c=t._se&&aP(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,IU(t,t._nw,n))),s&&(i=Math.max(i,IU(t,t._ne,n))),a&&(i=Math.max(i,IU(t,t._sw,n))),c&&(i=Math.max(i,IU(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];aP(a,n)&&(i=a.level)}t=t.parent}return i}function PU(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||Yre(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]=_Dt(e[s.level],s)}PU(e,t._nw,n),PU(e,t._ne,n),PU(e,t._sw,n),PU(e,t._se,n)}function _Dt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];Yre(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 tp=cP;var yDt=15;function JOe(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}JOe.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 ADt(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 er(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 Lo(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"?xh.LERC:xh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new tp(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new tp(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.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 bDt(e,t,n){try{let i=await t.fetchJson();ADt(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 Cb(){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(Cb.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}}});Cb.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 JOe(t);await bDt(r,i);let o=new Cb(t);return r.build(o),o._resource=n,o};Cb.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(Xre(this,n+1,e*2,t*2))){let d=ZOe(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):yDt,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 Xre(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}Cb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Cb.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Xre(this,n,e,t);if(l(i))return i;ZOe(this,n,e,t)};Cb.prototype.loadTileDataAvailability=function(e,t,n){};function xDt(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 TDt(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=xDt(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 ZOe(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=TDt(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 Xre(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 Kre=Cb;var QOe="https://dev.virtualearth.net/REST/v1/Locations";function $re(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:QOe,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties($re.prototype,{url:{get:function(){return QOe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});$re.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 Jre=$re;function Zre(){}Object.defineProperties(Zre.prototype,{credit:{get:function(){}}});Zre.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 Qre=Zre;var EDt=new se,eMe=new h,lP=new h;function CDt(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=EDt;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,eMe),h.multiplyByScalar(d,.5,d),p=N.multiplyByVector(yA.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],eMe),h.multiplyByScalar(f,.5,f),p=N.multiplyByVector(yA.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(vb.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,lP),h.add(r,lP,r),h.multiplyByScalar(f,p.z,lP),h.add(r,lP,r),h.multiplyByScalar(d,p.w,lP),h.add(r,lP,r)}}var vDt=new h,SDt=new h;function vb(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=vDt,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=SDt,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=CDt(this),this._lastTimeIndex=0}Object.defineProperties(vb.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}}});vb.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);vb.prototype.findTimeInterval=Dr.prototype.findTimeInterval;vb.prototype.wrapTime=Dr.prototype.wrapTime;vb.prototype.clampTime=Dr.prototype.clampTime;vb.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var eoe=vb;var toe={},wDt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},IDt=new he,PDt=new h,DDt=new N,RDt=new N,ODt=new N,MDt=new h,NDt=new h,LDt=new h,FDt=new h,BDt=new he,kDt=new U,DU=new h,UDt=new U,zDt=new h,VDt=new h,h7=function(e,t){return e-t};toe.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=ue.clone(e.boundingSphere,new ue),p=Qt.clone(e.orientedBoundingBox,new Qt),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?nA.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,IDt);I.height=.5*(s+a);let R=he.toCartesian(I,m,PDt),O=At.eastNorthUpToFixedFrame(R,m,DDt),L=N.inverseTransformation(O,RDt),_=N.unpack(o.nodes[0].matrix,0,ODt);_=N.multiply(Hi.Y_UP_TO_Z_UP,_,_);let C=b1t(o,i,wDt),w=Xr.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=Xr.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=yi.geodeticLatitudeToMercatorAngle(T),Se=1/(yi.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,MDt),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,NDt),He=new Co(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,LDt),Gt=N.multiplyByPoint(_,vt,FDt),lt=he.fromCartesian(Gt,m,BDt),{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,h7)>=0?rt=0:vr(fe,st,h7)>=0&&(rt=1),vr(Ae,st,h7)>=0?ht=0:vr(xe,st,h7)>=0&&(ht=1);let Bi=U.fromElements(rt,ht,kDt),Xn;if(i){let hi=h.unpack(M,st*3,DU);hi=N.multiplyByPointAsVector(_,hi,DU),hi=h.normalize(hi,DU),Xn=cn.octEncode(hi,UDt)}let bi;r&&(bi=(yi.geodeticLatitudeToMercatorAngle(ft)-ge)*Se);let Wi;f&&(Wi=m.geodeticSurfaceNormal(Gt,zDt)),Pe=He.encode($e,Pe,Gt,Bi,Xt,Xn,bi,Wi);let wi=N.multiplyByPoint(L,Gt,VDt);Re=h.minimumByComponent(wi,Re,Re),Qe=h.maximumByComponent(wi,Qe,Qe)}let qe=new bc(h.clone(He.center,new h),$e,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Xe,Qt.clone(p,new Qt),He,Q,W,J,Z);return aMe(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var jDt=new U,HDt=new U,GDt=new Array(6),WDt=new U,qDt=new U,YDt=new U,XDt=new h,KDt=new h,$Dt=new h,JDt=new he,ZDt=new h,QDt=new he,e1t=new he,tMe=new h,t1t=new h,n1t=new h,i1t=new h,r1t=new h,o1t=new h,s1t=new h,a1t=new h,c1t=new N,l1t=new N,nMe=new U,u1t=new U,f1t=new h,d1t=new ue,h1t=new Qt,m1t=new vf,iMe=new h,rMe=new U,p1t=new U,oMe=new h,g1t=new h;function _1t(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);nA.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 y1t(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);nA.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=DU;y.x=p,y.y=g,y.z=m,y=h.normalize(y,DU),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function A1t(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 nA.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function m7(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 nA.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function b1t(e,t,n){return n.positions=_1t(e),n.normals=t?y1t(e):void 0,n.indices=A1t(e),n.edgeIndicesWest=m7(e,"left"),n.edgeIndicesSouth=m7(e,"bottom"),n.edgeIndicesEast=m7(e,"right"),n.edgeIndicesNorth=m7(e,"top"),n}toe.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=Co.clone(e.parentEncoding,new Co),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=[];M1t(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,JDt);_.height=.5*(i+r);let C=he.toCartesian(_,x,ZDt),w=T.length,P=new Co(C,void 0,void 0,void 0,void 0,d,p,A,g,m),M=P.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.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,c1t),xe=N.inverseTransformation(fe,l1t),ge=b.west,we=b.east,Se=b.south,Re=b.north,Qe=yi.geodeticLatitudeToMercatorAngle(Se),Xe=1/(yi.geodeticLatitudeToMercatorAngle(Re)-Qe),$e=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,s1t),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,a1t);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],bi=u1t;bi.x=E[Xt*2+0],bi.y=E[Xt*2+1];let Wi=bi.x,wi=bi.y,hi=v[Xt*2+0],xi=v[Xt*2+1],jn=1-hi-xi,nn=f.decodeHeight(u,ht),Wn=f.decodeHeight(u,Bi),Zi=f.decodeHeight(u,Xn),Mr=nn*hi+Wn*xi+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,e1t),no=he.toCartesian(Ks,x,t1t),gi=N.multiplyByPoint(xe,no,i1t);qe=h.minimumByComponent(gi,qe,qe),st=h.maximumByComponent(gi,st,st);let ho;if(d){let Bn=f.decodeNormal(u,ht,XDt),qi=f.decodeNormal(u,Bi,KDt),ki=f.decodeNormal(u,Xn,$Dt),Nr=h.fromElements(Bn.x*hi+qi.x*xi+ki.x*jn,Bn.y*hi+qi.y*xi+ki.y*jn,Bn.z*hi+qi.z*xi+ki.z*jn,iMe);Nr=h.normalize(Nr,iMe),ho=cn.octEncode(Nr,p1t)}let ur;p&&(ur=(yi.geodeticLatitudeToMercatorAngle(Bs)-Qe)*Xe);let Zo;A&&(Zo=x.geodeticSurfaceNormal(no,g1t)),Ae=P.encode(ae,Ae,no,bi,Mr,ho,ur,Zo)}let vt=Qt.fromRectangle(b,$e,Pe,x,h1t),Gt=ue.fromVertices(ae,P.center,M,d1t),mt=new Om(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(P.center,ae,M,P.center,$e,f1t),ft=new bc(h.clone(P.center,new h),ae,q,B,w,$e,Pe,b,ue.clone(Gt),h.clone(mt),M,Qt.clone(vt),P,Q,W,J,Z);return aMe(ft,b,x,qe,st,fe,xe,o),ft};function aMe(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;Xr.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,r1t),k=h.clone(r,o1t),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,nMe),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,QDt),Xe=he.toCartesian(He,n,tMe),$e;d&&($e=c.getOctEncodedNormal(f,ae,rMe));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Xe,oMe)),x=c.encode(f,x,Xe,Ae,Qe,$e,Pe,qe);let st=N.multiplyByPoint(s,Xe,n1t);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=vf.fromCorners(j,k,m1t),W=new Co(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,tMe),c.decodeTextureCoordinates(f,fe,nMe),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,rMe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,oMe):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var noe=0,x1t=1,ioe=2,roe=3,T1t=4,E1t=new h,C1t=[new h,new h,new h,new h,new h,new h],v1t=[new U,new U,new U,new U,new U,new U],S1t=[new h,new h,new h,new h,new h,new h],w1t=[new U,new U,new U,new U,new U,new U];function sMe(e,t,n,i){switch(n){case noe:return D.sign(i.x-e.x);case ioe:return D.sign(t.x-i.x);case roe:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function I1t(e,t,n,i,r,o){let s,a,c;switch(n){case noe:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case ioe:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case roe: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 P1t={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 D1t(e,t,n,i,r,o,s,a){let c,u=v1t,f=C1t,d=3,p=w1t;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=S1t;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)%T1t,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=sMe(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=sMe(n,i,y,I);if(v*O===-1){let L=I1t(n,i,y,T,I,E1t),{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 R1t(e,t,n,i,r,o,s,a){return D1t(e?t?roe:noe:t?ioe:x1t,2,n,i,r,o,s,a)}var O1t=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function M1t(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=jDt;E.x=A,E.y=x;let v=HDt;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,WDt),C=s.decodeTextureCoordinates(o,O,qDt),w=s.decodeTextureCoordinates(o,L,YDt),P=R1t(e,t,E,v,_,C,w,P1t),M=P.length;if(M<3)continue;let F=GDt;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=O1t[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 uP=toe;var p7={};p7.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};p7.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)};p7.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=p7;function ny(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=Qt.clone(e.orientedBoundingBox,new Qt),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(ny.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});ny.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:lMe(i,e,t,n)};ny.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 cMe="createVerticesFromCesium3DTilesTerrain",N1t=new Jn(cMe),L1t=new Jn(cMe,uf.maximumAsynchronousTasks);ny.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?L1t:N1t,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=Co.clone(g.encoding,new Co),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=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),P=Qt.clone(d._orientedBoundingBox,new Qt),M=new bc(_,y,T,R,b,O,L,c,C,w,m.stride,P,m,E,S,v,I);return d._mesh=M,Promise.resolve(M)})};ny.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=uP.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)})};ny.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:g7(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};ny.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:g7(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};ny.prototype.wasCreatedByUpsampling=function(){return!1};function ty(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}ty.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};ty.prototype.upsample=function(e,t,n,i,r,o,s){return g7(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};ty.prototype._upsampleSync=function(e,t,n,i,r,o,s){return g7(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};ty.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return lMe(i,e,t,n)};ty.prototype.wasCreatedByUpsampling=function(){return!0};ty.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(ty.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var F1t=new Jn("upsampleVerticesFromCesium3DTilesTerrain",uf.maximumAsynchronousTasks);function g7(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=uP.upsampleMesh(b),E=new ty({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=F1t.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Co.clone(T.encoding,new Co),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=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=Qt.clone(T.orientedBoundingBox,new Qt),q=new bc(B,S,L,M,R,F,V,y,j,k,v,G,E,_,w,C,P),Q=new ty({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var B1t=new U,k1t=new U,U1t=new U,z1t=new h;function lMe(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,B1t),m=a.decodeTextureCoordinates(s,d,k1t),y=a.decodeTextureCoordinates(s,p,U1t),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,z1t);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 RU=ny;function ip(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(ip.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}}});ip.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new ip({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};ip.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};ip.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)uMe(this,t)};ip.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++,uMe(this,i),t};ip.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],fMe(this,0)),this._array[e-1]=void 0,t};ip.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=ooe(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&fMe(this,n)}return this._array[e-1]=void 0,t};ip.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};ip.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[ooe(this,1,2)?1:2]};function _7(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function OU(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function ooe(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function uMe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=OU(e,t,i);for(r!==n&&(_7(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(OU(e,t,o)!==r)break;_7(e,t,o),t=o}}function fMe(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){OU(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;OU(e,f,o)===i&&(o=f)}}if(OU(e,o,t)===i&&(_7(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);ooe(e,o,a)===i&&_7(e,o,a)}t=o}}var iy=ip;function O0(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 er({ellipsoid:this._ellipsoid}),this._subtreeCache=new QE({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}O0.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 O0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=$l.fromJson(c);return r._tileset0=new r0(n,s,u),r._tileset1=new r0(n,a,u),r};O0.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return O0.fromUrl(n,t)};var V1t=new Array(3);O0.prototype.requestTileGeometry=async function(e,t,n,i){let r=hMe(n,e),o=r===0?this._tileset0:this._tileset1,s=mMe(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 Lg.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=>iT(new Uint8Array(x))),b=V1t;b[0]=p,b[1]=A,b[2]=f?A.then(x=>j1t(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(Ud.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(Ud.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(Ud.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(Ud.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),P=d._ellipsoid,M=Qt.fromRectangle(w,I,R,P,new Qt),F=d.getLevelMaximumGeometricError(n)*5,V=y7(o,T,s,0,0),B=y7(o,T,s,1,0),j=y7(o,T,s,0,1),k=y7(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new RU({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}};O0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=hMe(n,e),o=r===0?this._tileset0:this._tileset1,s=mMe(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 hMe(e,t){let n=1<<e;return t/n|0}function mMe(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new o0({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function j1t(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new aA({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 Mg({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function y7(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=soe(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function soe(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new o0({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}O0.prototype.loadTileDataAvailability=function(e,t,n){};O0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(O0.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 H1t(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function QE(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new iy({comparator:QE.comparator}),this._provider=e.provider}QE.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};QE.prototype.addSubtree=function(e,t){let n=new H1t(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()};QE.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}};QE.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=soe(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=dMe(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=dMe(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function dMe(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=soe(e,r,s,a);return t.getDescendantCoordinates(c)}QE.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var aoe=O0;function Sb(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=b7(e.westIndices,r,t),this._southIndices=b7(e.southIndices,o,t),this._eastIndices=b7(e.eastIndices,r,t),this._northIndices=b7(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(Sb.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 A7=[];function b7(e,t,n){A7.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)A7[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(A7.sort(t),je.createTypedArray(n,A7)):e}var pMe="createVerticesFromQuantizedTerrainMesh",G1t=new Jn(pMe),W1t=new Jn(pMe,uf.maximumAsynchronousTasks);Sb.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?W1t:G1t).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=Co.clone(g.encoding);return p._mesh=new bc(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 q1t=new Jn("upsampleQuantizedTerrainMesh",uf.maximumAsynchronousTasks);Sb.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=q1t.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 Sb({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.clone(T.boundingSphere),orientedBoundingBox:Qt.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 coe=32767,gMe=new h;Sb.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=coe;let r=D.clamp((n-e.south)/e.height,0,1);return r*=coe,l(this._mesh)?$1t(this,i,r):J1t(this,i,r)};function _Me(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 Y1t=new U,X1t=new U,K1t=new U;function $1t(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,Y1t),g=o.decodeTextureCoordinates(r,f,X1t),m=o.decodeTextureCoordinates(r,d,K1t);if(_Me(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,gMe);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 J1t(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(_Me(t,n,p,y,g,A,m,b)){let x=np.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,gMe);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/coe)}}}}Sb.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};Sb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var eC=Sb;function Z1t(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 AMe(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=[]}AMe.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 bMe(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 er({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Lo({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=Xr.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 tp(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 tp(e.tilingScheme,u),g=new tp(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 Z1t({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 foe(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Q1t(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 foe(e,n);throw new oe(i)}async function eRt(e,t,n){await bMe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new tp(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 foe(e,t){try{let n=await e.layerJsonResource.fetchJson();return eRt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await bMe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Q1t(e,n,t)}}function rp(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 loe={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function yMe(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 tRt(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 nRt(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 ue(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===loe.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===loe.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===loe.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=Qt.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new eC({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})}rp.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=doe(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)})):xMe(this,e,t,n,o,i)};function xMe(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=yMe(void 0)):u=yMe(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)?tRt(e,m,i,t,n):nRt(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(rp.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}}});rp.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};rp.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return rp.fromUrl(n,t)};rp.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 AMe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await foe(i);let r=new rp(t);return i.build(r),r};rp.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(doe(this,e,t,n,i[o],o===0).result)return;return!1};rp.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=doe(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function uoe(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 doe(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=uoe(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=xMe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=uoe(r,f.x,f.y,f.level)}return{result:!1}}rp._getAvailabilityTile=uoe;var tC=rp;function ry(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 mu(n),this._workerName="createCircleGeometry"}ry.packedLength=mu.packedLength;ry.pack=function(e,t,n){return mu.pack(e._ellipseGeometry,t,n)};var TMe=new mu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Hc={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};ry.unpack=function(e,t,n){let i=mu.unpack(e,t,TMe);return Hc.center=h.clone(i._center,Hc.center),Hc.ellipsoid=ee.clone(i._ellipsoid,Hc.ellipsoid),Hc.ellipsoid=ee.clone(i._ellipsoid,TMe._ellipsoid),Hc.height=i._height,Hc.extrudedHeight=i._extrudedHeight,Hc.granularity=i._granularity,Hc.vertexFormat=Be.clone(i._vertexFormat,Hc.vertexFormat),Hc.stRotation=i._stRotation,Hc.shadowVolume=i._shadowVolume,l(n)?(Hc.semiMajorAxis=i._semiMajorAxis,Hc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new mu(Hc),n):(Hc.radius=i._semiMajorAxis,new ry(Hc))};ry.createGeometry=function(e){return mu.createGeometry(e._ellipseGeometry)};ry.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new ry({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(ry.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var hoe=ry;function fP(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 Qf(n),this._workerName="createCircleOutlineGeometry"}fP.packedLength=Qf.packedLength;fP.pack=function(e,t,n){return Qf.pack(e._ellipseGeometry,t,n)};var iRt=new Qf({center:new h,semiMajorAxis:1,semiMinorAxis:1}),ld={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};fP.unpack=function(e,t,n){let i=Qf.unpack(e,t,iRt);return ld.center=h.clone(i._center,ld.center),ld.ellipsoid=ee.clone(i._ellipsoid,ld.ellipsoid),ld.height=i._height,ld.extrudedHeight=i._extrudedHeight,ld.granularity=i._granularity,ld.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(ld.semiMajorAxis=i._semiMajorAxis,ld.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Qf(ld),n):(ld.radius=i._semiMajorAxis,new fP(ld))};fP.createGeometry=function(e){return Qf.createGeometry(e._ellipseGeometry)};var moe=fP;function rRt(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 MU=rRt;function oRt(e){return e=e??H.EMPTY_OBJECT,tC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var NU=oRt;function sRt(e){return e=e??H.EMPTY_OBJECT,tC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var nC=sRt;function dP(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new er({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xr.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(dP.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}}});dP.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})})};dP.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};dP.prototype.getTileDataAvailable=function(e,t,n){};dP.prototype.loadTileDataAvailability=function(e,t,n){};var poe=dP;var aRt=1953029805,cRt=2917034100;function goe(e,t){if(goe.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===aRt||r===cRt)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++}goe.passThroughDataForTesting=!1;var LU=goe;function EMe(e){this.proxy=e}EMe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var _oe=EMe;function hP(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new er({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(hP.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(){}}});hP.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new jc({buffer:new Uint8Array(256),width:16,height:16}))};hP.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};hP.prototype.getTileDataAvailable=function(e,t,n){};hP.prototype.loadTileDataAvailability=function(e,t,n){};var M0=hP;function N0(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 yoe(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(N0.prototype,{projectionMatrix:{get:function(){return yoe(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return yoe(this),this._infinitePerspective}}});var lRt=new h,uRt=new h,fRt=new h,dRt=new h;N0.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,lRt),d=uRt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=fRt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=dRt;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};N0.prototype.getPixelDimensions=function(e,t,n,i,r){yoe(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};N0.prototype.clone=function(e){return l(e)||(e=new N0),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};N0.prototype.equals=function(e){return l(e)&&e instanceof N0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};N0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof N0&&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 yu=N0;function ff(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new yu,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}ff.packedLength=6;ff.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};ff.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ff),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 op(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(ff.prototype,{projectionMatrix:{get:function(){return op(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return op(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return op(this),this._fovy}},sseDenominator:{get:function(){return op(this),this._sseDenominator}},offCenterFrustum:{get:function(){return op(this),this._offCenterFrustum}}});ff.prototype.computeCullingVolume=function(e,t,n){return op(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ff.prototype.getPixelDimensions=function(e,t,n,i,r){return op(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};ff.prototype.clone=function(e){return l(e)||(e=new ff),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};ff.prototype.equals=function(e){return!l(e)||!(e instanceof ff)?!1:(op(this),op(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ff.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ff)?!1:(op(this),op(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 Ji=ff;var x7=0,hRt=1;function iC(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof Ji?(s=x7,a=Ji.packedLength):t instanceof gn&&(s=hRt,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}iC.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===x7?(Ji.pack(r,t,n),n+=Ji.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 mRt=new Ji,pRt=new gn,gRt=new Le,_Rt=new h,yRt=new Be;iC.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===x7?(r=Ji.unpack(e,t,mRt),t+=Ji.packedLength):(r=gn.unpack(e,t,pRt),t+=gn.packedLength);let o=h.unpack(e,t,_Rt);t+=h.packedLength;let s=Le.unpack(e,t,gRt);t+=Le.packedLength;let a=Be.unpack(e,t,yRt);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new iC({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 mP(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 ARt=new $,bRt=new N,Aoe=new N,CMe=new h,vMe=new h,SMe=new h,xRt=new h,TRt=new h,ERt=new h,wb=new Array(3),FU=new Array(4);FU[0]=new se(-1,-1,1,1);FU[1]=new se(1,-1,1,1);FU[2]=new se(1,1,1,1);FU[3]=new se(-1,1,1,1);var wMe=new Array(4);for(let e=0;e<4;++e)wMe[e]=new se;iC._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,ARt),u=o??CMe,f=s??vMe,d=a??SMe;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,bRt),g,m,y=i.projectionMatrix;if(n===x7){let A=N.multiply(y,p,Aoe);m=N.inverse(A,Aoe)}else g=N.inverseTransformation(p,Aoe);l(m)?(wb[0]=i.near,wb[1]=i.far):(wb[0]=0,wb[1]=i.near,wb[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(FU[b],wMe[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,wb[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=wb[A],v=wb[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}};iC.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);iC._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=CMe,b=vMe,x=SMe,T=h.negate(A,xRt),E=h.negate(b,TRt),v=h.negate(x,ERt);u=0,o&&(mP(u,p,g,m,y,v,A,b),u+=12),mP(u,p,g,m,y,x,T,b),u+=12,mP(u,p,g,m,y,T,v,b),u+=12,mP(u,p,g,m,y,E,v,T),u+=12,mP(u,p,g,m,y,A,x,b),u+=12,mP(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:ue.fromVertices(c)})};var rC=iC;var boe=0,CRt=1;function BU(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Ji?(o=boe,s=Ji.packedLength):t instanceof gn&&(o=CRt,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}BU.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===boe?(Ji.pack(r,t,n),n+=Ji.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 vRt=new Ji,SRt=new gn,wRt=new Le,IRt=new h;BU.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===boe?(r=Ji.unpack(e,t,vRt),t+=Ji.packedLength):(r=gn.unpack(e,t,SRt),t+=gn.packedLength);let o=h.unpack(e,t,IRt);t+=h.packedLength;let s=Le.unpack(e,t,wRt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new BU({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};BU.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);rC._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:ue.fromVertices(s)})};var kU=BU;function T7(){pe.throwInstantiationError()}Object.defineProperties(T7.prototype,{credit:{get:pe.throwInstantiationError}});T7.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};T7.prototype.geocode=pe.throwInstantiationError;var pP=T7;var IMe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(IMe);var Ib=IMe;function PMe(){pe.throwInstantiationError()}PMe.createGeometry=function(e){pe.throwInstantiationError()};var xoe=PMe;function PRt(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 UU=PRt;var LRt=Qo(Toe(),1);function DRt(e,t){return(e&t)!==0}var Cl=DRt;var RRt=[1,2,4,8],DMe=15,ORt=16,MRt=64,NRt=128;function L0(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}L0.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 L0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};L0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};L0.prototype.hasSubtree=function(){return Cl(this._bits,ORt)};L0.prototype.hasImagery=function(){return Cl(this._bits,MRt)};L0.prototype.hasTerrain=function(){return Cl(this._bits,NRt)};L0.prototype.hasChildren=function(){return Cl(this._bits,DMe)};L0.prototype.hasChild=function(e){return Cl(this._bits,RRt[e])};L0.prototype.getChildBitmask=function(){return this._bits&DMe};var VU=L0;function FRt(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 BRt=FRt(`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\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7\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 ud(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(ud.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});ud.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 ud;i._resource=n;try{await kRt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${OMe(i,"",1).url}: ${r}`;throw new oe(o)}return i};ud.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Cl(t,o)?Cl(e,o)&&(s|=1):(s|=2,Cl(e,o)||(s|=1)),i+=s}return i};ud.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];Cl(s,2)?Cl(s,1)||(t|=o):(n|=o,Cl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};ud.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 RMe=new Jn("decodeGoogleEarthEnterprisePacket");ud.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=OMe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return RMe.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=VU.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}})})};ud.prototype.populateSubtree=function(e,t,n,i){let r=ud.tileXYToQuadKey(e,t,n);return voe(this,r,i)};function voe(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}),voe(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}),voe(e,t,s)}).finally(function(){delete a[r]})}ud.prototype.getTileInformation=function(e,t,n){let i=ud.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};ud.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function OMe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Eoe,Coe;function kRt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Coe)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Coe=nx(n).then(function(){Eoe=window.cesiumGoogleEarthDbRootParser(LRt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Coe.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Eoe.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 RMe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Eoe.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=BRt})}var oy=ud;function oC(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(oC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var LMe="createVerticesFromGoogleEarthEnterpriseBuffer",URt=new Jn(LMe),zRt=new Jn(LMe,uf.maximumAsynchronousTasks),MMe=new ie,E7=new ie;oC.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,MMe),t.tileXYToRectangle(n,i,r,E7);let u=c.cartographicToCartesian(ie.center(E7)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?zRt:URt).scheduleTask({buffer:this._buffer,nativeRectangle:MMe,rectangle:E7,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 bc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,E7,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Qt.clone(y.orientedBoundingBox),Co.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})};oC.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)?WRt(this,i,r):XRt(this,i,r,e)};var VRt=new Jn("upsampleQuantizedTerrainMesh",uf.maximumAsynchronousTasks);oC.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=VRt.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 eC({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.clone(m.boundingSphere),orientedBoundingBox:Qt.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})})};oC.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};oC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var jRt=new U,HRt=new U,GRt=new U,FMe=new h;function WRt(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,jRt),g=o.decodeTextureCoordinates(r,f,HRt),m=o.decodeTextureCoordinates(r,d,GRt),y=np.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,FMe);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 qRt=Uint16Array.BYTES_PER_ELEMENT,NMe=Uint32Array.BYTES_PER_ELEMENT,Soe=Int32Array.BYTES_PER_ELEMENT,YRt=Float32Array.BYTES_PER_ELEMENT,woe=Float64Array.BYTES_PER_ELEMENT;function XRt(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+=NMe;u+=NMe,u+=2*woe;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=woe;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=woe;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Soe;let y=c.getInt32(u,!0)*3;u+=Soe,u+=Soe;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+=YRt;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=qRt;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=np.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,FMe);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 gP=oC;var Eh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},C7=new K;function v7(){this._terrainCache={},this._lastTidy=K.now()}v7.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};v7.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};v7.prototype.tidy=function(){if(K.now(C7),K.secondsDifference(C7,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(C7,o.timestamp)>10&&delete e[r]}K.clone(C7,this._lastTidy)}};function Pb(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new er({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 v7,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(Pb.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(){}}});Pb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new Pb(t);return n._metadata=e,n};var KRt=new Jn("decodeGoogleEarthEnterprisePacket");function BMe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Eh.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}Pb.prototype.requestTileGeometry=function(e,t,n,i){let r=oy.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=Eh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new gP({buffer:u,childTileMask:BMe(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===Eh.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 Eh.SELF:p=a.terrainVersion;break;case Eh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Eh.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=$Rt(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?KRt.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=Eh.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=Eh.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 gP({buffer:b,childTileMask:BMe(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=Eh.NONE,Promise.reject(b))})};Pb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Pb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=oy.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===Eh.NONE)return!1;if((!l(s)||s===Eh.UNKNOWN)&&(o.terrainState=Eh.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};Pb.prototype.loadTileDataAvailability=function(e,t,n){};function $Rt(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 Ioe=Pb;var JRt="https://maps.googleapis.com/maps/api/geocode/json",kMe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function Poe(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:JRt,queryParameters:{key:t}}),this._credit=new It(kMe,!0)}Object.defineProperties(Poe.prototype,{credit:{get:function(){return this._credit}}});Poe.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:kMe,collapsible:!1}}})};var Doe=Poe;function ZRt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var jU=ZRt;var ZMe={},QRt=32.184,eOt=2451545,UMe=-.0529921,zMe=-.1059842,VMe=13.0120009,jMe=13.3407154,HMe=.9856003,GMe=26.4057084,WMe=13.064993,qMe=.3287146,YMe=1.7484877,XMe=-.1589763,KMe=.0036096,$Me=.1643573,JMe=12.9590088,Roe=new K;ZMe.ComputeMoon=function(e,t){l(e)||(e=K.now()),Roe=K.addSeconds(e,QRt,Roe);let n=K.totalDays(Roe)-eOt,i=n/kn.DAYS_PER_JULIAN_CENTURY,r=(125.045+UMe*n)*D.RADIANS_PER_DEGREE,o=(250.089+zMe*n)*D.RADIANS_PER_DEGREE,s=(260.008+VMe*n)*D.RADIANS_PER_DEGREE,a=(176.625+jMe*n)*D.RADIANS_PER_DEGREE,c=(357.529+HMe*n)*D.RADIANS_PER_DEGREE,u=(311.589+GMe*n)*D.RADIANS_PER_DEGREE,f=(134.963+WMe*n)*D.RADIANS_PER_DEGREE,d=(276.617+qMe*n)*D.RADIANS_PER_DEGREE,p=(34.226+YMe*n)*D.RADIANS_PER_DEGREE,g=(15.134+XMe*n)*D.RADIANS_PER_DEGREE,m=(119.743+KMe*n)*D.RADIANS_PER_DEGREE,y=(239.961+$Me*n)*D.RADIANS_PER_DEGREE,A=(25.053+JMe*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*UMe+.1208*M*zMe-.0642*F*VMe+.0158*V*jMe+.0252*B*HMe-.0066*j*GMe-.0047*k*WMe-.0046*G*qMe+.0028*q*YMe+.0052*Q*XMe+.004*W*KMe+.0019*J*$Me-.0044*Z*JMe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new jU),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var HU=ZMe;function QMe(e){(!l(e)||typeof e!="function")&&(e=HU.ComputeMoon),this._computeFunction=e}var tOt=new h,nOt=new h,iOt=new h;function rOt(e,t,n){let i=tOt;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=iOt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,nOt);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 oOt=new $,sOt=new Le;QMe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=rOt(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,sOt),s=$.fromQuaternion(Le.conjugate(o,o),oOt);return $.multiply(s,i,i)};var GU=QMe;var Ooe=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()}},Moe=Ooe;var eNe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(eNe);var sy=eNe;function Noe(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Noe.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Noe.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Ib.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 WU=Noe;function aOt(e){if(!Object.values(sy).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var tNe=Object.freeze({[sy.GOOGLE]:"google",[sy.BING]:"bing",[sy.DEFAULT]:void 0});function cOt(e){return tNe[e]}function lOt(e){return Object.entries(tNe).find(t=>t[1]===e)[0]}function Loe(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??sy.DEFAULT,n=e.accessToken??Fu.defaultAccessToken,i=De.createIfNeeded(e.server??Fu.defaultServer);i.appendForwardSlash();let r=Fu.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 WU(o),this.geocodeProviderType=t}Object.defineProperties(Loe.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return lOt(this._pelias.url.queryParameters.geocoder)},set:function(e){aOt(e);let t={...this._pelias.url.queryParameters,geocoder:cOt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});Loe.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var sC=Loe;var nNe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(nNe);var Foe=nNe;var iNe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(iNe);var Boe=iNe;var rNe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(rNe);var qU=rNe;var oNe={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(oNe);var koe=oNe;function sNe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function aNe(e){let t=he.fromCartesian(e);return{longitude:D.toDegrees(t.longitude),latitude:D.toDegrees(t.latitude),height:t.height}}function uOt(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 fOt(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 dOt=new N,hOt=new N,S7=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??Fu.defaultAccessToken,r=De.createIfNeeded(n.server??Fu.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=fOt(n,i,dOt);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,hOt),i={testPoint:aNe(t.testPoint),closePoint:aNe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??qU.NEAREST,worldToView:uOt(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=sNe(r.snapPoint),o.hitPoint=sNe(r.hitPoint),o}};S7.DEFAULT_SNAP_APERTURE=12;var Uoe=S7;var ca={};ca.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ca.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ca.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ca.defaultAccessToken=void 0;ca.defaultShareKey=void 0;ca._getAuthorizationHeader=function(){return l(ca.defaultShareKey)?`Basic ${ca.defaultShareKey}`:`Bearer ${ca.defaultAccessToken}`};ca.apiEndpoint=new De({url:"https://api.bentley.com"});ca.getExports=async function(e,t){let n=new De({url:`${ca.apiEndpoint}mesh-export`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ca.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}`)}};ca.getRealityDataMetadata=async function(e,t){let n=new De({url:`${ca.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ca._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}`)}};ca.getRealityDataURL=async function(e,t,n){let i=new De({url:`${ca.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ca._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 la=ca;var cNe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(cNe);var to=cNe;var zoe=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},Voe=zoe;var joe=[],Hoe=[];function mOt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=joe,u=Hoe,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 Goe(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Goe(e,t,n,i,o),Goe(e,t,n,o+1,r),mOt(e,t,n,i,o,r)}function pOt(e,t,n){let i=e.length,r=Math.ceil(i*.5);joe.length=r,Hoe.length=r,Goe(e,t,n,0,i-1),joe.length=0,Hoe.length=0}var F0=pOt;function _P(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(_P.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});_P.prototype.findTimeInterval=Dr.prototype.findTimeInterval;_P.prototype.wrapTime=Dr.prototype.wrapTime;_P.prototype.clampTime=Dr.prototype.clampTime;_P.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 Woe=_P;var lNe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(lNe);var $o=lNe;function vl(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 w7=new h;Object.defineProperties(vl.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,w7),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,w7);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,w7),w7)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});vl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new vl(e,t)};var fNe=new h;vl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,fNe),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 gOt=new h;vl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,gOt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,fNe),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 _Ot=new h;vl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return $o.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,_Ot),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?$o.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?$o.FULL:$o.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?$o.PARTIAL:$o.FULL))}}return $o.NONE};var I7=new h;vl.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,I7),I7),c=-h.dot(a,r),u=vl._anyRotationVector(r,a,c),f=vl._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=vl._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,I7),I7)};var yOt=[];vl.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,yOt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return vl.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var AOt=new h;vl._anyRotationVector=function(e,t,n){let i=h.abs(t,AOt),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 bOt=new h;vl._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,bOt);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 qoe=new h,xOt=new h,P7=new h,uNe=new h;vl._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,qoe),s=h.clone(e.center,xOt),a=e.radius,c=h.subtract(s,o,P7),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,uNe),uNe),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,qoe);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,qoe);T=h.normalize(h.subtract(h.add(b,v,P7),s,P7),P7);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 YU=vl;function Yoe(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(Yoe.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Yoe.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 Xoe=Yoe;var TOt={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},Koe=TOt;var EOt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},$oe=EOt;var COt=new h;function vOt(e,t,n,i){let r=lx(e,t,n,i,COt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var Joe=vOt;function dNe(){pe.throwInstantiationError()}dNe.prototype.getURL=pe.throwInstantiationError;var Zoe=dNe;async function SOt(e,t,n,i){return l(i)||(i=!1),POt(e,t,n,i)}function wOt(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(mNe(i)):o=r.then(mNe(i)).catch(DOt(i)),e.shift(),t.push(o),!0}function IOt(e){return new Promise(function(t){setTimeout(t,e)})}function Qoe(e,t,n){return e.length?wOt(e,t,n)?Qoe(e,t,n):IOt(100).then(()=>Qoe(e,t,n)):Promise.resolve()}function POt(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 Qoe(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function hNe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function mNe(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(!hNe(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];hNe(s,i,n)}}):Promise.resolve()}}function DOt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var XU=SOt;var ese=new U;async function pNe(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,ese);let p=e.loadTileDataAvailability(ese.x,ese.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 XU(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 pNe(e,a,n),t}var aC=pNe;var gNe={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(gNe);var un=gNe;function Db(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 sse(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function cC(e){let t=[];if(e.shiftKey&&t.push(to.SHIFT),e.ctrlKey&&t.push(to.CTRL),e.altKey&&t.push(to.ALT),t.length)return t}var Fs={LEFT:0,MIDDLE:1,RIGHT:2};function fd(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 ROt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(fd(e,"pointerdown",t,BOt),fd(e,"pointerup",t,SNe),fd(e,"pointermove",t,kOt),fd(e,"pointercancel",t,SNe)):(fd(e,"mousedown",t,wNe),fd(e,"mouseup",n,INe),fd(e,"mousemove",n,PNe),fd(e,"touchstart",t,LOt),fd(e,"touchend",n,xNe),fd(e,"touchmove",n,FOt),fd(e,"touchcancel",n,xNe)),fd(e,"dblclick",t,MOt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",fd(e,i,t,NOt)}function OOt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var _Ne={position:new U};function ase(e){e._lastSeenTouchEvent=xn()}function cse(e){return xn()-e._lastSeenTouchEvent>sp.mouseEmulationIgnoreMilliseconds}function ose(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function wNe(e,t){if(!cse(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Fs.LEFT)i=un.LEFT_DOWN;else if(n===Fs.MIDDLE)i=un.MIDDLE_DOWN;else if(n===Fs.RIGHT)i=un.RIGHT_DOWN;else return;let r=Db(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=cC(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,_Ne.position),s(_Ne),t.preventDefault())}var yNe={position:new U},ANe={position:new U};function tse(e,t,n,i){let r=cC(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=Db(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,yNe.position),o(yNe)),l(s)){let c=e._primaryStartPosition;ose(c,a,e._clickPixelTolerance)&&(U.clone(a,ANe.position),s(ANe))}}}function INe(e,t){if(!cse(e))return;let n=t.button;n!==Fs.LEFT&&n!==Fs.MIDDLE&&n!==Fs.RIGHT||(e._buttonDown[Fs.LEFT]&&(tse(e,un.LEFT_UP,un.LEFT_CLICK,t),e._buttonDown[Fs.LEFT]=!1),e._buttonDown[Fs.MIDDLE]&&(tse(e,un.MIDDLE_UP,un.MIDDLE_CLICK,t),e._buttonDown[Fs.MIDDLE]=!1),e._buttonDown[Fs.RIGHT]&&(tse(e,un.RIGHT_UP,un.RIGHT_CLICK,t),e._buttonDown[Fs.RIGHT]=!1))}var nse={startPosition:new U,endPosition:new U};function PNe(e,t){if(!cse(e))return;let n=cC(t),i=Db(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(un.MOUSE_MOVE,n);l(o)&&(U.clone(r,nse.startPosition),U.clone(i,nse.endPosition),o(nse)),U.clone(i,r),(e._buttonDown[Fs.LEFT]||e._buttonDown[Fs.MIDDLE]||e._buttonDown[Fs.RIGHT])&&t.preventDefault()}var bNe={position:new U};function MOt(e,t){let n=t.button,i;if(n===Fs.LEFT)i=un.LEFT_DOUBLE_CLICK;else return;let r=cC(t),o=e.getInputAction(i,r);l(o)&&(Db(e,t,bNe.position),o(bNe))}function NOt(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=cC(t),r=e.getInputAction(un.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function LOt(e,t){ase(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,Db(e,o,new U));D7(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 xNe(e,t){ase(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);D7(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var TNe={position:new U},ise={position1:new U,position2:new U},ENe={position:new U},CNe={position:new U},vNe={position:new U};function D7(e,t){let n=cC(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[Fs.LEFT]){if(e._buttonDown[Fs.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,ENe.position),o(ENe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(un.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];ose(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,CNe.position),s(CNe))}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[Fs.LEFT]=!0,o=e.getInputAction(un.LEFT_DOWN,n),l(o)&&(U.clone(c,TNe.position),o(TNe)),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];ose(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,vNe.position),s(vNe))}},sp.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(un.PINCH_START,n),l(o)&&(U.clone(i.values[0],ise.position1),U.clone(i.values[1],ise.position2),o(ise),t.preventDefault()))}function FOt(e,t){ase(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)&&Db(e,o,u)}DNe(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 rse={startPosition:new U,endPosition:new U},KU={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function DNe(e,t){let n=cC(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[Fs.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,rse.startPosition),U.clone(a,rse.endPosition),s(rse)),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,KU.distance.startPosition),U.fromElements(0,g,KU.distance.endPosition),U.fromElements(E,x,KU.angleAndHeight.startPosition),U.fromElements(T,b,KU.angleAndHeight.endPosition),s(KU)}}function BOt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Db(e,t,new U)),D7(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else wNe(e,t)}function SNe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),D7(e,t),e._previousPositions.remove(i)}else INe(e,t)}function kOt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;Db(e,t,r),DNe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else PNe(e,t)}function sp(e){this._inputEvents={},this._buttonDown={[Fs.LEFT]:!1,[Fs.MIDDLE]:!1,[Fs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-sp.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new kt,this._previousPositions=new kt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,ROt(this)}sp.prototype.setInputAction=function(e,t,n){let i=sse(t,n);this._inputEvents[i]=e};sp.prototype.getInputAction=function(e,t){let n=sse(e,t);return this._inputEvents[n]};sp.prototype.removeInputAction=function(e,t){let n=sse(e,t);delete this._inputEvents[n]};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return OOt(this),le(this)};sp.mouseEmulationIgnoreMilliseconds=800;sp.touchHoldDelayMilliseconds=1500;var ua=sp;function UOt(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 $U(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}$U.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};$U.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 $U({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var R7=new Array(2),O7=new Array(2),zOt={positions:R7,height:O7,ellipsoid:void 0,minDistance:void 0,granularity:void 0};$U.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=zOt;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=R7,R.height=O7;let L=0;for(u=0;u<f-1;++u){R7[0]=t[u],R7[1]=t[u+1],O7[0]=I[u],O7[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=UOt(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:ue.fromPoints(t)})};var lse=$U;var M7=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};M7.DEFAULT_SNAP_APERTURE=void 0;var use=M7;function yP(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 Xa(i),this._workerName="createSphereGeometry"}yP.packedLength=Xa.packedLength;yP.pack=function(e,t,n){return Xa.pack(e._ellipsoidGeometry,t,n)};var VOt=new Xa,Rb={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};yP.unpack=function(e,t,n){let i=Xa.unpack(e,t,VOt);return Rb.vertexFormat=Be.clone(i._vertexFormat,Rb.vertexFormat),Rb.stackPartitions=i._stackPartitions,Rb.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Rb.radii),n._ellipsoidGeometry=new Xa(Rb),n):(Rb.radius=i._radii.x,new yP(Rb))};yP.createGeometry=function(e){return Xa.createGeometry(e._ellipsoidGeometry)};var JU=yP;function jOt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var lC=jOt;var HOt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},wn=HOt;var fse=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()}},dse=fse;function uC(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??tt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(uC.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(uC.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=GOt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});uC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};uC.prototype.isDestroyed=function(){return!1};uC.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};uC.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??tt.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 GOt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var hse=uC;function WOt(e,t){this.rectangle=e,this.maxLevel=t}function RNe(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=[]}RNe.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 qOt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new er({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=Xr.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 WOt(new ie(a,c,u,f),d))}}function YOt(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 XOt(e,t,n){try{let i=await t.fetchXML();qOt(e,i)}catch(i){YOt(t,i,n)}}function Ob(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(Ob.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(){}}});Ob.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new RNe(t),i=De.createIfNeeded(e);await XOt(n,i);let r=new Ob(t);return n.build(r),r._resource=i,r};Ob.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:kh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:KOt(a,e,t,n),structure:a._terrainDataStructure})})};Ob.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var ONe=new ie;function KOt(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,ONe);l(d)&&(N7(r,f,t*2,n*2,i+1)&&(a|=4),N7(r,f,t*2+1,n*2,i+1)&&(a|=8),N7(r,f,t*2,n*2+1,i+1)&&(a|=1),N7(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function N7(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,ONe))}Ob.prototype.getTileDataAvailable=function(e,t,n){};Ob.prototype.loadTileDataAvailability=function(e,t,n){};var mse=Ob;var MNe={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(MNe);var pse=MNe;function $Ot(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 gse=$Ot;function JOt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var ZU=JOt;function fC(){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(fC.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 NNe(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 ZOt(e,t){NNe(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 LNe(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 QOt(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 eMt(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 tMt(e,t){LNe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(eMt(o,i),{framebuffer:n[o].framebuffer,uniformMap:QOt(e,o)});e._commands=r}fC.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 z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};fC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,ZOt(this,e),tMt(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};fC.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)};fC.prototype.isDestroyed=function(){return!1};fC.prototype.destroy=function(){return NNe(this),LNe(this),le(this)};var QU=fC;var nMt=new h(1,1,1);function _se(e){e=e??nMt,this._dimensions=h.clone(e)}Object.defineProperties(_se.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var iMt=new h;_se.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,iMt),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 yse=_se;var ez=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float phi = 2.0 * M_PI * xi.x; +float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); +vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); +vec3 tangentX = normalize(cross(upVector, N)); +vec3 tangentY = cross(N, tangentX); +return tangentX * H.x + tangentY * H.y + N * H.z; +} +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +{ +float alphaRoughnessSq = alphaRoughness * alphaRoughness; +float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); +float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); +float GGX = GGXV + GGXL; +if (GGX > 0.0) +{ +return 0.5 / GGX; +} +return 0.0; +} +vec2 integrateBrdf(float roughness, float NdotV) +{ +vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); +float A = 0.0; +float B = 0.0; +const int NumSamples = 1024; +float alphaRoughness = roughness * roughness; +for (int i = 0; i < NumSamples; i++) +{ +vec2 xi = hammersley2D(i, NumSamples); +vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); +vec3 L = 2.0 * dot(V, H) * H - V; +float NdotL = clamp(L.z, 0.0, 1.0); +float NdotH = clamp(H.z, 0.0, 1.0); +float VdotH = clamp(dot(V, H), 0.0, 1.0); +if (NdotL > 0.0) +{ +float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); +float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; +float Fc = pow(1.0 - VdotH, 5.0); +A += (1.0 - Fc) * G_Vis; +B += Fc * G_Vis; } -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); +return vec2(A, B) / float(NumSamples); } -#endif -`;var{Material:Trt,MetallicRoughness:zZ,SpecularGlossiness:VZ,Specular:zAe,Clearcoat:VAe}=Tn,jAe={name:"MaterialPipelineStage",_processTexture:Xu,_processTextureTransform:HAe};jAe.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;wrt(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Irt(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&Prt(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&Rrt(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&Ort(i.clearcoat,o,s,u,c),Mrt(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Ert(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=e0.UNLIT:y.lightingModel=e0.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===Sp.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===Sp.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)&&vrt(i.lineStyle,t,n,o,s),s.addFragmentLines(AF),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function Ert(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 Crt(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(xF);let u=bF.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 vrt(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) +void main() { - float cumDist = attributes.${u}; -#ifdef LINE_CUM_DIST_NORMALIZED - cumDist *= u_cumulativeDistanceMax; -#endif - const float textureCoordinateBase = 8192.0; - v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; +out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } -#endif -`)}else l(s)&&r.addVertexLines(` -#ifdef HAS_LINE_PATTERN -void lineStyleStageVS(in ProcessedAttributes attributes) +`;function tz(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(tz.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function rMt(e,t,n){let i=t.createViewportQuadCommand(ez,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}tz.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:Ht.NEAREST});this._colorTexture=n;let i=new ys({context:t,colorTextures:[n],destroyAttachments:!1});rMt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};tz.prototype.isDestroyed=function(){return!1};tz.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var nz=tz;var Ase=0,FNe=new h,L7=new h,oMt=new Lo;function sMt(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=oMt.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)?cMt(He,s,g)??d:aMt(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)bse(Pe,i,r,o,j,Ase,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)bse(st,i,r,o,j,Ase,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=lMt($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)),bse(Xn,i,r,o,j,Ase,u,Gt),mt++}if(vt.length<3)continue;let ft=fi.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=hMt(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}),dMt(V,P)}function aMt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function cMt(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 lMt(e){let t=[];for(let n of e){let i=fMt(n);if(i.length<3)continue;uMt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function uMt(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 fMt(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 bse(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,FNe),h.subtract(FNe,s,L7),a.push(L7.x,L7.y,L7.z)}function dMt(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 hMt(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var iz=sMt;var BNe={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(BNe);var B0=BNe;function AP(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}AP.prototype.getTexture=function(e){return this._textures[e]};function mMt(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})}AP.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):mMt(this,e,t)};function pMt(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?F7(r,o,n):gMt(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function F7(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?UNe(e,n):new Dt({context:n,source:t,sampler:r});return kNe(r)&&o.generateMipmap(),o}function gMt(e,t,n){let{typedArray:i,sampler:r}=e,o=kNe(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=UU(i,a,c),p=sA(d);return F7({sampler:r},p,n)}}else{let d=sA(t);return F7(e,d,n)}else return F7(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."),UNe(e,n)}function kNe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function UNe(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})}AP.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];pMt(this,r,t)}n.length=0};AP.prototype.isDestroyed=function(){return!1};AP.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 le(this)};var rz=AP;function oz(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Kg.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??TA.INHERIT,this._textureManager=new rz,this._defaultTexture=void 0,this.uniformMap=_Mt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},bMt(this),xMt(this)}function _Mt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===B0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=yMt(e,i)):n[i]=AMt(e,i)}return n}function yMt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function AMt(e,t){return function(){return e.uniforms[t].value}}function dC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function bMt(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,dC(o,t,r),r=e.usedVariablesVertex.featureIdSet,dC(o,n,r),r=e.usedVariablesVertex.metadataSet,dC(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,dC(s,t,r),r=e.usedVariablesFragment.featureIdSet,dC(s,n,r),r=e.usedVariablesFragment.metadataSet,dC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;dC(s,a,c)}}function zNe(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 Sl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${zNe(t)} is not available in the ${i} shader. Did you mean ${zNe(n)} instead?`;throw new pe(r)}}function xMt(e){let t=e.usedVariablesVertex.attributeSet;Sl(t,"position","positionMC","vertex"),Sl(t,"normal","normalMC","vertex"),Sl(t,"tangent","tangentMC","vertex"),Sl(t,"bitangent","bitangentMC","vertex"),Sl(t,"positionWC","positionMC","vertex"),Sl(t,"positionEC","positionMC","vertex"),Sl(t,"normalEC","normalMC","vertex"),Sl(t,"tangentEC","tangentMC","vertex"),Sl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Sl(n,"position","positionEC","fragment"),Sl(n,"normal","normalEC","fragment"),Sl(n,"tangent","tangentEC","fragment"),Sl(n,"bitangent","bitangentEC","fragment"),Sl(n,"normalMC","normalEC","fragment"),Sl(n,"tangentMC","tangentEC","fragment"),Sl(n,"bitangentMC","bitangentEC","fragment")}oz.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===B0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};oz.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};oz.prototype.isDestroyed=function(){return!1};oz.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var k0=oz;function TMt(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 Ht({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var sz=TMt;function EMt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!CMt(r?.[s],o?.[s]))continue;let a=vMt(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function CMt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function vMt(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return SMt(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return wMt(e,i,r)}function SMt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new k0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { - vec4 posClip = gl_Position; - vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw; + material.diffuse = fsInput.metadata.${e}.rgb; + material.alpha = fsInput.metadata.${e}.a; +}`})}function wMt(e,t,n){let r=MU([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 sz({typedArray:r,width:128,height:1});return new k0({uniforms:{u_colorMap:{type:B0.SAMPLER_2D,value:o},u_minimumValue:{type:B0.FLOAT,value:t[0]},u_maximumValue:{type:B0.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; - const float textureCoordinateBase = 8192.0; - if (czm_viewport.z > czm_viewport.w) { - v_lineCoord = textureCoordinateBase + screenPos.x; - } else { - v_lineCoord = textureCoordinateBase + screenPos.y; - } + 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 bP=EMt;function IMt(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=B7(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=B7(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=B7(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=B7(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=DMt(P,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${VNe(B)};`,`${p}.${w}.max${V} = ${VNe(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=PMt(w,P);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${L};`])}}function B7(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 PMt(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 VNe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function DMt(e,t){return e===bt.SCALAR?"":`[${t}]`}var az=IMt;function ap(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?jNe:HNe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function jNe(e){return e===$t.OUTSIDE}function HNe(e){return e===$t.INSIDE}Object.defineProperties(ap.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?jNe:HNe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});ap.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};ap.prototype.get=function(e){return this._planes[e]};function GNe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}ap.prototype.contains=function(e){return GNe(this._planes,e)!==-1};ap.prototype.remove=function(e){let t=this._planes,n=GNe(t,e);if(n===-1)return!1;e instanceof ia&&(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 ia&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};ap.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ia&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var RMt=new sn(h.fromElements(1,0,0),0);function OMt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=NMt(i[o],t,RMt);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var xse=new se,MMt=new h;function NMt(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,xse),s=N.multiplyByVector(t,o,xse),a=h.fromCartesian4(s,MMt);return s=se.divideByScalar(s,h.magnitude(a),xse),sn.fromCartesian4(s,n)}function WNe(e,t){return t.x=Math.min(e,Ut.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var LMt=new U;ap.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=WNe(i,LMt);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:Ke.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;OMt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};ap.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=WNe(r,n);return o.y*=2,o};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var ay=ap;var cz=`struct Ray { +vec3 pos; +vec3 dir; +}; +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); +} +`;var lz=`#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 -`)}function HAe(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 Srt(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 Xu(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)&&HAe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Srt(e,t,n,i,r),Crt(e,t,n,i,r,s)}function wrt(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Trt.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&&Xu(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),Xu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Xu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Irt(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&&Xu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,VZ.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&&Xu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,VZ.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!==VZ.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 Prt(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&&Xu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==zAe.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&&Xu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,zAe.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 Drt=new h;function Rrt(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Xu(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,Drt)}}function Ort(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!==VAe.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&&Xu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==VAe.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&&Xu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Xu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Mrt(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Xu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,zZ.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&&Xu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==zZ.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!==zZ.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 TF=jAe;var tu={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"};tu.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(tu.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(tu.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(tu.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(tu.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(tu.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(tu.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",[`${tu.METADATA_PICKING_VALUE_TYPE} value = ${tu.METADATA_PICKING_VALUE_TYPE}(${tu.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${tu.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${tu.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${tu.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${tu.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Vf=tu;var EF=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ -vec3 positionMC = attributes.positionMC; -attributes.positionMC = getMorphedPosition(positionMC); -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = getMorphedNormal(normalMC); -#endif -#ifdef HAS_TANGENTS -vec3 tangentMC = attributes.tangentMC; -attributes.tangentMC = getMorphedTangent(tangentMC); +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); } -`;var Bc={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)"};Bc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Urt(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||(Lrt(e,d,e.attributeIndex,a),e.attributeIndex++)}}zrt(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(EF);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var Nrt={attributeString:void 0,functionId:void 0};function Lrt(e,t,n,i){let r=e.shaderBuilder;Frt(e,t,n);let o=Brt(t,Nrt);krt(r,o,i)}function Frt(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 Brt(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function krt(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 Urt(e){e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_POSITION,Bc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,Bc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,Bc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function zrt(e){e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var CF=Bc;var GAe={name:"PickingPipelineStage"};function jZ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}GAe.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)Vrt(e,t,a,i);else if(l(a))jrt(e,i);else{let c=WAe(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=jZ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function WAe(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(Wo.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 Vrt(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=jZ(e.pickId)}function jrt(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=WAe(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=jZ(e.pickId)}var vF=GAe;var qAe={ADD:0,REPLACE:1};Object.freeze(qAe);var _o=qAe;var SF=`float getPointSizeFromAttenuation(vec3 positionEC) { -float pointSize = model_pointCloudParameters.x; -float geometricError = model_pointCloudParameters.y; -float depthMultiplier = model_pointCloudParameters.z; -float depth = -positionEC.z; -return min((geometricError / depth) * depthMultiplier, pointSize); +#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); } -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); +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; } -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); +float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); +return vec4(entry.xyz, stepSize); } -#endif -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +vec2 packIntToVec2(int value) { +float shifted = float(value) / 255.0; +float lowBits = fract(shifted); +float highBits = floor(shifted) / 255.0; +return vec2(highBits, lowBits); } -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -return getPointSizeFromAttenuation(v_positionEC); +vec2 packFloatToVec2(float value) { +float lowBits = fract(value); +float highBits = floor(value) / 255.0; +return vec2(highBits, lowBits); +} +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); +} +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() +{ +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; } +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 -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { -#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) -return step(-v_normalEC.z, 0.0); +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 -return 1.0; -#endif +shapeIntersection = nextIntersection(ix); +if (shapeIntersection.entry.w == NO_HIT) { +break; +} else { +currentT = shapeIntersection.entry.w; +endT = shapeIntersection.exit.w; } #endif -`;var Hrt=new se,XAe={name:"PointCloudStylingPipelineStage"};XAe.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=Yrt(a),A=Xrt(o,y);Krt(i,A);let x=$rt(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;Wo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===_o.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(SF);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Hrt,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=Grt(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 mn?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var YAe=new h;function Grt(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,YAe);a=N.multiplyByPointAsVector(s,a,YAe);let c=a.x*a.y*a.z;return D.cbrt(c/o)}var Wrt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},qrt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Yrt(e){let t=Je(qrt);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 HZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Xrt(e,t){let n=Wrt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${HZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${HZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${HZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Krt(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 GZ(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 $rt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&GZ(t,r),l(n)&&GZ(n,r),l(i)&&GZ(i,r),r}var wF=XAe;var IF=`void primitiveOutlineStage() { -v_outlineCoordinates = a_outlineCoordinates; } -`;var PF=`void primitiveOutlineStage(inout czm_modelMaterial material) { -if (!model_showOutline) { -return; +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); } -float outlineX = -texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; -float outlineY = -texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; -float outlineZ = -texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; -float outlineness = max(outlineX, max(outlineY, outlineZ)); -material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +colorAccum.a /= ALPHA_ACCUM_MAX; +#if defined(PICKING) +if (colorAccum.a == 0.0) { +discard; } -`;var KAe={name:"PrimitiveOutlinePipelineStage"};KAe.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=Zx.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(IF),i.addFragmentLines(PF)};var DF=KAe;var $Ae={name:"PrimitiveStatisticsPipelineStage",_countGeometry:JAe,_count2DPositions:ZAe,_countMorphTargetAttributes:QAe,_countMaterialTextures:ebe,_countFeatureIdTextures:tbe,_countBinaryMetadata:nbe};$Ae.process=function(e,t,n){let i=e.model,r=i.statistics;JAe(r,t),ZAe(r,e.runtimePrimitive),QAe(r,t),ebe(r,t.material),tbe(r,t.featureIds),nbe(r,i)};function JAe(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+=Jrt(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 Jrt(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 ZAe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function QAe(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 ebe(e,t){let n=Zrt(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 Zrt(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 tbe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Tn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function nbe(e,t){let n=t.structuralMetadata;l(n)&&(Qrt(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 Qrt(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 RF=$Ae;var eot=new N,tot=new N,ibe={name:"SceneMode2DPipelineStage"};ibe.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,eot),u=rot(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=aot(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,tot)}};e.uniformMap=Ot(m,e.uniformMap)};var not=new h,iot=new h;function rot(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,not),r=fr.computeActualEllipsoidPosition(n,i,i),o=N.multiplyByPoint(t,e.positionMax,iot),s=fr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var rbe=new h;function oot(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,rbe),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 sot(e,t,n,i){let r;l(e.quantization)?r=oot(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,rbe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=N.multiplyByPoint(t,u,u),d=fr.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 aot(e,t,n,i){let r=Je(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=sot(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var OF=ibe;var MF=`void skinningStage(inout ProcessedAttributes attributes) -{ -mat4 skinningMatrix = getSkinningMatrix(); -mat3 skinningMatrixMat3 = mat3(skinningMatrix); -vec4 positionMC = vec4(attributes.positionMC, 1.0); -attributes.positionMC = vec3(skinningMatrix * positionMC); -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = skinningMatrixMat3 * normalMC; -#endif -#ifdef HAS_TANGENTS -vec3 tangentMC = attributes.tangentMC; -attributes.tangentMC = skinningMatrixMat3 * tangentMC; -#endif +out_FragColor = u_pickColor; +#elif defined(PICKING_VOXEL) +if (colorAccum.a == 0.0) { +discard; } -`;var cT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};cT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),lot(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(MF);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function cot(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 lot(e,t){e.addFunction(cT.FUNCTION_ID_GET_SKINNING_MATRIX,cT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(cT.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=cot(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(cT.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(cT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var NF=cT;var LF=`void verticalExaggerationStage( -inout ProcessedAttributes attributes -) { -vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); -vec2 vertexAzimuth = normalize(vertexPositionENU.xy); -float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); -float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; -vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; -vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; -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, vertexEllipsoidNormalEC); -float smallAngleVersine = 0.5 * sinTheta * sinTheta; -float versine = isSmallAngle ? smallAngleVersine : exactVersine; -float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; -float vertexHeight = czm_eyeHeight + dHeight; -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 * exaggerationDirectionScaledMC; +vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex); +vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0])); +out_FragColor = vec4(megatextureId, sampleIndex); +#else +out_FragColor = colorAccum; +#endif } -`;var obe={name:"VerticalExaggerationPipelineStage"},uot=new U;obe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(LF),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,uot)}};var FF=obe;var WZ={};function fot(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 dot(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 hot(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 mot(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 pot(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 got(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}WZ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?dot(t,n):fot(t);if(e===Oe.TRIANGLE_STRIP)return i?mot(t,n):hot(t);if(e===Oe.TRIANGLE_FAN)return i?got(t,n):pot(t)};WZ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var qS=WZ;var sbe={name:"WireframePipelineStage"};sbe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=_ot(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=qS.getWireframeIndicesCount(a,c)};function _ot(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=qS.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 BF=sbe;function abe(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=[]}abe.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!==Tg.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=yot(r,i,n),L=l(r.classificationType);u&&t.push(OF),t.push(iF),x&&t.push(BF),L&&t.push(FL),d&&t.push(CF),p&&t.push(NF),S&&t.push(wF),b&&t.push(XL),g&&(I?_t("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(gF)),A&&t.push(TF),t.push(bA),t.push(qd),t.push(Vf),O.hasPropertyTable&&(t.push(xA),t.push(LL),t.push(UL)),f&&t.push(FF),m&&t.push(qL),t.push(yF),r.allowPicking&&t.push(vF),I&&t.push(DF),R&&(e.edgeVisibilityRequested=!0,t.push(QL),t.push($L)),t.push(NL),t.push(RF)};function yot(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 kF=abe;function qZ(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=[],Aot(this)}Object.defineProperties(qZ.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,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=cbe(f,d,new N);a.push(p)}}function cbe(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}qZ.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]=cbe(i,r,e[n])}};var UF=qZ;function bot(){this.pass=void 0,this.alphaCutoff=void 0}var lT=bot;function xot(e){this.shaderBuilder=new Cg,this.model=e,this.uniformMap={},this.alphaOptions=new lT,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var zF=xot;var VF=`void silhouetteStage(inout vec4 color) { -if(model_silhouettePass) { -color = czm_gammaCorrect(model_silhouetteColor); +`;var uz=`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 fz=`#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 jF=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { -#ifdef HAS_NORMALS -if(model_silhouettePass) { -vec3 normal = normalize(czm_normal3D * attributes.normalMC); -normal.x *= czm_projection[0][0]; -normal.y *= czm_projection[1][1]; -positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; +return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; } -#endif +vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) +{ +return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; } -`;var FH={name:"ModelSilhouettePipelineStage"};FH.silhouettesLength=0;FH.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++FH.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(jF),i.addFragmentLines(VF),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 HF=FH;var GF=`void modelSplitterStage() +RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) { -#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 +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); } -`;var BH={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};BH.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(GF);let r={};i.addUniform("float",BH.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[BH.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var WF=BH;function Tot(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 qF=Tot;function Eot(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??e0.UNLIT}var YF=Eot;function Cot(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=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new YF,this.pickId=void 0,this.snapId=void 0}var XF=Cot;function XZ(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!==ei.CESIUM_3D_TILE,this._classifies3DTiles=r!==ei.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Iot(this)}function vot(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:cc.LESS_OR_EQUAL},depthMask:!1}}var Sot={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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},wot={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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},fbe=[];function Iot(e){let t=e._command,n=fbe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=KF(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=YZ(t,o),a=lbe(t,o);n.length=0,n.push(s,a),e._commandListTerrain=KF(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=ube(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=YZ(t,o),a=lbe(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=KF(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=ube(e,n,e._commandList3DTilesPicking))}}function KF(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 YZ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?Zn.ALWAYS:Zn.EQUAL,r=vot(i);return n.renderState=Ge.fromCache(r),n}function lbe(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Sot),n}var Pot=[];function ube(e,t,n){let i=Ge.fromCache(wot),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=Pot;return c.length=0,c.push(s,a),KF(e,c,n)}Object.defineProperties(XZ.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=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}}});XZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Qn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Qn(t,this._commandListTerrain),this._classifies3DTiles&&Qn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=YZ(this._command,r),s=fbe;s.length=0,s.push(o),this._commandListIgnoreShow=KF(this,s,this._commandListIgnoreShow)}Qn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Qn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Qn(t,this._commandList3DTilesPicking)),t};var $F=XZ;function YS(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=ue.clone(t.boundingVolume),this._modelMatrix2D=new N,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=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,Dot(this)}function Xd(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}Xd.clone=function(e){return new Xd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Dot(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 Xd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Xd({command:Bot(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Xd({command:Got(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Xd({command:Wot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Xd({command:kot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Xd({command:Uot(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 Xd({command:dbe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Xd({command:dbe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Xd({command:zot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(YS.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=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,Oot(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Mot(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Not(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Lot(this))}}});function Rot(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=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Oot(e){let t=e.shadows,n=Pn.castShadows(t),i=Pn.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 Mot(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 Not(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 Lot(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}}}YS.prototype.pushCommands=function(e,t){let n=kH(this,e);n&&!this._has2DCommands&&(Fot(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Rot(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==hm.ALL_OPAQUE&&t0(t,this._translucentCommand,n),i===hm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||t0(r._backfaceCommands,this._skipLodBackfaceCommand,n),Vot(this,o,n),t0(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){t0(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Wd.EDGES_ONLY&&this._needsEdgeCommands||t0(t,this._originalCommand,n),t}};YS.prototype.pushSilhouetteCommands=function(e,t){let n=kH(this,e);return t0(t,this._silhouetteColorCommand,n),t};YS.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=kH(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),t0(t,s,r),t}if(i.pick){if(n!==Wd.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),t0(t,s,r),t}if(n===Wd.SURFACES_ONLY)return t;let o=n===Wd.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),t0(t,this._edgeCommand,r),t};YS.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=kH(this,e);return t0(t,this._planarFillIdCommand,n),t};function t0(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function kH(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 Yg(e,t){if(!l(t))return;let n=Xd.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 Fot(e){Yg(e,e._originalCommand),Yg(e,e._translucentCommand),Yg(e,e._skipLodBackfaceCommand),Yg(e,e._skipLodStencilCommand),Yg(e,e._silhouetteModelCommand),Yg(e,e._silhouetteColorCommand),Yg(e,e._edgeCommand),Yg(e,e._edgeSnapCommand),Yg(e,e._planarFillIdCommand)}function Bot(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 kot(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 Uot(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 dbe(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 zot(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 Vot(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=jot(r);if(o!==s){let a=Hot(o),c=Je(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function jot(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function Hot(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function Got(e){let t=at.shallowClone(e),n=Je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ui.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 Wot(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=Zn.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=Zn.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 JF=YS;var ZF=`precision highp float; -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { -czm_modelVertexOutput vsOutput; -vsOutput.positionMC = positionMC; -vsOutput.pointSize = 1.0; -return vsOutput; +vec4 entry = intersectionMax(intersect0.entry, intersect1.entry); +vec4 exit = intersectionMin(intersect0.exit, intersect1.exit); +return RayShapeIntersection(entry, exit); } -void main() -{ -ProcessedAttributes attributes; -initializeAttributes(attributes); -#ifdef HAS_IMAGERY -initializeImageryAttributes(); -#endif -#ifdef USE_DEQUANTIZATION -dequantizationStage(attributes); -#endif -#ifdef HAS_MORPH_TARGETS -morphTargetsStage(attributes); -#endif -#ifdef HAS_SKINNING -skinningStage(attributes); -#endif -#ifdef HAS_PRIMITIVE_OUTLINE -primitiveOutlineStage(); -#endif -#ifdef HAS_BITANGENTS -attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); -#endif -FeatureIds featureIds; -featureIdStage(featureIds, attributes); -#ifdef HAS_SELECTED_FEATURE_ID -SelectedFeature feature; -selectedFeatureIdStage(feature, featureIds); -cpuStylingStage(attributes.positionMC, feature); -#endif -#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) -mat4 modelView = czm_modelView3D; -mat3 normal = czm_normal3D; -#else -mat4 modelView = czm_modelView; -mat3 normal = czm_normal; -#endif -#ifdef HAS_INSTANCING -#ifdef USE_LEGACY_INSTANCING -mat4 instanceModelView; -mat3 instanceModelViewInverseTranspose; -legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); -modelView = instanceModelView; -normal = instanceModelViewInverseTranspose; -#else -instancingStage(attributes); -#endif -#ifdef USE_PICKING -v_pickColor = a_pickColor; -#endif -#endif -Metadata metadata; -MetadataClass metadataClass; -MetadataStatistics metadataStatistics; -metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); -#ifdef HAS_VERTICAL_EXAGGERATION -verticalExaggerationStage(attributes); -#endif -#ifdef HAS_CUSTOM_VERTEX_SHADER -czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); -customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); -#endif -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 HAS_VECTOR_LOOKUP -modelVectorLookupStage(attributes); -#endif -#ifdef HAS_SILHOUETTE -silhouetteStage(attributes, positionClip); -#endif -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float show = pointCloudShowStylingStage(attributes, metadata); -#else -float show = 1.0; -#endif -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -show *= pointCloudBackFaceCullingStage(); -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); -#endif -#ifdef PRIMITIVE_TYPE_POINTS -#ifdef HAS_CUSTOM_VERTEX_SHADER -gl_PointSize = vsOutput.pointSize; -#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) -gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); -#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; +struct Intersections { +vec4 intersections[INTERSECTION_COUNT * 2]; +float distanceToDepthBuffer; +#if (INTERSECTION_COUNT > 1) +int index; +int surroundCount; +bool surroundIsPositive; #endif +}; +RayShapeIntersection getFirstIntersection(in Intersections ix) +{ +return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); } -`;var QF=`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() +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) { -czm_modelMaterial material; -material.diffuse = vec3(0.0); -material.specular = vec3(1.0); -material.roughness = 1.0; -material.occlusion = 1.0; -material.normalEC = vec3(0.0, 0.0, 1.0); -material.emissive = vec3(0.0); -material.alpha = 1.0; -return material; +float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; +return vec4(intersection.xyz * scale, intersection.w); } -vec4 handleAlpha(vec3 color, float alpha) -{ -#ifdef ALPHA_MODE_MASK -if (alpha < u_alphaCutoff) { -discard; +#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; } -#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; +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; } -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; +for (int i = 0; i < passCount; ++i) { +if (i < ix.index) { +continue; } -#endif -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -if (v_pointCloudShow == 0.0) -{ -discard; +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; } -#endif -#ifdef HAS_MODEL_SPLITTER -modelSplitterStage(); -#endif -czm_modelMaterial material = defaultModelMaterial(); -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; +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; } -#endif -Metadata metadata; -MetadataClass metadataClass; -MetadataStatistics metadataStatistics; -metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); -#ifndef METADATA_PICKING_ENABLED -#ifdef HAS_SELECTED_FEATURE_ID -selectedFeatureIdStage(selectedFeature, featureIds); -#endif -#ifndef CUSTOM_SHADER_REPLACE_MATERIAL -materialStage(material, attributes, selectedFeature); -#endif -#ifdef HAS_CUSTOM_FRAGMENT_SHADER -customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); -#endif -lightingStage(material, attributes); -#ifdef HAS_SELECTED_FEATURE_ID -cpuStylingStage(material, selectedFeature); -#endif -#ifdef HAS_MODEL_COLOR -modelColorStage(material); -#endif -#ifdef HAS_PRIMITIVE_OUTLINE -primitiveOutlineStage(material); -#endif -vec4 color = handleAlpha(material.diffuse, material.alpha); -#else -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); -#endif -#ifdef HAS_ATMOSPHERE -atmosphereStage(color, attributes); -#endif -#ifdef HAS_EDGE_VISIBILITY -edgeVisibilityStage(color, featureIds); -edgeDetectionStage(color, featureIds); -if (u_isEdgePass) { -isEdge = true; +break; } -#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; } +return shapeIntersection; } #endif +`;var dz=`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; } -`;function hbe(){}hbe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=qot(e,n,t),r=Yot(e,i,t),o=e.model;return l(o.classificationType)?new $F({primitiveRenderResources:e,command:r}):new JF({primitiveRenderResources:e,command:r})};function qot(e,t,n){t.addVertexLines(ZF),t.addFragmentLines(QF);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Yot(e,t,n){let i=Xot(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=ue.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:Pn.castShadows(o.shadows),m=p?!1:Pn.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 Xot(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var eB=hbe;function ml(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={},Kot(this)}Object.defineProperties(ml.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 Kot(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;mbe(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 pL({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=pbe(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 UF({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 mbe(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 $ot=new h;function Jot(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,$ot);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=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function pbe(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=pbe(e,d,p);i.push(g)}let s=new ML({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 kF({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 vL(f,s);f._nodesByName[u]=d}return c}var Zot=new h,Qot=new h,est=new h,tst=new h;ml.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};ml.prototype.buildRenderResources=function(e){let t=this._model,n=new zF(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 qF(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 XF(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};ml.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Zot),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Qot);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=ue.clone(f.boundingSphere,new ue);let d=N.multiplyByPoint(a,f.positionMin,est),p=N.multiplyByPoint(a,f.positionMax,tst);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=ue.fromCornerPoints(n,i,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};ml.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=eB.buildModelDrawCommand(a,t);s.drawCommand=c}}};ml.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(yA),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(hL),n.isClippingEnabled()&&t.push(yL);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(xL),n.hasDrapedVectors()&&t.push(CL),n.hasSilhouette(e)&&t.push(HF),l(n.splitDirection)&&n.splitDirection!==Ho.NONE&&t.push(WF),Wo.is3DTiles(n.type)&&t.push(cL),i&&t.push(fL)};ml.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)}}};ml.prototype.updateModelMatrix=function(e,t){mbe(this,e),t.mode!==re.SCENE3D&&Jot(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};ml.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 gbe(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);gbe(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 UH(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];gbe(e,c,t,n,i)}}var nst={backFaceCulling:void 0};ml.prototype.updateBackFaceCulling=function(e){let t=nst;t.backFaceCulling=e,UH(this,!1,ist,t)};function ist(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var rst={shadowMode:void 0};ml.prototype.updateShadows=function(e){let t=rst;t.shadowMode=e,UH(this,!1,ost,t)};function ost(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var sst={debugShowBoundingVolume:void 0};ml.prototype.updateShowBoundingVolume=function(e){let t=sst;t.debugShowBoundingVolume=e,UH(this,!1,ast,t)};function ast(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var _be=[],ybe=[],Abe=[],cst={frameState:void 0,hasSilhouette:void 0};ml.prototype.pushDrawCommands=function(e){let t=_be;t.length=0;let n=ybe;n.length=0;let i=Abe;i.length=0;let r=cst;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,UH(this,!0,lst,r),Qn(e.commandList,t),Qn(e.commandList,n),Qn(e.commandList,i)};function lst(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=_be,s=ybe,a=Abe,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)}ml.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)};ml.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var tB=ml;function EA(){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(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 nB=EA;var Ebe=Qo(mj(),1);var bbe={},uT=Uint32Array.BYTES_PER_ELEMENT;bbe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=uT;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+=uT,t+=uT;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=uT;let s=i.getUint32(t,!0);t+=uT;let a=i.getUint32(t,!0);t+=uT;let c=i.getUint32(t,!0);t+=uT;let u=Do(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Do(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 fm(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=fst(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=dst(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=mst(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=hst(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=pst(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),ust(A),A};function ust(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 fst(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 dst(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 hst(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 mst(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 pst(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 fT=bbe;var gst=Tn.Components,_st=Tn.Scene,yst=Tn.Node,Ast=Tn.Primitive,bst=Tn.Attribute,xbe=Tn.Quantization,xst=Tn.FeatureIdAttribute,Tst=Tn.Material,Est=Tn.MetallicRoughness,KZ=class extends er{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=fT.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=Cst(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 Cst(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=Rg.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&vst(e,i,o),Fst(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 vst(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:Sst(u.componentsPerAttribute),componentType:wst(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Sst(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function wst(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 iB(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new xbe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new xbe;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 bst;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 Tbe,zH;function Ist(e){if(!l(zH)){Tbe=new Ebe.default(0),zH=new Array(e);for(let t=0;t<e;++t)zH[t]=Tbe.random()}return zH}var Pst=new h,Dst=new h,Rst=new h;function Ost(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Ist(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Pst),u=h.fromElements(a,a,a,Dst),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,Rst),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Mst={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Nst(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Ost(o),r=iB(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=iB(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=iB(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=iB(e,Mst,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=iB(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Lst(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?Ug({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Ha({schema:{},propertyTables:[]})}function Fst(e,t){let n=e._parsedContent,i=new Est;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Tst;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Sp.BLEND);let s=!l(n.normals);r.unlit=s;let a=new Ast;if(a.attributes=Nst(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new xst;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new yst;c.index=0,c.primitives=[a];let u=new _st;u.nodes=[c],u.upAxis=Vi.Z,u.forwardAxis=Vi.X;let f=new gst;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Lst(n,d),d.length>0&&Bst(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 Bst(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 rB=KZ;var VH={};VH.getHeight=function(e,t,n){return(e-n)*t+n};var kst=new he;VH.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,kst);if(!l(o))return h.clone(e,r);let s=VH.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var Ar=VH;var jH=new h,Cbe=new h,vbe=new h,oB=new h,Ust=new h,zst=new h,Vst=new he,jst=new ue;function HH(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 Hst=32,$Z=new Map,JZ=[];function Gst(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 XS(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(xa.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,jst),E=yi.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=$Z.get(f);l(A)||(A={},l(y)&&(A.vertices=xa.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=xa.readIndicesAsTypedArray(f.indices)),$Z.set(f,A),JZ.push(f),JZ.length>Hst&&$Z.delete(JZ.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++)HH(g,O,m,jH),N.multiplyByPoint(T,jH,oB),R[O*3]=oB.x,R[O*3+1]=oB.y,R[O*3+2]=oB.z;A.world=R,A.worldTransform=N.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Gst(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];HH(g,E,m,jH),HH(g,v,m,Cbe),HH(g,S,m,vbe);for(let I of d){let R=N.multiplyByPoint(I.transform,jH,oB),O=N.multiplyByPoint(I.transform,Cbe,Ust),L=N.multiplyByPoint(I.transform,vbe,zst);i!==1&&(Ar.getPosition(R,o,i,r,R),Ar.getPosition(O,o,i,r,O),Ar.getPosition(L,o,i,r,L));let _=yi.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,Vst);f.cartographicToCartesian(d,s)}return s}}var ZZ=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}},sB=ZZ;var QZ=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 aT(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 sB(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},aB=QZ;function Tr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Wo.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 oL(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??dl.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 ue,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 Zp(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Ts.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Nc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,Ibe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new aB(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new tT,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Lg(e.environmentMapOptions);Lg.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Pn.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??Wd.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Wo.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??Ho.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new nB,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 eQ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Wst(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 aL({model:e,propertyTable:s});n.push(a)}return n}function qst(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 iQ(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(Tr.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){iQ(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=iQ(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 Dbe(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===Wo.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&&(Ts.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Nc.setOwner(e,this,"_clippingPolygons"),Ibe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Nc.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&&(Lg.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}}});Tr.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))};Tr.prototype.getNode=function(e){return this._nodesByName[e]};Tr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Tr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Tr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Tr.prototype.makeStyleDirty=function(){this._styleDirty=!0};Tr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Yst=new N,Xst=new $,Kst=new N;Tr.prototype.update=function(e){let t=!1;try{t=$st(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")eQ(this,i);else{let r=xt.getError("model",this._resource,i);eQ(this,r)}}if(Jst(this,e),Zst(this,e),Qst(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."));eQ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Wst(this,r);let o=new tB({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(eat(this),tat(this),nat(this,e),iat(this),rat(this,e),oat(this,e),sat(this,e),aat(this,e),uat(this,e),fat(this,e),dat(this,e),hat(this,e),this._defaultTexture=e.context.defaultTexture,mat(this,e),gat(this,e),Aat(this),bat(this,e),Cat(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)),Tat(this),vat(this,e),Sat(this),Iat(this,e)}};function $st(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Jst(e,t){l(e._customShader)&&e._customShader.update(t)}function Zst(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 Qst(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function eat(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=qst(t,e),e._styleDirty=!0,e.resetDrawCommands())}function tat(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function nat(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&&wbe(e)}function wbe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=hm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function iat(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 rat(e,t){e._silhouetteDirty&&(Obe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function oat(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function sat(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 Ibe(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 aat(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)&&(Nc.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 cat=new ie;function Pbe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function lat(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function uat(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,cat);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 Pbe(e);let r=lat(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function fat(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function dat(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function hat(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 mat(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function pat(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function rQ(e,t){if(!l(e)||!l(t))return N.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function gat(e,t){pat(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=rQ(e.modelMatrix,e._modelMatrix))}var CA=new h,tQ=new he,_at=new he,yat=200,Sbe=30;function Aat(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=Sbe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;CA.x=r[12],CA.y=r[13],CA.z=r[14];let o=i.cartesianToCartographic(CA,_at);l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Sbe,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+yat,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Nat(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,tQ),tQ.height=m,Rbe(e,i,o,tQ)):rQ(r,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function bat(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Dbe(e,n),xat(e,n,t)}function Dbe(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=ue.transform(e._boundingSphere,t,e._boundingSphere)}function xat(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,CA),e._sceneMode!==re.SCENE3D&&fr.computeActualEllipsoidPosition(n,CA,CA);let s=e._boundingSphere.radius,a=Pat(CA,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 Tat(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 Eat=new $(1,0,0,0,0,1,0,-1,0);function Cat(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=Xst,s=Yst;if(s=N.multiply(r.uniformState.view3D,i,s),o=N.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(Eat,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=N.multiply(i,e._clippingPlanes.modelMatrix,Kst);e._clippingPlanesMatrix=N.inverseTranspose(a,e._clippingPlanesMatrix)}}function vat(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 Sat(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 wat(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Iat(e,t){let n=Fat(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!wat(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Bat(e,t),e._sceneGraph.pushDrawCommands(t))}var nQ=new ue;function Pat(e,t,n){return nQ.center=e,nQ.radius=t,n.camera.getPixelSize(nQ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var GH=new h,Dat=new h,WH=new h,Rat=new h,Oat=new N;function Mat(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,Rat),a=N.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Oat),c=e.scale,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,Dat);h.multiplyByScalar(p,c,p),N.multiplyByPoint(a,p,WH),N.multiplyByPointAsVector(u,WH,WH);let g=h.dot(WH,s);g<f&&(f=g)}return-f}function Rbe(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Mat(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else Uy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,GH);let r=e._clampedModelMatrix;rQ(e.modelMatrix,r),r[12]=GH.x,r[13]=GH.y,r[14]=GH.z,e._heightDirty=!0}function Nat(e,t,n){return function(i){Rbe(e,t,n,i)}}var Lat=new h;function Fat(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,Lat);fr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Bat(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}Tr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Tr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Obe(e){return e.context.stencilBuffer}Tr.prototype.hasSilhouette=function(e){return Obe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Tr.prototype.hasSkipLevelOfDetail=function(e){if(!Wo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Tr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Tr.prototype.pick=function(e,t,n,i,r){return XS(this,e,t,n,i,r)};Tr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Tr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Tr.prototype.isDestroyed=function(){return!1};Tr.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(),Pbe(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)&&Nc.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,le(this)};Tr.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};Tr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Tr.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 Uf(n),a=l(e.content)?Wo.TILE_GLTF:Wo.GLTF,c=n.gltfResource,u=cB(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 Tr(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};Tr.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 $N(t);try{await n.load();let i=cB(n,Wo.TILE_B3DM,e);return new Tr(i)}catch(i){throw n.destroy(),i}};Tr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new rB(t);try{await n.load();let i=cB(n,Wo.TILE_PNTS,e);return new Tr(i)}catch(i){throw n.destroy(),i}};Tr.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 QN(t);try{await n.load();let i=cB(n,Wo.TILE_I3DM,e);return new Tr(i)}catch(i){throw n.destroy(),i}};Tr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new JN(t),i=cB(n,Wo.TILE_GEOJSON,e);return new Tr(i)};var kat=new z;Tr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,kat),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,iQ(t,this._color)&&this.resetDrawCommands()};Tr.prototype.applyStyle=function(e){let t=this.type===Wo.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),wbe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function cB(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 jf=Tr;var oQ=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:Hu.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=lB(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await jf.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=lB(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await jf.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=lB(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await jf.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=lB(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await jf.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=lB(t,n,o,{geoJson:r,resource:i}),c=await jf.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 lB(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 Hf=oQ;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,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 le(this)}},uB=sQ;function Uat(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 dT=Uat;var zat=new he,gm=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),KS(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),KS(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,KS(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),KS(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,KS(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,zat);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&&KS(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 ra.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(gm,"defaultColor",z.WHITE),ut(gm,"defaultPointOutlineColor",z.BLACK),ut(gm,"defaultPointOutlineWidth",0),ut(gm,"defaultPointSize",8);function KS(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??gm.defaultColor,i=e._pointOutlineColor??gm.defaultPointOutlineColor,r=e._pointOutlineWidth??gm.defaultPointOutlineWidth,o=e._pointSize??gm.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,dT(f,d,p,r,o))}var Xg=gm;function Vat(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 hT;function jat(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(hT)||(l(f.imageSmoothingEnabled)?hT="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?hT="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?hT="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(hT="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[hT]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Vat(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[hT]=!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 mT=jat;var Wbe=Qo(Fbe(),1);var Bbe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Bbe);var yo=Bbe;var kbe={},Ube=0,Gat=256,Wat=new z(.165,.165,.165,.8),qat=new U(7,5),sa=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function pT(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function dB(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function hB(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Vbe(e){let t=kbe[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(hB(n,"line-height"));isNaN(i)&&(i=void 0),t={family:hB(n,"font-family"),size:hB(n,"font-size").replace("px",""),style:hB(n,"font-style"),weight:hB(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Ube<Gat&&(kbe[e._font]=t,Ube++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function _m(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??Wat),this._backgroundPadding=U.clone(e.backgroundPadding??qat),this._style=e.style??yo.FILL,this._verticalOrigin=e.verticalOrigin??Hn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??ji.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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,Vbe(this),this._updateClamping()}Object.defineProperties(_m.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(!eX(t,e)){_x(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),dB(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=_m.filterUnsupportedCharacters(e);this._renderedText=_m.enableRightToLeftDetection?Zat(t):t,pT(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,pT(this),Vbe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),pT(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),pT(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,pT(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,pT(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),dB(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,pT(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,dB(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),dB(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),dB(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=_x(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}}});_m.prototype._updateClamping=function(){Lr._updateClamping(this._labelCollection,this)};_m.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Lr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};_m.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===Hn.BOTTOM||e.verticalOrigin===Hn.BASELINE?r-=s:e.verticalOrigin===Hn.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===Hn.BOTTOM||e.verticalOrigin===Hn.BASELINE?b-=T:e.verticalOrigin===Hn.CENTER&&(b-=T*.5),e._verticalOrigin===Hn.TOP?b+=ka.PADDING*a:(e._verticalOrigin===Hn.BOTTOM||e._verticalOrigin===Hn.BASELINE)&&(b-=ka.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};_m.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};_m.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};_m.prototype.isDestroyed=function(){return!1};_m.enableRightToLeftDetection=!1;function Yat(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=sa.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=sa.RTL:n.test(f)?a=sa.LTR:i.test(f)?a=sa.BRACKETS:a=sa.WEAK,u===0&&(s=a),s===a&&a!==sa.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function Xat(e){return e.split("").reverse().join("")}function mB(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Kat(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var $at="\u05D0-\u05EA",Jat="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",zbe=new RegExp(`[${$at}${Jat}]`);function Zat(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=zbe.test(r.charAt(0)),s=Yat(r,zbe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===sa.BRACKETS?Kat(f.Word):Xat(f.Word);o?f.Type===sa.RTL?(c=d+c,a=0):f.Type===sa.LTR?(c=mB(c,a,f.Word),a+=f.Word.length):(f.Type===sa.WEAK||f.Type===sa.BRACKETS)&&(f.Type===sa.WEAK&&s[u-1].Type===sa.BRACKETS?c=d+c:s[u-1].Type===sa.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===sa.RTL?(c=d+c,a=0):(c=mB(c,a,f.Word),a+=f.Word.length):c=mB(c,0,d)):f.Type===sa.RTL?c=mB(c,a,d):f.Type===sa.LTR?(c+=f.Word,a=c.length):(f.Type===sa.WEAK||f.Type===sa.BRACKETS)&&(u>0&&s[u-1].Type===sa.RTL?s.length>u+1?s[u+1].Type===sa.RTL?c=mB(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 vA=_m;var qbe=Qo(jbe(),1);function ect(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var tct=1.2,Hbe="ID_WHITE_PIXEL",aQ=new U(4,4),nct=new et(1,1,1,1);function ict(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=aQ.x,r.height=aQ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(Hbe,r),n.addImageSubRegion(Hbe,nct)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var Kg={};function rct(e,t,n,i,r,o){return Kg.font=t,Kg.fillColor=n,Kg.strokeColor=i,Kg.strokeWidth=r,Kg.padding=ka.PADDING,Kg.fill=o===yo.FILL||o===yo.FILL_AND_OUTLINE,Kg.stroke=o===yo.OUTLINE||o===yo.FILL_AND_OUTLINE,Kg.backgroundColor=z.BLACK,mT(e,Kg)}function cQ(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 oct=new qbe.default,sct=/\s/;function act(e,t){let n=t._renderedText,i=oct.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/ka.FONT_SIZE,r<s)for(let p=r;p<s;++p)cQ(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=ict(c,e),t._backgroundBillboard=a),cct(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 pg(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${ka.FONT_SIZE}px ${t._fontFamily}`,S=rct(g,v,z.WHITE,z.WHITE,0,yo.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!sct.test(g)){let I=(0,Wbe.default)(S,{cutoff:ka.CUTOFF,radius:ka.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 ect,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){cQ(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=ji.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===yo.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===yo.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===yo.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function cct(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=ji.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 Gbe(e,t,n){return t===ji.CENTER?-e/2:t===ji.RIGHT?-(e+n.x):n.x}var qo=new U,lct=new U;function uct(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,lct);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=Gbe(b,m,d),T=(l(e._lineHeight)?e._lineHeight:tct*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),qo.x=x*g,qo.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=Gbe(b,m,d),qo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Hn.TOP?(qo.y=_.height-a-d.y,qo.y+=ka.PADDING):y===Hn.CENTER?qo.y=(E+_.height-a)/2:y===Hn.BASELINE?(qo.y=E,qo.y-=ka.PADDING):(qo.y=E+s+d.y,qo.y-=ka.PADDING),qo.y=(qo.y-_.descent-R)*g,I&&(qo.x-=ka.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(qo),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,As(e.heightReference)&&(L.billboard._labelTranslate=U.clone(qo,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];qo.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` -`).join("").length>0&&(m===ji.CENTER?x=-r/2-d.x:m===ji.RIGHT?x=-(r+d.x*2):x=0,qo.x=x*g,y===Hn.TOP?qo.y=p-a-s:y===Hn.CENTER?qo.y=(p-a)/2-s:y===Hn.BASELINE?qo.y=-d.y-s:qo.y=0,qo.y=qo.y*g,f.width=v,f.height=S,f._setTranslate(qo),f._labelTranslate=U.clone(qo,f._labelTranslate))}function Ybe(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)cQ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function n0(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Df({scene:this._scene,textureAtlas:new Ax({initialSize:aQ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new pg(t),this._glyphBillboardCollection=new Df({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??Li.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(n0.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}}});n0.prototype.add=function(e){let t=new vA(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};n0.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),Ybe(this,e),!0}return!1};n0.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Ybe(this,e[t]);e.length=0};n0.prototype.contains=function(e){return l(e)&&e._labelCollection===this};n0.prototype.get=function(e){return this._labels[e]};n0.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&&(act(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(uct(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?Li.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)};n0.prototype.isDestroyed=function(){return!1};n0.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var i0=n0;var gT=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif -in vec2 v_st; -void main() -{ -czm_materialInput materialInput; -vec2 st = v_st; -st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); -materialInput.s = st.s; -materialInput.st = st; -materialInput.str = vec3(st, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE -out_FragColor *= u_highlightColor; +ix.distanceToDepthBuffer = entry; +#if defined(DEPTH_TEST) +setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); #endif -czm_writeLogDepth(); -} -`;var pB=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; -void main() -{ -float texCoord = texCoordExpandAndBatchIndex.x; -float expandDir = texCoordExpandAndBatchIndex.y; -bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; -float batchTableIndex = texCoordExpandAndBatchIndex.w; -vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); -float width = widthAndShow.x + 0.5; -float show = widthAndShow.y; -if (width < 1.0) -{ -show = 0.0; } -vec4 pickColor = batchTable_getPickColor(batchTableIndex); -vec4 p, prev, next; -if (czm_morphTime == 1.0) -{ -p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); -prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); -next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); +`;var hz=`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); } -else if (czm_morphTime == 0.0) -{ -p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); -next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); +#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; } -else -{ -p = czm_columbusViewMorph( -czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), -czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), -czm_morphTime); -prev = czm_columbusViewMorph( -czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), -czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), -czm_morphTime); -next = czm_columbusViewMorph( -czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), -czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), -czm_morphTime); } -#ifdef DISTANCE_DISPLAY_CONDITION -vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); -vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); -vec3 centerLow = centerLowAndRadius.xyz; -float radius = centerLowAndRadius.w; -vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; +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; } -else -{ -vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); -lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); } -float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; -float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; -if (lengthSq < nearSq || lengthSq > farSq) -{ -show = 0.0; +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 -float polylineAngle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); -gl_Position = czm_viewportOrthographic * positionWC * show; -v_st.s = texCoord; -v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); -v_width = width; -v_pickColor = pickColor; -v_polylineAngle = polylineAngle; } -`;var gB=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; +#endif +`;var xP=`vec4 transformNormalToEC(in vec4 intersection) { +return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } -`;var _B=`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; +RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { +return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit)); } -`;var yB=`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; +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 AB=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) { -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; +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); } -`;var bB=`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 } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) { -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; +intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false)); +intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true)); } -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; +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; } -int idxMid = (idxBelow + idxAbove) / 2; -float heightTex = getHeight(idxMid, invTexSize); -if (height > heightTex) { -idxBelow = idxMid; -heightBelow = heightTex; +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 { -idxAbove = idxMid; -heightAbove = heightTex; +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; } } -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) +RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) { -color.rgb /= color.a; +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)); } -color.rgb = czm_gammaCorrect(color.rgb); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; } -`;var xB=`uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float distanceToContour = mod(materialInput.height, spacing); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float dxc = abs(dFdx(materialInput.height)); -float dyc = abs(dFdy(materialInput.height)); -float dF = max(dxc, dyc) * czm_pixelRatio * width; -float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else -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 mz=`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 TB=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); -vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; } -`;var EB=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; -float getTime(float t, float coord) -{ -float scalar = 1.0 / maximumDistance; -float q = distance(t, coord) * scalar; -if (repeat) -{ -float r = distance(t, coord + 1.0) * scalar; -float s = distance(t, coord - 1.0) * scalar; -q = min(min(r, s), q); +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -return clamp(q, 0.0, 1.0); } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) { -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; +RayShapeIntersection intersection = intersectBoundPlanes(rayEC); +setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var CB=`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)); +`;var pz=`uniform vec2 u_cylinderRenderRadiusMinMax; +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) +uniform vec2 u_cylinderRenderAngleMinMax; #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; +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 vB=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 textureValue = texture(image, fract(repeat * materialInput.st)); -vec3 normalTangentSpace = textureValue.channels; -normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; -normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); -normalTangentSpace = normalize(normalTangentSpace); -vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; -material.normal = normalEC; -return material; } -`;var SB=`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; +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -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 -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); } -else -{ -float d1 = czm_infinity; -if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) { -d1 = abs(st.s - base); -} -float d2 = abs(st.t - ptOnUpperLine); -float d3 = abs(st.t - ptOnLowerLine); -dist = min(min(d1, d2), d3); +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); } -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; +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); } -`;var wB=`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 -); +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); } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { -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; +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 gz=`#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); } -fragColor = czm_gammaCorrect(fragColor); -material.emission = fragColor.rgb; -material.alpha = fragColor.a; -return material; } -`;var IB=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; -czm_material czm_getMaterial(czm_materialInput materialInput) +RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex) { -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 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); } -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; +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)); } -`;var PB=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) +vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle) { -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; +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 DB=`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; +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 RB=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; +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); } -`;var OB=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -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; +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; } -`;var MB=`uniform vec4 waterColor; -uniform vec4 landColor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); -outColor = czm_gammaCorrect(outColor); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; +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; } -`;var NB=`uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float time = czm_frameNumber * animationSpeed; -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; +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; } -`;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??$n.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,fct(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($be(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function $be(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];$be(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 rs({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 le(this)};function fct(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:Jn(),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}pct(t),_ct(t),xct(t),Ect(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 lQ(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 Xbe(e,t){}function dct(e,t){}var hct=["type","materials","uniforms","components","source"],mct=["diffuse","specular","shininess","normal","emission","alpha"];function pct(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;lQ(t,hct,Xbe,!0),lQ(r,mct,Xbe,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);lQ(n,o,dct,!1)}function gct(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 _ct(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&gct(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 Kbe={mat2:Xi,mat3:$,mat4:N},yct=/\.ktx2$/i;function Act(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}Jbe(n,e)}}}function Jbe(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 yct.test(r.url)?a=Ou(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 bct(e){return function(t,n){let i=t.uniforms[e];if(i instanceof rs){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),Zbe(t,e)}}function Zbe(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 xct(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Qbe(e,n)}function Qbe(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=Tct(r),s;if(o==="channels")s=LB(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;Cct(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Qbe(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=LB(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Act(t)),e._initializationPromises.push(Jbe(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(bct(t)),e._initializationPromises.push(Zbe(e,t));else if(o.indexOf("mat")!==-1){let u=new Kbe[o];e._uniforms[c]=function(){return Kbe[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Tct(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 Ect(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++}`;LB(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=LB(e,i,a)}}function LB(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 Cct(e,t,n){return LB(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:_B},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:vB},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:CB},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:OB},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:yB},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:AB},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:NB},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:DB},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:EB},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:SB},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:wB},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:IB},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:PB},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:xB},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:TB},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:RB},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:gB},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:bB},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:MB,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var rr=it;var nu={};nu.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};nu.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 vct=new he;nu.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,vct).height}return i};var Sct=new N,wct=new h,exe=new h,Ict=new sn(h.UNIT_X,0),txe=new h,Pct=new sn(h.UNIT_X,0),Dct=new h,Rct=new h,fQ=[];function ixe(e,t,n){let i=fQ;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 XH=new he,YH=new he,SA=new h,dQ=new h,Oct=new h,uQ=new vg,FB=new Rc;function Mct(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,dQ),u=i.scaleToGeodeticSurface(t,Oct),f=nu.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,XH),p=i.cartesianToCartographic(u,YH),g=ixe(f,r,o);uQ.setEndPoints(d,p);let m=uQ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,SA);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=uQ.interpolateUsingSurfaceDistance(b*m,YH);x.height=g[b],A=i.cartographicToCartesian(x,SA),h.pack(A,s,y),y+=3}return y}function Nct(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,XH),u=i.cartesianToCartographic(t,YH),f=nu.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=ixe(f,r,o);FB.ellipsoid.equals(i)||(FB=new Rc(void 0,void 0,i)),FB.setEndPoints(c,u);let p=FB.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,SA);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=FB.interpolateUsingSurfaceDistance(y*p,YH);A.height=d[y],m=i.cartographicToCartesian(A,SA),h.pack(m,s,g),g+=3}return g}nu.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??N.IDENTITY;let r=N.inverseTransformation(t,Sct),o=N.multiplyByPoint(r,h.ZERO,wct),s=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_Y,exe),exe),a=sn.fromPointNormal(o,s,Ict),c=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_X,txe),txe),u=sn.fromPointNormal(o,c,Pct),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=yi.lineSegmentPlane(d,m,a,Dct);if(l(y)){let A=h.multiplyByScalar(s,5e-9,Rct);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}};nu.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],dQ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,SA);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+=nu.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=Mct(y,A,s,i,b,x,f,d)}fQ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,XH);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,SA);return h.pack(m,f,u-3),f};var nxe=new he,Lct=new he;nu.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],dQ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,SA);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],nxe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],Lct),a+=nu.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,nxe);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=Nct(b,x,s,i,T,E,p,g)}fQ.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,XH);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,SA);return h.pack(A,p,d-3),p};nu.generateCartesianArc=function(e){let t=nu.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};nu.generateCartesianRhumbArc=function(e){let t=nu.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 or=nu;function Gf(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=rr.fromType(rr.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Br(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=or.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(oxe),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 rxe=Gf.POSITION_INDEX=0,Fct=Gf.SHOW_INDEX=1,Bct=Gf.WIDTH_INDEX=2,kct=Gf.MATERIAL_INDEX=3,BB=Gf.POSITION_SIZE_INDEX=4,Uct=Gf.DISTANCE_DISPLAY_CONDITION=5,oxe=Gf.NUMBER_OF_PROPERTIES=6;function $g(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Gf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,$g(this,Fct))}},positions:{get:function(){return this._positions},set:function(e){let t=Br(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)&&$g(this,BB),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),$g(this,rxe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,$g(this,kct))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,$g(this,Bct))}},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,$g(this,BB)}}},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),$g(this,Uct))}}});Gf.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[rxe]>0||this._propertiesChanged[BB]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=or.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)$g(this,BB);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){$g(this,BB);break}}};Gf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Gf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<oxe-1;++t)e[t]=0};Gf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Kd=Gf;var zct=Kd.SHOW_INDEX,Vct=Kd.WIDTH_INDEX,mQ=Kd.POSITION_INDEX,jct=Kd.MATERIAL_INDEX,sxe=Kd.POSITION_SIZE_INDEX,Hct=Kd.DISTANCE_DISPLAY_CONDITION,hxe=Kd.NUMBER_OF_PROPERTIES,Ku={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 ym(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(hxe),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(ym.prototype,{length:{get:function(){return pQ(this),this._polylines.length}}});ym.prototype.add=function(e){let t=new Kd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};ym.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};ym.prototype.removeAll=function(){gQ(this),yxe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};ym.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};ym.prototype.get=function(e){return pQ(this),this._polylines[e]};function Gct(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 hx(t,n,e._polylines.length)}var mxe=new Sn,pxe=new se,gxe=new U;ym.prototype.update=function(e){if(pQ(this),this._polylines.length===0||!this.show)return;$ct(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.");Gct(this,t),this._createBatchTable=!1}if(this._createVertexArray||qct(this))lxe(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[sxe]||r[jct])lxe(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[mQ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[zct]||r[Vct])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[mQ]||r[sxe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,mxe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,pxe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[Hct]){let m=gxe;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<hxe;++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;Wct(this,e,c,o)}};var kB=new ue,axe=new ue;function Wct(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=Xct(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=ue.clone(kB,_.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=ue.clone(P._boundingVolume2D,axe),B.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(B=ue.union(P._boundingVolumeWC,P._boundingVolume2D,axe)),c?(c=!1,ue.clone(B,kB)):ue.union(B,kB,kB)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(kB,_.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}ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){return _xe(this),gQ(this),yxe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function qct(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[mQ]?(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 cxe=[0,0,0];function lxe(e,t,n){e._createVertexArray=!1,gQ(e),_xe(e),Kct(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:Ku.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Ku.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ku.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Ku.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ku.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ku.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ku.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ku.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ku.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ku.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ku.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ku.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ku.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=cxe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=cxe,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 Yct(e,t){return t instanceof Dt?t.id:t}var KH=[];function Xct(e){let t=rr._uniformList[e.type],n=t.length;KH.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];KH[i]=o,KH[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(KH,Yct)}`}function Kct(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 r0(c,t,n)),u.addPolyline(a)}}}function $ct(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 pQ(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 gQ(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 _xe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}ym.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function yxe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function hQ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function r0(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}r0.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};r0.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,gT]}),o=t.getVertexShaderCallback()(pB),s=new Ye({defines:i,sources:[Gl,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Ku})};function Axe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}r0.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!Axe(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 Ea=new h,$d=new h,Jd=new h,$H=new h,Jct=new se,Zct=new U;r0.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=$H,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,$d),h.clone(x[V],Ea),V===E-1?g._loop?R=x[1]:(R=$H,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,Jd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&($d.z=0,Ea.z=0,Jd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(Ea.x)<1&&((Ea.x<0&&$d.x>0||Ea.x>0&&$d.x<0)&&h.clone(Ea,$d),(Ea.x<0&&Jd.x>0||Ea.x>0&&Jd.x<0)&&h.clone(Ea,Jd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(Ea,e,n),Sn.writeElements($d,e,n+6),Sn.writeElements(Jd,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=Jct;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=Zct;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,mxe),w=C.high,P=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,pxe),M=gxe;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 Qct=new h,elt=new h,tlt=new h,uxe=new h;r0.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=uxe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,elt);let m=N.multiplyByPoint(n,a[p],Qct),y;p===u-1?s._loop?y=a[1]:(y=uxe,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,tlt);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 nlt=new Array(1);r0.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new hQ(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=nlt;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 hQ(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 hQ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};r0.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 $S={positions:void 0,lengths:void 0},fxe=new Array(1),ilt=new h,rlt=new he;r0.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return fxe[0]=n.length,$S.positions=n,$S.lengths=fxe,$S;Axe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=ilt;for(let u=0;u<s;++u)a=n[u],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,rlt)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return $S.positions=r,$S.lengths=e._segments.lengths,$S};var dxe;r0.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=dxe,c=6*s*3;!l(a)||a.length<c?a=dxe=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=$H,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,$d),h.clone(f[A],Ea),A===s-1?t._loop?y=f[1]:(y=$H,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,Jd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&($d.z=0,Ea.z=0,Jd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(Ea.x)<1&&((Ea.x<0&&$d.x>0||Ea.x>0&&$d.x<0)&&h.clone(Ea,$d),(Ea.x<0&&Jd.x>0||Ea.x>0&&Jd.x<0)&&h.clone(Ea,Jd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(Ea,a,p),Sn.writeElements($d,a,p+6),Sn.writeElements(Jd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Am=ym;function wA(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 Df({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new i0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Am,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(wA.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 olt(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 slt=new Kn("createVectorTilePoints",5),alt=new h;function clt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=olt(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=slt.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,alt),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)})}wA.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 Xg(e,c,u,f,d)}};wA.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 llt(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=Xg.defaultPointSize,s.color=Xg.defaultColor,s.pointOutlineColor=Xg.defaultPointOutlineColor,s.pointOutlineWidth=Xg.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=yo.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=ji.CENTER,s.verticalOrigin=Hn.CENTER,s.labelHorizontalOrigin=ji.RIGHT,s.labelVerticalOrigin=Hn.BASELINE}}var ult=new z,flt=new z,dlt=new z,hlt=new z,mlt=new z,plt=new z,UB=new qt,zB=new qt,_Q=new Ht;wA.prototype.applyStyle=function(e,t){if(!l(e)){llt(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,ult)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,flt)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,dlt)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,hlt)),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,mlt)),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)?(UB.near=a.x,UB.nearValue=a.y,UB.far=a.z,UB.farValue=a.w,s.scaleByDistance=UB):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(zB.near=a.x,zB.nearValue=a.y,zB.far=a.z,zB.farValue=a.w,s.translucencyByDistance=zB):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(_Q.near=a.x,_Q.far=a.y,s.distanceDisplayCondition=_Q):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,plt)),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))}};wA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=clt(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)};wA.prototype.isDestroyed=function(){return!1};wA.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(),le(this)};var VB=wA;function Jg(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=ei.BOTH}Object.defineProperties(Jg.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 glt(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 _lt(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 Wp({color:c,offset:u,count:f,batchIds:p})}}var ylt=new Kn("createVectorTilePolygons",5),Alt=new z;function blt(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,Alt);s[y]=A.toRgba()}a=e._packedBuffer=glt(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=ylt.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];_lt(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),xlt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function xlt(e){l(e._primitive)||(e._primitive=new Nx({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)}Jg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Jg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Jg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Jg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Jg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=blt(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)};Jg.prototype.isDestroyed=function(){return!1};Jg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var jB=Jg;var HB=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; -void main() -{ -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = u_modifiedModelView * currentPosition; -vec4 prev = u_modifiedModelView * previousPosition; -vec4 next = u_modifiedModelView * nextPosition; -float angle; -vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; +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); +} +float tmin = intersect.x; +float tmax = intersect.y; +vec3 p0 = ray.pos + tmin * ray.dir; +vec3 p1 = ray.pos + tmax * ray.dir; +vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); +vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); +bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); +bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); +if (p0InShadowCone && p1InShadowCone) { +return RayShapeIntersection(miss, miss); +} else if (p0InShadowCone) { +return RayShapeIntersection(intersect1, farSide); +} else if (p1InShadowCone) { +return RayShapeIntersection(-1.0 * farSide, intersect0); +} else { +return RayShapeIntersection(intersect0, intersect1); +} +} +void intersectShape(in Ray ray, 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; } -`;function bm(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(bm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Tlt(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 Elt=new Kn("createVectorTilePolylines",5),JS={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Clt(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=Tlt(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=Elt.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),vlt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function vlt(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:JS.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:JS.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:JS.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:JS.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:JS.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 GB=new N,bxe=new h;function Slt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,GB),N.multiplyByPoint(GB,e._center,bxe),N.setTranslation(GB,bxe,GB),GB},u_highlightColor:function(){return e._highlightColor}})}function wlt(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 Ilt=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; +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); } -`;function Plt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(HB),r=n.getFragmentShaderCallback(!1,void 0,!1)(Ilt),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Gl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:JS})}function Dlt(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)}bm.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};bm.prototype.getPositions=function(e){return bm.getPolylinePositions(this,e)};bm.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 ra(e,o)}};bm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Rlt(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 Olt=new z,Mlt=z.WHITE,Nlt=!0;bm.prototype.applyStyle=function(e,t){if(!l(e)){Rlt(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,Olt):Mlt,s.show=l(e.show)?e.show.evaluate(s):Nlt}};bm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Clt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Slt(this,t),Plt(this,t),wlt(this);let n=e.passes;(n.render||n.pick)&&Dlt(this,e)};bm.prototype.isDestroyed=function(){return!1};bm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var _T=bm;var xxe=new h,Txe=new h,Exe=new he,yQ=new h,Llt=new h,Cxe=new ue,Flt=new Qi,WB=[new he,new he,new he,new he],qB=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=vxe(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,Exe),xxe),t.cartographicToCartesian(ie.southwest(e,Exe),Txe),h.midpoint(Txe,xxe,yQ);let a=t.scaleToGeodeticSurface(yQ,Llt);if(l(a)){let c=h.distance(yQ,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=vxe(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=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,Cxe),ue.union(r,Cxe,r)};function vxe(e){he.fromRadians(e.east,e.north,0,WB[0]),he.fromRadians(e.west,e.north,0,WB[1]),he.fromRadians(e.east,e.south,0,WB[2]),he.fromRadians(e.west,e.south,0,WB[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=WB[c];if(Flt.positionToTileXY(u,s,qB),c===0)i=qB.x,r=qB.y;else if(i!==qB.x||r!==qB.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;var YB=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; -void main() -{ -float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); -float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); -vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; -vec3 right = normalize(cross(forward, startEllipsoidNormal)); -vec4 position = vec4(startPositionAndHeight.xyz, 1.0); -position.xyz += forward * isEnd; -v_volumeUpEC = czm_normal * normalize(cross(right, forward)); -float offset; -vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); -offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); -offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; -position.xyz += offset * ellipsoidNormal; -position = u_modifiedModelView * position; -right = czm_normal * right; -vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); -scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); -vec3 miterPushNormal = czm_normal * normalize(scratchNormal); -offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); -offset = offset / dot(miterPushNormal, right); -position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); -gl_Position = czm_depthClamp(czm_projection * position); -position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); -vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; -v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); -v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); -position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); -vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; -v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); -v_halfWidth = endFaceNormalAndHalfWidth.w; +#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 XB=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; -uniform vec4 u_highlightColor; -void main() -{ -float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME +`;var hC=`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; } -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -eyeCoordinate /= eyeCoordinate.w; -float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); -halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); -float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); -float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); -float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); -if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME +#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; } -out_FragColor = u_highlightColor; -czm_writeDepthClamp(); } -`;function Zg(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(Zg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Blt(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 klt(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 Ult=new Kn("createVectorTileClampedPolylines"),IA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function zlt(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=klt(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=Ult.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),Vlt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Vlt(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:IA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:IA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:IA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:IA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:IA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:IA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:IA.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 KB=new N,Sxe=new h;function jlt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,KB),N.multiplyByPoint(KB,e._center,Sxe),N.setTranslation(KB,Sxe,KB),KB},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function wxe(e){return Ge.fromCache({cull:{enabled:!0,face:Ui.FRONT},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function Hlt(e){l(e._rs)||(e._rs=wxe(!1),e._rs3DTiles=wxe(!0))}function Glt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(YB),r=n.getFragmentShaderCallback(!1,void 0,!0)(XB),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Gl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:IA})}function Wlt(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===ei.TERRAIN||i===ei.BOTH)&&t.commandList.push(n),(i===ei.CESIUM_3D_TILE||i===ei.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Zg.prototype.getPositions=function(e){return _T.getPolylinePositions(this,e)};Zg.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 ra(e,o)}};Zg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function qlt(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 Ylt=new z,Xlt=z.WHITE,Klt=!0;Zg.prototype.applyStyle=function(e,t){if(!l(e)){qlt(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,Ylt):Xlt,s.show=l(e.show)?e.show.evaluate(s):Klt}};function $lt(e){return Ni.initialize().then(function(){Blt(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Zg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=$lt(this).then(zlt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}jlt(this,t),Glt(this,t),Hlt(this);let n=e.passes;(n.render||n.pick)&&Wlt(this,e)};Zg.prototype.isDestroyed=function(){return!1};Zg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var $B=Zg;var AQ=32767,Jlt=new he,Zlt=new h;function Qlt(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/AQ),y=D.lerp(t.south,t.north,p/AQ),A=D.lerp(n,i,g/AQ),b=he.fromRadians(m,y,A,Jlt),x=r.cartographicToCartesian(b,Zlt);h.pack(x,u,f*3)}return u}var JB=Qlt;var xQ=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,rut(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)||bQ(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)||bQ(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)||bQ(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(),le(this)}};function eut(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function tut(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 xm=Uint32Array.BYTES_PER_ELEMENT;function nut(e){return new _T(e)}function iut(e){return new $B(e)}function rut(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=xm;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=xm;let s=r.getUint32(n,!0);if(n+=xm,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=xm,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=xm;let u=r.getUint32(n,!0);n+=xm;let f=r.getUint32(n,!0);n+=xm;let d=r.getUint32(n,!0);n+=xm;let p=r.getUint32(n,!0);n+=xm;let g=r.getUint32(n,!0);n+=xm,n+=xm;let m=Do(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Do(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 Wh(e,v,A,b,eut(e));if(e._batchTable=S,v===0)return;let I=new fm(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=tut(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 jB({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=JB(new Uint16Array(j),O,L,_,ee.WGS84);out(q,F,P.polylines,S,e.url,k)}let G=nut;l(M.classificationType)&&(G=iut),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 VB({positions:F,batchIds:P.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:M.heightReference,scene:M.scene})}}function bQ(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 out(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 ZB=xQ;function ZS(e,t){this._conditionsExpression=Je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,aut(this,t)}Object.defineProperties(ZS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function sut(e,t){this.condition=e,this.expression=t}function aut(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 sut(new Fd(a,t),new Fd(c,t)))}e._runtimeConditions=n}ZS.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)}};ZS.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)}};ZS.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); +#else +intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +return intersection; } -`,o};ZS.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];Qn(e,r.condition.getVariables()),Qn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var QB=ZS;function PA(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,cut(this,e)}function cut(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 Fd(r[o],i))}e._meta=n,e._ready=!0}function Ao(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Fd(String(t));if(typeof t=="string")return new Fd(t,n);if(l(t.conditions))return new QB(t,n)}else return;return t}function bo(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(PA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=Ao(this,e),this._style.show=bo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Ao(this,e),this._style.color=bo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Ao(this,e),this._style.pointSize=bo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Ao(this,e),this._style.pointOutlineColor=bo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Ao(this,e),this._style.pointOutlineWidth=bo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Ao(this,e),this._style.labelColor=bo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Ao(this,e),this._style.labelOutlineColor=bo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Ao(this,e),this._style.labelOutlineWidth=bo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Ao(this,e),this._style.font=bo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Ao(this,e),this._style.labelStyle=bo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Ao(this,e),this._style.labelText=bo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Ao(this,e),this._style.backgroundColor=bo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Ao(this,e),this._style.backgroundPadding=bo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Ao(this,e),this._style.backgroundEnabled=bo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Ao(this,e),this._style.scaleByDistance=bo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Ao(this,e),this._style.translucencyByDistance=bo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Ao(this,e),this._style.distanceDisplayCondition=bo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Ao(this,e),this._style.heightOffset=bo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Ao(this,e),this._style.anchorLineEnabled=bo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Ao(this,e),this._style.anchorLineColor=bo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Ao(this,e),this._style.image=bo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Ao(this,e),this._style.disableDepthTestDistance=bo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Ao(this,e),this._style.horizontalOrigin=bo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Ao(this,e),this._style.verticalOrigin=bo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Ao(this,e),this._style.labelHorizontalOrigin=bo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Ao(this,e),this._style.labelVerticalOrigin=bo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=Ao(this,e),this._style.lineWidth=bo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});PA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new PA(n)})};PA.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)};PA.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)};PA.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)};PA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Qn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Qn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Qn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Qg=PA;var Dxe=new ie,Ixe=new ie,TQ=new ie,JH=new Map;JH.set(il,{packCollectionData:Ss.packPolylineCollectionData,packTilePrimitives:Ss.packPolylineSegments});JH.set(Ua,{packCollectionData:Ss.packPolygonCollectionData,packTilePrimitives:Ss.packPolygonRings});var EQ=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 JH.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,Dxe);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:lut(t,r.ellipsoid)};for(let[u,f]of o){if(!Pxe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,Ixe);if(!!!ie.intersection(t,d,TQ))continue;let g=JH.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&&(Ss.packPolylineGrid(s),Ss.packPolylineTextures(n,s)),c&&(Ss.packPolygonGrid(s),Ss.packPolygonTextures(n,s)),Ss.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ss.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return uut(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(!Pxe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,Ixe),f=!!ie.intersection(n,u,TQ),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 Pxe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function lut(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 uut(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,Dxe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],TQ))return!0;return!1}var e_=EQ;var Rxe=new Dc,Oxe=new Aa,Mxe=new Oo,fut=new Kh,dut=new Of,hut=new Rf,CQ=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 ra.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(ku,Rxe),yield*this._iteratePrimitivesWith(il,Oxe),yield*this._iteratePrimitivesWith(Ua,Mxe)}*_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(ku,Rxe,fut)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(il,Oxe,dut)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Ua,Mxe,hut)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},yT=CQ;var Nxe=new h,mut=new Dc,put=new Aa,Fxe=new Oo;function gut(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)Bxe(e,n[r],N.IDENTITY,i);return i}function ZH(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function _ut(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?xa.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:Lxe(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=Lxe(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 Lxe(e){let t=ZH(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function yut(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?xa.readAttributeAsRawCompactTypedArray(o):xa.readAttributeAsTypedArray(o)),a=t.indices?xa.readIndicesAsTypedArray(t.indices):void 0,c=Aut(e,t,r);n instanceof ku?but(n,i,s,a,c):n instanceof il?xut(n,i,s,a,c):n instanceof Ua&&(l(t.vector)?Tut(n,i,s,a,c,t.vector):Eut(n,i,s,c,t.polygon))}function Aut(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof Tn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??xa.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new yT(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function but(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,Nxe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:Nxe,pickObject:u,featureId:u?.featureId},mut)}}function xut(e,t,n,i,r){let o=ZH(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=kxe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},put),s=u+1,a=0,c++}}function Tut(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},Fxe)}}function Eut(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=ZH(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=kxe(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},Fxe)}}function Bxe(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=_ut(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new ku({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new il({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new Ua({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),yut(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)Bxe(e,a[c],o,i)}function kxe(e,t,n,i){let r=ZH(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 e2=gut;var QH=new Dc,eG=new Aa,tG=new Oo,t2=new Kh,vQ=new Of,Uxe=new Rf,zxe=new N,SQ=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 ku).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Ua?t+n.triangleCount:n instanceof il?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 Qg({color:i}))}applyStyle(t){let n=o=>o instanceof ku,i=o=>o instanceof il,r=o=>o instanceof Ua;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,QH);let u=this.getFeature(QH.featureId,s);l(t.show)&&(QH.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,t2.color),l(t.pointSize)&&(t2.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(t2.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,t2.outlineColor),QH.setMaterial(t2)}}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,eG);let u=this.getFeature(eG.featureId,s);l(t.show)&&(eG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,vQ.color),l(t.lineWidth)&&(vQ.width=t.lineWidth.evaluate(u)),eG.setMaterial(vQ)}}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,tG);let u=this.getFeature(tG.featureId,s);l(t.show)&&(tG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Uxe.color),tG.setMaterial(Uxe)}}}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&&(vut(this),this._ready=!0)}N.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,zxe);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(zxe,this._collectionLocalMatrices[s],a.modelMatrix),!As(i._heightReference)||!e_.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,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=Cut(t,n,o,r),a=await jf.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function Cut(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 vut(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=e2(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var DA=SQ;function fc(){}fc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);fc._sorterTaskProcessor=void 0;fc._taskProcessorReady=!1;fc._error=void 0;fc._getSorterTaskProcessor=function(){if(!l(fc._sorterTaskProcessor)){let e=new Kn("gaussianSplatSorter",fc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?fc._taskProcessorReady=!0:fc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{fc._error=t}),fc._sorterTaskProcessor=e}return fc._sorterTaskProcessor};fc.radixSortIndexes=function(e){let t=fc._getSorterTaskProcessor();if(l(fc._error))throw fc._error;if(fc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var AT=fc;function dc(){}dc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);dc._textureTaskProcessor=void 0;dc._taskProcessorReady=!1;dc._error=void 0;dc._getTextureTaskProcessor=function(){if(!l(dc._textureTaskProcessor)){let e=new Kn("gaussianSplatTextureGenerator",dc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?dc._taskProcessorReady=!0:dc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{dc._error=t}),dc._textureTaskProcessor=e}return dc._textureTaskProcessor};dc.generateFromAttributes=function(e){let t=dc._getTextureTaskProcessor();if(l(dc._error))throw dc._error;if(!dc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var n2=dc;function Sut(e){let t=new Cg;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.alphaOptions=new lT,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var i2=Sut;var r2=`#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; +`;var _z=`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); } -vec3 halfToVec3(uvec2 packed) { -return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +return shapeUv / u_boxLocalToShapeUvScale; } -vec3 loadAndExpandSHCoeff(uint splatID, int index) { -uvec2 coeff = loadSHCoeff(splatID, index); -return halfToVec3(coeff); +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 dPosition = u_boxEcToXyz * positionEC; +return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w); } -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; +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 yz=`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); } +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); } -return result; +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 -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) -); +dy *= u_cylinderLocalToShapeUvScale.y; +float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); } -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; +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); } -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; +#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); } -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; +`;var Az=`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 -v_splitDirection = u_splitDirection; +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 o2=`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; +return vec3(v * sign(pos), length(v - evolute)); } -float B = exp(A * 4.) * v_splatColor.a ; -out_FragColor = vec4(v_splatColor.rgb * B , B); +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); } -`;var bT=new N,qxe=new N,s2=new N,vi=new $,a2=new Le,wut=new h,Iut=new Le,Put=new h,Dut=1e-12,nG=1e-5,wQ=1e-7,qa={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},qs={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Rut=2,Out=30,Mut=3,Nut=.008726646259971648,Lut=1;function Fut(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Mut)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Lut?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Nut:!1}function Vxe(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 But(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 jxe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function IQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function Hxe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function kut(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 Uut(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function zut(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=Uut(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 Vut(e,t){return e.length===t?e:e.subarray(0,t)}function jut(e,t,n){if(!l(t.indexes)||t.state!==qs.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&&Hxe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&Hxe(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=qa.IDLE,e._dirty=!1}async function Hut(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=qs.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=Wxe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=Wxe(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=Wut(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=qs.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=qs.BUILDING}}async function Gut(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===qs.SORTING&&(n.snapshot.state=qs.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=qs.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,jut(e,c,t),e._pendingSnapshot=void 0,iu.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===qs.SORTING&&(n.snapshot.state=qs.TEXTURE_READY),e._sorterState=qa.ERROR,e._sorterError=r}}async function Gxe(e,t,n){try{let i=await n,r=jxe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=qa.IDLE);return}e._indexes=i,e._sorterState=qa.SORTED}catch(i){if(!jxe(e,t))return;e._sorterState=qa.ERROR,e._sorterError=i}}function Wut(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 Wxe(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 iu(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=Ho.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(Vi.Y,Vi.X,new N),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=qa.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(iu.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===qs.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});iu.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)};iu.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,IQ(this._pendingSnapshot),IQ(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),le(this)};iu.prototype.isDestroyed=function(){return this._isDestroyed};iu.prototype.onTileLoad=function(e){this._dirty=!0};iu.prototype.onTileVisible=function(e){};iu.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,bT);N.multiplyTransformation(o,e.content.worldTransform,o);let s=N.inverse(r,qxe),a=N.multiplyTransformation(s,o,bT),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&N.equalsEpsilon(a,c,Dut))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)<=wQ&&Math.abs(g-1)<=wQ&&Math.abs(m-1)<=wQ,T=Math.abs(y)<=nG&&Math.abs(A)<=nG&&Math.abs(b)<=nG,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)<=nG;Le.fromRotationMatrix(vi,a2),Le.normalize(a2,a2);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=wut,L=Iut,_=Put;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(a2,L,L),Le.normalize(L,L)):(N.fromTranslationQuaternionRotationScale(O,L,_,s2),N.multiplyTransformation(a,s2,s2),N.getTranslation(s2,O),N.getScale(s2,_),Le.multiply(a2,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};iu.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==qs.BUILDING)return;n.state=qs.TEXTURE_PENDING;let i=n2.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=qs.BUILDING;return}Hut(e,t,n,i)};iu.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new i2(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(r2),r.addFragmentLines(o2);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 Tn.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};iu.prototype.update=function(e){let t=this._tileset;if(kut(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===qa.IDLE){let r=t._selectedTiles.length!==0&&But(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>=Rut,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>=Out;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=qa.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&IQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=N.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,qxe);N.multiplyTransformation(v,E.content.worldTransform??N.IDENTITY,v),N.getRotation(N.inverse(v,v),this._shInverseRotation)}for(let E of u)iu.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=zut(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 Vut(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:qs.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===qs.BUILDING){iu.generateSplatTexture(this,e,u);return}if(u.state===qs.TEXTURE_PENDING||u.state===qs.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,bT),u.state===qs.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=AT.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(bT),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=qs.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=qs.SORTING;let g=this._pendingSort;Gut(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===qs.SORTING&&(u.state=qs.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,bT),!l(this._sorterPromise)){if(!Fut(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=AT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(bT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){Vxe(this,e);let g=this._activeSort;this._sorterState=qa.SORTING,Gxe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=qa.WAITING;return}this._sorterState=qa.SORTING;return}else if(this._sorterState===qa.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=AT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(bT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){Vxe(this,e);let c=this._activeSort;this._sorterState=qa.SORTING,Gxe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=qa.WAITING;return}this._sorterState=qa.SORTING;return}else{if(this._sorterState===qa.SORTING)return;if(this._sorterState===qa.SORTED)iu.buildGSplatDrawCommand(this,e),this._sorterState=qa.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===qa.ERROR)throw this._sorterError}this._dirty=!1}};var c2=iu;var DQ=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 c2({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")&&qr("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:Vi.Y,forwardAxis:Vi.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 Uf(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}=Yut(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Jut(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),le(this)}};function qut(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Yut(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 Yxe=new ArrayBuffer(4),Xut=new Float32Array(Yxe),Kut=new Uint32Array(Yxe);function PQ(e){Xut[0]=e;let t=Kut[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 $ut(e){let t=qut(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 Jut(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}=$ut(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]=PQ(o[u].typedArray[y])|PQ(o[u].typedArray[y+1])<<16,r[m+1]=PQ(o[u].typedArray[y+2])}}return r}var RA=DQ;var Xxe={b3dm:function(e,t,n,i,r){return Hf.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Hf.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Hf.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return HM.fromTileType(e,t,n,i,r,Xxe)},externalTileset:function(e,t,n,i){return uB.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new WM(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new ZB(e,t,n,i,r)},subt:function(e,t,n,i,r){return fS.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return fS.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 RA.tilesetRequiresGaussianSplattingExt(e)?RA.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?DA.fromGltf(e,t,n,c):Hf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return RA.tilesetRequiresGaussianSplattingExt(e)?RA.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?DA.fromGltf(e,t,n,i):Hf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Hf.fromGeoJson(e,t,n,i)}},xT=Xxe;var Kxe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(Kxe);var Or=Kxe;var Zd={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"};Zd.isBinaryFormat=function(e){switch(e){case Zd.BATCHED_3D_MODEL:case Zd.INSTANCED_3D_MODEL:case Zd.COMPOSITE:case Zd.POINT_CLOUD:case Zd.VECTOR:case Zd.GEOMETRY:case Zd.IMPLICIT_SUBTREE:case Zd.VOXEL_BINARY:case Zd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Zd);var Ca=Zd;var $xe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze($xe);var Qd=$xe;var va={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},t_=new Array(va.NUMBER_OF_PASSES);t_[va.RENDER]=Object.freeze({pass:va.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});t_[va.PICK]=Object.freeze({pass:va.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});t_[va.SHADOW]=Object.freeze({pass:va.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});t_[va.PRELOAD]=Object.freeze({pass:va.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});t_[va.PRELOAD_FLIGHT]=Object.freeze({pass:va.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});t_[va.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:va.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});t_[va.MOST_DETAILED_PRELOAD]=Object.freeze({pass:va.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});t_[va.MOST_DETAILED_PICK]=Object.freeze({pass:va.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});va.getPassOptions=function(e){return t_[e]};Object.freeze(va);var so=va;var RQ=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 le(this)}},o0=RQ;function n_(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(n_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});n_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};n_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};n_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};n_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};n_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};n_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};n_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var l2=n_;function OQ(e,t){let n=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){OQ._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 l2({content:n,class:r})}}OQ._oneTimeWarning=_t;var TT=OQ;function Zut(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=ir(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 ET=Zut;function i_(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(i_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});i_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};i_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};i_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};i_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};i_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};i_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};i_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var u2=i_;function MQ(e,t){let n=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){MQ._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 u2({tile:n,class:r})}}MQ._oneTimeWarning=_t;var f2=MQ;function Qut(e){let t=new Uint8Array(e),n=tm(t);if(n==="glTF"&&(n="glb"),Ca.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=eft(t);if(l(i.root))return{contentType:Ca.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ca.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ca.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ca.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ca.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function eft(e){let t;try{t=Do(e)}catch{throw new oe("Invalid tile content.")}return t}var r_=Qut;var NQ=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(!tft(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;LQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=nft(this,i,n,this._tile._contentState);return ift(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 le(this)}};function LQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Jxe(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 tft(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 nft(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){Jxe(e,i);return}return LQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){Jxe(e,i);return}LQ(e,-1),Zxe(e,t,f)}})}async function ift(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>rft(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 rft(e,t,n){if(l(t))try{let i=r_(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===Ca.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ca.GEOMETRY||i.contentType===Ca.VECTOR;let a,c=xT[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=TT(r,u));let f=ET(r,u);return l(f)&&(a.group=new Rx({metadata:f})),a}catch(i){Zxe(e,n,i)}}function Zxe(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 d2=NQ;var Qxe=Math.cos,eTe=Math.sin,oft=Math.sqrt,FQ={};FQ.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=Qxe(f),p=eTe(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Qxe(m),A=d*eTe(m),b=a.x*y,x=a.y*A,T=oft(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 sft=new Xi,eh=new h,aft=new he,iG=new h,h2=new zi;function tTe(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;h2._ellipsoid=ee.default,eh=h2.project(e,eh),eh=h.subtract(eh,iG,eh);let g=Xi.fromRotation(t,sft);eh=Xi.multiplyByVector(g,eh,eh),eh=h.add(eh,iG,eh),e=h2.unproject(eh,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}}FQ.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,aft);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=D.TWO_PI),h2._ellipsoid=ee.default,iG=h2.project(E,iG));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 _=tTe(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=tTe(_,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 Sa=FQ;var cft=new ue,lft=new ue,uft=new h,fft=new ie;function nTe(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=uft;if(o)Sa.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++)Sa.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++)Sa.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--)Sa.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--)Sa.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 En,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function dft(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=nTe(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 ew(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"}ew.packedLength=ie.packedLength+ee.packedLength+5;ew.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 iTe=new ie,rTe=ee.clone(ee.UNIT_SPHERE),QS={rectangle:iTe,ellipsoid:rTe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};ew.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,iTe);t+=ie.packedLength;let r=ee.unpack(e,t,rTe);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):(QS.granularity=o,QS.height=s,QS.rotation=a,QS.extrudedHeight=c,QS.offsetAttribute=u===-1?void 0:u,new ew(QS))};var hft=new he;ew.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Sa.computeOptions(t,e._granularity,e._rotation,0,fft,hft),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=dft(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===gn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===gn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ue.fromRectangle3D(t,n,s,lft),d=ue.fromRectangle3D(t,n,a,cft);o=ue.union(f,d)}else{if(r=nTe(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===gn.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=ue.fromRectangle3D(t,n,s)}return new St({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var CT=ew;var m2=`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); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float longitude = shapeUv.x * czm_twoPi; +#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +longitude /= u_ellipsoidLocalToShapeUvScale.x; #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); +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 p2=`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; +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); } -`;var vT=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); +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); } -`;var g2=`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; +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); } -`;function o_(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?g2:p2,o=i?vT:m2,s=i?o_.FLAT_VERTEX_FORMAT:o_.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=vr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(o_.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}}});o_.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;o_.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;o_.prototype.getFragmentShaderSource=vr.prototype.getFragmentShaderSource;o_.prototype.isTranslucent=vr.prototype.isTranslucent;o_.prototype.getRenderState=vr.prototype.getRenderState;var yn=o_;function mft(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 _2=mft;function y2(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(y2.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});y2.fromCartesian3=function(e){return new y2(e.x,e.y,e.z)};y2.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 Er=y2;function pft(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)&&Gn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function BQ(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 gft(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?BQ(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(BQ(i.westHemisphereGeometry,n),BQ(i.eastHemisphereGeometry,n))}}function _ft(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(pft(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Gn.splitLongitude(t[c]);if(gft(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Gn.reorderForPostVertexCache(g.geometry),Gn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Gn.reorderForPostVertexCache(g.westHemisphereGeometry),Gn.reorderForPreVertexCache(g.westHemisphereGeometry),Gn.reorderForPostVertexCache(g.eastHemisphereGeometry),Gn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Gn.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&&Gn.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`;Gn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),Gn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Gn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Gn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Gn.fitToUnsignedShortIndices(u));p=g}return p}function kQ(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 yft(e,t){let n=[];return kQ(e,"geometry",t,n),kQ(e,"westHemisphereGeometry",t,n),kQ(e,"eastHemisphereGeometry",t,n),n}var s_={};s_.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=_ft(e),t.length>0&&(n=Gn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=yft(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]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function Aft(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 bft(e,t){let n=e.length;for(let i=0;i<n;++i)Aft(e[i],t)}function xft(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*ue.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}s_.packCreateGeometryResults=function(e,t){let n=new Float64Array(xft(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&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.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}};s_.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=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.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 St({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function Tft(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 Eft(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 Er(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}s_.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:Tft(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof zi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};s_.unpackCombineGeometryParameters=function(e){let t=Eft(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=s_.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 zi(o):new _i(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 oTe(e){let t=e.length,n=1+(ue.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,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function sTe(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}s_.packCombineGeometryResults=function(e,t){l(e.geometries)&&bft(e.geometries,t);let n=oTe(e.boundingSpheres),i=oTe(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}};s_.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:sTe(e.boundingSpheres),boundingSpheresCV:sTe(e.boundingSpheresCV)}};var ST=s_;var aTe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(aTe);var ss=aTe;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??Pn.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 Cft(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 vft=new U,Sft=new h,gTe=new se;function _Te(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,vft);if(t===3)return h.unpack(e,0,Sft);if(t===4)return se.unpack(e,0,gTe)}function wft(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=Cft(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 hx(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=_Te(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=gTe;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 Ift(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 Pft(e){let t=e.attributes,n=new En;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=Ift(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:ue.clone(e.boundingSphere)})}function Dft(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var Rft=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;as._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=Rft.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; +#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); } - -`,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); +`;var bz=`#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 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); } - -`:(o+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} -{ - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; +int normU8x2_toInt(in vec2 value) { +return int(value.x * 255.0) + 256 * int(value.y * 255.0); } - -`)}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};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 cTe(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 lTe(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?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) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${r}`};function uTe(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; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,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() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,g].join(` -`)}function Oft(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 Mft(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(); - #else - czm_writeDepthClamp(); - #endif +float normU8x2_toFloat(in vec2 value) { +return float(normU8x2_toInt(value)) / 65535.0; } -`,t}function fTe(e,t){let n=e.vertexAttributes}function Nft(e,t){return function(){return e[t]}}var UQ=Math.max(dn.hardwareConcurrency-1,1),rG,Lft=new Kn("combineGeometry");function Fft(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(rG))for(rG=new Array(UQ),r=0;r<UQ;r++)rG[r]=new Kn("createGeometry");let f;for(u=_2(u,UQ),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(rG[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){b2(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=Lft.scheduleTask(ST.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=ST.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):b2(e,t,ss.FAILED,void 0)}).catch(function(d){b2(e,t,ss.FAILED,d)})}}function Bft(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=Pft(p):g=p.constructor.createGeometry(p),r[c++]=Dft(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=ST.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):b2(e,t,ss.FAILED,void 0)}function kft(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 ue;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),xTe(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.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=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.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]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}as._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var dTe=new Sn,yTe=new he,ATe=new h,bTe=new ue;function Uft(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=ue.transform(y,A,bTe));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,dTe);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,yTe),v=u.project(E,ATe);T=Sn.fromCartesian(v,dTe),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var zQ=new h,zft=new h;function hTe(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=ue.transform(f,p,bTe));let g=f.center;g=o.scaleToGeodeticSurface(g,zft);let m=o.cartesianToCartographic(g,yTe),y=r.project(m,ATe),A=h.add(d,g,zQ);m=o.cartesianToCartographic(A,m);let b=r.project(m,zQ),x=h.subtract(b,y,zQ),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function Vft(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(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!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(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,b2(e,t,ss.COMPLETE,void 0)}function jft(e,t,n,i){let r=n.getRenderState(),o;i?(o=Je(r,!1),o.cull={enabled:!0,face:Ui.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=Ui.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=cc.GREATER,i?(o.cull={enabled:!0,face:Ui.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=Ui.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function Hft(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=cTe(o),o=as._updateColorAttribute(e,o,!1),o=uTe(e,o),o=as._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=lTe(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),fTe(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=cTe(o),o=as._updateColorAttribute(e,o,!0),o=uTe(e,o),o=as._modifyShaderPosition(e,o,t.scene3DOnly),o=Oft(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=lTe(s),s=Mft(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),fTe(e._spDepthFail,r))}var A2=new N,mTe=new h;function pTe(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]=Nft(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,A2),N.multiplyByPoint(A2,e.rtcCenter,mTe),N.setTranslation(A2,mTe,A2),A2}),a}function Gft(e,t,n,i,r,o,s,a){let c=pTe(e,t,n,a),u;l(e._depthFailAppearance)&&(u=pTe(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]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.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 Wft(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=Pn.castShadows(e.shadows),g=Pn.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)||wft(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?Fft(this,e):Bft(this,e)),this._state===ss.COMBINED&&(Uft(this,e),hTe(this,e),Vft(this,e)),!this.show||this._state!==ss.COMPLETE)return;this._batchTableOffsetsUpdated||hTe(this,e),this._recomputeBoundingSpheres&&kft(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??jft)(this,t,n,u),o&&(this._createShaderProgramFunction??Hft)(this,e,n),(r||o)&&(this._createCommandsFunction??Gft)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??Wft)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var qft=new ue,Yft=new ue;function xTe(e,t,n){if(n===gn.TOP){let i=ue.clone(e,qft),r=ue.clone(e,Yft);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===gn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function Xft(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 Kft(e,t,n,i,r){return function(o){let s=_Te(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var $ft=new h;function Jft(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)&&xTe(i,h.fromArray(o.get(),0,$ft),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function Zft(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:Xft(s,n,f),set:Kft(s,n,f,this,u)}}return Jft(this,c,n),Zft(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,le(this)};function b2(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;function nw(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;idt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(nw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});nw.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var TTe=new h,oG=new h,ETe=new h,Qft=new h,edt=new h,tdt=new h,ndt=new h,th=new he,CTe=new sn(h.UNIT_X,0),tw=new pn;function idt(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),th.longitude=t.west,th.latitude=(t.south+t.north)*.5,th.height=0;let i=n.cartographicToCartesian(th,tdt),r=h.cross(i,h.UNIT_Z,Qft);h.normalize(r,e.westNormal),th.longitude=t.east;let o=n.cartographicToCartesian(th,ndt),s=h.cross(h.UNIT_Z,o,TTe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,TTe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,edt),u=t.south,f;if(u>0){th.longitude=(t.west+t.east)*.5,th.latitude=u;let y=n.cartographicToCartesian(th,tw.origin);h.clone(c,tw.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,CTe);yi.rayPlane(tw,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,oG)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),oG);let d=h.cross(f,a,ETe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){th.longitude=(t.west+t.east)*.5,th.latitude=p;let y=n.cartographicToCartesian(th,tw.origin);h.negate(c,tw.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,CTe);yi.rayPlane(tw,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,oG)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),oG);let m=h.cross(a,g,ETe);h.normalize(m,e.northNormal)}var rdt=new h,odt=new h,sdt=new h(0,-1,0),adt=new h(0,0,-1),vTe=new h;function cdt(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),rdt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),odt),f.z=f.y,f.y=f.x,f.x=0,d=sdt,g=h.UNIT_Y,p=adt,m=h.UNIT_Z);let y=h.subtract(i,u,vTe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,vTe),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)}nw.prototype.distanceToCamera=function(e){let t=cdt(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};nw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};nw.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new CT({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 Mn({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var Wf=nw;var x2={},ldt=new h,STe=new h,wTe=new h,ITe=new h,PTe=new en;x2.validOutline=function(e){let n=en.fromPoints(e,PTe).halfAxes,i=$.getColumn(n,0,STe),r=$.getColumn(n,1,wTe),o=$.getColumn(n,2,ITe),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};x2.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,PTe),o=r.halfAxes,s=$.getColumn(o,0,STe),a=$.getColumn(o,1,wTe),c=$.getColumn(o,2,ITe),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 DTe(e,t,n,i,r){let o=h.subtract(e,t,ldt),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}x2.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=DTe(i[o],e,t,n);return r}};x2.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return DTe(i,e,t,n,r)}};var a_=x2;function udt(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 St({attributes:s,indices:i,primitiveType:Oe.LINES})}function wT(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ti.computeHierarchyPackedLength(t,h)+1}wT.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new wT(t)};wT.pack=function(e,t,n){return n=n??0,n=ti.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var fdt={polygonHierarchy:{}};wT.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new wT(fdt)),n._polygonHierarchy=i,n.packedLength=r,n};wT.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Br(n,h.equalsEpsilon,!0),n.length<3||!a_.validOutline(n))return;let r=ti.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:udt(r[c])});o.push(u)}let s=Gn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new St({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var nh=wT;var sG=new he;function T2(e){let t=Ig.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=bdt(t,n,i,r);this._boundingPlanes=o;let s=Cdt(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=XQ(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]=XQ(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=XQ(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();sG=r.cartesianToCartographic(c,sG),sG.height=(i+n)/2,this.center=r.cartographicToCartesian(sG,c),this._boundingSphere=ue.fromPoints(s)}var ddt=new h,hdt=new he,mdt=new h,pdt=new he,gdt=new h,_dt=new h,ydt=new h,Adt=new h;function bdt(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,ddt),a=i.cartesianToCartographic(o,hdt);a.height=n;let c=i.cartographicToCartesian(a,mdt),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,pdt),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,gdt));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,_dt),x=h.subtract(A,g,Adt),T=h.cross(x,b,ydt);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var IT=new h,PT=new h,DT=new h,VQ=new h,jQ=new h,HQ=new h,xdt=new h,Tdt=new h,Edt=new h,GQ=new h,WQ=new h,qQ=new h,OA=new h,s0=new $;function RTe(e,t,n){IT=e.normal,PT=t.normal,DT=n.normal,VQ=h.multiplyByScalar(e.normal,-e.distance,VQ),jQ=h.multiplyByScalar(t.normal,-t.distance,jQ),HQ=h.multiplyByScalar(n.normal,-n.distance,HQ),GQ=h.multiplyByScalar(h.cross(PT,DT,xdt),h.dot(VQ,IT),GQ),WQ=h.multiplyByScalar(h.cross(DT,IT,Tdt),h.dot(jQ,PT),WQ),qQ=h.multiplyByScalar(h.cross(IT,PT,Edt),h.dot(HQ,DT),qQ),s0[0]=IT.x,s0[1]=PT.x,s0[2]=DT.x,s0[3]=IT.y,s0[4]=PT.y,s0[5]=DT.y,s0[6]=IT.z,s0[7]=PT.z,s0[8]=DT.z;let i=$.determinant(s0);return OA=h.add(GQ,WQ,OA),OA=h.add(OA,qQ,OA),new h(OA.x/i,OA.y/i,OA.z/i)}function Cdt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=RTe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=RTe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var YQ=new h,iw=new h;function XQ(e,t){let n=[];for(let i=0;i<4;i++)YQ=h.subtract(t[(i+1)%4],t[i],YQ),iw=h.cross(e.normal,YQ,iw),iw=h.normalize(iw,iw),n[i]=h.clone(iw);return n}Object.defineProperties(T2.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var KQ=new h;T2.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=$Q(sn.projectPointOntoPlane(c,t,KQ),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=OTe(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=$Q(sn.projectPointOntoPlane(c,t,KQ),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=$Q(sn.projectPointOntoPlane(this._boundingPlanes[1],t,KQ),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 vdt=new h,Sdt=new h;function OTe(e,t,n){let i=h.subtract(n,t,vdt),r=h.subtract(e,t,Sdt),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 wdt=new sn(h.UNIT_X,0);function $Q(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],wdt);sn.getPointDistance(u,e)<0||(a=OTe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}T2.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};T2.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new nh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=nh.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new nh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=nh.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 nh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=nh.createGeometry(f);c[u]=new Bt({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 E2=T2;var Idt=new h(1,1,1),aG=Math.cos,cG=Math.sin;function rw(e){e=e??H.EMPTY_OBJECT;let t=e.radii??Idt,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"}rw.packedLength=2*h.packedLength+8;rw.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 MTe=new h,NTe=new h,c_={radii:MTe,innerRadii:NTe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};rw.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,MTe);t+=h.packedLength;let r=h.unpack(e,t,NTe);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):(c_.minimumClock=o,c_.maximumClock=s,c_.minimumCone=a,c_.maximumCone=c,c_.stackPartitions=u,c_.slicePartitions=f,c_.subdivisions=d,c_.offsetAttribute=p===-1?void 0:p,new rw(c_))};rw.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]=cG(I),L[E]=aG(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=cG(S),C[E]=aG(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]=cG(I),L[E]=aG(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=cG(S),C[E]=aG(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 En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let M=b.length,F=e._offsetAttribute===gn.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:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var qf=rw;function ow(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 qf(i),this._workerName="createSphereOutlineGeometry"}ow.packedLength=qf.packedLength;ow.pack=function(e,t,n){return qf.pack(e._ellipsoidGeometry,t,n)};var Pdt=new qf,RT={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};ow.unpack=function(e,t,n){let i=qf.unpack(e,t,Pdt);return RT.stackPartitions=i._stackPartitions,RT.slicePartitions=i._slicePartitions,RT.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,RT.radii),n._ellipsoidGeometry=new qf(RT),n):(RT.radius=i._radii.x,new ow(RT))};ow.createGeometry=function(e){return qf.createGeometry(e._ellipsoidGeometry)};var l_=ow;function sw(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(sw.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}}});sw.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};sw.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};sw.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};sw.prototype.createDebugVolume=function(e){let t=new l_({radius:this.radius}),n=N.fromTranslation(this.center,N.clone(N.IDENTITY)),i=new Bt({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 u_=sw;var Ddt=new h;function a0(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"}a0.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new a0({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};a0.fromAxisAlignedBoundingBox=function(e){return new a0({minimum:e.minimum,maximum:e.maximum})};a0.packedLength=2*h.packedLength+1;a0.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 FTe=new h,BTe=new h,LTe={minimum:FTe,maximum:BTe,offsetAttribute:void 0};a0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,FTe),r=h.unpack(e,t+h.packedLength,BTe),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):(LTe.offsetAttribute=o===-1?void 0:o,new a0(LTe))};a0.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,Ddt),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===gn.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 ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Tm=a0;var Rdt=new h,Odt=new h,Mdt=new h,Ndt=new h;function OT(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function JQ(e,t){let n=h.normalize(e,Ndt),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return OT(e,i,t)}function kTe(e){let t=$.getColumn(e,0,Rdt),n=$.getColumn(e,1,Odt),i=$.getColumn(e,2,Mdt),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=OT(n,i,t):!r&&o&&!s?n=OT(t,i,n):!r&&!o&&s?i=OT(n,t,i):r?o?s||(t=JQ(i,t),n=OT(i,t,n)):(t=JQ(n,t),i=OT(n,t,i)):(n=JQ(t,n),i=OT(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function aw(e,t){t=kTe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(aw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});aw.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};aw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};aw.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=kTe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};aw.prototype.createDebugVolume=function(e){let t=new Tm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=N.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({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 $u=aw;function ao(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||ir(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=f2(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,ao._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")&&ao._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?_o.REPLACE:_o.ADD):l(i)?p=i.refine:p=_o.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Or.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(ao._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(ao._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 o0(e,this),m=!0,y=Or.READY):(y=Or.UNLOADED,A=t.getDerivedResource({url:v}),b=Kc.getServerKey(A.getUrlComponent()))}else g=new o0(e,this),m=!0,y=Or.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=Qd.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}ao._deprecationWarning=qr;Object.defineProperties(ao.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===Or.READY}},contentUnloaded:{get:function(){return this._contentState===Or.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Or.EXPIRED}},contentFailed:{get:function(){return this._contentState===Or.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var MA=new h;function Ldt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,MA),c=h.add(s.positionWC,a,MA),u=h.subtract(c,o,MA);if(h.magnitude(u)>r){let E=h.normalize(u,MA),v=h.multiplyByScalar(E,r,MA),S=h.add(o,v,MA),I=h.subtract(S,s.positionWC,MA),R=h.normalize(I,MA);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===_o.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===so.PRELOAD_FLIGHT||n._pass===so.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 GTe=new K;ao.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 mn){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 Fdt(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 Bdt(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}ao.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:ea.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!==ea.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Bdt(n,this),this._priorityProgressiveResolution=Fdt(n,this),this.priorityDeferred=Ldt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};ao.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(GTe);K.lessThan(this.expireDate,e)&&(this._contentState=Or.EXPIRED,this._expiredContent=this._content)}};function kdt(e){if(!l(e.expireDuration))return;let t=K.now(GTe);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 Udt(e){return function(){return e._priority}}ao.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?zdt(this):jdt(this)};function zdt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=ir(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new d2(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Or.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Or.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Or.FAILED,r})}async function Vdt(e,t,n,i,r){let o=e._contentState;e._contentState=Or.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(WTe(e,a))return i&&(e.expireDate=void 0),e._content=new o0(t,e),UTe(e),e._contentState=Or.PROCESSING,e._content;throw e._contentState=Or.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 Hdt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof o0&&UTe(e),e._contentState=Or.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Or.FAILED,a}}function jdt(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:Udt(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 Vdt(e,r,i,n,o)}function WTe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function UTe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}ao._isEmptyTile=WTe;async function Hdt(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=r_(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===Ca.GEOMETRY||r.contentType===Ca.VECTOR,(r.contentType===Ca.IMPLICIT_SUBTREE||r.contentType===Ca.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===Ca.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=xT[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=TT(n,a));let c=ET(n,a);return l(c)&&(o.group=new Rx({metadata:c})),o}ao.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};ao.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Or.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};ao.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Or.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 qTe=new ue;function QQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,qTe);e._boundingVolume2D=new u_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Gdt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,qTe);e._contentBoundingVolume2D=new u_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}ao.prototype.visibility=function(e,t){let n=e.cullingVolume,i=QQ(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 ea.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)};ao.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===ea.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=Gdt(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)};ao.prototype.distanceToTile=function(e){return QQ(this,e).distanceToCamera(e)};var Wdt=new h;ao.prototype.distanceToTileCenter=function(e){let n=QQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Wdt);return h.dot(e.camera.directionWC,i)};ao.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var YTe=new $,XTe=new h,qdt=new $,eee=new h,KTe=new ie,$Te=new en,ZQ=new N;function Ydt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],eee),r=$.fromArray(e,3,qdt);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,YTe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new $u(i,r)}function zTe(e,t,n,i){let r=ie.unpack(e,0,KTe),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,$Te),c=a.center,u=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,ZQ),ZQ),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,YTe);return u=$.multiply(f,u,u),l(i)&&i instanceof $u?(i.update(c,u),i):new $u(c,u)}function Xdt(e,t,n,i){if(!N.equalsEpsilon(t,n,D.EPSILON8))return i instanceof $u?zTe(e,t,n,i):zTe(e,t,n,void 0);let r=ie.unpack(e,0,KTe);return i instanceof Wf?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Wf({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function Kdt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],eee),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,XTe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new u_(i,r)}ao.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=Gy.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(ir(e,"3DTILES_bounding_volume_S2"))return new E2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=Ydt(o,t,n);return this._verticalExaggeration!==1&&VTe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Xdt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof $u?VTe(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=Kdt(a,t,n);if(this._verticalExaggeration!==1){let u=Ar.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,eee),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var $dt=h.unpackArray(new Array(24).fill(0));function VTe(e,t,n){let i=e.boundingVolume.computeCorners($dt).map(o=>Ar.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,$Te);e.update(r.center,r.halfAxes)}ao.prototype.updateTransform=function(e,t){e=e??N.IDENTITY;let n=N.multiplyTransformation(e,this.transform,ZQ),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()};ao.prototype.updateGeometricErrorScale=function(){let e=N.getScale(this.computedTransform,XTe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Jdt(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 Zdt(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=Or.FAILED,r}}function Qdt(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 eht(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)}ao.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;Qdt(this,e),eht(this,e),Jdt(this,e,t,n),Zdt(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 jTe=[];ao.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(kdt(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Or.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=jTe;try{this._content.update(e,t)}catch(i){throw this._contentState=Or.FAILED,i}jTe.length=0,t.commandList=n};function HTe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function lG(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}ao.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=lG(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===_o.REPLACE?lG(this._priorityHolder._distanceToCamera,n.distance,i.distance):lG(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=HTe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=lG(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=HTe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===so.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};ao.prototype.isDestroyed=function(){return!1};ao.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(),le(this)};var ih=ao;var tee=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()}},nee=tee;var JTe={},tht=new h;JTe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof $u||i instanceof Wf){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=Qd.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof $u||a instanceof Wf)){e._optimChildrenWithinParent=Qd.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,tht),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=Qd.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Qd.USE_OPTIMIZATION};var C2=JTe;function nht(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var rh=nht;function c0(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(c0.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}}});c0.prototype.get=function(e){return this._array[e]};c0.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};c0.prototype.peek=function(){return this._array[this._length-1]};c0.prototype.push=function(e){let t=this.length++;this._array[t]=e};c0.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};c0.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};c0.prototype.resize=function(e){this.length=e};c0.prototype.trim=function(e){e=e??this._length,this._array.length=e};var ru=c0;function f_(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(f_.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}}});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 cw=f_;function d_(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(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 Yn.hasProperty(e,this._properties,this._class)};d_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};d_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};d_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};d_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};d_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};d_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var v2=d_;function ZTe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new v2({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 cw({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 cw({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(ZTe.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 MT=ZTe;function S2(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(S2.prototype,{length:{get:function(){return this._length}}});function iht(e,t,n){this.item=e,this.previous=t,this.next=n}S2.prototype.add=function(e){let t=new iht(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 QTe(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}S2.prototype.remove=function(e){l(e)&&(QTe(this,e),--this._length)};S2.prototype.splice=function(e,t){if(e===t)return;QTe(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 w2=S2;function NA(){this._list=new w2,this._sentinel=this._list.add(),this._trimTiles=!1}NA.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};NA.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};NA.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};NA.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};NA.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};NA.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)}};NA.prototype.trim=function(){this._trimTiles=!0};var I2=NA;function uG(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 ree(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}uG.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=ree(e,n),this._referenceMaximum[n]=ree(t,n)};function rht(e,t){let n=e.tilePropertyName;if(l(n)){let i=ree(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 iee=[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)];uG.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=rht(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=iee.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=iee[d],y=iee[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};uG.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 P2=uG;function lw(){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}lw.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};lw.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])}};lw.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Hf))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])}};lw.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Hf))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])}};lw.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 Em=lw;function D2(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(D2.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});D2.prototype.makeDirty=function(){this._styleDirty=!0};D2.prototype.resetDirty=function(){this._styleDirty=!1};D2.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 R2=D2;function eEe(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}eEe.maximumFrameNumber=15e6;var LA=eEe;function oht(e,t,n){let i=ir(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)&&!ir(r,"3DTILES_bounding_volume_S2")&&!ir(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=sht(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=aht(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 sht(e){if(ir(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 aht(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 l0=oht;var O2={};function tEe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function oee(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function nEe(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 see(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}O2.encode2D=function(e,t){return(tEe(e)|tEe(t)<<1)>>>0};O2.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=nEe(e),t[1]=nEe(e>>1),t};O2.encode3D=function(e,t,n){return oee(e)|oee(t)<<1|oee(n)<<2};O2.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=see(e),t[1]=see(e>>1),t[2]=see(e>>2),t};var FA=O2;function xo(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(xo.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?FA.encode3D(this.x,this.y,this.z):FA.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}}});xo.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 xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};xo.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 xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};xo.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 xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};xo.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 xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new xo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};xo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};xo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};xo.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};xo.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)};xo.prototype.isImplicitTilesetRoot=function(){return this.level===0};xo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};xo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};xo.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 iEe=[0,0,0];xo.fromMortonIndex=function(e,t,n,i){let r;return e===Hs.OCTREE?(r=FA.decode3D(i,iEe),new xo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=FA.decode2D(i,iEe),new xo({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};xo.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),xo.fromMortonIndex(e,t,i,o)};var u0=xo;function h_(){}h_.selectTiles=function(e,t){pe.throwInstantiationError()};h_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};h_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};h_.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)};h_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};h_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};h_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!cht(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function cht(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}h_.updateTile=function(e,t){rEe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,fht(e),e._shouldSelect=!1,e._finalResolution=!0};function rEe(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];rEe(o,t),e._visible=o._visible;return}if(lht(e,t)){e._visible=!1;return}let i=e.refine===_o.REPLACE,r=e._optimChildrenWithinParent===Qd.USE_OPTIMIZATION;if(i&&r&&n&&!uht(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function lht(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==_o.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function uht(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 fht(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 Ya=h_;function oEe(){}var M2={stack:new ru,stackMaximumLength:0};oEe.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}=Ya,s=M2.stack;for(s.push(i);s.length>0;){M2.stackMaximumLength=Math.max(M2.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===_o.ADD,u=a.refine===_o.REPLACE,f=dht(a);f&&hht(a,s,t),(c||u&&!f)&&(mht(e,a),r(a,t),pht(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return M2.stack.trim(M2.stackMaximumLength),n};function dht(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function hht(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 mht(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function pht(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var N2=oEe;function sEe(){}var L2={stack:new ru,stackMaximumLength:0},F2={stack:new ru,stackMaximumLength:0};sEe.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(Ya.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;_ht(n,t),L2.stack.trim(L2.stackMaximumLength),F2.stack.trim(F2.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function aee(e,t){e.contentAvailable&&Ya.selectTile(e,t)}function ght(e,t,n){let i=e.refine===_o.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=Ya;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(Ya.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=yht(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 _ht(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=Ya,a=L2.stack;for(a.push(e);a.length>0;){L2.stackMaximumLength=Math.max(L2.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?ght(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===_o.ADD?(aee(c,t),r(c,t)):c.refine===_o.REPLACE&&(r(c,t),d&&aee(c,t)):(n._emptyTiles.push(c),r(c,t),d&&aee(c,t)),o(c,t),s(c,t)}}function yht(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Ya,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=F2.stack;for(c.push(e);c.length>0;){F2.stackMaximumLength=Math.max(F2.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 B2=sEe;function aEe(){}var k2={stack:new ru,stackMaximumLength:0},U2={stack:new ru,stackMaximumLength:0},m_={stack:new ru,stackMaximumLength:0,ancestorStack:new ru,ancestorStackMaximumLength:0},Aht=2;aEe.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(Ya.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;vht(n,t),Sht(n,t),k2.stack.trim(k2.stackMaximumLength),U2.stack.trim(U2.stackMaximumLength),m_.stack.trim(m_.stackMaximumLength),m_.ancestorStack.trim(m_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function bht(e,t){let{updateTile:n,touchTile:i,selectTile:r}=Ya,o=U2.stack;for(o.push(e);o.length>0;){U2.stackMaximumLength=Math.max(U2.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<Aht&&o.push(u))}}}function fG(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:bht(e,t)}function xht(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 Tht(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 Eht(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Ya;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(Ya.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 Cht(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 vht(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}=Ya,c=k2.stack;for(c.push(e);c.length>0;){k2.stackMaximumLength=Math.max(k2.stackMaximumLength,c.length);let u=c.pop();xht(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Eht(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===_o.ADD?(fG(u,t),o(u,t)):u.refine===_o.REPLACE&&(Cht(u,i)?(o(u,t),p&&fG(u,t)):p?(fG(u,t),o(u,t)):Tht(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&fG(u,t)),s(u,t),a(u,t)}}function Sht(e,t){let{selectTile:n,canTraverse:i}=Ya,{stack:r,ancestorStack:o}=m_,s;for(r.push(e);r.length>0||o.length>0;){if(m_.stackMaximumLength=Math.max(m_.stackMaximumLength,r.length),m_.ancestorStackMaximumLength=Math.max(m_.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===_o.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 z2=aEe;function wa(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(wa.prototype,{length:{get:function(){return this._layers.length}}});wa.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()})};wa.prototype.addImageryProvider=function(e,t){let n=new Is(e);return this.add(n,t),n};wa.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};wa.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=[]};wa.prototype.contains=function(e){return this.indexOf(e)!==-1};wa.prototype.indexOf=function(e){return this._layers.indexOf(e)};wa.prototype.get=function(e){return this._layers[e]};function dG(e,t){return e.indexOf(t)}function cEe(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)}wa.prototype.raise=function(e){let t=dG(this._layers,e);cEe(this,t,t+1)};wa.prototype.lower=function(e){let t=dG(this._layers,e);cEe(this,t,t-1)};wa.prototype.raiseToTop=function(e){let t=dG(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))};wa.prototype.lowerToBottom=function(e){let t=dG(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 lEe=new ie;function uEe(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=lEe,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)}}wa.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(uEe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var wht=new ie,Iht=new ie,cee=new U,lee=new U,Pht=new he,Dht=new he;function Rht(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,wht),s=1/1024,a=Iht;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 zi)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;cee.x=a.west,cee.y=a.south,lee.x=a.east,lee.y=a.north;let u=c.unproject(cee,Pht),f=c.unproject(lee,Dht);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function Oht(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=Rht(A,d.textureCoordinateRectangle,g,lEe);ie.contains(b,t)&&n(p)}}}}wa.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)&&uEe(t,r,!0,function(c){a(c)}),l(i)&&Oht(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})};wa.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};wa.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};wa.prototype.isDestroyed=function(){return!1};wa.prototype.destroy=function(){return this.removeAll(!0),le(this)};wa.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 NT=wa;function co(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 I2,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 ru,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 R2,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Em,this._statisticsLast=new Em,this._statisticsPerPass=new Array(so.NUMBER_OF_PASSES);for(let r=0;r<so.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Em;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 P2(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 NT(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??Pn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Fu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Zp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new kg,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)&&Ts.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Nc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),pEe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new tT,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Lg(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??Ho.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??Wd.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(co.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){Ts.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Nc.setOwner(e,this,"_clippingPolygons"),pEe(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 qr("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,bEe(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}}});co.fromIonAssetId=async function(e,t){let n=await jo.fromAssetId(e);return co.fromUrl(n,t)};co.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 co.loadJson(n),o=await Mht(n,r),s=new co(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,bEe(s);let c=l(r.asset.gltfUpAxis)?Vi.fromName(r.asset.gltfUpAxis):Vi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Vi.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>Ni._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=N.clone(s._initialClippingPlanesOriginMatrix),s};co.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};co.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};co.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)&&co.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=fEe(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===_o.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=fEe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&C2.checkChildrenWithinParent(c)}return s};function fEe(e,t,n,i){if(!(l(n.implicitTiling)||ir(n,"3DTILES_implicit_tiling")))return new ih(e,t,n,i);let o=e.schema,s=new l0(t,n,o),a=new u0({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 ih(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Mht(e,t){let n=ir(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Fi.getSchemaLoader({resource:e});else if(l(n.schema))i=Fi.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new MT({schema:i.schema,metadataJson:n});return Fi.unload(i),r}var dEe=new h,Nht=new he,Lht=new N,Fht=new h,Bht=new h,kht=new h,Uht=new h;function zht(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Wf)n=h.normalize(a.positionWC,dEe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=N.inverseTransformation(c.computedTransform,Lht),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=N.multiplyByPoint(y,b.center,Fht);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,Nht);n=h.normalize(a.positionWC,dEe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=N.multiplyByPoint(y,a.positionWC,Bht);if(n=h.UNIT_Z,i=N.multiplyByPointAsVector(y,a.directionWC,kht),i=h.normalize(i,i),r=T.z,u instanceof $u){let E=$.getColumn(b.halfAxes,2,Uht),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof u_){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 Vht(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=>{gEe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?yEe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function mEe(e,t){return e._priority-t._priority}co.prototype.postPassesUpdate=function(e){l(this._root)&&(jht(this,e),smt(this,e),this._cache.unloadTiles(this,AEe),rmt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function pEe(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)}co.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Kht(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&&zht(this,e),e.newFrame&&this._cache.reset()};function jht(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!==Or.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function Hht(e){let t=e._requestedTiles;t.sort(mEe);for(let n=0;n<t.length;++n)Vht(e,t[n])}function gEe(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 Ght(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Or.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var Wht=new he,qht=new he,Yht=new h;function Xht(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,Wht),f=he.fromCartesian(r.center,c,qht);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,Yht);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Kht(e,t){Ght(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,gEe(f,e,u)}}e.totalMemoryUsageInBytes<i?Jht(e):a&&n.length>0&&$ht(e)}function $ht(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(mEe)}function Jht(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var hG=new h,Zht={maximumFractionDigits:3};function hEe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Zht):Math.round(t).toLocaleString()}function uee(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,hG);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,hG);o=h.multiplyByScalar(o,.75*n,hG),r=h.add(o,i,hG)}return r}function fee(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: ${hEe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${hEe(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]}`;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 Qht(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:uee(e.debugPickedTile),a=fee(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];fee(a,e,uee(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&fee(a,e,uee(a))}}e._tileDebugLabels.update(t)}function emt(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),Xht(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 i0),Qht(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var _Ee=[],tmt=[];function yEe(e,t){let n=t,i=_Ee;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&&(omt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function AEe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function mG(e,t){let n=e-t;return n<0?n+LA.maximumFrameNumber:n}var nmt=64;function imt(e,t,n){let i=tmt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Or.LOADING||o===Or.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Or.UNLOADED&&o!==Or.FAILED||l(r.cacheNode)||Math.min(mG(t,r._visitedFrame),mG(t,r._touchedFrame),mG(t,r._selectedFrame),mG(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 rmt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<nmt&&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,!imt(u,i,r)&&(yEe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function omt(e,t){e._cache.unloadTile(e,t,AEe),t.destroy()}co.prototype.trimLoadedTiles=function(){this._cache.trim()};function smt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Em.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 amt(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 cmt(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 lmt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,amt(e),cmt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Hht(e),emt(e,t,i),Em.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 bEe(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}co.prototype.getTraversal=function(e){let{pass:t}=e;return t===so.MOST_DETAILED_PRELOAD||t===so.MOST_DETAILED_PICK?N2:this.isSkippingLevelOfDetail?z2:B2};co.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};co.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===so.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===so.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===so.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=so.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=lmt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};co.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};co.prototype.isDestroyed=function(){return!1};co.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=_Ee;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,le(this)};co.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};co.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!co.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var umt=new pn,fmt=new h,dmt=new h,hmt=new he;co.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=umt,r=n.cartographicToCartesian(e,fmt),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,dmt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,hmt)?.height};co.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 mmt=new h;co.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,mmt);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};co.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};co.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 Yo=co;function Cm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Cm.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}}});Cm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Cm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Cm.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};Cm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)xEe(this,t)};Cm.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++,xEe(this,i),t};Cm.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],TEe(this,0)),this._array[e-1]=void 0,t};Cm.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=dee(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&TEe(this,n)}return this._array[e-1]=void 0,t};Cm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Cm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[dee(this,1,2)?1:2]};function pG(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function V2(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function dee(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function xEe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=V2(e,t,i);for(r!==n&&(pG(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(V2(e,t,o)!==r)break;pG(e,t,o),t=o}}function TEe(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){V2(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;V2(e,f,o)===i&&(o=f)}}if(V2(e,o,t)===i&&(pG(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);dee(e,o,a)===i&&pG(e,o,a)}t=o}}var p_=Cm;function j2(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new p_({comparator:j2.comparator})}j2.prototype.addSubtree=function(e){let t=new pmt(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()};j2.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}};j2.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 pmt(e,t){this.subtree=e,this.stamp=t}var H2=j2;function g_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(g_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});g_.fromMetadataArray=function(e){return new g_({metadata:e})};g_.fromGltf=async function(e){let t=new Uf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new g_({loader:t})};g_.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=gmt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function gmt(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}g_.prototype.isDestroyed=function(){return!1};g_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var LT=g_;function pl(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,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 na(h.negate(h.UNIT_X,new h),e.x),new na(h.negate(h.UNIT_Y,new h),e.y),new na(h.negate(h.UNIT_Z,new h),e.z),new na(h.UNIT_X,-t.x),new na(h.UNIT_Y,-t.y),new na(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Eg({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 _mt=new h,ymt=new h,Amt=new $,bmt=new h,xmt=new h;pl.prototype.update=function(e,t,n,i,r){i=i??t.clone(bmt),r=r??n.clone(xmt),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,ymt);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=pee(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.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(hee(p.x,g.x),hee(p.y,g.y),hee(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function hee(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var Tmt=new N;pl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,Tmt),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 gG=new h,mee=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),gG),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)),mee);return pee(c,u,this._shapeTransform,r)};var EEe=new h;pl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,EEe),s=h.multiplyByScalar(o,r,EEe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,gG),r,gG),c=h.add(a,s,mee),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),gG),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),mee);return pee(d,p,this._shapeTransform,i)};pl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));pl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var CEe=new h;function pee(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,CEe),c=h.midpoint(e,t,_mt);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),CEe);let u=N.getRotation(n,Amt);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var FT=pl;function Yf(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=Yf.DefaultMinBounds.clone(),this._maxBounds=Yf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Yf,n=[new na(h.negate(h.UNIT_Z,new h),e.z),new na(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Eg({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(Yf.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 Emt=new h,Cmt=new h,vmt=new h,Smt=new h,wmt=new h,Imt=new N,Pmt=new h,vEe=new U;Yf.prototype.update=function(e,t,n,i,r){i=i??t.clone(Cmt),r=r??n.clone(vmt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=Yf,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,Smt),p=h.minimumByComponent(n,r,wmt),g=N.getScale(e,Emt);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=yee(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.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 Dmt=new $,Rmt=new $,Omt=new N;Yf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,Imt),i=N.multiplyByPoint(n,e.camera.positionWC,Pmt);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,vEe),vEe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],Dmt),s=e.context.uniformState.inverseView,a=N.multiplyTransformation(n,s,Omt),c=N.getMatrix3(a,Rmt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};Yf.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 _G=new h,_ee=new h;Yf.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),_G),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),_ee);return yee(c,u,this._shapeTransform,r)};var SEe=new h;Yf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,SEe),s=h.multiplyByScalar(o,r,SEe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,_G),r,_G),c=h.add(a,s,_ee),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),_G),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),_ee);return yee(d,p,this._shapeTransform,i)};Yf.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));Yf.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var Mmt=5,Nmt=new Array(Mmt),Lmt=new h,Fmt=new $,Bmt=new N,kmt=new N,Umt=new N,gee=new N,zmt=new h,Vmt=new h,jmt=new h,IEe=new Array(8);for(let e=0;e<8;e++)IEe[e]=new h;function wEe(e,t,n){return Math.abs(se.dot(e,t))<n}function Hmt(e){let t=N.getColumn(e,0,zmt),n=N.getColumn(e,1,Vmt),i=N.getColumn(e,2,jmt),r=D.EPSILON4;return wEe(t,n,r)&&wEe(n,i,r)}function Gmt(e,t){let n=IEe;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 Wmt=new h;function yee(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=Nmt,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,Lmt),O=$.fromRotationZ(d,Fmt),L=h.fromElements(x,T,E,Wmt),_=N.fromScale(L,Umt),C=N.fromRotation(O,kmt),w=N.fromTranslation(R,Bmt),P=N.multiplyTransformation(C,N.multiplyTransformation(w,_,gee),gee),M=N.multiplyTransformation(n,P,gee);return Hmt(M)?en.fromTransformation(M,i):Gmt(M,i)}var BT=Yf;function oh(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._rectangle=new ie,this._minimumHeight=oh.DefaultMinBounds.z,this._maximumHeight=oh.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(oh.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 qmt=new h,Ymt=new h,Xmt=new h,Kmt=new h,$mt=new h,Jmt=new h,Zmt=new h,Qmt=new h,PEe=new h,DEe=new h,ept=new ie;oh.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=oh;i=i??o,r=r??s;let a=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=N.getScale(e,Qmt),p=h.clone(o,qmt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,Ymt),m=h.clamp(n,p,s,Xmt),y=h.clamp(i,p,s,Kmt),A=h.clamp(r,p,s,$mt),b=h.maximumByComponent(g,y,Jmt),x=h.minimumByComponent(m,A,Zmt),T=h.add(d,h.fromElements(m.z,m.z,m.z,PEe),PEe),E=h.add(d,h.fromElements(x.z,x.z,x.z,DEe),DEe);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,ept);this._orientedBoundingBox=Aee(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=ue.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,bi=(m.x-o.x)/S,Wi=1-M/S,wi=(bi+.5*Wi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=wi,M>c){Xt=S/M;let hi=Xn-wi;rt=-Xt*(hi-Math.floor(hi))}}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 tpt=new he,npt=new h,ipt=new N,REe=new $;oh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,tpt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,npt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,ipt),a=N.getRotation(s,REe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,REe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var kEe=new ie;oh.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,kEe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return Aee(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var rpt=new U,opt=new U,G2=new U,OEe=new U,MEe=new U,W2=new U;function spt(e,t,n,i){let r=U.abs(e,rpt),o=U.fromElements(1/t.x,1/t.y,opt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,G2),a=U.multiplyComponents(t,s,OEe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,MEe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,W2)),d=U.normalize(U.subtract(r,c,W2),W2),p=U.multiplyByScalar(d,f,W2);s=U.multiplyComponents(U.add(p,c,G2),o,G2),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,G2),G2),a=U.multiplyComponents(t,s,OEe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,MEe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,W2)),i)}var apt=new U,NEe=new U,cpt=new h,LEe=new U;oh.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,NEe),d=spt(f,U.fromElements(i.x,i.z,apt),r,cpt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,LEe),LEe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,NEe),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 FEe=new h,BEe=new h,lpt=new h;oh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,FEe),s=h.multiplyByScalar(o,r,FEe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,BEe),r,BEe),c=h.add(a,s,lpt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,kEe),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return Aee(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Aee(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}oh.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-ee.WGS84.minimumRadius));oh.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var kT=oh;var Ju={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Ju.getMinBounds=function(e){switch(e){case Ju.BOX:return FT.DefaultMinBounds;case Ju.ELLIPSOID:return kT.DefaultMinBounds;case Ju.CYLINDER:return BT.DefaultMinBounds}};Ju.getMaxBounds=function(e){switch(e){case Ju.BOX:return FT.DefaultMaxBounds;case Ju.ELLIPSOID:return kT.DefaultMaxBounds;case Ju.CYLINDER:return BT.DefaultMaxBounds}};Ju.getShapeConstructor=function(e){switch(e){case Ju.BOX:return FT;case Ju.ELLIPSOID:return kT;case Ju.CYLINDER:return BT}};Object.freeze(Ju);var hc=Ju;function q2(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===hc.ELLIPSOID?Vp.Z_UP:Vp.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new H2}Object.defineProperties(q2.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}}});q2.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();fpt(n);let i=ypt(n,t);await i.load();let{root:r}=n,o=ir(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new MT({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=Apt(s,c);Object.assign(u,dpt(r)),l(r.transform)?u.globalTransform=N.unpack(r.transform):u.globalTransform=N.clone(N.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=upt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new q2(u),d=new l0(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Fi.unload(i),f};function upt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(zd.TILESET_TILE_COUNT)}function fpt(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!ir(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!ir(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ir(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function dpt(e){let t=e.boundingVolume;if(l(t.box))return gpt(t.box);if(l(t.region))return hpt(t.region);if(ir(t,"3DTILES_bounding_volume_cylinder"))return _pt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function hpt(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:hc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var mpt=new h,ppt=new $;function gpt(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,mpt),i=$.getRotation(t.halfAxes,ppt);return{shape:hc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:N.fromRotationTranslation(i,t.center)}}function _pt(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:hc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function ypt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Fi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Fi.getSchemaLoader({schema:i})}function Apt(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=UEe(b,T),v=UEe(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 UEe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function bpt(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=r_(a);return r=await Ng.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}q2.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 u0({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 bpt(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 LT.fromGltf(b)};var bee=q2;function xee(e){e=e??1,this._radius=e??1}Object.defineProperties(xee.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});xee.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 Y2=xee;var X2=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -void main() -{ -vec4 position = czm_computePosition(); -#ifdef EXTRUDED_GEOMETRY -float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); -delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; -position = position + vec4(extrudeDirection * delta, 0.0); -#endif -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); -v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D -vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); -vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); -vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); -bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; -planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); -planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); -idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; -idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); -planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); -planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; -vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; -vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; -vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; -vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D -vec3 eastWard = southEastCorner - southWestCorner; -float eastExtent = length(eastWard); -eastWard /= eastExtent; -vec3 northWard = northWestCorner - southWestCorner; -float northExtent = length(northWard); -northWard /= northExtent; -v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); -v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); -v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL -vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); -vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); -v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); -v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); -v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif -gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +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; } -`;function xpt(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var gl=xpt;var uw=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { -vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); -return eyeCoordinate.xyz / eyeCoordinate.w; +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); } -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { -vec2 glFragCoordXY = gl_FragCoord.xy; -float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); -float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); -bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); -float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); -float useDownOrLeft = float(useUpOrRight == 0.0); -vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); -vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); -return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +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; } -#endif // NORMAL_EC -void main(void) -{ -#ifdef REQUIRES_EC -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif -#ifdef REQUIRES_WC -vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; -vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +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 -#ifdef TEXTURE_COORDINATES -vec2 uv; -#ifdef SPHERICAL -vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); -sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; -sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); -uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; -uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL -uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; -uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES -#ifdef CULL_FRAGMENTS -if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { -discard; +#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 -#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)); -vec3 normalEC = normalize(cross(leftRight, downUp)); +inputCoordinate.y = height; +inputCoordinate.z = angle; #endif -#ifdef PER_INSTANCE_COLOR -vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT -out_FragColor = color; -#else // FLAT -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = -eyeCoordinate.xyz; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#else // PER_INSTANCE_COLOR -czm_materialInput materialInput; -#ifdef USES_NORMAL_EC -materialInput.normalEC = normalEC; #endif -#ifdef USES_POSITION_TO_EYE_EC -materialInput.positionToEyeEC = -eyeCoordinate.xyz; +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); +} #endif -#ifdef USES_TANGENT_TO_EYE -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +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; +} +return childData; +} +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 +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif -#ifdef USES_ST -materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; -materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +} +bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { +int levelDifference = tileCoordinate.w - octreeCoords.w; +if (levelDifference < 0) { +return false; +} +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +return coordinateAtLevel == octreeCoords.xyz; +} +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]); +} +return; +} +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); +} +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 +} +`;var xz=`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); +} +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 -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#endif // PER_INSTANCE_COLOR -czm_writeDepthClamp(); -#endif // PICK } -`;function sh(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new Tee;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new Tee;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}sh.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,uw]})};sh.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:[uw],pickColorQualifier:"in"})};sh.prototype.createVertexShader=function(e,t,n,i){return YEe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};sh.prototype.createPickVertexShader=function(e,t,n,i){return YEe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var zEe=new h,VEe=new he,jEe={high:0,low:0};function YEe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=VEe;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,zEe),d=Sn.encode(f.x,jEe);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=VEe;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=s.project(p,zEe);d=Sn.encode(g.x,jEe),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 Tee(){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(Tee.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 HEe(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 Tpt=[new U,new U,new U,new U];function XEe(e,t){let n=Tpt,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/HEe(i,r,o),a=1/HEe(i,o,r);e.uvMinAndExtents=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var KEe=new he,$Ee=new h,Ept=new h,Cpt=new h,yG={high:0,low:0};function JEe(e,t,n){let i=KEe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,$Ee);i.latitude=e.north;let o=t.project(i,Ept);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Cpt),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,yG);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,yG),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,yG),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,yG),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var vpt=new N,Spt=new N,GEe=new h,wpt=new he,Ipt=[new he,new he,new he,new he,new he,new he,new he,new he];function Ppt(e,t,n,i,r,o){let s=ie.center(e,wpt);s.height=n;let a=he.toCartesian(s,t,GEe),c=At.eastNorthUpToFixedFrame(a,t,vpt),u=N.inverse(c,Spt),f=e.west,d=e.east,p=e.north,g=e.south,m=Ipt;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,GEe);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 Dpt=new h,Rpt=new h,Opt=new Sn;sh.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=$Ee,s=Dpt,a=Rpt;Ppt(e,n,r??0,o,s,a);let c={};XEe(c,t);let u=Sn.fromCartesian(o,Opt);return c.southWest_HIGH=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),JEe(e,i,c),c};var Mpt=new h;function WEe(e,t,n,i){let r=KEe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,Mpt),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 qEe=new U;sh.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=WEe(e.south,e.west,n,qEe),o=r.x,s=r.y,a=WEe(e.north,e.east,n,qEe),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 gl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new gl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return XEe(g,t),JEe(e,i,g),g};sh.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)};sh.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 Npt(e){return Math.max(e.width,e.height)>sh.MAX_WIDTH_FOR_PLANAR_EXTENTS}sh.shouldUseSphericalCoordinates=function(e){return Npt(e)};sh.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Xf=sh;function UT(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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(UT.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}}});UT.isSupported=function(e){return e.context.stencilBuffer};function fw(e,t){let n=t?Zn.EQUAL:Zn.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:cc.LESS_OR_EQUAL},depthMask:!1}}function Cee(e){return{stencilTest:{enabled:e,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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 Lpt={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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 Fpt(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(fw(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(fw(r,!0)),e._rsColorPass=Ge.fromCache(Cee(r,!1)),e._rsPickPass=Ge.fromCache(Lpt)}function Bpt(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() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function kpt(e,t){let n=t.context,i=e._primitive,r=X2;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=Bpt(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ye({defines:[a],sources:[r]}),u=new Ye({sources:[Jy]}),f=e._primitive._attributeLocations,d=new Xf(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 Upt(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 zpt(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 Vpt(e,t,n,i,r,o,s){Upt(e,o),zpt(e,s)}function ZEe(e,t){return Math.floor(e%t/2)}function Eee(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function QEe(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function jpt(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!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[ZEe(m,b)],d&&(A=n[m],Eee(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,Eee(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],Eee(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[ZEe(m,b)];y=u[T.index],d&&(A=i[m],QEe(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,QEe(A,t,r,o,y))}}}UT.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=Xf.hasAttributesForSphericalExtents(c),g=Xf.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 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){Fpt(n,A)},i._createShaderProgramFunction=function(y,A,b){kpt(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){Vpt(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){jpt(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(fw(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(fw(!1,!0)),this._rsColorPass=Ge.fromCache(Cee(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(fw(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(fw(!0,!0)),this._rsColorPass=Ge.fromCache(Cee(!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))})};UT.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};UT.prototype.isDestroyed=function(){return!1};UT.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,le(this)};var dw=UT;var AG={CUMULUS:0};AG.validate=function(e){return e===AG.CUMULUS};Object.freeze(AG);var hw=AG;var K2=`uniform sampler2D u_noiseTexture; +`;var qNe={Z_UP:0,Y_UP:1};Object.freeze(qNe);var U0=qNe;function FMt(e){let t=new e_;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([uz]),e.provider.metadataOrder===U0.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",bz,cz,xz,fz,hz,dz]),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([_z,mz,hC]):u==="CYLINDER"?t.addFragmentLines([yz,xP,pz,hC]):u==="ELLIPSOID"&&t.addFragmentLines([Az,xP,gz,hC]),t.addFragmentLines([lz]);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 Tz=FMt;var YNe=new U;function BMt(e,t){let n=new Tz(e);az(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=bs.getTextureResolution(r,t,YNe),S=XNe(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=ay.getTextureResolution(s,t,YNe),S=XNe(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 XNe(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 Ez=BMt;var ZNe={};function kMt(e,t,n){let i,r,o;if(e instanceof Ji){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 yu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var UMt=new h,KNe=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 Ese(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,UMt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),KNe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),KNe));o=Math.min(kMt(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 Cz(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 eLe=new h;function zMt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,eLe),f=c.pitch,d=Cz(c.heading,i),p=Cz(c.roll,o),g=Ese(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 VMt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function jMt(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 HMt=new he,GMt=new he;function WMt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,HMt),m=f.pitch,y=Cz(f.heading,i),A=Cz(f.roll,o),b=p.cartesianToCartographic(n,GMt);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?VMt(g,b):jMt(g,b);let T=Ese(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 qMt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,eLe),u=Cz(a.heading,i),f=a.frustum.right-a.frustum.left,d=Ese(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 $Ne=new he,YMt=new h;function Tse(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function JNe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}ZNe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return Tse();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,$Ne),n=o.project($Ne,YMt));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=JNe(x,t.complete),E=JNe(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 Tse(T,E);let I=new Array(4);if(I[re.SCENE2D]=qMt,I[re.SCENE3D]=WMt,I[re.COLUMBUS_VIEW]=zMt,m<=0)return Tse(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=Ls.CUBIC_OUT:d=Ls.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var vz=ZNe;var tLe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(tLe);var Au=tLe;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 Ji,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,dLe(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,CLe(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 mh(0,-D.PI_OVER_FOUR,0);function dLe(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 XMt(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(XMt(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 KMt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var $Mt=new he,JMt=new h,k7=new h,ZMt=new se,QMt=new se,eNt=new se,tNt=new se,nNt=new se;function iNt(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,ZMt),r=n.cartesianToCartographic(i,$Mt),o=t.project(r,JMt),s=QMt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,nNt),c=se.add(N.getColumn(e._transform,0,k7),i,k7);n.cartesianToCartographic(c,r),t.project(r,o);let u=eNt;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=tNt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(a,u,f);else{let d=se.add(N.getColumn(e._transform,1,k7),i,k7);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 Cse=new h;function Il(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?KMt(e):iNt(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=Cse;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,Cse));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,Cse);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)&&dLe(e)}function hLe(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 mLe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function pLe(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 V7=new N,j7=new N;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Il(this),this._invTransform}},viewMatrix:{get:function(){return Il(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Il(this),this._invViewMatrix}},positionCartographic:{get:function(){return Il(this),this._positionCartographic}},positionWC:{get:function(){return Il(this),this._positionWC}},directionWC:{get:function(){return Il(this),this._directionWC}},upWC:{get:function(){return Il(this),this._upWC}},rightWC:{get:function(){return Il(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,V7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,j7);this._setTransform(n);let i=hLe(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,V7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,j7);this._setTransform(n);let i=mLe(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,V7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,j7);this._setTransform(n);let i=pLe(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&&ALe(this,this.position)};var rNt=new h,oNt=new h,sNt=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,sNt);N.clone(e,this._transform),this._transformChanged=!0,Il(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),Il(this)};var aNt=new U,cNt=new pn,lNt=new h,uNt=new h;function gLe(e){if(!N.equals(N.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=aNt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,cNt);r=n.pickWorldCoordinates(a,t,!0,lNt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,uNt));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=gLe(this)))};var H7=new h,Pse=new N,fNt=new N,Dse=new Le,Rse=new $,_Le=new he;function dNt(e,t,n){let i=N.clone(e.transform,Pse),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,fNt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Dse),s=$.fromQuaternion(o,Rse);$.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 hNt(e,t,n,i){let r=N.clone(e.transform,Pse);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,_Le);t=a.project(c,H7)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Dse),s=$.fromQuaternion(o,Rse);$.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 mNt(e,t,n,i){let r=N.clone(e.transform,Pse);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,_Le);t=c.project(u,H7)}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===Au.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,Dse),s=$.fromQuaternion(o,Rse);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var pNt=new h,gNt=new h,_Nt=new h;function yLe(e,t,n,i){let r=h.clone(n.direction,pNt),o=h.clone(n.up,gNt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,V7),u=N.inverseTransformation(c,j7);N.multiplyByPointAsVector(u,r,r),N.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,_Nt);return i.heading=hLe(r,o),i.pitch=mLe(r),i.roll=pLe(r,o,s),i}var Ise={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},TP=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,H7);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,H7),i=!1),l(t.direction)&&(t=yLe(this,r,t,Ise.orientation)),TP.heading=t.heading??0,TP.pitch=t.pitch??-D.PI_OVER_TWO,TP.roll=t.roll??0,n===re.SCENE3D?dNt(this,r,TP):n===re.SCENE2D?mNt(this,r,TP,i):hNt(this,r,TP,i)};var yNt=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,yNt).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Il(this),N.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Il(this),N.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Il(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Il(this),N.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Il(this),N.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Il(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function ALe(e,t){let n=e._scene.mapMode2D===Au.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 nLe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,nLe),h.add(n,nLe,n),this._mode===re.SCENE2D&&ALe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?G7(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?G7(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 ANt=new Le,bNt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,ANt),r=$.fromQuaternion(i,bNt),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,TNt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,xNt),r=$.fromQuaternion(i,TNt);$.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,bLe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,bLe(this,-e)};var ENt=new h,CNt=new h,vNt=new h,iLe=new h;function bLe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,ENt),r=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,iLe),D.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,CNt),a=h.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=h.dot(i,h.negate(s,iLe)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(s,i,vNt);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,xLe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,xLe(this,e)};function xLe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function G7(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===Au.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===Au.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 TLe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?G7(this,e):TLe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?G7(this,-e):TLe(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 SNt=new N;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,SNt);this.lookAtTransform(r,t)};var wNt=new h,INt=new Le,PNt=new Le,DNt=new $;function ELe(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,INt),o=Le.fromAxisAngle(h.UNIT_Z,-e,PNt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,DNt),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=ELe(t.heading,t.pitch,t.range,wNt):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 RNt=new N,rLe=new h,ONt=new h,oLe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=N.clone(this._transform,RNt);this._setTransform(N.IDENTITY);let i=h.subtract(e,this.positionWC,rLe);h.magnitudeSquared(i)<D.EPSILON8&&(i=h.clone(this.directionWC,rLe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,ONt),o=h.cross(i,r,oLe);h.magnitudeSquared(o)<D.EPSILON8&&(o=h.clone(this.rightWC,oLe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var Sz=new he,MNt=new he,NNt=new h,LNt=new h,FNt=new h,BNt=new h,kNt=new h,UNt=new h,zNt=new h,vse=new h,VNt={direction:new h,right:new h,up:new h},sLe;function wl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function CLe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:VNt,{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=Sz;O.longitude=f,O.latitude=s,O.height=0;let L=MNt;L.longitude=f,L.latitude=a,L.height=0;let _=sLe;(!l(_)||_.ellipsoid!==r)&&(sLe=_=new _g(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,Sz).latitude}let p=Sz;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,zNt),m=Sz;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,NNt);m.longitude=c;let A=r.cartographicToCartesian(m,FNt);m.longitude=f;let b=r.cartographicToCartesian(m,kNt);m.latitude=a;let x=r.cartographicToCartesian(m,UNt);m.longitude=u;let T=r.cartographicToCartesian(m,BNt);m.longitude=c;let E=r.cartographicToCartesian(m,LNt);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(wl(v,I,A,O),wl(v,I,T,O),wl(v,I,y,O),wl(v,I,E,O),wl(v,I,b,O),wl(v,I,x,O),wl(v,S,A,L),wl(v,S,T,L),wl(v,S,y,L),wl(v,S,E,L),wl(v,S,b,L),wl(v,S,x,L)),a<0&&s>0){let _=Sz;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,vse);h.subtract(C,g,C),R=Math.max(R,wl(v,I,C,O),wl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,vse),h.subtract(C,g,C),R=Math.max(R,wl(v,I,C,O),wl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,vse),n)}var jNt=new he,HNt=new h,GNt=new h;function WNt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=jNt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,HNt);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,GNt);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 qNt=new he,YNt=new h,XNt=new h;function KNt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Au.INFINITE_SCROLL?r+=D.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=qNt;o.longitude=r,o.latitude=t.north;let s=i.project(o,YNt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,XNt),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 CLe(this,e,t);if(n===re.COLUMBUS_VIEW)return WNt(this,e,t);if(n===re.SCENE2D)return KNt(this,e,t)};var $Nt=new pn;function JNt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,$Nt),o=_i.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return pn.getPoint(r,s,i)}var ZNt=new pn;function QNt(e,t,n,i){let o=e.getPickRay(t,ZNt).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 eLt=new pn;function tLt(e,t,n,i){let r=e.getPickRay(t,eLt),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=JNt(this,e,t,n);else if(this._mode===re.SCENE2D)n=QNt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=tLt(this,e,this._projection,n);else return;return n}};var nLt=new h,iLt=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,nLt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,iLt),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 U7=new h;function sLt(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,U7),h.add(U7,f,f),h.multiplyByScalar(e.upWC,u,U7),h.add(U7,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===Au.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):sLt(this,e,t)};var aLt=new h,cLt=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,aLt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),cLt);return Math.max(0,h.magnitude(n)-e.radius)};var lLt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,lLt);return Math.max(r.x,r.y)};function uLt(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:Ls.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var fLt=new h,aLe=new h,dLt=new h,hLt=new h;function mLt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,fLt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,aLe),aLe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,dLt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,hLt)),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 uLt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return mLt(this,e)};var pLt=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};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=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}};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,pLt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=yLe(this,t,r,Ise.orientation)),l(e.duration)&&e.duration<=0){let f=Ise;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;Ja.destination=t,Ja.heading=r.heading,Ja.pitch=r.pitch,Ja.roll=r.roll,Ja.duration=e.duration,Ja.complete=function(){s===o._currentFlight&&(o._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=vz.createTween(a,Ja);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 gLt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function _Lt(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 yLt=100;function vLe(e,t,n){n=mh.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=yLt:e.frustum instanceof gn||e._mode===re.SCENE2D?n.range=_Lt(e,s):n.range=gLt(e,s),n.range=D.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=vLe(this,e,t),this.lookAt(e.center,t)};var ALt=new N,cLe=new h,bLt=new h,xLt=new h,TLt=new h,ELt=new se,CLt=new Le,vLt=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=vLe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,cLe):r=ELe(i.heading,i.pitch,i.range,cLe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,ALt);N.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,bLt),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,CLt),p=$.fromQuaternion(d,vLt);h.fromCartesian4(N.getColumn(a,1,ELt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,TLt);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 lLe=new h,uLe=new h,Sse=new h,fLe=new h,wz=[new h,new h,new h,new h];function SLt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,lLe),o=h.magnitude(r),s=h.normalize(r,uLe),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,Sse),Sse),c=h.normalize(h.cross(s,a,fLe),fLe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,lLe),d=u/o,p=h.multiplyByScalar(a,d,uLe),g=h.multiplyByScalar(c,d,Sse),m=h.add(f,g,wz[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,wz[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,wz[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,wz[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),wz}var wse=new U,wLt=new h,Mb=[new he,new he,new he,new he];function z7(e,t,n,i,r,o){wse.x=e,wse.y=t;let s=i.pickEllipsoid(wse,r,wLt);return l(s)?(Mb[n]=r.cartesianToCartographic(s,Mb[n]),1):(Mb[n]=r.cartesianToCartographic(o[n],Mb[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 ue(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=SLt(this,e);if(c+=z7(0,0,0,this,e,u),c+=z7(0,a,1,this,e,u),c+=z7(s,a,2,this,e,u),c+=z7(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(Mb,t);let f=0,d=Mb[3].longitude;for(let p=0;p<4;++p){let g=Mb[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,Mb[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 Ji)return;let e=this._scene;this.frustum=new Ji,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=gLe(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;var SLe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(SLe);var cr=SLe;var RLe=[to.SHIFT,to.CTRL,to.ALT,[to.SHIFT,to.CTRL],[to.SHIFT,to.ALT],[to.CTRL,to.ALT],[to.SHIFT,to.CTRL,to.ALT]];function Za(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function ILt(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 wLe(e,t,n){let i=Za(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]?(ILt(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 ILe(e,t){let n=Za(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 EP(e,t,n){let i=Za(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(){Ose(Za(n,void 0),e);for(let f of RLe){let d=Za(n,f);Ose(d,e)}},u,t)}function Ose(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 PLe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function PLt(e,t,n){let i=n._isDown,r=!1,o=Za(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,Ose(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 DLe(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=Za(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=Za(c,t);PLt(c,t,e),o[u]&&(n[u]?(PLe(i[u],r[u]),r[u].valid=!0,PLe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},un.MOUSE_MOVE,t)}function Ch(e){this._eventHandler=new ua(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,ILe(this,void 0),wLe(this,void 0,e),EP(this,void 0,cr.LEFT_DRAG),EP(this,void 0,cr.RIGHT_DRAG),EP(this,void 0,cr.MIDDLE_DRAG),DLe(this,void 0);for(let t of RLe)ILe(this,t),wLe(this,t,e),EP(this,t,cr.LEFT_DRAG),EP(this,t,cr.RIGHT_DRAG),EP(this,t,cr.MIDDLE_DRAG),DLe(this,t)}Object.defineProperties(Ch.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Za(cr.WHEEL)]||!this._update[Za(cr.WHEEL,to.SHIFT)]||!this._update[Za(cr.WHEEL,to.CTRL)]||!this._update[Za(cr.WHEEL,to.ALT)];return this._buttonsDown>0||e}}});Ch.prototype.isMoving=function(e,t){let n=Za(e,t);return!this._update[n]};Ch.prototype.getMovement=function(e,t){let n=Za(e,t);return this._movement[n]};Ch.prototype.getLastMovement=function(e,t){let n=Za(e,t),i=this._lastMovement[n];if(i.valid)return i};Ch.prototype.isButtonDown=function(e,t){let n=Za(e,t);return this._isDown[n]};Ch.prototype.getStartMousePosition=function(e,t){if(e===cr.WHEEL)return this._currentMousePosition;let n=Za(e,t);return this._eventStartPosition[n]};Ch.prototype.getButtonPressTime=function(e,t){let n=Za(e,t);return this._pressTime[n]};Ch.prototype.getButtonReleaseTime=function(e,t){let n=Za(e,t);return this._releaseTime[n]};Ch.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Ch.prototype.isDestroyed=function(){return!1};Ch.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var Iz=Ch;var Mse=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()}},Nse=Mse;function DLt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var vh=DLt;function Pz(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new iy({comparator:Pz.comparator})}Pz.prototype.addSubtree=function(e){let t=new RLt(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()};Pz.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}};Pz.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 RLt(e,t){this.subtree=e,this.stamp=t}var Dz=Pz;function cy(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(cy.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});cy.fromMetadataArray=function(e){return new cy({metadata:e})};cy.fromGltf=async function(e){let t=new Lf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new cy({loader:t})};cy.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=OLt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function OLt(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}cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var mC=cy;function Pl(){this._orientedBoundingBox=new Qt,this._boundingSphere=new ue,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 ia(h.negate(h.UNIT_X,new h),e.x),new ia(h.negate(h.UNIT_Y,new h),e.y),new ia(h.negate(h.UNIT_Z,new h),e.z),new ia(h.UNIT_X,-t.x),new ia(h.UNIT_Y,-t.y),new ia(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ay({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 MLt=new h,NLt=new h,LLt=new $,FLt=new h,BLt=new h;Pl.prototype.update=function(e,t,n,i,r){i=i??t.clone(FLt),r=r??n.clone(BLt),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,NLt);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=Bse(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.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(Lse(p.x,g.x),Lse(p.y,g.y),Lse(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function Lse(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var kLt=new N;Pl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,kLt),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 W7=new h,Fse=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),W7),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)),Fse);return Bse(c,u,this._shapeTransform,r)};var OLe=new h;Pl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,OLe),s=h.multiplyByScalar(o,r,OLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,W7),r,W7),c=h.add(a,s,Fse),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),W7),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),Fse);return Bse(d,p,this._shapeTransform,i)};Pl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Pl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var MLe=new h;function Bse(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,MLe),c=h.midpoint(e,t,MLt);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),MLe);let u=N.getRotation(n,LLt);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var pC=Pl;function dd(){this._orientedBoundingBox=new Qt,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=dd.DefaultMinBounds.clone(),this._maxBounds=dd.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=dd,n=[new ia(h.negate(h.UNIT_Z,new h),e.z),new ia(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ay({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(dd.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 ULt=new h,zLt=new h,VLt=new h,jLt=new h,HLt=new h,GLt=new N,WLt=new h,NLe=new U;dd.prototype.update=function(e,t,n,i,r){i=i??t.clone(zLt),r=r??n.clone(VLt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=dd,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,jLt),p=h.minimumByComponent(n,r,HLt),g=N.getScale(e,ULt);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=zse(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.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 qLt=new $,YLt=new $,XLt=new N;dd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,GLt),i=N.multiplyByPoint(n,e.camera.positionWC,WLt);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,NLe),NLe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],qLt),s=e.context.uniformState.inverseView,a=N.multiplyTransformation(n,s,XLt),c=N.getMatrix3(a,YLt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};dd.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 q7=new h,Use=new h;dd.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),q7),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),Use);return zse(c,u,this._shapeTransform,r)};var LLe=new h;dd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,LLe),s=h.multiplyByScalar(o,r,LLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,q7),r,q7),c=h.add(a,s,Use),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),q7),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),Use);return zse(d,p,this._shapeTransform,i)};dd.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));dd.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var KLt=5,$Lt=new Array(KLt),JLt=new h,ZLt=new $,QLt=new N,eFt=new N,tFt=new N,kse=new N,nFt=new h,iFt=new h,rFt=new h,BLe=new Array(8);for(let e=0;e<8;e++)BLe[e]=new h;function FLe(e,t,n){return Math.abs(se.dot(e,t))<n}function oFt(e){let t=N.getColumn(e,0,nFt),n=N.getColumn(e,1,iFt),i=N.getColumn(e,2,rFt),r=D.EPSILON4;return FLe(t,n,r)&&FLe(n,i,r)}function sFt(e,t){let n=BLe;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 Qt.fromPoints(n,t)}var aFt=new h;function zse(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=$Lt,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,JLt),O=$.fromRotationZ(d,ZLt),L=h.fromElements(x,T,E,aFt),_=N.fromScale(L,tFt),C=N.fromRotation(O,eFt),w=N.fromTranslation(R,QLt),P=N.multiplyTransformation(C,N.multiplyTransformation(w,_,kse),kse),M=N.multiplyTransformation(n,P,kse);return oFt(M)?Qt.fromTransformation(M,i):sFt(M,i)}var gC=dd;function Sh(){this._orientedBoundingBox=new Qt,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._rectangle=new ie,this._minimumHeight=Sh.DefaultMinBounds.z,this._maximumHeight=Sh.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(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 cFt=new h,lFt=new h,uFt=new h,fFt=new h,dFt=new h,hFt=new h,mFt=new h,pFt=new h,kLe=new h,ULe=new h,gFt=new ie;Sh.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Sh;i=i??o,r=r??s;let a=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=N.getScale(e,pFt),p=h.clone(o,cFt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,lFt),m=h.clamp(n,p,s,uFt),y=h.clamp(i,p,s,fFt),A=h.clamp(r,p,s,dFt),b=h.maximumByComponent(g,y,hFt),x=h.minimumByComponent(m,A,mFt),T=h.add(d,h.fromElements(m.z,m.z,m.z,kLe),kLe),E=h.add(d,h.fromElements(x.z,x.z,x.z,ULe),ULe);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,gFt);this._orientedBoundingBox=Vse(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=ue.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,bi=(m.x-o.x)/S,Wi=1-M/S,wi=(bi+.5*Wi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=wi,M>c){Xt=S/M;let hi=Xn-wi;rt=-Xt*(hi-Math.floor(hi))}}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 _Ft=new he,yFt=new h,AFt=new N,zLe=new $;Sh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,_Ft);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,yFt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,AFt),a=N.getRotation(s,zLe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,zLe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var YLe=new ie;Sh.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,YLe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return Vse(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var bFt=new U,xFt=new U,Rz=new U,VLe=new U,jLe=new U,Oz=new U;function TFt(e,t,n,i){let r=U.abs(e,bFt),o=U.fromElements(1/t.x,1/t.y,xFt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,Rz),a=U.multiplyComponents(t,s,VLe),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,Oz)),d=U.normalize(U.subtract(r,c,Oz),Oz),p=U.multiplyByScalar(d,f,Oz);s=U.multiplyComponents(U.add(p,c,Rz),o,Rz),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,Rz),Rz),a=U.multiplyComponents(t,s,VLe),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,Oz)),i)}var EFt=new U,HLe=new U,CFt=new h,GLe=new U;Sh.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,HLe),d=TFt(f,U.fromElements(i.x,i.z,EFt),r,CFt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,GLe),GLe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,HLe),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 WLe=new h,qLe=new h,vFt=new h;Sh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,WLe),s=h.multiplyByScalar(o,r,WLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,qLe),r,qLe),c=h.add(a,s,vFt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,YLe),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return Vse(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Vse(e,t,n,i,r,o,s){return s=Qt.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Sh.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-ee.WGS84.minimumRadius));Sh.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var _C=Sh;var df={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};df.getMinBounds=function(e){switch(e){case df.BOX:return pC.DefaultMinBounds;case df.ELLIPSOID:return _C.DefaultMinBounds;case df.CYLINDER:return gC.DefaultMinBounds}};df.getMaxBounds=function(e){switch(e){case df.BOX:return pC.DefaultMaxBounds;case df.ELLIPSOID:return _C.DefaultMaxBounds;case df.CYLINDER:return gC.DefaultMaxBounds}};df.getShapeConstructor=function(e){switch(e){case df.BOX:return pC;case df.ELLIPSOID:return _C;case df.CYLINDER:return gC}};Object.freeze(df);var xc=df;function Mz(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===xc.ELLIPSOID?U0.Z_UP:U0.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new Dz}Object.defineProperties(Mz.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}}});Mz.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();wFt(n);let i=NFt(n,t);await i.load();let{root:r}=n,o=tr(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new YT({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=LFt(s,c);Object.assign(u,IFt(r)),l(r.transform)?u.globalTransform=N.unpack(r.transform):u.globalTransform=N.clone(N.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=SFt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new Mz(u),d=new r0(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Li.unload(i),f};function SFt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Ud.TILESET_TILE_COUNT)}function wFt(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!tr(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!tr(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!tr(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function IFt(e){let t=e.boundingVolume;if(l(t.box))return OFt(t.box);if(l(t.region))return PFt(t.region);if(tr(t,"3DTILES_bounding_volume_cylinder"))return MFt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function PFt(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:xc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var DFt=new h,RFt=new $;function OFt(e){let t=Qt.unpack(e),n=$.getScale(t.halfAxes,DFt),i=$.getRotation(t.halfAxes,RFt);return{shape:xc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:N.fromRotationTranslation(i,t.center)}}function MFt(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:xc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function NFt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Li.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Li.getSchemaLoader({schema:i})}function LFt(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=XLe(b,T),v=XLe(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 XLe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function FFt(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 Lg.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}Mz.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 o0({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 FFt(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 mC.fromGltf(b)};var jse=Mz;function Hse(e){e=e??1,this._radius=e??1}Object.defineProperties(Hse.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Hse.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 Nz=Hse;var Y7={CUMULUS:0};Y7.validate=function(e){return e===Y7.CUMULUS};Object.freeze(Y7);var CP=Y7;var Lz=`uniform sampler2D u_noiseTexture; uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; in vec2 v_offset; @@ -8898,7 +9548,7 @@ out_FragColor = cloud; #endif #endif } -`;var $2=`#ifdef INSTANCED +`;var Fz=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScaleX; @@ -8938,7 +9588,7 @@ v_color = color; v_slice = slice; v_brightness = brightness; } -`;var J2=`uniform vec3 u_noiseTextureDimensions; +`;var Bz=`uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; uniform vec3 u_noiseOffset; in vec2 v_position; @@ -9015,7 +9665,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 Z2=`uniform vec3 u_noiseTextureDimensions; +`;var kz=`uniform vec3 u_noiseTextureDimensions; in vec2 position; out vec2 v_position; void main() @@ -9030,7 +9680,7 @@ transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; transformedPos.y *= noiseTextureRows; v_position = transformedPos; } -`;function vm(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 Hpt=vm.SHOW_INDEX=0,Gpt=vm.POSITION_INDEX=1,Wpt=vm.SCALE_INDEX=2,qpt=vm.MAXIMUM_SIZE_INDEX=3,Ypt=vm.SLICE_INDEX=4,Xpt=vm.BRIGHTNESS_INDEX=5,Kpt=vm.COLOR_INDEX=6;vm.NUMBER_OF_PROPERTIES=7;function zT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(vm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,zT(this,Hpt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),zT(this,Gpt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),zT(this,Wpt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),zT(this,qpt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),zT(this,Kpt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,zT(this,Ypt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,zT(this,Xpt))}}});vm.prototype._destroy=function(){this._cloudCollection=void 0};var Kf=vm;var $f,bG=new h,$pt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},Jpt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},Zpt=Kf.SHOW_INDEX,Qpt=Kf.POSITION_INDEX,e0t=Kf.SCALE_INDEX,t0t=Kf.MAXIMUM_SIZE_INDEX,n0t=Kf.SLICE_INDEX,i0t=Kf.BRIGHTNESS_INDEX,r0t=Kf.NUMBER_OF_PROPERTIES,o0t=Kf.COLOR_INDEX;function Sm(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(r0t),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: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 bG.x=e._textureSliceWidth,bG.y=e._noiseTextureRows,bG.z=1/e._noiseTextureRows,bG}}Object.defineProperties(Sm.prototype,{length:{get:function(){return See(this),this._clouds.length}}});function tCe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Sm.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??hw.CUMULUS,n;return t===hw.CUMULUS&&(n=new Kf(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Sm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Sm.prototype.removeAll=function(){tCe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function See(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}}Sm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Sm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Sm.prototype.get=function(e){return See(this),this._clouds[e]};var s0t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),a0t=new Uint16Array([0,1,2,0,2,3]);function c0t(e){let t=tt.createVertexBuffer({context:e,typedArray:s0t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:a0t,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 wee;function l0t(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 u0t(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 f0t(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 d0t(e,t,n){let i=[{index:$f.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:$f.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:$f.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:$f.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:$f.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:$f.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:f0t(e)});let r=n?t:4*t;return new Ag(e,i,r,n)}var vee=new Sn;function nCe(e,t,n,i){let r,o=n[$f.positionHighAndScaleX],s=n[$f.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,vee);let c=i.scale,u=vee.high,f=vee.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 iCe(e,t,n,i){let r,o=n[$f.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 rCe(e,t,n,i){let r,o=n[$f.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 oCe(e,t,n,i){let r,o=n[$f.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 h0t(e,t,n,i){nCe(e,t,n,i),iCe(e,t,n,i),rCe(e,t,n,i),oCe(e,t,n,i)}function m0t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=c0t(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:$n.NEAREST})});let f=new Bf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:eCe(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 p0t(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=d0t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];h0t(e,t,s,c)}n._vaf.commit(wee(i))}}var g0t=[];function _0t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=g0t;u.length=0,(c[Qpt]||c[e0t])&&u.push(nCe),(c[Zpt]||c[i0t])&&u.push(iCe),(c[t0t]||c[n0t])&&u.push(rCe),c[o0t]&&u.push(oCe);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(wee(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 y0t(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:$f}),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 A0t(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)}}}Sm.prototype.update=function(e){if(See(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&m0t(this,e,Z2,J2),this._instanced=e.context.instancedArrays,$f=this._instanced?Jpt:$pt,wee=this._instanced?u0t:l0t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?p0t(this,e):o>0&&_0t(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)&&y0t(this,e,$2,K2),A0t(this,e))};Sm.prototype.isDestroyed=function(){return!1};Sm.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),le(this)};var Iee=Sm;async function b0t(e,t,n,i){return l(i)||(i=!1),E0t(e,t,n,i)}function x0t(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(aCe(i)):o=r.then(aCe(i)).catch(C0t(i)),e.shift(),t.push(o),!0}function T0t(e){return new Promise(function(t){setTimeout(t,e)})}function Pee(e,t,n){return e.length?x0t(e,t,n)?Pee(e,t,n):T0t(100).then(()=>Pee(e,t,n)):Promise.resolve()}function E0t(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 Pee(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function sCe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function aCe(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(!sCe(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];sCe(s,i,n)}}):Promise.resolve()}}function C0t(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var Q2=b0t;var Dee=new U;async function cCe(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,Dee);let p=e.loadTileDataAvailability(Dee.x,Dee.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 Q2(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 cCe(e,a,n),t}var VT=cCe;async function Ree(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 Ree._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}Ree._sampleTerrainMostDetailed=VT;var jT=Ree;var v0t=D.toRadians(30);function Oee(e){this._angle=e??v0t}Object.defineProperties(Oee.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Oee.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 Mee=Oee;var Nee=[],Lee=[];function S0t(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=Nee,u=Lee,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 Fee(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Fee(e,t,n,i,o),Fee(e,t,n,o+1,r),S0t(e,t,n,i,o,r)}function w0t(e,t,n){let i=e.length,r=Math.ceil(i*.5);Nee.length=r,Lee.length=r,Fee(e,t,n,0,i-1),Nee.length=0,Lee.length=0}var f0=w0t;var I0t=new z,P0t=new z,D0t=new z,R0t=new z,lCe=new se,ek=new Uint8Array(4);function uCe(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 xG(e,t){return{height:e,color:z.clone(t)}}function fCe(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 O0t(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,Zu._minimumHeight,Zu._maximumHeight),y=z.clone(g.color,I0t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(xG(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||f0(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,xG(Zu._minimumHeight,c[0].color)),p&&c.splice(c.length,0,xG(Zu._maximumHeight,c[c.length-1].color)),c=fCe(c),i.push(c)}return i}function M0t(e){let t=O0t(e),n=[],i,r;function o(u,f){n.push(xG(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,R0t);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=uCe(m.height,x,b,D0t);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=uCe(b.height,y,m,P0t);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,Zu._emptyColor),o(b.height,Zu._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,Zu._emptyColor),o(m.height,Zu._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return fCe(n)}function Zu(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=M0t(n),o=r.length,s,a,c;if(!Zu._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,lCe),se.pack(lCe,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:$n.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(ek),d[g*4+0]=ek[0],d[g*4+1]=ek[1],d[g*4+2]=ek[2],d[g*4+3]=ek[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:$n.LINEAR})});return rr.fromType("ElevationBand",{heights:f,colors:p})}Zu._useFloatTexture=function(e){return e.floatingPointTexture};Zu._maximumHeight=5906376425472;Zu._minimumHeight=-5906376425472;Zu._emptyColor=new z(0,0,0,0);var Bee=Zu;async function N0t(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??Ta.defaultApiKey;if(!l(n))return L0t(t);let i,r=Ta.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Ta.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Yo.fromUrl(o,t)}var dCe={};async function L0t(e){let i=dCe[2275207];l(i)||(i=jo.fromAssetId(2275207),dCe[2275207]=i);let r=await i;return Yo.fromUrl(r,e)}var kee=N0t;async function F0t(e){let t=await Yo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new Qg({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Uee=F0t;function B0t(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 Bt({geometry:Gn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:Gn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:Gn.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 zee=B0t;var yCe=Qo(Ef(),1),hCe=576,k0t=100,tk="#ffffff",nk="#48b";function ACe(e,t){this.credit=e,this.count=t??1}function U0t(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 z0t(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 bCe="cesium-credit-delimiter";function mCe(e){let t=document.createElement("span");return t.textContent=e,t.className=bCe,t}function pCe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function gCe(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(mCe(n));else{let f=r[u];f.className!==bCe&&e.replaceChild(mCe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(pCe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(pCe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function V0t(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<hCe?(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>=hCe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function _Ce(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function j0t(e){let t=` +`;function cp(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 BFt=cp.SHOW_INDEX=0,kFt=cp.POSITION_INDEX=1,UFt=cp.SCALE_INDEX=2,zFt=cp.MAXIMUM_SIZE_INDEX=3,VFt=cp.SLICE_INDEX=4,jFt=cp.BRIGHTNESS_INDEX=5,HFt=cp.COLOR_INDEX=6;cp.NUMBER_OF_PROPERTIES=7;function yC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(cp.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,yC(this,BFt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),yC(this,kFt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),yC(this,UFt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),yC(this,zFt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),yC(this,HFt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,yC(this,VFt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,yC(this,jFt))}}});cp.prototype._destroy=function(){this._cloudCollection=void 0};var hd=cp;var md,X7=new h,GFt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},WFt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},qFt=hd.SHOW_INDEX,YFt=hd.POSITION_INDEX,XFt=hd.SCALE_INDEX,KFt=hd.MAXIMUM_SIZE_INDEX,$Ft=hd.SLICE_INDEX,JFt=hd.BRIGHTNESS_INDEX,ZFt=hd.NUMBER_OF_PROPERTIES,QFt=hd.COLOR_INDEX;function lp(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(ZFt),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:KLe(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 KLe(e){return function(){return X7.x=e._textureSliceWidth,X7.y=e._noiseTextureRows,X7.z=1/e._noiseTextureRows,X7}}Object.defineProperties(lp.prototype,{length:{get:function(){return Wse(this),this._clouds.length}}});function $Le(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}lp.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??CP.CUMULUS,n;return t===CP.CUMULUS&&(n=new hd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};lp.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};lp.prototype.removeAll=function(){$Le(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Wse(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}}lp.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};lp.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};lp.prototype.get=function(e){return Wse(this),this._clouds[e]};var eBt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),tBt=new Uint16Array([0,1,2,0,2,3]);function nBt(e){let t=nt.createVertexBuffer({context:e,typedArray:eBt,usage:Me.STATIC_DRAW}),n=nt.createIndexBuffer({context:e,typedArray:tBt,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 qse;function iBt(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=nt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function rBt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=nt.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 oBt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=nt.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 sBt(e,t,n){let i=[{index:md.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:md.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:md.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:md.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:md.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:md.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:oBt(e)});let r=n?t:4*t;return new n_(e,i,r,n)}var Gse=new Sn;function JLe(e,t,n,i){let r,o=n[md.positionHighAndScaleX],s=n[md.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,Gse);let c=i.scale,u=Gse.high,f=Gse.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 ZLe(e,t,n,i){let r,o=n[md.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 QLe(e,t,n,i){let r,o=n[md.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 eFe(e,t,n,i){let r,o=n[md.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 aBt(e,t,n,i){JLe(e,t,n,i),ZLe(e,t,n,i),QLe(e,t,n,i),eFe(e,t,n,i)}function cBt(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=nBt(a),r._spNoise=en.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 Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST})});let f=new Nf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:KLe(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 lBt(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=sBt(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];aBt(e,t,s,c)}n._vaf.commit(qse(i))}}var uBt=[];function fBt(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=uBt;u.length=0,(c[YFt]||c[XFt])&&u.push(JLe),(c[qFt]||c[JFt])&&u.push(ZLe),(c[KFt]||c[$Ft])&&u.push(QLe),c[QFt]&&u.push(eFe);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(qse(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 dBt(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=en.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:md}),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 hBt(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)}}}lp.prototype.update=function(e){if(Wse(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&cBt(this,e,kz,Bz),this._instanced=e.context.instancedArrays,md=this._instanced?WFt:GFt,qse=this._instanced?rBt:iBt;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?lBt(this,e):o>0&&fBt(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)&&dBt(this,e,Fz,Lz),hBt(this,e))};lp.prototype.isDestroyed=function(){return!1};lp.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(),$Le(this._clouds),le(this)};var Yse=lp;async function Xse(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 Xse._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}Xse._sampleTerrainMostDetailed=aC;var AC=Xse;var mBt=D.toRadians(30);function Kse(e){this._angle=e??mBt}Object.defineProperties(Kse.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Kse.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 $se=Kse;var pBt=new z,gBt=new z,_Bt=new z,yBt=new z,tFe=new se,Uz=new Uint8Array(4);function nFe(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 K7(e,t){return{height:e,color:z.clone(t)}}function iFe(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 ABt(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,hf._minimumHeight,hf._maximumHeight),y=z.clone(g.color,pBt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(K7(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||F0(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,K7(hf._minimumHeight,c[0].color)),p&&c.splice(c.length,0,K7(hf._maximumHeight,c[c.length-1].color)),c=iFe(c),i.push(c)}return i}function bBt(e){let t=ABt(e),n=[],i,r;function o(u,f){n.push(K7(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,yBt);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=nFe(m.height,x,b,_Bt);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=nFe(b.height,y,m,gBt);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,hf._emptyColor),o(b.height,hf._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,hf._emptyColor),o(m.height,hf._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return iFe(n)}function hf(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=bBt(n),o=r.length,s,a,c;if(!hf._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,tFe),se.pack(tFe,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 Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(Uz),d[g*4+0]=Uz[0],d[g*4+1]=Uz[1],d[g*4+2]=Uz[2],d[g*4+3]=Uz[3];let p=Dt.create({context:i,pixelFormat:Ke.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:Zn.LINEAR})});return Qi.fromType("ElevationBand",{heights:f,colors:p})}hf._useFloatTexture=function(e){return e.floatingPointTexture};hf._maximumHeight=5906376425472;hf._minimumHeight=-5906376425472;hf._emptyColor=new z(0,0,0,0);var Jse=hf;async function xBt(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??Ta.defaultApiKey;if(!l(n))return TBt(t);let i,r=Ta.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Ta.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Yo.fromUrl(o,t)}var rFe={};async function TBt(e){let i=rFe[2275207];l(i)||(i=Ho.fromAssetId(2275207),rFe[2275207]=i);let r=await i;return Yo.fromUrl(r,e)}var Zse=xBt;async function EBt(e){let t=await Yo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new l_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Qse=EBt;function CBt(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:Gn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Ft({geometry:Gn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Ft({geometry:Gn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new On({asynchronous:!1,geometryInstances:t,appearance:new yn({flat:!0,translucent:!1})})}var eae=CBt;var uFe=Qo(xf(),1),oFe=576,vBt=100,zz="#ffffff",Vz="#48b";function fFe(e,t){this.credit=e,this.count=t??1}function SBt(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 wBt(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 dFe="cesium-credit-delimiter";function sFe(e){let t=document.createElement("span");return t.textContent=e,t.className=dFe,t}function aFe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function cFe(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(sFe(n));else{let f=r[u];f.className!==dFe&&e.replaceChild(sFe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(aFe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(aFe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function IBt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<oFe?(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>=oFe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function lFe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function PBt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -9044,19 +9694,19 @@ v_position = transformedPos; .cesium-credit-lightbox { background-color: #303336; - color: ${tk}; + color: ${zz}; position: relative; - min-height: ${k0t}px; + min-height: ${vBt}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: ${tk}; + color: ${zz}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${nk}; + color: ${Vz}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -9076,10 +9726,10 @@ v_position = transformedPos; position: absolute; top: 0; right: 6px; - color: ${tk}; + color: ${zz}; } .cesium-credit-lightbox-close:hover { - color: ${nk}; + color: ${Vz}; } .cesium-credit-lightbox > ul { margin: 0; @@ -9098,20 +9748,20 @@ v_position = transformedPos; padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${tk}; + color: ${zz}; } .cesium-credit-expand-link:hover { - color: ${nk}; + color: ${Vz}; } .cesium-credit-expand-link:focus-visible, .cesium-credit-lightbox-close:focus-visible { - outline: 2px solid ${nk}; + outline: 2px solid ${Vz}; outline-offset: 2px; } .cesium-credit-text { - color: ${tk}; + color: ${zz}; } .cesium-credit-delimiter { @@ -9122,1648 +9772,1156 @@ v_position = transformedPos; .cesium-credit-logoContainer * { display: inline; } - -.cesium-credit-textContainer a:hover { - color: ${nk} -} - -.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 Xo(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=_Ce(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=_Ce(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),j0t(e);let m=It.clone(Xo.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 xCe(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 ACe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Xo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(TCe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,xCe(this,t,e)};Xo.prototype.addStaticCredit=function(e){let t=this._staticCredits;U0t(t,e)||t.push(e)};Xo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Xo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Xo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Xo.prototype.update=function(){this._expanded&&V0t(this)};Xo.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(Xo.cesiumCredit,this._cesiumCredit)||xCe(this,s,o,Number.MAX_VALUE)}It.equals(Xo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(Xo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Xo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;gCe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",gCe(this._creditList,t,void 0,"li"),z0t(this)};Xo.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),le(this)};Xo.prototype.isDestroyed=function(){return!1};Xo._cesiumCredit=void 0;Xo._cesiumCreditInitialized=!1;var TG;function TCe(){if(!l(TG)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new yCe.default(e).path()),TG=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Xo._cesiumCreditInitialized||(Xo._cesiumCredit=TG,Xo._cesiumCreditInitialized=!0),TG}Object.defineProperties(Xo,{cesiumCredit:{get:function(){return TCe(),Xo._cesiumCredit},set:function(e){Xo._cesiumCredit=e,Xo._cesiumCreditInitialized=!0}}});Xo.CreditDisplayElement=ACe;var ik=Xo;function H0t(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 rs({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var rk=H0t;var ok=`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 sk=`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; -} -`;var ak=`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; -} -`;function ck(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(ck.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});ck.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"?rk(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 rs({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=Lc.createGeometry(Lc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Gn.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:[ok]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?ak:sk,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)}};ck.prototype.isDestroyed=function(){return!1};ck.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(),le(this)};var HT=ck;function lk(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} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,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=vr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(lk.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}}});lk.prototype.getFragmentShaderSource=vr.prototype.getFragmentShaderSource;lk.prototype.isTranslucent=vr.prototype.isTranslucent;lk.prototype.getRenderState=vr.prototype.getRenderState;var Vee=lk;var EG=0,G0t=1;function GT(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=EG,a=Ki.packedLength):t instanceof mn&&(s=G0t,a=mn.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}GT.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===EG?(Ki.pack(r,t,n),n+=Ki.packedLength):(mn.pack(r,t,n),n+=mn.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 W0t=new Ki,q0t=new mn,Y0t=new Le,X0t=new h,K0t=new Be;GT.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===EG?(r=Ki.unpack(e,t,W0t),t+=Ki.packedLength):(r=mn.unpack(e,t,q0t),t+=mn.packedLength);let o=h.unpack(e,t,X0t);t+=h.packedLength;let s=Le.unpack(e,t,Y0t);t+=Le.packedLength;let a=Be.unpack(e,t,K0t);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new GT({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 mw(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 $0t=new $,J0t=new N,jee=new N,ECe=new h,CCe=new h,vCe=new h,Z0t=new h,Q0t=new h,egt=new h,BA=new Array(3),uk=new Array(4);uk[0]=new se(-1,-1,1,1);uk[1]=new se(1,-1,1,1);uk[2]=new se(1,1,1,1);uk[3]=new se(-1,1,1,1);var SCe=new Array(4);for(let e=0;e<4;++e)SCe[e]=new se;GT._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,$0t),u=o??ECe,f=s??CCe,d=a??vCe;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,J0t),g,m,y=i.projectionMatrix;if(n===EG){let A=N.multiply(y,p,jee);m=N.inverse(A,jee)}else g=N.inverseTransformation(p,jee);l(m)?(BA[0]=i.near,BA[1]=i.far):(BA[0]=0,BA[1]=i.near,BA[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(uk[b],SCe[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,BA[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=BA[A],v=BA[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}};GT.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);GT._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=ECe,b=CCe,x=vCe,T=h.negate(A,Z0t),E=h.negate(b,Q0t),v=h.negate(x,egt);u=0,o&&(mw(u,p,g,m,y,v,A,b),u+=12),mw(u,p,g,m,y,x,T,b),u+=12,mw(u,p,g,m,y,T,v,b),u+=12,mw(u,p,g,m,y,E,v,T),u+=12,mw(u,p,g,m,y,A,x,b),u+=12,mw(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:ue.fromVertices(c)})};var WT=GT;var Hee=0,tgt=1;function fk(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Ki?(o=Hee,s=Ki.packedLength):t instanceof mn&&(o=tgt,s=mn.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}fk.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===Hee?(Ki.pack(r,t,n),n+=Ki.packedLength):(mn.pack(r,t,n),n+=mn.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 ngt=new Ki,igt=new mn,rgt=new Le,ogt=new h;fk.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===Hee?(r=Ki.unpack(e,t,ngt),t+=Ki.packedLength):(r=mn.unpack(e,t,igt),t+=mn.packedLength);let o=h.unpack(e,t,ogt);t+=h.packedLength;let s=Le.unpack(e,t,rgt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new fk({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};fk.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);WT._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 St({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(s)})};var dk=fk;function CG(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 sgt=new h,agt=new $,cgt=new Le,lgt=new Ki,ugt=new Yl,fgt=new mn,dgt=new bs,hgt=new z,mgt=[1,1e5];CG.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=lgt:s instanceof Yl?a=ugt:s instanceof mn?a=fgt:a=dgt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=mgt,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,sgt);let m=agt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,cgt);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 Bt({geometry:new WT({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,hgt))},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Mn({geometryInstances:new Bt({geometry:new dk({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)};CG.prototype.isDestroyed=function(){return!1};CG.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 le(this)};var d0=CG;function wCe(){this._cachedShowFrustumsShaders={}}function pgt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function ggt(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 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+="}",r.sources.push(a);let u=pgt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var hk=new z;function _gt(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?(hk.red=t.debugOverlappingFrustums&1?1:0,hk.green=t.debugOverlappingFrustums&2?1:0,hk.blue=t.debugOverlappingFrustums&4?1:0,hk.alpha=1,hk):z.WHITE}),n}var ygt=new at;wCe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=ggt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,ygt);o.shaderProgram=r,o.uniformMap=_gt(e,t),o.execute(e.context,n)};var mk=wCe;var OCe=[];function Agt(e,t,n,i,r){let o=OCe;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 pk(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??un.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}pk.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 MCe=ee.clone(ee.UNIT_SPHERE),NCe=new Be,qT={positions:void 0,colors:void 0,ellipsoid:MCe,vertexFormat:NCe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};pk.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,MCe);t+=ee.packedLength;let c=Be.unpack(e,t,NCe);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):(qT.positions=o,qT.colors=s,qT.width=u,qT.colorsPerVertex=f,qT.arcType=d,qT.granularity=p,new pk(qT))};var ICe=new h,PCe=new h,DCe=new h,RCe=new h;pk.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=Br(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===un.GEODESIC||o===un.RHUMB){let M,F;o===un.GEODESIC?(M=D.chordLength(s,a.maximumRadius),F=or.numberOfPoints):(M=s,F=or.numberOfPointsRhumbLine);let V=or.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=Agt(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,OCe.length=0}o===un.GEODESIC?p=or.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:V}):p=or.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=ICe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,DCe),h.clone(p[u],PCe),u===g-1?(O=ICe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,RCe);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(PCe,y,v),h.pack(DCe,A,v),h.pack(RCe,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 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,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:ue.fromPoints(p),geometryType:Dd.POLYLINES})};var __=pk;var gk=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_color = color; -} -`;var bgt=`#define CLIP_POLYLINE -${Gl} -${gk}`,xgt=vT;function YT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=YT.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??bgt,this._fragmentShaderSource=e.fragmentShaderSource??xgt,this._renderState=vr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(YT.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}}});YT.VERTEX_FORMAT=Be.POSITION_ONLY;YT.prototype.getFragmentShaderSource=vr.prototype.getFragmentShaderSource;YT.prototype.isTranslucent=vr.prototype.isTranslucent;YT.prototype.getRenderState=vr.prototype.getRenderState;var Ys=YT;function vG(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}vG.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 Bt({geometry:new __({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ys.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:un.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new __({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ys.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:un.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new __({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ys.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:un.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 Ys,asynchronous:!1})}this._primitive.update(e)}};vG.prototype.isDestroyed=function(){return!1};vG.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var _k=vG;var Tgt=new TextDecoder,SG={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},Egt={LAYERS:3},yk={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Gee={TAGS:2,TYPE:3,GEOMETRY:4},XT={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},Cgt=["Unknown","Point","LineString","Polygon"];function vgt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=wG(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===Egt.LAYERS&&s===2){let a=y_(t,i,t.length);i=a.newPos;let c=Qu(i,a.value,t.length,"layer");n.push(Sgt(t,i,c)),i=c}else i=IG(t,i,s,t.length)}return{layers:n}}function Sgt(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=wG(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===yk.NAME&&p===2){let g=y_(e,i,n);i=g.newPos;let m=Qu(i,g.value,n,"layer name");r=qee(e,i,g.value),i=m}else if(d===yk.FEATURES&&p===2){let g=y_(e,i,n);i=g.newPos;let m=Qu(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===yk.KEYS&&p===2){let g=y_(e,i,n);i=g.newPos;let m=Qu(i,g.value,n,"key");s.push(qee(e,i,g.value)),i=m}else if(d===yk.VALUES&&p===2){let g=y_(e,i,n);i=g.newPos;let m=Qu(i,g.value,n,"value"),y=Pgt(e,i,m);a.push(y),i=m}else if(d===yk.EXTENT&&p===0){let g=pw(e,i,n);o=g.value,i=g.newPos}else i=IG(e,i,p,n)}let u=c.map(({start:f,end:d})=>wgt(e,f,d,s,a));return{name:r,extent:o,features:u}}function wgt(e,t,n,i,r){let o=t,s=SG.UNKNOWN,a=[],c=[];for(;o<n;){let d=wG(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===Gee.TYPE&&g===0){let m=pw(e,o,n);s=m.value,o=m.newPos}else if(p===Gee.TAGS&&g===2){let m=y_(e,o,n);o=m.newPos;let y=Qu(o,m.value,n,"feature tags");for(;o<y;){let A=pw(e,o,y);a.push(A.value),o=A.newPos}}else if(p===Gee.GEOMETRY&&g===2){let m=y_(e,o,n);o=m.newPos;let y=Qu(o,m.value,n,"feature geometry");for(;o<y;){let A=pw(e,o,y);c.push(A.value),o=A.newPos}}else o=IG(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=Igt(s,c);return{type:Cgt[s]??"Unknown",geometry:f,properties:u}}function Igt(e,t){let n=0,i=0,r=0;if(e===SG.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+=h0(t[n++]),r+=h0(t[n++]),o.push({x:i,y:r})}return o}if(e===SG.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+=h0(t[n++]),r+=h0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=h0(t[n++]),r+=h0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===SG.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+=h0(t[n++]),r+=h0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=h0(t[n++]),r+=h0(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 Pgt(e,t,n){let i=t;for(;i<n;){let r=wG(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===XT.STRING&&s===2){let a=y_(e,i,n);i=a.newPos;let c=Qu(i,a.value,n,"string value");return qee(e,i,c-i)}else{if(o===XT.FLOAT&&s===5)return Qu(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===XT.DOUBLE&&s===1)return Qu(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===XT.INT64&&s===0){let a=gw(e,i,n);return Wee(a.value)}else if(o===XT.UINT64&&s===0){let a=gw(e,i,n);return Wee(a.value)}else if(o===XT.SINT64&&s===0){let a=gw(e,i,n);return Wee(Dgt(a.value))}else if(o===XT.BOOL&&s===0)return pw(e,i,n).value!==0}i=IG(e,i,s,n)}}function wG(e,t,n){let i=pw(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function pw(e,t,n){let i=gw(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function y_(e,t,n){let i=gw(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 gw(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 qee(e,t,n){let i=Qu(t,n,e.length,"string");return Tgt.decode(e.subarray(t,i))}function Qu(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 IG(e,t,n,i){if(n===0)return gw(e,t,i).newPos;if(n===1)return Qu(t,8,i,"fixed64 field");if(n===2){let r=y_(e,t,i);return Qu(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return Qu(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function h0(e){return e>>>1^-(e&1)}function Dgt(e){return e>>1n^-(e&1n)}function Wee(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var Ak=vgt;var bk=`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); -} -else -{ -position = vec3(0.0); -direction = normalize(positionEC.xyz); -} -czm_ray ray = czm_ray(position, direction); -vec3 ellipsoid_center = czm_view[3].xyz; -czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); -if (!czm_isEmpty(intersection)) -{ -out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); -} -else -{ -discard; -} -czm_writeLogDepth(); -} -`;var xk=`in vec4 position; -out vec4 positionEC; -void main() -{ -positionEC = czm_modelView * position; -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -} -`;function Ek(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 Tk=dn.supportsTypedArrays()?new Float32Array(12):[],LCe=new h,FCe=new h,Yee=new h,BCe=new h,PG=new h;function Rgt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof mn)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,LCe),g=h.normalize(p,FCe),m=h.normalize(h.cross(h.UNIT_Z,p,Yee),Yee),y=h.normalize(h.cross(g,m,BCe),BCe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,LCe);let x=b/A;o=h.multiplyByScalar(m,x,FCe),s=h.multiplyByScalar(y,x,Yee)}let a=h.add(r,s,PG);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,Tk,0);let c=h.subtract(r,s,PG);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,Tk,3);let u=h.add(r,s,PG);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,Tk,6);let f=h.subtract(r,s,PG);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,Tk,9),Tk}Ek.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 ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Ye({sources:[xk]}),a=new Ye({sources:[bk]});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=Rgt(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}};Ek.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};Ek.prototype.isDestroyed=function(){return!1};Ek.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Ck=Ek;function KT(){}var Ogt=/\bgl_FragDepth\b/,Mgt=/\bdiscard\b/;function Ngt(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(Ogt.test(o[a])||Mgt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() -{ - out_FragColor = vec4(1.0); -} -`;i=new Ye({sources:[a]})}else if(!r&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`;i=new Ye({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Lgt(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}KT.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=Ngt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Lgt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var Fgt=/\s+czm_writeLogDepth\(/,Bgt=/\s+czm_vertexLogDepth\(/;function kgt(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(Bgt.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() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)Fgt.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(); -} -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}KT.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=kgt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Ugt(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 () -{ - 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 Xee(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}KT.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=Ugt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Xee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var zgt=`uint rgba8UnormToUint32(vec4 c) -{ - uvec4 b = uvec4(c * 255.0 + 0.5); - return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); -} -`;function Vgt(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=`${zgt} -void main () -{ - 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})}KT.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=Vgt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Xee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function _w(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 jgt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function kCe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function UCe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function Hgt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=kCe(n,i,r)}return e.normalized||(n=UCe(n,e.componentType)),n}function Ggt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=kCe(r,o,s)}return e.normalized||(r=UCe(r,e.componentType)),r}function Wgt(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=jgt(u);if(p===1)d[0]=Hgt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=Ggt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Vf.METADATA_PICKING_ENABLED),_w(g,Vf.METADATA_PICKING_VALUE_TYPE,f),_w(g,Vf.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),_w(g,Vf.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),_w(g,Vf.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),_w(g,Vf.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),_w(g,Vf.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})}KT.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Wgt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Xee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function qgt(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})}KT.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=qgt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var wm=KT;function DG(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 Ygt=new Le,zCe=new Le,Xgt=new $;function Kgt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,zCe),c=Le.fromAxisAngle(o,i,Ygt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,zCe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,Xgt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}DG.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;Kgt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};DG.prototype.isDestroyed=function(){return!1};DG.prototype.destroy=function(){return this._removeListener(),le(this)};var vk=DG;function $gt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var Kee=$gt;function kA(){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(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,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};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,le(this)};var Sk=kA;var yw=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; -in vec3 v_positionEC; -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) -{ -vec3 positionEC = czm_pointAlongRay(ray, intersection); -vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; -vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); -vec3 sphericalNormal = normalize(positionMC / u_radii); -vec3 normalMC = geodeticNormal * side; -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 -} -void main() -{ -float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; -vec3 direction = normalize(v_positionEC); -vec3 ellipsoidCenter = czm_modelView[3].xyz; -float t1 = -1.0; -float t2 = -1.0; -float b = -2.0 * dot(direction, ellipsoidCenter); -float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; -float discriminant = b * b - 4.0 * c; -if (discriminant >= 0.0) { -t1 = (-b - sqrt(discriminant)) * 0.5; -t2 = (-b + sqrt(discriminant)) * 0.5; -} -if (t1 < 0.0 && t2 < 0.0) { -discard; -} -float t = min(t1, t2); -if (t < 0.0) { -t = 0.0; -} -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; -} -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 -#endif -} -`;var Aw=`in vec3 position; -uniform vec3 u_radii; -out vec3 v_positionEC; -void main() -{ -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(); -} -`;var $ee={position:0};function RG(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 ue,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??rr.fromType(rr.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 Jgt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Lc.createGeometry(Lc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=zn.fromGeometry({context:e,geometry:n,attributeLocations:$ee,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}RG.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:Ui.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?tn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Jgt(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),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 c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ye({sources:[Aw]}),p=new Ye({sources:[this.material.shaderSource,yw]}),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:$ee}),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:[Aw]}),p=new Ye({sources:[this.material.shaderSource,yw],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:$ee}),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)}};RG.prototype.isDestroyed=function(){return!1};RG.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(),le(this)};var wk=RG;var Ik=`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 + +.cesium-credit-textContainer a:hover { + color: ${Vz} } -`;var Pk=`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; + +.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { + padding-left: 5px; } -`;function $T(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:rr.fromType(rr.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??Pk,this._fragmentShaderSource=e.fragmentShaderSource??Ik,this._renderState=vr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties($T.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 $T.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});$T.VERTEX_FORMAT=Be.POSITION_AND_ST;$T.prototype.getFragmentShaderSource=vr.prototype.getFragmentShaderSource;$T.prototype.isTranslucent=vr.prototype.isTranslucent;$T.prototype.getRenderState=vr.prototype.getRenderState;var Jee=$T;var Zgt=new h,Qgt=new h,e_t=new h,t_t=new h,n_t=new h,i_t=new h(1,1,1),VCe=Math.cos,jCe=Math.sin;function A_(e){e=e??H.EMPTY_OBJECT;let t=e.radii??i_t,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"}A_.packedLength=2*h.packedLength+Be.packedLength+7;A_.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 HCe=new h,GCe=new h,WCe=new Be,UA={radii:HCe,innerRadii:GCe,vertexFormat:WCe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};A_.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,HCe);t+=h.packedLength;let r=h.unpack(e,t,GCe);t+=h.packedLength;let o=Be.unpack(e,t,WCe);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):(UA.minimumClock=s,UA.maximumClock=a,UA.minimumCone=c,UA.maximumCone=u,UA.stackPartitions=f,UA.slicePartitions=d,UA.offsetAttribute=p===-1?void 0:p,new A_(UA))};A_.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]=jCe(g[f]),j[f]=VCe(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=VCe(m[d]),k[d]=jCe(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,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,Zgt),Xe=Se.geodeticSurfaceNormal(He,Qgt);if(L[f]&&h.negate(Xe,Xe),a.st){let $e=U.negate(Xe,n_t);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=e_t,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,t_t);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===gn.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:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var Zee;A_.getUnitEllipsoid=function(){return l(Zee)||(Zee=A_.createGeometry(new A_({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),Zee};var Xa=A_;function bw(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 Xa(i),this._workerName="createSphereGeometry"}bw.packedLength=Xa.packedLength;bw.pack=function(e,t,n){return Xa.pack(e._ellipsoidGeometry,t,n)};var r_t=new Xa,zA={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};bw.unpack=function(e,t,n){let i=Xa.unpack(e,t,r_t);return zA.vertexFormat=Be.clone(i._vertexFormat,zA.vertexFormat),zA.stackPartitions=i._stackPartitions,zA.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,zA.radii),n._ellipsoidGeometry=new Xa(zA),n):(zA.radius=i._radii.x,new bw(zA))};bw.createGeometry=function(e){return Xa.createGeometry(e._ellipsoidGeometry)};var Dk=bw;var Rk=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; +`;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=lFe(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=lFe(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),PBt(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 kt,lightboxCredits:new kt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function hFe(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 fFe(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(mFe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,hFe(this,t,e)};Jo.prototype.addStaticCredit=function(e){let t=this._staticCredits;SBt(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&&IBt(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)||hFe(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;cFe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",cFe(this._creditList,t,void 0,"li"),wBt(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),le(this)};Jo.prototype.isDestroyed=function(){return!1};Jo._cesiumCredit=void 0;Jo._cesiumCreditInitialized=!1;var $7;function mFe(){if(!l($7)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new uFe.default(e).path()),$7=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=$7,Jo._cesiumCreditInitialized=!0),$7}Object.defineProperties(Jo,{cesiumCredit:{get:function(){return mFe(),Jo._cesiumCredit},set:function(e){Jo._cesiumCredit=e,Jo._cesiumCreditInitialized=!0}}});Jo.CreditDisplayElement=fFe;var jz=Jo;var Hz=`uniform samplerCube u_cubeMap; +in vec3 v_texCoord; void main() { -vec3 positionToEyeEC = -v_positionEC; -mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = tangentToEyeMatrix; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); +out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); } -`;var Ok=`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; +`;var Gz=`in vec3 position; +out vec3 v_texCoord; void main() { -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; +vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -`;var Mk=`in vec3 v_positionEC; -in vec3 v_normalEC; +`;var Wz=`uniform mat3 u_cubeMapPanoramaTransform; +in vec3 position; +out vec3 v_texCoord; void main() { -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -`;var Nk=`in vec3 position3DHigh; +`;function qz(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(qz.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});qz.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"?xU(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 ts({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=Gn.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:[Hz]});a.shaderProgram=en.fromCache({context:o,vertexShaderSource:l(this._transform)?Wz:Gz,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)}};qz.prototype.isDestroyed=function(){return!1};qz.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(),le(this)};var bC=qz;function Yz(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 vec3 normal; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +${n?"":`in ${i} ${t}; +`}out ${i} ${r}; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var Lk=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${r}; +${o} void main() { -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var Fk=`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; +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=wr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(Yz.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}}});Yz.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Yz.prototype.isTranslucent=wr.prototype.isTranslucent;Yz.prototype.getRenderState=wr.prototype.getRenderState;var tae=Yz;function J7(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 DBt=new h,RBt=new $,OBt=new Le,MBt=new Ji,NBt=new yu,LBt=new gn,FBt=new As,BBt=new z,kBt=[1,1e5];J7.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 Ji?a=MBt:s instanceof yu?a=NBt:s instanceof gn?a=LBt:a=FBt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=kBt,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,DBt);let m=RBt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,OBt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new On({geometryInstances:new Ft({geometry:new rC({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,BBt))},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new On({geometryInstances:new Ft({geometry:new kU({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)};J7.prototype.isDestroyed=function(){return!1};J7.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 le(this)};var z0=J7;function pFe(){this._cachedShowFrustumsShaders={}}function UBt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function zBt(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 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+="}",r.sources.push(a);let u=UBt(i);return en.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var Xz=new z;function VBt(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?(Xz.red=t.debugOverlappingFrustums&1?1:0,Xz.green=t.debugOverlappingFrustums&2?1:0,Xz.blue=t.debugOverlappingFrustums&4?1:0,Xz.alpha=1,Xz):z.WHITE}),n}var jBt=new at;pFe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=zBt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,jBt);o.shaderProgram=r,o.uniformMap=VBt(e,t),o.execute(e.context,n)};var Kz=pFe;function Z7(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}Z7.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 U_({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:js.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 U_({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:js.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 U_({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:js.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 On({geometryInstances:[t,n,i],appearance:new js,asynchronous:!1})}this._primitive.update(e)}};Z7.prototype.isDestroyed=function(){return!1};Z7.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var $z=Z7;var HBt=new TextDecoder,Q7={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},GBt={LAYERS:3},Jz={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},nae={TAGS:2,TYPE:3,GEOMETRY:4},xC={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},WBt=["Unknown","Point","LineString","Polygon"];function qBt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=eW(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===GBt.LAYERS&&s===2){let a=ly(t,i,t.length);i=a.newPos;let c=mf(i,a.value,t.length,"layer");n.push(YBt(t,i,c)),i=c}else i=tW(t,i,s,t.length)}return{layers:n}}function YBt(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=eW(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===Jz.NAME&&p===2){let g=ly(e,i,n);i=g.newPos;let m=mf(i,g.value,n,"layer name");r=rae(e,i,g.value),i=m}else if(d===Jz.FEATURES&&p===2){let g=ly(e,i,n);i=g.newPos;let m=mf(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===Jz.KEYS&&p===2){let g=ly(e,i,n);i=g.newPos;let m=mf(i,g.value,n,"key");s.push(rae(e,i,g.value)),i=m}else if(d===Jz.VALUES&&p===2){let g=ly(e,i,n);i=g.newPos;let m=mf(i,g.value,n,"value"),y=$Bt(e,i,m);a.push(y),i=m}else if(d===Jz.EXTENT&&p===0){let g=vP(e,i,n);o=g.value,i=g.newPos}else i=tW(e,i,p,n)}let u=c.map(({start:f,end:d})=>XBt(e,f,d,s,a));return{name:r,extent:o,features:u}}function XBt(e,t,n,i,r){let o=t,s=Q7.UNKNOWN,a=[],c=[];for(;o<n;){let d=eW(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===nae.TYPE&&g===0){let m=vP(e,o,n);s=m.value,o=m.newPos}else if(p===nae.TAGS&&g===2){let m=ly(e,o,n);o=m.newPos;let y=mf(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===nae.GEOMETRY&&g===2){let m=ly(e,o,n);o=m.newPos;let y=mf(o,m.value,n,"feature geometry");for(;o<y;){let A=vP(e,o,y);c.push(A.value),o=A.newPos}}else o=tW(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=KBt(s,c);return{type:WBt[s]??"Unknown",geometry:f,properties:u}}function KBt(e,t){let n=0,i=0,r=0;if(e===Q7.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+=V0(t[n++]),r+=V0(t[n++]),o.push({x:i,y:r})}return o}if(e===Q7.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+=V0(t[n++]),r+=V0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=V0(t[n++]),r+=V0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===Q7.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+=V0(t[n++]),r+=V0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=V0(t[n++]),r+=V0(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 $Bt(e,t,n){let i=t;for(;i<n;){let r=eW(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===xC.STRING&&s===2){let a=ly(e,i,n);i=a.newPos;let c=mf(i,a.value,n,"string value");return rae(e,i,c-i)}else{if(o===xC.FLOAT&&s===5)return mf(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===xC.DOUBLE&&s===1)return mf(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===xC.INT64&&s===0){let a=SP(e,i,n);return iae(a.value)}else if(o===xC.UINT64&&s===0){let a=SP(e,i,n);return iae(a.value)}else if(o===xC.SINT64&&s===0){let a=SP(e,i,n);return iae(JBt(a.value))}else if(o===xC.BOOL&&s===0)return vP(e,i,n).value!==0}i=tW(e,i,s,n)}}function eW(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=SP(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function ly(e,t,n){let i=SP(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 SP(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 rae(e,t,n){let i=mf(t,n,e.length,"string");return HBt.decode(e.subarray(t,i))}function mf(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 tW(e,t,n,i){if(n===0)return SP(e,t,i).newPos;if(n===1)return mf(t,8,i,"fixed64 field");if(n===2){let r=ly(e,t,i);return mf(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return mf(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function V0(e){return e>>>1^-(e&1)}function JBt(e){return e>>1n^-(e&1n)}function iae(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var Zz=qBt;var Qz=`in vec4 positionEC; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function JT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??JT.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:rr.fromType(rr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=vr.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(JT.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}}});JT.prototype.getFragmentShaderSource=vr.prototype.getFragmentShaderSource;JT.prototype.isTranslucent=vr.prototype.isTranslucent;JT.prototype.getRenderState=vr.prototype.getRenderState;JT.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:Nk,fragmentShaderSource:Mk}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:Fk,fragmentShaderSource:Lk}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:Ok,fragmentShaderSource:Rk})};var Cr=JT;var o_t=1e5;function Bk(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:o_t,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 Dk({radius:this._radius,vertexFormat:Be.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),r=new rr({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Mn({geometryInstances:i,appearance:new Cr({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(Bk.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)}}});Bk.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};Bk.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};Bk.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var Qee=Bk;function ete(){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(ete.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var s_t=new h;ete.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,s_t),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 kk=ete;function ef(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??ef.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??ef.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??ef.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??ef.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??ef.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){a_t(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(){c_t(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}ef.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};ef.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new ef({scene:e})),e._frameRateMonitor};Object.defineProperties(ef.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}}});ef.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};ef.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function a_t(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 c_t(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var Uk=ef;function l_t(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 zk=l_t;var nte=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=u_t(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 ku({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new il({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new Ua({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:JCe(m.points[b],r,u),pickObject:i?tte(this,x,this._points,Dc,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:qCe(m.polylines[b],r,s),pickObject:i?tte(this,x,this._polylines,Aa,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:qCe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?tte(this,T,this._polygons,Oo,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=As(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=As(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),le(this)}isDestroyed(){return!1}};function tte(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 u_t(e){let t=f_t(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(YCe(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(T_t(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 f_t(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(b_t(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function YCe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":XCe(e.coordinates,t.points);return;case"MultiPoint":h_t(e.coordinates,t.points);return;case"LineString":KCe(e.coordinates,t.polylines);return;case"MultiLineString":m_t(e.coordinates,t.polylines);return;case"Polygon":$Ce(e.coordinates,t.polygons);return;case"MultiPolygon":p_t(e.coordinates,t.polygons);return;case"GeometryCollection":d_t(e.geometries,t);return;default:return}}function d_t(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)YCe(e[n],t)}function XCe(e,t){let n=ite(e);l(n)&&t.push(n)}function h_t(e,t){for(let n=0;n<e.length;n++)XCe(e[n],t)}function KCe(e,t){let n=g_t(e);l(n)&&n.length>=2&&t.push(n)}function m_t(e,t){for(let n=0;n<e.length;n++)KCe(e[n],t)}function $Ce(e,t){let n=__t(e);l(n)&&t.push(n)}function p_t(e,t){for(let n=0;n<e.length;n++)$Ce(e[n],t)}function g_t(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=ite(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function __t(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=y_t(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 y_t(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=ite(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&A_t(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function ite(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 A_t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function b_t(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function JCe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var x_t=new h;function qCe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=JCe(e[o],t,x_t);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function T_t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var rte=nte;function E_t(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); - vec4 clippingPlanesEdgeColor = vec4(1.0); - clippingPlanesEdgeColor.rgb = ${n}.rgb; - float clippingPlanesEdgeWidth = ${n}.a; - if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) - { - out_FragColor = clippingPlanesEdgeColor; - } -`}var Vk=E_t;var C_t=new U;function v_t(e,t){let n=e.unionClippingRegions,i=e.length,r=Ts.useFloatTexture(t),o=Ts.getTextureResolution(e,t,C_t),s=o.x,a=o.y,c=r?I_t(s,a):P_t(s,a);return c+=` -`,c+=n?S_t(i):w_t(i),c}function S_t(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +vec3 position; +vec3 direction; +if (czm_orthographicIn3D == 1.0) { - 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; +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); } -`}function w_t(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 I_t(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) +else { - 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); +position = vec3(0.0); +direction = normalize(positionEC.xyz); } -`}function P_t(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) +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)) { - 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); +out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); +} +else +{ +discard; } -`}var ZT=v_t;function D_t(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 jk=D_t;function R_t(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 Hk=R_t;var ZCe={NONE:0,LERC:1};Object.freeze(ZCe);var ah=ZCe;function m0(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(m0.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 QCe=new h;m0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,QCe);return ste(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};m0.prototype.isScaledSpacePointVisible=function(e){return ste(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var O_t=new h;m0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=O_t,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),ste(e,r,i)};m0.prototype.computeHorizonCullingPoint=function(e,t,n){return nve(this._ellipsoid,e,t,n)};var eve=ee.clone(ee.UNIT_SPHERE);m0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=tve(this._ellipsoid,n,eve);return nve(r,e,t,i)};m0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return ive(this._ellipsoid,e,t,n,i,r)};m0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=tve(this._ellipsoid,r,eve);return ive(s,e,t,n,i,o)};var M_t=[];m0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,M_t),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var N_t=new h;function tve(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,N_t);e=ee.fromCartesian3(i,n)}return e}function nve(e,t,n,i){l(i)||(i=new h);let r=sve(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=rve(e,c,r);if(u<0)return;o=Math.max(o,u)}return ove(r,o,i)}var OG=new h;function ive(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=sve(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){OG.x=n[c]+r.x,OG.y=n[c+1]+r.y,OG.z=n[c+2]+r.z;let f=rve(e,OG,s);if(f<0)return;a=Math.max(a,f)}return ove(s,a,o)}function ste(e,t,n){let i=t,r=n,o=h.subtract(e,i,QCe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var L_t=new h,F_t=new h;function rve(e,t,n){let i=e.transformPositionToScaledSpace(t,L_t),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,F_t);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 ove(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var ote=new h;function sve(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,ote),h.normalize(ote,ote))}var Im=m0;var ave={NONE:0,BITS12:1};Object.freeze(ave);var Ka=ave;var Gk=new h,B_t=new h,ch=new U,k_t=new N,U_t=new N,z_t=Math.pow(2,12);function kc(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,B_t),A=i-n;Math.max(h.maximumComponent(y),A)<z_t-1?f=Ka.BITS12:f=Ka.NONE;let x=N.fromScale(y,k_t);x=N.setTranslation(x,g,x);let T=N.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,Gk),U_t);T=N.multiplyByTranslation(T,h.negate(g,Gk),T),p=N.clone(r,new N);let E=N.getTranslation(r,Gk);E=h.subtract(E,e,Gk),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()}kc.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,Gk),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,ch);let p=cn.compressTextureCoordinates(ch);U.fromElements(n.z,d,ch);let g=cn.compressTextureCoordinates(ch);U.fromElements(c,u,ch);let m=cn.compressTextureCoordinates(ch);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,ch);let y=cn.compressTextureCoordinates(ch);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 V_t=new h,cve=new h;kc.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,V_t),c=n.geodeticSurfaceNormal(a,cve),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};kc.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]}};kc.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],ch);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],ch);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)};kc.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,cve),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};kc.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)};kc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?cn.decompressTextureCoordinates(e[t+1],ch).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};kc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?cn.decompressTextureCoordinates(e[t+3],ch).x:e[t+6]};kc.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)};kc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};kc.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};kc.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 MG={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},NG={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};kc.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(MG.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(MG.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(MG.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(NG.compressed0,a?4:3),c&&s(NG.compressed1,1),this.hasGeodeticSurfaceNormals&&s(NG.geodeticSurfaceNormal,3)}return o};kc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?MG:NG};kc.clone=function(e,t){if(l(e))return l(t)||(t=new kc),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 To=kc;var p0={};p0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var ate=new h,j_t=new N,H_t=new h,G_t=new h;p0.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??p0.DEFAULT_STRUCTURE,P=w.heightScale??p0.DEFAULT_STRUCTURE.heightScale,M=w.heightOffset??p0.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??p0.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??p0.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??p0.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??p0.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,j_t),we,Se;R&&(we=_i.geodeticLatitudeToMercatorAngle(T),Se=1/(_i.geodeticLatitudeToMercatorAngle(v)-we));let Re=H_t;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=G_t;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,gi;R&&(gi=(_i.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),bd=Bs*n(qi),xp=J*Wc,Nh=Z*bd,Tp=1/i(xp*Wc+Nh*bd+no*Ks),ks=xp*Tp,tc=Nh*Tp,Kb=no*Tp,ri=new h;ri.x=ks+Wc*Bn,ri.y=tc+bd*Bn,ri.z=Kb+Ks*Bn,N.multiplyByPoint(ge,ri,ate),h.minimumByComponent(ate,Re,Re),h.maximumByComponent(ate,Qe,Qe),He=Math.min(He,Bn),qe[Nr]=ri,vt[Nr]=new U(ki,Zi),st[Nr]=Bn,R&&(Gt[Nr]=gi),C&&(lt[Nr]=m.geodeticSurfaceNormal(ri))}}let Bi=ue.fromPoints(qe),Xn;l(b)&&(Xn=en.fromRectangle(b,Ae,fe,m));let bi;I&&(bi=new Im(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let Wi=new Nf(Re,Qe,S),wi=new To(S,Wi,He,fe,xe,!1,R,C,O,L),hi=new Float32Array(Pe*wi.stride),xi=0;for(let jn=0;jn<Pe;++jn)xi=wi.encode(hi,xi,qe[jn],vt[jn],st[jn],void 0,Gt[jn],lt[jn]);return{vertices:hi,maximumHeight:fe,minimumHeight:Ae,encoding:wi,boundingSphere3D:Bi,orientedBoundingBox:Xn,occludeePointInScaledSpace:bi}};var xw=p0;function VA(){pe.throwInstantiationError()}Object.defineProperties(VA.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});VA.prototype.interpolateHeight=pe.throwInstantiationError;VA.prototype.isChildAvailable=pe.throwInstantiationError;VA.prototype.createMesh=pe.throwInstantiationError;VA.prototype.upsample=pe.throwInstantiationError;VA.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;VA.maximumAsynchronousTasks=5;var tf=VA;var W_t=3,lte=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new N,this._needsRebuild=!0,this._rootNode=new ute}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&X_t(this,n);let s=this._inverseTransform,a=Y_t;a.origin=N.multiplyByPoint(s,t.origin,a.origin),a.direction=N.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return uve(this._rootNode,a,c),Q_t(this,c,t,i,r,o)}},q_t=new Kn("incrementallyBuildTerrainPicker"),ute=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=lve(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=lve(n.x,n.y,n.level),this.children[t]=n}},Y_t=new pn,LG=[new h,new h,new h];function X_t(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 K_t=new h,$_t=new h;function lve(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,K_t),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,$_t);return Nf.fromCorners(r,o)}function J_t(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 Z_t=new zs;function uve(e,t,n){let i=yi.rayAxisAlignedBoundingBox(t,e.aabb,Z_t);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new zs(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)uve(e.children[o],t,n)}function Q_t(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=eyt(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 eyt(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>=W_t)&&!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=cte(a,r,o,t,u,c[3*A],LG[0]),x=cte(a,r,o,t,u,c[3*A+1],LG[1]),T=cte(a,r,o,t,u,c[3*A+2],LG[2]),E=yi.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&J_t(g,m,LG,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);nyt(e._inverseTransform,n,m,g)}return s}var tyt=new he;function cte(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,tyt);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 nyt(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=q_t.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 Wk=lte;function qk(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 Wk(t,n,p)}qk.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?iyt(this,this._transform):uyt(this,t,this._transform))};function iyt(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,fte).z<=D.EPSILON16&&(fte.z=1,N.setScale(t,fte,t)),t}var ryt=new h,oyt=new h,syt=new he,ayt=new he,cyt=new h,lyt=new h,fte=new h;function uyt(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,syt),ryt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,ayt),oyt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,cyt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,lyt);return N.fromTranslation(d,n),N.setScale(n,f,n),N.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}qk.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};qk.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};qk.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var mc=qk;function b_(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??ah.NONE;let t=xw.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===ah.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(b_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var fve="createVerticesFromHeightmap",fyt=new Kn(fve),dyt=new Kn(fve,tf.maximumAsynchronousTasks);b_.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?dyt:fyt).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 zi,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=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new mc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),To.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};b_.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=xw.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 zi,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new mc(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};b_.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===ah.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=dve(A,b,f,d,e,i,r,t,n)}else y=hyt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};b_.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)),_=dve(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,myt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new b_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};b_.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};b_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function hyt(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=FG(e,t,n,i,r,m*s+p),T=FG(e,t,n,i,r,m*s+g),E=FG(e,t,n,i,r,y*s+p),v=FG(e,t,n,i,r,y*s+g);return hve(A,b,x,T,E,v)}function dve(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 hve(y,A,b,x,T,E)}function hve(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function FG(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 myt(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 Uc=b_;function Tw(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(Tw.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(){}}});Tw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Uc({buffer:new Uint8Array(256),width:16,height:16}))};Tw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Tw.prototype.getTileDataAvailable=function(e,t,n){};Tw.prototype.loadTileDataAvailability=function(e,t,n){};var g0=Tw;var Yk=`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 -#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) +czm_writeLogDepth(); +} +`;var eV=`in vec4 position; +out vec4 positionEC; +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); +positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); } -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +`;function nV(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 tV=dn.supportsTypedArrays()?new Float32Array(12):[],gFe=new h,_Fe=new h,oae=new h,yFe=new h,nW=new h;function ZBt(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,gFe),g=h.normalize(p,_Fe),m=h.normalize(h.cross(h.UNIT_Z,p,oae),oae),y=h.normalize(h.cross(g,m,yFe),yFe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,gFe);let x=b/A;o=h.multiplyByScalar(m,x,_Fe),s=h.multiplyByScalar(y,x,oae)}let a=h.add(r,s,nW);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,tV,0);let c=h.subtract(r,s,nW);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,tV,3);let u=h.add(r,s,nW);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,tV,6);let f=h.subtract(r,s,nW);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,tV,9),tV}nV.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 ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Ye({sources:[eV]}),a=new Ye({sources:[Qz]});r&&(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 o=ZBt(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}};nV.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};nV.prototype.isDestroyed=function(){return!1};nV.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var iV=nV;function TC(){}var QBt=/\bgl_FragDepth\b/,e2t=/\bdiscard\b/;function t2t(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(QBt.test(o[a])||e2t.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() { -return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); + out_FragColor = vec4(1.0); } -#endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() +`;i=new Ye({sources:[a]})}else if(!r&&s){let a=`void main() { -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; + out_FragColor = vec4(1.0); + czm_writeLogDepth(); } -#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) +`;i=new Ye({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function n2t(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}TC.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=t2t(n,t.shaderProgram),i.depthOnlyCommand.renderState=n2t(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var i2t=/\s+czm_writeLogDepth\(/,r2t=/\s+czm_vertexLogDepth\(/;function o2t(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(r2t.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() { -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; + czm_log_depth_main(); + czm_vertexLogDepth(); } -else if (split > 0.0 && gl_FragCoord.x < splitPosition) { -alpha = 0.0; +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)i2t.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(); } -#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)); +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}TC.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=o2t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function s2t(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 () +{ + 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 sae(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}TC.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=s2t(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=sae(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var a2t=`uint rgba8UnormToUint32(vec4 c) +{ + uvec4 b = uvec4(c * 255.0 + 0.5); + return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -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() +`;function c2t(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=`${a2t} +void main () { -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) + 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})}TC.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=c2t(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=sae(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function wP(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 l2t(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function AFe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function bFe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function u2t(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=AFe(n,i,r)}return e.normalized||(n=bFe(n,e.componentType)),n}function f2t(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=AFe(r,o,s)}return e.normalized||(r=bFe(r,e.componentType)),r}function d2t(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=l2t(u);if(p===1)d[0]=u2t(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=f2t(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Vf.METADATA_PICKING_ENABLED),wP(g,Vf.METADATA_PICKING_VALUE_TYPE,f),wP(g,Vf.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),wP(g,Vf.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),wP(g,Vf.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),wP(g,Vf.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),wP(g,Vf.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})}TC.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=d2t(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=sae(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function h2t(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})}TC.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=h2t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var up=TC;function iW(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 m2t=new Le,xFe=new Le,p2t=new $;function g2t(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,xFe),c=Le.fromAxisAngle(o,i,m2t),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,xFe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,p2t);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}iW.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;g2t(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};iW.prototype.isDestroyed=function(){return!1};iW.prototype.destroy=function(){return this._removeListener(),le(this)};var rV=iW;function _2t(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var aae=_2t;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 ui({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,le(this)};var oV=Nb;var IP=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; +in vec3 v_positionEC; +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) { -direction = vec3(0.0, 0.0, -1.0); +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 } -else +void main() { -direction = normalize(vec3(xy, -czm_currentFrustum.x)); +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; } -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; +if (t1 < 0.0 && t2 < 0.0) { +discard; } -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) +float t = min(t1, t2); +if (t < 0.0) { +t = 0.0; +} +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; } +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 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; +} +`;var PP=`in vec3 position; +uniform vec3 u_radii; +out vec3 v_positionEC; +void main() +{ +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(); +} +`;var cae={position:0};function rW(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 ue,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??Qi.fromType(Qi.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 y2t(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:cae,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}rW.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=y2t(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),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 c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ye({sources:[PP]}),p=new Ye({sources:[this.material.shaderSource,IP]}),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=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:cae}),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:[PP]}),p=new Ye({sources:[this.material.shaderSource,IP],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=en.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:cae}),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)}};rW.prototype.isDestroyed=function(){return!1};rW.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(),le(this)};var sV=rW;var aV=`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 -#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); +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 -float nightBlend = 0.0; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #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 cV=`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() { -cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; +vec4 p = czm_computePosition(); +v_positionMC = position3DHigh + position3DLow; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -else if (czm_sceneMode == czm_sceneModeColumbusView) +`;function EC(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:Qi.fromType(Qi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??cV,this._fragmentShaderSource=e.fragmentShaderSource??aV,this._renderState=wr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(EC.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 EC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});EC.VERTEX_FORMAT=Be.POSITION_AND_ST;EC.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;EC.prototype.isTranslucent=wr.prototype.isTranslucent;EC.prototype.getRenderState=wr.prototype.getRenderState;var lae=EC;var A2t=1e5;function lV(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:A2t,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 JU({radius:this._radius,vertexFormat:Be.ALL}),i=new Ft({geometry:n,modelMatrix:this._transform}),r=new Qi({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new On({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(lV.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)}}});lV.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};lV.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};lV.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var uae=lV;function fae(){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(fae.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var b2t=new h;fae.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,b2t),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 uV=fae;function pf(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??pf.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??pf.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??pf.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??pf.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??pf.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){x2t(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(){T2t(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}pf.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};pf.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new pf({scene:e})),e._frameRateMonitor};Object.defineProperties(pf.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}}});pf.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};pf.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};pf.prototype.isDestroyed=function(){return!1};pf.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function x2t(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 T2t(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var fV=pf;function E2t(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 dV=E2t;var hae=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=C2t(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 Ku({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 Ua({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:wFe(m.points[b],r,u),pickObject:i?dae(this,x,this._points,Bc,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:TFe(m.polylines[b],r,s),pickObject:i?dae(this,x,this._polylines,ya,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:TFe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?dae(this,T,this._polygons,Mo,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=_s(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=_s(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),le(this)}isDestroyed(){return!1}};function dae(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 C2t(e){let t=v2t(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(EFe(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(F2t(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 v2t(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(N2t(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function EFe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":CFe(e.coordinates,t.points);return;case"MultiPoint":w2t(e.coordinates,t.points);return;case"LineString":vFe(e.coordinates,t.polylines);return;case"MultiLineString":I2t(e.coordinates,t.polylines);return;case"Polygon":SFe(e.coordinates,t.polygons);return;case"MultiPolygon":P2t(e.coordinates,t.polygons);return;case"GeometryCollection":S2t(e.geometries,t);return;default:return}}function S2t(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)EFe(e[n],t)}function CFe(e,t){let n=mae(e);l(n)&&t.push(n)}function w2t(e,t){for(let n=0;n<e.length;n++)CFe(e[n],t)}function vFe(e,t){let n=D2t(e);l(n)&&n.length>=2&&t.push(n)}function I2t(e,t){for(let n=0;n<e.length;n++)vFe(e[n],t)}function SFe(e,t){let n=R2t(e);l(n)&&t.push(n)}function P2t(e,t){for(let n=0;n<e.length;n++)SFe(e[n],t)}function D2t(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=mae(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function R2t(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=O2t(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=fi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function O2t(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=mae(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&M2t(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function mae(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 M2t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function N2t(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function wFe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var L2t=new h;function TFe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=wFe(e[o],t,L2t);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function F2t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var pae=hae;function B2t(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 hV=B2t;var k2t=new U;function U2t(e,t){let n=e.unionClippingRegions,i=e.length,r=bs.useFloatTexture(t),o=bs.getTextureResolution(e,t,k2t),s=o.x,a=o.y,c=r?j2t(s,a):H2t(s,a);return c+=` +`,c+=n?z2t(i):V2t(i),c}function z2t(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -cameraDist = -czm_view[3].z; + 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; } -else +`}function V2t(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -cameraDist = length(czm_view[3]); -} -float fadeOutDist = u_lightingFadeDistance.x; -float fadeInDist = u_lightingFadeDistance.y; -if (czm_sceneMode != czm_sceneMode3D) { -vec3 radii = czm_ellipsoidRadii; -float maxRadii = max(radii.x, max(radii.y, radii.z)); -fadeOutDist -= maxRadii; -fadeInDist -= maxRadii; + 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 j2t(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); } -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) +`}function H2t(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) { -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); + 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); } +`}var CC=U2t;function G2t(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 mV=G2t;function W2t(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 pV=W2t;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_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; +#ifdef APPLY_SPLIT +uniform float u_dayTextureSplit[TEXTURE_UNITS]; #endif -czm_material material = czm_getMaterial(materialInput); -vec4 materialColor = vec4(material.diffuse, material.alpha); -color = alphaBlend(materialColor, color); +#ifdef APPLY_BRIGHTNESS +uniform float u_dayTextureBrightness[TEXTURE_UNITS]; #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; +#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 ENABLE_CLIPPING_PLANES -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; -if (clipDistance < clippingPlanesEdgeWidth) -{ -finalColor = clippingPlanesEdgeColor; -} +#ifdef APPLY_GAMMA +uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; #endif -#ifdef ENABLE_CLIPPING_POLYGONS -bool insideAny = vectorClip(v_textureCoordinates.xy); -#ifdef CLIPPING_INVERSE -if (!insideAny) { -discard; -} -#else -if (insideAny) { -discard; -} +#ifdef APPLY_IMAGERY_CUTOUT +uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; #endif +#ifdef APPLY_COLOR_TO_ALPHA +uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; #endif -#ifdef HIGHLIGHT_FILL_TILE -finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; #endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) -vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else -vec3 atmosphereLightDirection = czm_lightDirectionWC; +#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 -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -if (!czm_backFacing()) -{ -bool dynamicLighting = false; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) -dynamicLighting = true; +#ifdef SHOW_OCEAN_WAVES +uniform sampler2D u_oceanNormalMap; #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; +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +uniform vec2 u_lightingFadeDistance; #endif -#ifdef COLOR_CORRECT -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels); +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_cartographicLimitRectangle; #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; +#ifdef GROUND_ATMOSPHERE +uniform vec2 u_nightFadeDistance; #endif -#ifndef HDR -fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); +#ifdef ENABLE_CLIPPING_PLANES +uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; #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); +#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) +uniform float u_minimumBrightness; #endif -#ifndef HDR -finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); -#else -finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); +#ifdef COLOR_CORRECT +uniform vec3 u_hsbShift; #endif -finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); +#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 -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); -} +uniform vec4 u_undergroundColor; +uniform vec4 u_undergroundColorAlphaByDistance; #endif -#ifdef HAS_VECTOR_LAYER -finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); -finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); +#ifdef ENABLE_VERTEX_LIGHTING +uniform float u_lambertDiffuseMultiplier; +uniform float u_vertexShadowDarkness; #endif -#ifdef TRANSLUCENT -if (inTranslucencyRectangle()) +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) { -vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; -finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); +float startDistance = nearFarScalar.x; +float startValue = nearFarScalar.y; +float endDistance = nearFarScalar.z; +float endValue = nearFarScalar.w; +float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); +return mix(startValue, endValue, t); } #endif -out_FragColor = finalColor; -} -#ifdef SHOW_REFLECTIVE_OCEAN -float waveFade(float edge0, float edge1, float x) +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { -float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -return pow(1.0 - y, 5.0); +return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } -float linearFade(float edge0, float edge1, float x) +#endif +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() { -return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.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; } -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); +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) +{ +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 -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; +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 -return vec4(color, imageryColor.a); -} -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var Xk=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; +#if !defined(APPLY_GAMMA) +vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); +color = tempColor.rgb; +alpha = tempColor.a; #else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; +color = pow(color, vec3(textureOneOverGamma)); #endif -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; +#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 EXAGGERATION -uniform vec2 u_verticalExaggerationAndRelativeHeight; +#ifdef APPLY_BRIGHTNESS +color = mix(vec3(0.0), color, textureBrightness); #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; +#ifdef APPLY_CONTRAST +color = mix(vec3(0.5), color, textureContrast); #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; +#ifdef APPLY_HUE +color = czm_hue(color, textureHue); #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; +#ifdef APPLY_SATURATION +color = czm_saturation(color, textureSaturation); #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); +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)); } -float get2DMercatorYPositionFraction(vec2 textureCoordinates) +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() { -const float maxTileWidth = 0.003068; -float positionFraction = textureCoordinates.y; -float southLatitude = u_southAndNorthLatitude.x; -float northLatitude = u_southAndNorthLatitude.y; -if (northLatitude - southLatitude > maxTileWidth) +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 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); +direction = vec3(0.0, 0.0, -1.0); } -return positionFraction; +else +{ +direction = normalize(vec3(xy, -czm_currentFrustum.x)); } -float get2DGeographicYPositionFraction(vec2 textureCoordinates) +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() { -return textureCoordinates.y; +#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; } -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +#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)) { -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; +color = vec4(1.0, 0.0, 0.0, 1.0); } -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +#endif +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +float cameraDist; +if (czm_sceneMode == czm_sceneMode2D) { -return getPositionPlanarEarth(position, 0.0, textureCoordinates); +cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; } -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +else if (czm_sceneMode == czm_sceneModeColumbusView) { -return getPositionPlanarEarth(position, height, textureCoordinates); +cameraDist = -czm_view[3].z; } -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +else { -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; +cameraDist = length(czm_view[3]); } -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; +float fadeOutDist = u_lightingFadeDistance.x; +float fadeInDist = u_lightingFadeDistance.y; +if (czm_sceneMode != czm_sceneMode3D) { +vec3 radii = czm_ellipsoidRadii; +float maxRadii = max(radii.x, max(radii.y, radii.z)); +fadeOutDist -= maxRadii; +fadeInDist -= maxRadii; +} +float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); +#else +float fade = 0.0; #endif -void main() +#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) { -#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; +mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); +vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC); +vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx); +vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); +color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); +} #endif -#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 +#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 -vec3 position3DWC = position + u_center3D; -#ifdef GEODETIC_SURFACE_NORMALS -vec3 ellipsoidNormal = geodeticSurfaceNormal; +#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 -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; +vec4 finalColor = color; #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); +#ifdef ENABLE_CLIPPING_PLANES +vec4 clippingPlanesEdgeColor = vec4(1.0); +clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; +float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; +if (clipDistance < clippingPlanesEdgeWidth) +{ +finalColor = clippingPlanesEdgeColor; +} #endif -v_normalMC = normalMC; -v_normalEC = czm_normal3D * v_normalMC; +#ifdef ENABLE_CLIPPING_POLYGONS +bool insideAny = vectorClip(v_textureCoordinates.xy); +#ifdef CLIPPING_INVERSE +if (!insideAny) { +discard; +} +#else +if (insideAny) { +discard; +} #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 +#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 -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; +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +if (!czm_backFacing()) +{ +bool dynamicLighting = false; +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) +dynamicLighting = true; #endif -} -`;var Ew=`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), +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, -atmosphereInnerRadius, rayleighColor, mieColor, opacity ); -} -`;var dte=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}},hte=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(ZT(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(Hg);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(pyt(Xe)),Gt.sources.push(gyt(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:Gt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[$e]=new dte(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 le(this)}};function pyt(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 gyt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var Kk=hte;var mve={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(mve);var Ko=mve;var pve={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(pve);var $a=pve;var gve={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(gve);var kr=gve;var _0=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 ue,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)&&(Ss.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Nc.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===$a.START&&(_yt(t,n,i,r),t.state=$a.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===$a.LOADING&&yyt(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=$a.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){_ve(this,!0,t,n)}removeGeodeticSurfaceNormals(t){_ve(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 _ve(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=To.clone(s);c.hasGeodeticSurfaceNormals=t,c=To.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?(_0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=_0._createVertexArrayForMesh(i.context,r)):(_0._freeVertexArray(e.vertexArray),e.vertexArray=_0._createVertexArrayForMesh(i.context,r)),_0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function _yt(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 yyt(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||_0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&Ayt(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&byt(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&Tyt(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(Eyt(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)vyt(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 Ayt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=$a.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 byt(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=Jr.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 xyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Tyt(e,t,n,i,r,o){let s=n.tilingScheme,a=xyt;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 Eyt(e,t,n,i,r,o,s){e.vertexArray=_0._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function Cyt(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:$n.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function vyt(e,t){let n=t.terrainData.waterMask,i=Cyt(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 lh=_0;var Syt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},wn=Syt;var yve={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>=yve.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},pi=yve;function vw(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}vw.prototype.update=function(e,t,n){this.changedThisFrame&&(vve(e,t,this.tile,n),this.changedThisFrame=!1)};vw.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};vw.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):lh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var wyt=new fA;vw.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=wyt;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);Ia(e,n,c,u,s,wn.EAST,!1,a,i),Ia(e,n,c,f,s,wn.NORTH,!1,a,i),Ia(e,n,c,d,s,wn.WEST,!1,a,i),Ia(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);Ia(e,n,c,g,s,wn.SOUTHEAST,!1,a,i),Ia(e,n,c,y,s,wn.SOUTHWEST,!1,a,i),Ia(e,n,c,m,s,wn.NORTHEAST,!1,a,i),Ia(e,n,c,A,s,wn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ia(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||pi.wasKicked(u._lastSelectionResult)||pi.originalResult(u._lastSelectionResult)===pi.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===pi.RENDERED){if(l(u.data.vertexArray))return;Iyt(e,t,n,u,o,r,a,c);return}if(pi.originalResult(i._lastSelectionResult)!==pi.CULLED)switch(o){case wn.WEST:Ia(e,t,n,i.northwestChild,r,o,!0,a,c),Ia(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.EAST:Ia(e,t,n,i.southeastChild,r,o,!0,a,c),Ia(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTH:Ia(e,t,n,i.southwestChild,r,o,!0,a,c),Ia(e,t,n,i.southeastChild,r,o,!0,a,c);break;case wn.NORTH:Ia(e,t,n,i.northeastChild,r,o,!0,a,c),Ia(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHWEST:Ia(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHEAST:Ia(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTHWEST:Ia(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.SOUTHEAST:Ia(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function Iyt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new vw(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),Pyt(e,t,n,i,r,a)}function Pyt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(vve(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 QT=new he,Dyt=new he,Cw=new h,_te=new h,mte=new U,pte=new U,Jf=new U;function HG(){this.height=0,this.encodedNormal=new U}function BG(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 Sve(e,t,n,i,u,c),c}var Ryt={minimumHeight:0,maximumHeight:0},Oyt=new h,Ave=new HG,bve=new HG,xve=new HG,Tve=new HG,Myt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,Nyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function vve(e,t,n,i){lh.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=UG(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,xve),p=UG(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,Ave),g=UG(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,bve),m=UG(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Tve);d=BG(o,f,0,1,d,p,m,g,xve),p=BG(o,f,0,0,p,d,g,m,Ave),g=BG(o,f,1,1,g,p,m,d,bve),m=BG(o,f,1,1,m,g,d,p,Tve);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 Uc({width:9,height:9,buffer:Myt,structure:{heightOffset:E}}),P=Nyt;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,Dyt);P.height=v;let M=f.cartographicToCartesian(P,Oyt),F=new To(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=Ryt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=kG(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=VG(o,f,F,G,q,o.westTiles,o.westMeshes,wn.EAST,j);let W=q;q=kG(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=VG(o,f,F,G,q,o.southTiles,o.southMeshes,wn.NORTH,j);let J=q;q=kG(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=VG(o,f,F,G,q,o.eastTiles,o.eastMeshes,wn.WEST,j);let Z=q;q=kG(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=VG(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=_i.geodeticLatitudeToMercatorAngle(s.south),fe=1/(_i.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(_i.geodeticLatitudeToMercatorAngle(P.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(QT,_te),we=cn.octEncode(ge,mte),Se=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,Jf),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 mc(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),Vyt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,Gt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=lh._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 kG(e,t,n,i,r,o,s,a,c,u,f){let d=QT;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,Cw),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,_te));let m=pte;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 jG=new ie;function $k(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,jG),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,jG),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 Lyt=new U;function gte(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 Fyt=new U,Byt=new h;function kyt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=$k(t,n,f.decodeTextureCoordinates(d,r,Jf),Jf),g=$k(t,n,f.decodeTextureCoordinates(d,o,pte),pte),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;QT.longitude=D.lerp(b.west,b.east,s),QT.latitude=D.lerp(b.south,b.north,a),u.height=QT.height=D.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,Lyt),E=f.getOctEncodedNormal(d,o,Fyt),v=cn.octDecode(T.x,T.y,Cw),S=cn.octDecode(E.x,E.y,Byt);x=h.lerp(v,S,m,Cw),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(QT,Cw),cn.octEncode(x,u.encodedNormal)}function Sve(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(QT,Cw);cn.octEncode(s,o.encodedNormal)}function UG(e,t,n,i,r,o,s,a,c,u,f){if(Cve(e,t,a,s,!1,n,i,f)||Cve(e,t,u,c,!0,n,i,f))return f;let p;if(yte(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],gte(o,p,n,i,f),f;let g;if(n===0?i===0?g=zG(e.westMeshes,e.westTiles,wn.EAST,e.southMeshes,e.southTiles,wn.NORTH,n,i):g=zG(e.northMeshes,e.northTiles,wn.SOUTH,e.westMeshes,e.westTiles,wn.EAST,n,i):i===0?g=zG(e.southMeshes,e.southTiles,wn.NORTH,e.eastMeshes,e.eastTiles,wn.WEST,n,i):g=zG(e.eastMeshes,e.eastTiles,wn.WEST,e.northMeshes,e.northTiles,wn.SOUTH,n,i),l(g))return Sve(e,t,n,i,g,f),f}function zG(e,t,n,i,r,o,s,a){let c=Eve(e,t,!1,n,s,a),u=Eve(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function VG(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=Uyt(e,t,n,i,r,o[u],s[u],a,c);return r}function Uyt(e,t,n,i,r,o,s,a,c){let u;a===wn.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,jG),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===wn.WEST&&o.x===0&&(u=ie.clone(o.rectangle,jG),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,Jf),d=Jf.x,p=Jf.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=_i.geodeticLatitudeToMercatorAngle(f.south),v=1/(_i.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,Jf);$k(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,Cw),M=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,mte):(F=mte,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=D.lerp(f.south,f.north,L);V=(_i.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(P,_te)),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 Eve(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(!yte(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 yte(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Cve(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(yte(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,Jf);let y=$k(g,e.tile,Jf,Jf);if(y.x===o&&y.y===s)return gte(m,p,o,s,a),!0;if(d=wr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,Jf);let x=$k(g,e.tile,Jf,Jf);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 kyt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return gte(m,c[d],o,s,a),!0}return!1}var zyt=[new h,new h,new h,new h];function Vyt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=zyt;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 Sw=vw;var Ate=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=Pn.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){Ts.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Nc.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(Gyt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=Hyt(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(),Xyt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)lh._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:cc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.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&&Sw.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&&Wyt(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;qyt(this,g,m,t);let y=m.tileBoundingRegion;yAt(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),Rve(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===pi.CULLED_BUT_NEEDED,o=i.terrainState),lh.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,lh.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=Mve(this,n);if(n.fog.enabled&&!o&&D.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=WG(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,Ove);if(!l(d))return Ko.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=Kyt,ue.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=ue.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 mn;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=Zyt;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=Qyt;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:pi.NONE;if(p===pi.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===pi.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,eAt),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){cAt(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(),le(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]=lAt(p,t,i),a.state=$a.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=$a.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==pi.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)}},jyt=new ie;function Hyt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,jyt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function Gyt(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 Wyt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Nc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function qyt(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 Yyt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function Xyt(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 Rve(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 Kyt=new ue,Ove=new ie,$yt=new ie,Jyt=new he;function WG(e,t){if(t.west<t.east)return t;let n=ie.clone(t,$yt);return ie.center(e,Jyt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function Mve(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 Zyt=[],Qyt=[],eAt=new h,wve=new N,GG=new N,tAt=new se,nAt=new se,iAt=new se,rAt=new h,Ive=new h,oAt=new h,sAt=new h,aAt=[new h,new h,new h,new h];function Pve(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=aAt;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 cAt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new lh);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Wf({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=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Pve(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=Pve(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 lAt(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 uAt=new N,fAt=new N;function Dve(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,Ive);return N.setTranslation(i,r,wve),wve},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,Ive);return N.setTranslation(i,o,GG),N.multiply(r,GG,GG),GG},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,uAt):N.IDENTITY;return N.inverseTranspose(r,fAt)},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 dAt(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=hAt(e,r,i),n.wireframeVertexArray.mesh=i}}function hAt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Gn.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 Nve,Lve,qG;(function(){let e=new Bt({geometry:Tm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new l_({radius:1})}),n=new N,i,r;function o(s){return new Mn({geometryInstances:s,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}Nve=function(s,a){return s===i||(qG(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},Lve=function(s,a){return s===i||(qG(),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},qG=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var mAt=new se(0,0,0,0),pAt={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},gAt=z.TRANSPARENT,_At=new qt;function yAt(e,t,n){let i=t.data;if(Yyt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new Sw(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??gAt,A=e.undergroundColorAlphaByDistance??_At,b=Mve(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=Pn.castShadows(e.shadows)&&!d,w=Pn.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=tAt,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),oAt),Xt=mt.project(ie.northeast(t.rectangle),sAt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Xt.x,ae.w=Xt.y,n.mode!==re.MORPHING&&(k=rAt,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 _i&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=_i.geodeticLatitudeToMercatorAngle(Ae),ge=1/(_i.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let Se=pAt;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)||qG(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=Dve(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 ue,ft.orientedBoundingBox=void 0,Xt=Dve(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)?Nve(ks,z.RED).update(n):l(tc)&&Lve(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 bi=nAt,Wi=WG(t.rectangle,e.cartographicLimitRectangle),wi=iAt,hi=WG(t.rectangle,m);h.fromElements(P,M,F,rt.hsbShift);let xi=t.rectangle,jn=1/xi.width,nn=1/xi.height;bi.x=(Wi.west-xi.west)*jn,bi.y=(Wi.south-xi.south)*nn,bi.z=(Wi.east-xi.west)*jn,bi.w=(Wi.north-xi.south)*nn,se.clone(bi,rt.localizedCartographicLimitRectangle),wi.x=(hi.west-xi.west)*jn,wi.y=(hi.south-xi.south)*nn,wi.z=(hi.east-xi.west)*jn,wi.w=(hi.north-xi.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,gi=!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 Kb=ks.useWebMercatorT?tc.textureWebMercator:tc.texture,ri=tc.imageryLayer;l(ks.textureTranslationAndScale)||(ks.textureTranslationAndScale=ri._calculateTextureTranslationAndScale(t,ks)),rt.dayTextures[mt]=Kb,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,gi=gi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ri.dayAlpha,gi=gi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ri.brightness,Zi=Zi||rt.dayTextureBrightness[mt]!==Is.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ri.contrast,Mr=Mr||rt.dayTextureContrast[mt]!==Is.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ri.hue,fo=fo||rt.dayTextureHue[mt]!==Is.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ri.saturation,Bs=Bs||rt.dayTextureSaturation[mt]!==Is.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ri.gamma,Ks=Ks||rt.dayTextureOneOverGamma[mt]!==1/Is.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=WG(xi,ri.cutoutRectangle),Ep=ie.simpleIntersection(Ma,xi,Ove);ur=l(Ep)||ur,Kr.x=(Ma.west-xi.west)*jn,Kr.y=(Ma.south-xi.south)*nn,Kr.z=(Ma.east-xi.west)*jn,Kr.w=(Ma.north-xi.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,Cy=Ma.length;Ep<Cy;++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,bd=(Nr?.polygonRings.length??0)>0,xp=l(Wc)&&Wc.enabled&&Wc.length>0&&t.isClipped&&bd;Se.numberOfDayTextures=mt,Se.applyBrightness=Zi,Se.applyContrast=Mr,Se.applyHue=fo,Se.applySaturation=Bs,Se.applyGamma=Ks,Se.applyAlpha=no,Se.applyDayNightAlpha=gi,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&&(dAt(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?(ue.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&&ue.union(q.boundingSphere,da,da)):(ft.boundingVolume=ue.clone(q.boundingSphere,da),ft.orientedBoundingBox=en.clone(q.boundingVolume,Tp)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),Rve(ft,n),st=qe,vt=mAt}while(Qe<He)}var Jk=Ate;function Fve(){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(Fve.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 Zk=Fve;var bte=class{constructor(t){this._ellipsoid=new Im(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},Qk=bte;var xte=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()}},AAt=1e3,Tte=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 xte(AAt),this.state=$a.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 xAt(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];if(!l(o))continue;i.add(o);let s=Bve(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=Bve(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._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<$a.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=$a.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),YG(this._southwestChild),this._southwestChild=void 0,YG(this._southeastChild),this._southeastChild=void 0,YG(this._northwestChild),this._northwestChild=void 0,YG(this._northeastChild),this._northeastChild=void 0}},bAt=256;function xAt(e,t,n,i){let r=n.width/bAt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var TAt=new he;function Bve(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,TAt),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 YG(e){l(e)&&e.freeResources()}var e3=Tte;function XG(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}XG.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};XG.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(),kve(this,t)),t=i}};function kve(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}XG.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))&&kve(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var t3=XG;function uh(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 t3,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 Qk({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(uh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});uh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function EAt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,zve(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()}uh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==$a.START&&e(t),t=t.replacementNext};uh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};uh.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};uh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function zve(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}uh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(EAt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),zve(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};uh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),wAt(this,e),BAt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function CAt(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))}uh.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(MAt(this,e),FAt(this,e),CAt(this,e))};uh.prototype.isDestroyed=function(){return!1};uh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var i3,Uve=new he;function vAt(e,t){let n=ie.center(e.rectangle,Uve),i=n.longitude-i3.longitude,r=n.latitude-i3.latitude;n=ie.center(t.rectangle,Uve);let o=n.longitude-i3.longitude,s=n.latitude-i3.latitude;return i*i+r*r-(o*o+s*s)}var SAt=new h,n3=[];function wAt(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=e3.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(n3.length<g){n3=new Array(g);for(let m=0;m<g;++m)n3[m]===void 0&&(n3[m]=new r3)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;i3=t.camera.positionCartographic,o.sort(vAt);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,SAt);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?zc(e,p,r,t,s,!1,n3[d]):(x_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function x_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function r3(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Vve(){this.southwest=new r3,this.southeast=new r3,this.northwest=new r3,this.northeast=new r3}Vve.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 Cte=new Array(31);for(let e=0;e<Cte.length;++e)Cte[e]=new Vve;function IAt(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=RAt(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:pi.NONE,g=e.tileProvider;if(s||i){let m=pi.originalResult(p)===pi.RENDERED,y=pi.originalResult(p)===pi.CULLED||p===pi.NONE,A=n.state===$a.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&x_(e,e._tileLoadQueueMedium,n,t),KG(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&x_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){KG(e,n),x_(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===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(PAt(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!==pi.KICKED&&_!==n;)_._lastSelectionResult=pi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,KG(e,n),n._lastSelectionResult=pi.RENDERED;let O=p===pi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,x_(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&&x_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,KG(e,n),x_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function PAt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Cte[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(zc(e,t,u,o,f,s,p),zc(e,n,u,o,f,s,g),zc(e,i,u,o,f,s,m),zc(e,r,u,o,f,s,y)):(zc(e,i,u,o,f,s,m),zc(e,t,u,o,f,s,p),zc(e,r,u,o,f,s,y),zc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(zc(e,n,u,o,f,s,g),zc(e,t,u,o,f,s,p),zc(e,r,u,o,f,s,y),zc(e,i,u,o,f,s,m)):(zc(e,r,u,o,f,s,y),zc(e,i,u,o,f,s,m),zc(e,n,u,o,f,s,g),zc(e,t,u,o,f,s,p)),d.combine(a)}function DAt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function zc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==Ko.NONE)return IAt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,DAt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&x_(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?(x_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=pi.CULLED):t._lastSelectionResult=pi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function RAt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof mn||t.camera.frustum instanceof bs)return OAt(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 OAt(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 KG(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function MAt(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=Ete(e,t,s,o,n,!1);a=Ete(e,t,s,o,i,a),Ete(e,t,s,o,r,a)}function NAt(e,t){return e._loadPriority-t._loadPriority}function Ete(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(NAt);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 ww=new pn,$G=new he,jA=new h,LAt=[];function FAt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=LAt;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:pi.NONE;(A===pi.RENDERED||A===pi.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,ww.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,ww.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,jA);h.subtract(A.positionOnEllipsoidSurface,O,ww.origin)}}else he.clone(A.positionCartographic,$G),$G.height=-11500,c.project($G,jA),h.fromElements(jA.z,jA.x,jA.y,jA),h.clone(jA,ww.origin),h.clone(h.UNIT_X,ww.direction);T=d.data.pick(ww,a,c,!1,jA),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,$G);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 BAt(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 o3=uh;function Pm(e){e=e??ee.default;let t=new g0({ellipsoid:e}),n=new NT,i=new e_({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Kk,this._material=void 0,this._surface=new o3({tileProvider:new Jk({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 Zk,Ste(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=Pn.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(Pm.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)&&Ste(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,Ste(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 Ste(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[am,Ew];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(Yk),e._surfaceShaderSet.baseVertexShaderSource=new Ye({sources:[am,Ew,Xk],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ye({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function kAt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var UAt=[],zAt={start:0,stop:0};Pm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=UAt;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=ue.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))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=yi.raySphere(e,d,zAt);l(p)&&s.push(f)}s.sort(kAt(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 VAt=new he;Pm.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,VAt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var jAt=new h,jve=new h,HAt=new he,GAt=new pn;function vte(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}Pm.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=vte(n._southwestChild,e)||vte(n._southeastChild,e)||vte(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,jAt),u=GAt,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,jve);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,jve);if(l(p))return a.cartesianToCartographic(p,HAt).height};Pm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Pm.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))};Pm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Pm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Pm.prototype.isDestroyed=function(){return!1};Pm.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(),le(this)};var s3=Pm;var nf=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;var HA=`uniform highp sampler2D u_depthTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function y0(){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(y0.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 Hve(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:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(HA,{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(nf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(HA,{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(nf,{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}y0.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),Hve(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};y0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};y0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};y0.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),Hve(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};y0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};y0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};y0.prototype.isDestroyed=function(){return!1};y0.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()),le(this)};var a3=y0;function eE(){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(eE.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 WAt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function qAt(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 YAt(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(HA,{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}eE.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;qAt(this,n,r,o,e),YAt(this,n,r,o,i),this._useHdr=e};eE.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};eE.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};eE.prototype.isDestroyed=function(){return!1};eE.prototype.destroy=function(){return WAt(this),le(this)};var c3=eE;var pc={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},tE=pc.DERIVED_COMMANDS_MAXIMUM_LENGTH,Qve=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function nE(){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(tE),this._derivedBlendCommandTypes=new Array(tE),this._derivedPickCommandTypes=new Array(tE),this._derivedCommandTypesToUpdate=new Array(tE),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(nE.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}}});nE.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=Gve(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Gve(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Wve(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Wve(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=JAt(this,e,t),this._sunVisibleThroughGlobe=XAt(this,e),this._environmentVisible=KAt(this,e),this._useDepthPlane=$At(this,e),this._numberOfTextureUniforms=ZAt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),QAt(this,e)};function Gve(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 Wve(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function XAt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function KAt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function $At(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function JAt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function ZAt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function QAt(e,t){e._derivedCommandsLength=wte(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=wte(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=wte(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<tE;++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=mbt())}function wte(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?pc.PICK_FRONT_FACE:u?pc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:pc.TRANSLUCENT_FRONT_FACE,d=i?pc.PICK_BACK_FACE:u?pc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:pc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=pc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=pc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=pc.DEPTH_ONLY_BACK_FACE),r[o++]=pc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=pc.DEPTH_ONLY_FRONT_FACE),r[o++]=pc.OPAQUE_BACK_FACE,r[o++]=f),o)}function fh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function qve(e,t){return e.indexOf(t)>-1}function ebt(e,t){fh(e.defines,"TRANSLUCENT"),fh(t.defines,"TRANSLUCENT")}function tbt(e,t){fh(e.defines,"GROUND_ATMOSPHERE"),fh(t.defines,"GROUND_ATMOSPHERE"),fh(e.defines,"FOG"),fh(t.defines,"FOG"),fh(e.defines,"TRANSLUCENT"),fh(t.defines,"TRANSLUCENT")}function Ite(e,t){if(qve(t.defines,"TILE_LIMIT_RECTANGLE")||qve(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function Pte(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 eSe(e,t){Pte(e,t),fh(e.defines,"GROUND_ATMOSPHERE"),fh(t.defines,"GROUND_ATMOSPHERE"),fh(e.defines,"FOG"),fh(t.defines,"FOG")}function nbt(e,t){Pte(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function ibt(e,t){eSe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Yve(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 rbt(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 obt(e){e.cull.face=Ui.BACK,e.cull.enabled=!0}function sbt(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0}function abt(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function cbt(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function lbt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Xve(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function Kve(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function ubt(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function fbt(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function dbt(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 Iw(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function hbt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function Dm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function mbt(){return[new Dm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:ebt,getRenderStateFunction:obt,getUniformMapFunction:void 0}),new Dm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:tbt,getRenderStateFunction:sbt,getUniformMapFunction:void 0}),new Dm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Ite,getRenderStateFunction:abt,getUniformMapFunction:void 0}),new Dm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Ite,getRenderStateFunction:cbt,getUniformMapFunction:void 0}),new Dm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Ite,getRenderStateFunction:lbt,getUniformMapFunction:void 0}),new Dm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Pte,getRenderStateFunction:Xve,getUniformMapFunction:Iw}),new Dm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:eSe,getRenderStateFunction:Kve,getUniformMapFunction:Iw}),new Dm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:nbt,getRenderStateFunction:Xve,getUniformMapFunction:Iw}),new Dm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ibt,getRenderStateFunction:Kve,getUniformMapFunction:Iw}),new Dm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Yve,getRenderStateFunction:ubt,getUniformMapFunction:Iw}),new Dm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Yve,getRenderStateFunction:fbt,getUniformMapFunction:Iw})]}var $ve=new Array(tE),Jve=new Array(tE);nE.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)Jve[r]=this._derivedCommandPacks[n[r]],$ve[r]=Qve[n[r]];pbt(this,e,i,n,$ve,Jve,t)}};function pbt(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=hbt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=rbt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=dbt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}nE.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=Qve[r[a]];n.commandList.push(s[c])}};function tSe(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 Zve(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var gbt=[pc.OPAQUE_FRONT_FACE,pc.OPAQUE_BACK_FACE],_bt=[pc.DEPTH_ONLY_FRONT_FACE,pc.DEPTH_ONLY_BACK_FACE,pc.DEPTH_ONLY_FRONT_AND_BACK_FACE];nE.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),tSe(s,a,t,i,r,gbt))};nE.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)&&Zve(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,tSe(a,c,t,i,r,_bt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}Zve(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var l3=nE;var ybt=1953029805,Abt=2917034100;function Dte(e,t){if(Dte.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===ybt||r===Abt)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++}Dte.passThroughDataForTesting=!1;var u3=Dte;var vbt=Qo(Rte(),1);function bbt(e,t){return(e&t)!==0}var _l=bbt;var xbt=[1,2,4,8],nSe=15,Tbt=16,Ebt=64,Cbt=128;function A0(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}A0.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 A0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};A0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};A0.prototype.hasSubtree=function(){return _l(this._bits,Tbt)};A0.prototype.hasImagery=function(){return _l(this._bits,Ebt)};A0.prototype.hasTerrain=function(){return _l(this._bits,Cbt)};A0.prototype.hasChildren=function(){return _l(this._bits,nSe)};A0.prototype.hasChild=function(e){return _l(this._bits,xbt[e])};A0.prototype.getChildBitmask=function(){return this._bits&nSe};var d3=A0;function Sbt(e){let t=e.length,n=new ArrayBuff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x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Zf(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(Zf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Zf.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 Zf;i._resource=n;try{await Ibt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${rSe(i,"",1).url}: ${r}`;throw new oe(o)}return i};Zf.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;_l(t,o)?_l(e,o)&&(s|=1):(s|=2,_l(e,o)||(s|=1)),i+=s}return i};Zf.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];_l(s,2)?_l(s,1)||(t|=o):(n|=o,_l(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Zf.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 iSe=new Kn("decodeGoogleEarthEnterprisePacket");Zf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=rSe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return iSe.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=d3.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}})})};Zf.prototype.populateSubtree=function(e,t,n,i){let r=Zf.tileXYToQuadKey(e,t,n);return Nte(this,r,i)};function Nte(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}),Nte(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}),Nte(e,t,s)}).finally(function(){delete a[r]})}Zf.prototype.getTileInformation=function(e,t,n){let i=Zf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Zf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function rSe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Ote,Mte;function Ibt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Mte)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Mte=rx(n).then(function(){Ote=window.cesiumGoogleEarthDbRootParser(vbt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Mte.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Ote.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 iSe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Ote.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=wbt})}var T_=Zf;var oSe=Qo(Rte(),1);function Lte(){this._image=new Image}Lte.prototype.isReady=function(){return!0};Lte.prototype.shouldDiscardImage=function(e){return e===this._image};function iE(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 Lte),this._errorEvent=new be}Object.defineProperties(iE.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}}});iE.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new iE(t);return n._metadata=e,n};iE.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]}};iE.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=T_.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=Pbt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){u3(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Dbt(f)),!l(d)&&(!l(p)||p)){let g=Rbt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:Og({uint8Array:f,format:d,flipY:!0})})};iE.prototype.pickFeatures=function(e,t,n,i,r){};function Pbt(e,t,n,i,r,o){let s=T_.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 Dbt(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 Rbt(e){let t=oSe.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 Fte=iE;var Obt=600;function b0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ta.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ta.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??Obt}Object.defineProperties(b0.prototype,{});b0.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=Ta.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 HT({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};b0.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}};b0.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};b0.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}`)}};b0.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};b0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ta.defaultStreetViewStaticApiKey??Ta.defaultApiKey,!l(e.key)&&!l(Ta.defaultStreetViewStaticApiKey)&&!l(Ta.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new b0({...e})};b0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var Bte=b0;var Mbt=new z(1,1,1,.4),Nbt=new z(0,1,0,.05),Lbt=new z(0,.5,0,.2);function rE(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??Mbt,this._glowColor=e.glowColor??Nbt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??Lbt,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(rE.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}}});rE.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()};rE.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};rE.prototype.getTileCredits=function(e,t,n){};rE.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};rE.prototype.pickFeatures=function(e,t,n,i,r){};var kte=rE;var qte=[zi,_i],Fbt=qte.length,vSe=Math.cos(D.toRadians(30)),sSe=Math.cos(D.toRadians(150)),SSe=0,wSe=1e3;function WA(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??un.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(WA.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});WA.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<Fbt;i++)if(t instanceof qte[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var Bbt=new h,aSe=new h,cSe=new h;function Wte(e,t,n,i,r){let o=ou(i,e,0,Bbt),s=ou(i,e,n,aSe),a=ou(i,t,0,cSe),c=E_(s,o,aSe),u=E_(a,o,cSe);return h.cross(u,c,r),h.normalize(r,r)}var kbt=new he,Ubt=new h,zbt=new h,Vbt=new h;function Ute(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===un.GEODESIC?d=new vg(e,t,s):o===un.RHUMB&&(d=new Rc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=Wte(e,t,i,s,Vbt),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,kbt),v=ou(s,E,n,Ubt),S=ou(s,E,i,zbt);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 zte=new he;function ou(e,t,n,i){return he.clone(t,zte),zte.height=n,he.toCartesian(zte,e,i)}WA.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};WA.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 WA({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 E_(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function lSe(e,t,n,i){return i=E_(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var jbt=new h,Hbt=new h,Gbt=new h,ISe=new h,Wbt=0,qbt=-1;function Vte(e,t,n,i,r){let o=E_(n,t,ISe),s=lSe(e,t,o,jbt),a=lSe(i,t,o,Hbt);if(D.equalsEpsilon(h.dot(s,a),qbt,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,Gbt);return h.dot(a,c)<Wbt&&(r=h.negate(r,r)),r}var e5=sn.fromPointNormal(h.ZERO,h.UNIT_Y),Ybt=new h,Xbt=new h,Kbt=new h,$bt=new h,Jbt=new h,JG=new h,ZG=new he,uSe=new he,fSe=new he;WA.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new qte[e._projectionIndex](i),a=SSe,c=wSe,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Rc(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=yi.lineSegmentPlane(g,m,e5,JG),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===un.GEODESIC?v.push(h.clone(x)):e.arcType===un.RHUMB&&(E=i.cartesianToCartographic(x,ZG).longitude,y=i.cartesianToCartographic(g,ZG),A=i.cartesianToCartographic(m,uSe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,fSe),x=i.cartographicToCartesian(T,JG),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=yi.lineSegmentPlane(g,m,e5,JG),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===un.GEODESIC?v.push(h.clone(x)):e.arcType===un.RHUMB&&(E=i.cartesianToCartographic(x,ZG).longitude,y=i.cartesianToCartographic(g,ZG),A=i.cartesianToCartographic(m,uSe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,fSe),x=i.cartographicToCartesian(T,JG),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=Br(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=Ybt,w=Xbt,P=Kbt,M=$bt,F=Jbt,V=I[0],B=I[1],j=I[S-1];for(C=ou(i,j,a,C),M=ou(i,B,a,M),w=ou(i,V,a,w),P=ou(i,V,c,P),n?F=Vte(C,w,P,M,F):F=Wte(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),Ute(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];ou(i,q,c,P),ou(i,I[f+1],a,M),Vte(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),Ute(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=ou(i,k,a,w),P=ou(i,k,c,P),n){let q=I[0];C=ou(i,G,a,C),M=ou(i,q,a,M),F=Vte(C,w,P,M,F)}else F=Wte(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(Ute(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 Ext(n,s,L,_,O,R,t)};var Zbt=new h,Qbt=new $,ext=new Le;function dSe(e,t,n,i){let r=E_(n,t,Zbt),o=h.dot(r,e);if(o>vSe||o<sSe){let s=E_(i,n,ISe),a=o<sSe?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,ext),u=$.fromQuaternion(c,Qbt);return $.multiplyByVector(u,e,e),!0}return!1}var hSe=new he,txt=new h,mSe=new h;function h3(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,txt),s=h.add(o,n,mSe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,hSe);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,mSe),u=c.cartesianToCartographic(s,hSe)),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 nxt=new h,pSe=new h;function gSe(e,t,n,i,r,o){let s=h.subtract(t,e,nxt);h.normalize(s,s);let a=n-SSe,c=h.multiplyByScalar(s,a,pSe);h.add(e,c,r);let u=i-wSe;c=h.multiplyByScalar(s,u,pSe),h.add(t,c,o)}var ixt=new h;function QG(e,t){let n=sn.getPointDistance(e5,e),i=sn.getPointDistance(e5,t),r=ixt;D.equalsEpsilon(n,0,D.EPSILON2)?(r=E_(t,e,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=E_(e,t,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(t,r,t))}function rxt(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 PSe=new he,DSe=new he,_Se=new h,jte=new h,ySe=new h,ASe=new h,oxt=new h,bSe=new h,sxt=[PSe,DSe],axt=new ie,cxt=new h,lxt=new h,uxt=new h,fxt=new h,dxt=new h,hxt=new h,Hte=new h,Gte=new h,mxt=new h,pxt=new h,gxt=new h,xSe=new h,_xt=new h,yxt=new h,Axt=new Sn,bxt=new Sn,TSe=new h,xxt=new h,ESe=new h,Txt=[new ue,new ue],RSe=[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],CSe=RSe.length;function Ext(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,_=PSe;_.height=0;let C=DSe;C.height=0;let w=_Se,P=jte;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,ASe),W=h.unpack(i,0,jte),J=h.unpack(r,0,bSe);if(e){let Se=h.unpack(n,n.length-6,ySe);dSe(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,ySe),Re=h.clone(W,_Se),Qe=h.clone(J,oxt);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,ASe),W=h.unpack(i,c,jte),J=h.unpack(r,c,bSe),q=dSe(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 gi=rxt(_,C);He=t.project(_,dxt),Xe=t.project(C,hxt);let ho=E_(Xe,He,TSe);ho.y=Math.abs(ho.y),$e=Hte,Pe=Gte,gi===0||h.dot(ho,h.UNIT_Y)>vSe?($e=h3(t,_,Qe,He,Hte),Pe=h3(t,C,J,Xe,Gte)):gi===1?(Pe=h3(t,C,J,Xe,Gte),$e.x=0,$e.y=D.sign(_.longitude-Math.abs(C.longitude)),$e.z=0):($e=h3(t,_,Qe,He,Hte),Pe.x=0,Pe.y=D.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(Se,Axt),vt=h.subtract(Q,Se,mxt),Gt=h.normalize(vt,xSe),lt=h.subtract(Re,Se,pxt);lt=h.normalize(lt,lt);let mt=h.cross(Gt,lt,xSe);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,_xt);ft=h.normalize(ft,ft);let Xt=h.subtract(W,Q,gxt);Xt=h.normalize(Xt,Xt);let rt=h.cross(J,Xt,yxt);rt=h.normalize(rt,rt);let ht=qe/F,Bi=Z/F,Xn=0,bi,Wi,wi,hi=0,xi=0;if(s){Xn=h.distance(He,Xe),bi=Sn.fromCartesian(He,bxt),Wi=h.subtract(Xe,He,TSe),wi=h.normalize(Wi,xxt);let gi=wi.x;wi.x=wi.y,wi.y=-gi,hi=Xn/L,xi=ae/L}for(V=0;V<8;V++){let gi=G+V*4,ho=j+V*2,ur=gi+3,Zo=V<4?1:-1,Bn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,gi),A[ur]=vt.x,h.pack(st.low,b,gi),b[ur]=vt.y,h.pack(ft,x,gi),x[ur]=vt.z,h.pack(rt,T,gi),T[ur]=ht*Zo,h.pack(mt,E,gi);let qi=Bi*Bn;qi===0&&Bn<0&&(qi=9),E[ur]=qi,s&&(v[gi]=bi.high.x,v[gi+1]=bi.high.y,v[gi+2]=bi.low.x,v[gi+3]=bi.low.y,I[gi]=-$e.y,I[gi+1]=$e.x,I[gi+2]=Pe.y,I[gi+3]=-Pe.x,S[gi]=Wi.x,S[gi+1]=Wi.y,S[gi+2]=wi.x,S[gi+3]=wi.y,R[ho]=hi*Zo,qi=xi*Bn,qi===0&&Bn<0&&(qi=9),R[ho+1]=qi)}let jn=uxt,nn=fxt,Wn=cxt,Zi=lxt,Mr=ie.fromCartographicArray(sxt,axt),fo=Ni.getMinimumMaximumHeights(Mr,u),Bs=fo.minimumTerrainHeight,Ks=fo.maximumTerrainHeight;Ae+=Math.abs(Bs),Ae+=Math.abs(Ks),gSe(Se,Re,Bs,Ks,jn,Wn),gSe(Q,W,Bs,Ks,nn,Zi);let no=h.multiplyByScalar(mt,D.EPSILON5,ESe);h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),QG(jn,nn),QG(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,ESe),h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),QG(jn,nn),QG(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<CSe;V++)m[c+V]=RSe[V]+fe;fe+=8,c+=CSe}let xe=Txt;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:GA(A),startLoAndForwardOffsetY:GA(b),startNormalAndForwardOffsetZ:GA(x),endNormalAndTextureCoordinateNormalizationX:GA(T),rightNormalAndTextureCoordinateNormalizationY:GA(E)};return s&&(we.startHiLo2D=GA(v),we.offsetAndRight2D=GA(S),we.startEndNormals2D=GA(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new St({attributes:we,indices:m,boundingSphere:ge})}function GA(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}WA._projectNormal=h3;var oE=WA;var m3=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +#else +positionWC = v_positionMC; +lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); +rayleighColor = v_atmosphereRayleighColor; +mieColor = v_atmosphereMieColor; +opacity = v_atmosphereOpacity; #endif -void main(void) -{ -float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); -if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -eyeCoordinate /= eyeCoordinate.w; -float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); -float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); -float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); -float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); -if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec3 alignedPlaneNormal; -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); -s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; -float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, t); -materialInput.str = vec3(s, t, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -out_FragColor.rgb *= out_FragColor.a; -czm_writeDepthClamp(); -} -`;var p3=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +#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 -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; +finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); +#endif +finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); #endif -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { -return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -void main(void) +#endif +#ifdef UNDERGROUND_COLOR +if (czm_backFacing()) { -vec4 eyeCoordinate = gl_FragCoord; -eyeCoordinate /= eyeCoordinate.w; -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); -float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); -distanceFromStart = max(0.0, distanceFromStart); -distanceFromEnd = max(0.0, distanceFromEnd); -float s = distanceFromStart / (distanceFromStart + distanceFromEnd); -s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, v_texcoordT); -materialInput.str = vec3(s, v_texcoordT, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR +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 g3=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -in float batchId; -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; -#ifdef WIDTH_VARYING -out float v_width; #endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; +#ifdef HAS_VECTOR_LAYER +finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); +finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); #endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; +#ifdef TRANSLUCENT +if (inTranslucencyRectangle()) +{ +vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; +finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); +} +#endif +out_FragColor = finalColor; +} +#ifdef SHOW_REFLECTIVE_OCEAN +float waveFade(float edge0, float edge1, float x) +{ +float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +return pow(1.0 - y, 5.0); +} +float linearFade(float edge0, float edge1, float x) +{ +return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +} +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 -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; +vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); #endif -void main() +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); +} +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var _V=`#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) { -v_batchId = batchId; -vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); -vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); -vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec4 startPlane2D; -vec4 startPlane3D; -startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); -startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); -vec4 rightPlane2D; -vec4 rightPlane3D; -rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); -rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); -posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); -posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); -posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); -vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); -vec4 endPlane2D; -vec4 endPlane3D; -endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); -endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); -v_forwardDirectionEC = normalize(endEC - startEC); -vec2 cleanTexcoordNormalization2D; -cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); -cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); -vec2 cleanTexcoordNormalization3D; -cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; -cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); -v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR -v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); -v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR -#ifdef WIDTH_VARYING -float width = czm_batchTable_width(batchId); -float halfWidth = width * 0.5; -v_width = width; -v_texcoordNormalizationAndHalfWidth.z = halfWidth; +return u_modifiedModelViewProjection * vec4(position, 1.0); +} +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); +} +return positionFraction; +} +float get2DGeographicYPositionFraction(vec2 textureCoordinates) +{ +return textureCoordinates.y; +} +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +{ +float yPositionFraction = get2DYPositionFraction(textureCoordinates); +vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); +return u_modifiedModelViewProjection * rtcPosition2D; +} +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, 0.0, textureCoordinates); +} +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, height, textureCoordinates); +} +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +{ +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; +} +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; +#endif +void main() +{ +#ifdef QUANTIZATION_BITS12 +vec2 xy = czm_decompressTextureCoordinates(compressed0.x); +vec2 zh = czm_decompressTextureCoordinates(compressed0.y); +vec3 position = vec3(xy, zh.x); +float height = zh.y; +vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); +height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; +position = (u_scaleAndBias * vec4(position, 1.0)).xyz; +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL) +float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; +float encodedNormal = compressed1; +#elif defined(INCLUDE_WEB_MERCATOR_Y) +float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; +float encodedNormal = 0.0; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) +float webMercatorT = textureCoordinates.y; +float encodedNormal = compressed0.w; #else -float halfWidth = 0.5 * czm_batchTable_width(batchId); -v_texcoordNormalizationAndHalfWidth.z = halfWidth; +float webMercatorT = textureCoordinates.y; +float encodedNormal = 0.0; #endif -vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); -float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); -vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); -geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc3D.xyz += geodeticSurfaceNormal; -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; -vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); -absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); -planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); -upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); -normalEC = normalize(cross(planeDirection, upOrDown)); -geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); -geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc2D.xyz += geodeticSurfaceNormal; -normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR -v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.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 -positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; -gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif -} -`;var _3=`in vec3 position3DHigh; -in vec3 position3DLow; -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; +vec3 position3DWC = position + u_center3D; +#ifdef GEODETIC_SURFACE_NORMALS +vec3 ellipsoidNormal = geodeticSurfaceNormal; #else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; +vec3 ellipsoidNormal = normalize(position3DWC); #endif -in float batchId; -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef WIDTH_VARYING -out float v_width; +#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 -#ifdef ANGLE_VARYING -out float v_polylineAngle; +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 -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; +v_normalMC = normalMC; +v_normalEC = czm_normal3D * v_normalMC; #endif -void main() -{ -#ifdef COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; -vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); -vec3 ecEnd = forwardDirectionEC + ecStart; -forwardDirectionEC = normalize(forwardDirectionEC); -v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); -v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; -#else // COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; -vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); -vec3 ecEnd = ecStart + offset; -vec3 forwardDirectionEC = normalize(offset); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; -#endif // COLUMBUS_VIEW_2D -v_endEcAndStartEcX.xyz = ecEnd; -v_endEcAndStartEcX.w = ecStart.x; -v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR -vec4 positionRelativeToEye = czm_computePosition(); -vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; -float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); -vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -upOrDown = cross(forwardDirectionEC, normalEC); -upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; -upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; -upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; -positionEC.xyz += upOrDown; -v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); -float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING -v_width = width; +#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 -v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; -v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; -v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; -v_endPlaneNormalEcAndBatchId.w = batchId; -width = width * max(0.0, czm_metersPerPixel(positionEC)); -width = width / dot(normalEC, v_rightPlaneEC.xyz); -#ifdef COLUMBUS_VIEW_2D -normalEC *= sign(texcoordNormalization2D.x); +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; #else -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +vec3 atmosphereLightDirection = czm_lightDirectionWC; #endif -positionEC.xyz += width * normalEC; -gl_Position = czm_depthClamp(czm_projection * positionEC); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); +computeAtmosphereScattering( +position3DWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); +#endif +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); +#endif +#ifdef APPLY_MATERIAL +float northPoleZ = czm_ellipsoidRadii.z; +vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); +vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); +float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); +v_slope = acos(dotProd); +vec3 normalRejected = ellipsoidNormal * dotProd; +vec3 normalProjected = v_normalMC - normalRejected; +vec3 aspectVector = normalize(normalProjected); +v_aspect = acos(dot(aspectVector, vectorEastMC)); +float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); +v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); +v_height = height; #endif } -`;var y3=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +`;var DP=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; +vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); +czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); +float atmosphereInnerRadius = length(positionWC); +computeScattering( +primaryRay, +length(cameraToPositionWC), +lightDirection, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +} +`;var gae=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}},_ae=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===$a.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(CC(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(Xg);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(q2t(Xe)),Gt.sources.push(Y2t(S));let ft=en.fromCache({context:n.context,vertexShaderSource:Gt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[$e]=new gae(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 le(this)}};function q2t(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 Y2t(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var yV=_ae;var IFe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(IFe);var Qa=IFe;var PFe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(PFe);var kr=PFe;var j0=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 ue,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)&&(Es.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Mc.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===Qa.START&&(X2t(t,n,i,r),t.state=Qa.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===Qa.LOADING&&K2t(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=Qa.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){DFe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){DFe(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=nt.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=nt.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 DFe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Co.clone(s);c.hasGeodeticSurfaceNormals=t,c=Co.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?(j0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=j0._createVertexArrayForMesh(i.context,r)):(j0._freeVertexArray(e.vertexArray),e.vertexArray=j0._createVertexArrayForMesh(i.context,r)),j0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function X2t(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 K2t(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||j0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&$2t(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&J2t(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&Q2t(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(ekt(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)nkt(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 $2t(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=Qa.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 J2t(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=Zr.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 Z2t={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Q2t(e,t,n,i,r,o){let s=n.tilingScheme,a=Z2t;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 ekt(e,t,n,i,r,o,s){e.vertexArray=j0._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function tkt(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 Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function nkt(e,t){let n=t.terrainData.waterMask,i=tkt(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 wh=j0;var RFe={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>=RFe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},pi=RFe;function OP(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}OP.prototype.update=function(e,t,n){this.changedThisFrame&&(kFe(e,t,this.tile,n),this.changedThisFrame=!1)};OP.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};OP.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):wh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var ikt=new dA;OP.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=ikt;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||pi.wasKicked(u._lastSelectionResult)||pi.originalResult(u._lastSelectionResult)===pi.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===pi.RENDERED){if(l(u.data.vertexArray))return;rkt(e,t,n,u,o,r,a,c);return}if(pi.originalResult(i._lastSelectionResult)!==pi.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 rkt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new OP(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),okt(e,t,n,i,r,a)}function okt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(kFe(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 vC=new he,skt=new he,RP=new h,xae=new h,yae=new U,Aae=new U,pd=new U;function fW(){this.height=0,this.encodedNormal=new U}function oW(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 UFe(e,t,n,i,u,c),c}var akt={minimumHeight:0,maximumHeight:0},ckt=new h,OFe=new fW,MFe=new fW,NFe=new fW,LFe=new fW,lkt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,ukt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function kFe(e,t,n,i){wh.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=aW(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,NFe),p=aW(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,OFe),g=aW(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,MFe),m=aW(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,LFe);d=oW(o,f,0,1,d,p,m,g,NFe),p=oW(o,f,0,0,p,d,g,m,OFe),g=oW(o,f,1,1,g,p,m,d,MFe),m=oW(o,f,1,1,m,g,d,p,LFe);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:lkt,structure:{heightOffset:E}}),P=ukt;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,skt);P.height=v;let M=f.cartographicToCartesian(P,ckt),F=new Co(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=akt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=sW(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=lW(o,f,F,G,q,o.westTiles,o.westMeshes,wn.EAST,j);let W=q;q=sW(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=lW(o,f,F,G,q,o.southTiles,o.southMeshes,wn.NORTH,j);let J=q;q=sW(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=lW(o,f,F,G,q,o.eastTiles,o.eastMeshes,wn.WEST,j);let Z=q;q=sW(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=lW(o,f,F,G,q,o.northTiles,o.northMeshes,wn.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=Qt.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=yi.geodeticLatitudeToMercatorAngle(s.south),fe=1/(yi.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(yi.geodeticLatitudeToMercatorAngle(P.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(vC,xae),we=cn.octEncode(ge,yae),Se=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,pd),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 bc(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),_kt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,Gt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=wh._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 sW(e,t,n,i,r,o,s,a,c,u,f){let d=vC;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,RP),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,xae));let m=Aae;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 uW=new ie;function AV(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,uW),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,uW),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 fkt=new U;function bae(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 dkt=new U,hkt=new h;function mkt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=AV(t,n,f.decodeTextureCoordinates(d,r,pd),pd),g=AV(t,n,f.decodeTextureCoordinates(d,o,Aae),Aae),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;vC.longitude=D.lerp(b.west,b.east,s),vC.latitude=D.lerp(b.south,b.north,a),u.height=vC.height=D.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,fkt),E=f.getOctEncodedNormal(d,o,dkt),v=cn.octDecode(T.x,T.y,RP),S=cn.octDecode(E.x,E.y,hkt);x=h.lerp(v,S,m,RP),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(vC,RP),cn.octEncode(x,u.encodedNormal)}function UFe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(vC,RP);cn.octEncode(s,o.encodedNormal)}function aW(e,t,n,i,r,o,s,a,c,u,f){if(BFe(e,t,a,s,!1,n,i,f)||BFe(e,t,u,c,!0,n,i,f))return f;let p;if(Tae(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],bae(o,p,n,i,f),f;let g;if(n===0?i===0?g=cW(e.westMeshes,e.westTiles,wn.EAST,e.southMeshes,e.southTiles,wn.NORTH,n,i):g=cW(e.northMeshes,e.northTiles,wn.SOUTH,e.westMeshes,e.westTiles,wn.EAST,n,i):i===0?g=cW(e.southMeshes,e.southTiles,wn.NORTH,e.eastMeshes,e.eastTiles,wn.WEST,n,i):g=cW(e.eastMeshes,e.eastTiles,wn.WEST,e.northMeshes,e.northTiles,wn.SOUTH,n,i),l(g))return UFe(e,t,n,i,g,f),f}function cW(e,t,n,i,r,o,s,a){let c=FFe(e,t,!1,n,s,a),u=FFe(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function lW(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=pkt(e,t,n,i,r,o[u],s[u],a,c);return r}function pkt(e,t,n,i,r,o,s,a,c){let u;a===wn.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,uW),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===wn.WEST&&o.x===0&&(u=ie.clone(o.rectangle,uW),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,pd),d=pd.x,p=pd.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=yi.geodeticLatitudeToMercatorAngle(f.south),v=1/(yi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,pd);AV(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,RP),M=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,yae):(F=yae,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=D.lerp(f.south,f.north,L);V=(yi.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(P,xae)),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 FFe(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(!Tae(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 Tae(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function BFe(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(Tae(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,pd);let y=AV(g,e.tile,pd,pd);if(y.x===o&&y.y===s)return bae(m,p,o,s,a),!0;if(d=vr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,pd);let x=AV(g,e.tile,pd,pd);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 mkt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return bae(m,c[d],o,s,a),!0}return!1}var gkt=[new h,new h,new h,new h];function _kt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=gkt;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 MP=OP;var Eae=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){bs.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Mc.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(bkt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=Akt(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(),Ckt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)wh._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:ac.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ac.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&&MP.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&&xkt(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;Tkt(this,g,m,t);let y=m.tileBoundingRegion;Xkt(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),GFe(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===pi.CULLED_BUT_NEEDED,o=i.terrainState),wh.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)!==$o.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,wh.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=qFe(this,n);if(n.fog.enabled&&!o&&D.fog(r,n.fog.density)>=1)return $o.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return $o.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=hW(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,WFe);if(!l(d))return $o.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=vkt,ue.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=ue.union(a.boundingSphere,u,u))),!l(u))return $o.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 $o.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=$o.NONE:y===$t.INTERSECTING?m=$o.PARTIAL:y===$t.INSIDE&&(m=$o.FULL),m===$o.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:$o.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=Ikt;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=Pkt;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:pi.NONE;if(p===pi.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===pi.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,Dkt),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){kkt(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(),le(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]=Ukt(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!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==pi.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)}},ykt=new ie;function Akt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,ykt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function bkt(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 xkt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Mc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function Tkt(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 Ekt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function Ckt(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 GFe(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 vkt=new ue,WFe=new ie,Skt=new ie,wkt=new he;function hW(e,t){if(t.west<t.east)return t;let n=ie.clone(t,Skt);return ie.center(e,wkt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function qFe(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 Ikt=[],Pkt=[],Dkt=new h,zFe=new N,dW=new N,Rkt=new se,Okt=new se,Mkt=new se,Nkt=new h,VFe=new h,Lkt=new h,Fkt=new h,Bkt=[new h,new h,new h,new h];function jFe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Bkt;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 kkt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new wh);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new qf({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=Qt.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=jFe(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=jFe(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 Ukt(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 zkt=new N,Vkt=new N;function HFe(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,VFe);return N.setTranslation(i,r,zFe),zFe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,VFe);return N.setTranslation(i,o,dW),N.multiply(r,dW,dW),dW},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,zkt):N.IDENTITY;return N.inverseTranspose(r,Vkt)},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 jkt(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=Hkt(e,r,i),n.wireframeVertexArray.mesh=i}}function Hkt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Gn.toWireframe(r);let o=r.indices,s=nt.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 YFe,XFe,mW;(function(){let e=new Ft({geometry:Hh.fromDimensions({dimensions:new h(2,2,2)})}),t=new Ft({geometry:new __({radius:1})}),n=new N,i,r;function o(s){return new On({geometryInstances:s,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}YFe=function(s,a){return s===i||(mW(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},XFe=function(s,a){return s===i||(mW(),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},mW=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Gkt=new se(0,0,0,0),Wkt={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},qkt=z.TRANSPARENT,Ykt=new qt;function Xkt(e,t,n){let i=t.data;if(Ekt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new MP(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=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??qkt,A=e.undergroundColorAlphaByDistance??Ykt,b=qFe(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=Rkt,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),Lkt),Xt=mt.project(ie.northeast(t.rectangle),Fkt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Xt.x,ae.w=Xt.y,n.mode!==re.MORPHING&&(k=Nkt,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,Bi=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Bi,ae.z+=ht,ae.w+=Bi}mt instanceof yi&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=yi.geodeticLatitudeToMercatorAngle(Ae),ge=1/(yi.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let Se=Wkt;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)||mW(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=HFe(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 ue,ft.orientedBoundingBox=void 0,Xt=HFe(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)?YFe(ks,z.RED).update(n):l(tc)&&XFe(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 bi=Okt,Wi=hW(t.rectangle,e.cartographicLimitRectangle),wi=Mkt,hi=hW(t.rectangle,m);h.fromElements(P,M,F,rt.hsbShift);let xi=t.rectangle,jn=1/xi.width,nn=1/xi.height;bi.x=(Wi.west-xi.west)*jn,bi.y=(Wi.south-xi.south)*nn,bi.z=(Wi.east-xi.west)*jn,bi.w=(Wi.north-xi.south)*nn,se.clone(bi,rt.localizedCartographicLimitRectangle),wi.x=(hi.west-xi.west)*jn,wi.y=(hi.south-xi.south)*nn,wi.z=(hi.east-xi.west)*jn,wi.w=(hi.north-xi.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,gi=!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 Kb=ks.useWebMercatorT?tc.textureWebMercator:tc.texture,ri=tc.imageryLayer;l(ks.textureTranslationAndScale)||(ks.textureTranslationAndScale=ri._calculateTextureTranslationAndScale(t,ks)),rt.dayTextures[mt]=Kb,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,gi=gi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ri.dayAlpha,gi=gi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ri.brightness,Zi=Zi||rt.dayTextureBrightness[mt]!==Ss.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ri.contrast,Mr=Mr||rt.dayTextureContrast[mt]!==Ss.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ri.hue,fo=fo||rt.dayTextureHue[mt]!==Ss.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ri.saturation,Bs=Bs||rt.dayTextureSaturation[mt]!==Ss.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ri.gamma,Ks=Ks||rt.dayTextureOneOverGamma[mt]!==1/Ss.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=hW(xi,ri.cutoutRectangle),Ep=ie.simpleIntersection(Ma,xi,WFe);ur=l(Ep)||ur,Kr.x=(Ma.west-xi.west)*jn,Kr.y=(Ma.south-xi.south)*nn,Kr.z=(Ma.east-xi.west)*jn,Kr.w=(Ma.north-xi.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,Cy=Ma.length;Ep<Cy;++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,bd=(Nr?.polygonRings.length??0)>0,xp=l(Wc)&&Wc.enabled&&Wc.length>0&&t.isClipped&&bd;Se.numberOfDayTextures=mt,Se.applyBrightness=Zi,Se.applyContrast=Mr,Se.applyHue=fo,Se.applySaturation=Bs,Se.applyGamma=Ks,Se.applyAlpha=no,Se.applyDayNightAlpha=gi,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&&(jkt(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?(ue.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&&ue.union(q.boundingSphere,da,da)):(ft.boundingVolume=ue.clone(q.boundingSphere,da),ft.orientedBoundingBox=Qt.clone(q.boundingVolume,Tp)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),GFe(ft,n),st=qe,vt=Gkt}while(Qe<He)}var bV=Eae;function KFe(){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(KFe.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 xV=KFe;var Cae=class{constructor(t){this._ellipsoid=new Om(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},TV=Cae;var vae=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()}},Kkt=1e3,Sae=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 vae(Kkt),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),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 Jkt(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];if(!l(o))continue;i.add(o);let s=$Fe(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=$Fe(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._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<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 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=Qa.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),pW(this._southwestChild),this._southwestChild=void 0,pW(this._southeastChild),this._southeastChild=void 0,pW(this._northwestChild),this._northwestChild=void 0,pW(this._northeastChild),this._northeastChild=void 0}},$kt=256;function Jkt(e,t,n,i){let r=n.width/$kt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var Zkt=new he;function $Fe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,Zkt),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 pW(e){l(e)&&e.freeResources()}var EV=Sae;function gW(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}gW.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};gW.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(),JFe(this,t)),t=i}};function JFe(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}gW.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))&&JFe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var CV=gW;function Ih(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 CV,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 TV({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Ih.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Ih.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Qkt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,QFe(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()}Ih.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Qa.START&&e(t),t=t.replacementNext};Ih.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Ih.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};Ih.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function QFe(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}Ih.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Qkt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),QFe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Ih.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),i3t(this,e),h3t(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function e3t(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))}Ih.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(l3t(this,e),d3t(this,e),e3t(this,e))};Ih.prototype.isDestroyed=function(){return!1};Ih.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var SV,ZFe=new he;function t3t(e,t){let n=ie.center(e.rectangle,ZFe),i=n.longitude-SV.longitude,r=n.latitude-SV.latitude;n=ie.center(t.rectangle,ZFe);let o=n.longitude-SV.longitude,s=n.latitude-SV.latitude;return i*i+r*r-(o*o+s*s)}var n3t=new h,vV=[];function i3t(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=EV.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(vV.length<g){vV=new Array(g);for(let m=0;m<g;++m)vV[m]===void 0&&(vV[m]=new wV)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;SV=t.camera.positionCartographic,o.sort(t3t);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,n3t);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,vV[d]):(uy(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function uy(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function wV(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function eBe(){this.southwest=new wV,this.southeast=new wV,this.northwest=new wV,this.northeast=new wV}eBe.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 Iae=new Array(31);for(let e=0;e<Iae.length;++e)Iae[e]=new eBe;function r3t(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=a3t(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:pi.NONE,g=e.tileProvider;if(s||i){let m=pi.originalResult(p)===pi.RENDERED,y=pi.originalResult(p)===pi.CULLED||p===pi.NONE,A=n.state===Qa.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&uy(e,e._tileLoadQueueMedium,n,t),_W(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&uy(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){_W(e,n),uy(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===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(o3t(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!==pi.KICKED&&_!==n;)_._lastSelectionResult=pi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,_W(e,n),n._lastSelectionResult=pi.RENDERED;let O=p===pi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,uy(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&&uy(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,_W(e,n),uy(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function o3t(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Iae[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 s3t(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)!==$o.NONE)return r3t(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,s3t(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&uy(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?(uy(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=pi.CULLED):t._lastSelectionResult=pi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function a3t(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof gn||t.camera.frustum instanceof As)return c3t(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 c3t(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 _W(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function l3t(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=wae(e,t,s,o,n,!1);a=wae(e,t,s,o,i,a),wae(e,t,s,o,r,a)}function u3t(e,t){return e._loadPriority-t._loadPriority}function wae(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(u3t);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 NP=new pn,yW=new he,Lb=new h,f3t=[];function d3t(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=f3t;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:pi.NONE;(A===pi.RENDERED||A===pi.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,NP.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,NP.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,Lb);h.subtract(A.positionOnEllipsoidSurface,O,NP.origin)}}else he.clone(A.positionCartographic,yW),yW.height=-11500,c.project(yW,Lb),h.fromElements(Lb.z,Lb.x,Lb.y,Lb),h.clone(Lb,NP.origin),h.clone(h.UNIT_X,NP.direction);T=d.data.pick(NP,a,c,!1,Lb),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,yW);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 h3t(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 IV=Ih;function fp(e){e=e??ee.default;let t=new M0({ellipsoid:e}),n=new XT,i=new u_({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new yV,this._material=void 0,this._surface=new IV({tileProvider:new bV({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 xV,Dae(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(fp.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)&&Dae(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,Dae(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 Dae(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[lm,DP];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(gV),e._surfaceShaderSet.baseVertexShaderSource=new Ye({sources:[lm,DP,_V],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ye({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function m3t(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var p3t=[],g3t={start:0,stop:0};fp.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=p3t;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=ue.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))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=_i.raySphere(e,d,g3t);l(p)&&s.push(f)}s.sort(m3t(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 _3t=new he;fp.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,_3t);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var y3t=new h,tBe=new h,A3t=new he,b3t=new pn;function Pae(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}fp.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=Pae(n._southwestChild,e)||Pae(n._southeastChild,e)||Pae(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,y3t),u=b3t,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,tBe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,tBe);if(l(p))return a.cartesianToCartographic(p,A3t).height};fp.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};fp.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))};fp.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};fp.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};fp.prototype.isDestroyed=function(){return!1};fp.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(),le(this)};var PV=fp;var gf=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_width = width; -v_st.s = st.s; -v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); -v_polylineAngle = angle; +out_FragColor = texture(colorTexture, v_textureCoordinates); +} +`;var Fb=`uniform highp sampler2D u_depthTexture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;var Cxt=`#define CLIP_POLYLINE -${Gl} -${y3}`,vxt=gT;function sE(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=sE.VERTEX_FORMAT;this.material=l(e.material)?e.material:rr.fromType(rr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??Cxt,this._fragmentShaderSource=e.fragmentShaderSource??vxt,this._renderState=vr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(sE.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}}});sE.VERTEX_FORMAT=Be.POSITION_AND_ST;sE.prototype.getFragmentShaderSource=vr.prototype.getFragmentShaderSource;sE.prototype.isTranslucent=vr.prototype.isTranslucent;sE.prototype.getRenderState=vr.prototype.getRenderState;var gc=sE;function C_(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new gc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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=OSe(!1),this._renderState3DTiles=OSe(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Ui.FRONT},depthTest:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(C_.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}}});C_.initializeTerrainHeights=function(){return Ni.initialize()};function Sxt(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(_3);s=Mn._appendShowToShader(r,s),s=Mn._appendDistanceDisplayConditionToShader(r,s),s=Mn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(g3);a=Mn._appendShowToShader(r,a),a=Mn._appendDistanceDisplayConditionToShader(r,a),a=Mn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(m3),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 ${Ni._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(p3);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 OSe(e){return Ge.fromCache({cull:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function wxt(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Ys?{}: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 MSe(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 Ixt(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!==ei.CESIUM_3D_TILE,p=f!==ei.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],MSe(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,MSe(e,g,t,r,o,b,s))}}}C_.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){C_.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 gl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,oE.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){Sxt(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){wxt(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){Ixt(n,u,f,d,p,g,m)},this._primitive=new Mn(i)}if(this.appearance instanceof Ys&&!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))})};C_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};C_.isSupported=function(e){return e.frameState.context.depthTexture};C_.prototype.isDestroyed=function(){return!1};C_.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,le(this)};var Rm=C_;var Pxt={u_globeMinimumAltitude:function(){return 55e3}};function rf(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??ei.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:Pxt}}Object.defineProperties(rf.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}}});rf.isSupported=dw.isSupported;function NSe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function LSe(e){return function(t,n){return e._minHeight}}var Dxt=new h,Rxt=new h,Oxt=new h,Mxt=new he,Nxt=new ie;function t5(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,Dxt),g=h.unpack(r,d,Rxt),m=h.add(p,g,Oxt),y=n.cartesianToCartographic(m,Mxt),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=Nxt;return f.north=c,f.south=s,f.east=u,f.west=a,f}function Lxt(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function Fxt(e,t,n){let i=t.mapProjection.ellipsoid,r=t5(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.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 Yte(e,t){return Math.floor(e%t/2)}function Xte(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 FSe(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 Bxt(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!==ei.CESIUM_3D_TILE,d=u!==ei.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[Yte(m,b)],f&&(A=n[m],Xte(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,Xte(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],Xte(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[Yte(m,b)],!e._useFragmentCulling){let T=x[Yte(m,b)];y=c[T.index]}f&&(A=i[m],FSe(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,FSe(e,A,t,r,o,y))}}}rf.initializeTerrainHeights=function(){return Ni.initialize()};rf.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){rf.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=t5(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)}Lxt(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=rf._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=t5(e,o),Xf.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=t5(e,o),x=o.textureCoordinateRotationPoints;A?y=Xf.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Xf.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,LSe(this),NSe(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,LSe(this),NSe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){Fxt(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){Bxt(t,A,b,x,T,E,v,S)},this._primitive=new dw(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))})};rf.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};rf.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};rf.prototype.isDestroyed=function(){return!1};rf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};rf._supportsMaterials=function(e){return e.depthTexture};rf.supportsMaterials=function(e){return rf._supportsMaterials(e.frameState.context)};var su=rf;function Om(){}Om._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Om._decodeTaskProcessor=new Kn("decodeI3S",Om._maxDecodingConcurrency);Om._promise=void 0;async function kxt(){if(await Om._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Om._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}Om.decode=async function(e,t,n,i,r){return l(Om._promise)||(Om._promise=kxt()),Om._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 A3=Om;function Kte(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(Kte.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Kte.prototype.load=async function(){return this._data=await Mm.loadJson(this._resource),this._data};var b3=Kte;function v_(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(v_.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 n5(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 Uxt(e){return e==="String"?1:n5(e)}async function zxt(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)}v_.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=zxt(this).catch(function(e){console.error(e)}),this._loadPromise)};v_.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}};v_.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};v_.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)}}}};v_.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=n5(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=n5(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};v_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Uxt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};v_.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=n5(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 x3=v_;function Vxt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var aE=Vxt;function T3(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(T3.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});T3.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var jxt=new h,Hxt=new h,Gxt=new h,Wxt=new h,qxt=new h;function $te(e,t,n,i){let r=h.subtract(i,n,jxt),o=h.cross(r,h.subtract(e,n,Hxt),Wxt),s=h.cross(r,h.subtract(t,n,Gxt),qxt);return h.dot(o,s)>=0}var Yxt=new h,Xxt=new h,Kxt=new h,$xt=new h,Jxt=new h,Zxt=new h,Qxt=new h,eTt=new h,tTt=new h,nTt=new h;T3.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],Yxt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],Xxt),x=new h(u[y*3],u[y*3+1],u[y*3+2],Kxt);if(!$te(i,A,b,x)||!$te(i,b,A,x)||!$te(i,x,A,b))continue;let T=h.subtract(b,A,$xt),E=h.subtract(x,A,Jxt),v=h.cross(T,E,Zxt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,Qxt),I=h.subtract(i,A,eTt),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,tTt)),_=h.magnitudeSquared(h.subtract(i,x,nTt));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 BSe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(aE(e[i])):t.push(e[i]);return t}T3.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=BSe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=BSe(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 Pw=T3;function yl(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(yl.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}}});yl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new ih(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await Mm.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 kSe(e,t){let n=new x3(e,t);return e._fields[t.name]=n,n.load()}yl.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(kSe(this,i))}return Promise.all(t)};yl.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 kSe(this,r)}return Promise.resolve()};yl.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)};yl.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};yl.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 yl(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};yl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new Pw(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 Pw(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};yl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new b3(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};yl.prototype._clearGeometryData=function(){this._geometryData=[]};yl.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+=sTt(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 Ic(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}};yl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};yl.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 A3.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 iTt(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 rTt(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 USe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await iTt(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(!rTt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}yl.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=USe(this,t);e.push(n)}return Promise.all(e)};ih.prototype._hookedRequestContent=ih.prototype.requestContent;ih.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(()=>{USe(e._i3sNode,n)})),e._isLoading=!1,t})}};function oTt(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 i5(e,t,n,i){let r=e+t*n;return i[r]}function sTt(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=i5(s,a,n.width,n.buffer),d=i5(c,a,n.width,n.buffer),p=i5(s,u,n.width,n.buffer),g=i5(c,u,n.width,n.buffer),m=oTt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(ih.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var Dw=yl;function r5(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(r5.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Jte(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(aE(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function Rw(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=Jte(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=Jte(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=Jte(a.color,a.transparency)))}break}}return n}function aTt(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=Rw(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]=Rw(r.symbol,t)}return n}}function cTt(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(Rw(o.symbol,t)))}return i.symbols.push(void 0),i}}r5.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=Rw(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=Rw(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=aTt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=Rw(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=cTt(i,n))}};function zSe(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?zSe(s,t,n,i):s}}function lTt(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 uTt(e,t,n){let i=t[n],r=lTt(e.ranges,i);return e.symbols[r]}r5.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=>zSe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>uTt(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 E3=r5;function of(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(of.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}}});of.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 E3(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()};of.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)}};of.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]}}};of.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 Dw(this,t,!0)}else this._rootNode=new Dw(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};of.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]})};of._fetchJson=function(e){return e.fetchJson()};of.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=of._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]};of.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]))};of.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 Yo.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()})};of.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};of.prototype.filterByAttributes=function(e){this._filters=l(e)?Je(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var cE=of;function o5(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(o5.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}}});o5.prototype.load=async function(){return this._data=await Mm.loadJson(this._resource),this._data};o5.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 C3=o5;function v3(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(v3.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}}});v3._fromData=async function(e,t,n,i){let r=new v3(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=v3._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 Mm.loadJson(r._resource),c=new cE(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 S3=v3;var HSe=Qo(VSe(),1);function aa(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(aa.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}}});aa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return le(this)};aa.prototype.isDestroyed=function(){return!1};aa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};aa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};aa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};aa.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 fTt(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 jSe(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=fTt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=S3._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 C3(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 cE(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.`)}aa.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await aa.loadJson(n),r=new aa(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=jSe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await jSe(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};aa._fetchJson=function(e){return e.fetchJson()};aa.loadJson=async function(e){let t=await aa._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};aa.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};aa.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 dTt=new U;function hTt(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,dTt),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 _i&&(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===ah.LERC){let x=HSe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function mTt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await hTt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}aa.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=mTt(this),this._geoidDataPromise)};aa.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};aa.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};aa.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[]};aa.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 Mm=aa;function x0(){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(x0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});x0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var pTt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},gTt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},_Tt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:tn.ALPHA_BLEND},yTt=`uniform sampler2D colorTexture; +`;function H0(){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(H0.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 nBe(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:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Fb,{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(gf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Fb,{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(gf,{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 z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}H0.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),nBe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};H0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};H0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};H0.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),nBe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};H0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};H0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};H0.prototype.isDestroyed=function(){return!1};H0.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()),le(this)};var DV=H0;function SC(){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(SC.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 x3t(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function T3t(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 E3t(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(Fb,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({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}SC.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;T3t(this,n,r,o,e),E3t(this,n,r,o,i),this._useHdr=e};SC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};SC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};SC.prototype.isDestroyed=function(){return!1};SC.prototype.destroy=function(){return x3t(this),le(this)};var RV=SC;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},wC=Tc.DERIVED_COMMANDS_MAXIMUM_LENGTH,dBe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function IC(){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(wC),this._derivedBlendCommandTypes=new Array(wC),this._derivedPickCommandTypes=new Array(wC),this._derivedCommandTypesToUpdate=new Array(wC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(IC.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}}});IC.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=iBe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=iBe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=rBe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=rBe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=w3t(this,e,t),this._sunVisibleThroughGlobe=C3t(this,e),this._environmentVisible=v3t(this,e),this._useDepthPlane=S3t(this,e),this._numberOfTextureUniforms=I3t(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),P3t(this,e)};function iBe(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 rBe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function C3t(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function v3t(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function S3t(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function w3t(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function I3t(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function P3t(e,t){e._derivedCommandsLength=Rae(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Rae(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Rae(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<wC;++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=G3t())}function Rae(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?Tc.PICK_FRONT_FACE:u?Tc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Tc.TRANSLUCENT_FRONT_FACE,d=i?Tc.PICK_BACK_FACE:u?Tc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Tc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=Tc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=Tc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=Tc.DEPTH_ONLY_BACK_FACE),r[o++]=Tc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=Tc.DEPTH_ONLY_FRONT_FACE),r[o++]=Tc.OPAQUE_BACK_FACE,r[o++]=f),o)}function Ph(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function oBe(e,t){return e.indexOf(t)>-1}function D3t(e,t){Ph(e.defines,"TRANSLUCENT"),Ph(t.defines,"TRANSLUCENT")}function R3t(e,t){Ph(e.defines,"GROUND_ATMOSPHERE"),Ph(t.defines,"GROUND_ATMOSPHERE"),Ph(e.defines,"FOG"),Ph(t.defines,"FOG"),Ph(e.defines,"TRANSLUCENT"),Ph(t.defines,"TRANSLUCENT")}function Oae(e,t){if(oBe(t.defines,"TILE_LIMIT_RECTANGLE")||oBe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function Mae(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 hBe(e,t){Mae(e,t),Ph(e.defines,"GROUND_ATMOSPHERE"),Ph(t.defines,"GROUND_ATMOSPHERE"),Ph(e.defines,"FOG"),Ph(t.defines,"FOG")}function O3t(e,t){Mae(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function M3t(e,t){hBe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function sBe(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 N3t(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 L3t(e){e.cull.face=Vi.BACK,e.cull.enabled=!0}function F3t(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0}function B3t(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function k3t(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function U3t(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function aBe(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function cBe(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function z3t(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function V3t(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function j3t(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 LP(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function H3t(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function dp(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function G3t(){return[new dp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:D3t,getRenderStateFunction:L3t,getUniformMapFunction:void 0}),new dp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:R3t,getRenderStateFunction:F3t,getUniformMapFunction:void 0}),new dp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Oae,getRenderStateFunction:B3t,getUniformMapFunction:void 0}),new dp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Oae,getRenderStateFunction:k3t,getUniformMapFunction:void 0}),new dp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Oae,getRenderStateFunction:U3t,getUniformMapFunction:void 0}),new dp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Mae,getRenderStateFunction:aBe,getUniformMapFunction:LP}),new dp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hBe,getRenderStateFunction:cBe,getUniformMapFunction:LP}),new dp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:O3t,getRenderStateFunction:aBe,getUniformMapFunction:LP}),new dp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:M3t,getRenderStateFunction:cBe,getUniformMapFunction:LP}),new dp({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sBe,getRenderStateFunction:z3t,getUniformMapFunction:LP}),new dp({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sBe,getRenderStateFunction:V3t,getUniformMapFunction:LP})]}var lBe=new Array(wC),uBe=new Array(wC);IC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)uBe[r]=this._derivedCommandPacks[n[r]],lBe[r]=dBe[n[r]];W3t(this,e,i,n,lBe,uBe,t)}};function W3t(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=H3t(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=N3t(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=j3t(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}IC.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=dBe[r[a]];n.commandList.push(s[c])}};function mBe(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 fBe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var q3t=[Tc.OPAQUE_FRONT_FACE,Tc.OPAQUE_BACK_FACE],Y3t=[Tc.DEPTH_ONLY_FRONT_FACE,Tc.DEPTH_ONLY_BACK_FACE,Tc.DEPTH_ONLY_FRONT_AND_BACK_FACE];IC.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),mBe(s,a,t,i,r,q3t))};IC.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)&&fBe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,mBe(a,c,t,i,r,Y3t),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}fBe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var OV=IC;var pBe=Qo(Toe(),1);function Nae(){this._image=new Image}Nae.prototype.isReady=function(){return!0};Nae.prototype.shouldDiscardImage=function(e){return e===this._image};function PC(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 er({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 Nae),this._errorEvent=new be}Object.defineProperties(PC.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}}});PC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new PC(t);return n._metadata=e,n};PC.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]}};PC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=oy.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=X3t(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){LU(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=K3t(f)),!l(d)&&(!l(p)||p)){let g=$3t(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:Mg({uint8Array:f,format:d,flipY:!0})})};PC.prototype.pickFeatures=function(e,t,n,i,r){};function X3t(e,t,n,i,r,o){let s=oy.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 K3t(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 $3t(e){let t=pBe.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 Lae=PC;var J3t=600;function G0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ta.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ta.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??J3t}Object.defineProperties(G0.prototype,{});G0.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=Ta.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 bC({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};G0.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}};G0.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};G0.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}`)}};G0.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};G0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ta.defaultStreetViewStaticApiKey??Ta.defaultApiKey,!l(e.key)&&!l(Ta.defaultStreetViewStaticApiKey)&&!l(Ta.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new G0({...e})};G0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var Fae=G0;var Z3t=new z(1,1,1,.4),Q3t=new z(0,1,0,.05),eUt=new z(0,.5,0,.2);function DC(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 er({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??Z3t,this._glowColor=e.glowColor??Q3t,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??eUt,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(DC.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}}});DC.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()};DC.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};DC.prototype.getTileCredits=function(e,t,n){};DC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};DC.prototype.pickFeatures=function(e,t,n,i,r){};var Bae=DC;function hp(){}hp._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);hp._decodeTaskProcessor=new Jn("decodeI3S",hp._maxDecodingConcurrency);hp._promise=void 0;async function tUt(){if(await hp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return hp._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}hp.decode=async function(e,t,n,i,r){return l(hp._promise)||(hp._promise=tUt()),hp._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 MV=hp;function kae(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(kae.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});kae.prototype.load=async function(){return this._data=await mp.loadJson(this._resource),this._data};var NV=kae;function fy(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(fy.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 AW(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 nUt(e){return e==="String"?1:AW(e)}async function iUt(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)}fy.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=iUt(this).catch(function(e){console.error(e)}),this._loadPromise)};fy.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}};fy.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};fy.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)}}}};fy.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=AW(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=AW(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};fy.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=nUt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};fy.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=AW(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 LV=fy;function FV(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(FV.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});FV.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var rUt=new h,oUt=new h,sUt=new h,aUt=new h,cUt=new h;function Uae(e,t,n,i){let r=h.subtract(i,n,rUt),o=h.cross(r,h.subtract(e,n,oUt),aUt),s=h.cross(r,h.subtract(t,n,sUt),cUt);return h.dot(o,s)>=0}var lUt=new h,uUt=new h,fUt=new h,dUt=new h,hUt=new h,mUt=new h,pUt=new h,gUt=new h,_Ut=new h,yUt=new h;FV.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],lUt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],uUt),x=new h(u[y*3],u[y*3+1],u[y*3+2],fUt);if(!Uae(i,A,b,x)||!Uae(i,b,A,x)||!Uae(i,x,A,b))continue;let T=h.subtract(b,A,dUt),E=h.subtract(x,A,hUt),v=h.cross(T,E,mUt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,pUt),I=h.subtract(i,A,gUt),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,_Ut)),_=h.magnitudeSquared(h.subtract(i,x,yUt));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 gBe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(lC(e[i])):t.push(e[i]);return t}FV.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=gBe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=gBe(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 FP=FV;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 ih(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await mp.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 _Be(e,t){let n=new LV(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(_Be(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 _Be(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 FP(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 FP(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 NV(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+=TUt(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 MV.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 AUt(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 bUt(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 yBe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await AUt(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(!bUt(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=yBe(this,t);e.push(n)}return Promise.all(e)};ih.prototype._hookedRequestContent=ih.prototype.requestContent;ih.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(()=>{yBe(e._i3sNode,n)})),e._isLoading=!1,t})}};function xUt(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 bW(e,t,n,i){let r=e+t*n;return i[r]}function TUt(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=bW(s,a,n.width,n.buffer),d=bW(c,a,n.width,n.buffer),p=bW(s,u,n.width,n.buffer),g=bW(c,u,n.width,n.buffer),m=xUt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(ih.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var BP=Dl;function xW(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(xW.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function zae(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(lC(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function kP(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=zae(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=zae(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=zae(a.color,a.transparency)))}break}}return n}function EUt(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=kP(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]=kP(r.symbol,t)}return n}}function CUt(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(kP(o.symbol,t)))}return i.symbols.push(void 0),i}}xW.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=kP(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=kP(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=EUt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=kP(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=CUt(i,n))}};function ABe(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?ABe(s,t,n,i):s}}function vUt(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 SUt(e,t,n){let i=t[n],r=vUt(e.ranges,i);return e.symbols[r]}xW.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=>ABe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>SUt(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 BV=xW;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 BV(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 BP(this,t,!0)}else this._rootNode=new BP(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 Yo.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 RC=_f;function TW(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(TW.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}}});TW.prototype.load=async function(){return this._data=await mp.loadJson(this._resource),this._data};TW.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 kV=TW;function UV(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(UV.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}}});UV._fromData=async function(e,t,n,i){let r=new UV(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=UV._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 mp.loadJson(r._resource),c=new RC(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 zV=UV;var TBe=Qo(bBe(),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 le(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 wUt(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 xBe(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=wUt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=zV._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 kV(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 RC(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=xBe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await xBe(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 IUt=new U;function PUt(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,IUt),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 yi&&(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===xh.LERC){let x=TBe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function DUt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await PUt(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=DUt(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 mp=fa;function W0(){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 ui({color:new z(0,0,0,0),owner:this}),this._clearCommand=new ui({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(W0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});W0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var RUt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},OUt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},MUt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:tn.ALPHA_BLEND},NUt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -10791,7 +10949,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,ATt=`uniform sampler2D colorTexture; +`,LUt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -10806,156 +10964,7 @@ void main() out_FragColor = color; #endif } -`;x0.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 wf({context:e,width:s,height:a,format:zl.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(pTt),this._rsClassified=Ge.fromCache(gTt),this._rsDefault=Ge.fromCache(_Tt)),!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)?ATt:yTt,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(nf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};x0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};x0.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))};x0.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)};x0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};x0.prototype.isDestroyed=function(){return!1};x0.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()),le(this)};var Ow=x0;var ca={};ca.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ca.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ca.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ca.defaultAccessToken=void 0;ca.defaultShareKey=void 0;ca._getAuthorizationHeader=function(){return l(ca.defaultShareKey)?`Basic ${ca.defaultShareKey}`:`Bearer ${ca.defaultAccessToken}`};ca.apiEndpoint=new De({url:"https://api.bentley.com"});ca.getExports=async function(e,t){let n=new De({url:`${ca.apiEndpoint}mesh-export`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ca.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}`)}};ca.getRealityDataMetadata=async function(e,t){let n=new De({url:`${ca.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ca._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}`)}};ca.getRealityDataURL=async function(e,t,n){let i=new De({url:`${ca.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ca._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 la=ca;var GSe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(GSe);var Ps=GSe;var WSe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(WSe);var Vr=WSe;var qSe=Qo(Ef(),1);function bTt(e){let t=new qSe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var S_=bTt;function Fo(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(Fo.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var Mw={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Fo.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):(Mw.start=i,Mw.stop=r,Mw.isStartIncluded=o,Mw.isStopIncluded=s,Mw.data=a,new Fo(Mw))};Fo.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Fo.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 Fo(e)};Fo.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)))};Fo.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)))};Fo.intersect=function(e,t,n,i){if(!l(t))return Fo.clone(Fo.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 Fo.clone(Fo.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 Fo),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};Fo.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};Fo.prototype.clone=function(e){return Fo.clone(this,e)};Fo.prototype.equals=function(e,t){return Fo.equals(this,e,t)};Fo.prototype.equalsEpsilon=function(e,t,n){return Fo.equalsEpsilon(this,e,t,n)};Fo.prototype.toString=function(){return Fo.toIso8601(this)};Fo.EMPTY=Object.freeze(new Fo({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Cn=Fo;var YSe=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),XSe=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),xTt=Object.freeze(new Cn({start:YSe,stop:XSe})),TTt={MINIMUM_VALUE:YSe,MAXIMUM_VALUE:XSe,MAXIMUM_INTERVAL:xTt},nt=TTt;function I3(){this._cache={}}I3.prototype.fromColor=function(e,t){return a5(void 0,void 0,e,t,this._cache)};I3.prototype.fromUrl=function(e,t,n){return a5(e,void 0,t,n,this._cache)};I3.prototype.fromMakiIconId=function(e,t,n){return a5(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};I3.prototype.fromText=function(e,t,n){return a5(void 0,e,t,n,this._cache)};var ETt=new z;function CTt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,ETt).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 KSe(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 w3=new Array(4);function a5(e,t,n,i,r){w3[0]=e,w3[1]=t,w3[2]=n,w3[3]=i;let o=JSON.stringify(w3),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(CTt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return KSe(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=mT(t,{font:`bold ${i}px sans-serif`});KSe(c,u,i)}return r[o]=a,a}var w_=I3;function ene(e,t){return K.compare(e.start,t.start)}function Ds(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(Ds.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}}});Ds.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Ds))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};Ds.prototype.get=function(e){return this._intervals[e]};Ds.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ds.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ds.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ds.prototype.contains=function(e){return this.indexOf(e)>=0};var Zte=new Cn;Ds.prototype.indexOf=function(e){let t=this._intervals;Zte.start=e,Zte.stop=e;let n=wr(t,Zte,ene);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)};Ds.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]}};Ds.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=wr(n,e,ene);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)};Ds.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=wr(t,e,ene);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};Ds.prototype.intersect=function(e,t,n){let i=new Ds,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};Ds.fromJulianDateArray=function(e,t){l(t)||(t=new Ds);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 Al=new Uh,P3=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Qte(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,Al);let i=Al.millisecond+t.millisecond,r=Al.second+t.second,o=Al.minute+t.minute,s=Al.hour+t.hour,a=Al.day+t.day,c=Al.month+t.month,u=Al.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),P3[2]=Bl(u)?29:28;a>P3[c]||c>=13;)a>P3[c]&&(a-=P3[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),P3[2]=Bl(u)?29:28;return Al.millisecond=i,Al.second=r,Al.minute=o,Al.hour=s,Al.day=a,Al.month=c,Al.year=u,K.fromGregorianDate(Al,n)}var vTt=new K,STt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function $Se(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(STt);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,vTt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var D3=new Uh;Ds.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!$Se(n[2],D3))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=Qte(s,D3),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return Ds.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ds.fromIso8601DateArray=function(e,t){return Ds.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)};Ds.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)($Se(i[u],D3)||u===0)&&(r&&l(a)?s=Qte(a,D3):s=Qte(n,D3),o.push(s),a=s);return Ds.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Rs=Ds;var oRe=Qo(wne(),1),YU=Qo(Ef(),1);S0();_c();_E();i9();X3();var xPe={type:"module"},Zne="error",vSt="messageerror",TPe,Jne,EPe,Qne=!0;try{Qne=typeof structuredClone==Uo&&structuredClone(new DOMException("","AbortError")).code!==Ue}catch{}APe(SSt);function SSt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Uo&&(o=o());let s;try{s=a9(e.workerURI,n,e)}catch{return Kne(e),$ne(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await wSt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return Kne(e),CPe(e),s9(e,t);if(a&&a.codecImportFailed){if(e.reader)return CPe(e),s9(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function wSt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(xE);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}=ISt(e.writable),f;try{f=eie({type:hPe,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(()=>PSt(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 ISt(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 CPe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function tie(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function a9(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(Jne===Ue||TPe!==e){let u=typeof e==Uo;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===Ue&&(i=!1),i&&(c=xPe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return a9(e,t,n,i,!1);if(i)throw p;return a9(e,t,n,!0,!1)}}else{i===Ue&&(i=!0),i&&(c=xPe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return a9(e,t,n,!1,r);throw p}}TPe=e,Jne=a,EPe=c}else s=new Worker(Jne,EPe);return s.addEventListener(dPe,u=>{n.workerAlive=!0,SPe(n),DSt(u,n)}),s.addEventListener(Zne,u=>vPe(u,n)),s.addEventListener(vSt,u=>vPe(u,n)),s}function PSt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(tie(e),e.worker=null,t){let i=new Error(xE);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function SPe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function vPe(e,t){e.preventDefault&&e.preventDefault(),SPe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;tie(t),n||(t.worker=null);let s=e.error||new Error(e.message||Zne);n||(s=Object.assign(new Error(s.message||Zne),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function eie(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=z5(o),c.push(e.value.buffer)),i&&Qne&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Qne=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function DSt({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==mPe){let{value:y,done:A}=await a.read();g()||eie({type:Wne,value:y,done:A,messageId:r},t)}n==Wne&&(await c.ready,await c.write(new Uint8Array(i)),g()||eie({type:pPe,messageId:r},t)),n==gPe&&m(null,o)}}catch(y){g()||(tie(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}Tre();_c();S0();AE();X3();f9();g9();Lne();_E();Kw();Pie();M3();var Nre="File already exists",Lre="Zip file comment exceeds 64KB",SDe="Invalid zip file comment (must be a Uint8Array)",wDe="File entry comment exceeds 64KB",IDe="Invalid file entry comment (must be a string)",PDe="Invalid date (must be a valid Date instance)",DDe="File entry name exceeds 64KB",Fre="Version exceeds 65535",RDe="The strength must equal 1, 2, or 3",ODe="Encryption is not supported in USDZ files",MDe="Encryption is not supported when the 'passThrough' option is set",NDe="Invalid extra field (must be a Map)",LDe="Invalid extra field type (must be integer 0..65535)",FDe="Invalid extra field data (must be a Uint8Array)",q9="Extra field data exceeds 64KB",Kwt="Compression method not supported",BDe=-2147483648,kDe=2147483647,gDe=BigInt(0),_De=BigInt("0x7fffffffffffffff"),Y9="Zip64 is not supported (set the 'zip64' option to 'true')",UDe="Undefined uncompressed size",zDe="Undefined compression method";var VDe="Undefined reader",jDe="Zip file not empty",HDe="Invalid uid (must be integer 0..2^32-1)",GDe="Invalid gid (must be integer 0..2^32-1)",WDe="Invalid UNIX mode (must be integer 0..65535)",qDe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",YDe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",XDe="Invalid msdosAttributesRaw (must be integer 0..255)",KDe="Invalid msdosAttributes (must be an object with boolean flags)",$De="Invalid level (must be integer 0..9)",JDe="Signature data exceeds 64KB",yDe=new Uint8Array([7,0,2,0,65,69,3,0,0]),$wt=4,Jwt=9,Zwt=67,Qwt=1,Pre="infozip",Dre="unix",eIt=9,Ere=0,ADe=[],uU=class{constructor(t,n={}){t=new sI(t);let{availableSize:i=mE,maxSize:r=mE}=t,o=i>0&&i!==mE&&r>0&&r!==mE;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[O3]===Ue?t.size||t.writable.size||0:n[O3],initialOffset:n[O3]===Ue?0:n[O3]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:Ue})}prependZip(t){return Cre(this,tIt(this,t))}appendZip(t){return Cre(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 N_(t),await Vc(t),(t.size===Ue||!t.readUint8Array)&&(t=new af(await P0(t.readable)),await Vc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(Tre(),dDe)),d=new f(t),p=await d.getEntries();await d.close(),await Vc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(Nre);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 N0(n.writer,QDe()),n.offset+=4));let y=await xIt(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=ZDe(L||mr),A.extraFieldAES&&(O=99);let P=sr(L),M=!!R&&R.uncompressedSize!==Ue,F=!!R&&R.compressedSize!==Ue,V=r1e(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=i1e({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&&jc(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:mr,rawExtraFieldAES:mr,rawExtraFieldExtendedTimestamp:mr,rawExtraFieldNTFS:mr,rawExtraFieldUnix:mr,rawExtraField:L,rawCentralExtraField:mr,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=nIt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),Cre(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==pE&&(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=mr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(SDe);if(sr(t)>65535)throw new Error(Lre);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 pIt(i,t,n),!p9(o)&&Ji(i,n,N5)||await s.getWriter().close(),o.getData?o.getData():s}};var Rre=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Cre(e,t){let n=new Rre((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 tIt(e,t){if(e.filenames.size)throw new Error(jDe);await e.appendZipEntries(t)}async function nIt(e,t,n,i){if(i=Object.assign({},i),Ji(e,i,EE)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Nre);e.filenames.add(t),Ere<R_().maxWorkers?Ere++:await new Promise(r=>ADe.push(r));try{return await iIt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=ADe.shift();r?r():Ere--}}async function iIt(e,t,n,i){let r=rIt(e,t,i);({name:t}=r);let o=oIt(e,t,i),{comment:s}=o,a=i[x9];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 bPe(R_())&&(p.level=0);let g=await sIt(e,n,o,i);({reader:n}=g);let m=fU(e.writer),y=B_(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[b9],crc32:i.crc32===Ue?i[b9]:i.crc32,offset:e.offset-m,diskNumberStart:y,[Vw]:e.options[Vw]});let A=uIt(i),b=dIt(i),x=sr(A.localHeaderArray,b.dataDescriptorArray);d=await cIt(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,[_9]:d.internalFileAttributes,[y9]:d.externalFileAttributes}),new QA(d)}function rIt(e,t,n){let i=Ji(e,n,yie),r=Ji(e,n,xie,i?20:768),o=Ji(e,n,Eie),s=_I(e,n,"uid"),a=_I(e,n,"gid"),c=_I(e,n,vie),u=Ji(e,n,yIe),f=Ji(e,n,Sie),d=Ji(e,n,wie),p=Ji(e,n,Iie);if(Hw(s,4294967295,HDe),Hw(a,4294967295,GDe),Hw(c,65535,WDe),u!==Ue&&u!==Pre&&u!==Dre)throw new Error(qDe);if(u===Dre&&(s!==Ue&&s>65535||a!==Ue&&a>65535))throw new Error(YDe);u===Ue&&(s!==Ue||a!==Ue)&&(u=Pre);let g=_I(e,n,gie),m=Ji(e,n,_ie),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),Hw(g,255,XDe),m&&(typeof m!==Wwe||Array.isArray(m)))throw new Error(KDe);if(r>65535)throw new Error(Fre);let b=n1e(e,n,pie,y9),x=b!==Ue;x||(b=0),!n[EE]&&t.endsWith("/")&&(n[EE]=!0);let T=Ji(e,n,EE);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}=fIt(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 oIt(e,t,n){let i=Ore(e,n,_Ie)||Ww,r=i(t,L5);if(r===Ue&&(r=Ww(t)),sr(r)>65535)throw new Error(DDe);let o=n[Q3]||"";if(typeof o!=pE)throw new Error(IDe);let s=i(o,F5);if(s===Ue&&(s=Ww(o)),sr(s)>65535)throw new Error(wDe);let a=Ji(e,n,bie);if(a!==Ue&&a>65535)throw new Error(Fre);let c=Ire(e,n,aI,new Date),u=Ji(e,n,cI),f=Ire(e,n,tU),d=Ire(e,n,nU),p=n1e(e,n,mie,_9,0),g=Ji(e,n,P5),m=Ji(e,n,w5),y=Ji(e,n,I5);U5(m,y);let A=_I(e,n,aIe,3),b=Ji(e,n,Tie),x=Ji(e,n,cIe,!0),T=Ji(e,n,lIe),E=Ji(e,n,uIe,!0),v=Ji(e,n,R5),S=Ji(e,n,M5),I=Ji(e,n,dIe),R=Ore(e,n,hIe),O=Ji(e,n,mIe,!0),L=k5(Ji(e,n,D5)),_=Ji(e,n,pIe,!0),C=Ji(e,n,Cie),w=g||C===Ue?Ue:K5(C);if(!g&&C!==Ue&&C!==0&&C!==8&&!w)throw new Error(Kwt);let P=_I(e,n,fIe);if(Hw(P,eIt,$De),e.options[Vw]){if(m!==Ue||y!==Ue)throw new Error(ODe);P===Ue&&C===Ue&&(P=0)}g&&(P=Ue);let M=Ji(e,n,O5),F=Ji(e,n,Pne);I&&F===Ue&&(F=!1),(F===Ue||b&&!g)&&(F=!0),P!==Ue&&P!=6&&(M=!1);let V=Ji(e,n,A9);if(!b&&(m!==Ue||y!==Ue)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(RDe);let B=vre(n[x9]),j=vre(n[AIe]),k=vre(n[bIe]);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 vre(e){if(!e)return mr;if(!(e instanceof Map))throw new Error(NDe);let t=0,n=0;e.forEach((o,s)=>{if(One(s,65535,LDe),!(o instanceof Uint8Array))throw new Error(FDe);if(sr(o)>65535)throw new Error(q9);t+=4+sr(o)});let i=new Uint8Array(t),r=fi(i);return e.forEach((o,s)=>{M0(r,n,s),M0(r,n+2,sr(o)),mU(i,o,n+4),n+=4+sr(o)}),i}async function sIt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Ji(e,i,EE))throw new Error(VDe);let r;return t&&(t=new N_(t),await Vc(t),{size:r}=t),Object.assign({reader:t},aIt(e,!!t,r,n,i))}function aIt(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[eU],y===Ue)throw new Error(UDe);if(g===Ue)throw new Error(zDe)}let A=d===!0,b=Ji(e,r,Aie);if(t&&o&&!b&&sr(a,c))throw new Error(MDe);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?vDe(y)+T:n):n===Ue?(f=!0,(d||d===Ue)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(Mre(g,p)?vDe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!Mre(g,p);E&&!s&&Ji(e,r,Pne)===Ue&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(Y9);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 cIt(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[Vw],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:mE}),I.size=0,await Vc(s)):(I=s,await R,await O()),await Vc(I);let _=fU(s);e.addSplitZipSignature&&!b&&await TDe(e,s),y&&!b&&bDe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=B_(s),P=dU(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await N0(I,C)),A=await lIt(n,I,A,i,R_(),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 TDe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=B_(s),A.offset=dU(e,s),y){let M=i.metadataSize;bDe(i,e.offset-fU(s)),A.size+=i.metadataSize-M}mIt(A,d.localHeaderView,r),await N0(s,d.localHeaderArray),await e1e(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(){yI(s,sr(d.localHeaderArray))&&await s.closeDisk()}}async function lIt(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,bi={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,hi=0;ht||(wi=0);let{writable:xi}=t;if(e){let jn=km(oie(e)),nn=e.size,Wn={options:{codecType:eI,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 u9({readable:jn,writable:xi},Wn);if(hi=Zi.outputSize,t.size+=hi,ht||(wi=Zi.inputSize,(!m||j)&&(Wi=Zi.crc32)),!B&&hi>=4294967295||!V&&wi>=4294967295)throw new Error(Y9)}catch(Zi){throw Zi.outputSize!==Ue&&(t.size+=Zi.outputSize),Zi}}return hIt({crc32:Wi,compressedSize:hi,uncompressedSize:wi,headerInfo:a,dataDescriptorInfo:c},s),k&&await N0(t,O),Object.assign(bi,{uncompressedSize:wi,compressedSize:hi,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+hi,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:Wi,crc32:m&&!j&&!ht?Ue:Wi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),bi}function uIt(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&&Mre(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=td(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=mr;let P;if(x&&!c){let xe=td(sr(yDe)+2);xe.writeUint16(39169),xe.writeBytes(yDe),P=xe.array,P[8]=m}else P=mr;let M,F,V;if(y){let xe=H9(n),ge=t1e(xe);if(ge){let Se=9+(r?4:0)+(o?4:0),Re=td(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(EDe(H9(r))),o&&Re.writeUint32(EDe(H9(o))),F=Re.array}else F=mr;if(A===Ue?!ge||!!(r||o):A)try{let Se=wre(n),Re=td(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(Se),Re.writeUint64(r?wre(r):Se),Re.writeUint64(o?wre(o):Se),M=Re.array}catch{M=mr}else M=mr}else M=F=mr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==Pre&&(xe!==Ue||ge!==Ue)){let Se=xDe(xe===Ue?0:xe),Re=xDe(ge===Ue?0:ge),Qe=3+Se.length+Re.length,He=td(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==Dre&&(xe!==Ue||ge!==Ue)){let Se=td(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=mr}catch{B=mr}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[$wt]=Qwt),M0(fi(P),Jwt,R),R=99);let k=w?sr(L):0,G=k+sr(P,F,M,B,p,g),q=e[Vw]?Zwt:0;if(G+q>65535)throw new Error(q9);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=i1e({version:I,bitFlag:r1e(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<zw?zw:Q>Ine?Ine:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=td(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||jc(fe,18,0),T||jc(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:mr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:M,rawExtraFieldUnix:B,rawExtraFieldAES:P,extraFieldLength:G}}function bDe(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);M0(a,0,6534),M0(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);M0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function xDe(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 fIt(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 dIt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=mr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=fi(i),n&&(o=4,jc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function hIt({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&&(jc(u,10,e),c&&jc(d,p,e)),o?c&&(hU(d,p+4,BigInt(t)),hU(d,p+12,BigInt(n))):(jc(u,14,t),jc(u,18,n),c&&(jc(d,p+4,t),jc(d,p+8,n)))}function mIt({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)&&jc(u,14,r),c||jc(u,18,o),a||jc(u,22,s)),n&&i){let p=30+sr(e)+4;hU(u,p,BigInt(s)),hU(u,p+8,BigInt(o))}}async function pIt(e,t,n){let i=gIt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await _It(e,i,n),a=await yIt(e,s,n);await AIt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function gIt(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=td(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=mr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=H9(p);if(f&&t1e(v)){let I=td(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=mr;n.rawExtraFieldExtendedTimestamp=E;let S=sr(T,r,s,a,E,c,u);if(S>65535)throw new Error(q9);t+=46+sr(i,o)+S}return t}async function _It(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await Vc(r);let s=0,a=0,c=B_(r),u=fU(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;yI(r,s+k-a)&&(await N0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=B_(r),u=fU(r)),L||jc(O,18,V),_||jc(O,14,B),(w||C)&&p.version<45&&M0(O,0,45);let G=td(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 QA(p))}catch{}}return await N0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:B_(r),entriesLength:f},directoryArray:o}}async function yIt(e,t,n){let i=Ore(e,n,vIe);if(i){let r=await i(t),o=sr(r);if(o>65535)throw new Error(JDe);let s=td(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return yI(a,sr(s.array))&&await a.closeDisk(),await N0(a,s.array),6+o}return 0}async function AIt(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=dU(e,o),p=sr(t);if(p>65535)throw new Error(Lre);let g=Ji(e,n,A9),m=B_(r);if(yI(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(Y9);g=!0}let y=td(g?98:22);yI(r,sr(y.array)+p)&&await r.closeDisk(),m=B_(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(dU(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Ji(e,n,gIe,!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 N0(r,y.array),p&&await N0(r,t)}function td(e){let t=new Uint8Array(e),n=fi(t),i=0;return{array:t,writeUint8:r=>{CIt(n,i,r),i+=1},writeUint16:r=>{M0(n,i,r),i+=2},writeUint32:r=>{jc(n,i,r),i+=4},writeUint64:r=>{hU(n,i,BigInt(r)),i+=8},writeBytes:r=>{mU(t,r,i),i+=sr(r)},skip:r=>i+=r}}function B_(e){let{diskNumber:t=0}=e;return t}function fU(e){let{diskOffset:t=0}=e;return t}function yI(e,t){let{availableSize:n=mE}=e;return t>n}function dU(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function bIt(e){let t=await zo(e,0,4);return EIt(fi(t),0)==134695760}function ZDe(e){let t=fi(e),n=0;for(;n+4<=sr(e);){let i=4+W9(t,n+2);if(W9(t,n)==1)return ZDe(hh(e.subarray(0,n),e.subarray(Math.min(n+i,sr(e)))));n+=i}return e}async function xIt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>j9(t,c)-j9(t,u)),a=0;for(let c of s){let u=j9(t,c);await Sre(e,t,a,u-a),yI(r,await TIt(t,u))&&await r.closeDisk(),o.set(c,{offset:dU(e,r),diskNumberStart:B_(r)}),a=u}await Sre(e,t,a,i-a)}else{let s=e.offset;await Sre(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+j9(t,a),diskNumberStart:0}))}return o}async function Sre(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await e1e(oie(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 TIt(e,t){let n=await zo(e,t,30);if(sr(n)<30)return 30;let i=fi(n);return 30+W9(i,26)+W9(i,28)}function j9(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function QDe(){let e=new Uint8Array(4);return jc(fi(e),0,134695760),e}async function TDe(e,t){delete e.addSplitZipSignature,await N0(t,QDe()),e.offset+=4}async function N0(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 e1e(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 wre(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<gDe?gDe:t>_De?_De:t}}function H9(e){return Math.floor(e.getTime()/1e3)}function t1e(e){return e>=BDe&&e<=kDe}function EDe(e){return Math.min(kDe,Math.max(BDe,e))}function Ji(e,t,n,i){let r=t[n]===Ue?e.options[n]:t[n];return r===Ue?i:r}function Ire(e,t,n,i){let r=Ji(e,t,n,i);if(r===null)return i;if(r!==Ue&&(typeof r.getTime!=Uo||Number.isNaN(r.getTime())))throw new Error(PDe);return r}function Ore(e,t,n){return jw(Ji(e,t,n))}function n1e(e,t,n,i,r){let o=CDe(t,n,i),s=o===Ue?CDe(e.options,n,i):o;return s===Ue?r:s}function CDe(e,t,n){return e[t]===Ue?e[n]:e[t]}function _I(e,t,n,i){return gE(Ji(e,t,n,i))}function vDe(e){return e+5*(Math.floor(e/16383)+1)}function Mre(e,t){return e===Ue?t===Ue||t>0:e!==0}function W9(e,t){return e.getUint16(t,!0)}function EIt(e,t){return e.getUint32(t,!0)}function CIt(e,t,n){e.setUint8(t,n)}function M0(e,t,n){e.setUint16(t,n,!0)}function jc(e,t,n){e.setUint32(t,n,!0)}function hU(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 i1e({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=td(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);M0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),M0(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 r1e(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}g9();M3();S0();AE();_c();S0();AE();Gne();var wPi=1024*1024;Kw();var DPi=1024*1024;var OPi=1024*1024;var MPi=512*1024;var SIt={};try{Gw({baseURI:SIt.url})}catch{}S0();var wIt=[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],IIt=[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],PIt=[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],DIt=[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],RIt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gU=new Uint8Array(288);gU.fill(8,0,144),gU.fill(9,144,256),gU.fill(7,256,280),gU.fill(8,280,288);var OIt=new Uint8Array(30).fill(5);function pU(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 nd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function o1e(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+=nd[a>>18&63]+nd[a>>12&63]+nd[a>>6&63]+nd[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=nd[a>>18&63]+nd[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=nd[a>>18&63]+nd[a>>12&63]+nd[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(pU(gU),pU(OIt));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=wIt[T]+f(IIt[T]),v=m(b),S=PIt[v]+f(DIt[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[RIt[I]]=f(3);let E=pU(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[pU(v.subarray(0,A)),pU(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=nd.indexOf(n[o])<<18|nd.indexOf(n[o+1])<<12|(63&nd.indexOf(n[o+2]))<<6|63&nd.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/6DVSQEDkXcBwJ8M08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pwZlHRl98/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)})}_c();S0();X3();f9();var $9="deflate",X9="deflate-raw",s1e="deflate64-raw",K9="gzip",Ns,AI,k_,_U,a1e;function c1e(e){if(Ns=e,{malloc:AI,free:k_,memory:_U}=Ns,typeof AI!="function"||typeof k_!="function"||!_U)throw Ns=AI=k_=_U=null,new Error("Invalid WASM module")}function l1e(e){a1e=e}function u1e(e,t,n={}){if(!Ns){let a=new Error("WASM module not loaded");throw a.cause=a1e,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=AI(r),this.in=AI(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=Ns.deflate_process,this._last_consumed=Ns.deflate_last_consumed,this._end=Ns.deflate_end,this.streamHandle=Ns.deflate_new(),t===K9?a=Ns.deflate_init_gzip(this.streamHandle,i):t===X9?a=Ns.deflate_init_raw(this.streamHandle,i):a=Ns.deflate_init(this.streamHandle,i)):t===s1e?(this._process=Ns.inflate9_process,this._last_consumed=Ns.inflate9_last_consumed,this._end=Ns.inflate9_end,this.streamHandle=Ns.inflate9_new(),a=Ns.inflate9_init_raw(this.streamHandle)):(this._process=Ns.inflate_process,this._last_consumed=Ns.inflate_last_consumed,this._end=Ns.inflate_end,this.streamHandle=Ns.inflate_new(),t===X9?a=Ns.inflate_init_raw(this.streamHandle):t===K9?a=Ns.inflate_init_gzip(this.streamHandle):a=Ns.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(_U.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&&k_&&(k_(this.in),this.in=0),this.in=AI(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(_U.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&&k_&&k_(a.in),a.in=0,a.out&&k_&&k_(a.out),a.out=0,c}}var DE=class{constructor(t=$9,n){return u1e(!0,t,n)}},RE=class{constructor(t=$9,n){return u1e(!1,t,n)}};DE.requiresModule=!0;RE.requiresModule=!0;DE.supportedFormats=[$9,X9,K9];RE.supportedFormats=[$9,X9,K9,s1e];var f1e=!1;async function d1e(e,{baseURI:t}){if(!f1e)try{await MIt(e,t),f1e=!0}catch(n){throw l1e(n),n}}async function MIt(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=NIt(e);else throw o}let r=await WebAssembly.instantiate(n);c1e(r.instance.exports)}function NIt(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 J9;yPe({initModule:e=>{if(!J9){let{wasmURI:t}=e;typeof t==Uo&&(t=t()),J9=d1e(t,e).catch(n=>{throw J9=null,n})}return J9}});Gw({CompressionStreamFallback:DE,DecompressionStreamFallback:RE});o1e(Gw);function LIt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Ln=LIt;function nb(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(nb.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});nb.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};nb.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))}};nb.prototype.equals=function(e){return this===e||e instanceof nb&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};nb.prototype.valueOf=function(){return this._value};nb.prototype.toString=function(){return String(this._value)};var di=nb;function FIt(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 BIt(e){return new di(e)}function kIt(e,t,n){return FIt(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??BIt)}var me=kIt;function yU(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(yU.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")});yU.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 yU(this)};yU.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 Tl=yU;var h1e={FIXED:0,INERTIAL:1};Object.freeze(h1e);var Gi=h1e;function Bre(){this._removalFunctions=[]}Bre.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)}};Bre.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var $o=Bre;function zm(){pe.throwInstantiationError()}Object.defineProperties(zm.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});zm.prototype.getValue=pe.throwInstantiationError;zm.prototype.equals=pe.throwInstantiationError;zm.equals=function(e,t){return e===t||l(e)&&e.equals(t)};zm.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(!zm.equals(e[i],t[i]))return!1;return!0};zm.isConstant=function(e){return!l(e)||e.isConstant};zm.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};zm.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};zm.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=zm;function UIt(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 OE(){this._eventHelper=new $o,this._definitionChanged=new be,this._intervals=new Rs,this._intervals.changedEvent.addEventListener(OE.prototype._intervalsChanged,this)}Object.defineProperties(OE.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var zIt=new K;OE.prototype.getValue=function(e,t){l(e)||(e=K.now(zIt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};OE.prototype.equals=function(e){return this===e||e instanceof OE&&this._intervals.equals(e._intervals,X.equals)};OE.prototype._intervalsChanged=function(){UIt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var El=OE;function ib(e){this._referenceFrame=e??Gi.FIXED,this._definitionChanged=new be,this._composite=new El,this._composite.definitionChanged.addEventListener(ib.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ib.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 VIt=new K;ib.prototype.getValue=function(e,t){return l(e)||(e=K.now(VIt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};ib.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};ib.prototype.equals=function(e){return this===e||e instanceof ib&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};ib.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var yc=ib;function Z9(){pe.throwInstantiationError()}Object.defineProperties(Z9.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}});Z9.prototype.update=function(e){pe.throwInstantiationError()};Z9.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ls=Z9;function kre(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??Vr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(kre.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Vr.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===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});kre.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Vr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Vr.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 Vm=kre;function jIt(e){return e}function HIt(e,t){return me(e,t,jIt)}var lu=HIt;function ME(){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(ME.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:lu("startTime"),stopTime:lu("stopTime"),currentTime:lu("currentTime"),clockRange:lu("clockRange"),clockStep:lu("clockStep"),multiplier:lu("multiplier")});ME.prototype.clone=function(e){return l(e)||(e=new ME),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};ME.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};ME.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};ME.prototype.getValue=function(e){return l(e)||(e=new Vm),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=ME;var m1e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(m1e);var U_=m1e;function bI(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(bI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});bI.prototype.getType=function(e){return"Color"};var GIt=new K;bI.prototype.getValue=function(e,t){return l(e)||(e=K.now(GIt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};bI.prototype.equals=function(e){return this===e||e instanceof bI&&X.equals(this._color,e._color)};var Kt=bI;var WIt=new U(1,1),qIt=!1,YIt=z.WHITE;function xI(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(xI.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")});xI.prototype.getType=function(e){return"Image"};var XIt=new K;xI.prototype.getValue=function(e,t){return l(e)||(e=K.now(XIt)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,WIt,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,YIt,t.color),X.getValueOrDefault(this._transparent,e,qIt)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};xI.prototype.equals=function(e){return this===e||e instanceof xI&&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 rb=xI;function KIt(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 rb;return t.image=e,t}}function $It(e,t){return me(e,t,KIt)}var lo=$It;function AU(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(AU.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});AU.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 AU(this)};AU.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 NE=AU;function TI(){pe.throwInstantiationError()}Object.defineProperties(TI.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});TI.prototype.getValue=pe.throwInstantiationError;TI.prototype.getValueInReferenceFrame=pe.throwInstantiationError;TI.prototype.equals=pe.throwInstantiationError;var p1e=new $;TI.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,p1e);if(n===Gi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Gi.FIXED)return $.multiplyByVector($.transpose(o,p1e),t,r)};var Hm=TI;function LE(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Gi.FIXED}Object.defineProperties(LE.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Gi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var JIt=new K;LE.prototype.getValue=function(e,t){return l(e)||(e=K.now(JIt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};LE.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)};LE.prototype.getValueInReferenceFrame=function(e,t,n){return Hm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};LE.prototype.equals=function(e){return this===e||e instanceof LE&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var uu=LE;function bU(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(bU.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:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});bU.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 bU(this)};bU.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 FE=bU;function xU(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(xU.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:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});xU.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 xU(this)};xU.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 BE=xU;function TU(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(TU.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:lo("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")});TU.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 TU(this)};TU.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 kE=TU;function EU(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(EU.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:lo("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")});EU.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 EU(this)};EU.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 UE=EU;function CU(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(CU.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")});CU.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 CU(this)};CU.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 Gm=CU;var Ure=new AA;function vU(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(vU.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 ZIt=new K;vU.prototype.getValue=function(e,t){return l(e)||(e=K.now(ZIt)),l(t)||(t=new AA),t.translation=X.getValueOrClonedDefault(this._translation,e,Ure.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,Ure.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,Ure.scale,t.scale),t};vU.prototype.equals=function(e){return this===e||e instanceof vU&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var zE=vU;function z_(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(z_.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}}});z_.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function QIt(e){return new di(e)}z_.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??QIt)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};z_.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var ePt=new K;z_.prototype.getValue=function(e,t){l(e)||(e=K.now(ePt)),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};z_.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 tPt(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}z_.prototype.equals=function(e){return this===e||e instanceof z_&&tPt(this,e)};var fu=z_;function g1e(e){return new zE(e)}function nPt(e){return new fu(e,g1e)}function iPt(e){return new fu(e)}function rPt(e){return new fu(e)}function SU(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(SU.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,rPt),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,nPt),articulations:me("articulations",void 0,iPt),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});SU.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 SU(this)};SU.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 fu(t,g1e)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new fu(n)}};var V_=SU;function wU(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(wU.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});wU.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new wU(this)};wU.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var VE=wU;function IU(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(IU.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:lo("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});IU.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 IU(this)};IU.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 j_=IU;function PU(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(PU.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});PU.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 PU(this)};PU.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 DU=PU;function RU(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(RU.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")});RU.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 RU(this)};RU.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 jE=RU;function oPt(e){return Array.isArray(e)&&(e=new Mc(e)),new di(e)}function OU(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(OU.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,oPt),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:lo("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")});OU.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 OU(this)};OU.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 Wm=OU;function MU(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(MU.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:lo("material"),depthFailMaterial:lo("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});MU.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 MU(this)};MU.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 Cl=MU;function NU(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(NU.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:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});NU.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 NU(this)};NU.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 HE=NU;function LU(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(LU.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:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});LU.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 LU(this)};LU.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 qm=LU;function FU(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(FU.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:lo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});FU.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 FU(this)};FU.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 H_=FU;var sPt=new he,zre=[];function aPt(e){return new uu(e)}function cPt(e){return me(e,void 0,aPt)}function Za(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function _h(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Jn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??U_.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",...zre],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 Vre(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)&&Vre(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(_h.prototype,{availability:lu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:lu("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&&Vre(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:lu("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&&Vre(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Za("billboard",Tl),box:Za("box",NE),corridor:Za("corridor",FE),cylinder:Za("cylinder",BE),description:me("description"),ellipse:Za("ellipse",kE),ellipsoid:Za("ellipsoid",UE),label:Za("label",Gm),model:Za("model",V_),tileset:Za("tileset",VE),orientation:me("orientation"),path:Za("path",j_),plane:Za("plane",DU),point:Za("point",jE),polygon:Za("polygon",Wm),polyline:Za("polyline",Cl),polylineVolume:Za("polylineVolume",HE),properties:Za("properties",fu),position:cPt("position"),rectangle:Za("rectangle",qm),viewFrom:me("viewFrom"),wall:Za("wall",H_)});_h.registerEntityType=function(e,t){Object.defineProperties(_h.prototype,{[e]:Za(e,t)}),zre.includes(e)||zre.push(e)};_h.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};_h.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,lu(e,!0))};_h.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};_h.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 _1e=new $,y1e=new h,A1e=new Le;_h.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,y1e);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,A1e);return l(i)?t=N.fromRotationTranslation($.fromQuaternion(i,_1e),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};_h.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,y1e);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,sPt);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):As(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,A1e);return l(c)?r=N.fromRotationTranslation($.fromQuaternion(c,_1e),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};_h.supportsMaterialsforEntitiesOnTerrain=function(e){return su.supportsMaterials(e)};_h.supportsPolylinesOnTerrain=function(e){return Rm.isSupported(e)};var eo=_h;function cs(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??Ho.NONE}var b1e=cs.SHOW_INDEX=0,E1e=cs.POSITION_INDEX=1,lPt=cs.COLOR_INDEX=2,uPt=cs.OUTLINE_COLOR_INDEX=3,fPt=cs.OUTLINE_WIDTH_INDEX=4,dPt=cs.PIXEL_SIZE_INDEX=5,hPt=cs.SCALE_BY_DISTANCE_INDEX=6,mPt=cs.TRANSLUCENCY_BY_DISTANCE_INDEX=7,pPt=cs.DISTANCE_DISPLAY_CONDITION_INDEX=8,gPt=cs.DISABLE_DEPTH_DISTANCE_INDEX=9,_Pt=cs.SPLIT_DIRECTION_INDEX=10;cs.NUMBER_OF_PROPERTIES=11;function id(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(cs.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,id(this,b1e))}},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),id(this,E1e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),id(this,hPt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),id(this,mPt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,id(this,dPt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),id(this,lPt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),id(this,uPt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,id(this,fPt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),id(this,pPt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,id(this,gPt))}},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,id(this,b1e))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,id(this,_Pt))}}});cs.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};cs.prototype._getActualPosition=function(){return this._actualPosition};cs.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),id(this,E1e)};var x1e=new se;cs._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(N.multiplyByPoint(n,e,x1e),fr.computeActualEllipsoidPosition(t,x1e))};var T1e=new se;cs._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,T1e),T1e);return fr.worldToWindowCoordinates(n,r,i)};cs.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=cs._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};cs.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};cs.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};cs.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Pa=cs;var ob=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -in float v_splitDirection; -void main() -{ -if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; -if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -float distanceToCenter = length(gl_PointCoord - vec2(0.5)); -float maxDistance = max(0.0, 0.5 - v_pixelDistance); -float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); -float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); -vec4 color = mix(v_outlineColor, v_color, innerAlpha); -color.a *= wholeAlpha; -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; -} -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; -} -#else -if (color.a >= 0.995) -{ -discard; -} -#endif -#endif -out_FragColor = czm_gammaCorrect(color); -czm_writeLogDepth(); -} -`;var BU=`uniform float u_maxTotalPointSize; -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 scaleByDistance; -in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -out float v_splitDirection; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -void main() -{ -vec3 positionHigh = positionHighAndSize.xyz; -vec3 positionLow = positionLowAndOutline.xyz; -float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; -float totalSize = positionHighAndSize.w + outlineWidthBothSides; -float outlinePercent = outlineWidthBothSides / totalSize; -totalSize *= czm_pixelRatio; -float temp = compressedAttribute1.x * SHIFT_RIGHT8; -float show = floor(temp); -#ifdef EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -vec4 color = 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) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; -} -else -{ -lengthSq = dot(positionEC.xyz, positionEC.xyz); -} -#endif -#ifdef EYE_DISTANCE_SCALING -totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif -if (totalSize > 0.0) { -totalSize += 3.0; -} -totalSize = min(totalSize, u_maxTotalPointSize); -if (totalSize < 1.0) -{ -positionEC.xyz = vec3(0.0); -totalSize = 1.0; -} -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency < 0.004) -{ -positionEC.xyz = vec3(0.0); -} -#endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; -float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; -if (lengthSq < nearSq || lengthSq > farSq) { -positionEC.xyz = vec3(0.0, 0.0, 1.0); -} -#endif -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) -{ -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))) -{ -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif -} -} -#endif -v_color = color; -v_color.a *= translucency * show; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency * show; -v_innerPercent = 1.0 - outlinePercent; -v_pixelDistance = 2.0 / totalSize; -gl_PointSize = totalSize * show; -gl_Position *= show; -v_pickColor = pickColor; -v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; -} -`;var yPt=Pa.SHOW_INDEX,Gre=Pa.POSITION_INDEX,C1e=Pa.COLOR_INDEX,APt=Pa.OUTLINE_COLOR_INDEX,bPt=Pa.OUTLINE_WIDTH_INDEX,xPt=Pa.PIXEL_SIZE_INDEX,v1e=Pa.SCALE_BY_DISTANCE_INDEX,S1e=Pa.TRANSLUCENCY_BY_DISTANCE_INDEX,w1e=Pa.DISTANCE_DISPLAY_CONDITION_INDEX,TPt=Pa.DISABLE_DEPTH_DISTANCE_INDEX,EPt=Pa.SPLIT_DIRECTION_INDEX,Wre=Pa.NUMBER_OF_PROPERTIES,vl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function yh(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(Wre),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=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Li.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(yh.prototype,{length:{get:function(){return qre(this),this._pointPrimitives.length}}});function I1e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}yh.prototype.add=function(e){let t=new Pa(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};yh.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};yh.prototype.removeAll=function(){I1e(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function qre(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}}yh.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};yh.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};yh.prototype.get=function(e){return qre(this),this._pointPrimitives[e]};yh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Wre;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function CPt(e,t,n){return new Ag(e,[{index:vl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Gre]},{index:vl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Gre]},{index:vl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[C1e]},{index:vl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[S1e]},{index:vl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[v1e]},{index:vl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[w1e]}],t)}var jre=new Sn,Q9=new z;function P1e(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,jre);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[vl.positionHighAndSize],u=jre.high;c(r,u.x,u.y,u.z,s);let f=n[vl.positionLowAndOutline],d=jre.low;f(r,d.x,d.y,d.z,a)}var vPt=256;function D1e(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;Q9.red=o.alpha,Q9.green=s.alpha,Q9.blue=a.alpha;let c=n[vl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(Q9))}function R1e(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)*vPt+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[vl.compressedAttribute1];g(r,d,p,o,a)}function O1e(e,t,n,i){let r=i._index,o=n[vl.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 M1e(e,t,n,i){let r=i._index,o=n[vl.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 SPt(e,t,n,i){P1e(e,t,n,i),D1e(e,t,n,i),R1e(e,t,n,i),O1e(e,t,n,i),M1e(e,t,n,i)}function Hre(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):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function wPt(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)&&Hre(e,i,i.length,t,o,!0)):n===re.MORPHING?Hre(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&Hre(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function IPt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var PPt=[];yh.prototype.update=function(e){if(qre(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,wPt(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<Wre;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=CPt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,SPt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=PPt;v.length=0,(o[Gre]||o[bPt]||o[xPt])&&v.push(P1e),(o[C1e]||o[APt])&&v.push(D1e),(o[yPt]||o[S1e])&&v.push(R1e),o[v1e]&&v.push(O1e),(o[w1e]||o[TPt]||o[EPt])&&v.push(M1e);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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),IPt(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Li.OPAQUE||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Li.TRANSLUCENT||this._blendOption===Li.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:[BU]}),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===Li.OPAQUE_AND_TRANSLUCENT&&(y=new Ye({defines:["OPAQUE"],sources:[ob]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vl}),y=new Ye({defines:["TRANSLUCENT"],sources:[ob]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vl})),this._blendOption===Li.OPAQUE&&(y=new Ye({sources:[ob]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vl})),this._blendOption===Li.TRANSLUCENT&&(y=new Ye({sources:[ob]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:vl})),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===Li.OPAQUE,I=this._blendOption===Li.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)}}};yh.prototype.isDestroyed=function(){return!1};yh.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(),I1e(this._pointPrimitives),le(this)};var EI=yh;var N1e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Yre=1,kU=8,ls=new Uint32Array(96),zU=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!==Yre)throw new Error(`Got v${r} data when expected v${Yre}.`);let o=N1e[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=N1e.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,kU,t),this.coords=new i(o,kU+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(kU+a+c+u);this.ids=new this.IndexArrayType(f,kU,t),this.coords=new i(f,kU+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(Yre<<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 Kre(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;ls[0]=0,ls[1]=o.length-1,ls[2]=0;let c=3,u=[];for(;c>0;){let f=ls[--c],d=ls[--c],p=ls[--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)&&(ls[c++]=p,ls[c++]=g-1,ls[c++]=1-f),(f===0?i>=m:r>=y)&&(ls[c++]=g+1,ls[c++]=d,ls[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;ls[0]=0,ls[1]=o.length-1,ls[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=ls[--c],p=ls[--c],g=ls[--c];if(p-g<=a){for(let b=g;b<=p;b++)L1e(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];L1e(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(ls[c++]=g,ls[c++]=m-1,ls[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(ls[c++]=m+1,ls[c++]=p,ls[c++]=1-d)}return u}};function Kre(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;F1e(e,t,s,i,r,o),Kre(e,t,n,i,s-1,1-o),Kre(e,t,n,s+1,r,1-o)}function F1e(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));F1e(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(UU(e,t,i,n),t[2*r+o]>s&&UU(e,t,i,r);a<c;){for(UU(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?UU(e,t,i,c):(c++,UU(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function UU(e,t,n,i){Xre(e,n,i),Xre(t,2*n,2*i),Xre(t,2*n+1,2*i+1)}function Xre(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function L1e(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function Ym(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 B1e(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var DPt=new et;function k1e(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=vA.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Lr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Pa.getScreenSpaceBoundingBox(e,t,r)),B1e(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&z1e(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=vA.getScreenSpaceBoundingBox(s,t,DPt);B1e(a,n),r=et.union(r,a,r)}return r}function RPt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&z1e(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 U1e(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 z1e(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function $re(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 OPt=new et,MPt=new et,NPt=new et;function LPt(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 i0({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Df({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new EI;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 Im(y,A),x=[];e._clusterLabels&&$re(i,x,n,b,e),e._clusterBillboards&&$re(r,x,n,b,e),e._clusterPoints&&$re(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,P;if(x.length>0){let M=new zU(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=Lr._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(U1e(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=k1e(V,F.coord,u,e,OPt);let B=et.clone(S,MPt);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=k1e(k,L.coord,u,e,NPt);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(U1e(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 RPt(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}}Ym.prototype._initialize=function(e){this._scene=e;let t=LPt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Ym.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 Zre(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 Qre(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Ym.prototype.getLabel=Zre("_labelCollection",i0,"_unusedLabelIndices","labelIndex");Ym.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,Qre(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};Ym.prototype.getBillboard=Zre("_billboardCollection",Df,"_unusedBillboardIndices","billboardIndex");Ym.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,Qre(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};Ym.prototype.getPoint=Zre("_pointCollection",EI,"_unusedPointIndices","pointIndex");Ym.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,Qre(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Jre(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function FPt(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,Jre(e._labelCollection),Jre(e._billboardCollection),Jre(e._pointCollection))}Ym.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,FPt(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)};Ym.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 rd=Ym;var V1e={id:void 0};function VU(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 Sl(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=Jn(),this._show=!0,this._firing=!1,this._refire=!1}Sl.prototype.suspendEvents=function(){this._suspendCount++};Sl.prototype.resumeEvents=function(){this._suspendCount--,VU(this)};Object.defineProperties(Sl.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}}});Sl.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})};Sl.prototype.add=function(e){e instanceof eo||(e=new eo(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(Sl.prototype._onEntityDefinitionChanged,this),VU(this),e};Sl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Sl.prototype.contains=function(e){return this._entities.get(e.id)===e};Sl.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(Sl.prototype._onEntityDefinitionChanged,this),VU(this),!0):!1};Sl.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(Sl.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),VU(this)};Sl.prototype.getById=function(e){return this._entities.get(e)};Sl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(V1e.id=e,t=new eo(V1e),this.add(t)),t};Sl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),VU(this)};var Qa=Sl;function BPt(e,t){this.position=e,this.headingPitchRoll=t}var jU=BPt;function kPt(e,t){this.position=e,this.headingPitchRange=t}var HU=kPt;function e7(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=[]}e7.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};e7.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;H1e.call(this,e,t,function(i){n.playlistIndex=0,i||j1e(n._activeEntries),n.tourEnd.raiseEvent(i)})};e7.prototype.stop=function(){j1e(this._activeEntries)};function j1e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function H1e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=UPt.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 UPt(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++,H1e.call(this,e,t,n)}}var GU=e7;function t7(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}t7.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 ue(this.view.position);t.flyToBoundingSphere(r,i)}};t7.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};t7.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Es.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=t7;function eoe(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}eoe.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};eoe.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var qU=eoe;function G_(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new $o,this._referenceFrame=t??Gi.FIXED,this.setValue(e)}Object.defineProperties(G_.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 zPt=new K;G_.prototype.getValue=function(e,t){return l(e)||(e=K.now(zPt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};G_.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};G_.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,G_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};G_.prototype.equals=function(e){return this===e||e instanceof G_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};G_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var W_=G_;function G1e(e,t,n){let i=new WeakRef(t),r=e.addEventListener(function(){let o=i.deref();l(o)?n.apply(o,arguments):r()});return r}function GE(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}e._removeTargetListener=G1e(n.definitionChanged,e,Ah.prototype._onTargetEntityDefinitionChanged),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 Ah(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,this._removeTargetListener=void 0,G1e(e.collectionChanged,this,Ah.prototype._onCollectionChanged)}Object.defineProperties(Ah.prototype,{isConstant:{get:function(){return X.isConstant(GE(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=GE(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 GE(this)}}});Ah.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 Ah(e,n,i)};var VPt=new K;Ah.prototype.getValue=function(e,t){let n=GE(this);return l(e)||(e=K.now(VPt)),l(n)?n.getValue(e,t):void 0};Ah.prototype.getValueInReferenceFrame=function(e,t,n){let i=GE(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Ah.prototype.getType=function(e){let t=GE(this);return l(t)?t.getType(e):void 0};Ah.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};Ah.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Ah.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=GE(this),l(i)&&this._definitionChanged.raiseEvent(this))};var q_=Ah;var W1e={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(W1e);var du=W1e;var toe=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}},sb=toe;var q1e={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 Y1e(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 X1e(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var noe=[],ioe=[];function n7(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=X1e(i[o],e),c=wr(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=X1e(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(noe[p++]=f,o=o+1,s=0;s<r;s++)ioe[g++]=i[o],o=o+1;a=f}p>0&&(ioe.length=g,Y1e(n,u,ioe),noe.length=p,Y1e(t,c,noe))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function bh(e,t){let n=e;n===Number&&(n=q1e);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=q1e);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=sb,this._lastInterpolationAlgorithm=sb,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=du.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=du.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(bh.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 jPt=new K;bh.prototype.getValue=function(e,t){l(e)||(e=K.now(jPt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=wr(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===du.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===du.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===du.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===du.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===du.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===du.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)};bh.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))};bh.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)}n7(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};bh.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)}n7(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};bh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};bh.prototype.addSamplesPackedArray=function(e,t){n7(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};bh.prototype.removeSample=function(e){let t=wr(this._times,e,K.compare);return t<0?!1:(K1e(this,t,1),!0)};function K1e(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)}bh.prototype.removeSamples=function(e){let t=this._times,n=wr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=wr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,K1e(this,n,i-n)};bh.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};bh._mergeNewSamples=n7;var od=bh;function xh(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 od(h,n),this._definitionChanged=new be,this._referenceFrame=e??Gi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(xh.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 HPt=new K;xh.prototype.getValue=function(e,t){return l(e)||(e=K.now(HPt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};xh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Hm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};xh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};xh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};xh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};xh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};xh.prototype.removeSample=function(e){return this._property.removeSample(e)};xh.prototype.removeSamples=function(e){this._property.removeSamples(e)};xh.prototype.equals=function(e){return this===e||e instanceof xh&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ac=xh;function ab(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(ab.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:Gi.FIXED}}});var GPt=new K;ab.prototype.getValue=function(e,t){return l(e)||(e=K.now(GPt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};ab.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))};ab.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};ab.prototype.equals=function(e){return this===e||e instanceof ab&&this._value===e._value};ab.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var L0=ab;function WE(){this._definitionChanged=new be,this._intervals=new Rs,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 WPt=new K;WE.prototype.getValue=function(e,t){l(e)||(e=K.now(WPt));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 Y_=WE;var sRe={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=ng(t),sRe[t]}},hoe;typeof DOMParser<"u"&&(hoe=new DOMParser);var qPt=new oRe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),cb=32,$1e=2414016,J1e=1,Z1e=16093e3,Q1e=.1,eRe=[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"],tRe=["http://www.google.com/kml/ext/2.2"],YPt=["http://www.w3.org/2005/Atom"],Ve={kml:eRe,gx:tRe,atom:YPt,kmlgx:eRe.concat(tRe)},moe={Document:gRe,Folder:dDt,Placemark:hDt,NetworkLink:TDt,GroundOverlay:ADt,PhotoOverlay:ARe,ScreenOverlay:yDt,Tour:pDt},coe=class{constructor(t){this._dataSource=t,this._deferred=Pu(),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=X_._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=X_._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=moe[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||X_._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function XPt(e){let t=e.slice(0,Math.min(4,e.size)),n=Pu(),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 KPt(e){let t=Pu(),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 aRe(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 cRe(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 $Pt(e,t){let n=await e.getData(new Z3);n=aRe(n),n=cRe(n),t.kml=hoe.parseFromString(n,"application/xml")}async function roe(e,t){let n=sRe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new $3(n));t[e.filename]=i}function sd(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 ad(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=poe(a,i);l(c)&&s.setAttribute(n,c.url)}}function lRe(e,t,n){let i=Da(e,"id");i=l(i)&&i.length!==0?i:Jn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Jn(),l(n)&&(i=n+i)),r=t.add(new eo({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new doe),r}function XU(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function s7(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 i7(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++]=s7(n[s],t);return r}function lb(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 nRe(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 Xm(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 Km(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 poe(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 lf={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function loe(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?(lf.maximumRed=o,lf.red=void 0):(lf.maximumRed=void 0,lf.red=0),r>0?(lf.maximumGreen=r,lf.green=void 0):(lf.maximumGreen=void 0,lf.green=0),i>0?(lf.maximumBlue=i,lf.blue=void 0):(lf.maximumBlue=void 0,lf.blue=0),lf.alpha=n,z.fromRandom(lf)):new z(o,r,i,n)}function qE(e,t,n){let i=Fn(e,t,n);if(l(i))return loe(i,Fn(e,"colorMode",n)==="random")}function JPt(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 Rs;return r.addInterval(new Cn({start:i,stop:nt.MAXIMUM_VALUE})),r}function ZPt(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 Rs,n.addInterval(new Cn({start:r,stop:s}))}else l(r)?(n=new Rs,n.addInterval(new Cn({start:r,stop:nt.MAXIMUM_VALUE}))):l(s)&&(n=new Rs,n.addInterval(new Cn({start:nt.MINIMUM_VALUE,stop:s})));return n}function uRe(){let e=new Tl;return e.width=cb,e.height=cb,e.scaleByDistance=new qt($1e,J1e,Z1e,Q1e),e.pixelOffsetScaleByDistance=new qt($1e,J1e,Z1e,Q1e),e}function goe(){let e=new Wm;return e.outline=!0,e.outlineColor=z.WHITE,e}function fRe(){let e=new Gm;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=ji.LEFT,e.font="16px sans-serif",e.style=yo.FILL_AND_OUTLINE,e}function _oe(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=poe(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(Cf(o7(d))),l(p)&&s.setQueryParameters(Cf(o7(p)));let g=t._ellipsoid;return Aoe(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function QPt(e,t,n,i,r){let o=Si(t,"scale",Ve.kml),s=Si(t,"heading",Ve.kml),a=qE(t,"color",Ve.kml),c=ar(t,"Icon",Ve.kml),u=_oe(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=lb(m,"x"),A=lb(m,"y"),b=Da(m,"xunits"),x=Da(m,"yunits"),T=n.billboard;l(T)||(T=uRe(),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-cb)*o:b==="fraction"&&(E=-y*cb*o),E+=cb*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+cb)*o:x==="fraction"&&(v=A*cb*o),v-=cb*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function r7(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")QPt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=fRe(),n.label=c),c.scale=Si(a,"scale",Ve.kml)??c.scale,c.fillColor=qE(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Cl,n.polyline=c),c.width=Si(a,"width",Ve.kml),c.material=qE(a,"color",Ve.kml),l(qE(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(Km(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=goe(),n.polygon=c),c.material=qE(a,"color",Ve.kml)??c.material,c.fill=Km(a,"fill",Ve.kml)??c.fill,c.outline=Km(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=loe(Fn(a,"bgColor",Ve.kml))??z.WHITE,u=loe(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 eDt(e,t,n,i,r){let o=new eo,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")r7(e,d,o,i,r);else{let p=Xm(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);r7(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 tDt(e,t,n){return t.fetchXML().then(function(i){return dRe(e,i,n,t,!0)})}function dRe(e,t,n,i,r,o){let s,a,c,u,f=nRe(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 eo({id:a}),n.add(c),r7(e,u,c,i,o)))}let d=nRe(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=Xm(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),r7(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(tDt(e,x,n))}}}return p}function yoe(e,t,n){let i=new q_(e,t.id,["position"]),r=new L0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Cl,t.polyline.positions=new W_([i,r])}function hRe(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 nDt(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 L0(e))}function iDt(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 a7(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():fRe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():uRe(),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 mRe(e,t){let n=e.path;l(n)||(n=new j_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function rDt(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=Km(n,"extrude",Ve.kml),u=e._ellipsoid,f=s7(o,u);return i.position=f,a7(e,i,r,hRe(s,a)),c&&XU(s,a)&&yoe(t,i,r),!0}function iRe(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=Km(n,"extrude",Ve.kml),u=Km(n,"tessellate",Ve.kml),f=XU(s,a),d=Si(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=i7(o,p),m=r.polyline;if(f&&c){let y=new H_;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 Cl;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 Cl,i.polyline=m,m.positions=iDt(g,s,a,p),(!u||f)&&(m.arcType=un.NONE);return!0}function oDt(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=i7(a,c),f=Km(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():goe(),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 Mc(u),b=Xm(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=Xm(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=ar(s[T],"coordinates",Ve.kml),u=i7(a,c),l(u)&&A.holes.push(new Mc(u))}m.hierarchy=A}return!0}function sDt(e,t,n,i,r){let o=Fn(n,"altitudeMode",Ve.kml),s=Fn(n,"altitudeMode",Ve.gx),a=Xm(n,"coord",Ve.gx),c=Xm(n,"angles",Ve.gx),u=Xm(n,"when",Ve.kml),f=Km(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=s7(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new Ac;return A.addSamples(y,m),i.position=A,a7(e,i,r,hRe(o,s)),mRe(i,r),i.availability=new Rs,u.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),d&&f&&yoe(t,i,r),!0}function rRe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new Ac;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:nDt(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 aDt(e,t,n,i,r){let o=Km(n,"interpolate",Ve.gx),s=Xm(n,"Track",Ve.gx),a,c,u,f=!1,d=new Y_,p=new Rs,g=new yc,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=Xm(b,"when",Ve.kml),T=Xm(b,"coord",Ve.gx),E=Fn(b,"altitudeMode",Ve.kml),v=Fn(b,"altitudeMode",Ve.gx),S=XU(E,v),I=Km(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=s7(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&rRe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),rRe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,a7(e,i,r),mRe(i,r),f&&(yoe(t,i,r),i.polyline.show=d),!0}var pRe={Point:rDt,LineString:iRe,LinearRing:iRe,Polygon:oDt,Track:sDt,MultiTrack:aDt,MultiGeometry:cDt,Model:lDt};function cDt(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=pRe[f.localName];if(l(d)){let p=lRe(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 lDt(e,t,n,i,r){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function uDt(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=Xm(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 fDt(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=qPt.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&&(sd(jr,"a","href",i),sd(jr,"link","href",i),sd(jr,"area","href",i),sd(jr,"img","src",i),sd(jr,"iframe","src",i),sd(jr,"video","src",i),sd(jr,"audio","src",i),sd(jr,"source","src",i),sd(jr,"track","src",i),sd(jr,"input","src",i),sd(jr,"embed","src",i),sd(jr,"script","src",i),sd(jr,"video","poster",i)),ad(jr,"a","href",r),ad(jr,"link","href",r),ad(jr,"area","href",r),ad(jr,"img","src",r),ad(jr,"iframe","src",r),ad(jr,"video","src",r),ad(jr,"audio","src",r),ad(jr,"source","src",r),ad(jr,"track","src",r),ad(jr,"input","src",r),ad(jr,"embed","src",r),ad(jr,"script","src",r),ad(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 c7(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=lRe(t,i,n.context),c=a.kml,u=eDt(e,t,n.styleCollection,o,s),f=Fn(t,"name",Ve.kml);a.name=f,a.parent=r;let d=ZPt(t);l(d)||(d=JPt(t)),a.availability=d,boe(a);function p(T){return T?T.show&&p(T.parent):!0}let g=Km(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),uDt(t,a),fDt(t,a,u,s,o);let x=e._ellipsoid;return yRe(t,a,x),_Re(t,a,x),l(ar(t,"Region",Ve.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function gRe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function dDt(e,t,n,i){let r=c7(e,t,n),o=Je(n);o.parentEntity=r.entity,gRe(e,t,o,i)}function hDt(e,t,n,i){let r=c7(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=pRe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),a7(e,o,s))}var mDt={FlyTo:_Dt,Wait:gDt,SoundCue:ooe,AnimatedUpdate:ooe,TourControl:ooe};function pDt(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=mDt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function ooe(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function gDt(e,t){let n=Si(t,"duration",Ve.gx);e.addPlaylistEntry(new qU(n))}function _Dt(e,t,n){let i=Si(t,"duration",Ve.gx),r=Fn(t,"flyToMode",Ve.gx),o={kml:{}};yRe(t,o,n),_Re(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new WU(i,r,s);e.addPlaylistEntry(a)}function _Re(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=Ic.fromDegrees(a,c-90,u);t.kml.camera=new jU(f,d)}}function yRe(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 Nd(a,c-D.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new HU(d,f)}}function yDt(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=_oe(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=lb(g,"x"),y=lb(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=lb(p,"x"),y=lb(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=lb(d,"x"),y=lb(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 ADt(e,t,n,i){let o=c7(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=i7(ar(t,"LatLonQuad",Ve.gx),c),f=Si(t,"drawOrder",Ve.kml);if(l(u))s=goe(),s.hierarchy=new Mc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new qm,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=_oe(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=qE(t,"color",Ve.kml),s.material.transparent=!0}else s.material=qE(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 ARe(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 ub={INTERVAL:0,EXPIRE:1,STOP:2};function o7(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var bDt=new ie,CI=new he,soe=new U,xDt=new h;function Aoe(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=ox(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??bDt,l(n)&&(soe.x=n.clientWidth*.5,soe.y=n.clientHeight*.5,u=t.pickEllipsoid(soe,o,xDt)),l(u)?f=o.cartesianToCartographic(u,CI):(f=ie.center(r,CI),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,CI),c=c.replace("[cameraLon]",D.toDegrees(CI.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(CI.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(CI.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(Cf(c))}function TDt(e,t,n,i){let o=c7(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=poe(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(Cf(o7(b))),l(x)&&u.setQueryParameters(Cf(o7(x)));let T=e._ellipsoid;Aoe(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Qa,y=foe(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,boe(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:Jn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Cf(Fn(v,"cookie",Ve.kml)??""),O=Si(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=ub.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=ub.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=ub.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 EDt(e,t,n,i){let r=moe[t.localName];return l(r)?r(e,t,n,i):ARe(e,t,n,i)}function uoe(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=S_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new X_._DeferredLoading(e),d=new Qa(e);return Promise.all(dRe(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(moe[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(),EDt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function CDt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");L3({workerURI:o,wasmURI:s});let a=new wE(new af(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(roe(d,f)),d=g):u.push(roe(g,f)))}if(l(d)&&u.push($Pt(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),uoe(e,t,f.kml,i,f,r)}function foe(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?XPt(u).then(function(f){return f?CDt(e,t,u,r,a):KPt(u).then(function(d){d=aRe(d),d=cRe(d);let p,g;try{p=hoe.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 uoe(e,t,p,r,o,a,s)})}):uoe(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var X_=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 Qa(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new w_,this._networkLinks=new Ut,this._entityCluster=new rd,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,Ls.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return foe(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=Ps.LOOP_STOP,o.clockStep=Vr.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),Ls.setLoading(r,!1),r}).catch(function(o){return Ls.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;aoe.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];aoe.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(!aoe.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===ub.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===ub.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===ub.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 Qa,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;Aoe(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),foe(r,m,y,{context:p.id}).then(vDt(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 boe(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 vDt(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=Cf(Fn(a,"cookie",Ve.kml)??""),u=Si(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===ub.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===ub.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,boe(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 aoe=new Ut,doe=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}};X_._DeferredLoading=coe;X_._getTimestamp=xn;var YE=X_;var TRe=Qo(xRe(),1);function vI(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(vI.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var SDt=new K;vI.prototype.getValue=function(e,t){return l(e)||(e=K.now(SDt)),this._callback(e,t)};vI.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};vI.prototype.equals=function(e){return this===e||e instanceof vI&&this._callback===e._callback&&this._isConstant===e._isConstant};var $m=vI;function u7(e){return h.fromDegrees(e[0],e[1],e[2])}var xoe={"urn:ogc:def:crs:OGC:1.3:CRS84":u7,"EPSG:4326":u7,"urn:ogc:def:crs:EPSG::4326":u7},ERe={},CRe={},Toe=48,Eoe,Coe=z.ROYALBLUE,voe=z.YELLOW,Soe=2,woe=z.fromBytes(255,255,0,100),Ioe=!1,wDt={small:24,medium:48,large:64},IDt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function vRe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||IDt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${vRe(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 PDt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function DDt(e,t){return new $m(PDt(vRe,e,t),!0)}function f7(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Jn();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 di(c):n(o,s))}return r}function Poe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var SRe={Feature:IRe,FeatureCollection:RDt,GeometryCollection:PRe,LineString:NRe,MultiLineString:LRe,MultiPoint:ORe,MultiPolygon:kRe,Point:RRe,Polygon:BRe,Topology:URe},wRe={GeometryCollection:PRe,LineString:NRe,MultiLineString:LRe,MultiPoint:ORe,MultiPolygon:kRe,Point:RRe,Polygon:BRe,Topology:URe};function IRe(e,t,n,i,r){if(t.geometry===null){f7(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=wRe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function RDt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)IRe(e,o[s],void 0,i,r)}function PRe(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=wRe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function DRe(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=wDt[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 Tl;f.verticalOrigin=new di(Hn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=f7(t,e._entityCollection,r.describe);d.billboard=f,d.position=new uu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new di(g)}).catch(function(){f.image=new di(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function RRe(e,t,n,i,r){DRe(e,t,i,n.coordinates,r)}function ORe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)DRe(e,t,i,o[s],r)}function MRe(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 di(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=f7(t,e._entityCollection,r.describe),u=new Cl;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new di(Poe(i,n)),u.arcType=un.RHUMB}function NRe(e,t,n,i,r){MRe(e,t,i,n.coordinates,r)}function LRe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)MRe(e,t,i,o[s],r)}function FRe(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 di(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 di(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 Wm;u.outline=new di(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=un.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Mc(Poe(i[g],n)));let d=i[0];u.hierarchy=new di(new Mc(Poe(d,n),f)),d[0].length>2?u.perPositionHeight=new di(!0):r.clampToGround||(u.height=0);let p=f7(t,e._entityCollection,r.describe);p.polygon=u}function BRe(e,t,n,i,r){FRe(e,t,i,n.coordinates,r)}function kRe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)FRe(e,t,i,o[s],r)}function URe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=TRe.feature(n,n.objects[o]),a=SRe[s.type];a(e,s,s,i,r)}}function fb(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Qa(this),this._promises=[],this._pinBuilder=new w_,this._entityCluster=new rd,this._credit=void 0,this._resourceCredits=[]}fb.load=function(e,t){return new fb().load(e,t)};Object.defineProperties(fb,{markerSize:{get:function(){return Toe},set:function(e){Toe=e}},markerSymbol:{get:function(){return Eoe},set:function(e){Eoe=e}},markerColor:{get:function(){return Coe},set:function(e){Coe=e}},stroke:{get:function(){return voe},set:function(e){voe=e}},strokeWidth:{get:function(){return Soe},set:function(e){Soe=e}},fill:{get:function(){return woe},set:function(e){woe=e}},clampToGround:{get:function(){return Ioe},set:function(e){Ioe=e}},crsNames:{get:function(){return xoe}},crsLinkHrefs:{get:function(){return ERe}},crsLinkTypes:{get:function(){return CRe}}});Object.defineProperties(fb.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}}});fb.prototype.load=function(e,t){return zRe(this,e,t,!0)};fb.prototype.process=function(e,t){return zRe(this,e,t,!1)};function zRe(e,t,n,i){Ls.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??DDt,markerSize:n.markerSize??Toe,markerSymbol:n.markerSymbol??Eoe,markerColor:n.markerColor??Coe,strokeWidthProperty:new di(n.strokeWidth??Soe),strokeMaterialProperty:new Kt(n.stroke??voe),fillMaterialProperty:new Kt(n.fill??woe),clampToGround:n.clampToGround??Ioe},Promise.resolve(o).then(function(a){return ODt(e,a,n,s,i)}).catch(function(a){throw Ls.setLoading(e,!1),e._error.raiseEvent(e,a),a})}fb.prototype.update=function(e){return!0};function ODt(e,t,n,i,r){let o;l(i)&&(o=S_(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=SRe[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?u7: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=xoe[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=ERe[u.href];if(l(f)||(f=CRe[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=xoe[`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,Ls.setLoading(e,!1),e})})}var db=fb;var KU={};KU.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await la.getExports(e,t);if(i.length>0&&i.every(c=>c.status===la.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===la.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 Yo.fromUrl(a,n)};KU.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await la.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![la.RealityDataType.Cesium3DTiles,la.RealityDataType.PNTS,la.RealityDataType.RealityMesh3DTiles,la.RealityDataType.Terrain3DTiles,la.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await la.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Yo.fromUrl(s,a)};KU.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await la.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![la.RealityDataType.KML,la.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await la.getRealityDataURL(e,t,i);return n===la.RealityDataType.GeoJSON?db.load(o):YE.load(o)};KU.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${la.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return db.load(o)};var Doe=KU;function d7(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(d7.prototype,{total:{get:function(){return this._total}}});function hb(e){let t=new Array(Oc.NUMBER_OF_JOB_TYPES);t[Oc.TEXTURE]=new d7(l(e)?e[Oc.TEXTURE]:10),t[Oc.PROGRAM]=new d7(l(e)?e[Oc.PROGRAM]:10),t[Oc.BUFFER]=new d7(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}hb.getTimestamp=xn;Object.defineProperties(hb.prototype,{totalBudget:{get:function(){return this._totalBudget}}});hb.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};hb.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};hb.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=hb.getTimestamp();e.execute();let a=hb.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var $U=hb;var Roe=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function JU(e,t){this.spatialNode=e,this.keyframe=t,this.state=Roe.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}JU.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Roe.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};JU.priorityComparator=function(e,t){return e.priority-t.priority};JU.searchComparator=function(e,t){return e.keyframe-t.keyframe};JU.LoadState=Roe;var Hr=JU;function VRe(){}Object.defineProperties(VRe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var Ooe=VRe;var MDt=/\/$/,jRe=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 SI(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();MDt.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=jRe,this._resource=i,this._imageryProvider=new _s({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(SI.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}}});SI.prototype.getTileCredits=function(e,t,n){};SI.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};SI.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};SI._defaultCredit=jRe;var Moe=SI;function mb(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??Jn(),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,WRe(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");HRe(this,n),this._initialized=!0}else GRe(this);m.bindTexture(this._textureTarget,null)}function HRe(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=Noe(y),A=Noe(A),b=Noe(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}mb.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?(HRe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),GRe(this)),this._initialized=!0),d||NDt(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function NDt(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 Noe(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function GRe(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)}mb.create=function(e){return new mb(e)};Object.defineProperties(mb.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){WRe(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 WRe(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=$n.NEAREST),Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=$n.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)}mb.prototype.generateMipmap=function(e){e=e??vd.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)};mb.prototype.isDestroyed=function(){return!1};mb.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var ZU=mb;function F0(e,t,n,i,r=134217728,o){let s=LDt(i),a=FDt(n),c=n*Lt.getSizeInBytes(i),u=F0.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 ZU({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:$n.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new BDt(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(F0.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:$n.LINEAR}),this._nearestSampling=e)}}});function LDt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function FDt(e){switch(e){case 1:return Ke.RED;case 2:return Ke.RG;case 3:return Ke.RGB;case 4:return Ke.RGBA}}function BDt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}F0.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};F0.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--};F0.prototype.isFull=function(){return this.emptyList===void 0};F0.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=qRe(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}qRe(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 qRe(e){return e.reduce((t,n)=>t*n)}F0.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)};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var QU=F0;var bc={};bc.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}`)};bc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=bc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};bc.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=bc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return bc.decodeRawMetadataValueComponent(e,t,c)};bc.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=bc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return bc.decodeRawMetadataValueElement(e,n,0)};bc.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}`)};bc.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}`)};bc.decodeMetadataValues=function(e,t,n){let i=bc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=bc.convertFromObjectType(e.type,t.offset),s=bc.convertFromObjectType(e.type,t.scale);i=qp.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=bc.convertToObjectType(e.type,c);s[a]=u}return s}return bc.convertToObjectType(e.type,i)};var ez=Object.freeze(bc);function kDt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var tz=kDt;var sOe={},UDt=32.184,zDt=2451545,YRe=-.0529921,XRe=-.1059842,KRe=13.0120009,$Re=13.3407154,JRe=.9856003,ZRe=26.4057084,QRe=13.064993,eOe=.3287146,tOe=1.7484877,nOe=-.1589763,iOe=.0036096,rOe=.1643573,oOe=12.9590088,Loe=new K;sOe.ComputeMoon=function(e,t){l(e)||(e=K.now()),Loe=K.addSeconds(e,UDt,Loe);let n=K.totalDays(Loe)-zDt,i=n/kn.DAYS_PER_JULIAN_CENTURY,r=(125.045+YRe*n)*D.RADIANS_PER_DEGREE,o=(250.089+XRe*n)*D.RADIANS_PER_DEGREE,s=(260.008+KRe*n)*D.RADIANS_PER_DEGREE,a=(176.625+$Re*n)*D.RADIANS_PER_DEGREE,c=(357.529+JRe*n)*D.RADIANS_PER_DEGREE,u=(311.589+ZRe*n)*D.RADIANS_PER_DEGREE,f=(134.963+QRe*n)*D.RADIANS_PER_DEGREE,d=(276.617+eOe*n)*D.RADIANS_PER_DEGREE,p=(34.226+tOe*n)*D.RADIANS_PER_DEGREE,g=(15.134+nOe*n)*D.RADIANS_PER_DEGREE,m=(119.743+iOe*n)*D.RADIANS_PER_DEGREE,y=(239.961+rOe*n)*D.RADIANS_PER_DEGREE,A=(25.053+oOe*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*YRe+.1208*M*XRe-.0642*F*KRe+.0158*V*$Re+.0252*B*JRe-.0066*j*ZRe-.0047*k*QRe-.0046*G*eOe+.0028*q*tOe+.0052*Q*nOe+.004*W*iOe+.0019*J*rOe-.0044*Z*oOe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new tz),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var nz=sOe;function aOe(e){(!l(e)||typeof e!="function")&&(e=nz.ComputeMoon),this._computeFunction=e}var VDt=new h,jDt=new h,HDt=new h;function GDt(e,t,n){let i=VDt;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=HDt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,jDt);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 WDt=new $,qDt=new Le;aOe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=GDt(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,qDt),s=$.fromQuaternion(Le.conjugate(o,o),WDt);return $.multiply(s,i,i)};var iz=aOe;var Foe={};function YDt(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var XDt=32.184,KDt=2451545;function SOe(e,t){t=K.addSeconds(e,XDt,t);let n=K.totalDays(t)-KDt;return t=K.addSeconds(t,YDt(n),t),t}var h7=new K(2451545,0,si.TAI),$Dt=1e3,Th=D.RADIANS_PER_DEGREE,cd=D.RADIANS_PER_ARCSECOND,Hc=14959787e4,cOe=new $;function wOe(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=ZDt(o-i,t),d=JDt(t,0);i1t(c,n,u,cOe);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(cOe,s,s)}function JDt(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function ZDt(e,t){let n=t1t(e,t);return n1t(n,t)}var QDt=50,e1t=D.EPSILON8;function t1t(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<QDt&&Math.abs(r-i)>e1t;++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 n1t(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 i1t(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 r1t=1.0000010178*Hc,o1t=100.46645683*Th,s1t=129597742283429e-5*cd,lOe=16002,uOe=21863,fOe=32004,dOe=10931,hOe=14529,mOe=16368,pOe=15318,gOe=32794,a1t=64*1e-7*Hc,c1t=-152*1e-7*Hc,l1t=62*1e-7*Hc,u1t=-8*1e-7*Hc,f1t=32*1e-7*Hc,d1t=-41*1e-7*Hc,h1t=19*1e-7*Hc,m1t=-11*1e-7*Hc,p1t=-150*1e-7*Hc,g1t=-46*1e-7*Hc,_1t=68*1e-7*Hc,y1t=54*1e-7*Hc,A1t=14*1e-7*Hc,b1t=24*1e-7*Hc,x1t=-28*1e-7*Hc,T1t=22*1e-7*Hc,_Oe=10,yOe=16002,AOe=21863,bOe=10931,xOe=1473,TOe=32004,EOe=4387,COe=73,E1t=-325*1e-7,C1t=-322*1e-7,v1t=-79*1e-7,S1t=232*1e-7,w1t=-52*1e-7,I1t=97*1e-7,P1t=55*1e-7,D1t=-41*1e-7,R1t=-105*1e-7,O1t=-137*1e-7,M1t=258*1e-7,N1t=35*1e-7,L1t=-116*1e-7,F1t=-88*1e-7,B1t=-112*1e-7,k1t=-80*1e-7,wI=new K(0,0,si.TAI);function U1t(e,t){SOe(e,wI);let i=(wI.dayNumber-h7.dayNumber+(wI.secondsOfDay-h7.secondsOfDay)/kn.SECONDS_PER_DAY)/(kn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=r1t+a1t*Math.cos(lOe*r)+p1t*Math.sin(lOe*r)+c1t*Math.cos(uOe*r)+g1t*Math.sin(uOe*r)+l1t*Math.cos(fOe*r)+_1t*Math.sin(fOe*r)+u1t*Math.cos(dOe*r)+y1t*Math.sin(dOe*r)+f1t*Math.cos(hOe*r)+A1t*Math.sin(hOe*r)+d1t*Math.cos(mOe*r)+b1t*Math.sin(mOe*r)+h1t*Math.cos(pOe*r)+x1t*Math.sin(pOe*r)+m1t*Math.cos(gOe*r)+T1t*Math.sin(gOe*r),s=o1t+s1t*i+E1t*Math.cos(_Oe*r)+R1t*Math.sin(_Oe*r)+C1t*Math.cos(yOe*r)+O1t*Math.sin(yOe*r)+v1t*Math.cos(AOe*r)+M1t*Math.sin(AOe*r)+S1t*Math.cos(bOe*r)+N1t*Math.sin(bOe*r)+w1t*Math.cos(xOe*r)+L1t*Math.sin(xOe*r)+I1t*Math.cos(TOe*r)+F1t*Math.sin(TOe*r)+P1t*Math.cos(EOe*r)+B1t*Math.sin(EOe*r)+D1t*Math.cos(COe*r)+k1t*Math.sin(COe*r),a=.0167086342-.0004203654*i,c=102.93734808*Th+11612.3529*cd*i,u=469.97289*cd*i,f=174.87317577*Th-8679.27034*cd*i;return wOe(o,a,u,c,f,s,t)}function IOe(e,t){SOe(e,wI);let i=(wI.dayNumber-h7.dayNumber+(wI.secondsOfDay-h7.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*Th,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Th,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Th,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*Th,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*Th+cd*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*Th+cd*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*Th+cd*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*Th+cd*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*Th-cd*(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*=$Dt;let F=u+f*cd,V=d+p*cd,B=y+A*cd,j=g+m*cd;return wOe(a,c,F,V,j,B,t)}var vOe=.012300034,z1t=vOe/(vOe+1)*-1;function V1t(e,t){return t=IOe(e,t),h.multiplyByScalar(t,z1t,t)}var POe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),rz=new h;Foe.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),rz=U1t(e,rz),t=h.negate(rz,t),V1t(e,rz),h.subtract(t,rz,t),$.multiplyByVector(POe,t,t),t};Foe.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=IOe(e,t),$.multiplyByVector(POe,t,t),t};var pb=Foe;function oz(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 wk({radii:this.ellipsoid.radii,material:rr.fromType(rr.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new iz}Object.defineProperties(oz.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var m7=new $,j1t=new $,H1t=new h,p7=[];oz.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,m7))||At.computeTemeToPseudoFixedMatrix(n,m7);let i=this._axes.evaluate(n,j1t);$.transpose(i,i),$.multiply(m7,i,i);let r=pb.computeMoonPositionInEarthInertialFrame(n,H1t);$.multiplyByVector(m7,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=p7,p7.length=0,t.update(e),e.commandList=o,p7.length===1?p7[0]:void 0};oz.prototype.isDestroyed=function(){return!1};oz.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var sz=oz;var G1t=0,W1t=14,q1t=-1e3,Y1t=1e4,X1t=2*Math.PI*ee.WGS84.maximumRadius,K1t=256,$1t=new ie,J1t=new ie,Boe=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??G1t,this._maxZoom=n.maxZoom??W1t,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=Z1t(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Yo.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,le(this)}};function Z1t(e,t){let n=new Po,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=eRt(n,i,t.minZoom),o={boundingVolume:{region:OOe(i)},geometricError:ROe(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=DOe(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 DOe(e,t,n,i,r,o,s){if(!tRt(e,i,o,s,n,$1t,J1t))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:OOe(a)},geometricError:i<r?ROe(i):0,refine:"REPLACE",content:{uri:Q1t(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=DOe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function Q1t(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return Td(o)}function ROe(e){return X1t/((1<<e)*K1t)}function OOe(e){return[e.west,e.south,e.east,e.north,q1t,Y1t]}function eRt(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 tRt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var az=Boe;var g7=class extends az{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=Vi.Z,t._modelForwardAxis=Vi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=Ak(o),a=MOe(r.getUrlComponent(!0)),c=aM(s,a,{featureIdProperty:t});if(!l(c)){if(!nRt(s))return new o0(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return DA.fromGltf(n,i,r,c)}}}};function MOe(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 nRt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}g7._parseTileCoordinates=MOe;var koe=g7;function Uoe(e){}Uoe.prototype.isReady=function(){return!0};Uoe.prototype.shouldDiscardImage=function(e){return!1};var zoe=Uoe;var II=`#ifdef MRT +`;W0.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 Ff({context:e,width:s,height:a,format:nu.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(RUt),this._rsClassified=Ge.fromCache(OUt),this._rsDefault=Ge.fromCache(MUt)),!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)?LUt:NUt,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(gf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};W0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};W0.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))};W0.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)};W0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};W0.prototype.isDestroyed=function(){return!1};W0.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()),le(this)};var UP=W0;var VV={};VV.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await la.getExports(e,t);if(i.length>0&&i.every(c=>c.status===la.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===la.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 Yo.fromUrl(a,n)};VV.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await la.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![la.RealityDataType.Cesium3DTiles,la.RealityDataType.PNTS,la.RealityDataType.RealityMesh3DTiles,la.RealityDataType.Terrain3DTiles,la.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await la.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Yo.fromUrl(s,a)};VV.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await la.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![la.RealityDataType.KML,la.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await la.getRealityDataURL(e,t,i);return n===la.RealityDataType.GeoJSON?mb.load(o):YE.load(o)};VV.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${la.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return mb.load(o)};var Vae=VV;function CW(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(CW.prototype,{total:{get:function(){return this._total}}});function Bb(e){let t=new Array(Oc.NUMBER_OF_JOB_TYPES);t[Oc.TEXTURE]=new CW(l(e)?e[Oc.TEXTURE]:10),t[Oc.PROGRAM]=new CW(l(e)?e[Oc.PROGRAM]:10),t[Oc.BUFFER]=new CW(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}Bb.getTimestamp=xn;Object.defineProperties(Bb.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Bb.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Bb.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};Bb.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=Bb.getTimestamp();e.execute();let a=Bb.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var jV=Bb;var jae=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function HV(e,t){this.spatialNode=e,this.keyframe=t,this.state=jae.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}HV.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=jae.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};HV.priorityComparator=function(e,t){return e.priority-t.priority};HV.searchComparator=function(e,t){return e.keyframe-t.keyframe};HV.LoadState=jae;var Hr=HV;function EBe(){}Object.defineProperties(EBe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var Hae=EBe;var FUt=/\/$/,CBe=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 zP(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();FUt.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=CBe,this._resource=i,this._imageryProvider=new vs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(zP.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}}});zP.prototype.getTileCredits=function(e,t,n){};zP.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};zP.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};zP._defaultCredit=CBe;var Gae=zP;function q0(e,t,n,i,r=134217728,o){let s=BUt(i),a=kUt(n),c=n*Lt.getSizeInBytes(i),u=q0.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 CU({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:Zn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new UUt(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(q0.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:Zn.LINEAR}),this._nearestSampling=e)}}});function BUt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function kUt(e){switch(e){case 1:return Ke.RED;case 2:return Ke.RG;case 3:return Ke.RGB;case 4:return Ke.RGBA}}function UUt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}q0.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};q0.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--};q0.prototype.isFull=function(){return this.emptyList===void 0};q0.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=vBe(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}vBe(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 vBe(e){return e.reduce((t,n)=>t*n)}q0.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)};q0.prototype.isDestroyed=function(){return!1};q0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var GV=q0;var Ec={};Ec.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}`)};Ec.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=Ec.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};Ec.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=Ec.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return Ec.decodeRawMetadataValueComponent(e,t,c)};Ec.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=Ec.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return Ec.decodeRawMetadataValueElement(e,n,0)};Ec.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}`)};Ec.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}`)};Ec.decodeMetadataValues=function(e,t,n){let i=Ec.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=Ec.convertFromObjectType(e.type,t.offset),s=Ec.convertFromObjectType(e.type,t.scale);i=Vp.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=Ec.convertToObjectType(e.type,c);s[a]=u}return s}return Ec.convertToObjectType(e.type,i)};var WV=Object.freeze(Ec);function qV(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 sV({radii:this.ellipsoid.radii,material:Qi.fromType(Qi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new GU}Object.defineProperties(qV.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var vW=new $,zUt=new $,VUt=new h,SW=[];qV.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,vW))||At.computeTemeToPseudoFixedMatrix(n,vW);let i=this._axes.evaluate(n,zUt);$.transpose(i,i),$.multiply(vW,i,i);let r=xb.computeMoonPositionInEarthInertialFrame(n,VUt);$.multiplyByVector(vW,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=SW,SW.length=0,t.update(e),e.commandList=o,SW.length===1?SW[0]:void 0};qV.prototype.isDestroyed=function(){return!1};qV.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var YV=qV;var jUt=0,HUt=14,GUt=-1e3,WUt=1e4,qUt=2*Math.PI*ee.WGS84.maximumRadius,YUt=256,XUt=new ie,KUt=new ie,Wae=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??jUt,this._maxZoom=n.maxZoom??HUt,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=$Ut(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Yo.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,le(this)}};function $Ut(e,t){let n=new Lo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=ZUt(n,i,t.minZoom),o={boundingVolume:{region:IBe(i)},geometricError:wBe(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=SBe(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 SBe(e,t,n,i,r,o,s){if(!QUt(e,i,o,s,n,XUt,KUt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:IBe(a)},geometricError:i<r?wBe(i):0,refine:"REPLACE",content:{uri:JUt(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=SBe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function JUt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return Td(o)}function wBe(e){return qUt/((1<<e)*YUt)}function IBe(e){return[e.west,e.south,e.east,e.north,GUt,WUt]}function ZUt(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 QUt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var XV=Wae;var wW=class extends XV{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=Zz(o),a=PBe(r.getUrlComponent(!0)),c=iz(s,a,{featureIdProperty:t});if(!l(c)){if(!ezt(s))return new n0(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return MA.fromGltf(n,i,r,c)}}}};function PBe(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 ezt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}wW._parseTileCoordinates=PBe;var qae=wW;function Yae(e){}Yae.prototype.isReady=function(){return!0};Yae.prototype.shouldDiscardImage=function(e){return!1};var Xae=Yae;var VP=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -10978,7 +10987,7 @@ return; } discard; } -`;var cz=`uniform sampler2D u_opaque; +`;var KV=`uniform sampler2D u_opaque; uniform sampler2D u_accumulation; uniform sampler2D u_revealage; in vec2 v_textureCoordinates; @@ -10998,18 +11007,18 @@ if (opaque != czm_backgroundColor) out_FragColor.a = 1.0; } } -`;function K_(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 NOe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Voe(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function LOe(e){NOe(e),Voe(e)}function iRt(e,t,n,i){NOe(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 rRt(e,t){Voe(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)&&(Voe(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)&&(LOe(e),e._translucentMultipassSupport=!1,i=!1)}return i}K_.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,iRt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!rRt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ye({sources:[cz]}),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:[II]}),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:[II]}),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 oRt={enabled:!0,color:new z(0,0,0,0),equationRgb:wc.ADD,equationAlpha:wc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA},sRt={enabled:!0,color:new z(0,0,0,0),equationRgb:wc.ADD,equationAlpha:wc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationAlpha:$r.ONE},aRt={enabled:!0,color:new z(0,0,0,0),equationRgb:wc.ADD,equationAlpha:wc.ADD,functionSourceRgb:$r.ZERO,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA};function joe(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 cRt(e,t,n){return joe(t,oRt,e._translucentRenderStateCache,n)}function lRt(e,t,n){return joe(t,sRt,e._translucentRenderStateCache,n)}function uRt(e,t,n){return joe(t,aRt,e._alphaRenderStateCache,n)}var fRt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function dy(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 ui({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({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 DBe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Kae(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function RBe(e){DBe(e),Kae(e)}function tzt(e,t,n,i){DBe(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 nzt(e,t){Kae(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)&&(Kae(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)&&(RBe(e),e._translucentMultipassSupport=!1,i=!1)}return i}dy.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,tzt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!nzt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ye({sources:[KV]}),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:[VP]}),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:[VP]}),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 izt={enabled:!0,color:new z(0,0,0,0),equationRgb:Pc.ADD,equationAlpha:Pc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA},rzt={enabled:!0,color:new z(0,0,0,0),equationRgb:Pc.ADD,equationAlpha:Pc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationAlpha:$r.ONE},ozt={enabled:!0,color:new z(0,0,0,0),equationRgb:Pc.ADD,equationAlpha:Pc.ADD,functionSourceRgb:$r.ZERO,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA};function $ae(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 szt(e,t,n){return $ae(t,izt,e._translucentRenderStateCache,n)}function azt(e,t,n){return $ae(t,rzt,e._translucentRenderStateCache,n)}function czt(e,t,n){return $ae(t,ozt,e._alphaRenderStateCache,n)}var lzt=` 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); -`,dRt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,uzt=` 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; -`,hRt=` float ai = czm_out_FragColor.a; +`,fzt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function Hoe(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 +`;function Jae(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]}; @@ -11021,7 +11030,7 @@ ${u}`}return a.sources.push(u),a.sources.push(`void main() discard; } ${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function mRt(e,t){return Hoe(e,t,"translucentMRT",fRt)}function pRt(e,t){return Hoe(e,t,"translucentMultipass",dRt)}function gRt(e,t){return Hoe(e,t,"alphaMultipass",hRt)}K_.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=mRt(t,e.shaderProgram),n.translucentCommand.renderState=cRt(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=pRt(t,e.shaderProgram),n.translucentCommand.renderState=lRt(this,t,e.renderState),n.alphaCommand.shaderProgram=gRt(t,e.shaderProgram),n.alphaCommand.renderState=uRt(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 _Rt(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 yRt(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}K_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){yRt(this,e,t,n,i,r);return}_Rt(this,e,t,n,i,r)};K_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};K_.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};K_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};K_.prototype.isDestroyed=function(){return!1};K_.prototype.destroy=function(){return LOe(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()),le(this)};var lz=K_;var ARt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function _7(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 Po({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??ARt;typeof d=="string"&&(d=new It(d)),_s.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(_7.prototype=Object.create(_s.prototype),_7.prototype.constructor=_7);var $_=_7;function xc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Jn(),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(xc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});xc.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};xc.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};xc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};xc.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=[]};xc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function y7(e,t){return e._primitives.indexOf(t)}xc.prototype.raise=function(e){if(l(e)){let t=y7(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};xc.prototype.raiseToTop=function(e){if(l(e)){let t=y7(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};xc.prototype.lower=function(e){if(l(e)){let t=y7(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};xc.prototype.lowerToBottom=function(e){if(l(e)){let t=y7(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};xc.prototype.get=function(e){return this._primitives[e]};xc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};xc.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)}};xc.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)}};xc.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)}};xc.prototype.isDestroyed=function(){return!1};xc.prototype.destroy=function(){return this.removeAll(),le(this)};var wl=xc;function B0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(B0.prototype,{length:{get:function(){return this._length}}});B0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new wl({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};B0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};B0.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};B0.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};B0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};B0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};B0.prototype.isDestroyed=function(){return!1};B0.prototype.destroy=function(){return this.removeAll(),le(this)};var uz=B0;function FOe(){pe.throwInstantiationError()}Object.defineProperties(FOe.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var Goe=FOe;function A7(){pe.throwInstantiationError()}Object.defineProperties(A7.prototype,{});A7.fromUrl=function(e){pe.throwInstantiationError()};A7.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var Woe=A7;var bRt=new U(1,1);function qoe(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??bRt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(qoe.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var BOe=new h;qoe.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,BOe),h.add(this.position,BOe,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 PI=qoe;function kOe(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(kOe.prototype,{complete:{get:function(){return this._complete}}});var Yoe=kOe;function UOe(e){}UOe.prototype.emit=function(e){pe.throwInstantiationError()};var Xoe=UOe;var zOe=new U(1,1);function fz(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 Y2(.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??zOe),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??zOe),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(fz.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 xRt(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 PI;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function TRt(e){let t=e._particlePool.pop();return l(t)||(t=new PI),t}function ERt(e,t){e._particlePool.push(t)}function CRt(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 vRt(e){l(e._billboard)&&(e._billboard.show=!1)}function VOe(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 SRt(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 wRt(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 b7=new h;fz.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Df),this._updateParticlePool&&(xRt(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)?VOe(this,s):(vRt(s),ERt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=wRt(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=TRt(this),this._emitter.emit(s),h.add(s.position,s.velocity,b7),N.multiplyByPoint(u,b7,b7),s.position=N.multiplyByPoint(u,s.position,s.position),h.subtract(b7,s.position,s.velocity),h.normalize(s.velocity,s.velocity),SRt(this,s),VOe(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&&CRt(this)};fz.prototype.isDestroyed=function(){return!1};fz.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var Koe=fz;function x7(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(x7.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});x7.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}};x7.prototype.destroy=function(){return le(this)};var J_=x7;function XE(){this._framebuffer=new ai,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(XE.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function IRt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function PRt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function dzt(e,t){return Jae(e,t,"translucentMRT",lzt)}function hzt(e,t){return Jae(e,t,"translucentMultipass",uzt)}function mzt(e,t){return Jae(e,t,"alphaMultipass",fzt)}dy.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=dzt(t,e.shaderProgram),n.translucentCommand.renderState=szt(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=hzt(t,e.shaderProgram),n.translucentCommand.renderState=azt(this,t,e.renderState),n.alphaCommand.shaderProgram=mzt(t,e.shaderProgram),n.alphaCommand.renderState=czt(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 pzt(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 gzt(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}dy.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){gzt(this,e,t,n,i,r);return}pzt(this,e,t,n,i,r)};dy.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};dy.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};dy.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){return RBe(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()),le(this)};var $V=dy;var _zt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function IW(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 Lo({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??_zt;typeof d=="string"&&(d=new It(d)),vs.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(IW.prototype=Object.create(vs.prototype),IW.prototype.constructor=IW);var hy=IW;function OBe(){pe.throwInstantiationError()}Object.defineProperties(OBe.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var Zae=OBe;function PW(){pe.throwInstantiationError()}Object.defineProperties(PW.prototype,{});PW.fromUrl=function(e){pe.throwInstantiationError()};PW.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var Qae=PW;var yzt=new U(1,1);function ece(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??yzt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(ece.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var MBe=new h;ece.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,MBe),h.add(this.position,MBe,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 jP=ece;function NBe(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(NBe.prototype,{complete:{get:function(){return this._complete}}});var tce=NBe;function LBe(e){}LBe.prototype.emit=function(e){pe.throwInstantiationError()};var nce=LBe;var FBe=new U(1,1);function JV(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 Nz(.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??FBe),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??FBe),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(JV.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 Azt(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 jP;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function bzt(e){let t=e._particlePool.pop();return l(t)||(t=new jP),t}function xzt(e,t){e._particlePool.push(t)}function Tzt(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 Ezt(e){l(e._billboard)&&(e._billboard.show=!1)}function BBe(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 Czt(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 vzt(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 DW=new h;JV.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Gf),this._updateParticlePool&&(Azt(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)?BBe(this,s):(Ezt(s),xzt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=vzt(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=bzt(this),this._emitter.emit(s),h.add(s.position,s.velocity,DW),N.multiplyByPoint(u,DW,DW),s.position=N.multiplyByPoint(u,s.position,s.position),h.subtract(DW,s.position,s.velocity),h.normalize(s.velocity,s.velocity),Czt(this,s),BBe(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&&Tzt(this)};JV.prototype.isDestroyed=function(){return!1};JV.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var ice=JV;function RW(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(RW.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});RW.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}};RW.prototype.destroy=function(){return le(this)};var my=RW;function OC(){this._framebuffer=new ai,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(OC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Szt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function wzt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -11033,12 +11042,12 @@ void main() 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}XE.prototype.update=function(e,t){IRt(this,e,t),PRt(this,e,t)};var DRt=new se,RRt=new se(1,1/255,1/65025,1/16581375);XE.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,DRt);return se.divideByScalar(r,255,r),se.dot(r,RRt)};XE.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};XE.prototype.isDestroyed=function(){return!1};XE.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var dz=XE;function ORt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Tc=ORt;function hz(){this._framebuffer=new ai({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(hz.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function MRt(e){e._framebuffer.destroy()}function NRt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new Tc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}hz.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&NRt(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};hz.prototype.isDestroyed=function(){return!1};hz.prototype.destroy=function(){return MRt(this),le(this)};var mz=hz;function LRt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var pz=LRt;function KE(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}KE.create=function(e){return new KE(e)};KE.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};KE.prototype.isDestroyed=function(){return!1};KE.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};KE.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 gz=KE;function $E(e){let t=new Tc(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 jOe(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]}$E.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};$E.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=gz.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=Ke.createTypedArray(c,a,i,r);return u.getBufferData(d),jOe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};$E.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 jOe(r,o,n,i,t)};$E.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)};$E.prototype.isDestroyed=function(){return!1};$E.prototype.destroy=function(){return this._fb.destroy(),le(this)};var _z=$E;function T7(e){e=e??!0,this.value=T7.toValue(e)}Object.defineProperties(T7.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});T7.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Dn=T7;function JE(){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(JE.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});JE.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};JE.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};JE.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};JE.prototype.isDestroyed=function(){return!1};JE.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var yz=JE;function Z_(){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 FRt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Z_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Z_.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)};Z_.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)};Z_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Z_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Z_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Z_.prototype.isDestroyed=function(){return!1};Z_.prototype.destroy=function(){return FRt(this),le(this)};var ZE=Z_;function gb(){}var BRt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};gb.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return BRt[n]===!0})};gb.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};gb.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; +`,{renderState:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}OC.prototype.update=function(e,t){Szt(this,e,t),wzt(this,e,t)};var Izt=new se,Pzt=new se(1,1/255,1/65025,1/16581375);OC.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,Izt);return se.divideByScalar(r,255,r),se.dot(r,Pzt)};OC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};OC.prototype.isDestroyed=function(){return!1};OC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var ZV=OC;function QV(){this._framebuffer=new ai({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(QV.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Dzt(e){e._framebuffer.destroy()}function Rzt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new Ac(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}QV.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&Rzt(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};QV.prototype.isDestroyed=function(){return!1};QV.prototype.destroy=function(){return Dzt(this),le(this)};var e4=QV;function Ozt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var t4=Ozt;function MC(e){let t=new Ac(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 kBe(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]}MC.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};MC.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=EU.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=Ke.createTypedArray(c,a,i,r);return u.getBufferData(d),kBe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};MC.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 kBe(r,o,n,i,t)};MC.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)};MC.prototype.isDestroyed=function(){return!1};MC.prototype.destroy=function(){return this._fb.destroy(),le(this)};var n4=MC;function NC(){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 ui({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(NC.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});NC.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};NC.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};NC.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};NC.prototype.isDestroyed=function(){return!1};NC.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var i4=NC;function py(){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 ui({color:new z(0,0,0,0),depth:1,owner:this})}function Mzt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(py.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});py.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)};py.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)};py.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};py.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};py.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};py.prototype.isDestroyed=function(){return!1};py.prototype.destroy=function(){return Mzt(this),le(this)};var LC=py;function kb(){}var Nzt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};kb.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return Nzt[n]===!0})};kb.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};kb.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_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Ye({defines:i,sources:r})};gb.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; +}`)}return new Ye({defines:i,sources:r})};kb.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() { @@ -11062,7 +11071,7 @@ void main() `: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})};gb.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}`};gb.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})};gb.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; +`,s.push(f),new Ye({defines:o,sources:s})};kb.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}`};kb.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})};kb.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 @@ -11173,7 +11182,7 @@ ${m?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,E+=` out_FragColor.rgb *= visibility; } -`,x.push(E),new Ye({defines:b,sources:x})};var Jm=gb;function k0(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 E7,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 U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new bs: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 kRt(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,Joe(this),this._clearCommand=new li({depth:1,color:new z}),this._clearPassState=new Tc(t),this._size=e.size??2048,this.size=this._size}k0.MAXIMUM_DISTANCE=2e4;function kRt(e){this.camera=new E7,this.passState=new Tc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function $oe(e,t){return Ge.fromCache({cull:{enabled:!0,face:Ui.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 Joe(e){let t=!e._usesDepthTexture;e._primitiveRenderState=$oe(t,e._primitiveBias),e._terrainRenderState=$oe(t,e._terrainBias),e._pointRenderState=$oe(t,e._pointBias)}k0.prototype.debugCreateRenderStates=function(){Joe(this)};Object.defineProperties(k0.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){GRt(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 Zoe(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 URt(e,t){let n=new wf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:zl.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 gs({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 zRt(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 gs({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 VRt(e,t){let n=new wf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:zl.DEPTH_COMPONENT16}),i=new rs({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 gs({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 WOe(e,t){e._isPointLight?VRt(e,t):e._usesDepthTexture?zRt(e,t):URt(e,t)}function jRt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Joe(e),Zoe(e),WOe(e,t))}function HRt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Zoe(e),WOe(e,t),jRt(e,t),qOe(e,t))}function qOe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function GRt(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 WRt=new et;function qRt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,x.push(E),new Ye({defines:b,sources:x})};var pp=kb;function Y0(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 OW,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 U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new As: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 Lzt(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,oce(this),this._clearCommand=new ui({depth:1,color:new z}),this._clearPassState=new Ac(t),this._size=e.size??2048,this.size=this._size}Y0.MAXIMUM_DISTANCE=2e4;function Lzt(e){this.camera=new OW,this.passState=new Ac(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function rce(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 oce(e){let t=!e._usesDepthTexture;e._primitiveRenderState=rce(t,e._primitiveBias),e._terrainRenderState=rce(t,e._terrainBias),e._pointRenderState=rce(t,e._pointBias)}Y0.prototype.debugCreateRenderStates=function(){oce(this)};Object.defineProperties(Y0.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){Vzt(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 sce(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 Fzt(e,t){let n=new Ff({context:t,width:e._textureSize.x,height:e._textureSize.y,format:nu.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=new ys({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 Bzt(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:Ht.NEAREST}),i=new ys({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 kzt(e,t){let n=new Ff({context:t,width:e._textureSize.x,height:e._textureSize.y,format:nu.DEPTH_COMPONENT16}),i=new ts({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.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 ys({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 VBe(e,t){e._isPointLight?kzt(e,t):e._usesDepthTexture?Bzt(e,t):Fzt(e,t)}function Uzt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,oce(e),sce(e),VBe(e,t))}function zzt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(sce(e),VBe(e,t),Uzt(e,t),jBe(e,t))}function jBe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Vzt(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 N(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var jzt=new et;function Hzt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -11234,7 +11243,7 @@ ${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=Ie.OVERLAY,i}function YRt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=WRt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=qRt(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 U0=new Array(8);U0[0]=new se(-1,-1,-1,1);U0[1]=new se(1,-1,-1,1);U0[2]=new se(1,1,-1,1);U0[3]=new se(-1,1,-1,1);U0[4]=new se(-1,-1,1,1);U0[5]=new se(1,-1,1,1);U0[6]=new se(1,1,1,1);U0[7]=new se(-1,1,1,1);var _b=new N,Qoe=new Array(8);for(let e=0;e<8;++e)Qoe[e]=new se;function XRt(e,t){let n=new Bt({geometry:new Tm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Bt({geometry:new l_({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 KRt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],$Rt=new h;function JRt(e,t){YRt(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 d0({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 d0({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 d0({camera:e._passes[i].camera,color:KRt[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,$Rt),a=N.fromTranslationQuaternionRotationScale(i,r,s,_b);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=XRt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new d0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function E7(){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}E7.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 ZRt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);E7.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(ZRt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var QRt=new Array(5),eOt=new Ki,tOt=new Array(4),YOe=new h,XOe=new h;function nOt(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=tOt,g=QRt;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(eOt),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,_b),_=N.inverse(L,_b),C=N.multiply(O,_,_b),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,YOe),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,XOe);for(let j=0;j<8;++j){let k=se.clone(U0[j],Qoe[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 iOt=new N,rOt=new h,oOt=new h,HOe=new h;function sOt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,_b),o=N.inverse(r,_b),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,rOt);a=h.cross(c,s,oOt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,HOe),f=N.computeView(u,s,a,c,iOt),d=N.multiply(f,o,_b),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,YOe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,XOe);for(let E=0;E<8;++E){let v=se.clone(U0[E],Qoe[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=HOe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=N.fromTranslation(m,_b);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 aOt=[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)],cOt=[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)],lOt=[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 uOt(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=aOt[i],r.upWC=cOt[i],r.rightWC=lOt[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var fOt=new h,dOt=new h,KOe=new ue,GOe=KOe.center;function hOt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=KOe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,fOt),s=h.negate(i.directionWC,dOt),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),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,GOe),GOe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function mOt(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=Pr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,hOt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}k0.prototype.update=function(e){if(mOt(this,e),this._needsUpdate)if(HRt(this,e.context),this._isPointLight&&uOt(this,e),this._cascadesEnabled&&(sOt(this,e),this._numberOfCascades>1&&nOt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ea.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&&JRt(this,e)};k0.prototype.updatePass=function(e,t){qOe(this,e,t)};var pOt=new U;function $Oe(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=pOt;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 gOt(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&&Jm.hasClippingForShadowCast(y),b=Jm.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=Jm.createShadowCastVertexShader(m,p,f),E=Jm.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=$Oe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}k0.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=Jm.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=Jm.createShadowReceiveVertexShader(a,u,f),b=Jm.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=$Oe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};k0.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]=gOt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){Zoe(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 le(this)};var Q_=k0;var Az=`uniform sampler2D u_opaqueDepthTexture; +`;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 Gzt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=jzt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=Hzt(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 X0=new Array(8);X0[0]=new se(-1,-1,-1,1);X0[1]=new se(1,-1,-1,1);X0[2]=new se(1,1,-1,1);X0[3]=new se(-1,1,-1,1);X0[4]=new se(-1,-1,1,1);X0[5]=new se(1,-1,1,1);X0[6]=new se(1,1,1,1);X0[7]=new se(-1,1,1,1);var Ub=new N,ace=new Array(8);for(let e=0;e<8;++e)ace[e]=new se;function Wzt(e,t){let n=new Ft({geometry:new Hh({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Ft({geometry:new __({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new On({geometryInstances:[n,i],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var qzt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],Yzt=new h;function Xzt(e,t){Gzt(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 z0({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 z0({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 z0({camera:e._passes[i].camera,color:qzt[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,Yzt),a=N.fromTranslationQuaternionRotationScale(i,r,s,Ub);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Wzt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new z0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function OW(){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}OW.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 Kzt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);OW.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(Kzt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var $zt=new Array(5),Jzt=new Ji,Zzt=new Array(4),HBe=new h,GBe=new h;function Qzt(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=Zzt,g=$zt;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(Jzt),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,Ub),_=N.inverse(L,Ub),C=N.multiply(O,_,Ub),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,HBe),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,GBe);for(let j=0;j<8;++j){let k=se.clone(X0[j],ace[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 eVt=new N,tVt=new h,nVt=new h,UBe=new h;function iVt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,Ub),o=N.inverse(r,Ub),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,tVt);a=h.cross(c,s,nVt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,UBe),f=N.computeView(u,s,a,c,eVt),d=N.multiply(f,o,Ub),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,HBe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,GBe);for(let E=0;E<8;++E){let v=se.clone(X0[E],ace[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=UBe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=N.fromTranslation(m,Ub);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 rVt=[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)],oVt=[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)],sVt=[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 aVt(e,t){let n=new Ji;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=rVt[i],r.upWC=oVt[i],r.rightWC=sVt[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var cVt=new h,lVt=new h,WBe=new ue,zBe=WBe.center;function uVt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=WBe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,cVt),s=h.negate(i.directionWC,lVt),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),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,zBe),zBe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function fVt(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,uVt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Y0.prototype.update=function(e){if(fVt(this,e),this._needsUpdate)if(zzt(this,e.context),this._isPointLight&&aVt(this,e),this._cascadesEnabled&&(iVt(this,e),this._numberOfCascades>1&&Qzt(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&&Xzt(this,e)};Y0.prototype.updatePass=function(e,t){jBe(this,e,t)};var dVt=new U;function qBe(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=dVt;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 hVt(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&&pp.hasClippingForShadowCast(y),b=pp.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=pp.createShadowCastVertexShader(m,p,f),E=pp.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=qBe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}Y0.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=pp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=pp.createShadowReceiveVertexShader(a,u,f),b=pp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=qBe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};Y0.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]=hVt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};Y0.prototype.isDestroyed=function(){return!1};Y0.prototype.destroy=function(){sce(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 le(this)};var gy=Y0;var r4=`uniform sampler2D u_opaqueDepthTexture; uniform sampler2D u_translucentDepthTexture; in vec2 v_textureCoordinates; void main() @@ -11244,7 +11253,7 @@ float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); out_FragColor = czm_packDepth(translucentDepth); } -`;var QE=`uniform sampler2D colorTexture; +`;var FC=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -11270,7 +11279,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var _Ot=!1;function yb(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(yb.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function JOe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function ZOe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function yOt(e,t,n,i){JOe(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 AOt(e,t,n,i){ZOe(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 bOt(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)&&(yOt(e,t,r,o),AOt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Ye({sources:[Az]}),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:[QE]}),a={colorTexture:function(){return e._textureToComposite}},_Ot&&(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:[QE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ye({sources:[QE]}),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:Zn.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)}yb.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){bOt(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}};yb.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)};yb.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),xOt(this,e,t)};function xOt(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}yb.prototype.isSupported=function(){return this._supported};yb.prototype.isDestroyed=function(){return!1};yb.prototype.destroy=function(){return JOe(this),ZOe(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()),le(this)};var bz=yb;function TOt(){this.command=void 0,this.near=void 0,this.far=void 0}function C7(e,t,n){let i=e.context,r;i.depthTexture&&(r=new a3);let o;e._useOIT&&i.depthTexture&&(o=new lz(i));let s=new Tc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Pr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new _z(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new mz,this.sceneFramebuffer=new ZE,this.edgeFramebuffer=new Sk,this.planarFillIdFramebuffer=new yz,this.globeDepth=r,this.globeTranslucencyFramebuffer=new c3,this.oit=o,this.translucentTileClassification=new bz(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var ese=new h,tse=new h;function EOt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,ese)),h.maximumComponent(h.abs(t.position,tse))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,ese),h.multiplyByScalar(t.position,r,tse),h.equalsEpsilon(ese,tse,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)}C7.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return EOt(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(),Pr.clone(t,n),!0)};function COt(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 zk(g,m)}}function vOt(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 QOe=new ea,SOt=new zs;C7.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=QOe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=QOe;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,SOt);if(w=F.start,P=F.stop,m=Math.min(m,w),y=Math.max(y,P),A&&L.receiveShadows&&w<Q_.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 TOt),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),COt(this,e,m,y);for(let O=0;O<g;O++)vOt(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}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let P=_[C];P<w.length&&l(w[P]);++P)w[P]=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)};C7.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 eC=C7;var tMe=.1,wOt=new rh({pass:so.MOST_DETAILED_PRELOAD}),IOt=new rh({pass:so.MOST_DETAILED_PICK}),xz=new rh({pass:so.PICK});function Ra(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Pr(e);n.frustum=new mn({width:tMe,aspectRatio:1,near:.1}),this._pickOffscreenView=new eC(e,n,t)}Ra.prototype.update=function(){this._pickPositionCacheDirty=!0};Ra.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new dz,n[t]=i),i};var POt=new bs,DOt=new h,v7=new h,ROt=new U,OOt=new N;function MOt(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,OOt);o._setTransform(N.IDENTITY);let d=h.clone(o.position,DOt);h.multiplyByScalar(o.right,c,v7),h.add(v7,d,d),h.multiplyByScalar(o.up,u,v7),h.add(v7,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,ROt),g=POt;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 NOt=new Yl,LOt=new U;function FOt(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,LOt),y=m.x*n*.5,A=m.y*i*.5,b=NOt;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 S7(e,t,n,i,r){let o=e.camera.frustum;return o instanceof mn||o instanceof bs?MOt(e,t,n,i,r):FOt(e,t,n,i,r)}var Tz=new et(0,0,3,3),w7=new U,Ez=new z(0,0,0,0);function nse(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 Cz(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=fr.transformWindowToDrawingBuffer(e,t,w7);nse(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=S7(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=xz,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,Ez),e.resolveFramebuffers(p)}function vz(e){let{context:t}=e;t.endFrame()}Ra.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=Tz;Cz(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.")),vz(e),f};Ra.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=Tz;Cz(e,t,a,n,i);let c=s.end(a,r);return vz(e),c};Ra.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=fr.transformWindowToDrawingBuffer(e,t,w7),d=nse(r.drawingBufferHeight,f,n,i,Tz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=S7(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=xz,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,Ez),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Ra.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=fr.transformWindowToDrawingBuffer(e,t,w7),f=nse(i.drawingBufferHeight,u,1,1,Tz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=S7(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=xz,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,Ez);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,ez.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function BOt(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=S7(e,t,1,1,s),r.tilesetPassState=xz,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Ez),e.resolveFramebuffers(c),i.endFrame()}var kOt=new Ki,UOt=new Yl,zOt=new mn,VOt=new bs;Ra.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=fr.transformWindowToDrawingBuffer(e,t,w7);e.pickTranslucentDepth?BOt(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(kOt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(UOt):l(s.frustum.width)?f=s.frustum.clone(zOt):f=s.frustum.clone(VOt);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=fr.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 jOt=new he;Ra.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,jOt);r.cartographicToCartesian(o,n)}return n};function HOt(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=Dn.toValue(!1,p.show),r.push(p))}a instanceof ra&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function nMe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!HOt(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=Dn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}Ra.prototype.drillPick=function(e,t,n,i,r){return nMe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var eMe=new h,GOt=new h;function WOt(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 iMe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,eMe),s=h.cross(r,o,eMe),a=h.cross(r,s,GOt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??tMe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function qOt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=iMe(e,r,o,a),u=wOt;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}Ra.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)qOt(this,e,t[n])&&t.splice(n--,1)};function rMe(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 wl&&rMe(r,t,n))}}function I7(e,t,n,i,r,o){let s=[];if(rMe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new WOt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function YOt(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 XOt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,iMe(e,n,r,f.camera);let d=et.clone(f.viewport,Tz),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=IOt:c.tilesetPassState=xz,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,Ez),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||YOt(m,i)}}function ise(e,t,n,i,r,o,s,a){return nMe(function(){let u=XOt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function DI(e,t,n,i,r,o,s){let a=ise(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function P7(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)})})}Ra.prototype.pickFromRay=function(e,t,n,i){return DI(this,e,t,n,i,!1,!1)};Ra.prototype.drillPickFromRay=function(e,t,n,i,r){return ise(this,e,t,n,i,r,!1,!1)};Ra.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=pn.clone(t),n=l(n)?n.slice():n,P7(e,I7(r,e,t,n,i,function(){return DI(r,e,t,n,i,!1,!0)}))};Ra.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=pn.clone(t),i=l(i)?i.slice():i,P7(e,I7(o,e,t,i,r,function(){return ise(o,e,t,n,i,r,!1,!0)}))};var KOt=new h,$Ot=new h,JOt=new pn,oMe=new he;function rse(e,t){let n=e.ellipsoid,i=Ni._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,$Ot),o=he.toCartesian(t,n,KOt),s=JOt;s.origin=o,s.direction=r;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function sMe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,oMe);return rse(e,i)}function aMe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,oMe).height}function ZOt(e,t,n,i,r){let o=rse(t,n);return I7(e,t,o,i,r,function(){let s=DI(e,t,o,i,r,!0,!0);if(l(s))return aMe(t,s.position)})}function QOt(e,t,n,i,r,o){let s=sMe(t,n);return I7(e,t,s,i,r,function(){let a=DI(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}Ra.prototype.sampleHeight=function(e,t,n,i){let r=rse(e,t),o=DI(this,e,r,n,i,!0,!1);if(l(o))return aMe(e,o.position)};Ra.prototype.clampToHeight=function(e,t,n,i,r){let o=sMe(e,t),s=DI(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};Ra.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]=ZOt(this,e,t[s],n,i);return P7(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}))};Ra.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]=QOt(this,e,t[s],n,i,t[s]);return P7(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ra.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Sz=Ra;var uMe=Qo(mj(),1);var eMt={modifyFragmentShader:function(t){return t=Ye.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`;var mVt=!1;function zb(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 ui({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({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(zb.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function YBe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function XBe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function pVt(e,t,n,i){YBe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST})}function gVt(e,t,n,i){XBe(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 _Vt(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)&&(pVt(e,t,r,o),gVt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Ye({sources:[r4]}),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:[FC]}),a={colorTexture:function(){return e._textureToComposite}},mVt&&(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:[FC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ye({sources:[FC]}),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:ei.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)}zb.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){_Vt(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}};zb.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)};zb.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),yVt(this,e,t)};function yVt(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}zb.prototype.isSupported=function(){return this._supported};zb.prototype.isDestroyed=function(){return!1};zb.prototype.destroy=function(){return YBe(this),XBe(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()),le(this)};var o4=zb;function AVt(){this.command=void 0,this.near=void 0,this.far=void 0}function MW(e,t,n){let i=e.context,r;i.depthTexture&&(r=new DV);let o;e._useOIT&&i.depthTexture&&(o=new $V(i));let s=new Ac(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 n4(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new e4,this.sceneFramebuffer=new LC,this.edgeFramebuffer=new oV,this.planarFillIdFramebuffer=new i4,this.globeDepth=r,this.globeTranslucencyFramebuffer=new RV,this.oit=o,this.translucentTileClassification=new o4(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var cce=new h,lce=new h;function bVt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,cce)),h.maximumComponent(h.abs(t.position,lce))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,cce),h.multiplyByScalar(t.position,r,lce),h.equalsEpsilon(cce,lce,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)}MW.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return bVt(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 xVt(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 dV(g,m)}}function TVt(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 KBe=new ta,EVt=new Us;MW.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=KBe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=KBe;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,EVt);if(w=F.start,P=F.stop,m=Math.min(m,w),y=Math.max(y,P),A&&L.receiveShadows&&w<gy.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 ui?(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 AVt),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),xVt(this,e,m,y);for(let O=0;O<g;O++)TVt(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}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let P=_[C];P<w.length&&l(w[P]);++P)w[P]=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)};MW.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=MW;var JBe=.1,CVt=new vh({pass:ao.MOST_DETAILED_PRELOAD}),vVt=new vh({pass:ao.MOST_DETAILED_PICK}),s4=new vh({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:JBe,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 ZV,n[t]=i),i};var SVt=new As,wVt=new h,NW=new h,IVt=new U,PVt=new N;function DVt(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,PVt);o._setTransform(N.IDENTITY);let d=h.clone(o.position,wVt);h.multiplyByScalar(o.right,c,NW),h.add(NW,d,d),h.multiplyByScalar(o.up,u,NW),h.add(NW,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,IVt),g=SVt;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 RVt=new yu,OVt=new U;function MVt(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,OVt),y=m.x*n*.5,A=m.y*i*.5,b=RVt;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 LW(e,t,n,i,r){let o=e.camera.frustum;return o instanceof gn||o instanceof As?DVt(e,t,n,i,r):MVt(e,t,n,i,r)}var a4=new et(0,0,3,3),FW=new U,c4=new z(0,0,0,0);function uce(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 l4(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=dr.transformWindowToDrawingBuffer(e,t,FW);uce(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=LW(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=s4,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,c4),e.resolveFramebuffers(p)}function u4(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=a4;l4(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.")),u4(e),f};Oa.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=a4;l4(e,t,a,n,i);let c=s.end(a,r);return u4(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=dr.transformWindowToDrawingBuffer(e,t,FW),d=uce(r.drawingBufferHeight,f,n,i,a4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=LW(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=s4,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,c4),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=dr.transformWindowToDrawingBuffer(e,t,FW),f=uce(i.drawingBufferHeight,u,1,1,a4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=LW(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=s4,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,c4);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,WV.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function NVt(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=LW(e,t,1,1,s),r.tilesetPassState=s4,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,c4),e.resolveFramebuffers(c),i.endFrame()}var LVt=new Ji,FVt=new yu,BVt=new gn,kVt=new As;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=dr.transformWindowToDrawingBuffer(e,t,FW);e.pickTranslucentDepth?NVt(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(LVt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(FVt):l(s.frustum.width)?f=s.frustum.clone(BVt):f=s.frustum.clone(kVt);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=dr.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 UVt=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,UVt);r.cartographicToCartesian(o,n)}return n};function zVt(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 na&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function ZBe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!zVt(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 ZBe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var $Be=new h,VVt=new h;function jVt(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 QBe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,$Be),s=h.cross(r,o,$Be),a=h.cross(r,s,VVt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??JBe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function HVt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=QBe(e,r,o,a),u=CVt;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)HVt(this,e,t[n])&&t.splice(n--,1)};function e2e(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 xl&&e2e(r,t,n))}}function BW(e,t,n,i,r,o){let s=[];if(e2e(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new jVt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function GVt(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 WVt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,QBe(e,n,r,f.camera);let d=et.clone(f.viewport,a4),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=vVt:c.tilesetPassState=s4,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,c4),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||GVt(m,i)}}function fce(e,t,n,i,r,o,s,a){return ZBe(function(){let u=WVt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function HP(e,t,n,i,r,o,s){let a=fce(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function kW(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 HP(this,e,t,n,i,!1,!1)};Oa.prototype.drillPickFromRay=function(e,t,n,i,r){return fce(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,kW(e,BW(r,e,t,n,i,function(){return HP(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,kW(e,BW(o,e,t,i,r,function(){return fce(o,e,t,n,i,r,!1,!0)}))};var qVt=new h,YVt=new h,XVt=new pn,t2e=new he;function dce(e,t){let n=e.ellipsoid,i=Mi._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,YVt),o=he.toCartesian(t,n,qVt),s=XVt;s.origin=o,s.direction=r;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function n2e(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,t2e);return dce(e,i)}function i2e(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,t2e).height}function KVt(e,t,n,i,r){let o=dce(t,n);return BW(e,t,o,i,r,function(){let s=HP(e,t,o,i,r,!0,!0);if(l(s))return i2e(t,s.position)})}function $Vt(e,t,n,i,r,o){let s=n2e(t,n);return BW(e,t,s,i,r,function(){let a=HP(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=dce(e,t),o=HP(this,e,r,n,i,!0,!1);if(l(o))return i2e(e,o.position)};Oa.prototype.clampToHeight=function(e,t,n,i,r){let o=n2e(e,t),s=HP(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]=KVt(this,e,t[s],n,i);return kW(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]=$Vt(this,e,t[s],n,i,t[s]);return kW(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 f4=Oa;var s2e=Qo(gj(),1);var JVt={modifyFragmentShader:function(t){return t=Ye.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -11279,9 +11288,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},RI=eMt;var tC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function wz(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=tC.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=Pn.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??Ho.NONE,this._splittingEnabled=!1,this._error=void 0,tMt(this,e)}Object.defineProperties(wz.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=ue.clone(e,this._boundingSphere)}}});function tMt(e,t){let n=fT.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=Wh.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=tC.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 nMt=new h,iMt=new h,rMt=new h,cMe,D7;function oMt(e){if(!l(D7)){cMe=new uMe.default(0),D7=new Array(e);for(let t=0;t<e;++t)D7[t]=cMe.random()}return D7}function sMt(e){let n=e.length/3,i=Math.min(n,20),r=oMt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,nMt),c=h.fromElements(s,s,s,iMt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,rMt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function lMe(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 aMt=new se,cMt=new se,lMt=new z,fMe=0,R7=1,lse=2,dMe=3,uMt=4,ose=new N,fMt=new N;function dMt(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=uMt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=lMe(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=lMe(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:fMe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=sMt(o.typedArray)),T)if(b)P.push({index:R7,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;P.push({index:R7,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:lse,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&P.push({index:dMe,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 ue,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 hMt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=aMt;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 mn?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,lMt);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,ose);let u=N.multiply(ose,a.modelMatrix,ose);return N.inverseTranspose(u,fMt)}};RI.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=cMt;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 sse(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 ase(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 cse(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 mMt={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 pMt(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(mMt),_={},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&&(sse(S,V),ase(S,B)),P&&(sse(I,V),ase(I,B)),M&&(sse(R,V),ase(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=cse(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=cse(T,R7);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=cse(T,lse);fe.enabled=q}let Q={a_position:fMe};G&&(Q.a_color=R7),q&&(Q.a_normal=lse),A&&(Q.a_batchId=dMe);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}hMt(e,t);let Z=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},GP=JVt;var kC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function d4(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??Vo.NONE,this._splittingEnabled=!1,this._error=void 0,ZVt(this,e)}Object.defineProperties(d4.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=ue.clone(e,this._boundingSphere)}}});function ZVt(e,t){let n=TT.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=rm.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 QVt=new h,e4t=new h,t4t=new h,r2e,UW;function n4t(e){if(!l(UW)){r2e=new s2e.default(0),UW=new Array(e);for(let t=0;t<e;++t)UW[t]=r2e.random()}return UW}function i4t(e){let n=e.length/3,i=Math.min(n,20),r=n4t(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,QVt),c=h.fromElements(s,s,s,e4t);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,t4t);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function o2e(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 r4t=new se,o4t=new se,s4t=new z,a2e=0,zW=1,_ce=2,c2e=3,a4t=4,hce=new N,c4t=new N;function l4t(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=a4t;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=o2e(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=nt.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=nt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=nt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=nt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=o2e(c.typedArray,"batchIds"),w=nt.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:a2e,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=i4t(o.typedArray)),T)if(b)P.push({index:zW,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;P.push({index:zW,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:_ce,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&P.push({index:c2e,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 ue,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 u4t(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=r4t;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,s4t);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,hce);let u=N.multiply(hce,a.modelMatrix,hce);return N.inverseTranspose(u,c4t)}};GP.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=o4t;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 mce(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 pce(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 gce(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 f4t={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 d4t(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(f4t),_={},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&&(mce(S,V),pce(S,B)),P&&(mce(I,V),pce(I,B)),M&&(mce(R,V),pce(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=gce(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=gce(T,zW);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=gce(T,_ce);fe.enabled=q}let Q={a_position:a2e};G&&(Q.a_color=zW),q&&(Q.a_normal=_ce),A&&(Q.a_batchId=c2e);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}u4t(e,t);let Z=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -11352,12 +11361,12 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,ae+=` -`,ae+=ZT(E,s),ae+=` +`,ae+=CC(E,s),ae+=` `),ae+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,F&&(ae+=Vk("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} -`,e.splitDirection!==Ho.NONE&&(ae=RI.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 gMt(e,t){if(e._decodingState===tC.READY)return!1;if(e._decodingState===tC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Rg.decodePointCloud(i,t);l(r)&&(e._decodingState=tC.DECODING,r.then(function(o){e._decodingState=tC.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=tC.FAILED,e._error=o}))}return!0}var _Mt=new se,yMt=new h;wz.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(gMt(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)||(dMt(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,_Mt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(u,d,d);let p=N.getScale(u,yMt);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!==Ho.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&pMt(this,e,this._style),this._drawCommand.castShadows=Pn.castShadows(this.shadows),this._drawCommand.receiveShadows=Pn.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)};wz.prototype.isDestroyed=function(){return!1};wz.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var Iz=wz;var AMt={NEAREST:0,LINEAR:1},ld=AMt;function ey(e){e=e??H.EMPTY_OBJECT;let{name:t=Jn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=ld.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 Tc;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(ey.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 bMt=/uniform\s+sampler2D\s+depthTexture/g;ey.prototype._isSupported=function(e){return!bMt.test(this._fragmentShader)||e.depthTexture};function xMt(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 TMt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function EMt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function CMt(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]=TMt(e,o),n[o]=xMt(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`]=EMt(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 vMt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,F&&(ae+=hV("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} +`,e.splitDirection!==Vo.NONE&&(ae=GP.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=en.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 h4t(e,t){if(e._decodingState===kC.READY)return!1;if(e._decodingState===kC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Og.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 m4t=new se,p4t=new h;d4.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(h4t(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)||(l4t(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,m4t);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(u,d,d);let p=N.getScale(u,p4t);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!==Vo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&d4t(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)};d4.prototype.isDestroyed=function(){return!1};d4.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var h4=d4;var g4t={NEAREST:0,LINEAR:1},gd=g4t;function _y(e){e=e??H.EMPTY_OBJECT;let{name:t=$n(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=gd.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 Ac;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(_y.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 _4t=/uniform\s+sampler2D\s+depthTexture/g;_y.prototype._isSupported=function(e){return!_4t.test(this._fragmentShader)||e.depthTexture};function y4t(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 A4t(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function b4t(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function x4t(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]=A4t(e,o),n[o]=y4t(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`]=b4t(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 T4t(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; @@ -11381,7 +11390,7 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function SMt(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=vMt(n,r)}let i=new Ye({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function wMt(e){let t=e._sampleMode,n,i;t===ld.LINEAR?(n=Wt.LINEAR,i=$n.LINEAR):(n=Wt.NEAREST,i=$n.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 IMt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function PMt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function DMt(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]=PMt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(IMt(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 hMe(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 RMt(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 OMt(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&&(ey._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})}ey.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&hMe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=RMt(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,OMt(this,e),CMt(this),DMt(this,e),SMt(this,e),wMt(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};ey.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)};ey.prototype.isDestroyed=function(){return!1};ey.prototype.destroy=function(){return hMe(this),le(this)};ey._oneTimeWarning=_t;var Ur=ey;var Pz=`uniform sampler2D colorTexture; +${e}`}function E4t(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=T4t(n,r)}let i=new Ye({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function C4t(e){let t=e._sampleMode,n,i;t===gd.LINEAR?(n=Wt.LINEAR,i=Zn.LINEAR):(n=Wt.NEAREST,i=Zn.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 v4t(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function S4t(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function w4t(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]=S4t(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(v4t(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 l2e(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 I4t(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 P4t(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&&(_y._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: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:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Ht.NEAREST})}_y.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&l2e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=I4t(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,P4t(this,e),x4t(this),w4t(this,e),E4t(this,e),C4t(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};_y.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)};_y.prototype.isDestroyed=function(){return!1};_y.prototype.destroy=function(){return l2e(this),le(this)};_y._oneTimeWarning=_t;var Ur=_y;var m4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11401,7 +11410,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var Dz=`precision highp float; +`;var p4=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -11509,7 +11518,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var Rz=`uniform sampler2D colorTexture; +`;var g4=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -11519,7 +11528,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var Oz=`uniform sampler2D colorTexture; +`;var _4=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -11536,7 +11545,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var Mz=`uniform sampler2D colorTexture; +`;var y4=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -11552,7 +11561,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var Nz=`uniform sampler2D colorTexture; +`;var A4=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -11561,7 +11570,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var Lz=`uniform sampler2D colorTexture; +`;var b4=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -11575,7 +11584,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 Fz=`uniform sampler2D colorTexture; +`;var x4=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -11610,14 +11619,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 Bz=`uniform sampler2D depthTexture; +`;var T4=`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 kz=`uniform sampler2D depthTexture; +`;var E4=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -11667,7 +11676,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 Uz=`uniform sampler2D colorTexture; +`;var C4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11696,7 +11705,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 zz=`uniform sampler2D colorTexture; +`;var v4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11716,7 +11725,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var Vz=`in vec2 v_textureCoordinates; +`;var S4=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -11734,7 +11743,7 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var Ab=`#define SAMPLES 8 +`;var Vb=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; @@ -11768,7 +11777,7 @@ result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } -`;var jz=`uniform sampler2D colorTexture; +`;var w4=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -11883,7 +11892,7 @@ result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } -`;var Hz=`uniform sampler2D colorTexture; +`;var I4=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE @@ -11905,7 +11914,7 @@ color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var Gz=`uniform sampler2D colorTexture; +`;var P4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { @@ -11918,7 +11927,7 @@ 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 Wz=`uniform sampler2D colorTexture; +`;var D4=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11939,7 +11948,7 @@ color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var qz=`uniform sampler2D colorTexture; +`;var R4=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) @@ -11975,7 +11984,7 @@ out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); * 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 Yz=`#if (FXAA_QUALITY_PRESET == 10) + */var O4=`#if (FXAA_QUALITY_PRESET == 10) #define FXAA_QUALITY_PS 3 #define FXAA_QUALITY_P0 1.5 #define FXAA_QUALITY_P1 3.0 @@ -12445,8 +12454,8 @@ if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); } -`;function nC(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(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(nC.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}}});nC.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};nC.prototype.get=function(e){return this._stages[e]};function MMt(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}nC.prototype.update=function(e,t){this._selectedDirty=MMt(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)}};nC.prototype.isDestroyed=function(){return!1};nC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var uf=nC;var us={};function use(e){let r=`#define USE_STEP_SIZE -${Ab}`,o=new Ur({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:ld.LINEAR}),s=new Ur({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:ld.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 uf({name:e,stages:[o,s],uniforms:a})}us.createBlurStage=function(){return use("czm_blur")};us.createDepthOfFieldStage=function(){let e=use("czm_depth_of_field_blur"),t=new Ur({name:"czm_depth_of_field_composite",fragmentShader:Fz,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 uf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};us.isDepthOfFieldSupported=function(e){return e.context.depthTexture};us.createEdgeDetectionStage=function(){let e=Jn();return new Ur({name:`czm_edge_detection_${e}`,fragmentShader:kz,uniforms:{length:.25,color:z.clone(z.BLACK)}})};us.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function NMt(e){if(!l(e))return us.createEdgeDetectionStage();let t=new uf({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}; +`;function UC(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=$n()),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(UC.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}}});UC.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};UC.prototype.get=function(e){return this._stages[e]};function D4t(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}UC.prototype.update=function(e,t){this._selectedDirty=D4t(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)}};UC.prototype.isDestroyed=function(){return!1};UC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var yf=UC;var fs={};function yce(e){let r=`#define USE_STEP_SIZE +${Vb}`,o=new Ur({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:gd.LINEAR}),s=new Ur({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:gd.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 yf({name:e,stages:[o,s],uniforms:a})}fs.createBlurStage=function(){return yce("czm_blur")};fs.createDepthOfFieldStage=function(){let e=yce("czm_depth_of_field_blur"),t=new Ur({name:"czm_depth_of_field_composite",fragmentShader:x4,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 yf({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=$n();return new Ur({name:`czm_edge_detection_${e}`,fragmentShader:E4,uniforms:{length:.25,color:z.clone(z.BLACK)}})};fs.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function R4t(e){if(!l(e))return fs.createEdgeDetectionStage();let t=new yf({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) { @@ -12461,22 +12470,14 @@ void main() { ${r} } out_FragColor = color; } -`,s=new Ur({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new uf({name:"czm_edge_detection_composite",stages:[t,s]})}us.createSilhouetteStage=function(e){let t=NMt(e),n=new Ur({name:"czm_silhouette_color_edges",fragmentShader:qz,uniforms:{silhouetteTexture:t.name}});return new uf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};us.isSilhouetteSupported=function(e){return e.context.depthTexture};us.createBloomStage=function(){let e=new Ur({name:"czm_bloom_contrast_bias",fragmentShader:Lz,uniforms:{contrast:128,brightness:-.3}}),t=use("czm_bloom_blur"),n=new uf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ur({name:"czm_bloom_generate_composite",fragmentShader:Mz,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 uf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};us.createAmbientOcclusionStage=function(){let e=new Ur({name:"czm_ambient_occlusion_generate",fragmentShader:Dz,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ur({name:"czm_ambient_occlusion_composite",fragmentShader:Rz,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 uf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};us.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var LMt=`#define FXAA_QUALITY_PRESET 39 -${Yz} -${Vz}`;us.createFXAAStage=function(){return new Ur({name:"czm_FXAA",fragmentShader:LMt,sampleMode:ld.LINEAR})};us.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=Pz,new Ur({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};us.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=Uz,new Ur({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};us.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=zz,new Ur({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};us.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=Wz,new Ur({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};us.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=Hz,new Ur({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};us.createAutoExposureStage=function(){return new ND};us.createBlackAndWhiteStage=function(){return new Ur({name:"czm_black_and_white",fragmentShader:Oz,uniforms:{gradations:5}})};us.createBrightnessStage=function(){return new Ur({name:"czm_brightness",fragmentShader:Nz,uniforms:{brightness:.5}})};us.createNightVisionStage=function(){return new Ur({name:"czm_night_vision",fragmentShader:Gz})};us.createDepthViewStage=function(){return new Ur({name:"czm_depth_view",fragmentShader:Bz})};us.createLensFlareStage=function(){return new Ur({name:"czm_lens_flare",fragmentShader:jz,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 ud=us;function ty(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function Kz(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function fse(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[Kz(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[Kz(d)]=!0)}}}return i.name}function Xz(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=Xz(e,t,n,p,r):a=fse(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=Kz(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=Kz(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[Kz(i.get(p))]=!0}return a}function FMt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=Xz(e,t,n,i,void 0);a=Xz(e,t,n,r,a),a=fse(e,t,n,o,a),a=Xz(e,t,n,e,a),fse(e,t,n,s,a)}else Xz(e,t,n,e,void 0);return n}function BMt(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 kMt(e,t){let n=FMt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=BMt(e,i,n[i]))}function dse(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function UMt(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})}}ty.prototype.updateDependencies=function(){this._updateDependencies=!0};ty.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)&&(dse(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&kMt(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,dse(this),UMt(this,e))};ty.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};ty.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};ty.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};ty.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};ty.prototype.isDestroyed=function(){return!1};ty.prototype.destroy=function(){return dse(this),le(this)};var iC=ty;var mMe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(mMe);var ny=mMe;var hse=[];function hu(){let e=ud.createFXAAStage(),t=ud.createAmbientOcclusionStage(),n=ud.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=ud.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=ny.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new iC(this),o={},s=hse;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(hu.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 mse(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 ny.REINHARD:n=ud.createReinhardTonemappingStage(t);break;case ny.MODIFIED_REINHARD:n=ud.createModifiedReinhardTonemappingStage(t);break;case ny.FILMIC:n=ud.createFilmicTonemappingStage(t);break;case ny.PBR_NEUTRAL:n=ud.createPbrNeutralTonemappingStage(t);break;default:n=ud.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 mse(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}hu.prototype.add=function(e){let t=this._stageNames,n=hse;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};hu.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=hse;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};hu.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};hu.prototype.get=function(e){return mse(this),this._stages[e]};hu.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};hu.prototype.getStageByName=function(e){return this._stageNames[e]};hu.prototype.update=function(e,t,n){mse(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:$n.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)};hu.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function rC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}hu.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return rC(t)};function z0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){z0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)z0(e.get(o),t,rC(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)z0(e.get(o),t,n,i,r)}hu.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&&(z0(a,e,A,n,i),A=rC(a)),p&&c.ready&&(z0(c,e,A,n,i),A=rC(c)),g&&u.ready&&z0(u,e,A,n,i),m&&f.ready&&(z0(f,e,A,n,i),A=rC(f));let b=A;if(o>0){z0(r[0],e,A,n,i);for(let x=1;x<o;++x)z0(r[x],e,rC(r[x-1]),n,i);b=rC(r[o-1])}y&&s.ready&&z0(s,e,b,n,i)};hu.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(nf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};hu.prototype.isDestroyed=function(){return!1};hu.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(),le(this)};var $z=hu;var pse=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()}},gse=pse;function Il(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 O7=new h;Object.defineProperties(Il.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,O7),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,O7);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,O7),O7)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});Il.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Il(e,t)};var gMe=new h;Il.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,gMe),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 zMt=new h;Il.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,zMt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,gMe),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 VMt=new h;Il.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,VMt),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 M7=new h;Il.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,M7),M7),c=-h.dot(a,r),u=Il._anyRotationVector(r,a,c),f=Il._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=Il._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,M7),M7)};var jMt=[];Il.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,jMt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return Il.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var HMt=new h;Il._anyRotationVector=function(e,t,n){let i=h.abs(t,HMt),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 GMt=new h;Il._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,GMt);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 _se=new h,WMt=new h,N7=new h,pMe=new h;Il._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,_se),s=h.clone(e.center,WMt),a=e.radius,c=h.subtract(s,o,N7),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,pMe),pMe),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,_se);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,_se);T=h.normalize(h.subtract(h.add(b,v,N7),s,N7),N7);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 Jz=Il;var oC=`in vec4 position; -in vec2 textureCoordinates; -out vec2 v_textureCoordinates; -void main() -{ -gl_Position = position; -v_textureCoordinates = textureCoordinates; -} -`;function L7(e){this._context=e}var Zz,qMt=new at({primitiveType:Oe.TRIANGLES}),YMt=new li({color:new z(0,0,0,0)});function XMt(e,t){return new gs({context:e,colorTextures:[t],destroyAttachments:!1})}function KMt(e,t){return Qt.fromCache({context:e,vertexShaderSource:oC,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function $Mt(e,t){return(!l(Zz)||Zz.viewport.width!==e||Zz.viewport.height!==t)&&(Zz=Ge.fromCache({viewport:new et(0,0,e,t)})),Zz}L7.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:KMt(r,e.fragmentShaderSource),a=XMt(r,t),c=$Mt(n,i),u=e.uniformMap,f=YMt;f.framebuffer=a,f.renderState=c,f.execute(r);let d=qMt;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)};L7.prototype.isDestroyed=function(){return!1};L7.prototype.destroy=function(){return le(this)};var Qz=L7;var yse=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)}},eV=yse;function Zm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Zm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Zm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function JMt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Zm.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)?JMt(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};Zm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){Ase(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Zm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};Zm.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 Ase(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];Ase(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Zm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Ase(this,n),--this._numberOfShaders}this._shadersToRelease={}};Zm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Zm.prototype.isDestroyed=function(){return!1};Zm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var tV=Zm;function sC(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(sC.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});sC.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};sC.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};sC.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={}};sC.prototype.isDestroyed=function(){return!1};sC.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var nV=sC;function ZMt(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var iy=ZMt;function OI(){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(OI.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 AMe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return AMe(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 xse(this),this._view3D}},viewRotation:{get:function(){return xse(this),this._viewRotation}},viewRotation3D:{get:function(){return xse(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return TMe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return TMe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return lNt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return uNt(this),this._modelView}},modelView3D:{get:function(){return fNt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return _Nt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return dNt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return hNt(this),this._inverseModelView3D}},viewProjection:{get:function(){return mNt(this),this._viewProjection}},inverseViewProjection:{get:function(){return pNt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return gNt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return yNt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return ANt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return bNt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return xNt(this),this._normal}},normal3D:{get:function(){return TNt(this),this._normal3D}},inverseNormal:{get:function(){return ENt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return CNt(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 xMe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return xMe(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 QMt(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 eNt(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function tNt(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function nNt(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var _Me=new h,iNt=new N,yMe=new $;function rNt(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,_Me)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,_Me)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,iNt);e._enuToModel=N.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=N.inverseTransformation(e._enuToModel,e._modelToEnu);let s=N.getRotation(o,yMe),a=$.multiply(e._viewRotation,s,yMe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var bse=new $,oNt=new he;function sNt(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,bse);let n=pb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(bse,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=pb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(bse,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,oNt);i.project(o,e._sunPositionColumbusView)}OI.prototype.updateCamera=function(e){QMt(this,e.viewMatrix),eNt(this,e.inverseViewMatrix),rNt(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 mn};OI.prototype.updateFrustum=function(e){tNt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&nNt(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};OI.prototype.updatePass=function(e){this._pass=e};var aNt=[],cNt=new iy;OI.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),sNt(this,e);let n=e.light??cNt;n instanceof iy?(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??aNt,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 AMe(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 lNt(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 uNt(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function fNt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function dNt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function hNt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function mNt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function pNt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function gNt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function _Nt(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 yNt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function ANt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function bNt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function xNt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function TNt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function ENt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;N.getMatrix3(e.modelView,t),$.transpose(t,t)}}function CNt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;N.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var bMe=new h;function xMe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,bMe),Sn.fromCartesian(bMe,e._encodedCameraPositionMC))}var vNt=new h,SNt=new h,wNt=new h,INt=new h,PNt=new he,DNt=new h,RNt=new N;function ONt(e,t,n,i,r,o,s,a){let c=vNt;c.x=e.y,c.y=e.z,c.z=e.x;let u=SNt;u.x=n.y,u.y=n.z,u.z=n.x;let f=wNt;f.x=i.y,f.y=i.z,f.z=i.x;let d=INt;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,PNt);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,DNt),y=At.eastNorthUpToFixedFrame(m,g,RNt);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 xse(e){e._view3DDirty&&(e._mode===re.SCENE3D?N.clone(e._view,e._view3D):ONt(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 TMe(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var iV=OI;function ff(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):MNt(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new tV(this),this._textureCache=new nV,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=!!fs(f,["OES_standard_derivatives"]),this._blendMinmax=!!fs(f,["EXT_blend_minmax"]),this._elementIndexUint=!!fs(f,["OES_element_index_uint"]),this._depthTexture=!!fs(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!fs(f,["EXT_frag_depth"]),this._debugShaders=fs(f,["WEBGL_debug_shaders"]),this._textureFloat=!!fs(f,["OES_texture_float"]),this._textureHalfFloat=!!fs(f,["OES_texture_half_float"]),this._textureFloatLinear=!!fs(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!fs(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!fs(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!fs(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!fs(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!fs(f,["EXT_color_buffer_half_float"]),this._s3tc=!!fs(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!fs(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!fs(f,["WEBGL_compressed_texture_astc"]),this._etc=!!fs(f,["WEBG_compressed_texture_etc"]),this._etc1=!!fs(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!fs(f,["EXT_texture_compression_bptc"]),Ou.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?fs(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=fs(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=fs(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=fs(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 iV,C=new Tc(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 MNt(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 NNt(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 LNt(e,t,n,i){let r=`${NNt(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function FNt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(LNt(e,t,n,i))}function BNt(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 kNt(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,BNt(e,r,t))}return i}function fs(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var UNt={};Object.defineProperties(ff.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=kNt(this._originalGLContext,e?FNt: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 rs({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 UNt}}});function EMe(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 Tse;typeof WebGLRenderingContext<"u"&&(Tse=[te.BACK]);function F7(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Tse;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var zNt=new li;ff.prototype.clear=function(e,t){e=e??zNt,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;EMe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;F7(this,c),n.clear(i)};function VNt(e,t,n,i,r){F7(e,t),EMe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function jNt(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()}ff.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,VNt(this,r,t,n,o),jNt(this,e,n,i)};ff.prototype.beginFrame=function(){};ff.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=Tse;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)};ff.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 F7(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};ff.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 F7(this,s),t.readPixels(n,i,r,o,Ke.RGBA,ze.toWebGLConstant(a,this),u),u};var CMe={position:0,textureCoordinates:1};ff.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:CMe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};ff.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:oC,fragmentShaderSource:e,attributeLocations:CMe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};ff.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};ff.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 eV(this._pickObjects,t,z.fromRgba(t))};ff.prototype.isDestroyed=function(){return!1};ff.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(),le(this)};var aC=ff;var Ese=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))}},rV=Ese;function cC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}cC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};cC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof mn,!(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?xLt(this,e):ILt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var HNt=new h,GNt=new h,WNt=new h,qNt=new h,YNt=new h,XNt=new h,KNt=new h,$Nt=new he,JNt=new N,ZNt=new Ki,QNt=new mn,eLt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};cC.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=HNt,r=GNt,o=WNt;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,KNt),d=At.eastNorthUpToFixedFrame(f,t,JNt);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,$Nt),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=QNt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=ZNt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=eLt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=DLt(a);oV(this,c),this._previousMode===re.SCENE2D?PLt(this,e,a,c):(a.position2D=N.multiplyByPoint(Pr.TRANSFORM_2D,i,qNt),a.direction2D=N.multiplyByPointAsVector(Pr.TRANSFORM_2D,r,YNt),a.up2D=N.multiplyByPointAsVector(Pr.TRANSFORM_2D,o,XNt),n._mode=re.MORPHING,LMe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Sse={position:new h,direction:new h,up:new h,frustum:void 0},SMe=new Ki;cC.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)fLt(this,e,t);else{let i;e>0?(i=Sse,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=wMe(this,t);let r,o=n.camera;o.frustum instanceof mn?r=o.frustum.clone():(r=SMe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let s=BMe(i);oV(this,s),vse(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return B7(this),le(this)};function oV(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ia(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,ln.LEFT_DOWN),e._morphHandler.setInputAction(n,ln.MIDDLE_DOWN),e._morphHandler.setInputAction(n,ln.RIGHT_DOWN),e._morphHandler.setInputAction(n,ln.WHEEL)}}function B7(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 tLt=new he,nLt=new h,iLt=new N;function wMe(e,t){let n=e._scene,i=n.camera,r=Sse,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,tLt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,nLt),f=At.eastNorthUpToFixedFrame(u,t,iLt);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var rLt=new h,oLt=new h,sLt=new h,aLt=new h,cLt=new h,lLt=new h;function vse(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,rLt),a=h.clone(o.direction,oLt),c=h.clone(o.up,sLt),u=N.multiplyByPoint(Pr.TRANSFORM_2D_INVERSE,n.position,aLt),f=N.multiplyByPointAsVector(Pr.TRANSFORM_2D_INVERSE,n.direction,cLt),d=N.multiplyByPointAsVector(Pr.TRANSFORM_2D_INVERSE,n.up,lLt);function p(m){Eh(s,u,m.time,o.position),Eh(a,f,m.time,o.direction),Eh(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:Es.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){FMe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var uLt=new mn,IMe=new h,PMe=new h,DMe=new h,wse=new h,RMe=new h,OMe=new h;function fLt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Sse,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=wMe(e,n));let s;e._morphToOrthographic?(s=uLt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=SMe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),o.frustum=s;let a=BMe(o);oV(e,a);let c;e._morphToOrthographic?c=function(){vse(e,t,o,a)}:c=function(){NMe(e,t,o,function(){vse(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,wse),complete:function(){i._mode=re.MORPHING,c()}})):c()}function Eh(e,t,n,i){return h.lerp(e,t,n,i)}function MMe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof mn)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:Es.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var dLt=new h,hLt=new h,mLt=new h,Cse=new h,pLt=new h,gLt=new h,_Lt=new bs,yLt=new pn,ALt=new h,bLt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function xLt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,dLt),o=h.clone(i.direction,hLt),s=h.clone(i.up,mLt),a=h.negate(h.UNIT_Z,pLt),c=h.clone(h.UNIT_Y,gLt),u=Cse;if(t>0)h.clone(h.ZERO,Cse),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Cse);let A=yLt;N.multiplyByPoint(Pr.TRANSFORM_2D,r,A.origin),N.multiplyByPointAsVector(Pr.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,ALt);l(x)&&(N.multiplyByPoint(Pr.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=_Lt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=bLt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=kMe(d);oV(e,p);function g(A){Eh(r,u,A.time,i.position),Eh(o,a,A.time,i.direction),Eh(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:Es.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){MMe(e,t,d,m,p)}});e._currentTweens.push(y)}var vMe=new he,TLt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new bs},ELt={position:new h,direction:new h,up:new h,frustum:void 0},CLt=new h,vLt=new pn,SLt=new N,wLt=new h;function ILt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=TLt;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,vMe),i.mapProjection.project(vMe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=vLt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,wLt),m=At.eastNorthUpToFixedFrame(g,n,SLt);N.inverseTransformation(m,m),N.multiplyByPointAsVector(m,p,p),N.multiplyByPointAsVector(Pr.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,CLt);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(Pr.TRANSFORM_2D,o.position,o.position2D),N.multiplyByPointAsVector(Pr.TRANSFORM_2D,o.direction,o.direction2D),N.multiplyByPointAsVector(Pr.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=ELt;N.multiplyByPoint(Pr.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=kMe(c);oV(e,u);function f(){MMe(e,t,o,s,u)}LMe(e,t,o,f)}function NMe(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:Es.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function PLt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,wse),a=h.clone(n.direction,RMe),c=h.clone(n.up,OMe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,IMe),d=h.clone(o.direction,PMe),p=h.clone(o.up,DMe);f.z=s.z;function g(y){Eh(f,s,y.time,o.position),Eh(d,a,y.time,o.direction),Eh(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:Es.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():NMe(e,0,n,u)}function LMe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,IMe),a=h.clone(o.direction,PMe),c=h.clone(o.up,DMe),u=h.clone(n.position2D,wse),f=h.clone(n.direction2D,RMe),d=h.clone(n.up2D,OMe);function p(m){Eh(s,u,m.time,o.position),Eh(a,f,m.time,o.direction),Eh(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:Es.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){FMe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function FMe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Es.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function BMe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),B7(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 kMe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),B7(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 DLt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),B7(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 sV=cC;function k7(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(k7.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}}});k7.prototype.cancelTween=function(){this._tweens.remove(this)};function Qm(){this._tweens=[]}Object.defineProperties(Qm.prototype,{length:{get:function(){return this._tweens.length}}});Qm.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new k7(this);let t=e.duration/kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/kn.SECONDS_PER_MILLISECOND,r=e.easingFunction??Es.LINEAR_NONE,o=e.startObject,s=new $me(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 k7(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Qm.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})};Qm.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})};Qm.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})};Qm.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};Qm.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};Qm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Qm.prototype.get=function(e){return this._tweens[e]};Qm.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 lC=Qm;function cV(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=nr.LEFT_DRAG,this.zoomEventTypes=[nr.RIGHT_DRAG,nr.WHEEL,nr.PINCH],this.rotateEventTypes=nr.LEFT_DRAG,this.tiltEventTypes=[nr.MIDDLE_DRAG,nr.PINCH,{eventType:nr.LEFT_DRAG,modifier:Zr.CTRL},{eventType:nr.RIGHT_DRAG,modifier:Zr.CTRL}],this.lookEventTypes={eventType:nr.LEFT_DRAG,modifier:Zr.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 VM(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 lC,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 RLt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function OLt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var MLt=.4;function NLt(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<MLt){let g=RLt(p,i),m=e.getLastMovement(t,n);if(!l(m)||OLt(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 LLt(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 UMe=[];function mu(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(UMe[0]=n,n=UMe);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),LLt(e,o)):r<1&&NLt(s,f,d,r,i,e,o))}}var U7=new pn,FLt=new h,BLt=new U,kLt=new h,ULt=new U,zLt=new h,VLt=new h,jLt=new h,HLt=new h,JMe=new h,GLt=new h,WLt=new h,qLt=new h,YLt=new h,XLt=new h,KLt=new h,$Lt=new h,JLt=new h,ZLt=new h,QLt=new h,uC=new h,zMe=new h,VMe=new h,Ise={orientation:new Ic};function Fse(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=Ise.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,U7).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=ry(e,t,FLt)),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,kLt);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,U7).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,JMe);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=ULt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=ry(e,L,zLt);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=WLt;h.clone(A.position,C);let w=e._zoomWorldPosition,P=GLt;if(P=h.normalize(w,P),h.dot(P,R)<0)return;let M=QLt,F=XLt;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,uC),M);let V=KLt,B=$Lt;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=qLt;h.normalize(C,Ae);let fe=YLt;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,uC),F),h.multiplyByScalar(h.normalize(M,uC),h.magnitude(M)-m,M),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=JLt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,zMe),h.multiplyByScalar(F,Math.sin(ae),VMe),uC),Q,xe),h.add(C,xe,C),h.normalize(M,Ae),h.normalize(h.cross(Ae,fe,uC),F);let ge=ZLt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,zMe),h.multiplyByScalar(F,Math.sin(ae),VMe),uC),h.magnitude(M),ge),h.add(M,ge,M),h.clone(C,A.position),h.normalize(h.subtract(M,C,uC),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(Ise);return}else{let C=h.normalize(_,VLt),w=h.normalize(e._zoomWorldPosition,jLt),P=h.dot(w,C);if(P>0&&P<1){let M=D.acosClamped(P),F=h.cross(w,C,HLt),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=fr.worldToWindowCoordinates(y,e._zoomWorldPosition,BLt);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,U7):R=A.getPickRay(t,U7);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(Ise)}var eFt=new pn,tFt=new pn,nFt=new h;function iFt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,eFt).origin,s=r.getPickRay(n.endPosition,tFt).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,nFt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function jMe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Fse(e,t,n,e.zoomFactor,r.getMagnitude())}var rFt=new U,oFt=new U;function HMe(e,t,n){if(l(n.angleAndHeight)){sFt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=rFt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=oFt;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 sFt(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 aFt(e){let t=e._scene.mapMode2D===Xl.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(mu(e,e.enableTranslate,e.translateEventTypes,iFt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),mu(e,e.enableZoom,e.zoomEventTypes,jMe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&mu(e,e.enableRotate,e.tiltEventTypes,HMe,e.inertiaSpin,"_lastInertiaTiltMovement")):(mu(e,e.enableZoom,e.zoomEventTypes,jMe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&mu(e,e.enableRotate,e.translateEventTypes,HMe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ZMe=new pn,cFt=new h,lFt=new h;function ry(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,cFt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,ZMe),u=r.pickWorldCoordinates(c,i,a,lFt),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 uFt=new he;function q7(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,uFt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var fFt=new h;function QMe(e,t){let n=t.origin,i=t.direction,r=q7(e),o=h.normalize(n,fFt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function eNe(e,t,n,i){let r=h.distance(t.origin,n),o=q7(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 tNe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=q7(e))):r=q7(e),pn.getPoint(t,r,i)}var dFt=new U;function nNe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,dFt),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,Bse(e,t,e._strafeStartPosition),t.endPosition=n}var GMe=new pn,hFt=new pn,Pse=new h,mFt=new h,pFt=new h,gFt=new h,_Ft=new sn(h.UNIT_X,0),yFt=new U,AFt=new U;function bFt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){dd(e,t,n);return}if(e._strafing){nNe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,yFt),a=U.clone(n.endPosition,AFt),c=r.getPickRay(s,GMe),u=h.clone(h.ZERO,gFt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=ry(e,s,Pse),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=tNe(e,c,d,Pse)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Bse(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,_Ft);c=r.getPickRay(s,GMe);let g=yi.rayPlane(c,p,Pse),m=r.getPickRay(a,hFt),y=yi.rayPlane(m,p,mFt);if(!l(g)||!l(y)){e._looking=!0,dd(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,pFt),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 iNe=new U,j7=new pn,H7=new h,xFt=new h,rNe=new N,TFt=new N,EFt=new h,CFt=new sn(h.UNIT_X,0),Dse=new h,Mse=new he,oNe=new N,vFt=new Le,SFt=new $,G7=new h;function wFt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){dd(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,IFt(e,t,n)):PFt(e,t,n)}function IFt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=iNe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,j7),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,dd(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,H7);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,Mse);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,rNe),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,oNe);r._setTransform(b),fd(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 PFt(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,H7);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=ry(e,t,H7)),!l(s)){a=r.getPickRay(t,j7);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,dd(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,H7),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,j7)),eNe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=iNe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,j7);let d=h.clone(h.ZERO,EFt);d.x=s.x;let p=sn.fromPointNormal(d,c,CFt),g=yi.rayPlane(a,p,xFt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,Mse);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,rNe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Mse),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,TFt)):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,oNe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,Dse),Dse),R=h.dot(r.right,I);if(fd(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,fd(e,t,n,v,!0,!1),r.constrainedAxis=C}else fd(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,G7);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,Dse);if(e.enableCollisionDetection&&zse(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,vFt),M=$.fromQuaternion(P,SFt);$.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 sNe=new U,aNe=new pn,cNe=new h;function DFt(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=sNe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,aNe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=ry(e,a,cNe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=QMe(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)}Fse(e,t,n,e.zoomFactor,g)}function RFt(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))mu(e,e.enableRotate,e.rotateEventTypes,fd,e.inertiaSpin,"_lastInertiaSpinMovement"),mu(e,e.enableZoom,e.zoomEventTypes,uNe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),mu(e,e.enableTilt,e.tiltEventTypes,wFt,e.inertiaSpin,"_lastInertiaTiltMovement"),mu(e,e.enableTranslate,e.translateEventTypes,bFt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),mu(e,e.enableZoom,e.zoomEventTypes,DFt,e.inertiaZoom,"_lastInertiaZoomMovement"),mu(e,e.enableLook,e.lookEventTypes,dd),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var OFt=new pn,MFt=new sn(h.UNIT_X,0),NFt=new h,LFt=new h;function Bse(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,OFt),s=h.clone(r.direction,LFt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,MFt),c=yi.rayPlane(o,a,NFt);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 WMe=new h,lNe=new he,Nse=new h,Lse=new ee,FFt=new h,BFt=new h,kFt=new h;function UFt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){fd(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,FFt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)dd(e,t,n,u);else if(e._rotating)fd(e,t,n);else if(e._strafing)nNe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Nse,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Lse),Ose(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,lNe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=ry(e,n.startPosition,kFt);if(l(p)){let g,m=r.getPickRay(n.startPosition,ZMe);if(o)g=!0,tNe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,BFt);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,Bse(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Nse,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Lse),Ose(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,dd(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,WMe))?(Ose(e,t,n,e._ellipsoid),h.clone(WMe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,fd(e,t,n)):(e._looking=!0,dd(e,t,n,u));U.clone(t,e._rotateMousePosition)}function fd(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 Rse=se.clone(se.UNIT_W),qMe=se.clone(se.UNIT_W),z7=new h,MI=new h,V7=new h,YMe=new h,zFt=new U,VFt=new U,jFt=new U,HFt=new U,GFt=new pn;function Ose(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,zFt),a=U.clone(n.endPosition,VFt),c=i.cartesianToCartographic(o.positionWC,lNe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Rse),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=ry(e,s,Rse)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,MI),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),MI),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,HFt),y=U.subtract(a,s,jFt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,MI),b=h.normalize(o.positionWC,JMe),x=o.getPickRay(a,GFt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,V7),V7),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,V7);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,YMe);f=h.add(u,A,qMe),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,Rse),f=o.pickEllipsoid(a,i,qMe)),!l(u)||!l(f)){e._rotating=!0,fd(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,z7);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,MI),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,V7);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,YMe);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,z7);let L=h.cross(d,O,z7),_=h.dot(L,h.subtract(u,d,MI)),C=h.dot(L,h.subtract(f,d,MI)),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,z7);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var WFt=new h,qFt=new he,XMe=0;function uNe(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=sNe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,aNe),d,p=r.cartesianToCartographic(s.position,qFt).height,g=Math.abs(XMe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=ry(e,u,cNe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(XMe=y),c){let b=QMe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,WFt);Fse(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var fNe=new U,W7=new pn,aV=new h,YFt=new h,dNe=new N,XFt=new N,hNe=new N,KFt=new Le,$Ft=new $,kse=new he,Use=new h;function JFt(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,Use);dd(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,kse);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,QFt(e,t,n)):eBt(e,t,n)}var ZFt=new he;function QFt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,ZFt).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=fNe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,W7),d,p=yi.rayEllipsoid(f,i);if(l(p))d=pn.getPoint(f,p.start,aV);else if(a>e._minimumTrackBallHeight){let x=yi.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,kse);T.height=0,d=i.cartographicToCartesian(T,aV)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Use);dd(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,dNe),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,hNe);o._setTransform(g),fd(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 eBt(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,aV);else{if(a=ry(e,t,aV),!l(a)){if(c=o.getPickRay(t,W7),u=yi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,kse).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Use);dd(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,aV)}s&&(l(c)||(c=o.getPickRay(t,W7)),eNe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=fNe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,W7);let p=h.magnitude(a),g=h.fromElements(p,p,p,Nse),m=ee.fromCartesian3(g,Lse);if(u=yi.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=pn.getPoint(c,y,YFt),b=At.eastNorthUpToFixedFrame(a,i,dNe),x=At.eastNorthUpToFixedFrame(A,m,XFt),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,hNe);o._setTransform(x);let I=h.cross(A,o.positionWC,G7);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,fd(e,t,n,v,!0,!1),o.constrainedAxis=C}else fd(e,t,n,v,!0,!1);if(o._setTransform(b),fd(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,G7);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,G7);if(e.enableCollisionDetection&&zse(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,KFt),M=$.fromQuaternion(P,$Ft);$.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 tBt=new U,nBt=new U,KMe=new pn,$Me=new pn,iBt=new h,rBt=new h;function dd(e,t,n,i){let o=e._scene.camera,s=tBt;s.x=n.startPosition.x,s.y=0;let a=nBt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,KMe),u=o.getPickRay(a,$Me),f=0,d,p;o.frustum instanceof mn?(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,KMe),u=o.getPickRay(a,$Me),f=0,o.frustum instanceof mn?(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,iBt),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,rBt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function oBt(e){mu(e,e.enableRotate,e.rotateEventTypes,UFt,e.inertiaSpin,"_lastInertiaSpinMovement"),mu(e,e.enableZoom,e.zoomEventTypes,uNe,e.inertiaZoom,"_lastInertiaZoomMovement"),mu(e,e.enableTilt,e.tiltEventTypes,JFt,e.inertiaSpin,"_lastInertiaTiltMovement"),mu(e,e.enableLook,e.lookEventTypes,dd)}var sBt=new N,aBt=new he;function zse(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,sBt),c=h.magnitude(r.position),r._setTransform(N.IDENTITY));let u=aBt;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)))}cV.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 cBt=new h,lBt=new h;cV.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,cBt),c=h.clone(t.directionWC,lBt);if(i===re.SCENE2D?aFt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,RFt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,oBt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);zse(this,u)}this._aggregator.reset()};cV.prototype.isDestroyed=function(){return!1};cV.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var lV=cV;function Y7(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new aC(this._canvas,Je(e?.contextOptions)),this._canvases=[]}Y7.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)}}})};Y7.prototype.destroy=function(){this._context.destroy(),le(this)};Y7.prototype.isDestroyed=function(){return!1};var uV=Y7;function fV(e){let t=new Tc(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 uBt(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}fV.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};fV.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 uBt(i,r,t,n)};fV.prototype.isDestroyed=function(){return!1};fV.prototype.destroy=function(){return this._fb.destroy(),le(this)};var dV=fV;var hV={},fBt=new et(0,0,3,3),dBt=new U,hBt=new U,mBt=new pn,pBt=new h,gBt=3,_Bt=.1,mNe=9;function Vse(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function pNe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Vse(s)<=gBt&&(t=Math.min(t,s.depth));let n=t*(1+_Bt),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)=>Vse(a)<Vse(s)?a:s)}function gNe(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 jse(e,t,n){let i=dBt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,mBt);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,pBt);return h.add(r.origin,a,new h)}hV.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 dV(o));let a=s.snapFramebuffer,c=fBt;Cz(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(vz(e),u.length===0)return;let f=pNe(u);if(!l(f))return;let d=jse(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=hBt;g.x=t.x+f.x,g.y=t.y+f.y,Cz(e,g,c,mNe,mNe,{framebuffer:a,snap:!0});let m=a.end(c);vz(e);let y=gNe(m,f.object);p=l(y)?jse(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)}};hV._selectBestHit=pNe;hV._nearestSurfaceHit=gNe;hV._snapHitToWorld=jse;var mV=hV;var pV=`uniform sampler2D colorTexture; +`,s=new Ur({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new yf({name:"czm_edge_detection_composite",stages:[t,s]})}fs.createSilhouetteStage=function(e){let t=R4t(e),n=new Ur({name:"czm_silhouette_color_edges",fragmentShader:R4,uniforms:{silhouetteTexture:t.name}});return new yf({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:b4,uniforms:{contrast:128,brightness:-.3}}),t=yce("czm_bloom_blur"),n=new yf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ur({name:"czm_bloom_generate_composite",fragmentShader:y4,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 yf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};fs.createAmbientOcclusionStage=function(){let e=new Ur({name:"czm_ambient_occlusion_generate",fragmentShader:p4,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ur({name:"czm_ambient_occlusion_composite",fragmentShader:g4,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 yf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var O4t=`#define FXAA_QUALITY_PRESET 39 +${O4} +${S4}`;fs.createFXAAStage=function(){return new Ur({name:"czm_FXAA",fragmentShader:O4t,sampleMode:gd.LINEAR})};fs.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=m4,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+=C4,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+=v4,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+=D4,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+=I4,new Ur({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};fs.createAutoExposureStage=function(){return new QU};fs.createBlackAndWhiteStage=function(){return new Ur({name:"czm_black_and_white",fragmentShader:_4,uniforms:{gradations:5}})};fs.createBrightnessStage=function(){return new Ur({name:"czm_brightness",fragmentShader:A4,uniforms:{brightness:.5}})};fs.createNightVisionStage=function(){return new Ur({name:"czm_night_vision",fragmentShader:P4})};fs.createDepthViewStage=function(){return new Ur({name:"czm_depth_view",fragmentShader:T4})};fs.createLensFlareStage=function(){return new Ur({name:"czm_lens_flare",fragmentShader:w4,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 _d=fs;function yy(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function N4(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Ace(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[N4(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[N4(d)]=!0)}}}return i.name}function M4(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=M4(e,t,n,p,r):a=Ace(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=N4(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=N4(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[N4(i.get(p))]=!0}return a}function M4t(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=M4(e,t,n,i,void 0);a=M4(e,t,n,r,a),a=Ace(e,t,n,o,a),a=M4(e,t,n,e,a),Ace(e,t,n,s,a)}else M4(e,t,n,e,void 0);return n}function N4t(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 L4t(e,t){let n=M4t(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=N4t(e,i,n[i]))}function bce(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function F4t(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 ui({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}yy.prototype.updateDependencies=function(){this._updateDependencies=!0};yy.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)&&(bce(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&L4t(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,bce(this),F4t(this,e))};yy.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};yy.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};yy.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};yy.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};yy.prototype.isDestroyed=function(){return!1};yy.prototype.destroy=function(){return bce(this),le(this)};var zC=yy;var u2e={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(u2e);var Ay=u2e;var xce=[];function bu(){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=Ay.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new zC(this),o={},s=xce;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(bu.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 Tce(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 Ay.REINHARD:n=_d.createReinhardTonemappingStage(t);break;case Ay.MODIFIED_REINHARD:n=_d.createModifiedReinhardTonemappingStage(t);break;case Ay.FILMIC:n=_d.createFilmicTonemappingStage(t);break;case Ay.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,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 Tce(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}bu.prototype.add=function(e){let t=this._stageNames,n=xce;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};bu.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=xce;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};bu.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};bu.prototype.get=function(e){return Tce(this),this._stages[e]};bu.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};bu.prototype.getStageByName=function(e){return this._stageNames[e]};bu.prototype.update=function(e,t,n){Tce(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 Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.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)};bu.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function VC(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}bu.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return VC(t)};function K0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){K0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)K0(e.get(o),t,VC(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)K0(e.get(o),t,n,i,r)}bu.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&&(K0(a,e,A,n,i),A=VC(a)),p&&c.ready&&(K0(c,e,A,n,i),A=VC(c)),g&&u.ready&&K0(u,e,A,n,i),m&&f.ready&&(K0(f,e,A,n,i),A=VC(f));let b=A;if(o>0){K0(r[0],e,A,n,i);for(let x=1;x<o;++x)K0(r[x],e,VC(r[x-1]),n,i);b=VC(r[o-1])}y&&s.ready&&K0(s,e,b,n,i)};bu.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(gf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};bu.prototype.isDestroyed=function(){return!1};bu.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(),le(this)};var L4=bu;var Ece=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()}},Cce=Ece;var vce=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))}},F4=vce;function jC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}jC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};jC.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?p8t(this,e):T8t(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var B4t=new h,k4t=new h,U4t=new h,z4t=new h,V4t=new h,j4t=new h,H4t=new h,G4t=new he,W4t=new N,q4t=new Ji,Y4t=new gn,X4t={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};jC.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=B4t,r=k4t,o=U4t;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,H4t),d=At.eastNorthUpToFixedFrame(f,t,W4t);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,G4t),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=Y4t,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=q4t,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=X4t;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=C8t(a);B4(this,c),this._previousMode===re.SCENE2D?E8t(this,e,a,c):(a.position2D=N.multiplyByPoint(Or.TRANSFORM_2D,i,z4t),a.direction2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,r,V4t),a.up2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,j4t),n._mode=re.MORPHING,x2e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Ice={position:new h,direction:new h,up:new h,frustum:void 0},d2e=new Ji;jC.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)o8t(this,e,t);else{let i;e>0?(i=Ice,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=h2e(this,t);let r,o=n.camera;o.frustum instanceof gn?r=o.frustum.clone():(r=d2e,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let s=E2e(i);B4(this,s),wce(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};jC.prototype.isDestroyed=function(){return!1};jC.prototype.destroy=function(){return VW(this),le(this)};function B4(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ua(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 VW(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 K4t=new he,$4t=new h,J4t=new N;function h2e(e,t){let n=e._scene,i=n.camera,r=Ice,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,K4t);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,$4t),f=At.eastNorthUpToFixedFrame(u,t,J4t);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var Z4t=new h,Q4t=new h,e8t=new h,t8t=new h,n8t=new h,i8t=new h;function wce(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,Z4t),a=h.clone(o.direction,Q4t),c=h.clone(o.up,e8t),u=N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,n.position,t8t),f=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.direction,n8t),d=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.up,i8t);function p(m){Dh(s,u,m.time,o.position),Dh(a,f,m.time,o.direction),Dh(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:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){T2e(e,r,0,1,t,i)}});e._currentTweens.push(g)}var r8t=new gn,m2e=new h,p2e=new h,g2e=new h,Pce=new h,_2e=new h,y2e=new h;function o8t(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Ice,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=h2e(e,n));let s;e._morphToOrthographic?(s=r8t,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=d2e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),o.frustum=s;let a=E2e(o);B4(e,a);let c;e._morphToOrthographic?c=function(){wce(e,t,o,a)}:c=function(){b2e(e,t,o,function(){wce(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Pce),complete:function(){i._mode=re.MORPHING,c()}})):c()}function Dh(e,t,n,i){return h.lerp(e,t,n,i)}function A2e(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:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var s8t=new h,a8t=new h,c8t=new h,Sce=new h,l8t=new h,u8t=new h,f8t=new As,d8t=new pn,h8t=new h,m8t={position:void 0,direction:void 0,up:void 0,frustum:void 0};function p8t(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,s8t),o=h.clone(i.direction,a8t),s=h.clone(i.up,c8t),a=h.negate(h.UNIT_Z,l8t),c=h.clone(h.UNIT_Y,u8t),u=Sce;if(t>0)h.clone(h.ZERO,Sce),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Sce);let A=d8t;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,h8t);l(x)&&(N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=f8t;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=m8t;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=C2e(d);B4(e,p);function g(A){Dh(r,u,A.time,i.position),Dh(o,a,A.time,i.direction),Dh(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:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){A2e(e,t,d,m,p)}});e._currentTweens.push(y)}var f2e=new he,g8t={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new As},_8t={position:new h,direction:new h,up:new h,frustum:void 0},y8t=new h,A8t=new pn,b8t=new N,x8t=new h;function T8t(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=g8t;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,f2e),i.mapProjection.project(f2e,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=A8t;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,x8t),m=At.eastNorthUpToFixedFrame(g,n,b8t);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,y8t);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=_8t;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=C2e(c);B4(e,u);function f(){A2e(e,t,o,s,u)}x2e(e,t,o,f)}function b2e(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:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function E8t(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,Pce),a=h.clone(n.direction,_2e),c=h.clone(n.up,y2e);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,m2e),d=h.clone(o.direction,p2e),p=h.clone(o.up,g2e);f.z=s.z;function g(y){Dh(f,s,y.time,o.position),Dh(d,a,y.time,o.direction),Dh(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:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():b2e(e,0,n,u)}function x2e(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,m2e),a=h.clone(o.direction,p2e),c=h.clone(o.up,g2e),u=h.clone(n.position2D,Pce),f=h.clone(n.direction2D,_2e),d=h.clone(n.up2D,y2e);function p(m){Dh(s,u,m.time,o.position),Dh(a,f,m.time,o.direction),Dh(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:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){T2e(e,r,1,0,t,i)}});e._currentTweens.push(g)}function T2e(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Ls.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function E2e(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),VW(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 C2e(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),VW(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 C8t(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),VW(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 k4=jC;function jW(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(jW.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}}});jW.prototype.cancelTween=function(){this._tweens.remove(this)};function gp(){this._tweens=[]}Object.defineProperties(gp.prototype,{length:{get:function(){return this._tweens.length}}});gp.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new jW(this);let t=e.duration/kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/kn.SECONDS_PER_MILLISECOND,r=e.easingFunction??Ls.LINEAR_NONE,o=e.startObject,s=new kRe(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 jW(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};gp.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})};gp.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})};gp.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})};gp.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};gp.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};gp.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};gp.prototype.get=function(e){return this._tweens[e]};gp.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 HC=gp;function z4(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:to.CTRL},{eventType:cr.RIGHT_DRAG,modifier:to.CTRL}],this.lookEventTypes={eventType:cr.LEFT_DRAG,modifier:to.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 Iz(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 HC,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 v8t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function S8t(e){return U.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var w8t=.4;function I8t(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<w8t){let g=v8t(p,i),m=e.getLastMovement(t,n);if(!l(m)||S8t(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 P8t(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 v2e=[];function xu(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(v2e[0]=n,n=v2e);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),P8t(e,o)):r<1&&I8t(s,f,d,r,i,e,o))}}var HW=new pn,D8t=new h,R8t=new U,O8t=new h,M8t=new U,N8t=new h,L8t=new h,F8t=new h,B8t=new h,B2e=new h,k8t=new h,U8t=new h,z8t=new h,V8t=new h,j8t=new h,H8t=new h,G8t=new h,W8t=new h,q8t=new h,Y8t=new h,GC=new h,S2e=new h,w2e=new h,Dce={orientation:new wc};function kce(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=Dce.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=by(e,t,D8t)),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,O8t);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,B2e);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=M8t;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=by(e,L,N8t);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=U8t;h.clone(A.position,C);let w=e._zoomWorldPosition,P=k8t;if(P=h.normalize(w,P),h.dot(P,R)<0)return;let M=Y8t,F=j8t;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,GC),M);let V=H8t,B=G8t;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=z8t;h.normalize(C,Ae);let fe=V8t;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,GC),F),h.multiplyByScalar(h.normalize(M,GC),h.magnitude(M)-m,M),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=W8t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,S2e),h.multiplyByScalar(F,Math.sin(ae),w2e),GC),Q,xe),h.add(C,xe,C),h.normalize(M,Ae),h.normalize(h.cross(Ae,fe,GC),F);let ge=q8t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,S2e),h.multiplyByScalar(F,Math.sin(ae),w2e),GC),h.magnitude(M),ge),h.add(M,ge,M),h.clone(C,A.position),h.normalize(h.subtract(M,C,GC),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(Dce);return}else{let C=h.normalize(_,L8t),w=h.normalize(e._zoomWorldPosition,F8t),P=h.dot(w,C);if(P>0&&P<1){let M=D.acosClamped(P),F=h.cross(w,C,B8t),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=dr.worldToWindowCoordinates(y,e._zoomWorldPosition,R8t);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(Dce)}var X8t=new pn,K8t=new pn,$8t=new h;function J8t(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,X8t).origin,s=r.getPickRay(n.endPosition,K8t).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,$8t),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function I2e(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;kce(e,t,n,e.zoomFactor,r.getMagnitude())}var Z8t=new U,Q8t=new U;function P2e(e,t,n){if(l(n.angleAndHeight)){ejt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=Z8t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=Q8t;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 ejt(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 tjt(e){let t=e._scene.mapMode2D===Au.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(xu(e,e.enableTranslate,e.translateEventTypes,J8t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),xu(e,e.enableZoom,e.zoomEventTypes,I2e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&xu(e,e.enableRotate,e.tiltEventTypes,P2e,e.inertiaSpin,"_lastInertiaTiltMovement")):(xu(e,e.enableZoom,e.zoomEventTypes,I2e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&xu(e,e.enableRotate,e.translateEventTypes,P2e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var k2e=new pn,njt=new h,ijt=new h;function by(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,njt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,k2e),u=r.pickWorldCoordinates(c,i,a,ijt),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 rjt=new he;function $W(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,rjt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var ojt=new h;function U2e(e,t){let n=t.origin,i=t.direction,r=$W(e),o=h.normalize(n,ojt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function z2e(e,t,n,i){let r=h.distance(t.origin,n),o=$W(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 V2e(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=$W(e))):r=$W(e),pn.getPoint(t,r,i)}var sjt=new U;function j2e(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,sjt),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,Uce(e,t,e._strafeStartPosition),t.endPosition=n}var D2e=new pn,ajt=new pn,Rce=new h,cjt=new h,ljt=new h,ujt=new h,fjt=new sn(h.UNIT_X,0),djt=new U,hjt=new U;function mjt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Ad(e,t,n);return}if(e._strafing){j2e(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,djt),a=U.clone(n.endPosition,hjt),c=r.getPickRay(s,D2e),u=h.clone(h.ZERO,ujt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=by(e,s,Rce),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=V2e(e,c,d,Rce)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Uce(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,fjt);c=r.getPickRay(s,D2e);let g=_i.rayPlane(c,p,Rce),m=r.getPickRay(a,ajt),y=_i.rayPlane(m,p,cjt);if(!l(g)||!l(y)){e._looking=!0,Ad(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,ljt),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 H2e=new U,qW=new pn,YW=new h,pjt=new h,G2e=new N,gjt=new N,_jt=new h,yjt=new sn(h.UNIT_X,0),Oce=new h,Lce=new he,W2e=new N,Ajt=new Le,bjt=new $,XW=new h;function xjt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Ad(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Tjt(e,t,n)):Ejt(e,t,n)}function Tjt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=H2e;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,qW),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,Ad(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,YW);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,Lce);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,G2e),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,W2e);r._setTransform(b),yd(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 Ejt(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,YW);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=by(e,t,YW)),!l(s)){a=r.getPickRay(t,qW);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,Ad(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,YW),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,qW)),z2e(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=H2e;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,qW);let d=h.clone(h.ZERO,_jt);d.x=s.x;let p=sn.fromPointNormal(d,c,yjt),g=_i.rayPlane(a,p,pjt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,Lce);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,G2e),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Lce),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,gjt)):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,W2e);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,Oce),Oce),R=h.dot(r.right,I);if(yd(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,yd(e,t,n,v,!0,!1),r.constrainedAxis=C}else yd(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,XW);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,Oce);if(e.enableCollisionDetection&&jce(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,Ajt),M=$.fromQuaternion(P,bjt);$.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 q2e=new U,Y2e=new pn,X2e=new h;function Cjt(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=q2e,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,Y2e),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=by(e,a,X2e));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=U2e(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)}kce(e,t,n,e.zoomFactor,g)}function vjt(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))xu(e,e.enableRotate,e.rotateEventTypes,yd,e.inertiaSpin,"_lastInertiaSpinMovement"),xu(e,e.enableZoom,e.zoomEventTypes,$2e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),xu(e,e.enableTilt,e.tiltEventTypes,xjt,e.inertiaSpin,"_lastInertiaTiltMovement"),xu(e,e.enableTranslate,e.translateEventTypes,mjt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),xu(e,e.enableZoom,e.zoomEventTypes,Cjt,e.inertiaZoom,"_lastInertiaZoomMovement"),xu(e,e.enableLook,e.lookEventTypes,Ad),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var Sjt=new pn,wjt=new sn(h.UNIT_X,0),Ijt=new h,Pjt=new h;function Uce(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,Sjt),s=h.clone(r.direction,Pjt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,wjt),c=_i.rayPlane(o,a,Ijt);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 R2e=new h,K2e=new he,Fce=new h,Bce=new ee,Djt=new h,Rjt=new h,Ojt=new h;function Mjt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){yd(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,Djt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Ad(e,t,n,u);else if(e._rotating)yd(e,t,n);else if(e._strafing)j2e(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Fce,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Bce),Nce(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,K2e).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=by(e,n.startPosition,Ojt);if(l(p)){let g,m=r.getPickRay(n.startPosition,k2e);if(o)g=!0,V2e(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,Rjt);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,Uce(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Fce,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Bce),Nce(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Ad(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,R2e))?(Nce(e,t,n,e._ellipsoid),h.clone(R2e,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,yd(e,t,n)):(e._looking=!0,Ad(e,t,n,u));U.clone(t,e._rotateMousePosition)}function yd(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 Mce=se.clone(se.UNIT_W),O2e=se.clone(se.UNIT_W),GW=new h,WP=new h,WW=new h,M2e=new h,Njt=new U,Ljt=new U,Fjt=new U,Bjt=new U,kjt=new pn;function Nce(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,Njt),a=U.clone(n.endPosition,Ljt),c=i.cartesianToCartographic(o.positionWC,K2e).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Mce),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=by(e,s,Mce)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,WP),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),WP),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,Bjt),y=U.subtract(a,s,Fjt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,WP),b=h.normalize(o.positionWC,B2e),x=o.getPickRay(a,kjt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,WW),WW),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,WW);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,M2e);f=h.add(u,A,O2e),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,Mce),f=o.pickEllipsoid(a,i,O2e)),!l(u)||!l(f)){e._rotating=!0,yd(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,GW);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,WP),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,WW);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,M2e);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,GW);let L=h.cross(d,O,GW),_=h.dot(L,h.subtract(u,d,WP)),C=h.dot(L,h.subtract(f,d,WP)),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,GW);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var Ujt=new h,zjt=new he,N2e=0;function $2e(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=q2e,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,Y2e),d,p=r.cartesianToCartographic(s.position,zjt).height,g=Math.abs(N2e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=by(e,u,X2e));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(N2e=y),c){let b=U2e(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,Ujt);kce(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var J2e=new U,KW=new pn,U4=new h,Vjt=new h,Z2e=new N,jjt=new N,Q2e=new N,Hjt=new Le,Gjt=new $,zce=new he,Vce=new h;function Wjt(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,Vce);Ad(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,zce);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Yjt(e,t,n)):Xjt(e,t,n)}var qjt=new he;function Yjt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,qjt).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=J2e;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,KW),d,p=_i.rayEllipsoid(f,i);if(l(p))d=pn.getPoint(f,p.start,U4);else if(a>e._minimumTrackBallHeight){let x=_i.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,zce);T.height=0,d=i.cartographicToCartesian(T,U4)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Vce);Ad(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,Z2e),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,Q2e);o._setTransform(g),yd(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 Xjt(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,U4);else{if(a=by(e,t,U4),!l(a)){if(c=o.getPickRay(t,KW),u=_i.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,zce).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Vce);Ad(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,U4)}s&&(l(c)||(c=o.getPickRay(t,KW)),z2e(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=J2e;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,KW);let p=h.magnitude(a),g=h.fromElements(p,p,p,Fce),m=ee.fromCartesian3(g,Bce);if(u=_i.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=pn.getPoint(c,y,Vjt),b=At.eastNorthUpToFixedFrame(a,i,Z2e),x=At.eastNorthUpToFixedFrame(A,m,jjt),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,Q2e);o._setTransform(x);let I=h.cross(A,o.positionWC,XW);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,yd(e,t,n,v,!0,!1),o.constrainedAxis=C}else yd(e,t,n,v,!0,!1);if(o._setTransform(b),yd(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,XW);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,XW);if(e.enableCollisionDetection&&jce(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,Hjt),M=$.fromQuaternion(P,Gjt);$.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 Kjt=new U,$jt=new U,L2e=new pn,F2e=new pn,Jjt=new h,Zjt=new h;function Ad(e,t,n,i){let o=e._scene.camera,s=Kjt;s.x=n.startPosition.x,s.y=0;let a=$jt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,L2e),u=o.getPickRay(a,F2e),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,L2e),u=o.getPickRay(a,F2e),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,Jjt),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,Zjt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function Qjt(e){xu(e,e.enableRotate,e.rotateEventTypes,Mjt,e.inertiaSpin,"_lastInertiaSpinMovement"),xu(e,e.enableZoom,e.zoomEventTypes,$2e,e.inertiaZoom,"_lastInertiaZoomMovement"),xu(e,e.enableTilt,e.tiltEventTypes,Wjt,e.inertiaSpin,"_lastInertiaTiltMovement"),xu(e,e.enableLook,e.lookEventTypes,Ad)}var e6t=new N,t6t=new he;function jce(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,e6t),c=h.magnitude(r.position),r._setTransform(N.IDENTITY));let u=t6t;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)))}z4.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 n6t=new h,i6t=new h;z4.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,n6t),c=h.clone(t.directionWC,i6t);if(i===re.SCENE2D?tjt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,vjt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,Qjt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);jce(this,u)}this._aggregator.reset()};z4.prototype.isDestroyed=function(){return!1};z4.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var V4=z4;function j4(e){let t=new Ac(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 r6t(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}j4.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};j4.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 r6t(i,r,t,n)};j4.prototype.isDestroyed=function(){return!1};j4.prototype.destroy=function(){return this._fb.destroy(),le(this)};var H4=j4;var G4={},o6t=new et(0,0,3,3),s6t=new U,a6t=new U,c6t=new pn,l6t=new h,u6t=3,f6t=.1,eke=9;function Hce(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function tke(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Hce(s)<=u6t&&(t=Math.min(t,s.depth));let n=t*(1+f6t),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)=>Hce(a)<Hce(s)?a:s)}function nke(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 Gce(e,t,n){let i=s6t;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,c6t);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,l6t);return h.add(r.origin,a,new h)}G4.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 H4(o));let a=s.snapFramebuffer,c=o6t;l4(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(u4(e),u.length===0)return;let f=tke(u);if(!l(f))return;let d=Gce(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=a6t;g.x=t.x+f.x,g.y=t.y+f.y,l4(e,g,c,eke,eke,{framebuffer:a,snap:!0});let m=a.end(c);u4(e);let y=nke(m,f.object);p=l(y)?Gce(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)}};G4._selectBestHit=tke;G4._nearestSurfaceHit=nke;G4._snapHitToWorld=Gce;var W4=G4;var q4=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -12489,7 +12490,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 gV=`uniform sampler2D colorTexture; +`;var Y4=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -12510,14 +12511,14 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function oy(){this._sceneFramebuffer=new ZE;let e=.125,t=new Array(6);t[0]=new Ur({fragmentShader:nf,textureScale:e,forcePowerOfTwo:!0,sampleMode:ld.LINEAR});let n=t[1]=new Ur({fragmentShader:gV,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:Ab,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:Ab,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:nf,sampleMode:ld.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new Ur({fragmentShader:pV,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new uf({stages:t});let r=new iC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}oy.prototype.get=function(e){return this._stages.get(e)};oy.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 yBt=new se,_Ne=new U,ABt=new U,yNe=new N;function bBt(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,yNe),u=N.multiplyByPoint(o,r,yBt),f=At.pointToGLWindowCoordinates(s,c,r,_Ne);u.x+=D.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=ABt;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,yNe),f=At.pointToGLWindowCoordinates(s,c,r,_Ne),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)}oy.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};oy.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),bBt(this,t,n),r};oy.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)};oy.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(nf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};oy.prototype.isDestroyed=function(){return!1};oy.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var _V=oy;function fC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}fC.fromKeyframeNode=function(e,t,n,i){let r=new fC(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=xBt(e,s,n),r._orientedBoundingBox=EBt(e,o,n,r._orientedBoundingBox),r};function xBt(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 ANe=new h,TBt=new h;function EBt(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,ANe),d=h.divideComponents(h.subtract(f,e._paddingBefore,ANe),e.dimensions,TBt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(fC.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()}}});fC.prototype.hasProperty=function(e){return l(this._metadata[e])};fC.prototype.getNames=function(){return Object.keys(this._metadata)};fC.prototype.getProperty=function(e){return this._metadata[e]};var yV=fC;function Ch(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 CBt=new h;Ch.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,CBt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Ch.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 Ch(g,m,y,A,this,e,this.dimensions))};Ch.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Ch.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 bNe={keyframe:0};function AV(e,t){return bNe.keyframe=e,wr(t,bNe,Hr.searchComparator)}Ch.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=vBt(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=xNe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=xNe(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 vBt(e,t){let n=AV(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function xNe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Ch.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Ch.prototype.createKeyframeNode=function(e){let t=AV(e,this.keyframeNodes);if(t<0){t=~t;let n=new Hr(this,e);this.keyframeNodes.splice(t,0,n)}};Ch.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=AV(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=AV(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};Ch.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=AV(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};Ch.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 bV=Ch;function bb(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 QU(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 bV(0,0,0,0,void 0,d,o),this._priorityQueue=new p_({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,Hse(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:$n.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}bb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Hse(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,Hse(e,t,r-1,i+1),Hse(e,r+1,n,i+1)}bb.simultaneousRequestCountMaximum=50;bb.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:$n.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&&TNe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();IBt(this,e),PBt(this,e);let m=xn();NBt(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;MBt(this,e,b,x,T)}};bb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};bb.prototype.isDestroyed=function(){return!1};bb.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(),le(this)};function TNe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];TNe(e,i)}}function SBt(e,t){if(e._simultaneousRequestCount>=bb.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 wBt(e){return e/(1+e)}function IBt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),ENe(e.rootNode,ea.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 PBt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(DBt);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&&SBt(e,f),f.state===Hr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!RBt(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 DBt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function RBt(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 ENe(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===ea.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=wBt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+OBt(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];ENe(R,t,n,i)}}function OBt(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 MBt(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 X7={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function NBt(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]=X7.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=LBt(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]=X7.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?X7.LEAF:X7.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),FBt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&BBt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function LBt(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 FBt(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 BBt(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 xV=bb;function V0(e){e=e??H.EMPTY_OBJECT;let{provider:t=V0.DefaultProvider,modelMatrix:n=N.IDENTITY,customShader:i=kv(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Em,this._calculateStatistics=o;let{shape:s,minBounds:a=hc.getMinBounds(s),maxBounds:c=hc.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=kBt(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??V0.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 Am,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=hc.getShapeConstructor(s);this._shape=new m,vNe(this),this._shapeVisible=SNe(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]}}UBt(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 kBt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===Vp.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function UBt(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(V0.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){Ts.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=kv(this._provider);this._customShader=r??V0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var zBt=new se,VBt=new se,jBt=new N,HBt=new N,GBt=new h,WBt=new se;V0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){ZBt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=vNe(this),o=JBt(this,e);if((r||o)&&(this._shapeVisible=SNe(this),c2t(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=l2t(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&&_2t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),u2t(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&&(RM(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=h2t(p,d,VBt);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=XBt(this,n.cameraPositionLocal,WBt);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,qBt(this),YBt(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 qBt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function YBt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function XBt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,GBt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var KBt=new h,Gse=new h,$Bt=new he;function JBt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function ZBt(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 xV(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,a2t(e._traversal,i)}function vNe(e){return TV(e,"_modelMatrix","_modelMatrixOld")+TV(e,"_minBounds","_minBoundsOld")+TV(e,"_maxBounds","_maxBoundsOld")+TV(e,"_minClippingBounds","_minClippingBoundsOld")+TV(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function TV(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var QBt=new h,e2t=new h,t2t=new h,n2t=new h,i2t=new N,r2t=new N;function SNe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,QBt),r=h.clone(e._maxBounds,e2t),o=h.clone(e._minClippingBounds,t2t),s=h.clone(e._maxClippingBounds,n2t),a=N.clone(e._modelMatrix,i2t);if(e.shape===hc.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,KBt);N.multiplyByScale(a,m,a),N.multiplyByTranslation(a,s2t(e),a)}let c=e._provider,u=c.shapeTransform??N.IDENTITY,f=c.globalTransform??N.IDENTITY,d=N.multiplyTransformation(f,a,r2t);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 o2t=new h;function s2t(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=N.IDENTITY,globalTransform:r=N.IDENTITY}=e._provider,o=N.getTranslation(i,Gse),s=N.multiplyByPoint(e._modelMatrix,o,Gse),a=N.multiplyByPoint(r,s,Gse),u=ee.WGS84.cartesianToCartographic(a,$Bt),f=0;l(u)&&(f=u.height);let d=Ar.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,o2t)}function a2t(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 c2t(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 l2t(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 u2t(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)}V0.prototype.isDestroyed=function(){return!1};V0.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(),le(this)};var CNe=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)),f2t=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),d2t=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function h2t(e,t,n){let i=N.fromRotationTranslation(e.halfAxes,e.center,jBt),r=N.multiply(t,i,HBt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=d2t,d=CNe.length;for(u=0;u<d;u++)N.multiplyByVector(r,CNe[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=f2t[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,zBt),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 Wse=3e7,m2t=new h(Wse,0,0),p2t=new h(0,Wse,0),g2t=new h(0,0,Wse);function _2t(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:rr.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,m2t,z.RED,a),r(h.ZERO,p2t,z.LIME,a),r(h.ZERO,g2t,z.BLUE,a),i.update(t)}V0.DefaultCustomShader=new zp({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function xy(){this._sceneFramebuffer=new LC;let e=.125,t=new Array(6);t[0]=new Ur({fragmentShader:gf,textureScale:e,forcePowerOfTwo:!0,sampleMode:gd.LINEAR});let n=t[1]=new Ur({fragmentShader:Y4,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:Vb,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:Vb,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:gf,sampleMode:gd.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new Ur({fragmentShader:q4,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new yf({stages:t});let r=new zC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}xy.prototype.get=function(e){return this._stages.get(e)};xy.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 d6t=new se,ike=new U,h6t=new U,rke=new N;function m6t(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,rke),u=N.multiplyByPoint(o,r,d6t),f=At.pointToGLWindowCoordinates(s,c,r,ike);u.x+=D.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=h6t;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,rke),f=At.pointToGLWindowCoordinates(s,c,r,ike),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)}xy.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};xy.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),m6t(this,t,n),r};xy.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)};xy.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(gf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};xy.prototype.isDestroyed=function(){return!1};xy.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var X4=xy;function WC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Qt}WC.fromKeyframeNode=function(e,t,n,i){let r=new WC(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=p6t(e,s,n),r._orientedBoundingBox=_6t(e,o,n,r._orientedBoundingBox),r};function p6t(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 oke=new h,g6t=new h;function _6t(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,oke),d=h.divideComponents(h.subtract(f,e._paddingBefore,oke),e.dimensions,g6t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(WC.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()}}});WC.prototype.hasProperty=function(e){return l(this._metadata[e])};WC.prototype.getNames=function(){return Object.keys(this._metadata)};WC.prototype.getProperty=function(e){return this._metadata[e]};var K4=WC;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 Qt,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var y6t=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,y6t),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 ske={keyframe:0};function $4(e,t){return ske.keyframe=e,vr(t,ske,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=A6t(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=ake(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=ake(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 A6t(e,t){let n=$4(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function ake(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=$4(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=$4(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=$4(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=$4(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 J4=Rh;function jb(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 GV(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 J4(0,0,0,0,void 0,d,o),this._priorityQueue=new iy({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,Wce(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 Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}jb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Wce(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,Wce(e,t,r-1,i+1),Wce(e,r+1,n,i+1)}jb.simultaneousRequestCountMaximum=50;jb.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 Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Zn.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&&cke(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();T6t(this,e),E6t(this,e);let m=xn();I6t(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;w6t(this,e,b,x,T)}};jb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};jb.prototype.isDestroyed=function(){return!1};jb.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(),le(this)};function cke(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];cke(e,i)}}function b6t(e,t){if(e._simultaneousRequestCount>=jb.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 x6t(e){return e/(1+e)}function T6t(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),lke(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 E6t(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(C6t);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&&b6t(e,f),f.state===Hr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!v6t(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 C6t(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function v6t(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 lke(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=x6t(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+S6t(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];lke(R,t,n,i)}}function S6t(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 w6t(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 JW={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function I6t(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]=JW.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=P6t(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]=JW.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?JW.LEAF:JW.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),D6t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&R6t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function P6t(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 D6t(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 R6t(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 Z4=jb;function $0(e){e=e??H.EMPTY_OBJECT;let{provider:t=$0.DefaultProvider,modelMatrix:n=N.IDENTITY,customShader:i=bP(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Im,this._calculateStatistics=o;let{shape:s,minBounds:a=xc.getMinBounds(s),maxBounds:c=xc.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=O6t(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??$0.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 Em,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=xc.getShapeConstructor(s);this._shape=new m,fke(this),this._shapeVisible=dke(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]}}M6t(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 O6t(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===U0.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function M6t(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($0.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){bs.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=bP(this._provider);this._customShader=r??$0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var N6t=new se,L6t=new se,F6t=new N,B6t=new N,k6t=new h,U6t=new se;$0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){q6t(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=fke(this),o=W6t(this,e);if((r||o)&&(this._shapeVisible=dke(this),nHt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=iHt(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&&fHt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),rHt(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&&(Ez(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=aHt(p,d,L6t);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=j6t(this,n.cameraPositionLocal,U6t);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,z6t(this),V6t(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 z6t(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function V6t(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function j6t(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,k6t),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var H6t=new h,qce=new h,G6t=new he;function W6t(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function q6t(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 Z4(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,tHt(e._traversal,i)}function fke(e){return Q4(e,"_modelMatrix","_modelMatrixOld")+Q4(e,"_minBounds","_minBoundsOld")+Q4(e,"_maxBounds","_maxBoundsOld")+Q4(e,"_minClippingBounds","_minClippingBoundsOld")+Q4(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function Q4(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var Y6t=new h,X6t=new h,K6t=new h,$6t=new h,J6t=new N,Z6t=new N;function dke(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,Y6t),r=h.clone(e._maxBounds,X6t),o=h.clone(e._minClippingBounds,K6t),s=h.clone(e._maxClippingBounds,$6t),a=N.clone(e._modelMatrix,J6t);if(e.shape===xc.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,H6t);N.multiplyByScale(a,m,a),N.multiplyByTranslation(a,eHt(e),a)}let c=e._provider,u=c.shapeTransform??N.IDENTITY,f=c.globalTransform??N.IDENTITY,d=N.multiplyTransformation(f,a,Z6t);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 Q6t=new h;function eHt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=N.IDENTITY,globalTransform:r=N.IDENTITY}=e._provider,o=N.getTranslation(i,qce),s=N.multiplyByPoint(e._modelMatrix,o,qce),a=N.multiplyByPoint(r,s,qce),u=ee.WGS84.cartesianToCartographic(a,G6t),f=0;l(u)&&(f=u.height);let d=Ar.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,Q6t)}function tHt(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 nHt(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 iHt(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 rHt(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)}$0.prototype.isDestroyed=function(){return!1};$0.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(),le(this)};var uke=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)),oHt=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),sHt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function aHt(e,t,n){let i=N.fromRotationTranslation(e.halfAxes,e.center,F6t),r=N.multiply(t,i,B6t),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=sHt,d=uke.length;for(u=0;u<d;u++)N.multiplyByVector(r,uke[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=oHt[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,N6t),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 Yce=3e7,cHt=new h(Yce,0,0),lHt=new h(0,Yce,0),uHt=new h(0,0,Yce);function fHt(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:Qi.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,cHt,z.RED,a),r(h.ZERO,lHt,z.LIME,a),r(h.ZERO,uHt,z.BLUE,a),i.update(t)}$0.DefaultCustomShader=new k0({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 wNe(){this.shape=hc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}wNe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new LT({metadata:[new Float32Array(1)]});return Promise.resolve(n)};V0.DefaultProvider=new wNe;var xb=V0;var $7=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ai(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof uV;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Je(e.contextOptions);this._context=new aC(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=Jn(),this._jobScheduler=new $U,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new LA(o,new ik(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new Qz(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new l3,this._primitives=new wl({countReferences:r}),this._groundPrimitives=new wl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Ai.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new lC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Ck(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 sV(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new rV,this._minimumDisableDepthTestDistance=0,this._debugInspector=new mk,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 zi(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 fx,this.fog=new kk,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Pr.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Pr(this),this.shadowMap=new Q_({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 Ow,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new $z,this._brdfLutGenerator=new UO,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new lV(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Xl.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($7(this)),this._removeTaskProcessorListenerCallback=Kn.taskCompletedEvent.addEventListener($7(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Pr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Pr(this),this.preloadFlightCullingVolume=void 0,this._picking=new Sz(this),this._defaultView=new eC(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 iy,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,MNe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}Ai.defaultLogDepthBuffer=!0;function y2t(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($7(e))),n.push(t.terrainProviderChanged.addEventListener($7(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ai.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 um.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,y2t(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 Pr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new vk(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}}});Ai.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 A2t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function INe(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=wm.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=wm.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=wm.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=wm.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=wm.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Q_.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))}Ai.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&&A2t(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=Q_.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=wm.createLogDepthCommand(e,o,t.logDepth),INe(this,t.logDepth.command,s)),(d||m)&&INe(this,e,s)};var b2t=new rh({pass:so.RENDER}),qse=new rh({pass:so.PRELOAD}),Yse=new rh({pass:so.PRELOAD_FLIGHT}),x2t=new rh({pass:so.REQUEST_RENDER_MODE_DEFER_CHECK}),PNe=new ue,Xse;function T2t(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return PNe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Xse=Jz.fromBoundingSphere(PNe,e.camera.positionWC,Xse),Xse}Ai.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 MNe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}Ai.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=T2t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof mn||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=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),Ow.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};Ai.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 K7=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);K7=N.inverseTransformation(K7,K7);function E2t(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(K7,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=Xa.createGeometry(new Xa({radii:new h(f,f,f),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromTranslation(a)):(c=Lc.createGeometry(Lc.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 Bt({geometry:Gn.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=wm.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 pu(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)&&E2t(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 DNe(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 NNe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var C2t=new h;function RNe(e,t){let n=h.subtract(e,t,C2t),i=Math.max(0,h.magnitude(n));return i*i}function v2t(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return RNe(r.center,n)-RNe(i.center,n)}function S2t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function w2t(e,t,n,i,r){f0(i,NNe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function I2t(e,t,n,i,r){f0(i,S2t,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function P2t(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],f0(i,NNe,e.camera.positionWC);for(let r=0;r<i.length;++r)pu(i[r],e,t)}function D2t(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],f0(i,v2t,e.camera.positionWC);for(let r=0;r<i.length;++r)pu(i[r],e,t)}var R2t=new Ki,O2t=new Yl,M2t=new mn,N2t=new bs;function L2t(e){let{frustum:t}=e;return l(t.fov)?t.clone(R2t):l(t.infiniteProjectionMatrix)?t.clone(O2t):l(t.width)?t.clone(M2t):t.clone(N2t)}function F2t(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?w2t:I2t}function B2t(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=F2t(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,pu,t,f,c)}function k2t(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,pu,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,pu,t,n)}function U2t(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)pu(r[s],e,t);t.framebuffer=i}function z2t(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)pu(a[d],e,t);t.framebuffer=u}}function V2t(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)pu(i[o],e,t)}function $se(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=L2t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||j2t(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)pu(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)DNe(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,pu,A,e,t)):L(P,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(P,pu,A,e,t)):L(P,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let M;if(U2t(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(z2t(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),P2t(e,t,P),L(P,Ie.OPAQUE),V2t(e,t,P),D2t(e,t,P),w!==0&&e.mode!==re.SCENE2D&&(s.near=P.near,o.updateFrustum(s)),B2t(e,t,P),k2t(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,DNe,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 j2t(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&pu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&pu(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)?pu(o[s],e,t):o.splice(s,1)}}function LNe(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 H2t(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 G2t(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 FNe(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;G2t(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];pu(A,e,d.passState)}}}}var W2t=new h;Ai.prototype.updateAndExecuteCommands=function(e,t){okt(this,e,t),this._environmentState.useWebVR?q2t(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Xl.ROTATE?Tb(!0,this,e):tkt(this,e)};function q2t(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;kNe(e),n.createPotentiallyVisibleSet(e),LNe(e),o||FNe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Pr.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,W2t);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,$se(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,$se(e,t),Pr.clone(a,i)}var Y2t=new he(Math.PI,D.PI_OVER_TWO),X2t=new h,K2t=new h,$2t=new N,J2t=new N,Z2t=new h,Q2t=new h,ekt=new et;function tkt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,ekt);t.viewport=s;let a=Y2t,c=X2t;e.mapProjection.project(a,c);let f=h.clone(i.position,K2t),d=N.clone(i.transform,J2t),p=i.frustum.clone();i._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,$2t),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,Z2t),b=At.pointToGLWindowCoordinates(m,g,A,Q2t);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)Tb(!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),Tb(!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),Tb(!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),Tb(!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),Tb(!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),Tb(!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),Tb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function Tb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),kNe(t),i.createPotentiallyVisibleSet(t),e&&(LNe(t),r||FNe(t)),$se(t,n)}var ONe=new ea;function BNe(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 wl){BNe(o,t,n);continue}o.show&&e_.isSupported(o)&&As(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function nkt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;BNe(e._primitives,n,i)}Ai.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 mn||!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(cg.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=ONe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=ONe,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 um(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),nkt(this,e)};function ikt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new d0({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 rkt(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 kNe(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,ikt(e),rkt(e),e._globe&&e._globe.render(t)}function okt(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 _V: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)}Ai.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 skt(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 akt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function UNe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof wl){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=UNe(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}Ai.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=ckt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function ckt(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=UNe(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 Kse=new he;Ai.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,Kse);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(Kse.height=m,t(Kse))},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 lkt(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}Ai.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=akt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=lkt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function ukt(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 J_({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 fkt(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 dkt(e){e.primitives.postPassesUpdate(e._frameState),Kc.update()}var hkt=new z;function mkt(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=b2t;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,hkt),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 iy?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,H2t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function dC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function pkt(e){return e._picking.updateMostDetailedRayPicks(e)}Ai.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,LA.maximumFrameNumber,1);MNe(this,r,e),t.newFrame=!0}dC(this,fkt),this.primitives.show&&(dC(this,pkt),dC(this,gkt),dC(this,_kt),i||dC(this,ykt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),dC(this,mkt)),ukt(this,i),dC(this,dkt),skt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ai.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ai.prototype.requestRender=function(){this._renderRequested=!0};Ai.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};Ai.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};Ai.prototype.snap=function(e,t){return mV.snap(this,e,t)};Ai.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};Ai.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof xb))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 yV.fromKeyframeNode(r,s,c,a)};Ai.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=jk(s,t,n,i);if(!l(a))return;let c=Hk(o,n,i);if(!l(c))return;let u=new pz(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};Ai.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Ai.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ai.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ai.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function gkt(e){let t=e._frameState;qse.camera=t.camera,qse.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,qse)}function _kt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;Yse.camera=e.preloadFlightCamera,Yse.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Yse)}function ykt(e){e.primitives.updateForPass(e._frameState,x2t)}Ai.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ai.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ai.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ai.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ai.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ai.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ai.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ai.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ai.prototype.cartesianToCanvasCoordinates=function(e,t){return fr.worldToWindowCoordinates(this,e,t)};Ai.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ai.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};Ai.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};Ai.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function Akt(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()})}Ai.prototype.setTerrain=function(e){return Akt(this,e),e};Ai.prototype.isDestroyed=function(){return!1};Ai.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),le(this)};var EV=Ai;var sy={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};sy.validate=function(e){return e===sy.COMPLETE||e===sy.BELOW_ELLIPSOID_HORIZON||e===sy.ABOVE_ELLIPSOID_HORIZON};sy.toString=function(e){switch(e){case sy.COMPLETE:return"COMPLETE";case sy.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case sy.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var NI=sy;var LI=`float interpolateByDistance(vec4 nearFarScalar, float distance) +}`});function hke(){this.shape=xc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}hke.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new mC({metadata:[new Float32Array(1)]});return Promise.resolve(n)};$0.DefaultProvider=new hke;var Hb=$0;var QW=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ai(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof TU;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Je(e.contextOptions);this._context=new $E(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=$n(),this._jobScheduler=new jV,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new kA(o,new jz(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new pU(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new OV,this._primitives=new xl({countReferences:r}),this._groundPrimitives=new xl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Ai.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new HC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new iV(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new z,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:Ge.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new k4(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new F4,this._minimumDisableDepthTestDistance=0,this._debugInspector=new Kz,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 cT,this.fog=new uV,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 gy({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 UP,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new L4,this._brdfLutGenerator=new nz,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new V4(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Au.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(QW(this)),this._removeTaskProcessorListenerCallback=Jn.taskCompletedEvent.addEventListener(QW(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 f4(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 Q_,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,Ake(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}Ai.defaultLogDepthBuffer=!0;function dHt(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(QW(e))),n.push(t.terrainProviderChanged.addEventListener(QW(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ai.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 nm.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,dHt(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 rV(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}}});Ai.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 hHt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function mke(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=up.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=up.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=up.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=up.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=up.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=gy.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))}Ai.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&&hHt(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=gy.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=up.createLogDepthCommand(e,o,t.logDepth),mke(this,t.logDepth.command,s)),(d||m)&&mke(this,e,s)};var mHt=new vh({pass:ao.RENDER}),Xce=new vh({pass:ao.PRELOAD}),Kce=new vh({pass:ao.PRELOAD_FLIGHT}),pHt=new vh({pass:ao.REQUEST_RENDER_MODE_DEFER_CHECK}),pke=new ue,$ce;function gHt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return pke.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,$ce=YU.fromBoundingSphere(pke,e.camera.positionWC,$ce),$ce}Ai.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 Ake(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}Ai.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=gHt(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 As),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),UP.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};Ai.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 ZW=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ZW=N.inverseTransformation(ZW,ZW);function _Ht(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(ZW,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=Xa.createGeometry(new Xa({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 On({geometryInstances:new Ft({geometry:Gn.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=up.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 Tu(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&_Ht(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 gke(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 bke(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var yHt=new h;function _ke(e,t){let n=h.subtract(e,t,yHt),i=Math.max(0,h.magnitude(n));return i*i}function AHt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return _ke(r.center,n)-_ke(i.center,n)}function bHt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function xHt(e,t,n,i,r){F0(i,bke,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function THt(e,t,n,i,r){F0(i,bHt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function EHt(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],F0(i,bke,e.camera.positionWC);for(let r=0;r<i.length;++r)Tu(i[r],e,t)}function CHt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],F0(i,AHt,e.camera.positionWC);for(let r=0;r<i.length;++r)Tu(i[r],e,t)}var vHt=new Ji,SHt=new yu,wHt=new gn,IHt=new As;function PHt(e){let{frustum:t}=e;return l(t.fov)?t.clone(vHt):l(t.infiniteProjectionMatrix)?t.clone(SHt):l(t.width)?t.clone(wHt):t.clone(IHt)}function DHt(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?xHt:THt}function RHt(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=DHt(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,Tu,t,f,c)}function OHt(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,Tu,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,Tu,t,n)}function MHt(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)Tu(r[s],e,t);t.framebuffer=i}function NHt(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)Tu(a[d],e,t);t.framebuffer=u}}function LHt(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)Tu(i[o],e,t)}function Zce(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=PHt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||FHt(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)Tu(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)gke(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,Tu,A,e,t)):L(P,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(P,Tu,A,e,t)):L(P,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let M;if(MHt(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(NHt(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),EHt(e,t,P),L(P,Ie.OPAQUE),LHt(e,t,P),CHt(e,t,P),w!==0&&e.mode!==re.SCENE2D&&(s.near=P.near,o.updateFrustum(s)),RHt(e,t,P),OHt(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,gke,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 FHt(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&Tu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Tu(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)?Tu(o[s],e,t):o.splice(s,1)}}function xke(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 BHt(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 kHt(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 Tke(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;kHt(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];Tu(A,e,d.passState)}}}}var UHt=new h;Ai.prototype.updateAndExecuteCommands=function(e,t){QHt(this,e,t),this._environmentState.useWebVR?zHt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Au.ROTATE?Gb(!0,this,e):KHt(this,e)};function zHt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;Cke(e),n.createPotentiallyVisibleSet(e),xke(e),o||Tke(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,UHt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,Zce(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,Zce(e,t),Or.clone(a,i)}var VHt=new he(Math.PI,D.PI_OVER_TWO),jHt=new h,HHt=new h,GHt=new N,WHt=new N,qHt=new h,YHt=new h,XHt=new et;function KHt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,XHt);t.viewport=s;let a=VHt,c=jHt;e.mapProjection.project(a,c);let f=h.clone(i.position,HHt),d=N.clone(i.transform,WHt),p=i.frustum.clone();i._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,GHt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,qHt),b=At.pointToGLWindowCoordinates(m,g,A,YHt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)Gb(!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),Gb(!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),Gb(!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),Gb(!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),Gb(!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),Gb(!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),Gb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function Gb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),Cke(t),i.createPotentiallyVisibleSet(t),e&&(xke(t),r||Tke(t)),Zce(t,n)}var yke=new ta;function Eke(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 xl){Eke(o,t,n);continue}o.show&&u_.isSupported(o)&&_s(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function $Ht(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;Eke(e._primitives,n,i)}Ai.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(Bg.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=yke.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=yke,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 nm(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),$Ht(this,e)};function JHt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new z0({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 ZHt(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 Cke(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,JHt(e),ZHt(e),e._globe&&e._globe.render(t)}function QHt(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 X4: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)}Ai.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 eGt(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 tGt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function vke(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof xl){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=vke(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}Ai.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=nGt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function nGt(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=vke(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 Jce=new he;Ai.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,Jce);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(Jce.height=m,t(Jce))},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 iGt(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}Ai.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=tGt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=iGt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function rGt(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 my({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 oGt(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 sGt(e){e.primitives.postPassesUpdate(e._frameState),Kc.update()}var aGt=new z;function cGt(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=mHt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,aGt),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 Q_?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,BHt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function qC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function lGt(e){return e._picking.updateMostDetailedRayPicks(e)}Ai.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,kA.maximumFrameNumber,1);Ake(this,r,e),t.newFrame=!0}qC(this,oGt),this.primitives.show&&(qC(this,lGt),qC(this,uGt),qC(this,fGt),i||qC(this,dGt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),qC(this,cGt)),rGt(this,i),qC(this,sGt),eGt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ai.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ai.prototype.requestRender=function(){this._renderRequested=!0};Ai.prototype.clampLineWidth=function(e){return Math.max(Ut.minimumAliasedLineWidth,Math.min(e,Ut.maximumAliasedLineWidth))};Ai.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};Ai.prototype.snap=function(e,t){return W4.snap(this,e,t)};Ai.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};Ai.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof Hb))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 K4.fromKeyframeNode(r,s,c,a)};Ai.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=mV(s,t,n,i);if(!l(a))return;let c=pV(o,n,i);if(!l(c))return;let u=new t4(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};Ai.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Ai.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ai.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ai.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function uGt(e){let t=e._frameState;Xce.camera=t.camera,Xce.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Xce)}function fGt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;Kce.camera=e.preloadFlightCamera,Kce.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Kce)}function dGt(e){e.primitives.updateForPass(e._frameState,pHt)}Ai.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ai.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ai.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ai.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ai.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ai.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ai.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ai.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ai.prototype.cartesianToCanvasCoordinates=function(e,t){return dr.worldToWindowCoordinates(this,e,t)};Ai.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ai.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};Ai.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};Ai.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function hGt(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()})}Ai.prototype.setTerrain=function(e){return hGt(this,e),e};Ai.prototype.isDestroyed=function(){return!1};Ai.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),le(this)};var e8=Ai;var qP=`float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; @@ -12570,7 +12571,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 CV=`in vec3 v_outerPositionWC; +`;var t8=`in vec3 v_outerPositionWC; uniform vec3 u_hsbShift; #ifndef PER_FRAGMENT_ATMOSPHERE in vec3 v_mieColor; @@ -12615,7 +12616,7 @@ color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } -`;var vV=`in vec4 position; +`;var n8=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; @@ -12642,14 +12643,14 @@ v_outerPositionWC = positionWC.xyz; vec4 positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; } -`;function FI(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(FI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});FI.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Jse=new N;FI.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,Jse),r=N.multiplyTransformation(i,Vi.Y_UP_TO_Z_UP,Jse),o=N.multiply(this._scaleMatrix,r,Jse);N.clone(o,this._modelMatrix);let s=e.context,a=bkt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Xa.createGeometry(new Xa({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=zn.fromGeometry({context:s,geometry:p,attributeLocations:Gn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Ui.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:[am,LI,vV]}),m=new Ye({defines:p,sources:[am,LI,CV]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function bkt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}FI.prototype.isDestroyed=function(){return!1};FI.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var SV=FI;function hC(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new HT({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(hC.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}}});hC.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)};hC.prototype.isDestroyed=function(){return!1};hC.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function BI(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}hC.createEarthSkyBox=function(){return new hC({sources:{positiveX:BI("px"),negativeX:BI("mx"),positiveY:BI("py"),negativeY:BI("my"),positiveZ:BI("pz"),negativeZ:BI("mz")}})};var wV=hC;function Zse(e){e=e??1,this._radius=e??1}Object.defineProperties(Zse.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Zse.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 Qse=Zse;function IV(){}IV.prototype.evaluate=function(e,t){pe.throwInstantiationError()};IV.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};IV.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};IV.prototype.getVariables=function(){pe.throwInstantiationError()};var eae=IV;var PV=`uniform sampler2D u_texture; +`;function YP(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(YP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});YP.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Qce=new N;YP.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,Qce),r=N.multiplyTransformation(i,Hi.Y_UP_TO_Z_UP,Qce),o=N.multiply(this._scaleMatrix,r,Qce);N.clone(o,this._modelMatrix);let s=e.context,a=mGt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Xa.createGeometry(new Xa({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=zn.fromGeometry({context:s,geometry:p,attributeLocations:Gn.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:[lm,qP,n8]}),m=new Ye({defines:p,sources:[lm,qP,t8]});this._spSkyAtmosphere=en.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function mGt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}YP.prototype.isDestroyed=function(){return!1};YP.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var i8=YP;function YC(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new bC({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(YC.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}}});YC.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)};YC.prototype.isDestroyed=function(){return!1};YC.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function XP(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}YC.createEarthSkyBox=function(){return new YC({sources:{positiveX:XP("px"),negativeX:XP("mx"),positiveY:XP("py"),negativeY:XP("my"),positiveZ:XP("pz"),negativeZ:XP("mz")}})};var r8=YC;function ele(e){e=e??1,this._radius=e??1}Object.defineProperties(ele.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});ele.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 tle=ele;function o8(){}o8.prototype.evaluate=function(e,t){pe.throwInstantiationError()};o8.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};o8.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};o8.prototype.getVariables=function(){pe.throwInstantiationError()};var nle=o8;var s8=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } -`;var DV=`uniform float u_radiusTS; +`;var a8=`uniform float u_radiusTS; in vec2 v_textureCoordinates; vec2 rotate(vec2 p, vec2 direction) { @@ -12681,7 +12682,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 RV=`in vec2 direction; +`;var c8=`in vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() @@ -12702,9 +12703,8 @@ halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); v_textureCoordinates = direction; } -`;function MV(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.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(MV.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var xkt=new U,Tkt=new U,Ekt=new se,OV=new se;MV.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:DV,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:RV,fragmentShaderSource:PV,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?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=fr.computeActualEllipsoidPosition(e,c,OV),g=h.magnitude(h.subtract(p,e.camera.position,OV)),m=r.uniformState.projection,y=Ekt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=N.multiplyByVector(m,y,OV),b=fr.clipToGLWindowCoordinates(t.viewport,A,xkt);y.x=D.SOLAR_RADIUS;let x=N.multiplyByVector(m,y,OV),T=fr.clipToGLWindowCoordinates(t.viewport,x,Tkt);return this._size=U.magnitude(U.subtract(T,b,OV)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};MV.prototype.isDestroyed=function(){return!1};MV.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(),le(this)};var NV=MV;var J7={};J7.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};J7.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)};J7.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 ep=J7;function Eb(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=Q7(e.westIndices,r,t),this._southIndices=Q7(e.southIndices,o,t),this._eastIndices=Q7(e.eastIndices,r,t),this._northIndices=Q7(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(Eb.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 Z7=[];function Q7(e,t,n){Z7.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)Z7[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(Z7.sort(t),je.createTypedArray(n,Z7)):e}var zNe="createVerticesFromQuantizedTerrainMesh",Ckt=new Kn(zNe),vkt=new Kn(zNe,tf.maximumAsynchronousTasks);Eb.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?vkt:Ckt).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=To.clone(g.encoding);return p._mesh=new mc(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 Skt=new Kn("upsampleQuantizedTerrainMesh",tf.maximumAsynchronousTasks);Eb.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=Skt.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 Eb({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.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 tae=32767,VNe=new h;Eb.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=tae;let r=D.clamp((n-e.south)/e.height,0,1);return r*=tae,l(this._mesh)?Dkt(this,i,r):Rkt(this,i,r)};function jNe(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 wkt=new U,Ikt=new U,Pkt=new U;function Dkt(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,wkt),g=o.decodeTextureCoordinates(r,f,Ikt),m=o.decodeTextureCoordinates(r,d,Pkt);if(jNe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=ep.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,VNe);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 Rkt(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(jNe(t,n,p,y,g,A,m,b)){let x=ep.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,VNe);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/tae)}}}}Eb.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};Eb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var mC=Eb;function zI(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var pC=new ie;function Okt(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}zI.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)Okt(e,g,p,s)||s.push(new kI(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,pC);let a=pC.west,c=pC.north;o.tileXYToRectangle(i,r,e,pC);let u=pC.east,f=pC.south,d=new Bkt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];nae(g.extent,d)&&kkt(this._maximumLevel,g,d)}};zI.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(UI(i.extent,e)){t=i;break}}return l(t)?LV(void 0,t,e):-1};var Mkt=[],Nkt=[],Lkt=new ie,Fkt=new ie;zI.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Mkt;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,Lkt)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,Fkt))):t.push(e);let n=Nkt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)FV(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 HNe=new he;zI.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,pC);return ie.center(i,HNe),this.computeMaximumLevelAtPosition(HNe)>=e};zI.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 kI(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(kI.prototype,{nw:{get:function(){return this._nw||(this._nw=new kI(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new kI(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new kI(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new kI(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Bkt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function nae(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 kkt(e,t,n){for(;t.level<e;)if(eW(t.nw.extent,n))t=t.nw;else if(eW(t.ne.extent,n))t=t.ne;else if(eW(t.sw.extent,n))t=t.sw;else if(eW(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=wr(t.rectangles,n.level,Ukt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Ukt(e,t){return e.level-t}function eW(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function UI(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function LV(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&UI(t._nw.extent,n),s=t._ne&&UI(t._ne.extent,n),a=t._sw&&UI(t._sw.extent,n),c=t._se&&UI(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,LV(t,t._nw,n))),s&&(i=Math.max(i,LV(t,t._ne,n))),a&&(i=Math.max(i,LV(t,t._sw,n))),c&&(i=Math.max(i,LV(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];UI(a,n)&&(i=a.level)}t=t.parent}return i}function FV(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||nae(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]=zkt(e[s.level],s)}FV(e,t._nw,n),FV(e,t._ne,n),FV(e,t._sw,n),FV(e,t._se,n)}function zkt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];nae(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 tp=zI;function Vkt(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 WNe(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=[]}WNe.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 qNe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Jr.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=Jr.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=Jr.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 Po({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Jr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Xr.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=Jr.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 tp(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 tp(e.tilingScheme,u),g=new tp(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 Vkt({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 oae(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function jkt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Jr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return oae(e,n);throw new oe(i)}async function Hkt(e,t,n){await qNe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new tp(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 oae(e,t){try{let n=await e.layerJsonResource.fetchJson();return Hkt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await qNe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):jkt(e,n,t)}}function np(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 iae={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function GNe(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 Gkt(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Uc({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 Wkt(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 ue(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===iae.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===iae.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===iae.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let Se=Do(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 mC({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})}np.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=sae(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)})):YNe(this,e,t,n,o,i)};function YNe(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=GNe(void 0)):u=GNe(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)?Gkt(e,m,i,t,n):Wkt(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(np.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}}});np.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};np.fromIonAssetId=async function(e,t){let n=await jo.fromAssetId(e);return np.fromUrl(n,t)};np.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 WNe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await oae(i);let r=new np(t);return i.build(r),r};np.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(sae(this,e,t,n,i[o],o===0).result)return;return!1};np.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=sae(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function rae(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 sae(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=rae(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=YNe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=rae(r,f.x,f.y,f.level)}return{result:!1}}np._getAvailabilityTile=rae;var gC=np;function qkt(e){return e=e??H.EMPTY_OBJECT,gC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var BV=qkt;function Ykt(e){return e=e??H.EMPTY_OBJECT,gC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var _C=Ykt;function VI(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,Kkt(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(_C(e))};VI.fromWorldBathymetry=function(e){return new VI(BV(e))};function Xkt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Kkt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){Xkt(e._errorEvent,i)}}var kV=VI;function jI(){}jI.prototype.boundingVolume=void 0;jI.prototype.boundingSphere=void 0;jI.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};jI.prototype.intersectPlane=function(e){pe.throwInstantiationError()};jI.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var aae=jI;function UV(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(UV.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}}});UV.prototype.getTileCredits=function(e,t,n){};UV.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)};UV.prototype.pickFeatures=function(e,t,n,i,r){};var zV=UV;function cae(e){pe.throwInstantiationError()}cae.prototype.isReady=pe.throwInstantiationError;cae.prototype.shouldDiscardImage=pe.throwInstantiationError;var lae=cae;var XNe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(XNe);var uae=XNe;function AC(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.shadows=e.shadows??Pn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Zp(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 kg,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(AC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ts.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function $kt(e){return`uniform vec4 czm_pickColor; -${e}`}function Jkt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function Zkt(){return"czm_pickColor"}AC.prototype.makeStyleDirty=function(){this._styleDirty=!0};AC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var Qkt=new K;function dae(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function yC(e,t){return e._intervals.indexOf(t.start)}function e3t(e,t){let n=e._intervals,i=e._clock,r=dae(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,Qkt),a=n.indexOf(s),c=yC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function t3t(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function n3t(e,t,n){let i=dae(e),r=yC(e,t),o=yC(e,n);return i>=0?r>=o:r<=o}function $Ne(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 i3t(e,t,n){let i=yC(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 Iz({arrayBuffer:u,cull:!0,fragmentShaderLoaded:$kt,uniformMapLoaded:Jkt(e),pickIdLoaded:Zkt})}).catch($Ne(e,c))}return o}function r3t(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 o3t(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(JNe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;r3t(e,a)}}t.touchedFrameNumber=i.frameNumber}var s3t=new N;function a3t(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 c3t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var l3t=new Zp;function JNe(e,t,n,i){let r=e.shading??l3t,o=t.pointCloud,s=t.transform??N.IDENTITY;o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,s3t),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=a3t(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=c3t(e);try{o.update(i)}catch(a){$Ne(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function fae(e,t,n,i){let r=i3t(e,t,i);o3t(e,r,n,i)}function u3t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function ZNe(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 f3t(e,t){let n=yC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function KNe(e,t,n,i,r){return l(n)?n.ready?!0:(fae(e,t,i,r),n.ready):!1}function d3t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=yC(e,n),d=yC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],KNe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],KNe(e,s,a,i,r))return s;return t}function h3t(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 HI={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};AC.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)&&h3t(this,r,s),HI.timeSinceLoad=t,HI.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=t3t(this);if(!l(g))return;let m=!1,y=dae(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||n3t(this,g,p))&&(p=e3t(this,g)),d=d3t(this,d,g,HI,e);let b=f3t(this,d);l(b)||(fae(this,d,HI,e),b=this._lastRenderedFrame),l(b)&&JNe(this,b,HI,e),l(p)&&fae(this,p,HI,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&&ZNe(this,u3t(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};AC.prototype.isDestroyed=function(){return!1};AC.prototype.destroy=function(){return ZNe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var GI=AC;var VV=`in vec2 v_textureCoordinates; +`;function u8(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.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(u8.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var pGt=new U,gGt=new U,_Gt=new se,l8=new se;u8.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 Nf({fragmentShaderSource:a8,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=nt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=nt.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=en.fromCache({context:r,vertexShaderSource:c8,fragmentShaderSource:s8,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?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=dr.computeActualEllipsoidPosition(e,c,l8),g=h.magnitude(h.subtract(p,e.camera.position,l8)),m=r.uniformState.projection,y=_Gt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=N.multiplyByVector(m,y,l8),b=dr.clipToGLWindowCoordinates(t.viewport,A,pGt);y.x=D.SOLAR_RADIUS;let x=N.multiplyByVector(m,y,l8),T=dr.clipToGLWindowCoordinates(t.viewport,x,gGt);return this._size=U.magnitude(U.subtract(T,b,l8)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};u8.prototype.isDestroyed=function(){return!1};u8.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(),le(this)};var f8=u8;function KP(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,AGt(this,e)}Object.defineProperties(KP.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}}});KP.fromWorldTerrain=function(e){return new KP(nC(e))};KP.fromWorldBathymetry=function(e){return new KP(NU(e))};function yGt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function AGt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){yGt(e._errorEvent,i)}}var d8=KP;function $P(){}$P.prototype.boundingVolume=void 0;$P.prototype.boundingSphere=void 0;$P.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};$P.prototype.intersectPlane=function(e){pe.throwInstantiationError()};$P.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var ile=$P;function h8(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new er({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 rle(e){pe.throwInstantiationError()}rle.prototype.isReady=pe.throwInstantiationError;rle.prototype.shouldDiscardImage=pe.throwInstantiationError;var ole=rle;var Ske={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(Ske);var sle=Ske;function KC(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 Yp(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 Vg,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(KC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function bGt(e){return`uniform vec4 czm_pickColor; +${e}`}function xGt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function TGt(){return"czm_pickColor"}KC.prototype.makeStyleDirty=function(){this._styleDirty=!0};KC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var EGt=new K;function cle(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function XC(e,t){return e._intervals.indexOf(t.start)}function CGt(e,t){let n=e._intervals,i=e._clock,r=cle(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,EGt),a=n.indexOf(s),c=XC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function vGt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function SGt(e,t,n){let i=cle(e),r=XC(e,t),o=XC(e,n);return i>=0?r>=o:r<=o}function Ike(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 wGt(e,t,n){let i=XC(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 h4({arrayBuffer:u,cull:!0,fragmentShaderLoaded:bGt,uniformMapLoaded:xGt(e),pickIdLoaded:TGt})}).catch(Ike(e,c))}return o}function IGt(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 PGt(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(Pke(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;IGt(e,a)}}t.touchedFrameNumber=i.frameNumber}var DGt=new N;function RGt(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 OGt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var MGt=new Yp;function Pke(e,t,n,i){let r=e.shading??MGt,o=t.pointCloud,s=t.transform??N.IDENTITY;o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,DGt),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=RGt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=OGt(e);try{o.update(i)}catch(a){Ike(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function ale(e,t,n,i){let r=wGt(e,t,i);PGt(e,r,n,i)}function NGt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Dke(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 LGt(e,t){let n=XC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function wke(e,t,n,i,r){return l(n)?n.ready?!0:(ale(e,t,i,r),n.ready):!1}function FGt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=XC(e,n),d=XC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],wke(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],wke(e,s,a,i,r))return s;return t}function BGt(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 JP={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};KC.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)&&BGt(this,r,s),JP.timeSinceLoad=t,JP.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=vGt(this);if(!l(g))return;let m=!1,y=cle(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||SGt(this,g,p))&&(p=CGt(this,g)),d=FGt(this,d,g,JP,e);let b=LGt(this,d);l(b)||(ale(this,d,JP,e),b=this._lastRenderedFrame),l(b)&&Pke(this,b,JP,e),l(p)&&ale(this,p,JP,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&&Dke(this,NGt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};KC.prototype.isDestroyed=function(){return!1};KC.prototype.destroy=function(){return Dke(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var ZP=KC;var p8=`in vec2 v_textureCoordinates; void main() { czm_materialInput materialInput; @@ -12715,9 +12715,9 @@ materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } -`;function tW(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=rr.fromType(rr.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}tW.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,VV]});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)}};tW.prototype.isDestroyed=function(){return!1};tW.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var hae=tW;var mae=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()}},pae=mae;function ay(){pe.throwInstantiationError()}Object.defineProperties(ay.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}});ay.prototype.update=pe.throwInstantiationError;ay.prototype.updateViewTransforms=pe.throwInstantiationError;ay.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;ay.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;ay.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;ay.DefaultMinBounds=pe.throwInstantiationError;ay.DefaultMaxBounds=pe.throwInstantiationError;var gae=ay;var m3t=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=m3t;var p3t=500;function g3t(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>p3t&&(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 ip=g3t;var _3t=new he;function y3t(e,t,n,i,r){let o=i.cartesianToCartographic(e,_3t);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):As(n)?o.height=t:Uy(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var cy=y3t;var A3t=z.WHITE,b3t=h.ZERO,x3t=We.NONE,T3t=U.ZERO,E3t=1,C3t=0,v3t=h.ZERO,S3t=ji.CENTER,w3t=Hn.CENTER,I3t=!1,P3t=Ho.NONE,D3t=new h,R3t=new z,O3t=new h,M3t=new U,N3t=new qt,L3t=new qt,F3t=new qt,B3t=new et,k3t=new Ht;function QNe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Cb(e,t){t.collectionChanged.addEventListener(Cb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}Cb.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,D3t),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){_ae(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,A3t,R3t),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,b3t,O3t),u.heightReference=X.getValueOrDefault(a._heightReference,e,x3t),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,T3t,M3t),u.scale=X.getValueOrDefault(a._scale,e,E3t),u.rotation=X.getValueOrDefault(a._rotation,e,C3t),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,v3t),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,S3t),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,w3t),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,N3t),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,L3t),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,F3t),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,I3t),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,k3t),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,P3t),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,B3t);l(p)&&u.setImageSubRegion(u.image,p)}return!0};Cb.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=ip(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=cy(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};Cb.prototype.isDestroyed=function(){return!1};Cb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Cb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};Cb.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 QNe(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 QNe(o)):(_ae(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],_ae(s.get(o.id),o,a),s.remove(o.id)};function _ae(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var jV=Cb;function HV(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(HV.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});HV.fromDistanceDisplayCondition=function(e){return new HV(e.near,e.far)};HV.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ni=HV;function WI(){pe.throwInstantiationError()}Object.defineProperties(WI.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});WI.prototype.getType=pe.throwInstantiationError;WI.prototype.getValue=pe.throwInstantiationError;WI.prototype.equals=pe.throwInstantiationError;var U3t=new K;WI.getValue=function(e,t,n){let i;return l(e)||(e=K.now(U3t)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=rr.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==rr.ColorType)&&(n=rr.fromType(rr.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Co=WI;function bC(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}bC.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};bC.prototype._setOptions=pe.throwInstantiationError;bC.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=Co.getValue(e,u,this._material);this._material=g,d=new Cr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=yn.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 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}))}};bC.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))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};bC.prototype.isDestroyed=function(){return!1};bC.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),le(this)};var Di=bC;var z3t=new Kt(z.WHITE),V3t=new di(!0),j3t=new di(!0),H3t=new di(!1),G3t=new di(z.BLACK),W3t=new di(Pn.DISABLED),q3t=new di(new Ht),Y3t=new di(ei.BOTH);function gu(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=eo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(gu.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}}});gu.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};gu.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};gu.prototype.createFillGeometryInstance=pe.throwInstantiationError;gu.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;gu.prototype.isDestroyed=function(){return!1};gu.prototype.destroy=function(){le(this)};gu.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(nt.MINIMUM_VALUE)};gu.prototype._isOnTerrain=function(e,t){return!1};gu.prototype._getIsClosed=function(e){return!0};gu.prototype._isDynamic=pe.throwInstantiationError;gu.prototype._setStaticOptions=pe.throwInstantiationError;gu.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??z3t,this._fillProperty=o??j3t,this._showProperty=u??V3t,this._showOutlineProperty=r.outline??H3t,this._outlineColorProperty=c?r.outlineColor??G3t:void 0,this._shadowsProperty=r.shadows??W3t,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??q3t,this._classificationTypeProperty=r.classificationType??Y3t,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)}};gu.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Ri=gu;var eLe=new h;function qI(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,eLe);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(qI.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});qI.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 X3t=new K;qI.prototype.getValue=function(e,t){l(e)||(e=K.now(X3t));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!Uy(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,eLe);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)};qI.prototype.isDestroyed=function(){return!1};qI.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var xC=qI;function K3t(e,t,n,i){if(Ri.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 xC(this._scene,s,o)}}var ly=K3t;var tLe=h.ZERO,nLe=new h,$3t=new h,iLe=new z;function J3t(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function hd(e,t){Ri.call(this,{entity:e,scene:t,geometryOptions:new J3t(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(hd.prototype=Object.create(Ri.prototype),hd.prototype.constructor=hd);Object.defineProperties(hd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});hd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ni.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,iLe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,tLe,nLe))),new Bt({id:t,geometry:Lc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,iLe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,tLe,nLe))),new Bt({id:t,geometry:Tm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};hd.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};hd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ri.prototype._isHidden.call(this,e,t)};hd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};hd.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:Cr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?gn.ALL:void 0};hd.prototype._onEntityPropertyChanged=ly;hd.DynamicGeometryUpdater=YI;function YI(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(YI.prototype=Object.create(Di.prototype),YI.prototype.constructor=YI);YI.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,$3t),r=this._options.dimensions;return!l(i)||!l(r)||Di.prototype._isHidden.call(this,e,t,n)};YI.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?gn.ALL:void 0};var GV=hd;function TC(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Gi.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(TC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Z3t=new K;TC.prototype.getValue=function(e,t){return l(e)||(e=K.now(Z3t)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};TC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};TC.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Hm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};TC.prototype.equals=function(e){return this===e||e instanceof TC&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var WV=TC;var Q3t=new N;function vb(e,t){t.collectionChanged.addEventListener(vb.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}vb.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,Q3t),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],eUt(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};vb.prototype.isDestroyed=function(){return!1};vb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vb.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)yae(this,e[i],t,n);return le(this)};vb.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?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};vb.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):(yae(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],yae(this,o,a,c),s.remove(o.id)};function yae(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function eUt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Yo.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 qV=vb;var tUt=z.WHITE,nUt=z.BLACK,iUt=new U(2,2);function XI(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(XI.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")});XI.prototype.getType=function(e){return"Checkerboard"};var rUt=new K;XI.prototype.getValue=function(e,t){return l(e)||(e=K.now(rUt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,tUt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,nUt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,iUt),t};XI.prototype.equals=function(e){return this===e||e instanceof XI&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var KI=XI;var nW={id:void 0},$I=new Array(2);function Aae(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 rLe(e,t,n,i){$I[0]=n,$I[1]=i.id,t[JSON.stringify($I)]=i.definitionChanged.addEventListener(Fs.prototype._onDefinitionChanged,e)}function oLe(e,t,n,i){$I[0]=n,$I[1]=i.id;let r=JSON.stringify($I);t[r](),t[r]=void 0}function Sb(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 Qa(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(Fs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],oLe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(Fs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],rLe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?Aae(y):(nW.id=s.id,y=new eo(nW)),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 Fs(e,t){this._owner=t,this._composite=new Qa(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Jn(),this._eventHash={},Sb(this),this._shouldRecomposite=!1}Object.defineProperties(Fs.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}}});Fs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),Sb(this)};Fs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Sb(this),!0):!1};Fs.prototype.removeAllCollections=function(){this._collections.length=0,Sb(this)};Fs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Fs.prototype.contains=function(e){return this._composite.contains(e)};Fs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Fs.prototype.getCollection=function(e){return this._collections[e]};Fs.prototype.getCollectionsLength=function(){return this._collections.length};function iW(e,t){return e.indexOf(t)}function sLe(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,Sb(e)}Fs.prototype.raiseCollection=function(e){let t=iW(this._collections,e);sLe(this,t,t+1)};Fs.prototype.lowerCollection=function(e){let t=iW(this._collections,e);sLe(this,t,t-1)};Fs.prototype.raiseCollectionToTop=function(e){let t=iW(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Sb(this))};Fs.prototype.lowerCollectionToBottom=function(e){let t=iW(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Sb(this))};Fs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Fs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Sb(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Fs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Fs.prototype.getById=function(e){return this._composite.getById(e)};Fs.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];oLe(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),Aae(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];rLe(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)?Aae(u):(nW.id=y,u=new eo(nW),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};Fs.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 bae=Fs;function wb(){this._definitionChanged=new be,this._composite=new El,this._composite.definitionChanged.addEventListener(wb.prototype._raiseDefinitionChanged,this)}Object.defineProperties(wb.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});wb.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var oUt=new K;wb.prototype.getValue=function(e,t){l(e)||(e=K.now(oUt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};wb.prototype.equals=function(e){return this===e||e instanceof wb&&this._composite.equals(e._composite,X.equals)};wb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var JI=wb;var aLe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(aLe);var cr=aLe;var Ec=[new h,new h],sUt=new h,aUt=new h,cUt=new h,lUt=new h,uUt=new h,fUt=new h,dUt=new h,hUt=new h,mUt=new h,ZI=new h,rW=new h,YV={},xae=new he;function pUt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];xae=t.cartesianToCartographic(r,xae),n[i]=xae.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function Tae(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 oW=new h,sW=new h;function gUt(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,oW),oW),s=r.projectPointOntoPlane(h.add(n,t,sW),sW),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var _Ut=new h(-1,0,0),EC=new N,yUt=new N,Eae=new $,AUt=$.IDENTITY.clone(),bUt=new h,xUt=new se,cLe=new h;function uy(e,t,n,i,r,o,s,a){let c=bUt,u=xUt;EC=At.eastNorthUpToFixedFrame(e,r,EC),c=N.multiplyByPointAsVector(EC,_Ut,c),c=h.normalize(c,c);let f=gUt(c,t,e,r);Eae=$.fromRotationZ(f,Eae),cLe.z=o,EC=N.multiplyTransformation(EC,N.fromRotationTranslation(Eae,cLe,yUt),EC);let d=AUt;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(EC,u,u),i.push(u.x,u.y,u.z);return i}var TUt=new h;function Cae(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,TUt);i=uy(c,t,n,i,r,o[a/3],s,1)}return i}function EUt(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 lLe(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 uLe=new Le,fLe=new h,dLe=new $;function hLe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,ZI),h.subtract(n,e,rW)),d=i===cr.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,ZI),f/(d+1),uLe),dLe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),uLe),dLe);let g,m;if(t=h.clone(t,fLe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,ZI),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,rW),s=uy(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,ZI),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,rW),s=uy(m,g,a,s,o,c,1,1),n=h.clone(n,fLe),g=h.subtract(n,e,ZI),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,rW),s=uy(m,g,a,s,o,c,1,1);return s}YV.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};YV.angleIsGreaterThanPi=function(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,oW),oW),s=r.projectPointOntoPlane(h.add(n,t,sW),sW);return s.x*o.y-s.y*o.x>=0};var CUt=new h,vUt=new h;YV.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=pUt(e,o),a=i._granularity,c=i._cornerType,u=r?EUt(t,n):lLe(t,n),f=r?lLe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=sUt,b=aUt,x=cUt,T=lUt,E=uUt,v=fUt,S=dUt,I=hUt,R=mUt,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=uy(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),CUt);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),vUt);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,ZI))),Q=YV.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),Ec[0]=h.clone(R,Ec[0]),Ec[1]=h.clone(v,Ec[1]),w=Tae(Ec,_+d,C+d,a),P=or.generateArc({positions:Ec,granularity:a,ellipsoid:o}),m=Cae(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===cr.ROUNDED||c===cr.BEVELED?hLe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=uy(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),Ec[0]=h.clone(R,Ec[0]),Ec[1]=h.clone(v,Ec[1]),w=Tae(Ec,_+d,C+d,a),P=or.generateArc({positions:Ec,granularity:a,ellipsoid:o}),m=Cae(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===cr.ROUNDED||c===cr.BEVELED?hLe(E,v,S,c,Q,o,m,u,C+d,r):m=uy(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=uy(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}Ec[0]=h.clone(R,Ec[0]),Ec[1]=h.clone(O,Ec[1]),w=Tae(Ec,_+d,C+d,a),P=or.generateArc({positions:Ec,granularity:a,ellipsoid:o}),m=Cae(P,I,u,m,o,w,1),r&&(y=uy(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 rp=YV;var Sae={},QI=new h,yLe=new h,SUt=new h,mLe=new h,_u=[new h,new h],ALe=new h,bLe=new h,xLe=new h,wUt=new h,IUt=new h,PUt=new h,DUt=new h,RUt=new h,OUt=new h,MUt=new h,pLe=new Le,gLe=new $;function aW(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,QI),h.subtract(n,e,yLe)),s=i===cr.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,QI),o/s,pLe),gLe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,pLe),gLe);let f=0;t=h.clone(t,QI);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 NUt(e){let t=ALe,n=bLe,i=xLe,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=aW(t,n,i,cr.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=aW(t,n,i,cr.ROUNDED,!1);return[o,c]}function _Le(e,t,n,i){let r=QI;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 vae(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,QI),a=h.negate(s,yLe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,SUt),p=h.add(d,a,mLe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,mLe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}Sae.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 LUt=new h,FUt=new h;Sae.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=ALe,c=bLe,u=xLe,f=wUt,d=IUt,p=PUt,g=DUt,m=RUt,y=OUt,A=MUt,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),LUt);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),FUt);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,QI))),M=rp.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),_u[0]=h.clone(g,_u[0]),_u[1]=h.clone(A,_u[1]),S=or.generateArc({positions:_u,granularity:t,ellipsoid:i}),b=vae(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===cr.ROUNDED||o===cr.BEVELED?I.push({leftPositions:aW(m,p,y,o,M)}):I.push({leftPositions:_Le(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),_u[0]=h.clone(g,_u[0]),_u[1]=h.clone(A,_u[1]),S=or.generateArc({positions:_u,granularity:t,ellipsoid:i}),b=vae(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===cr.ROUNDED||o===cr.BEVELED?I.push({rightPositions:aW(y,p,m,o,M)}):I.push({rightPositions:_Le(E,d,m,M)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),_u[0]=h.clone(g,_u[0]),_u[1]=h.clone(E,_u[1]),S=or.generateArc({positions:_u,granularity:t,ellipsoid:i}),b=vae(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===cr.ROUNDED&&(L=NUt(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var gr=Sae;var CLe=new h,vLe=new h,cW=new h,lW=new h,BUt=new h,SLe=new h,Ib=new h,eP=new h;function wLe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function op(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,Ib),Ib);o.normal&&gr.addAttribute(s,t,i,r),o.tangent&&gr.addAttribute(a,u,i,r),o.bitangent&&gr.addAttribute(c,n,i,r)}function ILe(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=CLe,w=vLe,P,M,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){M=cW,P=lW;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),gr.addAttribute(b,P,S),gr.addAttribute(b,M,void 0,I),op(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,Ib),Ib),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,eP),eP),C=h.normalize(h.add(Q,W,C),C),op(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,Ib),Ib),W=n.geodeticSurfaceNormal(h.fromArray(q,g,eP),eP),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=SLe,we=cW,Se=lW;if(C=h.fromArray(a,k,C),l(ae)){for(op(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,gr.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),op(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),op(v,C,w,S,void 0,t),S+=3}else{for(op(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,gr.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),op(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),op(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,Ib),Ib),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,eP),eP),C=h.normalize(h.add(Q,W,C),C),op(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),op(v,C,w,S,I,t),m){S+=3,I-=3,M=cW,P=lW;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),gr.addAttribute(b,M,void 0,I),gr.addAttribute(b,P,S),op(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 kUt(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=CLe,m=vLe,y=cW,A=lW,b=BUt,x=SLe,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&&(gr.addAttribute(f,A,E),gr.addAttribute(f,A,E+3),gr.addAttribute(f,A,T),gr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(gr.addAttribute(p,x,E),gr.addAttribute(p,x,E+3),gr.addAttribute(p,x,T),gr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),gr.addAttribute(d,b,E),gr.addAttribute(d,b,E+3),gr.addAttribute(d,b,T),gr.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 wae(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 UUt(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=gr.computePositions(e),o=ILe(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=wae(f,0,m),g=ui.scaleToGeodeticHeight(g,a,i),m=wae(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=kUt(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=wae(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===gn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===gn.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 TLe=new h,XV=new h,Sh=new he;function ELe(e,t,n,i,r,o){let s=h.subtract(t,e,TLe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,XV),c=h.cross(s,a,TLe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,XV),n.cartesianToCartographic(XV,Sh);let g=Sh.latitude,m=Sh.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,XV),n.cartesianToCartographic(XV,Sh),g=Sh.latitude,m=Sh.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 vh=new h,KV=new h,df=new he,hf=new he;function PLe(e,t,n,i,r){e=wLe(e,t);let o=Br(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;df.latitude=Number.POSITIVE_INFINITY,df.longitude=Number.POSITIVE_INFINITY,hf.latitude=Number.NEGATIVE_INFINITY,hf.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===cr.ROUNDED){let p=o[0];h.subtract(p,o[1],vh),h.normalize(vh,vh),h.multiplyByScalar(vh,a,vh),h.add(p,vh,KV),t.cartesianToCartographic(KV,Sh),c=Sh.latitude,u=Sh.longitude,df.latitude=Math.min(df.latitude,c),df.longitude=Math.min(df.longitude,u),hf.latitude=Math.max(hf.latitude,c),hf.longitude=Math.max(hf.longitude,u)}for(let p=0;p<s-1;++p)ELe(o[p],o[p+1],t,a,df,hf);let f=o[s-1];h.subtract(f,o[s-2],vh),h.normalize(vh,vh),h.multiplyByScalar(vh,a,vh),h.add(f,vh,KV),ELe(f,KV,t,a,df,hf),i===cr.ROUNDED&&(t.cartesianToCartographic(KV,Sh),c=Sh.latitude,u=Sh.longitude,df.latitude=Math.min(df.latitude,c),df.longitude=Math.min(df.longitude,u),hf.latitude=Math.max(hf.latitude,c),hf.longitude=Math.max(hf.longitude,u));let d=l(r)?r:new ie;return d.north=hf.latitude,d.south=df.latitude,d.east=hf.longitude,d.west=df.longitude,d}function dy(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??cr.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}dy.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 DLe=ee.clone(ee.UNIT_SPHERE),RLe=new Be,fy={positions:void 0,ellipsoid:DLe,vertexFormat:RLe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};dy.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,DLe);t+=ee.packedLength;let s=Be.unpack(e,t,RLe);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):(fy.positions=r,fy.width=a,fy.height=c,fy.extrudedHeight=u,fy.cornerType=f,fy.granularity=d,fy.shadowVolume=p,fy.offsetAttribute=g===-1?void 0:g,new dy(fy))};dy.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??cr.ROUNDED;return PLe(n,r,i,o,t)};dy.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=wLe(t,i);let r=Br(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=UUt(u,c);else{let g=gr.computePositions(u);if(f=ILe(g,c,i),f.attributes.position.values=ui.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===gn.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=ue.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})};dy.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new dy({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(dy.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=PLe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var CC=dy;var OLe=new h,MLe=new h,zUt=new h;function VUt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function NLe(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 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=OLe,I=MLe;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),gr.addAttribute(A,I,b),gr.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=zUt;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,gr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===cr.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,gr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===cr.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=OLe,I=MLe;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),gr.addAttribute(A,R,void 0,x),gr.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 jUt(e){let t=e.ellipsoid,n=gr.computePositions(e),i=NLe(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===gn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===gn.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 $V(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??cr.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}$V.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 LLe=ee.clone(ee.UNIT_SPHERE),Pb={positions:void 0,ellipsoid:LLe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};$V.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,LLe);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):(Pb.positions=r,Pb.width=s,Pb.height=a,Pb.extrudedHeight=c,Pb.cornerType=u,Pb.granularity=f,Pb.offsetAttribute=d===-1?void 0:d,new $V(Pb))};$V.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=VUt(t,i);let r=Br(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=jUt(c);else{let p=gr.computePositions(c);if(u=NLe(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===gn.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=ue.fromVertices(f.position.values,void 0,3);return new St({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var JV=$V;var HUt=new di(0);function yu(e){Ri.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(yu.prototype=Object.create(Ri.prototype),yu.prototype.constructor=yu);Object.defineProperties(yu.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});yu.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&su.isSupported(this._scene)};yu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};yu.prototype._computeCenter=pe.throwInstantiationError;yu.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Ri.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??HUt,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 xC(this._scene,a,o,s)}};yu.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ri.prototype.destroy.call(this)};yu.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryHeightReference);return}return As(t)?0:e};yu.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryExtrudedHeightReference);return}return As(t)?yu.CLAMP_TO_GROUND:e};yu.CLAMP_TO_GROUND="clamp";yu.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 gn.ALL;if(r===1)return gn.TOP};var ii=yu;var FLe=new z,BLe=h.ZERO,kLe=new h,ULe=new ie;function GUt(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 sp(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new GUt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(sp.prototype=Object.create(ii.prototype),sp.prototype.constructor=sp);sp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,FLe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,BLe,kLe))),new Bt({id:t,geometry:new CC(this._options),attributes:i})};sp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,FLe),r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,BLe,kLe))),new Bt({id:t,geometry:new JV(this._options),attributes:r})};sp.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)};sp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ri.prototype._isHidden.call(this,e,t)};sp.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)};sp.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:Cr.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=Ni.getMinimumMaximumHeights(CC.computeRectangle(s,ULe)).minimumTerrainHeight),s.extrudedHeight=r};sp.DynamicGeometryUpdater=tP;function tP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(tP.prototype=Object.create(Di.prototype),tP.prototype.constructor=tP);tP.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Di.prototype._isHidden.call(this,e,t,n)};tP.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=Ni.getMinimumMaximumHeights(CC.computeRectangle(i,ULe)).minimumTerrainHeight),i.extrudedHeight=s};var ZV=sp;function Iae(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 Qa(this),this._entityCluster=new rd}Object.defineProperties(Iae.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){Ls.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}}});Iae.prototype.update=function(e){return!0};var QV=Iae;var zLe={};zLe.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 vC=zLe;var Pae=new U,WUt=new h,qUt=new h,YUt=new h,XUt=new h;function hy(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"}hy.packedLength=Be.packedLength+5;hy.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 VLe=new Be,nP={vertexFormat:VLe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};hy.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,VLe);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):(nP.length=r,nP.topRadius=o,nP.bottomRadius=s,nP.slices=a,nP.offsetAttribute=c===-1?void 0:c,new hy(nP))};hy.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=vC.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=WUt;C.z=Math.sin(_);let w=Math.cos(_),P=YUt,M=qUt;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,XUt);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})),Pae.x=t*.5,Pae.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(Pae));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===gn.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 Dae;hy.getUnitCylinder=function(){return l(Dae)||(Dae=hy.createGeometry(new hy({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),Dae};var e4=hy;var Rae=new U;function iP(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"}iP.packedLength=6;iP.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 SC={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};iP.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):(SC.length=i,SC.topRadius=r,SC.bottomRadius=o,SC.slices=s,SC.numberOfVerticalLines=a,SC.offsetAttribute=c===-1?void 0:c,new iP(SC))};iP.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=vC.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}),Rae.x=t*.5,Rae.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(Rae));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===gn.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 t4=iP;var jLe=h.ZERO,HLe=new h,KUt=new h,GLe=new z;function $Ut(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 md(e,t){Ri.call(this,{entity:e,scene:t,geometryOptions:new $Ut(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(md.prototype=Object.create(Ri.prototype),md.prototype.constructor=md);Object.defineProperties(md.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});md.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ni.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,GLe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,jLe,HLe))),new Bt({id:t,geometry:new e4(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};md.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,GLe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,jLe,HLe))),new Bt({id:t,geometry:new t4(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};md.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};md.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Ri.prototype._isHidden.call(this,e,t)};md.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)};md.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:Cr.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?gn.ALL:void 0};md.prototype._onEntityPropertyChanged=ly;md.DynamicGeometryUpdater=rP;function rP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(rP.prototype=Object.create(Di.prototype),rP.prototype.constructor=rP);rP.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,KUt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Di.prototype._isHidden.call(this,e,t,n)};rP.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?gn.ALL:void 0};var n4=md;var JUt=D.factorial;function Oae(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+=Oae(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 ZUt=[],Mae=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/JUt(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=Oae(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=ZUt,m=QUt(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=Oae(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 QUt(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 i4=Mae;var Nae=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}},r4=Nae;function Pl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Pl.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new Pl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};Pl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Pl(e.clock,e.cone,e.magnitude)};Pl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Pl(e.clock,e.cone,1)};Pl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Pl.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};Pl.prototype.equals=function(e){return Pl.equals(this,e)};Pl.prototype.clone=function(e){return Pl.clone(this,e)};Pl.prototype.equalsEpsilon=function(e,t){return Pl.equalsEpsilon(this,e,t)};Pl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var o4=Pl;var u4=Qo(Ef(),1);var ezt=z.WHITE,tzt=.1,nzt=new U(8,8),izt=new U(0,0),rzt=new U(1,1);function oP(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(oP.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")});oP.prototype.getType=function(e){return"Grid"};var ozt=new K;oP.prototype.getValue=function(e,t){return l(e)||(e=K.now(ozt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ezt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,tzt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,nzt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,rzt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,izt,t.lineOffset),t};oP.prototype.equals=function(e){return this===e||e instanceof oP&&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 sP=oP;var WLe={WHOLE:0,PORTIONS:1};Object.freeze(WLe);var j0=WLe;function aP(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(aP.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});aP.prototype.getType=function(e){return"PolylineArrow"};var szt=new K;aP.prototype.getValue=function(e,t){return l(e)||(e=K.now(szt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};aP.prototype.equals=function(e){return this===e||e instanceof aP&&X.equals(this._color,e._color)};var cP=aP;var azt=z.WHITE,czt=z.TRANSPARENT,lzt=16,uzt=255;function lP(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(lP.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")});lP.prototype.getType=function(e){return"PolylineDash"};var fzt=new K;lP.prototype.getValue=function(e,t){return l(e)||(e=K.now(fzt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,azt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,czt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,lzt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,uzt,t.dashPattern),t};lP.prototype.equals=function(e){return this===e||e instanceof lP&&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 uP=lP;var dzt=z.WHITE,hzt=.25,mzt=1;function fP(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(fP.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")});fP.prototype.getType=function(e){return"PolylineGlow"};var pzt=new K;fP.prototype.getValue=function(e,t){return l(e)||(e=K.now(pzt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,dzt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,hzt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,mzt,t.taperPower),t};fP.prototype.equals=function(e){return this===e||e instanceof fP&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var dP=fP;var gzt=z.WHITE,_zt=z.BLACK,yzt=1;function hP(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(hP.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")});hP.prototype.getType=function(e){return"PolylineOutline"};var Azt=new K;hP.prototype.getValue=function(e,t){return l(e)||(e=K.now(Azt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,gzt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,_zt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,yzt),t};hP.prototype.equals=function(e){return this===e||e instanceof hP&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var Db=hP;function Rb(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new $o,this.setValue(e)}Object.defineProperties(Rb.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 bzt=new K;Rb.prototype.getValue=function(e,t){l(e)||(e=K.now(bzt));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};Rb.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,Rb.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Rb.prototype.equals=function(e){return this===e||e instanceof Rb&&X.arrayEquals(this._value,e._value)};Rb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var mP=Rb;var xzt={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}},wh=xzt;var qLe={HORIZONTAL:0,VERTICAL:1};Object.freeze(qLe);var ap=qLe;var Tzt=ap.HORIZONTAL,Ezt=z.WHITE,Czt=z.BLACK,vzt=0,Szt=1;function pP(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(pP.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")});pP.prototype.getType=function(e){return"Stripe"};var wzt=new K;pP.prototype.getValue=function(e,t){return l(e)||(e=K.now(wzt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,Tzt)===ap.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,Ezt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,Czt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,vzt),t.repeat=X.getValueOrDefault(this._repeat,e,Szt),t};pP.prototype.equals=function(e){return this===e||e instanceof pP&&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 gP=pP;function Ob(e){this._definitionChanged=new be,this._intervals=new Rs,this._intervals.changedEvent.addEventListener(Ob.prototype._intervalsChanged,this),this._referenceFrame=e??Gi.FIXED}Object.defineProperties(Ob.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 Izt=new K;Ob.prototype.getValue=function(e,t){return l(e)||(e=K.now(Izt)),this.getValueInReferenceFrame(e,Gi.FIXED,t)};Ob.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Hm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ob.prototype.equals=function(e){return this===e||e instanceof Ob&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};Ob.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var my=Ob;function _P(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(_P.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 Pzt=new h,YLe=new h,XLe=new K,Dzt=new K,Lae=1/60;_P.prototype.getValue=function(e,t){return this._getValue(e,t)};_P.prototype._getValue=function(e,t,n){l(e)||(e=K.now(Dzt)),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,Pzt),o=i.getValue(K.addSeconds(e,Lae,XLe),YLe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-Lae,XLe),YLe),!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,Lae,t)};_P.prototype.equals=function(e){return this===e||e instanceof _P&&X.equals(this._position,e._position)};var py=_P;function s4(e,t){this._velocityVectorProperty=new py(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(s4.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 KLe=new h,Rzt=new h,$Le=new $,Ozt=new K;s4.prototype.getValue=function(e,t){l(e)||(e=K.now(Ozt));let n=this._velocityVectorProperty._getValue(e,Rzt,KLe);if(l(n))return At.rotationMatrixFromPositionVelocity(KLe,n,this._ellipsoid,$Le),Le.fromRotationMatrix($Le,t)};s4.prototype.equals=function(e){return this===e||e instanceof s4&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var a4=s4;function Mb(){}Mb.packedLength=h.packedLength;Mb.unpack=h.unpack;Mb.pack=h.pack;var Fae;function c4(e,t){return t[0]==="#"&&(t=Fae+t),q_.fromString(e,t)}function JLe(e,t,n){if(l(n.reference))return c4(t,n.reference);if(l(n.velocityReference)){let i=c4(t,n.velocityReference);switch(e){case h:case Mb:return new py(i,e===Mb);case Le:return new a4(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function Mzt(e,t){return new $m(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var _r=new h,Au=new o4,Dl=new he,wC=new Cn,uW=new Le;function Nzt(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 ZLe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function Lzt(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 Fzt(e){let t=e.length;if(Au.magnitude=1,t===2)return Au.clock=e[0],Au.cone=e[1],h.fromSpherical(Au,_r),[_r.x,_r.y,_r.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Au.clock=e[i+1],Au.cone=e[i+2],h.fromSpherical(Au,_r),n[r+1]=_r.x,n[r+2]=_r.y,n[r+3]=_r.z;return n}function Bzt(e){let t=e.length;if(t===3)return Au.clock=e[0],Au.cone=e[1],Au.magnitude=e[2],h.fromSpherical(Au,_r),[_r.x,_r.y,_r.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Au.clock=e[i+1],Au.cone=e[i+2],Au.magnitude=e[i+3],h.fromSpherical(Au,_r),n[i+1]=_r.x,n[i+2]=_r.y,n[i+3]=_r.z;return n}function kzt(e){let t=e.length;if(t===3)return Dl.longitude=e[0],Dl.latitude=e[1],Dl.height=e[2],ee.default.cartographicToCartesian(Dl,_r),[_r.x,_r.y,_r.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Dl.longitude=e[i+1],Dl.latitude=e[i+2],Dl.height=e[i+3],ee.default.cartographicToCartesian(Dl,_r),n[i+1]=_r.x,n[i+2]=_r.y,n[i+3]=_r.z;return n}function Uzt(e){let t=e.length;if(t===3)return Dl.longitude=D.toRadians(e[0]),Dl.latitude=D.toRadians(e[1]),Dl.height=e[2],ee.default.cartographicToCartesian(Dl,_r),[_r.x,_r.y,_r.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Dl.longitude=D.toRadians(e[i+1]),Dl.latitude=D.toRadians(e[i+2]),Dl.height=e[i+3],ee.default.cartographicToCartesian(Dl,_r),n[i+1]=_r.x,n[i+2]=_r.y,n[i+3]=_r.z;return n}function Bae(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 Fzt(r);let o=e.spherical;if(l(o))return Bzt(o);let s=e.cartographicRadians;if(l(s))return kzt(s);let a=e.cartographicDegrees;if(l(a))return Uzt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function QLe(e,t){h.unpack(e,t,_r),h.normalize(_r,_r),h.pack(_r,e,t)}function zzt(e){let t=Bae(e);if(t.length===3)return QLe(t,0),t;for(let n=1;n<t.length;n+=4)QLe(t,n);return t}function eFe(e,t){Le.unpack(e,t,uW),Le.normalize(uW,uW),Le.pack(uW,e,t)}function Vzt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return eFe(t,0),t;for(let n=1;n<t.length;n+=5)eFe(t,n)}return t}function tFe(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")?Mb:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?un:e.hasOwnProperty("classificationType")?ei:e.hasOwnProperty("colorBlendMode")?dl:e.hasOwnProperty("cornerType")?cr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?ji:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?yo: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")?j0:e.hasOwnProperty("shadowMode")?Pn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?ap:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?u4.default:e.hasOwnProperty("verticalOrigin")?Hn:Object}function jzt(e,t,n){switch(e){case un:return un[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 Bae(t);case Mb:return zzt(t);case z:return Nzt(t);case ei:return ei[t.classificationType??t];case dl:return dl[t.colorBlendMode??t];case cr:return cr[t.cornerType??t];case We:return We[t.heightReference??t];case ji:return ji[t.horizontalOrigin??t];case Image:return ZLe(t,n);case K:return K.fromIso8601(t.date??t);case yo:return yo[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 j0:return j0[t.pathMode??t];case Le:return Vzt(t);case wh:return t.number??t;case NI:return NI[t.portionToDisplay??t];case Pn:return Pn[t.shadowMode??t.shadows??t];case String:return t.string??t;case ap:return ap[t.stripeOrientation??t];case ie:return Lzt(t);case u4.default:return ZLe(t,n);case Hn:return Hn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var Hzt={HERMITE:i4,LAGRANGE:r4,LINEAR:sb};function fW(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Hzt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=du[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=du[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var nFe={iso8601:void 0};function Jo(e){if(l(e))return nFe.iso8601=e,Cn.fromIso8601(nFe)}function kae(e){let t=nt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function iFe(e){let t=new El;return t.intervals.addInterval(kae(e)),t}function rFe(e){let t=new yc(e.referenceFrame);return t.intervals.addInterval(kae(e)),t}function dW(e,t,n,i,r,o,s){let a=Jo(i.interval);l(r)&&(l(a)?a=Cn.intersect(a,r,wC):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 pFe(t[n],a)}let g=!1;if(d){if(u=jzt(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!==wh;if(!g&&!p){d?t[n]=new di(m?e.unpack(u,0):u):t[n]=JLe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof od||(t[n]=y=new od(e)),y.addSamplesPackedArray(u,A),fW(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=JLe(e,s,i),l(y)||(t[n]=y=d?new Y_:new El),d&&y instanceof Y_?y.intervals.addInterval(a):y instanceof El?(d&&(a.data=new di(a.data)),y.intervals.addInterval(a)):(t[n]=y=iFe(y),d&&(a.data=new di(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new El),y instanceof El||(t[n]=y=iFe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof od))&&(x=a.clone(),x.data=new od(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),fW(i,x.data)}function pFe(e,t){if(e instanceof od){e.removeSamples(t);return}else if(e instanceof Y_){e.intervals.removeInterval(t);return}else if(e instanceof El){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,wC);r.isEmpty||pFe(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)dW(e,t,n,i[a],r,o,s);else dW(e,t,n,i,r,o,s)}function oFe(e,t,n,i,r,o){let s=Jo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,wC):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 gFe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Gi[n.referenceFrame]),g=g??Gi.FIXED,u=Bae(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new uu(h.unpack(u),g):e[t]=c4(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof Ac)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ac(g,a)),y.addSamplesPackedArray(u,A),fW(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=c4(o,n.reference),l(y)||(d?y=new my(g):y=new yc(g),e[t]=y),d&&y instanceof my&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof yc?(d&&(s.data=new uu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=rFe(y),d&&(s.data=new uu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof yc||(e[t]=y=rFe(y)):e[t]=y=new yc(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Ac)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new Ac(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),fW(n,x.data)}function gFe(e,t){if(e instanceof Ac){e.removeSamples(t);return}else if(e instanceof my){e.intervals.removeInterval(t);return}else if(e instanceof yc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,wC);r.isEmpty||gFe(r.data,t)}n.removeInterval(t);return}}function _Fe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)oFe(e,t,n[s],i,r,o);else oFe(e,t,n,i,r,o)}function sFe(e,t,n,i){l(n.references)?hW(e,t,n.references,n.interval,i,mP,El):(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 aFe(e,t,n,i,r,o){let s=Jo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,wC):s=i);let a=e[t],c,u;if(l(s)){a instanceof JI||(a=new JI,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 sP||(c=new sP),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 rb||(c=new rb),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 gP||(c=new gP),f=n.stripe,Ee(ap,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 Db||(c=new Db),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 dP||(c=new dP),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 cP||(c=new cP),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof uP||(c=new uP),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 KI||(c=new KI),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 pd(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)aFe(e,t,n[s],i,r,o);else aFe(e,t,n,i,r,o)}function Gzt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function Wzt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function qzt(e,t,n,i){let r=t.position;l(r)&&_Fe(e,"position",r,void 0,i,n)}function Yzt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function Xzt(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function Kzt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new fu);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)dW(tFe(s[a]),e.properties,o,s[a],void 0,i,n);else dW(tFe(s),e.properties,o,s,void 0,i,n)}}}function hW(e,t,n,i,r,o,s){let a=n.map(function(c){return c4(r,c)});if(l(i)){i=Jo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(kae(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function cFe(e,t,n,i){let r=n.references;l(r)?hW(e,t,r,n.interval,i,mP,El):Ee(Array,e,t,n,void 0,void 0,i)}function lFe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)cFe(e,t,n[r],i);else cFe(e,t,n,i)}function uFe(e,t,n,i){let r=n.references;l(r)?hW(e,t,r,n.interval,i,W_,yc):(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 f4(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)uFe(e,t,n[r],i);else uFe(e,t,n,i)}function $zt(e){return h.unpackArray(e)}function Jzt(e){return h.fromRadiansArrayHeights(e,ee.default)}function Zzt(e){return h.fromDegreesArrayHeights(e,ee.default)}function fFe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return hW(a,"positions",s,n.interval,i,W_,yc),a.positions});e[t]=new W_(o)}else l(n.cartesian)?n.array=n.cartesian.map($zt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Jzt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(Zzt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function Qzt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)fFe(e,t,n[r],i);else fFe(e,t,n,i)}function eVt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)sFe(e,t,n[r],i);else sFe(e,t,n,i)}function tVt(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 Rs),o.addInterval(Jo(r[s]));else o=new Rs,o.addInterval(Jo(r));e.availability=o}function nVt(e,t,n,i,r){l(t)&&Ee(Mb,e,"alignedAxis",t,n,i,r)}function iVt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Jo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Tl),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(ji,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Hn,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(wh,s,"rotation",r.rotation,o,i,n),nVt(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 rVt(e,t,n,i){let r=t.box;if(!l(r))return;let o=Jo(r.interval),s=e.box;l(s)||(e.box=s=new NE),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),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function oVt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Jo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new FE),Ee(Boolean,s,"show",r.show,o,i,n),f4(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(cr,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),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function sVt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Jo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new BE),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),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function aVt(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 cVt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Jo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new kE),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(wh,s,"rotation",r.rotation,o,i,n),Ee(wh,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),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function lVt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Jo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new UE),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),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function uVt(e,t,n,i){let r=t.label;if(!l(r))return;let o=Jo(r.interval),s=e.label;l(s)||(e.label=s=new Gm),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(yo,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(ji,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Hn,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 fVt(e,t,n,i){let r=t.model;if(!l(r))return;let o=Jo(r.interval),s=e.model;l(s)||(e.model=s=new V_),Ee(Boolean,s,"show",r.show,o,i,n),Ee(u4.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(Pn,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(dl,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)dFe(s,u[a],o,i,n);else dFe(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)hFe(s,f[a],o,i,n);else hFe(s,f,o,i,n)}function dFe(e,t,n,i,r){let o=Jo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,wC):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 fu),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new zE),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 hFe(e,t,n,i,r){let o=Jo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,wC):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 fu),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function dVt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Jo(r.interval),s=e.path;l(s)||(e.path=s=new j_),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),pd(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(j0,s,"materialMode",r.materialMode,o,i,n)}function hVt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Jo(r.interval),s=e.point;l(s)||(e.point=s=new jE),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 l4(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(l4.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}}});l4.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 Mc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Mc(n,i)};l4.prototype.equals=function(e){return this===e||e instanceof l4&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function mVt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Jo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new Wm),Ee(Boolean,s,"show",r.show,o,i,n),f4(s,"_positions",r.positions,n),Qzt(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new l4(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(wh,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),pd(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(un,s,"arcType",r.arcType,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function pVt(e){return e?un.GEODESIC:un.NONE}function gVt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Jo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Cl),Ee(Boolean,s,"show",r.show,o,i,n),f4(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),pd(s,"material",r.material,o,i,n),pd(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(un,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,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=Mzt(a.followSurface,pVt)}}function _Vt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Jo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new HE),f4(s,"positions",r.positions,n),eVt(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(cr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function yVt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Jo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new qm),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(wh,s,"rotation",r.rotation,o,i,n),Ee(wh,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),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function AVt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Jo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new VE),Ee(Boolean,s,"show",r.show,o,i,n),Ee(u4.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function bVt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Jo(r.interval),s=e.wall;l(s)||(e.wall=s=new H_),Ee(Boolean,s,"show",r.show,o,i,n),f4(s,"positions",r.positions,n),lFe(s,"minimumHeights",r.minimumHeights,n),lFe(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),pd(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function mFe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Jn()),Fae=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")aVt(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)}Fae=void 0}function xVt(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=Ps.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Vr.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=Ps.LOOP_STOP,t.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Jo(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=Vr[n.step]??Vr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function yFe(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),Ls.setLoading(e,!0),Promise.resolve(r).then(function(a){return TVt(e,a,o,i)}).catch(function(a){return Ls.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function TVt(e,t,n,i){Ls.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new AFe,r.removeAll()),fa._processCzml(t,r,n,void 0,e);let o=xVt(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=S_(n.getUrlComponent()),o=!0),Ls.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function AFe(){this.name=void 0,this.clock=void 0}function fa(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 AFe,this._version=void 0,this._entityCollection=new Qa(this),this._entityCluster=new rd,this._credit=void 0,this._resourceCredits=[]}fa.load=function(e,t){return new fa().load(e,t)};Object.defineProperties(fa.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}}});fa.updaters=[iVt,rVt,oVt,sVt,cVt,lVt,uVt,fVt,Gzt,Wzt,dVt,hVt,mVt,gVt,_Vt,Kzt,yVt,qzt,AVt,Yzt,bVt,Xzt,tVt];fa.registerUpdater=function(e){fa.updaters.includes(e)||fa.updaters.push(e)};fa.unregisterUpdater=function(e){if(fa.updaters.includes(e)){let t=fa.updaters.indexOf(e);fa.updaters.splice(t,1)}};fa.prototype.process=function(e,t){return yFe(this,e,t,!1)};fa.prototype.load=function(e,t){return yFe(this,e,t,!0)};fa.prototype.update=function(e){return!0};fa.processPacketData=Ee;fa.processPositionPacketData=_Fe;fa.processMaterialPacketData=pd;fa._processCzml=function(e,t,n,i,r){if(i=i??fa.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)mFe(e[o],t,i,n,r);else mFe(e,t,i,n,r)};var d4=fa;function bu(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(bu.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}}});bu.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})};bu.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};bu.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=[]};bu.prototype.contains=function(e){return this.indexOf(e)!==-1};bu.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};bu.prototype.get=function(e){return this._dataSources[e]};bu.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function mW(e,t){return e.indexOf(t)}function bFe(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)}bu.prototype.raise=function(e){let t=mW(this._dataSources,e);bFe(this,t,t+1)};bu.prototype.lower=function(e){let t=mW(this._dataSources,e);bFe(this,t,t-1)};bu.prototype.raiseToTop=function(e){let t=mW(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))};bu.prototype.lowerToBottom=function(e){let t=mW(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};bu.prototype.isDestroyed=function(){return!1};bu.prototype.destroy=function(){return this.removeAll(!0),le(this)};var h4=bu;function yP(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ut}yP.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};yP.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};yP.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};yP.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};yP.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var IC=yP;var zae={},pW=new h,xFe=new h,TFe=new Le,EFe=new $;function AP(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),pW),h.multiplyByScalar(n,Math.sin(f),xFe),h.add(pW,xFe,pW);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(pW,m,TFe),$.fromQuaternion(TFe,EFe),$.multiplyByVector(EFe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var CFe=new h,vFe=new h,Uae=new h,EVt=new h;zae.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,CFe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,vFe),y=i.geodeticSurfaceNormal(g,EVt),A=h.multiplyByScalar(y,r,Uae);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 CVt=new h,vVt=new h,SVt=new h;zae.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,CVt),g=h.cross(h.UNIT_Z,s,vVt);g=h.normalize(g,g);let m=h.cross(p,g,SVt),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=CFe,S=vFe,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=AP(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=AP(b,o,m,g,c,f,u,d,p,v),S=AP(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,Uae),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=AP(-b,o,m,g,c,f,u,d,p,v),S=AP(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,Uae),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=AP(-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 mf=zae;var bP=new h,Vae=new h,jae=new h,SFe=new h,Oa=new U,wFe=new $,wVt=new $,Hae=new Le,IFe=new h,PFe=new h,DFe=new h,yW=new he,RFe=new h,OFe=new U,MFe=new U;function NFe(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=IFe,x=PFe,T=DFe,E=new zi(a),v=E.project(a.cartesianToCartographic(r,yW),RFe),S=a.scaleToGeodeticSurface(r,bP);a.geodeticSurfaceNormal(S,S);let I=wFe,R=wVt;if(c!==0){let M=Le.fromAxisAngle(S,c,Hae);I=$.fromQuaternion(M,I),M=Le.fromAxisAngle(S,-c,Hae),R=$.fromQuaternion(M,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,OFe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,MFe),_=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,bP);if(i.st){let j=$.multiplyByVector(I,B,Vae),k=E.project(a.cartesianToCartographic(j,yW),jae);h.subtract(k,v,k),Oa.x=(k.x+o)/(2*o),Oa.y=(k.y+s)/(2*s),O.x=Math.min(Oa.x,O.x),O.y=Math.min(Oa.y,O.y),L.x=Math.max(Oa.x,L.x),L.y=Math.max(Oa.y,L.y),n&&(d[A+w]=Oa.x,d[A+1+w]=Oa.y),d[A++]=Oa.x,d[A++]=Oa.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 En;if(i.position){let M=mf.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===gn.TOP)M=M.fill(1,0,u/2);else{let F=t.offsetAttribute===gn.NONE?0:1;M=M.fill(F)}P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return P}function LFe(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 PC=new h;function IVt(e){let t=e.center;PC=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,PC),e.height,PC),PC=h.add(t,PC,PC);let n=new ue(PC,e.semiMajorAxis),i=mf.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=NFe(r,e,!1),a=LFe(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function PVt(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=IFe,E=PFe,v=DFe,S=new zi(s),I=S.project(s.cartesianToCartographic(i,yW),RFe),R=s.scaleToGeodeticSurface(i,bP);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,Hae),L=$.fromQuaternion(O,wFe),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,OFe),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,MFe),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,bP),k;if(n.st){let q=$.multiplyByVector(L,j,Vae),Q=S.project(s.cartesianToCartographic(q,yW),jae);h.subtract(Q,I,Q),Oa.x=(Q.x+r)/(2*r),Oa.y=(Q.y+o)/(2*o),_.x=Math.min(Oa.x,_.x),_.y=Math.min(Oa.y,_.y),C.x=Math.max(Oa.x,C.x),C.y=Math.max(Oa.y,C.y),p[x+P]=Oa.x,p[x+1+P]=Oa.y,p[x++]=Oa.x,p[x++]=Oa.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,Vae),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,SFe);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,SFe);h.subtract(q,j,q);let Q=h.subtract(k,j,jae);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 En;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===gn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===gn.NONE?0:1;F=F.fill(V)}M.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return M}function DVt(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 gW=new ue,_W=new ue;function RVt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,bP),e.height,bP);gW.center=h.add(t,r,gW.center),gW.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),_W.center=h.add(t,r,_W.center),_W.radius=i;let o=mf.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(gW,_W),f=NFe(s,e,!0),d=LFe(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=PVt(c,e);d=DVt(c);let b=je.createTypedArray(c.length*2/3,d),x=new St({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Gn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function FFe(e,t,n,i,r,o,s){let c=mf.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 G0(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}G0.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;G0.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 BFe=new h,kFe=new ee,UFe=new Be,H0={center:BFe,ellipsoid:kFe,vertexFormat:UFe,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};G0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,BFe);t+=h.packedLength;let r=ee.unpack(e,t,kFe);t+=ee.packedLength;let o=Be.unpack(e,t,UFe);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):(H0.height=f,H0.extrudedHeight=p,H0.granularity=d,H0.stRotation=u,H0.rotation=c,H0.semiMajorAxis=s,H0.semiMinorAxis=a,H0.shadowVolume=g,H0.offsetAttribute=m===-1?void 0:m,new G0(H0))};G0.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 FFe(n,r,o,a,s,i,t)};G0.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=RVt(r);else if(o=IVt(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===gn.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})};G0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new G0({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 OVt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=mf.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(G0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=FFe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=OVt(this)),this._textureCoordinateRotationPoints}}});var xu=G0;var zFe=new h,DC=new h;function MVt(e){let t=e.center;DC=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,DC),e.height,DC),DC=h.add(t,DC,DC);let n=new ue(DC,e.semiMajorAxis),i=mf.computeEllipsePositions(e,!1,!0).outerPositions,r=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:mf.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 AW=new ue,bW=new ue;function NVt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,zFe),e.height,zFe);AW.center=h.add(t,r,AW.center),AW.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),bW.center=h.add(t,r,bW.center),bW.radius=i;let o=mf.computeEllipsePositions(e,!1,!0).outerPositions,s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:mf.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(AW,bW),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===gn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===gn.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 xP(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"}xP.packedLength=h.packedLength+ee.packedLength+8;xP.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 VFe=new h,jFe=new ee,gy={center:VFe,ellipsoid:jFe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};xP.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,VFe);t+=h.packedLength;let r=ee.unpack(e,t,jFe);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):(gy.height=c,gy.extrudedHeight=f,gy.granularity=u,gy.rotation=a,gy.semiMajorAxis=o,gy.semiMinorAxis=s,gy.numberOfVerticalLines=d,gy.offsetAttribute=p===-1?void 0:p,new xP(gy))};xP.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=NVt(r);else if(o=MVt(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===gn.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 gd=xP;var HFe=new z,GFe=h.ZERO,WFe=new h,qFe=new ie;function LVt(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 cp(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new LVt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(cp.prototype=Object.create(ii.prototype),cp.prototype.constructor=cp);cp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,HFe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,GFe,WFe))),new Bt({id:t,geometry:new xu(this._options),attributes:i})};cp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,HFe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,GFe,WFe))),new Bt({id:t,geometry:new gd(this._options),attributes:o})};cp.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};cp.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Ri.prototype._isHidden.call(this,e,t)};cp.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)};cp.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:Cr.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=Ni.getMinimumMaximumHeights(xu.computeRectangle(s,qFe)).minimumTerrainHeight),s.extrudedHeight=r};cp.DynamicGeometryUpdater=TP;function TP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(TP.prototype=Object.create(Di.prototype),TP.prototype.constructor=TP);TP.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Di.prototype._isHidden.call(this,e,t,n)};TP.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=Ni.getMinimumMaximumHeights(xu.computeRectangle(i,qFe)).minimumTerrainHeight),i.extrudedHeight=s};var m4=cp;var FVt=new Kt(z.WHITE),Gae=h.ZERO,Wae=new h,BVt=new h,kVt=new h,qae=new z,UVt=new h(1,1,1);function zVt(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 _d(e,t){Ri.call(this,{entity:e,scene:t,geometryOptions:new zVt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(_d.prototype=Object.create(Ri.prototype),_d.prototype.constructor=_d);Object.defineProperties(_d.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});_d.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ni.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,qae)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Gae,Wae))),new Bt({id:i,geometry:new Xa(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};_d.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,qae),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:ni.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Gae,Wae))),new Bt({id:i,geometry:new qf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};_d.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};_d.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ri.prototype._isHidden.call(this,e,t)};_d.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)};_d.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:Cr.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?gn.ALL:void 0};_d.prototype._onEntityPropertyChanged=ly;_d.DynamicGeometryUpdater=p4;function p4(e,t,n){Di.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)&&(p4.prototype=Object.create(Di.prototype),p4.prototype.constructor=p4);p4.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,BVt),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,qae),c=Co.getValue(e,n.material??FVt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,kVt),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?gn.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,Gae,Wae);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?UVt: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 Cr({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=Dn.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=Dn.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=ni.toValue(O,P.distanceDisplayCondition),M.distanceDisplayCondition=ni.toValue(O,M.distanceDisplayCondition),Ht.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(P.offset=Er.toValue(L,P.offset),M.offset=Er.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 g4=_d;function EP(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}EP.packedLength=Be.packedLength;EP.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var YFe=new Be,VVt={vertexFormat:YFe};EP.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,YFe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new EP(VVt)};var xW=new h(-.5,-.5,0),TW=new h(.5,.5,0);EP.createGeometry=function(e){let t=e._vertexFormat,n=new En,i,r;if(t.position){if(r=new Float64Array(12),r[0]=xW.x,r[1]=xW.y,r[2]=0,r[3]=TW.x,r[4]=xW.y,r[5]=0,r[6]=TW.x,r[7]=TW.y,r[8]=0,r[9]=xW.x,r[10]=TW.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 ue(h.ZERO,Math.sqrt(2))})};var _4=EP;function CP(){this._workerName="createPlaneOutlineGeometry"}CP.packedLength=0;CP.pack=function(e,t){return t};CP.unpack=function(e,t,n){return l(n)?n:new CP};var Nb=new h(-.5,-.5,0),EW=new h(.5,.5,0);CP.createGeometry=function(){let e=new En,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=Nb.x,n[1]=Nb.y,n[2]=Nb.z,n[3]=EW.x,n[4]=Nb.y,n[5]=Nb.z,n[6]=EW.x,n[7]=EW.y,n[8]=Nb.z,n[9]=Nb.x,n[10]=EW.y,n[11]=Nb.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 ue(h.ZERO,Math.sqrt(2))})};var y4=CP;var jVt=new h,XFe=new z;function HVt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Ih(e,t){Ri.call(this,{entity:e,scene:t,geometryOptions:new HVt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Ih.prototype=Object.create(Ri.prototype),Ih.prototype.constructor=Ih);Ih.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ni.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,XFe)),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=Yae(d,p,f,f),new Bt({id:t,geometry:new _4(this._options),modelMatrix:f,attributes:i})};Ih.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,XFe),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=Yae(c,u,a,a),new Bt({id:t,geometry:new y4,modelMatrix:a,attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r)}})};Ih.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ri.prototype._isHidden.call(this,e,t)};Ih.prototype._getIsClosed=function(e){return!1};Ih.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Ih.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(nt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions)};Ih.DynamicGeometryUpdater=vP;function vP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(vP.prototype=Object.create(Di.prototype),vP.prototype.constructor=vP);vP.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,jVt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Di.prototype._isHidden.call(this,e,t,n)};vP.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 GVt=new h,WVt=new h,qVt=new h,YVt=new h,XVt=new $,KVt=new $,$Vt=new N;function Yae(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,qVt),a=h.clone(h.UNIT_Z,WVt);D.equalsEpsilon(Math.abs(h.dot(a,r)),1,D.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,GVt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=XVt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,YVt),d=$.multiplyByScale(u,f,KVt),p=N.fromRotationTranslation(d,s,$Vt);return N.multiplyTransformation(n,p,i)}Ih.createPrimitiveMatrix=Yae;var A4=Ih;var JVt=new h,ZVt=new et,QVt=new U,e4t=new U,t4t=new h,n4t=new h,i4t=new h,b4=new h,r4t=new h,o4t=new h,KFe=new Le,s4t=new $,a4t=new $,c4t=new h;function l4t(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=s4t;if(i!==0){let _=Le.fromAxisAngle(s,i,KFe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,KFe);let C=$.fromQuaternion(_,a4t);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=e4t;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,JVt),P=o(w,QVt);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 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 St({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function RC(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=ti.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ti.computeHierarchyPackedLength(n,U):1)+2}RC.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 RC(t)};RC.pack=function(e,t,n){return n=n??0,n=ti.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=ti.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var u4t=ee.clone(ee.UNIT_SPHERE),f4t=new Be,d4t={polygonHierarchy:{}};RC.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,u4t);t+=ee.packedLength;let o=Be.unpack(e,t,f4t);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ti.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new RC(d4t)),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};RC.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Br(s,h.equalsEpsilon,!0),s.length<3)return;let a=t4t,c=n4t,u=i4t,f=r4t,d=o4t;if(!a_.computeProjectTo2DArguments(s,b4,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(b4,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(b4,c4t);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=a_.createProjectPointsTo2DFunction(b4,f,d),m=a_.createProjectPointTo2DFunction(b4,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ti.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ti.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ti.computeBoundingRectangle(a,m,s,i,ZVt),S=[];for(let O=0;O<b.length;O++){let L=new Bt({geometry:l4t(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Gn.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 x4=RC;var $Fe=[],CW=[];function h4t(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,$Fe);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===un.GEODESIC)for(u=0;u<f;u++)m+=ti.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===un.RHUMB)for(u=0;u<f;u++)m+=ti.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===un.GEODESIC?y=ti.subdivideLine(t[u],t[(u+1)%f],n,CW):r===un.RHUMB&&(y=ti.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,CW));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 St({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function m4t(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,$Fe);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===un.GEODESIC)for(u=0;u<f;u++)A+=ti.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===un.RHUMB)for(u=0;u<f;u++)A+=ti.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===un.GEODESIC?b=ti.subdivideLine(t[u],t[(u+1)%f],n,CW):r===un.RHUMB&&(b=ti.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,CW));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 St({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function OC(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??un.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=ti.computeHierarchyPackedLength(t,h)+ee.packedLength+8}OC.pack=function(e,t,n){return n=n??0,n=ti.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 p4t=ee.clone(ee.UNIT_SPHERE),g4t={polygonHierarchy:{}};OC.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,p4t);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 OC(g4t)),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};OC.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 OC(t)};OC.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ti.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=m4t(t,s[m],u,r,o),a.geometry=ti.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===gn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===gn.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=h4t(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===gn.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=Gn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new St({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var T4=OC;var JFe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",ZFe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",QFe=new z,eBe=h.ZERO,tBe=new h,nBe=new ie,_4t=[],y4t=new U;function A4t(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 yd(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new A4t(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(yd.prototype=Object.create(ii.prototype),yd.prototype.constructor=yd);yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,QFe)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,eBe,tBe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new x4(i):o=new Jp(i),new Bt({id:t,geometry:o,attributes:r})};yd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,QFe),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:ni.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,eBe,tBe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new nh(i):a=new T4(i),new Bt({id:t,geometry:a,attributes:s})};yd.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,_4t),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,y4t);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)};yd.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ri.prototype._isHidden.call(this,e,t)};yd.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};yd.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)};yd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Cr.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(JFe)),s!==We.NONE&&u&&(o=void 0,_t(ZFe))):(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,un.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,nt.MINIMUM_VALUE),a=ii.getGeometryExtrudedHeight(a,c),a===ii.CLAMP_TO_GROUND){let d=Jp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,nBe);a=Ni.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};yd.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)};yd.DynamicGeometryUpdater=SP;function SP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(SP.prototype=Object.create(Di.prototype),SP.prototype.constructor=SP);SP.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Di.prototype._isHidden.call(this,e,t,n)};SP.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(JFe)),o!==We.NONE&&c&&(r=void 0,_t(ZFe))):(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,un.GEODESIC),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND){let f=Jp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,nBe);a=Ni.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var E4=yd;function b4t(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=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:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Gn.computeNormal(E)),i.tangent||i.bitangent){try{E=Gn.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 v4(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??cr.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}v4.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 iBe=ee.clone(ee.UNIT_SPHERE),rBe=new Be,C4={polylinePositions:void 0,shapePositions:void 0,ellipsoid:iBe,vertexFormat:rBe,cornerType:void 0,granularity:void 0};v4.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,iBe);t+=ee.packedLength;let c=Be.unpack(e,t,rBe);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):(C4.polylinePositions=o,C4.shapePositions=s,C4.cornerType=u,C4.granularity=f,new v4(C4))};var x4t=new et;v4.createGeometry=function(e){let t=e._positions,n=Br(t,h.equalsEpsilon),i=e._shape;if(i=rp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,x4t),o=rp.computePositions(n,i,r,e,!0);return b4t(o,i,r,e._vertexFormat)};var S4=v4;function T4t(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 St({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:ue.fromVertices(e),primitiveType:Oe.LINES})}function I4(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??cr.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}I4.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 oBe=ee.clone(ee.UNIT_SPHERE),w4={polylinePositions:void 0,shapePositions:void 0,ellipsoid:oBe,height:void 0,cornerType:void 0,granularity:void 0};I4.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,oBe);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):(w4.polylinePositions=o,w4.shapePositions=s,w4.cornerType=c,w4.granularity=u,new I4(w4))};var E4t=new et;I4.createGeometry=function(e){let t=e._positions,n=Br(t,h.equalsEpsilon),i=e._shape;if(i=rp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ui.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,E4t),o=rp.computePositions(n,i,r,e,!1);return T4t(o,i)};var P4=I4;var sBe=new z;function C4t(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 W0(e,t){Ri.call(this,{entity:e,scene:t,geometryOptions:new C4t(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(W0.prototype=Object.create(Ri.prototype),W0.prototype.constructor=W0);W0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ni.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,sBe)),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 S4(this._options),attributes:i})};W0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,sBe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new P4(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r)}})};W0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ri.prototype._isHidden.call(this,e,t)};W0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};W0.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:Cr.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};W0.DynamicGeometryUpdater=wP;function wP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(wP.prototype=Object.create(Di.prototype),wP.prototype.constructor=wP);wP.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Di.prototype._isHidden.call(this,e,t,n)};wP.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 D4=W0;var Xae=new h,lBe=new h,uBe=new h,fBe=new h,dBe=new ie,v4t=new U,S4t=new ue,w4t=new ue;function hBe(e,t){let n=new St({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 I4t(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=fBe,f=uBe,d=lBe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,Xae),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 hBe(t,{positions:e,normals:o,tangents:s,bitangents:a})}var Kae=new h,mBe=new h;function P4t(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=fBe,p=uBe,g=lBe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,Xae),A=h.fromArray(e,(m+6)%i,Kae);if(f){let b=h.fromArray(e,(m+3)%i,mBe);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 hBe(t,{positions:e,normals:r,tangents:o,bitangents:s})}function pBe(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=Xae,b=v4t,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)Sa.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&&(Sa.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&&(Sa.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=I4t(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 IP(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 PP(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 $ae=new Be;function D4t(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,$ae);Pe.normal=!0,e._vertexFormat=Pe}let d=pBe(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===gn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===gn.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===gn.TOP;R&&!J&&(I=i===gn.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=IP(G,Z,ge,p,A),Z+=6,r.st&&(W=PP(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=IP(G,Z,ge,p,A),Z+=6,r.st&&(W=PP(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=IP(G,Z,ge,p,A),Z+=6,r.st&&(W=PP(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=IP(G,Z,ge,p,A),Z+=6,r.st&&(W=PP(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=IP(G,Z,ge,p,A),Z+=6,r.st&&(W=PP(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=IP(G,Z,ge,p,A),Z+=6,r.st&&(W=PP(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=P4t(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,Kae),qe=h.fromArray(G,Xe*3,mBe);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=Gn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var R4t=[new h,new h,new h,new h],gBe=new he,O4t=new he;function Jae(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Sa.computeOptions(e,t,n,0,dBe,gBe),s=o.height,a=o.width,c=R4t;return Sa.computePosition(o,i,!1,0,0,c[0]),Sa.computePosition(o,i,!1,0,a-1,c[1]),Sa.computePosition(o,i,!1,s-1,0,c[2]),Sa.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function q0(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}q0.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;q0.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 _Be=new ie,yBe=ee.clone(ee.UNIT_SPHERE),Lb={rectangle:_Be,ellipsoid:yBe,vertexFormat:$ae,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};q0.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,_Be);t+=ie.packedLength;let r=ee.unpack(e,t,yBe);t+=ee.packedLength;let o=Be.unpack(e,t,$ae);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):(Lb.granularity=s,Lb.height=a,Lb.rotation=c,Lb.stRotation=u,Lb.extrudedHeight=f,Lb.shadowVolume=d,Lb.offsetAttribute=p===-1?void 0:p,new q0(Lb))};q0.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 Jae(n,i,o,r,t)};var M4t=new $,aBe=new Le,N4t=new he;q0.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=Sa.computeOptions(t,e._granularity,i,r,dBe,gBe,O4t),a=M4t;if(r!==0||i!==0){let g=ie.center(t,N4t),m=n.geodeticSurfaceNormalCartographic(g,Kae);Le.fromAxisAngle(m,-r,aBe),$.fromQuaternion(aBe,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=D4t(e,s);let g=ue.fromRectangle3D(t,n,c,w4t),m=ue.fromRectangle3D(t,n,u,S4t);p=ue.union(g,m)}else{if(d=pBe(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===gn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ue.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})};q0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new q0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var cBe=new ie,L4t=[new U,new U,new U],F4t=new Xi,B4t=new he;function k4t(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,cBe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=Jae(t,n,r,i,cBe),s=L4t;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,F4t),u=ie.center(a,B4t);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(q0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=Jae(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=k4t(this)),this._textureCoordinateRotationPoints}}});var MC=q0;var ABe=new z,bBe=h.ZERO,xBe=new h,TBe=new ie,U4t=new ie,z4t=new he;function V4t(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 lp(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new V4t(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(lp.prototype=Object.create(ii.prototype),lp.prototype.constructor=lp);lp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,ABe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,bBe,xBe))),new Bt({id:t,geometry:new MC(this._options),attributes:i})};lp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ABe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,bBe,xBe))),new Bt({id:t,geometry:new CT(this._options),attributes:o})};lp.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,U4t);if(!l(n))return;let i=ie.center(n,z4t);return he.toCartesian(i,ee.default,t)};lp.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ri.prototype._isHidden.call(this,e,t)};lp.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)};lp.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:Cr.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=Ni.getMinimumMaximumHeights(MC.computeRectangle(a,TBe)).minimumTerrainHeight),a.extrudedHeight=o};lp.DynamicGeometryUpdater=DP;function DP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(DP.prototype=Object.create(Di.prototype),DP.prototype.constructor=DP);DP.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Di.prototype._isHidden.call(this,e,t,n)};DP.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=Ni.getMinimumMaximumHeights(MC.computeRectangle(i,TBe)).minimumTerrainHeight),i.extrudedHeight=s};var R4=lp;var EBe={};function j4t(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var H4t=new he,G4t=new he;function W4t(e,t,n,i){t=Br(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,H4t);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,G4t);s&&(x.height=n[A]),m=m&&x.height===0,j4t(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 q4t=new Array(2),Y4t=new Array(2),X4t={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};EBe.computePositions=function(e,t,n,i,r,o){let s=W4t(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=X4t;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=or.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=q4t,A=Y4t;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=or.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(or.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(or.generateArc(p)),p.height=i,f=new Float64Array(or.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var NC=EBe;var Zae=new h,vW=new h,K4t=new h,CBe=new h,$4t=new h,J4t=new h,Z4t=new h;function LC(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}LC.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 vBe=ee.clone(ee.UNIT_SPHERE),SBe=new Be,O4={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:vBe,vertexFormat:SBe,granularity:void 0};LC.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,vBe);t+=ee.packedLength;let u=Be.unpack(e,t,SBe);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):(O4.positions=o,O4.minimumHeights=s,O4.maximumHeights=a,O4.granularity=f,new LC(O4))};LC.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 LC(c)};LC.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=NC.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=Z4t,R=J4t,O=$4t,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,Zae),k=h.fromArray(c,B,vW);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,CBe),q=h.subtract(j,s.geodeticSurfaceNormal(j,vW),vW);if(_+1<d&&(G=h.fromArray(u,B+3,CBe)),L){let Q=h.subtract(G,j,K4t),W=h.subtract(q,j,Zae);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 En;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,Zae),G=h.fromArray(g,j*3,vW);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:ue.fromVertices(g)})};var M4=LC;var wBe=new h,IBe=new h;function FC(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}FC.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 PBe=ee.clone(ee.UNIT_SPHERE),N4={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:PBe,granularity:void 0};FC.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,PBe);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):(N4.positions=o,N4.minimumHeights=s,N4.maximumHeights=a,N4.granularity=u,new FC(N4))};FC.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 FC(c)};FC.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=NC.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,wBe),E=h.fromArray(a,x,IBe);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,wBe),v=h.fromArray(d,T*3,IBe);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:ue.fromVertices(d)})};var L4=FC;var DBe=new z;function Q4t(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 up(e,t){Ri.call(this,{entity:e,scene:t,geometryOptions:new Q4t(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(up.prototype=Object.create(Ri.prototype),up.prototype.constructor=up);up.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ni.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,DBe)),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 M4(this._options),attributes:i})};up.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,DBe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new L4(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r)}})};up.prototype._isHidden=function(e,t){return!l(t.positions)||Ri.prototype._isHidden.call(this,e,t)};up.prototype._getIsClosed=function(e){return!1};up.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)};up.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:Cr.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};up.DynamicGeometryUpdater=RP;function RP(e,t,n){Di.call(this,e,t,n)}l(Object.create)&&(RP.prototype=Object.create(Di.prototype),RP.prototype.constructor=RP);RP.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Di.prototype._isHidden.call(this,e,t,n)};RP.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 F4=up;var BC=[GV,n4,ZV,m4,g4,A4,E4,D4,R4,F4];function kC(e,t){this.entity=e,this.scene=t;let n=new Array(BC.length),i=new be,r=new $o;for(let o=0;o<n.length;o++){let s=new BC[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(kC.prototype._onEntityPropertyChanged,this)}kC.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)};kC.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};kC.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};kC.registerUpdater=function(e){BC.includes(e)||BC.push(e)};kC.unregisterUpdater=function(e){if(BC.includes(e)){let t=BC.indexOf(e);BC.splice(t,1)}};var UC=kC;var RBe=new z,e8t=new Ht,t8t=new Ht,n8t=h.ZERO,i8t=new h;function fp(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(fp.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}fp.prototype.onMaterialChanged=function(){this.invalidated=!0};fp.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};fp.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)}))}};fp.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};fp.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=Co.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=Co.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,RBe);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,RBe);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=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,t8t,e8t);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,n8t,i8t);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};fp.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=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};fp.prototype.contains=function(e){return this.updaters.contains(e.id)};fp.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)};fp.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 OP(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}OP.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 fp(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function OBe(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}OP.prototype.remove=function(e){OBe(this._solidItems,e)||OBe(this._translucentItems,e)};function MBe(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 SW(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}OP.prototype.update=function(e){let t=SW(this,this._solidItems,e,!0);t=SW(this,this._translucentItems,e,t)&&t;let n=MBe(this,this._solidItems,e),i=MBe(this,this._translucentItems,e);return(n||i)&&(t=SW(this,this._solidItems,e,t)&&t,t=SW(this,this._translucentItems,e,t)&&t),t};function NBe(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}OP.prototype.getBoundingSphere=function(e,t){let n=NBe(this._solidItems,e,t);return n===Pt.FAILED?NBe(this._translucentItems,e,t):n};function LBe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}OP.prototype.removeAllPrimitives=function(){LBe(this._solidItems),LBe(this._translucentItems)};var Ph=OP;var r8t=new Ht,o8t=new Ht,s8t=h.ZERO,a8t=new h;function dp(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(dp.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut}dp.prototype.onMaterialChanged=function(){this.invalidated=!0};dp.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};dp.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};dp.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 c8t=new z;dp.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=Co.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=Co.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=Co.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Co.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,c8t);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=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,o8t,r8t);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,s8t,a8t);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};dp.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=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};dp.prototype.contains=function(e){return this.updaters.contains(e.id)};dp.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)};dp.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 MP(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}MP.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 dp(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};MP.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}}};MP.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};MP.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};MP.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 Dh=MP;function wW(e,t,n=0,i=e.length-1,r=l8t){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));wW(e,t,g,m,r)}let o=e[t],s=n,a=i;for(B4(e,n,t),r(e[i],o)>0&&B4(e,n,i);s<a;){for(B4(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?B4(e,n,a):(a++,B4(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function B4(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function l8t(e,t){return e<t?-1:e>t?1:0}var z4=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(!PW(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;PW(t,c)&&(n.leaf?i.push(a):ece(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!PW(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(PW(t,s)){if(n.leaf||ece(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=LP([]),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=u8t(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&ece(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=LP(t.slice(n,i+1)),NP(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=LP([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));FBe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);FBe(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 NP(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=Qae(u),d=h8t(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),U4(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=LP(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,NP(i,this.toBBox),NP(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=LP([t,n]),this.data.height=t.height+1,this.data.leaf=!1,NP(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=k4(t,0,a,this.toBBox),u=k4(t,a,i,this.toBBox),f=m8t(c,u),d=Qae(c)+Qae(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:f8t,o=t.leaf?this.compareMinY:d8t,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=k4(t,0,n,o),a=k4(t,i-n,i,o),c=IW(s)+IW(a);for(let u=n;u<i-n;u++){let f=t.children[u];U4(s,t.leaf?o(f):f),c+=IW(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];U4(a,t.leaf?o(f):f),c+=IW(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)U4(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():NP(t[n],this.toBBox)}};function u8t(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 NP(e,t){k4(e,0,e.children.length,t,e)}function k4(e,t,n,i,r){r||(r=LP(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];U4(r,e.leaf?i(s):s)}return r}function U4(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 f8t(e,t){return e.minX-t.minX}function d8t(e,t){return e.minY-t.minY}function Qae(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function IW(e){return e.maxX-e.minX+(e.maxY-e.minY)}function h8t(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 m8t(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 ece(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function PW(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function LP(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function FBe(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;wW(e,s,t,n,r),o.push(t,s,s,n)}}function DW(){this._tree=new z4}function zC(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}zC.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};DW.prototype.insert=function(e,t){let n=zC.fromRectangleAndId(e,t,new zC);this._tree.insert(n)};function p8t(e,t){return e.id===t.id}var g8t=new zC;DW.prototype.remove=function(e,t){let n=zC.fromRectangleAndId(e,t,g8t);this._tree.remove(n,p8t)};var _8t=new zC;DW.prototype.collides=function(e){let t=zC.fromRectangleAndId("",e,_8t);return this._tree.collides(t)};var VC=DW;var y8t=new z,A8t=new Ht,b8t=new Ht;function _y(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 VC}_y.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};_y.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)}))}};_y.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};_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 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,y8t);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=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,b8t,A8t);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(y,d.distanceDisplayCondition))}}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=Dn.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.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};_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 FP(e,t){this._batches=[],this._primitives=e,this._classificationType=t}FP.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 _y(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};FP.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};FP.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};FP.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};FP.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var BP=FP;var x8t=new Ht,T8t=new Ht;function Y0(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 VC}Y0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Y0.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)};Y0.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};Y0.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};Y0.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=Co.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=Co.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=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,T8t,x8t);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Y0.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=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Y0.prototype.contains=function(e){return this.updaters.contains(e.id)};Y0.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)};Y0.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 kP(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}kP.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Xf.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 Y0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};kP.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};kP.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};kP.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};kP.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 V4=kP;var E8t=new z,C8t=new Ht,v8t=new Ht,S8t=h.ZERO,w8t=new h;function yy(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}yy.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)}))}};yy.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};yy.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,E8t);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=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,v8t,C8t);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,S8t,w8t);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};yy.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=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};yy.prototype.contains=function(e){return this.updaters.contains(e.id)};yy.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)};yy.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 UP(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ut,this._translucentBatches=new Ut}UP.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 yy(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 yy(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};UP.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};UP.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};UP.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};UP.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 zP=UP;var I8t=[];function pf(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=Pn.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=eo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new zP(n,e,s,!1),this._outlineBatches[r+s]=new zP(n,e,s,!0),this._closedColorBatches[s]=new Ph(n,yn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Ph(n,yn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Dh(n,Cr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Dh(n,Cr,void 0,!0,s,!1),this._openColorBatches[s]=new Ph(n,yn,void 0,!1,s,!0),this._openColorBatches[r+s]=new Ph(n,yn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Dh(n,Cr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Dh(n,Cr,void 0,!1,s,!1);let a=ei.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new V4(i,s,Cr)),c[s]=new BP(i,s);else for(s=0;s<a;++s)c[s]=new BP(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new IC(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(pf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,I8t)}pf.registerUpdater=function(e){UC.registerUpdater(e)};pf.unregisterUpdater=function(e){UC.unregisterUpdater(e)};pf.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 UC(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(pf._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 P8t=[],D8t=new ue;pf.prototype.getBoundingSphere=function(e,t){let n=P8t,i=D8t,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]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};pf.prototype.isDestroyed=function(){return!1};pf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(pf.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(),le(this)};pf.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};pf.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=Pn.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)};pf._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)};pf.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 j4=pf;var R8t=1,O8t="30px sans-serif",M8t=yo.FILL,N8t=z.WHITE,L8t=z.BLACK,F8t=1,B8t=!1,k8t=new z(.165,.165,.165,.8),U8t=new U(7,5),z8t=U.ZERO,V8t=h.ZERO,j8t=We.NONE,H8t=ji.CENTER,G8t=Hn.CENTER,W8t=new h,q8t=new z,Y8t=new z,X8t=new z,K8t=new U,$8t=new h,J8t=new U,Z8t=new qt,Q8t=new qt,ejt=new qt,tjt=new Ht;function BBe(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,W8t),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){tce(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,j8t);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,R8t),u.font=X.getValueOrDefault(a._font,e,O8t),u.style=X.getValueOrDefault(a._style,e,M8t),u.fillColor=X.getValueOrDefault(a._fillColor,e,N8t,q8t),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,L8t,Y8t),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,F8t),u.showBackground=X.getValueOrDefault(a._showBackground,e,B8t),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,k8t,X8t),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,U8t,K8t),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,z8t,J8t),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,V8t,$8t),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,H8t),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,G8t),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Z8t),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Q8t),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,ejt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,tjt),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=ip(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=cy(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 le(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 BBe(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 BBe(o)):(tce(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],tce(s.get(o.id),o,a),s.remove(o.id)};function tce(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var H4=Fb;var njt=1,ijt=!0,rjt=0,ojt=!0,sjt=!0,ajt=Pn.ENABLED,cjt=We.NONE,ljt=z.RED,ujt=0,fjt=z.WHITE,djt=dl.HIGHLIGHT,hjt=.5,mjt=new U(1,1),kBe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},pjt=new N,gjt=new N,UBe=new z,zBe=new Array(4),_jt=new h;function Bb(e,t){t.collectionChanged.addEventListener(Bb.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}function yjt(e,t){return e instanceof di?e.valueOf():X.getValueOrUndefined(e,t)}function Ajt(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function VBe(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function bjt(e,t){if(!l(t))return N.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function xjt(e,t,n,i,r){let o=e._primitives,s=e._modelHash,a=s[t.id],c=()=>!e.isDestroyed()&&s[t.id]===a;try{let u=await jf.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(!c()){u.destroy();return}u.id=t,o.add(u),a.modelPrimitive=u,u.errorEvent.addEventListener(f=>{c()&&(console.log(f),f.name!=="TextureError"&&u.incrementallyLoadTextures&&(a.loadFailed=!0))})}catch(u){if(!c())return;console.log(u),a.loadFailed=!0}}Bb.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,p;if(f&&(d=s.computeModelMatrix(e,pjt),p=yjt(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!Ajt(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(VBe(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...kBe}},n[s.id]=u,VBe(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,ojt),A=X.getValueOrDefault(a._environmentMapOptions,e,kBe,u.environmentMapOptionsScratch);xjt(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,njt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,ijt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,rjt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=bjt(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,ajt),g.heightReference=X.getValueOrDefault(a._heightReference,e,cjt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,ljt,UBe),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,ujt),g.color=X.getValueOrDefault(a._color,e,fjt,UBe),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,djt),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,hjt),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,sjt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,mjt);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,zBe,0),m=h.unpack(zBe,0,_jt)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:Hu.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=N.fromTranslationRotationScale(I,gjt);R.matrix=N.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};Bb.prototype.isDestroyed=function(){return!1};Bb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Bb.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)nce(this,e[i],t,n);return le(this)};var G4=new h,Tjt=new he;Bb.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;G4.x=a[12],G4.y=a[13],G4.z=a[14];let c=o.cartesianToCartographic(G4,Tjt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=ip(r,n,G4,[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):As(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};Bb.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)?(Ejt(o,a),s.set(o.id,o)):(nce(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],nce(this,o,a,c),s.remove(o.id)};function nce(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Ejt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var W4=Bb;var jBe=new $,HBe=new $,GBe=new $,Cjt=new h,WBe=new h,vjt=new h,Sjt=new h,RW=new Le,OW=new N,MW=new $;function Y4(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,RW)&&(Le.conjugate(RW,RW),$.fromQuaternion(RW,MW),$.multiplyByVector(MW,r,r));else if(l(oce(e,i.position,OW)))N.inverse(OW,OW),N.getRotation(OW,MW),$.multiplyByVector(MW,r,r);else return;return r}}function oce(e,t,n){let i=t.getValue(e,Cjt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,WBe);if(l(o)&&!h.equalsEpsilon(i,o,D.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,jBe),a=At.computeFixedToIcrfMatrix(r,HBe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,GBe),s=$.transpose(c,jBe),a=At.computeTemeToPseudoFixedMatrix(r,HBe),$.transpose(a,a)):c=$.transpose(s,GBe);let u=vjt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,Sjt);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,WBe);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 qBe=60,ZBe=1,QBe=new Cn,ice=new Cn,rce=new Cn;function YBe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var NW=new h;function wjt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof eo&&(u=o,f=u.position,o=Gi.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,NW),g=Y4(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,NW),l(g)&&l(m)&&(g=Y4(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,NW),l(g)&&l(m)&&(g=Y4(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,NW),l(g)&&l(m)&&(g=Y4(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Ijt(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 Pjt(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 Djt(e,t,n,i,r,o,s,a){rce.start=t,rce.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,rce,QBe).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 Rjt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function Ojt(e,t,n,i,r,o,s,a){ice.start=t,ice.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,ice,QBe).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=e2e(d.data,m,y,i,r,o,c,a)}}return c}function e2e(e,t,n,i,r,o,s,a){for(;e instanceof q_;)e=e.resolvedProperty;if(e instanceof Ac){let c=e._property._times;s=wjt(e,t,n,c,i,r,o,s,a)}else e instanceof WV?s=Ijt(e,t,n,i,r,o,s,a):e instanceof yc?s=Ojt(e,t,n,i,r,o,s,a):e instanceof my?s=Djt(e,t,n,i,r,o,s,a):e instanceof uu||e instanceof L0&&X.isConstant(e)?s=Rjt(e,t,n,i,r,o,s,a):s=Pjt(e,t,n,i,r,o,s,a);return s}function sce(e,t,n,i,r,o,s){l(s)||(s=[]);let a=e2e(e,t,n,i,r,o,0,s);return s.length=a,s}var XBe=new $,KBe=new Le,$Be=new $,q4=new Cn,LW=new Cn,jC=new Cn;function Mjt(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 JBe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Br(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=sce(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=Co.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,ZBe),d++}return d}function X4(e,t){this._unusedIndexes=[],this._polylineCollection=new Am,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}X4.prototype.update=function(e){let t=this._referenceFrame;if(t===Gi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,XBe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,XBe)),N.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof eo){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,KBe))&&($.fromQuaternion(KBe,$Be),N.fromRotationTranslation($Be,n,this._polylineCollection.modelMatrix)):oce(e,t.position,this._polylineCollection.modelMatrix)}};X4.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,qBe),d=sce(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=Co.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===j0.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:qBe,y=g.intervals,A=0;if(l(y)){q4.start=o,q4.stop=s,q4.isStartIncluded=!0,q4.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Cn.intersect(x,q4,LW))continue;let T=LW.start,E=LW.stop;if(K.greaterThanOrEquals(T,E))continue;let v=Mjt(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(_,LW,jC)&&(K.greaterThan(jC.start,T)&&K.lessThan(jC.start,E)&&S.push(K.clone(jC.start)),K.greaterThan(jC.stop,T)&&K.lessThan(jC.stop,E)&&S.push(K.clone(jC.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=JBe(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=JBe(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,ZBe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};X4.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};X4.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function X0(e,t){t.collectionChanged.addEventListener(X0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}X0.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=Gi.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Gi.FIXED,p=d.toString()):m==="INERTIAL"?(d=Gi.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 X4(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};X0.prototype.isDestroyed=function(){return!1};X0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(X0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};X0.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 YBe(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 YBe(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))};X0._subSample=sce;X0._computeVvlhTransform=oce;X0._transformToEntityFrame=Y4;var K4=X0;var t2e=z.WHITE,n2e=z.BLACK,i2e=0,r2e=1,o2e=0,s2e=Ho.NONE,a2e=new z,Njt=new h,c2e=new z,l2e=new qt,u2e=new qt,f2e=new Ht;function d2e(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 kb(e,t){t.collectionChanged.addEventListener(kb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}kb.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,Njt),d=l(p)),!d){$4(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&($4(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)&&($4(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,l2e),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,u2e),c.color=X.getValueOrDefault(a._color,e,t2e,a2e),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,n2e,c2e),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,i2e),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,r2e),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,f2e),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,o2e),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,s2e);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,l2e),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,u2e),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,f2e),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,o2e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,s2e),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,t2e,a2e),A=X.getValueOrDefault(a._outlineColor,e,n2e,c2e),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,i2e)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,r2e)));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,dT(T,E,v,b,x))}m&&u._updateClamping()}}return!0};kb.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=ip(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=cy(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};kb.prototype.isDestroyed=function(){return!1};kb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(kb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};kb.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 d2e(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 d2e(o)):($4(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],$4(s.get(o.id),o,a),s.remove(o.id)};function $4(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 J4=kb;var Ljt=new di(0),FW={},h2e=new z,Fjt=new Kt(z.WHITE),Bjt=new di(!0),kjt=new di(Pn.DISABLED),Ujt=new di(new Ht),zjt=new di(ei.BOTH);function Vjt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function jjt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function hp(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(hp.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 Vjt,this._groundGeometryOptions=new jjt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=eo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(hp.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}}});hp.prototype.isOutlineVisible=function(e){return!1};hp.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};hp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ni.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,h2e)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new oE(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,h2e)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Bt({id:t,geometry:new __(this._geometryOptions),attributes:s}))};hp.prototype.createOutlineGeometryInstance=function(e){};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){this._entitySubscription(),le(this)};hp.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??Fjt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??Bjt,this._shadowsProperty=r.shadows??kjt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Ujt,this._classificationTypeProperty=r.classificationType??zjt,this._fillEnabled=!0,this._zIndex=a??Ljt;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=Ys.VERTEX_FORMAT:A=gc.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)}};hp.prototype.createDynamicUpdater=function(e,t){return new Z4(e,t,this)};var VP={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Z4(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 m2e(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=FW[n];!l(i)||i.isDestroyed()?(i=new Am,FW[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}Z4.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,un.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 Ys;else{let g=Co.getValue(e,d,this._material);p=new gc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Rm({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=m2e(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=un.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==un.NONE&&l(u)&&(VP.ellipsoid=f,VP.positions=o,VP.granularity=X.getValueOrUndefined(i._granularity,e),VP.height=or.extractHeights(o,f),c===un.GEODESIC?o=or.generateCartesianArc(VP):o=or.generateCartesianRhumbArc(VP)),a.show=!0,a.positions=o.slice(),a.material=Co.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};Z4.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 ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=m2e(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};Z4.prototype.isDestroyed=function(){return!1};Z4.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=FW[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete FW[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var Q4=hp;var Hjt=new z,Gjt=new Ht,Wjt=new Ht;function mp(e,t,n,i,r){let o;n instanceof Kt?o=Ys:o=gc,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(mp.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut,this.zIndex=i,this._asynchronous=r}mp.prototype.onMaterialChanged=function(){this.invalidated=!0};mp.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)};mp.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};mp.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};mp.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 Rm({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===gc&&(this.material=Co.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===gc&&(this.material=Co.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,Hjt);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=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Wjt,Gjt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};mp.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=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};mp.prototype.contains=function(e){return this.updaters.contains(e.id)};mp.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)};mp.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 jP(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}jP.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 mp(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};jP.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}}};jP.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};jP.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};jP.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 e8=jP;var qjt=[];function p2e(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function g2e(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*Pn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function K0(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=Pn.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 Ph(n,Ys,void 0,!1,r),this._materialBatches[r]=new Dh(n,gc,void 0,!1,r),this._colorBatches[r+o]=new Ph(n,Ys,Ys,!1,r),this._materialBatches[r+o]=new Dh(n,gc,Ys,!1,r),this._colorBatches[r+o*2]=new Ph(n,Ys,gc,!1,r),this._materialBatches[r+o*2]=new Dh(n,gc,gc,!1,r);this._dynamicBatch=new IC(n,i);let s=ei.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new e8(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(K0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,qjt)}K0.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?(p2e(this,f),g2e(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),p2e(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 Q4(c,this._scene),this._updaters.set(u,f),g2e(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(K0._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 Yjt=[],Xjt=new ue;K0.prototype.getBoundingSphere=function(e,t){let n=Yjt,i=Xjt,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]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(K0.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(),le(this)};K0._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)};K0.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 t8=K0;function gf(e){su.initializeTerrainHeights(),Rm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new $o,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??gf.defaultVisualizersCallback;let i=!1,r=new wl,o=new wl;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 QV;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 HP=[];gf.registerVisualizer=function(e){HP.includes(e)||HP.push(e)};gf.unregisterVisualizer=function(e){if(HP.includes(e)){let t=HP.indexOf(e);HP.splice(t,1)}};gf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new jV(t,i),new j4(e,i,n._primitives,n._groundPrimitives),new H4(t,i),new W4(e,i),new qV(e,i),new J4(t,i),new K4(e,i),new t8(e,i,n._primitives,n._groundPrimitives),...HP.map(r=>new r(e,i))]};Object.defineProperties(gf.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}}});gf.prototype.isDestroyed=function(){return!1};gf.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)),le(this)};gf.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};gf.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 Kjt=[],$jt=new ue;gf.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=Kjt,a=$jt,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]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};gf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new wl),s=r.add(new uz);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};gf.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};gf.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 n8=gf;var _2e=new $,y2e=new $,A2e=new $,Jjt=new N,BW=new h,b2e=new h,ace=new h,cce=new h,x2e=new h,T2e=new h,Zjt=new Le,Qjt=new h,e6t=new $,GP=new K,t6t=1.25;function n6t(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,GP);let I=r.getValue(GP,BW);if(l(I)||(K.addSeconds(c,-.001,GP),I=r.getValue(GP,BW),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,_2e),O=At.computeFixedToIcrfMatrix(GP,y2e),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,A2e),R=$.transpose(L,_2e),O=At.computeTemeToPseudoFixedMatrix(GP,y2e),$.transpose(O,O)):L=$.transpose(R,A2e);let _=$.multiplyByVector(R,d,x2e),C=$.multiplyByVector(O,I,T2e);h.subtract(_,C,cce);let w=h.magnitude(cce)*1e3,P=D.GRAVITATIONALPARAMETER,M=-P/(w*w-2*P/h.magnitude(_));M<0||M>t6t*u.maximumRadius?(m=b2e,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,ace),y=h.cross(A,m,BW),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,ace),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,D.EPSILON7)||(A=b2e,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,ace),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,A,BW),$.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,cce),x=h.clone(t.direction,x2e),T=h.clone(t.up,T2e));let E=Jjt,v;l(s)&&(v=s.getValue(c,Zjt));let S=o.getValue(c,Qjt);if(a===U_.INERTIAL&&l(v))N.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===U_.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,e6t);N.fromRotationTranslation(I,d,E)}else a===U_.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 i8(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 py(e.position,!0),this._offset3D=new h}Object.defineProperties(i8,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});i8.defaultOffset3D=new h(-14e3,3500,3500);var kW=new Nd,i6t=new h;i8.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)){kW.pitch=-D.PI_OVER_FOUR,kW.range=0;let b=a.getValue(e,i6t);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);kW.pitch*=x}p.viewBoundingSphere(t,kW),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(i8._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,n6t(this,p,g,m,a,c,u,s,e,i)};var r8=i8;var lce=32,r6t="http://www.opengis.net/kml/2.2",gp="http://www.google.com/kml/ext/2.2",o6t="http://www.w3.org/2000/xmlns/";function UW(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var s6t=/^data:image\/([^,;]+)/;UW.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(s6t);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 a6t(e,t){return function(n){e._files[t]=n}}UW.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(a6t(this,o))}return r};Object.defineProperties(UW.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function zW(e){this._time=e}zW.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};zW.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return GC(n)};zW.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function uce(){this._ids={},this._styles={},this._count=0}uce.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};uce.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 v2e(){this._ids={}}v2e.prototype.get=function(e){if(!l(e))return this.get(Jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function fce(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=fce._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(o6t,"xmlns:gx",gp);let a=o.createElement("Document");s.appendChild(a),w2e(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?c6t(f,c.files):{kml:f,externalFiles:c.files}})}async function c6t(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");L3({workerURI:n,wasmURI:i});let r=new oI("application/vnd.google-earth.kmz"),o=new uU(r);await o.add("doc.kml",new J3(e));let s=Object.keys(t);return await S2e(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function S2e(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new af(n[r])),S2e(e,t,n,i+1)}fce._createState=function(e){let t=e.entities,n=new uce,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 UW(e.modelCallback);return{kmlDoc:document.implementation.createDocument(r6t,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new v2e,styleCache:n,externalFileHandler:a,time:r,valueGetter:new zW(r),sampleDuration:s,defaultAvailability:new Rs([o])}};function w2e(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=[],l6t(e,p,u,f),u6t(e,p.polyline,u,f),C2e(e,p.rectangle,u,f,c),C2e(e,p.polygon,u,f,c),m6t(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),w2e(e,b,A)}}}var _f=new h,Tu=new he,pp=new K;function l6t(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){I2e(e,t,a,n,i);return}s.get(c,void 0,_f);let u=vn(r,"coordinates",HC(_f,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(WC(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Tl?D2e(e,a):P2e(e,a);i.push(p)}function I2e(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof yc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof V_,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 L0?(x=x._value,T.appendChild(WC(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(WC(e,n.heightReference)):T.appendChild(WC(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,_f);let I=vn(o,"coordinates",HC(_f,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof Ac)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Gi.FIXED,_f),v.push(HC(_f,s));else if(x instanceof od){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,_f),v.push(HC(_f,s))}else{let I=e.sampleDuration;b.start.clone(pp),b.isStartIncluded||K.addSeconds(pp,I,pp);let R=b.stop;for(;K.lessThan(pp,R);)x.getValue(pp,_f),E.push(K.toIso8601(pp)),v.push(HC(_f,s)),K.addSeconds(pp,I,pp);b.isStopIncluded&&K.equals(pp,R)&&(x.getValue(pp,_f),E.push(K.toIso8601(pp)),v.push(HC(_f,s)))}let S=o.createElementNS(gp,"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],gp);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(R2e(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(gp,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof Tl?D2e(e,n):P2e(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)),dce(e,x,T),r.push(T)}}}function P2e(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/lce)),r}function D2e(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,gp)),p.appendChild(vn(n,"y",g.y,gp)),p.appendChild(vn(n,"w",g.width,gp)),p.appendChild(vn(n,"h",g.height,gp))),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,lce),g=i.get(t.height,lce),m=i.get(t.horizontalOrigin,ji.CENTER);m===ji.CENTER?u.x-=p*.5:m===ji.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Hn.CENTER);y===Hn.TOP?u.y+=g:y===Hn.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 u6t(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",HC(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(vn(r,"drawOrder",m,gp)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(vn(r,"width",A)),dce(e,t.material,y),i.push(y)}function f6t(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,Tu),c.push(`${D.toDegrees(Tu.longitude)},${D.toDegrees(Tu.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 E2e(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,Tu),s.push(`${D.toDegrees(Tu.longitude)},${D.toDegrees(Tu.latitude)},${i?Tu.height:n}`);let c=vn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function d6t(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(E2e(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(E2e(e,p[m].positions,o,s)),a.push(y)}}return a}function C2e(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof qm;if(a&&s.getMaterialType(t.material)==="Image"){h6t(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?f6t(e,t,u):d6t(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(WC(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)),dce(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 h6t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(WC(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",GC(d.color))),n.push(s)}function R2e(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 m6t(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){I2e(e,t,n,i,r);return}let u=R2e(e,n),f=o.createElement("altitudeMode");f.appendChild(WC(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,_f),he.fromCartesian(_f,s,Tu);let d=o.createElement("Location");d.appendChild(vn(o,"longitude",D.toDegrees(Tu.longitude))),d.appendChild(vn(o,"latitude",D.toDegrees(Tu.latitude))),d.appendChild(vn(o,"altitude",Tu.height)),u.appendChild(d),i.push(u)}function dce(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=GC(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=GC(o.color);break;case"PolylineOutline":s=GC(o.color),c=GC(o.outlineColor),u=o.outlineWidth,n.appendChild(vn(i,"outerColor",c,gp)),n.appendChild(vn(i,"outerWidth",u,gp));break;case"Stripe":s=GC(o.oddColor);break}l(s)&&(n.appendChild(vn(i,"color",s)),n.appendChild(vn(i,"colorMode","normal")))}function WC(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 HC(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Tu),i.push(`${D.toDegrees(Tu.longitude)},${D.toDegrees(Tu.latitude)},${Tu.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 GC(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 hce=fce;var z2e=Qo(wne(),1);var V2e;typeof DOMParser<"u"&&(V2e=new DOMParser);var p6t=new z2e.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),VW=32,O2e=2414016,M2e=1,N2e=16093e3,L2e=.1,g6t=[null,void 0,"http://www.topografix.com/GPX/1/1"],to={gpx:g6t};function _6t(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 mce(e,t){let n=a8(e,"id");return n=l(n)?n:Jn(),t.getOrCreateEntity(n)}function pce(e){let t=F2e(e,"lon"),n=F2e(e,"lat"),i=o8(e,"ele",to.gpx);return h.fromDegrees(t,n,i)}function F2e(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 a8(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ub(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 gce(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 o8(e,t,n){let i=Ub(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function yf(e,t,n){let i=Ub(e,t,n);if(l(i))return i.textContent.trim()}function j2e(e){let t=new Tl;return t.width=VW,t.height=VW,t.scaleByDistance=new qt(O2e,M2e,N2e,L2e),t.pixelOffsetScaleByDistance=new qt(O2e,M2e,N2e,L2e),t.verticalOrigin=new di(Hn.BOTTOM),t.image=e,t}function y6t(){let e=new Gm;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=ji.LEFT,e.font="16px sans-serif",e.style=yo.FILL_AND_OUTLINE,e}function H2e(e){let t=new Cl;return t.width=4,t.material=new Db,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var B2e={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"}},s8;typeof document<"u"&&(s8=document.createElement("div"));function _ce(e,t){let n,i="",r=Object.keys(B2e),o=r.length;for(n=0;n<o;n++){let f=r[n],d=B2e[f];d.value=yf(e,d.tag,to.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=p6t.link(i),s8.innerHTML=i;let s=s8.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+=`${s8.innerHTML}</div>`,s8.innerHTML="",u}function G2e(e,t,n,i){let r=pce(t),o=mce(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,VW);o.billboard=j2e(s);let a=yf(t,"name",to.gpx);o.name=a,o.label=y6t(),o.label.text=a,o.description=_ce(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function A6t(e,t,n,i){let r=mce(t,n);r.description=_ce(t,r);let o=gce(t,"rtept",to.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)G2e(e,o[a],n,i),s[a]=pce(o[a]);r.polyline=H2e(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function b6t(e,t,n,i){let r=mce(t,n);r.description=_ce(t,r);let o=gce(t,"trkseg",to.gpx),s=[],a=[],c,u=!0,f=new Ac;for(let d=0;d<o.length;d++)c=x6t(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,VW);r.billboard=j2e(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Rs,r.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}r.polyline=H2e(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function x6t(e){let t={positions:[],times:[]},n=gce(e,"trkpt",to.gpx),i;for(let r=0;r<n.length;r++){let o=pce(n[r]);t.positions.push(o),i=yf(n[r],"time",to.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function T6t(e){let t=Ub(e,"metadata",to.gpx);if(l(t)){let n={name:yf(t,"name",to.gpx),desc:yf(t,"desc",to.gpx),author:E6t(t),copyright:v6t(t),link:W2e(t),time:yf(t,"time",to.gpx),keywords:yf(t,"keywords",to.gpx),bounds:S6t(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 E6t(e){let t=Ub(e,"author",to.gpx);if(l(t)){let n={name:yf(t,"name",to.gpx),email:C6t(t),link:W2e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function C6t(e){let t=Ub(e,"email",to.gpx);if(l(t)){let n=yf(t,"id",to.gpx),i=yf(t,"domain",to.gpx);return`${n}@${i}`}}function W2e(e){let t=Ub(e,"link",to.gpx);if(l(t)){let n={href:a8(t,"href"),text:yf(t,"text",to.gpx),mimeType:yf(t,"type",to.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function v6t(e){let t=Ub(e,"copyright",to.gpx);if(l(t)){let n={author:a8(t,"author"),year:yf(t,"year",to.gpx),license:yf(t,"license",to.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function S6t(e){let t=Ub(e,"bounds",to.gpx);if(l(t)){let n={minLat:o8(t,"minlat",to.gpx),maxLat:o8(t,"maxlat",to.gpx),minLon:o8(t,"minlon",to.gpx),maxLon:o8(t,"maxlon",to.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var k2e={wpt:G2e,rte:A6t,trk:b6t};function w6t(e,t,n,i){let r=Object.keys(k2e),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=k2e[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 U2e(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=a8(r,"version"),s=a8(r,"creator"),a,c=T6t(r);l(c)&&(a=c.name),r.localName==="gpx"?w6t(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=Ps.LOOP_STOP,u.clockStep=Vr.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),I6t(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),Ls.setLoading(e,!1),e}function I6t(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 P6t(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?_6t(o).then(function(s){let a,c;try{a=V2e.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 U2e(e,a,i)}):U2e(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function WP(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Qa(this),this._entityCluster=new rd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new w_}WP.load=function(e,t){return new WP().load(e,t)};Object.defineProperties(WP.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}}});WP.prototype.update=function(e){return!0};WP.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Ls.setLoading(this,!0);let n=this._name,i=this;return P6t(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=Ps.LOOP_STOP,r.clockStep=Vr.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),Ls.setLoading(i,!1),i}).catch(function(r){return Ls.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var c8=WP;function l8(){pe.throwInstantiationError()}l8.prototype.update=pe.throwInstantiationError;l8.prototype.getBoundingSphere=pe.throwInstantiationError;l8.prototype.isDestroyed=pe.throwInstantiationError;l8.prototype.destroy=pe.throwInstantiationError;var yce=l8;var D6t=15;function q2e(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}q2e.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 R6t(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 Po(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"?ah.LERC:ah.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new tp(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new tp(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.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 O6t(e,t,n){try{let i=await t.fetchJson();R6t(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Jr.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function zb(){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(zb.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}}});zb.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 q2e(t);await O6t(r,i);let o=new zb(t);return r.build(o),o._resource=n,o};zb.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(Ace(this,n+1,e*2,t*2))){let d=Y2e(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 Uc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):D6t,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 Ace(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}zb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};zb.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Ace(this,n,e,t);if(l(i))return i;Y2e(this,n,e,t)};zb.prototype.loadTileDataAvailability=function(e,t,n){};function M6t(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 N6t(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=M6t(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 Y2e(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=N6t(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 Ace(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 bce=zb;var X2e="https://dev.virtualearth.net/REST/v1/Locations";function xce(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:X2e,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(xce.prototype,{url:{get:function(){return X2e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});xce.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 Tce=xce;function Ece(){}Object.defineProperties(Ece.prototype,{credit:{get:function(){}}});Ece.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 Cce=Ece;var L6t=new se,K2e=new h,qP=new h;function F6t(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=L6t;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,K2e),h.multiplyByScalar(d,.5,d),p=N.multiplyByVector(_A.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],K2e),h.multiplyByScalar(f,.5,f),p=N.multiplyByVector(_A.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(Vb.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,qP),h.add(r,qP,r),h.multiplyByScalar(f,p.z,qP),h.add(r,qP,r),h.multiplyByScalar(d,p.w,qP),h.add(r,qP,r)}}var B6t=new h,k6t=new h;function Vb(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=B6t,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=k6t,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=F6t(this),this._lastTimeIndex=0}Object.defineProperties(Vb.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}}});Vb.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Vb.prototype.findTimeInterval=Rr.prototype.findTimeInterval;Vb.prototype.wrapTime=Rr.prototype.wrapTime;Vb.prototype.clampTime=Rr.prototype.clampTime;Vb.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var vce=Vb;var Sce={},U6t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},z6t=new he,V6t=new h,j6t=new N,H6t=new N,G6t=new N,W6t=new h,q6t=new h,Y6t=new h,X6t=new h,K6t=new he,$6t=new U,u8=new h,J6t=new U,Z6t=new h,Q6t=new h,jW=function(e,t){return e-t};Sce.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=ue.clone(e.boundingSphere,new ue),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?rA.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,z6t);I.height=.5*(s+a);let R=he.toCartesian(I,m,V6t),O=At.eastNorthUpToFixedFrame(R,m,j6t),L=N.inverseTransformation(O,H6t),_=N.unpack(o.nodes[0].matrix,0,G6t);_=N.multiply(Vi.Y_UP_TO_Z_UP,_,_);let C=OHt(o,i,U6t),w=Xr.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=Xr.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=_i.geodeticLatitudeToMercatorAngle(T),Se=1/(_i.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,W6t),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,q6t),He=new To(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,Y6t),Gt=N.multiplyByPoint(_,vt,X6t),lt=he.fromCartesian(Gt,m,K6t),{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),wr(ae,st,jW)>=0?rt=0:wr(fe,st,jW)>=0&&(rt=1),wr(Ae,st,jW)>=0?ht=0:wr(xe,st,jW)>=0&&(ht=1);let Bi=U.fromElements(rt,ht,$6t),Xn;if(i){let hi=h.unpack(M,st*3,u8);hi=N.multiplyByPointAsVector(_,hi,u8),hi=h.normalize(hi,u8),Xn=cn.octEncode(hi,J6t)}let bi;r&&(bi=(_i.geodeticLatitudeToMercatorAngle(ft)-ge)*Se);let Wi;f&&(Wi=m.geodeticSurfaceNormal(Gt,Z6t)),Pe=He.encode($e,Pe,Gt,Bi,Xt,Xn,bi,Wi);let wi=N.multiplyByPoint(L,Gt,Q6t);Re=h.minimumByComponent(wi,Re,Re),Qe=h.maximumByComponent(wi,Qe,Qe)}let qe=new mc(h.clone(He.center,new h),$e,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Xe,en.clone(p,new en),He,Q,W,J,Z);return nke(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var eHt=new U,tHt=new U,nHt=new Array(6),iHt=new U,rHt=new U,oHt=new U,sHt=new h,aHt=new h,cHt=new h,lHt=new he,uHt=new h,fHt=new he,dHt=new he,$2e=new h,hHt=new h,mHt=new h,pHt=new h,gHt=new h,_Ht=new h,yHt=new h,AHt=new h,bHt=new N,xHt=new N,J2e=new U,THt=new U,EHt=new h,CHt=new ue,vHt=new en,SHt=new Nf,Z2e=new h,Q2e=new U,wHt=new U,eke=new h,IHt=new h;function PHt(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);rA.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 DHt(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);rA.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=u8;y.x=p,y.y=g,y.z=m,y=h.normalize(y,u8),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function RHt(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 rA.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function HW(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 rA.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function OHt(e,t,n){return n.positions=PHt(e),n.normals=t?DHt(e):void 0,n.indices=RHt(e),n.edgeIndicesWest=HW(e,"left"),n.edgeIndicesSouth=HW(e,"bottom"),n.edgeIndicesEast=HW(e,"right"),n.edgeIndicesNorth=HW(e,"top"),n}Sce.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=To.clone(e.parentEncoding,new To),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=[];WHt(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,lHt);_.height=.5*(i+r);let C=he.toCartesian(_,x,uHt),w=T.length,P=new To(C,void 0,void 0,void 0,void 0,d,p,A,g,m),M=P.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.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,bHt),xe=N.inverseTransformation(fe,xHt),ge=b.west,we=b.east,Se=b.south,Re=b.north,Qe=_i.geodeticLatitudeToMercatorAngle(Se),Xe=1/(_i.geodeticLatitudeToMercatorAngle(Re)-Qe),$e=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,yHt),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,AHt);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],bi=THt;bi.x=E[Xt*2+0],bi.y=E[Xt*2+1];let Wi=bi.x,wi=bi.y,hi=v[Xt*2+0],xi=v[Xt*2+1],jn=1-hi-xi,nn=f.decodeHeight(u,ht),Wn=f.decodeHeight(u,Bi),Zi=f.decodeHeight(u,Xn),Mr=nn*hi+Wn*xi+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,dHt),no=he.toCartesian(Ks,x,hHt),gi=N.multiplyByPoint(xe,no,pHt);qe=h.minimumByComponent(gi,qe,qe),st=h.maximumByComponent(gi,st,st);let ho;if(d){let Bn=f.decodeNormal(u,ht,sHt),qi=f.decodeNormal(u,Bi,aHt),ki=f.decodeNormal(u,Xn,cHt),Nr=h.fromElements(Bn.x*hi+qi.x*xi+ki.x*jn,Bn.y*hi+qi.y*xi+ki.y*jn,Bn.z*hi+qi.z*xi+ki.z*jn,Z2e);Nr=h.normalize(Nr,Z2e),ho=cn.octEncode(Nr,wHt)}let ur;p&&(ur=(_i.geodeticLatitudeToMercatorAngle(Bs)-Qe)*Xe);let Zo;A&&(Zo=x.geodeticSurfaceNormal(no,IHt)),Ae=P.encode(ae,Ae,no,bi,Mr,ho,ur,Zo)}let vt=en.fromRectangle(b,$e,Pe,x,vHt),Gt=ue.fromVertices(ae,P.center,M,CHt),mt=new Im(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(P.center,ae,M,P.center,$e,EHt),ft=new mc(h.clone(P.center,new h),ae,q,B,w,$e,Pe,b,ue.clone(Gt),h.clone(mt),M,en.clone(vt),P,Q,W,J,Z);return nke(ft,b,x,qe,st,fe,xe,o),ft};function nke(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;Xr.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,gHt),k=h.clone(r,_Ht),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,J2e),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,fHt),Xe=he.toCartesian(He,n,$2e),$e;d&&($e=c.getOctEncodedNormal(f,ae,Q2e));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Xe,eke)),x=c.encode(f,x,Xe,Ae,Qe,$e,Pe,qe);let st=N.multiplyByPoint(s,Xe,mHt);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=Nf.fromCorners(j,k,SHt),W=new To(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,$2e),c.decodeTextureCoordinates(f,fe,J2e),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,Q2e):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,eke):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var wce=0,MHt=1,Ice=2,Pce=3,NHt=4,LHt=new h,FHt=[new h,new h,new h,new h,new h,new h],BHt=[new U,new U,new U,new U,new U,new U],kHt=[new h,new h,new h,new h,new h,new h],UHt=[new U,new U,new U,new U,new U,new U];function tke(e,t,n,i){switch(n){case wce:return D.sign(i.x-e.x);case Ice:return D.sign(t.x-i.x);case Pce:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function zHt(e,t,n,i,r,o){let s,a,c;switch(n){case wce:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case Ice:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case Pce: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 VHt={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 jHt(e,t,n,i,r,o,s,a){let c,u=BHt,f=FHt,d=3,p=UHt;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=kHt;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)%NHt,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=tke(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=tke(n,i,y,I);if(v*O===-1){let L=zHt(n,i,y,T,I,LHt),{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 HHt(e,t,n,i,r,o,s,a){return jHt(e?t?Pce:wce:t?Ice:MHt,2,n,i,r,o,s,a)}var GHt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function WHt(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=eHt;E.x=A,E.y=x;let v=tHt;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,iHt),C=s.decodeTextureCoordinates(o,O,rHt),w=s.decodeTextureCoordinates(o,L,oHt),P=HHt(e,t,E,v,_,C,w,VHt),M=P.length;if(M<3)continue;let F=nHt;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=GHt[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 YP=Sce;function by(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),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(by.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});by.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:rke(i,e,t,n)};by.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 ike="createVerticesFromCesium3DTilesTerrain",qHt=new Kn(ike),YHt=new Kn(ike,tf.maximumAsynchronousTasks);by.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?YHt:qHt,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=To.clone(g.encoding,new To),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=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),P=en.clone(d._orientedBoundingBox,new en),M=new mc(_,y,T,R,b,O,L,c,C,w,m.stride,P,m,E,S,v,I);return d._mesh=M,Promise.resolve(M)})};by.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=YP.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)})};by.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:GW(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};by.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:GW(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};by.prototype.wasCreatedByUpsampling=function(){return!1};function Ay(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}Ay.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};Ay.prototype.upsample=function(e,t,n,i,r,o,s){return GW(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};Ay.prototype._upsampleSync=function(e,t,n,i,r,o,s){return GW(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};Ay.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return rke(i,e,t,n)};Ay.prototype.wasCreatedByUpsampling=function(){return!0};Ay.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(Ay.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var XHt=new Kn("upsampleVerticesFromCesium3DTilesTerrain",tf.maximumAsynchronousTasks);function GW(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=YP.upsampleMesh(b),E=new Ay({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=XHt.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=To.clone(T.encoding,new To),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=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new mc(B,S,L,M,R,F,V,y,j,k,v,G,E,_,w,C,P),Q=new Ay({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var KHt=new U,$Ht=new U,JHt=new U,ZHt=new h;function rke(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,KHt),m=a.decodeTextureCoordinates(s,d,$Ht),y=a.decodeTextureCoordinates(s,p,JHt),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=ep.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,ZHt);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 f8=by;function $0(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 qC({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}$0.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 $0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=Kl.fromJson(c);return r._tileset0=new l0(n,s,u),r._tileset1=new l0(n,a,u),r};$0.fromIonAssetId=async function(e,t){let n=await jo.fromAssetId(e);return $0.fromUrl(n,t)};var QHt=new Array(3);$0.prototype.requestTileGeometry=async function(e,t,n,i){let r=ske(n,e),o=r===0?this._tileset0:this._tileset1,s=ake(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 Ng.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=>Vx(new Uint8Array(x))),b=QHt;b[0]=p,b[1]=A,b[2]=f?A.then(x=>eGt(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(zd.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(zd.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(zd.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(zd.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=WW(o,T,s,0,0),B=WW(o,T,s,1,0),j=WW(o,T,s,0,1),k=WW(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new f8({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}};$0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=ske(n,e),o=r===0?this._tileset0:this._tileset1,s=ake(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 ske(e,t){let n=1<<e;return t/n|0}function ake(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new u0({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function eGt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new cA({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=Fi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await Og({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function WW(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=Dce(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function Dce(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new u0({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}$0.prototype.loadTileDataAvailability=function(e,t,n){};$0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties($0.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 tGt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function qC(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new p_({comparator:qC.comparator}),this._provider=e.provider}qC.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};qC.prototype.addSubtree=function(e,t){let n=new tGt(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()};qC.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}};qC.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=Dce(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=oke(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=oke(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function oke(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=Dce(e,r,s,a);return t.getDescendantCoordinates(c)}qC.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Rce=$0;function xy(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 xu(n),this._workerName="createCircleGeometry"}xy.packedLength=xu.packedLength;xy.pack=function(e,t,n){return xu.pack(e._ellipseGeometry,t,n)};var cke=new xu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Gc={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};xy.unpack=function(e,t,n){let i=xu.unpack(e,t,cke);return Gc.center=h.clone(i._center,Gc.center),Gc.ellipsoid=ee.clone(i._ellipsoid,Gc.ellipsoid),Gc.ellipsoid=ee.clone(i._ellipsoid,cke._ellipsoid),Gc.height=i._height,Gc.extrudedHeight=i._extrudedHeight,Gc.granularity=i._granularity,Gc.vertexFormat=Be.clone(i._vertexFormat,Gc.vertexFormat),Gc.stRotation=i._stRotation,Gc.shadowVolume=i._shadowVolume,l(n)?(Gc.semiMajorAxis=i._semiMajorAxis,Gc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new xu(Gc),n):(Gc.radius=i._semiMajorAxis,new xy(Gc))};xy.createGeometry=function(e){return xu.createGeometry(e._ellipseGeometry)};xy.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new xy({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(xy.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Oce=xy;function XP(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 gd(n),this._workerName="createCircleOutlineGeometry"}XP.packedLength=gd.packedLength;XP.pack=function(e,t,n){return gd.pack(e._ellipseGeometry,t,n)};var nGt=new gd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Ad={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};XP.unpack=function(e,t,n){let i=gd.unpack(e,t,nGt);return Ad.center=h.clone(i._center,Ad.center),Ad.ellipsoid=ee.clone(i._ellipsoid,Ad.ellipsoid),Ad.height=i._height,Ad.extrudedHeight=i._extrudedHeight,Ad.granularity=i._granularity,Ad.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Ad.semiMajorAxis=i._semiMajorAxis,Ad.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new gd(Ad),n):(Ad.radius=i._semiMajorAxis,new XP(Ad))};XP.createGeometry=function(e){return gd.createGeometry(e._ellipseGeometry)};var Mce=XP;function KP(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=Xr.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(KP.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}}});KP.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 Uc({buffer:c,width:o,height:s})})};KP.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};KP.prototype.getTileDataAvailable=function(e,t,n){};KP.prototype.loadTileDataAvailability=function(e,t,n){};var Nce=KP;function lke(e){this.proxy=e}lke.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Lce=lke;function qW(){pe.throwInstantiationError()}Object.defineProperties(qW.prototype,{credit:{get:pe.throwInstantiationError}});qW.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};qW.prototype.geocode=pe.throwInstantiationError;var $P=qW;var uke={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(uke);var jb=uke;function fke(){pe.throwInstantiationError()}fke.createGeometry=function(e){pe.throwInstantiationError()};var Fce=fke;function YC(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(YC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var mke="createVerticesFromGoogleEarthEnterpriseBuffer",iGt=new Kn(mke),rGt=new Kn(mke,tf.maximumAsynchronousTasks),dke=new ie,YW=new ie;YC.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,dke),t.tileXYToRectangle(n,i,r,YW);let u=c.cartographicToCartesian(ie.center(YW)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?rGt:iGt).scheduleTask({buffer:this._buffer,nativeRectangle:dke,rectangle:YW,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 mc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,YW,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),To.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})};YC.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)?lGt(this,i,r):dGt(this,i,r,e)};var oGt=new Kn("upsampleQuantizedTerrainMesh",tf.maximumAsynchronousTasks);YC.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=oGt.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 mC({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.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})})};YC.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};YC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var sGt=new U,aGt=new U,cGt=new U,pke=new h;function lGt(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,sGt),g=o.decodeTextureCoordinates(r,f,aGt),m=o.decodeTextureCoordinates(r,d,cGt),y=ep.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,pke);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 uGt=Uint16Array.BYTES_PER_ELEMENT,hke=Uint32Array.BYTES_PER_ELEMENT,Bce=Int32Array.BYTES_PER_ELEMENT,fGt=Float32Array.BYTES_PER_ELEMENT,kce=Float64Array.BYTES_PER_ELEMENT;function dGt(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+=hke;u+=hke,u+=2*kce;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=kce;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=kce;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Bce;let y=c.getInt32(u,!0)*3;u+=Bce,u+=Bce;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+=fGt;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=uGt;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=ep.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,pke);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 JP=YC;var Rh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},XW=new K;function KW(){this._terrainCache={},this._lastTidy=K.now()}KW.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};KW.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};KW.prototype.tidy=function(){if(K.now(XW),K.secondsDifference(XW,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(XW,o.timestamp)>10&&delete e[r]}K.clone(XW,this._lastTidy)}};function Hb(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 KW,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(Hb.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(){}}});Hb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new Hb(t);return n._metadata=e,n};var hGt=new Kn("decodeGoogleEarthEnterprisePacket");function gke(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Rh.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}Hb.prototype.requestTileGeometry=function(e,t,n,i){let r=T_.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=Rh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new JP({buffer:u,childTileMask:gke(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===Rh.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new Uc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case Rh.SELF:p=a.terrainVersion;break;case Rh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Rh.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=mGt(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?hGt.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=Rh.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=Rh.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 JP({buffer:b,childTileMask:gke(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=Rh.NONE,Promise.reject(b))})};Hb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Hb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=T_.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===Rh.NONE)return!1;if((!l(s)||s===Rh.UNKNOWN)&&(o.terrainState=Rh.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};Hb.prototype.loadTileDataAvailability=function(e,t,n){};function mGt(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 Uce=Hb;var pGt="https://maps.googleapis.com/maps/api/geocode/json",_ke='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function zce(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:pGt,queryParameters:{key:t}}),this._credit=new It(_ke,!0)}Object.defineProperties(zce.prototype,{credit:{get:function(){return this._credit}}});zce.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:_ke,collapsible:!1}}})};var Vce=zce;var jce=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()}},Hce=jce;var yke={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(yke);var Ty=yke;function Gce(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Gce.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Gce.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===jb.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 d8=Gce;function gGt(e){if(!Object.values(Ty).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var Ake=Object.freeze({[Ty.GOOGLE]:"google",[Ty.BING]:"bing",[Ty.DEFAULT]:void 0});function _Gt(e){return Ake[e]}function yGt(e){return Object.entries(Ake).find(t=>t[1]===e)[0]}function Wce(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??Ty.DEFAULT,n=e.accessToken??Nu.defaultAccessToken,i=De.createIfNeeded(e.server??Nu.defaultServer);i.appendForwardSlash();let r=Nu.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 d8(o),this.geocodeProviderType=t}Object.defineProperties(Wce.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return yGt(this._pelias.url.queryParameters.geocoder)},set:function(e){gGt(e);let t={...this._pelias.url.queryParameters,geocoder:_Gt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});Wce.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var XC=Wce;var bke={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(bke);var qce=bke;var xke={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(xke);var Yce=xke;var Tke={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(Tke);var h8=Tke;var Eke={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(Eke);var Xce=Eke;function Cke(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function vke(e){let t=he.fromCartesian(e);return{longitude:D.toDegrees(t.longitude),latitude:D.toDegrees(t.latitude),height:t.height}}function AGt(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 bGt(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 xGt=new N,TGt=new N,$W=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??Nu.defaultAccessToken,r=De.createIfNeeded(n.server??Nu.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:jo._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=bGt(n,i,xGt);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,TGt),i={testPoint:vke(t.testPoint),closePoint:vke(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??h8.NEAREST,worldToView:AGt(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=Cke(r.snapPoint),o.hitPoint=Cke(r.hitPoint),o}};$W.DEFAULT_SNAP_APERTURE=12;var Kce=$W;var $ce=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},Jce=$ce;function ZP(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(ZP.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});ZP.prototype.findTimeInterval=Rr.prototype.findTimeInterval;ZP.prototype.wrapTime=Rr.prototype.wrapTime;ZP.prototype.clampTime=Rr.prototype.clampTime;ZP.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 Zce=ZP;function Qce(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(Qce.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Qce.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 ele=Qce;var EGt={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},tle=EGt;var CGt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},nle=CGt;var vGt=new h;function SGt(e,t,n,i){let r=Gx(e,t,n,i,vGt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var ile=SGt;function Ske(){pe.throwInstantiationError()}Ske.prototype.getURL=pe.throwInstantiationError;var rle=Ske;function wGt(e,t,n,i,r,o,s){let a=or.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 m8(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??un.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}m8.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};m8.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 m8({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var JW=new Array(2),ZW=new Array(2),IGt={positions:JW,height:ZW,ellipsoid:void 0,minDistance:void 0,granularity:void 0};m8.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===un.GEODESIC||r===un.RHUMB){let E,v,S;r===un.GEODESIC?(E=D.chordLength(o,s.maximumRadius),v=or.numberOfPoints,S=or.generateArc):(E=o,v=or.numberOfPointsRhumbLine,S=or.generateRhumbArc);let I=or.extractHeights(t,s),R=IGt;if(r===un.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=JW,R.height=ZW;let L=0;for(u=0;u<f-1;++u){JW[0]=t[u],JW[1]=t[u+1],ZW[0]=I[u],ZW[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=wGt(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 St({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:ue.fromPoints(t)})};var ole=m8;var QW=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};QW.DEFAULT_SNAP_APERTURE=void 0;var sle=QW;var ale=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()}},cle=ale;function KC(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(KC.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(KC.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=PGt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});KC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};KC.prototype.isDestroyed=function(){return!1};KC.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};KC.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 PGt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var lle=KC;function DGt(e,t){this.rectangle=e,this.maxLevel=t}function wke(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=[]}wke.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 RGt(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=Xr.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 DGt(new ie(a,c,u,f),d))}}function OGt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Jr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function MGt(e,t,n){try{let i=await t.fetchXML();RGt(e,i)}catch(i){OGt(t,i,n)}}function Gb(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(Gb.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(){}}});Gb.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new wke(t),i=De.createIfNeeded(e);await MGt(n,i);let r=new Gb(t);return n.build(r),r._resource=i,r};Gb.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 Uc({buffer:zh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:NGt(a,e,t,n),structure:a._terrainDataStructure})})};Gb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Ike=new ie;function NGt(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,Ike);l(d)&&(eq(r,f,t*2,n*2,i+1)&&(a|=4),eq(r,f,t*2+1,n*2,i+1)&&(a|=8),eq(r,f,t*2,n*2+1,i+1)&&(a|=1),eq(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function eq(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,Ike))}Gb.prototype.getTileDataAvailable=function(e,t,n){};Gb.prototype.loadTileDataAvailability=function(e,t,n){};var ule=Gb;var Pke={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(Pke);var fle=Pke;function LGt(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 dle=LGt;function FGt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var p8=FGt;function Oke(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function BGt(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 Mke(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Nke(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=Mke(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 Lke(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 Vm,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),Nke(this);try{let p=t.ellipsoid??ee.default,g=new EV({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,Mke(this),Lke(this);let m=t.globe;l(m)||(m=new s3(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Pn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=wV.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new NV,ee.WGS84.equals(p)&&(g.moon=new sz));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new SV(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=Is.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 ia(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 h4,E=!0);let v=new n8({scene:g,dataSourceCollection:T}),S=new $o;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&&BGt(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,hle(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,Oke(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=kp(n);u||(typeof n=="string"&&(n=new Error(n)),t=kp({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +`;function eq(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=Qi.fromType(Qi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}eq.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,p8]});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)}};eq.prototype.isDestroyed=function(){return!1};eq.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var lle=eq;var ule=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()}},fle=ule;function Ty(){pe.throwInstantiationError()}Object.defineProperties(Ty.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}});Ty.prototype.update=pe.throwInstantiationError;Ty.prototype.updateViewTransforms=pe.throwInstantiationError;Ty.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;Ty.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;Ty.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;Ty.DefaultMinBounds=pe.throwInstantiationError;Ty.DefaultMaxBounds=pe.throwInstantiationError;var dle=Ty;function Mke(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function kGt(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 Nke(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Lke(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=Nke(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 Fke(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 Nm,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),Lke(this);try{let p=t.ellipsoid??ee.default,g=new e8({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,Nke(this),Fke(this);let m=t.globe;l(m)||(m=new PV(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=r8.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new f8,ee.WGS84.equals(p)&&(g.moon=new YV));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new i8(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=Ss.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 ua(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 yk,E=!0);let v=new l3({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,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&&kGt(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,hle(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,Mke(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=Kp(n);u||(typeof n=="string"&&(n=new Error(n)),t=Kp({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()),le(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,Nke(this),Lke(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 kGt=new ue;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??kGt)===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&&Oke(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 Fke(this,e,{offset:t},!1)};Gr.prototype.flyTo=function(e,t){return Fke(this,e,t,!0)};function Fke(e,t,n,i){hle(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 Is){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 jT(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Yo||o instanceof GI||o instanceof xb||o instanceof ta){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 g8(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function hle(e){let t=e._zoomPromise;l(t)&&(g8(e),e._completeZoom(!1))}Gr.prototype._postRender=function(){UGt(this),zGt(this)};var Dke=new ue;function UGt(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 Nd(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)),g8(e)}if(t instanceof GI){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Yo||t instanceof xb){s(t.boundingSphere);return}if(t instanceof ta){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)),g8(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,Dke);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(Dke))}if(c.length===0){hle(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(g8(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),g8(e),e._completeZoom(!0))}var Rke=new ue;function zGt(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,Rke);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?Rke:void 0;e._entityView=new r8(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var _8=Gr;var mle=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()}},ple=mle;var Bke=new h,VGt=new sn(h.UNIT_X,0),jGt=new pn,HGt=new U(1,1,1);function _p(e,t,n,i=HGt){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,Bke);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,Bke),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,VGt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,jGt);return yi.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var kke={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(kke);var ec=kke;function GGt(e){if(e===ec.LEFT)return ln.LEFT_DOWN;if(e===ec.MIDDLE)return ln.MIDDLE_DOWN;if(e===ec.RIGHT)return ln.RIGHT_DOWN}function WGt(e){if(e===ec.LEFT)return ln.LEFT_UP;if(e===ec.MIDDLE)return ln.MIDDLE_UP;if(e===ec.RIGHT)return ln.RIGHT_UP}var gle=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=GGt(s.button),c=WGt(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)},ln.MOUSE_MOVE,s);return o}},yp=gle;var _le=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 ia(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}},y8=_le;var yle=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 ia(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}},A8=yle;var Ale=class{constructor(){this._elevatorController=new y8,this._mapController=new A8,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)}},ble=Ale;var xle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT,modifier:Zr.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 ia(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}},Tle=xle;var Ele=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.MIDDLE})]}static _getDefaultScrollInputs(){return[ln.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 ia(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),ln.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}},Cle=Ele;var Uke={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(Uke);var vle=Uke;var Sle=`uniform sampler2D u_depthTexture; +${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()),le(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,Lke(this),Fke(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 UGt=new ue;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??UGt)===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&&Mke(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 Bke(this,e,{offset:t},!1)};Gr.prototype.flyTo=function(e,t){return Bke(this,e,t,!0)};function Bke(e,t,n,i){hle(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 Ss){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 AC(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Yo||o instanceof ZP||o instanceof Hb||o instanceof ra){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 g8(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function hle(e){let t=e._zoomPromise;l(t)&&(g8(e),e._completeZoom(!1))}Gr.prototype._postRender=function(){zGt(this),VGt(this)};var Rke=new ue;function zGt(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 mh(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)),g8(e)}if(t instanceof ZP){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Yo||t instanceof Hb){s(t.boundingSphere);return}if(t instanceof ra){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)),g8(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,Rke);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(Rke))}if(c.length===0){hle(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(g8(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),g8(e),e._completeZoom(!0))}var Oke=new ue;function VGt(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,Oke);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?Oke:void 0;e._entityView=new f3(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var _8=Gr;var mle=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()}},ple=mle;var kke=new h,jGt=new sn(h.UNIT_X,0),HGt=new pn,GGt=new U(1,1,1);function _p(e,t,n,i=GGt){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,kke);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,kke),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,jGt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,HGt);return _i.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var Uke={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(Uke);var ec=Uke;function WGt(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 qGt(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 gle=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=WGt(s.button),c=qGt(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=gle;var _le=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 ua(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}},y8=_le;var yle=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 ua(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}},A8=yle;var Ale=class{constructor(){this._elevatorController=new y8,this._mapController=new A8,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)}},ble=Ale;var xle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT,modifier:to.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 ua(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}},Tle=xle;var Ele=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 ua(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}},Cle=Ele;var zke={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(zke);var vle=zke;var Sle=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -12729,8 +12729,8 @@ 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 zke={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(zke);var wle=zke;function qGt(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: ${kp(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 Ile=qGt;globalThis.CESIUM_VERSION="1.145.0";var b8;typeof ko<"u"&&(b8=ko);(function(){/*! +`;var Vke={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(Vke);var wle=Vke;function YGt(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: ${Kp(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 Ile=YGt;globalThis.CESIUM_VERSION="1.145.0";var b8;typeof ko<"u"&&(b8=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) @@ -12739,39 +12739,39 @@ out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); |/(?:\\\\.|[^/])+/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: `+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 YGt=ko;typeof window<"u"?(ko=window.ko,typeof b8<"u"?window.ko=b8:delete window.ko):(ko=global.ko,typeof b8<"u"?global.ko=b8:delete global.ko);var $C=YGt;/** +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 XGt=ko;typeof window<"u"?(ko=window.ko,typeof b8<"u"?window.ko=b8:delete window.ko):(ko=global.ko,typeof b8<"u"?global.ko=b8:delete global.ko);var $C=XGt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Ple="__knockoutObservables",Dle="__knockoutSubscribable";function Vke(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=jke(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Ple||r===Dle)&&!(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&&KGt(n,a)}}),e}function jke(e,t){var n=e[Ple];return!n&&t&&(n={},Object.defineProperty(e,Ple,{value:n})),n}function XGt(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),Vke.call(i,e,[t]),e}function KGt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=$Gt(e,t,i))})}function $Gt(e,t,n){var i=JGt(e,n);return i.subscribe(t)}function JGt(e,t){var n=t[Dle];if(!n){n=new e.subscribable,Object.defineProperty(t,Dle,{value:n});var i={};ZGt(t,n,i),QGt(e,t,n,i)}return n}function ZGt(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 QGt(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 Hke(e,t){if(!e)return null;var n=jke(e,!1);return n&&n[t]||null}function e5t(e,t){var n=Hke(e,t);n&&n.valueHasMutated()}function t5t(e){e.track=Vke,e.getObservable=Hke,e.valueHasMutated=e5t,e.defineProperty=XGt}var x8={attachToKo:t5t};var Gke="http://www.w3.org/2000/svg",Wke="cesium-svgPath-svg",n5t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Gke,"svg:svg");i.setAttribute("class",Wke);let r=document.createElementNS(Gke,"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",`${Wke} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},T8=n5t;x8.attachToKo($C);T8.register($C);var ve=$C;function E8(e){l(e)||(e=new Vm),this._clock=e,this._eventHelper=new $o,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(E8.prototype,{clock:{get:function(){return this._clock}}});E8.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};E8.prototype.isDestroyed=function(){return!1};E8.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var C8=E8;function i5t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var Rle=i5t;function r5t(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=r5t;var QP={};QP.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};QP.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};QP.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};QP.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};QP.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 Af=QP;function o5t(e,t,n,i,r){return n.call(i,e[t]),ve.getObservable(e,t).subscribe(n,i,r)}var Cc=o5t;function qke(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(qke.prototype,{command:{get:function(){return this._command}}});var Wb=qke;function s5t(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 Ole(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var a5t=new pn,c5t=new h;function v8(e,t){let n=this,i=e.canvas,r=new ia(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 J_({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 _k({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=Ole(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Ole(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 zV({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,ln.LEFT_CLICK):r.removeInputAction(ln.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,a5t),g=o.pick(p,n._scene,c5t);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,ln.LEFT_CLICK):r.removeInputAction(ln.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(v8.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}}});v8.prototype._update=function(){this.frustums&&(this.frustumStatisticText=s5t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Ole(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}`};v8.prototype.isDestroyed=function(){return!1};v8.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(),le(this)};var S8=v8;function tq(e,t){e=Ln(e);let n=document.createElement("div"),i=new S8(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=Af.createSection,c=Af.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(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 ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var w8=tq;function Yke(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=Is.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Is.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 g0),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new kV(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof g0),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(Yke.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var I8=Yke;function nq(e,t){e=Ln(e);let n=new I8(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(nq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nq.prototype.isDestroyed=function(){return!1};nq.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),le(this)};var P8=nq;function Xke(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(Xke.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var uo=Xke;function l5t(){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 qg({style:Wg.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 qg({style:Wg.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 qg({style:Wg.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 ag.fromBasemapType(Bh.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 ag.fromBasemapType(Bh.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 ag.fromBasemapType(Bh.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 $_({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 $_({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var Ple="__knockoutObservables",Dle="__knockoutSubscribable";function jke(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Hke(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Ple||r===Dle)&&!(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&&$Gt(n,a)}}),e}function Hke(e,t){var n=e[Ple];return!n&&t&&(n={},Object.defineProperty(e,Ple,{value:n})),n}function KGt(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),jke.call(i,e,[t]),e}function $Gt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=JGt(e,t,i))})}function JGt(e,t,n){var i=ZGt(e,n);return i.subscribe(t)}function ZGt(e,t){var n=t[Dle];if(!n){n=new e.subscribable,Object.defineProperty(t,Dle,{value:n});var i={};QGt(t,n,i),e5t(e,t,n,i)}return n}function QGt(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 e5t(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 Gke(e,t){if(!e)return null;var n=Hke(e,!1);return n&&n[t]||null}function t5t(e,t){var n=Gke(e,t);n&&n.valueHasMutated()}function n5t(e){e.track=jke,e.getObservable=Gke,e.valueHasMutated=t5t,e.defineProperty=KGt}var x8={attachToKo:n5t};var Wke="http://www.w3.org/2000/svg",qke="cesium-svgPath-svg",i5t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Wke,"svg:svg");i.setAttribute("class",qke);let r=document.createElementNS(Wke,"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",`${qke} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},T8=i5t;x8.attachToKo($C);T8.register($C);var ve=$C;function E8(e){l(e)||(e=new Nm),this._clock=e,this._eventHelper=new Xo,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(E8.prototype,{clock:{get:function(){return this._clock}}});E8.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};E8.prototype.isDestroyed=function(){return!1};E8.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var C8=E8;function r5t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var Rle=r5t;function o5t(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=o5t;var QP={};QP.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};QP.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};QP.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};QP.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};QP.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 Af=QP;function s5t(e,t,n,i,r){return n.call(i,e[t]),ve.getObservable(e,t).subscribe(n,i,r)}var Cc=s5t;function Yke(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(Yke.prototype,{command:{get:function(){return this._command}}});var Wb=Yke;function Xke(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=Ss.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ss.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 M0),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 M0),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(Xke.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var v8=Xke;function tq(e,t){e=Ln(e);let n=new v8(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(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 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),le(this)};var S8=tq;function Kke(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(Kke.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var uo=Kke;function a5t(){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 Qg({style:Zg.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 Qg({style:Zg.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 Qg({style:Zg.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 $g.fromBasemapType(gm.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 $g.fromBasemapType(gm.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 $g.fromBasemapType(gm.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 hy({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 hy({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 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 $_({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> +https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new hy({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 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 $_({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> +https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new hy({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 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 $_({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> +https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new hy({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 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 eu.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 eu.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 eu.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 TA.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 eu.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 eu.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 eu.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 eu.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 eu.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 eu.fromAssetId(3891169)}})),e}var D8=l5t;function u5t(){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 g0({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 _C({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var R8=u5t;var Rl="http://www.w3.org/2000/svg",Zke="http://www.w3.org/1999/xlink",iq,O8=z.fromCssColorString("rgba(247,250,255,0.384)"),rq=z.fromCssColorString("rgba(143,191,255,0.216)"),Mle=z.fromCssColorString("rgba(153,197,255,0.098)"),oq=z.fromCssColorString("rgba(255,255,255,0.086)"),f5t=z.fromCssColorString("rgba(255,255,255,0.267)"),d5t=z.fromCssColorString("rgba(255,255,255,0)"),Kke=z.fromCssColorString("rgba(66,67,68,0.3)"),$ke=z.fromCssColorString("rgba(0,0,0,0.5)");function qb(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var M8={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(Zke,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Lle(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 h5t(e,t){let n=Lle(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 m5t(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 p5t(e,t){let n=Lle(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 g5t(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 Jke(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 _5t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var sq=new z;function Xs(e,t){let n=t.alpha,i=1-n;return sq.red=e.red*i+t.red*n,sq.green=e.green*i+t.green*n,sq.blue=e.blue*i+t.blue*n,sq.toCssColorString()}function Nle(e,t,n){let i=M8[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 y5t(e,t,n){let i=M8[n],r=M8.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 A5t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&iq!==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?(iq=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===iq&&(iq=void 0),n.shuttleRingDragging=!1}function Ey(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)]}Ey.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();le(this)};Ey.prototype.isDestroyed=function(){return!1};Ey.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")}};Ey.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")))};Ey.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function eD(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",Zke);let s=document.createElementNS(Rl,"g");this._topG=s,this._realtimeSVG=new Ey(y5t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ey(Nle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ey(Nle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ey(Nle(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=M8.animation_pathSwooshFX,f=M8.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=h5t(0,-24);this._knobDate=y.element;let A=p5t(0,-7);this._knobTime=A.element,this._knobStatus=Lle(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){A5t(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=[],Jke(this,y.parts,function(I,R){t.adjustDate(I,R)}),Jke(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){_5t(T._shuttleRingPointer,T._knobOuter,I)}),Cc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&m5t(y,I)}),Cc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&g5t(A,I)}),Cc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(eD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eD.prototype.isDestroyed=function(){return!1};eD.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 le(this)};eD.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};eD.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=qb(this._themeNormal),n=qb(this._themeHover),i=qb(this._themeSelect),r=qb(this._themeDisabled),o=qb(this._themeKnob),s=qb(this._themePointer),a=qb(this._themeSwoosh),c=qb(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,O8)},{tagName:"stop",offset:"12%","stop-color":Xs(t,rq)},{tagName:"stop",offset:"46%","stop-color":Xs(t,Mle)},{tagName:"stop",offset:"81%","stop-color":Xs(t,oq)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(n,O8)},{tagName:"stop",offset:"12%","stop-color":Xs(n,rq)},{tagName:"stop",offset:"46%","stop-color":Xs(n,Mle)},{tagName:"stop",offset:"81%","stop-color":Xs(n,oq)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(i,O8)},{tagName:"stop",offset:"12%","stop-color":Xs(i,rq)},{tagName:"stop",offset:"46%","stop-color":Xs(i,Mle)},{tagName:"stop",offset:"81%","stop-color":Xs(i,oq)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(r,f5t)},{tagName:"stop",offset:"75%","stop-color":Xs(r,d5t)}]},{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,$ke)},{tagName:"stop",offset:"100%","stop-color":Xs(s,$ke)}]},{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,O8)},{tagName:"stop",offset:"60%","stop-color":Xs(o,Kke)},{tagName:"stop",offset:"85%","stop-color":Xs(o,rq)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,Kke)},{tagName:"stop",offset:"60%","stop-color":Xs(o,O8)},{tagName:"stop",offset:"85%","stop-color":Xs(o,oq)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var N8=eD;var b5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Yb=15,tD=105,x5t=[31,28,31,30,31,30,31,31,30,31,30,31];function T5t(e,t){return t===2&&Bl(e)?29:x5t[t-1]}function Qke(e,t,n){return K.fromGregorianDate(new Uh(t,n,Math.min(e.day,T5t(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function e3e(e,t){return e-t}function Fle(e,t){let n=wr(t,e,e3e);return n<0?~n:n}function E5t(e,t){if(Math.abs(e)<=Yb)return e/Yb;let n=Yb,i=tD,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 C5t(e,t,n){if(n.clockStep===Vr.SYSTEM_CLOCK)return Yb;if(Math.abs(e)<=1)return e*Yb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Yb,o=tD,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 bf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=bf.defaultDateFormatter,this._timeFormatter=bf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ve.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(bf.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===Vr.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 C5t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,tD),-tD);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===tD){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=E5t(s,a);if(t.snapToTicks)u=a[Fle(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>Yb?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===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,ve.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,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 Wb(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 Wb(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 Wb(r,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Vr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Rn(function(){t._clockViewModel.clockStep=Vr.SYSTEM_CLOCK},ve.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Wb(o,{toggled:ve.computed(function(){return e.clockStep===Vr.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=Fle(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Fle(c,a)+1;u<a.length&&(s.multiplier=a[u])})}bf.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${b5t[n.month-1]} ${n.day} ${n.year}`};bf.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];bf.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`};bf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};bf.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(e3e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Qn(s,o),this._allShuttleRingTicks=s};bf.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=Qke(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=Qke(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};bf.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(bf.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}}});bf._maxShuttleRingAngle=tD;bf._realtimeShuttleRingAngle=Yb;var L8=bf;function aq(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(aq.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});aq.prototype.isDestroyed=function(){return!1};aq.prototype.destroy=function(){document.removeEventListener(es.changeEventName,this._callback),le(this)};var F8=aq;var v5t="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",S5t="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 cq(e,t){e=Ln(e);let n=new F8(t,e);n._exitFullScreenPath=S5t,n._enterFullScreenPath=v5t;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(cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cq.prototype.isDestroyed=function(){return!1};cq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var B8=cq;function w5t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Yo&&(e.tileset=n.primitive),e.pickActive=!1}}function n3e(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Yo&&(e.tileset=i.primitive)},ln.MOUSE_MOVE):(e._eventHandler.removeInputAction(ln.MOUSE_MOVE),e.picking=e.picking)}var I5t={maximumFractionDigits:3};function k8(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,I5t):Math.round(t).toLocaleString()}function U8(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[so.PICK]:e._statisticsPerPass[so.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>${k8(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${k8(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${k8(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function i3e(){let e=Fi.statistics;return` + © <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 iu.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 iu.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 iu.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 CA.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 iu.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 iu.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 iu.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 iu.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 iu.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 iu.fromAssetId(3891169)}})),e}var w8=a5t;function c5t(){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 M0({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 nC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var I8=c5t;var Rl="http://www.w3.org/2000/svg",Qke="http://www.w3.org/1999/xlink",nq,P8=z.fromCssColorString("rgba(247,250,255,0.384)"),iq=z.fromCssColorString("rgba(143,191,255,0.216)"),Ole=z.fromCssColorString("rgba(153,197,255,0.098)"),rq=z.fromCssColorString("rgba(255,255,255,0.086)"),l5t=z.fromCssColorString("rgba(255,255,255,0.267)"),u5t=z.fromCssColorString("rgba(255,255,255,0)"),$ke=z.fromCssColorString("rgba(66,67,68,0.3)"),Jke=z.fromCssColorString("rgba(0,0,0,0.5)");function qb(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var D8={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(Qke,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Nle(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 f5t(e,t){let n=Nle(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 d5t(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 h5t(e,t){let n=Nle(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 m5t(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 Zke(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 p5t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var oq=new z;function Xs(e,t){let n=t.alpha,i=1-n;return oq.red=e.red*i+t.red*n,oq.green=e.green*i+t.green*n,oq.blue=e.blue*i+t.blue*n,oq.toCssColorString()}function Mle(e,t,n){let i=D8[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 g5t(e,t,n){let i=D8[n],r=D8.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 _5t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&nq!==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?(nq=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===nq&&(nq=void 0),n.shuttleRingDragging=!1}function Ey(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)]}Ey.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();le(this)};Ey.prototype.isDestroyed=function(){return!1};Ey.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")}};Ey.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")))};Ey.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function eD(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",Qke);let s=document.createElementNS(Rl,"g");this._topG=s,this._realtimeSVG=new Ey(g5t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ey(Mle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ey(Mle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ey(Mle(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=D8.animation_pathSwooshFX,f=D8.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=f5t(0,-24);this._knobDate=y.element;let A=h5t(0,-7);this._knobTime=A.element,this._knobStatus=Nle(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){_5t(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=[],Zke(this,y.parts,function(I,R){t.adjustDate(I,R)}),Zke(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){p5t(T._shuttleRingPointer,T._knobOuter,I)}),Cc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&d5t(y,I)}),Cc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&m5t(A,I)}),Cc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(eD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eD.prototype.isDestroyed=function(){return!1};eD.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 le(this)};eD.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};eD.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=qb(this._themeNormal),n=qb(this._themeHover),i=qb(this._themeSelect),r=qb(this._themeDisabled),o=qb(this._themeKnob),s=qb(this._themePointer),a=qb(this._themeSwoosh),c=qb(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,P8)},{tagName:"stop",offset:"12%","stop-color":Xs(t,iq)},{tagName:"stop",offset:"46%","stop-color":Xs(t,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(t,rq)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(n,P8)},{tagName:"stop",offset:"12%","stop-color":Xs(n,iq)},{tagName:"stop",offset:"46%","stop-color":Xs(n,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(n,rq)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(i,P8)},{tagName:"stop",offset:"12%","stop-color":Xs(i,iq)},{tagName:"stop",offset:"46%","stop-color":Xs(i,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(i,rq)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(r,l5t)},{tagName:"stop",offset:"75%","stop-color":Xs(r,u5t)}]},{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,Jke)},{tagName:"stop",offset:"100%","stop-color":Xs(s,Jke)}]},{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,P8)},{tagName:"stop",offset:"60%","stop-color":Xs(o,$ke)},{tagName:"stop",offset:"85%","stop-color":Xs(o,iq)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,$ke)},{tagName:"stop",offset:"60%","stop-color":Xs(o,P8)},{tagName:"stop",offset:"85%","stop-color":Xs(o,rq)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var R8=eD;var y5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Yb=15,tD=105,A5t=[31,28,31,30,31,30,31,31,30,31,30,31];function b5t(e,t){return t===2&&Bl(e)?29:A5t[t-1]}function e3e(e,t,n){return K.fromGregorianDate(new Bh(t,n,Math.min(e.day,b5t(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function t3e(e,t){return e-t}function Lle(e,t){let n=vr(t,e,t3e);return n<0?~n:n}function x5t(e,t){if(Math.abs(e)<=Yb)return e/Yb;let n=Yb,i=tD,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 T5t(e,t,n){if(n.clockStep===Vr.SYSTEM_CLOCK)return Yb;if(Math.abs(e)<=1)return e*Yb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Yb,o=tD,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 bf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=bf.defaultDateFormatter,this._timeFormatter=bf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ve.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(bf.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===Vr.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 T5t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,tD),-tD);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===tD){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=x5t(s,a);if(t.snapToTicks)u=a[Lle(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>Yb?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===Rs.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===Rs.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===Rs.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 Wb(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 Wb(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 Wb(r,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Vr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Rn(function(){t._clockViewModel.clockStep=Vr.SYSTEM_CLOCK},ve.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Wb(o,{toggled:ve.computed(function(){return e.clockStep===Vr.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=Lle(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Lle(c,a)+1;u<a.length&&(s.multiplier=a[u])})}bf.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${y5t[n.month-1]} ${n.day} ${n.year}`};bf.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];bf.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`};bf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};bf.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(t3e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);ti(s,o),this._allShuttleRingTicks=s};bf.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=e3e(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=e3e(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};bf.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(bf.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}}});bf._maxShuttleRingAngle=tD;bf._realtimeShuttleRingAngle=Yb;var O8=bf;function E5t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Yo&&(e.tileset=n.primitive),e.pickActive=!1}}function i3e(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Yo&&(e.tileset=i.primitive)},un.MOUSE_MOVE):(e._eventHandler.removeInputAction(un.MOUSE_MOVE),e.picking=e.picking)}var C5t={maximumFractionDigits:3};function M8(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,C5t):Math.round(t).toLocaleString()}function N8(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>${M8(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${M8(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${M8(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function r3e(){let e=Li.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${k8(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${k8(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${M8(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${M8(e.texturesByteLength)}</li> </ul> - `}var P5t=[{text:"Highlight",value:Fu.HIGHLIGHT},{text:"Replace",value:Fu.REPLACE},{text:"Mix",value:Fu.MIX}],t3e=new z(1,1,0,.4),D5t=new z,lq=new z;function vc(e,t){let n=this,i=e.canvas;this._eventHandler=new ia(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new J_({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=Fu.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 ra?(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()}},ln.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(ln.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=w5t(this),S=ve.observable();ve.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,ln.LEFT_CLICK):n._eventHandler.removeInputAction(ln.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)||n3e(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 P5t}},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=U8(e,!1),this._pickStatisticsText=U8(e,!0),this._resourceCacheStatisticsText=i3e(),n3e(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,D5t):z.WHITE:t.color=lq,this._scene.requestRender()),l(e)&&(z.clone(e.color,lq),e.color=t3e,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()&&!Ble(t.content)&&(t.color=lq,this._scene.requestRender()),l(e)&&!Ble(e.content)&&(z.clone(e.color,lq),e.color=t3e,this._scene.requestRender()),this._tile=e}}});function Ble(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(!Ble(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 Qg(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(` + `}var v5t=[{text:"Highlight",value:Uu.HIGHLIGHT},{text:"Replace",value:Uu.REPLACE},{text:"Mix",value:Uu.MIX}],n3e=new z(1,1,0,.4),S5t=new z,sq=new z;function vc(e,t){let n=this,i=e.canvas;this._eventHandler=new ua(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new my({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=Uu.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 na?(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=E5t(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)||i3e(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 v5t}},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=N8(e,!1),this._pickStatisticsText=N8(e,!0),this._resourceCacheStatisticsText=r3e(),i3e(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,S5t):z.WHITE:t.color=sq,this._scene.requestRender()),l(e)&&(z.clone(e.color,sq),e.color=n3e,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()&&!Fle(t.content)&&(t.color=sq,this._scene.requestRender()),l(e)&&!Fle(e.content)&&(z.clone(e.color,sq),e.color=n3e,this._scene.requestRender()),this._tile=e}}});function Fle(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(!Fle(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 l_(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=U8(e,!1),this._pickStatisticsText=U8(e,!0),this._resourceCacheStatisticsText=i3e())};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()}),le(this)};vc.getStatistics=U8;var z8=vc;function uq(e,t){e=Ln(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new z8(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=Af.createSection,c=Af.createCheckbox,u=Af.createRangeInput,f=Af.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(uq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uq.prototype.isDestroyed=function(){return!1};uq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var V8=uq;var r3e=1e3;function bp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new XC({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=s3e,this._handleArrowUp=o3e;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??jb.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)F5t(t);else return N5t(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?o3e(t):o?s3e(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;l3e(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 o3e(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 s3e(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 R5t(e,t){let n=l(t)?t.availability:void 0;return l(n)?VT(t,[e]).then(function(i){return e=i[0],e.height+=r3e,e}):(e.height+=r3e,Promise.resolve(e))}function O5t(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=jT(t,n):t=i.cartesianToCartographic(t),l(a)||(a=R5t(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 M5t(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 N5t(e,t,n){let i=e._searchText;if(c3e(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 M5t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Ule(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=a3e(e,$P.getCreditsFromResult(s[0]));l(a)||kle(e,t[r].credit);return}e._searchText=`${i} (not found)`}function kle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function a3e(e,t){return l(t)&&t.forEach(n=>kle(e,n)),t}function Ule(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function L5t(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 F5t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function c3e(e){return/^\s*$/.test(e)}function l3e(e){ve.getObservable(e,"_suggestions").removeAll()}async function B5t(e){if(!e.autoComplete)return;let t=e._searchText;if(l3e(e),Ule(e),!c3e(t))for(let n of e._geocoderServices){let i=await n.geocode(t,jb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=$P.getCreditsFromResult(o);r=r&&!l(s),a3e(e,s)}),r&&kle(e,n.credit)}if(e._suggestions.length>=5)return}}bp.flyToDestination=O5t;bp._updateSearchSuggestions=B5t;bp._adjustSuggestionsScroll=L5t;bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Ule(this),le(this)};var j8=bp;var k5t="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 fq(e){let t=Ln(e.container),n=new j8(e);n._startSearchPath=k5t,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(fq.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});fq.prototype.isDestroyed=function(){return!1};fq.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),le(this)};var H8=fq;function z5t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function f3e(e,t){ve.track(e);for(let n=0;n<e.sublayers.length;n++)f3e(e.sublayers[n],t)}function dq(e){return e.modelName==="FullModel"}function d3e(e){return e.modelName==="Overview"}function h3e(e){return d3e(e)||dq(e)}function u3e(e,t){if(h3e(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 V5t(e,t){if(h3e(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");dq(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function j5t(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 H5t(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:z5t,setOptionDisable:function(i,r){ve.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){V5t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){f3e(n[i],this.viewModel);let r=u3e(n[i],this.viewModel);l(r)&&(d3e(r)||!l(this.viewModel.defaultLayer)&&dq(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=u3e(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=dq(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return j5t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var G8=H5t;function G5t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` +`);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=N8(e,!1),this._pickStatisticsText=N8(e,!0),this._resourceCacheStatisticsText=r3e())};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()}),le(this)};vc.getStatistics=N8;var L8=vc;function aq(e,t){e=Ln(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new L8(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=Af.createSection,c=Af.createCheckbox,u=Af.createRangeInput,f=Af.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(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 ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var F8=aq;function cq(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(cq.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});cq.prototype.isDestroyed=function(){return!1};cq.prototype.destroy=function(){document.removeEventListener(es.changeEventName,this._callback),le(this)};var B8=cq;var w5t="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",I5t="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 lq(e,t){e=Ln(e);let n=new B8(t,e);n._exitFullScreenPath=I5t,n._enterFullScreenPath=w5t;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(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(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var k8=lq;function P5t(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 Ble(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var D5t=new pn,R5t=new h;function U8(e,t){let n=this,i=e.canvas,r=new ua(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 my({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 $z({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=Ble(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Ble(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,D5t),g=o.pick(p,n._scene,R5t);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(U8.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}}});U8.prototype._update=function(){this.frustums&&(this.frustumStatisticText=P5t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Ble(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}`};U8.prototype.isDestroyed=function(){return!1};U8.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(),le(this)};var z8=U8;function uq(e,t){e=Ln(e);let n=document.createElement("div"),i=new z8(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=Af.createSection,c=Af.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(uq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uq.prototype.isDestroyed=function(){return!1};uq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var V8=uq;var o3e=1e3;function bp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new sC({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=a3e,this._handleArrowUp=s3e;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??Ib.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)B5t(t);else return L5t(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?s3e(t):o?a3e(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;u3e(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 s3e(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 a3e(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 O5t(e,t){let n=l(t)?t.availability:void 0;return l(n)?aC(t,[e]).then(function(i){return e=i[0],e.height+=o3e,e}):(e.height+=o3e,Promise.resolve(e))}function M5t(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=AC(t,n):t=i.cartesianToCartographic(t),l(a)||(a=O5t(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 N5t(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 L5t(e,t,n){let i=e._searchText;if(l3e(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 N5t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Ule(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=c3e(e,pP.getCreditsFromResult(s[0]));l(a)||kle(e,t[r].credit);return}e._searchText=`${i} (not found)`}function kle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function c3e(e,t){return l(t)&&t.forEach(n=>kle(e,n)),t}function Ule(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function F5t(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 B5t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function l3e(e){return/^\s*$/.test(e)}function u3e(e){ve.getObservable(e,"_suggestions").removeAll()}async function k5t(e){if(!e.autoComplete)return;let t=e._searchText;if(u3e(e),Ule(e),!l3e(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Ib.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=pP.getCreditsFromResult(o);r=r&&!l(s),c3e(e,s)}),r&&kle(e,n.credit)}if(e._suggestions.length>=5)return}}bp.flyToDestination=M5t;bp._updateSearchSuggestions=k5t;bp._adjustSuggestionsScroll=F5t;bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Ule(this),le(this)};var j8=bp;var U5t="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",z5t="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 fq(e){let t=Ln(e.container),n=new j8(e);n._startSearchPath=U5t,n._stopSearchPath=z5t;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(fq.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});fq.prototype.isDestroyed=function(){return!1};fq.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),le(this)};var H8=fq;function f3e(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(f3e.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 G8=f3e;function dq(e,t,n){e=Ln(e);let i=new G8(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(dq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dq.prototype.isDestroyed=function(){return!1};dq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var W8=dq;function V5t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function h3e(e,t){ve.track(e);for(let n=0;n<e.sublayers.length;n++)h3e(e.sublayers[n],t)}function hq(e){return e.modelName==="FullModel"}function m3e(e){return e.modelName==="Overview"}function p3e(e){return m3e(e)||hq(e)}function d3e(e,t){if(p3e(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 j5t(e,t){if(p3e(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");hq(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 G5t(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:V5t,setOptionDisable:function(i,r){ve.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){j5t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){h3e(n[i],this.viewModel);let r=d3e(n[i],this.viewModel);l(r)&&(m3e(r)||!l(this.viewModel.defaultLayer)&&hq(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=d3e(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=hq(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 q8=G5t;function W5t(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" @@ -12813,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let r=new G8(t);ve.track(r),ve.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var zle=G5t;function m3e(){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(m3e.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var W8=m3e;function hq(e){let t=Ln(e.container),n=new W8,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(hq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});hq.prototype.isDestroyed=function(){return!1};hq.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),le(this)};var q8=hq;var W5t="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",q5t="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 Vle(){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?q5t:W5t}}),ve.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Vle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Vle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var Y8=Vle;function mq(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 Y8;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(mq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});mq.prototype.isDestroyed=function(){return!1};mq.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(),le(this)};var X8=mq;function p3e(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(p3e.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 K8=p3e;function pq(e,t,n){e=Ln(e);let i=new K8(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(pq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pq.prototype.isDestroyed=function(){return!1};pq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var $8=pq;function jle(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=Uk.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(jle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});jle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var J8=jle;function gq(e){let t=Ln(e.container),n=new J8(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(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),le(this)};var Z8=gq;function _q(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new $o,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(_q.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}}});_q.prototype.isDestroyed=function(){return!1};_q.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var Q8=_q;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",X5t="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",K5t="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 yq(e,t,n){e=Ln(e);let i=new Q8(t,n);i._globePath=Y5t,i._flatMapPath=X5t,i._columbusViewPath=K5t;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(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 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),le(this)};var ej=yq;function Aq(e){this._scene=e,this._orthographic=e.camera.frustum instanceof mn,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 $o,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof mn}),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(Aq.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}}});Aq.prototype.isDestroyed=function(){return!1};Aq.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var tj=Aq;var $5t="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",J5t="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 bq(e,t){e=Ln(e);let n=new tj(t);n._perspectivePath=$5t,n._orthographicPath=J5t;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(bq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});bq.prototype.isDestroyed=function(){return!1};bq.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),le(this)};var nj=bq;var Z5t=new U,xq="-1000px";function ij(e,t,n){this._scene=e,this._screenPositionX=xq,this._screenPositionY=xq,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 fr.worldToWindowCoordinates(e,i,r)}}ij.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Z5t);if(!l(e))this._screenPositionX=xq,this._screenPositionY=xq;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`}}};ij.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Es.EXPONENTIAL_OUT})};ij.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Es.EXPONENTIAL_OUT})};Object.defineProperties(ij.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var rj=ij;function Tq(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 rj(t,this._element,this._container);this._viewModel=c,ve.applyBindings(this._viewModel,this._element)}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(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),le(this)};var oj=Tq;function JC(e,t,n){this._color=e,this._height=t,this._base=n??0}JC.prototype.getHeight=function(){return this._height};JC.prototype.getBase=function(){return this._base};JC.prototype.getStartTime=function(){return this._start};JC.prototype.getStopTime=function(){return this._stop};JC.prototype.setRange=function(e,t){this._start=e,this._stop=t};JC.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 sj=JC;function g3e(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)}g3e.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 aj=g3e;var Hle=1e12,Oh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Eu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Xb=[.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],Q5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cu(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=Oh.none,this._touchMode=Eu.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=e9t(this),this._onMouseUp=t9t(this),this._onMouseMove=n9t(this),this._onMouseWheel=i9t(this),this._onTouchStart=r9t(this),this._onTouchMove=s9t(this),this._onTouchEnd=o9t(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()}Cu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cu.prototype.isDestroyed=function(){return!1};Cu.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),le(this)};Cu.prototype.addHighlightRange=function(e,t,n){let i=new sj(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cu.prototype.addTrack=function(e,t,n,i){let r=new aj(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Cu.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)};Cu.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 Gle(e){return e<10?`0${e.toString()}`:e.toString()}Cu.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`${Q5t[t.month-1]} ${t.day} ${t.year} ${Gle(t.hour)}:${Gle(t.minute)}:${Gle(t.second)}${i}`};Cu.prototype.smallestTicInPixels=7;Cu.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=Xb.length,V;for(V=0;V<F;++V){let k=Xb[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,Xb[P]))<1e-5){Xb[P]>=f&&(_=Xb[P]);break}if(M>=0)for(;M<P;){if(Math.abs(S(_,Xb[M]))<1e-5&&Xb[M]>=f){C=Xb[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})};Cu.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)))};Cu.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 e9t(e){return function(t){e._mouseMode!==Oh.touchOnly&&(t.button===0?(e._mouseMode=Oh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Oh.zoom:e._mouseMode=Oh.slide)),t.preventDefault()}}function t9t(e){return function(t){e._mouseMode=Oh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function n9t(e){return function(t){let n;if(e._mouseMode===Oh.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===Oh.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===Oh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function i9t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Hle=Math.max(Math.min(Math.abs(n),Hle),1),n/=Hle,e.zoomFrom(Math.pow(1.05,-n))}}function r9t(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Oh.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=Eu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Eu.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Eu.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=Eu.ignore}}function o9t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap?(e._touchMode=Eu.scrub,e._onTouchMove(t)):e._touchMode===Eu.scrub&&e._onTouchMove(t),e._mouseMode=Oh.touchOnly,n!==1?e._touchMode=n>0?Eu.ignore:Eu.none:e._touchMode===Eu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function s9t(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap&&(e._touchMode=Eu.slideZoom),e._mouseMode=Oh.touchOnly,e._touchMode===Eu.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===Eu.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))}}Cu.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 cj=Cu;var y3e=Qo(_3e(),1);function a9t(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 A3e(){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 c9t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(A3e(),e._locked=!1),e._noSleep.disable(),es.exitFullscreen(),n(!1)):(es.fullscreen||es.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=a9t("landscape")),t.useWebVR=!0,n(!0)))}function Eq(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 $o,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof mn)}),this._locked=!1,this._noSleep=new y3e.default,this._command=Rn(function(){c9t(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&&(A3e(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(Eq.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});Eq.prototype.isDestroyed=function(){return!1};Eq.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(es.changeEventName,this._callback),le(this)};var uj=Eq;var l9t="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",u9t="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 Cq(e,t,n){e=Ln(e);let i=new uj(t,n);i._exitVRPath=u9t,i._enterVRPath=l9t;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(Cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Cq.prototype.isDestroyed=function(){return!1};Cq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var fj=Cq;var b3e=new ue;function E3e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function f9t(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 d9t(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 x3e(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof eo)return i;if(n instanceof ra||n instanceof yT)return new eo({name:d9t(n),description:f9t(n),feature:n})}return g9t(e,t.position)}var h9t=new K;function qle(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,h9t)),e.updateFromClock(),e.zoomTo(i,r)}}}var m9t=new h;function p9t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Yo)return i}}function g9t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=p9t(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new eo({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 eo({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,m9t);u.position=new uu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=T3e())}),s}function T3e(){return new eo({id:"None",description:"No features found."})}function _9t(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 Vm,u=new C8(c),f=!0);let d=new _8(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 $o;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 oj(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 X8(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 XC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new H8({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 $8(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 ej(A,p));let E;t.projectionPicker&&(E=new nj(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??D8(),q=t.terrainProviderViewModels??R8();v=new P8(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 q8({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 N8(G,new L8(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 cj(G,c),O.addEventListener("settime",E3e,!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 B8(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 fj(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){_9t(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=x3e(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=x3e(i,G)}d.screenSpaceEventHandler.setInputAction(k,ln.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,ln.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,qle(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(ln.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ln.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",E3e,!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(),le(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,b3e)!==Pt.FAILED?n=b3e.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&&qle(this.timeline,e)};lr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&qle(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 Yle=lr;function y9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new V8(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Xle=y9t;function A9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new w8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Kle=A9t;function b9t(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){C3e(s,u),s=f,$le(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?$le(s,u):C3e(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){ZC(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=x9t(e,m,c,a),y.onerror=T9t(e,m),y.readAsText(m)}}$le(s,u),e.destroy=p8(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function ZC(e){e.stopPropagation(),e.preventDefault()}function C3e(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",ZC,!1),n.removeEventListener("dragover",ZC,!1),n.removeEventListener("dragexit",ZC,!1))}function $le(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",ZC,!1),e.addEventListener("dragover",ZC,!1),e.addEventListener("dragexit",ZC,!1)}function x9t(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=d4.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=db.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=YE.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=c8.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 Jle=b9t;function E9t(e,t){t=t??H.EMPTY_OBJECT;let n=new Z8({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Zle=E9t;function v3e(e){let t=e.split(` + </div>`,n.appendChild(i);let r=new q8(t);ve.track(r),ve.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var zle=W5t;var q5t="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",Y5t="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 Vle(){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?Y5t:q5t}}),ve.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Vle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Vle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var Y8=Vle;function mq(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 Y8;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(mq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});mq.prototype.isDestroyed=function(){return!1};mq.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(),le(this)};var X8=mq;function g3e(){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(g3e.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var K8=g3e;function pq(e){let t=Ln(e.container),n=new K8,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(pq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pq.prototype.isDestroyed=function(){return!1};pq.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),le(this)};var $8=pq;function jle(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=fV.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(jle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});jle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var J8=jle;function gq(e){let t=Ln(e.container),n=new J8(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(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),le(this)};var Z8=gq;function _q(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 Xo,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(_q.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}}});_q.prototype.isDestroyed=function(){return!1};_q.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var Q8=_q;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",K5t="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 yq(e,t){e=Ln(e);let n=new Q8(t);n._perspectivePath=X5t,n._orthographicPath=K5t;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(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 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),le(this)};var ej=yq;function Aq(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",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(Aq.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}}});Aq.prototype.isDestroyed=function(){return!1};Aq.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var tj=Aq;var $5t="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",J5t="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",Z5t="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 bq(e,t,n){e=Ln(e);let i=new tj(t,n);i._globePath=$5t,i._flatMapPath=J5t,i._columbusViewPath=Z5t;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(bq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});bq.prototype.isDestroyed=function(){return!1};bq.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),le(this)};var nj=bq;var Q5t=new U,xq="-1000px";function ij(e,t,n){this._scene=e,this._screenPositionX=xq,this._screenPositionY=xq,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 dr.worldToWindowCoordinates(e,i,r)}}ij.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Q5t);if(!l(e))this._screenPositionX=xq,this._screenPositionY=xq;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`}}};ij.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ls.EXPONENTIAL_OUT})};ij.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ls.EXPONENTIAL_OUT})};Object.defineProperties(ij.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var rj=ij;function Tq(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 rj(t,this._element,this._container);this._viewModel=c,ve.applyBindings(this._viewModel,this._element)}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(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),le(this)};var oj=Tq;function JC(e,t,n){this._color=e,this._height=t,this._base=n??0}JC.prototype.getHeight=function(){return this._height};JC.prototype.getBase=function(){return this._base};JC.prototype.getStartTime=function(){return this._start};JC.prototype.getStopTime=function(){return this._stop};JC.prototype.setRange=function(e,t){this._start=e,this._stop=t};JC.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 sj=JC;function _3e(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)}_3e.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 aj=_3e;var Hle=1e12,Oh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Eu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Xb=[.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],e9t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cu(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=Oh.none,this._touchMode=Eu.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=t9t(this),this._onMouseUp=n9t(this),this._onMouseMove=i9t(this),this._onMouseWheel=r9t(this),this._onTouchStart=o9t(this),this._onTouchMove=a9t(this),this._onTouchEnd=s9t(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()}Cu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cu.prototype.isDestroyed=function(){return!1};Cu.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),le(this)};Cu.prototype.addHighlightRange=function(e,t,n){let i=new sj(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cu.prototype.addTrack=function(e,t,n,i){let r=new aj(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Cu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Rs.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)};Cu.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 Gle(e){return e<10?`0${e.toString()}`:e.toString()}Cu.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`${e9t[t.month-1]} ${t.day} ${t.year} ${Gle(t.hour)}:${Gle(t.minute)}:${Gle(t.second)}${i}`};Cu.prototype.smallestTicInPixels=7;Cu.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=Xb.length,V;for(V=0;V<F;++V){let k=Xb[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,Xb[P]))<1e-5){Xb[P]>=f&&(_=Xb[P]);break}if(M>=0)for(;M<P;){if(Math.abs(S(_,Xb[M]))<1e-5&&Xb[M]>=f){C=Xb[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})};Cu.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)))};Cu.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 t9t(e){return function(t){e._mouseMode!==Oh.touchOnly&&(t.button===0?(e._mouseMode=Oh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Oh.zoom:e._mouseMode=Oh.slide)),t.preventDefault()}}function n9t(e){return function(t){e._mouseMode=Oh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function i9t(e){return function(t){let n;if(e._mouseMode===Oh.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===Oh.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===Oh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function r9t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Hle=Math.max(Math.min(Math.abs(n),Hle),1),n/=Hle,e.zoomFrom(Math.pow(1.05,-n))}}function o9t(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Oh.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=Eu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Eu.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Eu.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=Eu.ignore}}function s9t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap?(e._touchMode=Eu.scrub,e._onTouchMove(t)):e._touchMode===Eu.scrub&&e._onTouchMove(t),e._mouseMode=Oh.touchOnly,n!==1?e._touchMode=n>0?Eu.ignore:Eu.none:e._touchMode===Eu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function a9t(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap&&(e._touchMode=Eu.slideZoom),e._mouseMode=Oh.touchOnly,e._touchMode===Eu.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===Eu.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))}}Cu.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 cj=Cu;var A3e=Qo(y3e(),1);function c9t(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 b3e(){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 l9t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(b3e(),e._locked=!1),e._noSleep.disable(),es.exitFullscreen(),n(!1)):(es.fullscreen||es.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c9t("landscape")),t.useWebVR=!0,n(!0)))}function Eq(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 Xo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof gn)}),this._locked=!1,this._noSleep=new A3e.default,this._command=Rn(function(){l9t(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&&(b3e(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(Eq.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});Eq.prototype.isDestroyed=function(){return!1};Eq.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(es.changeEventName,this._callback),le(this)};var uj=Eq;var u9t="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",f9t="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 Cq(e,t,n){e=Ln(e);let i=new uj(t,n);i._exitVRPath=f9t,i._enterVRPath=u9t;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(Cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Cq.prototype.isDestroyed=function(){return!1};Cq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var fj=Cq;function x3e(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 Mh(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=v3e(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===hc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===hc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===hc.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 C9t=new h,v9t=new h,S9t=new Ic,w9t=new $;function J0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,C9t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,v9t),i=S9t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,w9t),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=N.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Mh.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=v3e(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)}}});Mh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Mh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Mh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Mh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Mh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Mh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Mh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new zp({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Mh.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(` +`}return i}function Mh(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=x3e(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===xc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===xc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===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:-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 d9t=new h,h9t=new h,m9t=new wc,p9t=new $;function J0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,d9t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,h9t),i=m9t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,p9t),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=N.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Mh.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=x3e(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)}}});Mh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Mh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Mh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Mh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Mh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Mh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Mh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new k0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Mh.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};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),le(this)};var dj=Mh;function vq(e,t){e=Ln(e);let n=document.createElement("div"),i=new dj(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}=Af,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)),Qle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Qle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Qle("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(vq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vq.prototype.isDestroyed=function(){return!1};vq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Qle(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=Af.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 hj=vq;function I9t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new hj(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var eue=I9t;globalThis.CESIUM_VERSION="1.145.0";var P9t="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}); +`);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};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),le(this)};var dj=Mh;function vq(e,t){e=Ln(e);let n=document.createElement("div"),i=new dj(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}=Af,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)),qle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),qle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),qle("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(vq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vq.prototype.isDestroyed=function(){return!1};vq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function qle(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=Af.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 hj=vq;var T3e=new ue;function v3e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function g9t(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 _9t(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 Jr)return i;if(n instanceof na||n instanceof NT)return new Jr({name:_9t(n),description:g9t(n),feature:n})}return x9t(e,t.position)}var y9t=new K;function Yle(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,y9t)),e.updateFromClock(),e.zoomTo(i,r)}}}var A9t=new h;function b9t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Yo)return i}}function x9t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=b9t(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new Jr({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=C3e();return}let c=a[0],u=new Jr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,A9t);u.position=new Gl(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=C3e())}),s}function C3e(){return new Jr({id:"None",description:"No features found."})}function T9t(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 Nm,u=new C8(c),f=!0);let d=new _8(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,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 oj(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 X8(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 sC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new H8({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 W8(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 nj(A,p));let E;t.projectionPicker&&(E=new ej(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??w8(),q=t.terrainProviderViewModels??I8();v=new S8(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 $8({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 R8(G,new O8(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 cj(G,c),O.addEventListener("settime",v3e,!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 k8(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 fj(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){T9t(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,Yle(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",v3e,!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(),le(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,T3e)!==Pt.FAILED?n=T3e.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&&Yle(this.timeline,e)};lr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Yle(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 Xle=lr;function E9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new F8(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Kle=E9t;function C9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new V8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var $le=C9t;function v9t(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,Jle(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Jle(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){ZC(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=S9t(e,m,c,a),y.onerror=w9t(e,m),y.readAsText(m)}}Jle(s,u),e.destroy=ZU(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function ZC(e){e.stopPropagation(),e.preventDefault()}function S3e(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",ZC,!1),n.removeEventListener("dragover",ZC,!1),n.removeEventListener("dragexit",ZC,!1))}function Jle(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",ZC,!1),e.addEventListener("dragover",ZC,!1),e.addEventListener("dragexit",ZC,!1)}function S9t(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=_k.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=mb.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=YE.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=rU.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 w9t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Zle=v9t;function I9t(e,t){t=t??H.EMPTY_OBJECT;let n=new Z8({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Qle=I9t;function P9t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new hj(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var eue=P9t;globalThis.CESIUM_VERSION="1.145.0";var D9t="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 eb02b61ec..a0e4e95e4 100644 --- a/plugins/feature/map/Cesium/index.js +++ b/plugins/feature/map/Cesium/index.js @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var Nke=Object.create;var nN=Object.defineProperty;var Lke=Object.getOwnPropertyDescriptor;var Fke=Object.getOwnPropertyNames;var Bke=Object.getPrototypeOf,kke=Object.prototype.hasOwnProperty;var Uke=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;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 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}},zke=(e,t)=>{for(var n in t)nN(e,n,{get:t[n],enumerable:!0})},Vke=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fke(t))!kke.call(e,r)&&r!==n&&nN(e,r,{get:()=>t[r],enumerable:!(i=Lke(t,r))||i.enumerable});return e};var js=(e,t,n)=>(n=e!=null?Nke(Bke(e)):{},Vke(t||!e||!e.__esModule?nN(n,"default",{value:e,enumerable:!0}):n,e));var ut=(e,t,n)=>Uke(e,typeof t!="symbol"?t+"":t,n);var rN=uh((KGt,Qae)=>{var D0=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)};D0.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}};D0.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};D0.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};D0.prototype.random_int31=function(){return this.random_int()>>>1};D0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};D0.prototype.random=function(){return this.random_int()*(1/4294967296)};D0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};D0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Qae.exports=D0});var kce=uh((EE,CE)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof EE=="object"&&EE&&!EE.nodeType&&EE,n=typeof CE=="object"&&CE&&!CE.nodeType&&CE,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(CE.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(EE)});var zce=uh((Uce,_N)=>{/*! +var Lke=Object.create;var nN=Object.defineProperty;var Fke=Object.getOwnPropertyDescriptor;var Bke=Object.getOwnPropertyNames;var kke=Object.getPrototypeOf,Uke=Object.prototype.hasOwnProperty;var zke=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;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 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}},Vke=(e,t)=>{for(var n in t)nN(e,n,{get:t[n],enumerable:!0})},jke=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bke(t))!Uke.call(e,r)&&r!==n&&nN(e,r,{get:()=>t[r],enumerable:!(i=Fke(t,r))||i.enumerable});return e};var js=(e,t,n)=>(n=e!=null?Lke(kke(e)):{},jke(t||!e||!e.__esModule?nN(n,"default",{value:e,enumerable:!0}):n,e));var ut=(e,t,n)=>zke(e,typeof t!="symbol"?t+"":t,n);var sN=uh((HGt,Gae)=>{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)};Gae.exports=P0});var uce=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 dce=uh((fce,gN)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ var Nke=Object.create;var nN=Object.defineProperty;var Lke=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof _N=="object"&&_N.exports?_N.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Uce,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 jce=uh((Vce,yN)=>{/*! + */(function(e,t){"use strict";typeof gN=="object"&&gN.exports?gN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(fce,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 mce=uh((hce,_N)=>{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ var Nke=Object.create;var nN=Object.defineProperty;var Lke=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof yN=="object"&&yN.exports?yN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Vce,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 nf=uh((Hce,AN)=>{/*! + */(function(e,t){"use strict";typeof _N=="object"&&_N.exports?_N.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(hce,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 ef=uh((pce,yN)=>{/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,1498 +58,1669 @@ var Nke=Object.create;var nN=Object.defineProperty;var Lke=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof AN=="object"&&AN.exports?AN.exports=t(kce(),zce(),jce()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Hce,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=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]\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 vye=uh((p9n,Cye)=>{"use strict";Cye.exports=Qst;var VD=1e20;function Qst(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?VD:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?VD:S===0?0:Math.pow(Math.max(0,S-.5),2)}Tye(A,o,s,x,T,v,E),Tye(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 Tye(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(Eye(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(Eye(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Eye(e,t,n,i,r){n[0]=0,i[0]=-VD,i[1]=+VD;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]=+VD}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 Rye=uh((O9n,hV)=>{function lat(){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 hV<"u"&&hV.exports&&(hV.exports=lat)});var Wee=uh((QAi,J1)=>{/*! + */(function(e,t){"use strict";typeof yN=="object"&&yN.exports?yN.exports=t(uce(),dce(),mce()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(pce,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 Uye=uh((pKn,kye)=>{"use strict";kye.exports=Uat;var n1=1e20;function Uat(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?n1:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?n1:S===0?0:Math.pow(Math.max(0,S-.5),2)}Fye(A,o,s,x,T,v,E),Fye(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 Fye(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(Bye(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(Bye(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Bye(e,t,n,i,r){n[0]=0,i[0]=-n1,i[1]=+n1;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]=+n1}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 Wye=uh((OKn,pV)=>{function Kat(){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 pV<"u"&&pV.exports&&(pV.exports=Kat)});var jee,WS,ke,nT,ku,Po,_ve,iT,yve,Ave,dr,cc=Cs(()=>{jee=new Date(2107,11,31,23,59,58),WS=new Date(1980,0,1),ke=void 0,nT=1/0,ku="undefined",Po="function",_ve="object",iT="string",yve="number",Ave="boolean",dr=new Uint8Array});function YS(e){if(e&&typeof e!=Po)throw new Error(Zve);return e}function aj(e){if(e&&(typeof e.addEventListener!=Po||typeof e.aborted!=Ave))throw new Error(Qve);return e||ke}function cj(e,t){if(e&&typeof e!=iT||t&&!(t instanceof Uint8Array))throw new Error(Wee)}function qee(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function XS(e,t,n){e!==ke&&qee(e,t,n)}function rT(e){return typeof e==iT&&e.trim()?Number(e):e}var bve,xve,Tve,Eve,Cve,$8,J8,Z8,Q8,vve,Sve,wve,Ive,Pve,Dve,Rve,Ove,ej,tj,nj,ij,Mve,Nve,Lve,Fve,Bve,kve,Uve,zve,Vve,Hee,jve,Hve,vR,qS,Gve,Wve,qve,Yve,Xve,Kve,Gee,$ve,Jve,rj,oj,_A,sj,zg,Zve,Qve,Wee,SR=Cs(()=>{cc();bve="filenameEncoding",xve="commentEncoding",Tve="decodeText",Eve="extractPrependedData",Cve="extractAppendedData",$8="password",J8="rawPassword",Z8="passThrough",Q8="signal",vve="checkPasswordOnly",Sve="checkOverlappingEntryOnly",wve="checkOverlappingEntry",Ive="checkAmbiguity",Pve="checkLocalDirectory",Dve="checkSignature",Rve="checkCrc32",Ove="checkAuthenticationCode",ej="useWebWorkers",tj="useCompressionStream",nj="transferStreams",ij="preventClose",Mve="encryptionStrength",Nve="extendedTimestamp",Lve="ntfsTimestamp",Fve="keepOrder",Bve="level",kve="bufferedWrite",Uve="createTempStream",zve="dataDescriptorSignature",Vve="useUnicodeFileNames",Hee="dataDescriptor",jve="supportZip64SplitFile",Hve="encodeText",vR="offset",qS="usdz",Gve="unixExtraFieldType",Wve="localExtraField",qve="centralExtraField",Yve="strictness",Xve="filenameValidation",Kve="normalizeFilename",Gee="maxAppendedDataSize",$ve="decryptCentralDirectory",Jve="signCentralDirectory",rj="filename",oj="comment",_A="strict",sj="balanced",zg="tolerant",Zve="Invalid option (must be a function)",Qve="Invalid signal (must be an AbortSignal instance)",Wee="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function Vg(){return Yee}function wR(e){return Xee(e.chunkSize)}function Xee(e){return e=rT(e),Number.isInteger(e)&&e>=tSe?Math.max(e,yAt):eSe}function IR(e){Object.assign(Yee,cSe(lSe(e)))}function cSe(e){let t={};for(let n of xAt){let i=e[n];i!==ke&&(t[n]=TAt(n,i))}return t}function TAt(e,t){if(sSe.includes(e)){if(t=rT(t),e==oSe&&(!Number.isInteger(t)||t<tSe))throw new Error(nSe)}else aSe.includes(e)&&YS(t);return t}function lSe(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 KS(e){let t=cSe(lSe(e));Object.assign(rSe,t),Object.assign(Yee,t)}var eSe,yAt,tSe,nSe,iSe,rSe,oSe,AAt,bAt,sSe,aSe,xAt,Yee,Gp=Cs(()=>{cc();SR();eSe=64*1024,yAt=64,tSe=1,nSe="Invalid maxWorkers (must be an integer greater than 0)",iSe=2;try{typeof navigator!=ku&&navigator.hardwareConcurrency&&(iSe=navigator.hardwareConcurrency)}catch{}rSe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:eSe,maxWorkers:iSe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=ku&&CompressionStream,DecompressionStream:typeof DecompressionStream!=ku&&DecompressionStream},oSe="maxWorkers",AAt=["baseURI","wasmURI","workerURI"],bAt=["useCompressionStream","useWebWorkers","transferStreams"],sSe=["chunkSize",oSe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],aSe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],xAt=[...AAt,...bAt,...sSe,...aSe],Yee={...rSe}});function Hd(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function lj(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 oT=Cs(()=>{});var PR,uSe,EAt,CAt,vAt,SAt,wAt,IAt,PAt,om,DR=Cs(()=>{PR=[[],[],[],[],[],[],[],[]];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;PR[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=PR[t-1][e];PR[t][e]=n>>>8^PR[0][n&255]}[uSe,EAt,CAt,vAt,SAt,wAt,IAt,PAt]=PR,om=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=PAt[a&255]^IAt[a>>>8&255]^wAt[a>>>16&255]^SAt[a>>>24&255]^vAt[c&255]^CAt[c>>>8&255]^EAt[c>>>16&255]^uSe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^uSe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var RR,fSe=Cs(()=>{DR();RR=class extends TransformStream{constructor(){let t,n=new om;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 $S(e){if(typeof TextEncoder==ku){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 Kee=Cs(()=>{cc()});var Yl,OR,dSe,$ee,Jee,yA,hSe=Cs(()=>{Yl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Yl.getPartial(n);return i===32?e.concat(t):Yl._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+Yl.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]=Yl.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=Yl.getPartial(r);return i.push(Yl.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},OR={bytes:{fromBits(e){let n=Yl.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(Yl.partial(8*(n&3),i)),t}}},dSe={};dSe.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=OR.utf8String.toBits(e));let n=t._buffer=Yl.concat(t._buffer,e),i=t._length,r=t._length=i+Yl.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=Yl.concat(t,[Yl.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}};$ee={};$ee.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}};Jee={};Jee.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=Yl.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 Yl.clamp(t,r)}};yA={importKey(e){return new yA.hmacSha1(OR.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=Yl;for(t=OR.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)}};yA.hmacSha1=class{constructor(e){let t=this,n=t._hash=dSe.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 uj(e){if(DAt)return crypto.getRandomValues(e);throw new Error(JS)}var DAt,Wp,AA,bA,jg,JS,fj=Cs(()=>{cc();DAt=typeof crypto!=ku&&typeof crypto.getRandomValues==Po,Wp="Invalid password",AA="Invalid signature",bA=AA,jg="zipjs-abort-check-password",JS="Crypto API not supported"});function ySe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:GAt(t,n),strength:i-1,pendingInput:dr})}function ASe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Hd(c,t));let u=t.length-r;n=WAt(n,i+(u-u%ZS));let f;for(f=0;f<=u-ZS;f+=ZS){let d=FR(qp,Gd(t,f,f+ZS));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(LR(qp,p),f+i)}return e.pendingInput=Gd(t,f),n}async function zAt(e,t,n,i){let r=await bSe(e,t,n,Gd(i,0,NR[t])),o=Gd(i,NR[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(Wp)}async function VAt(e,t,n){let i=uj(new Uint8Array(NR[t])),r=await bSe(e,t,n,i);return Hd(i,r)}async function bSe(e,t,n,i){e.password=null;let r=await jAt(RAt,n,NAt,!1,LAt),o=await HAt(Object.assign({salt:i},Zee),r,8*(MR[t]*2+2)),s=new Uint8Array(o),a=FR(qp,Gd(s,0,MR[t])),c=FR(qp,Gd(s,MR[t],MR[t]*2)),u=Gd(s,MR[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new kAt(new BAt(a),Array.from(FAt)),hmac:new UAt(c)}),u}async function jAt(e,t,n,i,r){if(mSe)try{return await BR.importKey(e,t,n,i,r)}catch{return mSe=!1,yA.importKey(t)}else return yA.importKey(t)}async function HAt(e,t,n){if(pSe)try{return await BR.deriveBits(e,t,n)}catch{return pSe=!1,yA.pbkdf2(t,e.salt,Zee.iterations,n)}else return yA.pbkdf2(t,e.salt,Zee.iterations,n)}function GAt(e,t){return t===ke?$S(e):t}function WAt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Gd(e,t,n){return e.subarray(t,n)}function LR(e,t){return e.fromBits(t)}function FR(e,t){return e.toBits(t)}var ZS,RAt,gSe,OAt,MAt,NAt,Zee,LAt,NR,MR,Hg,FAt,mj,BR,_Se,qp,BAt,kAt,UAt,mSe,pSe,dj,hj,xSe=Cs(()=>{cc();Kee();oT();hSe();fj();ZS=16,RAt="raw",gSe={name:"PBKDF2"},OAt={name:"HMAC"},MAt="SHA-1",NAt=Object.assign({hash:OAt},gSe),Zee=Object.assign({iterations:1e3,hash:{name:MAt}},gSe),LAt=["deriveBits"],NR=[8,12,16],MR=[16,24,32],Hg=10,FAt=[0,0,0,0],mj=typeof crypto!=ku,BR=mj&&crypto.subtle,_Se=mj&&typeof BR!=ku,qp=OR.bytes,BAt=$ee.aes,kAt=Jee.ctrGladman,UAt=yA.hmacSha1,mSe=mj&&_Se&&typeof BR.importKey==Po,pSe=mj&&_Se&&typeof BR.deriveBits==Po,dj=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){ySe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await zAt(c,f,u,Gd(s,0,NR[f]+2)),s=Gd(s,NR[f]+2),r?a.error(new Error(jg)):d()):await p;let g=new Uint8Array(s.length-Hg-(s.length-Hg)%ZS);a.enqueue(ASe(c,s,g,0,Hg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=Gd(u,0,u.length-Hg),p=Gd(u,u.length-Hg),g=dr;if(d.length){let A=FR(qp,d);c.update(A);let b=a.update(A);g=LR(qp,b)}let m=Gd(LR(qp,c.digest()),0,Hg),y=u.length<Hg?1:0;for(let A=0;A<Hg;A++)y|=m[A]^p[A];if(y&&o)throw new Error(bA);s.enqueue(g)}}})}},hj=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){ySe(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 VAt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%ZS);p.set(d,0),o.enqueue(ASe(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(FR(qp,a));s.update(d),u=LR(qp,d)}let f=LR(qp,s.digest()).slice(0,Hg);r.enqueue(Hd(u,f))}}})}}});function vSe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),qAt(e,t,n)}function TSe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=SSe(e)^t[i],_j(e,n[i]);return n}function ESe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=SSe(e)^t[i],_j(e,t[i]);return n}function qAt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new om(i[0]),crcKey2:new om(i[2])}),n)for(let r=0;r<n.length;r++)_j(e,n[r]);else for(let r=0;r<t.length;r++)_j(e,t.charCodeAt(r))}function _j(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=CSe(Math.imul(CSe(n+wSe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function SSe(e){let t=e.keys[2]|2;return wSe(Math.imul(t,t^1)>>>8)}function wSe(e){return e&255}function CSe(e){return e&4294967295}var QS,pj,gj,ISe=Cs(()=>{DR();fj();QS=12,pj=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){vSe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=TSe(a,o.subarray(0,QS));if(a.password=a.rawPassword=null,(c[QS-1]^a.passwordVerification)!=0)throw new Error(Wp);o=o.subarray(QS)}r?s.error(new Error(jg)):s.enqueue(TSe(a,o))}})}},gj=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){vSe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=uj(new Uint8Array(QS));u[QS-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(ESe(s,u),0),c=QS}else a=new Uint8Array(r.length),c=0;a.set(ESe(s,r),c),o.enqueue(a)}})}}});function sm(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 Yp(e,t){e=sm(e);let n=t?{type:t}:{};if(YAt())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 YAt(){return typeof Blob.prototype.stream!=Po||new Blob([]).stream()instanceof ReadableStream}function PSe(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 ew=Cs(()=>{cc()});function yj(e){return XAt.get(e)}function Aj(e){return Qee.get(e)}function KAt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Po&&typeof i!=Po)throw new Error(DSe);Qee.set(e,{CompressionStream:n,DecompressionStream:i})}async function RSe(e,t){!Qee.has(e)&&t&&KAt(e,await import(t))}var DSe,XAt,Qee,aT=Cs(()=>{cc();DSe="Invalid codec module",XAt=new Map,Qee=new Map});function QAt(e,t,n){let i=new om,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(NSe);y.set(JAt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(ete),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=am(e,f),e=nw(e,t),am(e,d);function p(){g(),s=setTimeout(()=>c(new Error(xA)),ZAt)}function g(){clearTimeout(s)}}function nte(e,t){if(!e)return!1;let n=OSe.get(e);n||(n=new Map,OSe.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 Ej(e){return nte(e,tte)}function ite(e){return nte(e,UR)}function LSe(e,t,n){t=am(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function FSe(e,t,n){if(!e)throw new Error($At);return new e(t,n)}function BSe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?MSe:tte,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return nw(e,a)}function am(e,t){return sm(e).pipeThrough(t)}function nw(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 ebt(n,o),await tbt(i,o)}}}async function ebt(e,t){try{await e.abort(t)}catch{}}async function tbt(e,t){try{await e.cancel(t)}catch{}}function nbt(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(iw);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var xA,iw,rw,$At,tte,MSe,UR,NSe,ete,JAt,ZAt,bj,xj,Tj,OSe,rte=Cs(()=>{DR();fSe();xSe();ISe();fj();cc();oT();ew();aT();xA="Invalid uncompressed size",iw="Invalid compressed data",rw=AA,$At="Compression method not supported",tte="deflate-raw",MSe="deflate64-raw",UR="gzip",NSe=10,ete=8,JAt=[31,139,8],ZAt=5e3,bj=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&&Aj(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new RR,T=am(T,A)),o)if(E)T=nw(T,FSe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new xj,T=nw(T,new r(UR)),T=am(T,x);else try{T=BSe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(UR)}catch{throw S}T=nw(T,I),T=am(T,new xj)}s&&(c?T=am(T,new gj(t)):(b=new hj(t),T=am(T,b))),LSe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},xj=class extends TransformStream{constructor(){let t,n=NSe,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<=ete){i=Hd(i,r);return}let a=s-ete,c=Math.min(a,i.length);o.enqueue(Hd(i.subarray(0,c),r.subarray(0,a-c))),i=Hd(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}};Tj=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=am(x,new pj(t)):(b=new dj(t),x=am(x,b))),u){let T=p&&Aj(p);if(T)x=nw(x,FSe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=BSe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===ke)throw E;let v;try{v=new r(UR)}catch{throw E}x=QAt(x,v,y)}x=nbt(x)}a&&(A=new RR,x=am(x,A)),LSe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(rw)}})}},OSe=new Map});var ibt,kSe,USe,zSe,ote,VSe,jSe,ow,vj,Cj,zR,Sj=Cs(()=>{cc();rte();ibt=64*1024,kSe="message",USe="start",zSe="pull",ote="data",VSe="ack",jSe="close",ow="deflate",vj="inflate",Cj=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(ow)?o=bj:r.startsWith(vj)&&(o=Tj),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(xA)},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)}})}},zR=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=ibt),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 GSe({initModule:e}){Ij=e}function WSe(e){ate=e}async function qSe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||Ej(t)||ite(t))return!0;if(n)try{return await Ij(e),!0}catch{return!1}return!1}function lte(e){e.createWorker?HSe=!0:wj=!1}async function ste(e,...t){try{await e(...t)}catch{}}function ute(e,t){return{run:()=>Pj(e,t)}}async function Pj({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(ow),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!Ej(d))try{await Ij(r)}catch{}}else try{await Ij(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new Cj(e,r),await t.pipeThrough(o).pipeThrough(new zR(wR(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 lT,wj,HSe,ate,Ij,cT,cte,VR=Cs(()=>{cc();Gp();Sj();lT="Worker startup timeout",Ij=()=>{};cT=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 HSe&&(f=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new zR(wR(o))).pipeThrough(new cte(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)}}}),wj===ke&&(wj=typeof Worker!=ku),(a&&ate&&(wj&&u||f)?ate:ute)(t,o)}},cte=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await ste(t,i)},async transform(s,a){o+=s.length,n&&await ste(n,o,i),a.enqueue(s)},async flush(){r&&await ste(r,o)}})}}});async function Mj(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=ubt(p,i.baseURI)),await RSe(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=uT.find(v=>!v.busy);if(E)return ewe(E),new cT(E,e,t,T);if(uT.length<y){let v={indexWorker:QSe};return QSe++,uT.push(v),new cT(v,e,t,T)}else return new Promise(v=>{sw.push({resolve:v,stream:e,workerOptions:t}),Rj=i.workerStarvationTimeout,Oj()})}function T(E){if(twe(),sw.length){let[{resolve:v,stream:S,workerOptions:I}]=sw.splice(0,1);v(new cT(E,S,I,T)),Oj()}else E.worker?(ewe(E),hbt(E,t)):uT=uT.filter(v=>v!=E)}}function ubt(e,t){try{return new URL(e,t).toString()}catch{return e}}function Oj(){!aw&&sw.length&&Number.isFinite(Rj)&&Rj>=0&&(aw=setTimeout(fbt,Rj))}function twe(){aw&&(clearTimeout(aw),aw=null)}function fbt(){if(aw=null,sw.length){let[{resolve:e,stream:t,workerOptions:n}]=sw.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new cT({},t,i,dbt)),Oj()}}function dbt(){twe(),Oj()}function hbt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{uT=uT.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function ewe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var uT,sw,aw,Rj,QSe,Nj=Cs(()=>{cc();Sj();aT();VR();uT=[],sw=[],QSe=0});function iwe(e){if(mbt){let t="";for(let n=0;n<e.length;n++)t+=nwe[e[n]];return t}else return new TextDecoder().decode(e)}var nwe,mbt,rwe=Cs(()=>{nwe="\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(""),mbt=nwe.length==256});function jR(e,t){return swe(e,t,!0)}function owe(e,t){return swe(e,t,!1)}function swe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?iwe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var gte=Cs(()=>{rwe()});function gbt(){uwe=(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();_te=n==1}catch{_te=!1}})()}function kj(e){return!!(e&&e.getData)}async function Ec(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function _bt(e){return e=new Gg(e),await Ec(e),(e.size===ke||!e.readUint8Array)&&(e=new Uu(await Yp(e.readable)),await Ec(e)),e}function Do(e,t,n){return e.readUint8Array(t,n)}function Ate(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?lw.prototype.createReadable.call(e,t):e.readable}var cwe,lwe,pbt,hOi,mOi,yte,awe,cw,lw,Lj,HR,_te,uwe,Uu,uw,GR,WR,Fj,Bj,Gg,fw,Uj=Cs(()=>{cc();Gp();oT();ew();gte();cwe="Writer iterator completed too soon",lwe="Writer not initialized",pbt="text/plain",hOi=256*1024,mOi=16*1024*1024,yte="writable",awe=Symbol(),cw=class{constructor(){this.size=0}init(){this.initialized=!0}},lw=class extends cw{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=wR(Vg())}={}){let r=this,o=0;return i=Xee(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-o),c=await Do(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},Lj=class extends cw{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(lwe);return t.writeUint8Array(lj(i))}});Object.defineProperty(t,yte,{get(){return n}})}writeUint8Array(){}},HR=class extends Lj{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)}};Uu=class extends lw{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),uwe||gbt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?sm(i.stream()):_te?sm(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)}},uw=class extends cw{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,yte,{get(){return i.writable}}),n.contentType=t,n.blobPromise=Yp(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},GR=class extends Uu{constructor(t){super(new Blob([t],{type:pbt}))}},WR=class extends uw{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():owe(new Uint8Array(await i.arrayBuffer()),t)}},Fj=class extends lw{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(_bt));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 Do(c,a,n);else{let f=u-a,d=await Do(c,a,f),p=await i.readUint8Array(t+f,n-f);o=Hd(d,p)}}else o=dr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},Bj=class extends cw{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===awe){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(cwe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Ec(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,yte,{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(awe)}finally{t.releaseLock()}}},Gg=class{constructor(t){return Array.isArray(t)&&(t=new Fj(t)),(t instanceof ReadableStream||typeof t.getReader==Po)&&(t={readable:sm(t)}),t}},fw=class{constructor(t){return t.writable===ke&&typeof t.next==Po&&(t=new Bj(t)),(t instanceof WritableStream||typeof t.getWriter==Po)&&(t={writable:PSe(t)}),t.size===ke&&(t.size=0),t}}});var bte,xte,qR,Tte,YR,Ete,Cte,vte,dw,hw,XR,Ste,KR,wte,Ite,Pte,zj,Vj,Dte,Rte,Ote,jj,Mte,Nte,Lte,Fte,fT,Bte,ybt,kte,Hj,Abt,Gj,bbt,xbt,Tbt,Ebt,Ute,zte,Vte,jte,Cbt,vbt,Sbt,wbt,Ibt,Pbt,Dbt,Rbt,Obt,Mbt,Nbt,Lbt,Fbt,Bbt,kbt,Ubt,TA,Hte=Cs(()=>{bte="filename",xte="rawFilename",qR="comment",Tte="rawComment",YR="uncompressedSize",Ete="compressedSize",Cte="offset",vte="diskNumberStart",dw="lastModDate",hw="rawLastModDate",XR="lastAccessDate",Ste="rawLastAccessDate",KR="creationDate",wte="rawCreationDate",Ite="internalFileAttributes",Pte="externalFileAttributes",zj="internalFileAttribute",Vj="externalFileAttribute",Dte="msdosAttributesRaw",Rte="msdosAttributes",Ote="msDosCompatible",jj="zip64",Mte="encrypted",Nte="version",Lte="versionMadeBy",Fte="zipCrypto",fT="directory",Bte="executable",ybt="symlink",kte="compressionMethod",Hj="signature",Abt="crc32",Gj="extraField",bbt="extraFieldInfoZip",xbt="extraFieldUnix",Tbt="extraFieldUnixType1",Ebt="extraFieldPkwareUnix",Ute="unixMode",zte="setuid",Vte="setgid",jte="sticky",Cbt="bitFlag",vbt="rawBitFlag",Sbt="filenameLength",wbt="extraFieldLength",Ibt="unixExternalUpper",Pbt="filenameUTF8",Dbt="commentUTF8",Rbt="rawExtraField",Obt="extraFieldZip64",Mbt="extraFieldUnicodePath",Nbt="extraFieldUnicodeComment",Lbt="extraFieldAES",Fbt="extraFieldNTFS",Bbt="extraFieldExtendedTimestamp",kbt="extraFieldUSDZ",Ubt=[bte,xte,YR,Ete,dw,hw,qR,Tte,XR,Ste,KR,wte,Cte,vte,Ite,Pte,zj,Vj,Dte,Rte,Ote,jj,Mte,Nte,Lte,Fte,fT,Bte,ybt,kte,Hj,Abt,Gj,xbt,bbt,Tbt,Ebt,"uid","gid",Ute,Ibt,zte,Vte,jte,Cbt,vbt,Sbt,wbt,Pbt,Dbt,Rbt,Obt,Mbt,Nbt,Lbt,Fbt,Bbt,kbt],TA=class{constructor(t){Ubt.forEach(n=>this[n]=t[n])}}});var kwe={};Vke(kwe,{ERR_AMBIGUOUS_ARCHIVE:()=>_ne,ERR_BAD_FORMAT:()=>mw,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>fne,ERR_ENCRYPTED:()=>mne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>yne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>gne,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>une,ERR_EOCDR_NOT_FOUND:()=>lne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>hne,ERR_INVALID_AUTHENTICATION_CODE:()=>bA,ERR_INVALID_COMPRESSED_DATA:()=>iw,ERR_INVALID_CRC32:()=>rw,ERR_INVALID_FILENAME_VALIDATION:()=>xne,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Tne,ERR_INVALID_PASSWORD:()=>Wp,ERR_INVALID_SIGNATURE:()=>AA,ERR_INVALID_STRICTNESS:()=>bne,ERR_INVALID_UNCOMPRESSED_SIZE:()=>xA,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>dne,ERR_OVERLAPPING_ENTRY:()=>pne,ERR_SPLIT_ZIP_FILE:()=>Kj,ERR_UNSAFE_FILENAME:()=>Ane,ERR_UNSUPPORTED_COMPRESSION:()=>Xj,ERR_UNSUPPORTED_ENCRYPTION:()=>Yj,ERR_UNSUPPORTED_UINT64:()=>Ene,ERR_WORKER_STARTUP_TIMEOUT:()=>lT,WARNING_APPENDED_DATA:()=>Jj,WARNING_COMPRESSED_PATCHED_DATA:()=>Sne,WARNING_DUPLICATE_FILENAME:()=>Dne,WARNING_MALFORMED_EXTRA_FIELD:()=>u6,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Rne,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>One,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>Mne,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>pw,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Ine,WARNING_PREPENDED_DATA:()=>Zj,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Pne,WARNING_UNKNOWN_VERSION:()=>vne,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>wne,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Cne,WARNING_WRAPPED_ENTRIES_COUNT:()=>$j,ZipReader:()=>pT,ZipReaderStream:()=>e6,isZipFile:()=>Pwe});async function Pwe(e,t={}){if(e=new Gg(e),await Ec(e),(e.size===ke||!e.readUint8Array)&&(e=new Uu(await Yp(e.readable)),await Ec(e)),e.size<22)return!1;let n=Lne(t,{}),i=n!=zg,r=Nwe(t[Gee],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await Lwe(e,i,r);if(!o||n==_A&&s>1)return!1;let a=hr(li(o),20),c=o.offset+22+a;return e.size-c<=r}function Gte(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 Awe(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 Wte(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 Qbt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function ext(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:wf(n,2),uncompressedSize:wf(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 Dwe(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:pxt(o),filenameLength:hr(t,n+22),extraFieldLength:hr(t,n+24)})}function Rwe(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&&(txt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(bwe(p,bte,xte,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(bwe(g,qR,Tte,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(nxt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(xwe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(xwe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(ixt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=Twe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(Twe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(rxt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function txt(e,t){t.zip64=!0;let n=li(e.data),i=Kbt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+_we[s].bytes,0);if(e.data.length<r)throw new Error(hne);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=_we[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function bwe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=li(e.data),s=new om;s.append(r[n]);let a=li(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Pi(o,1),u=CA(o,0);Object.assign(e,{version:u,[t]:jR(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Pi(a,0)}),e.valid&&(i[t]=e[t],i[t+Xbt]=!0)}function nxt(e,t,n){let i=li(e.data),r=CA(i,4);Object.assign(e,{vendorVersion:CA(i,0),vendorId:CA(i,2),strength:r,originalCompressionMethod:n,compressionMethod:hr(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=Iwe&&(t.crc32=ke)}function ixt(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=qte(s),f=qte(a),d=qte(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function xwe(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 Twe(e,t,n){try{let i=li(e.data),r,o;if(n){let s=0,a=CA(i,s++),c=CA(i,s++);r=Ewe(e.data.subarray(s,s+c)),s+=c;let u=CA(i,s++);o=Ewe(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 Ewe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function rxt(e,t,n){if(!e.data.length)return;let i=li(e.data),r=CA(i,0),o=[],s=[];n?((r&1)==1&&(o.push(dw),s.push(hw)),(r&2)==2&&(o.push(XR),s.push(Ste)),(r&4)==4&&(o.push(KR),s.push(wte))):e.data.length>=5&&(o.push(dw),s.push(hw));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 oxt({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 Do(e,a+o,d+4),m=li(g),y=g.length==d+4&&Pi(m,0)==134695760;if(y){let A=Cwe(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=Cwe(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(pne);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function Cwe(e,t,n){let i=Pi(e,t),r,o;return n?(r=wf(e,t+4),o=wf(e,t+12)):(r=Pi(e,t+4),o=Pi(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function gw(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function sxt(e){return await Owe(e)==134695760}async function axt(e){let t=await Owe(e);return t==134695760||t==808471376}async function Owe(e){let t=await Do(e,0,4);return Pi(li(t))}function Mwe(e){return e===_A||e===sj||e===zg}function cxt(e,t,n){return Math.min(e,n?t*Zbt:t)}function Lne(e,t){return vwe(e,vwe(t,sj))}function vwe(e,t){let n=e[Yve];if(n!==ke){if(!Mwe(n))throw new Error(bne);return n}let i=e[Ive];return i===ke?t:i?_A:t==zg?zg:sj}function lxt(e,t){return e===ke?t!=zg:!!e}function uxt(e,t){return e===ke?t==_A:!!e}function fxt(e,t){if(e===ke)return t;if(!Mwe(e))throw new Error(xne);return e}function dxt(e,t){if(t==zg)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||Ybt.test(e)?!0:t==_A&&(n.includes(".")||n.includes(""))}function Nwe(e,t){if(e!==ke){let n=rT(e);if(typeof n!=yve||Number.isNaN(n)||n<0)throw new Error(Tne);return n}return t==_A?0:t==zg?1/0:65535}async function Lwe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:Jbt},s,a,c=0;for await(let[u,f,d,p,g]of Fwe(e,r)){let m=hr(u,p+20);if(g+22+m==i){let y=await Bwe(e,u,f,p,g,i,o);if(y==Qj){if(s||(s=Xte(d,p,g)),c++,!t||c>1)break}else y==Nne&&!a&&(a=Xte(d,p,g))}}return s||(s=a),s||(s=await hxt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function hxt(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 Fwe(e,r)){let p=Xte(u,f,d);o||(o=p);let g=await Bwe(e,a,c,f,d,i,n);if(g==Qj)return p;g==Nne&&!s&&(s=p)}return s||o}async function*Fwe(e,t){let n=e.size-t,i=await Do(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 Xte(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function Bwe(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 Swe(e,t,n,r-20,o,s)==117853008?Qj:ywe;if(!a&&!c)return Nne;let f=hr(t,i+6);for(let d of[r-c,gw(e,f)+u])if(await Swe(e,t,n,d,o,s)==33639248)return Qj;return ywe}async function Swe(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 Do(e,i,4);return Pi(li(s),0)}return ke}function mxt(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]))&&$p(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&gwe)!=(e.rawBitFlag&gwe)&&$p(s,r,Rne),t.compressionMethod!=e.compressionMethod&&$p(s,r,One),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&$p(s,r,Mne)}function $p(e,t,n){e?Wj(n):Wd(t,n)}function Wd(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function Wj(e){let t=new Error(_ne);throw t.reason=e,t}function ys(e,t,n){return t[n]===ke?e.options[n]:t[n]}function wwe(e,t,n){return YS(ys(e,t,n))}function pxt(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<WS?WS:i}function qte(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function CA(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 wf(e,t){let n=e.getBigUint64(t,!0);if(n>$bt)throw new Error(Ene);return Number(n)}var mw,lne,une,fne,dne,hne,mne,Yj,Xj,Kj,pne,gne,_ne,yne,Ane,bne,xne,Tne,Ene,Cne,vne,Sne,u6,wne,$j,Jj,Zj,Ine,Pne,Dne,pw,Rne,One,Mne,qbt,Ybt,mwe,Xbt,pwe,gwe,Iwe,Kbt,_we,$bt,Jbt,Zbt,ywe,Nne,Qj,pT,e6,Yte,Fne=Cs(()=>{cc();Gp();aT();Nj();Uj();gte();oT();ew();DR();Hte();SR();mw="File format is not recognized",lne="End of central directory not found",une="End of Zip64 central directory locator not found",fne="Central directory header not found",dne="Local file header not found",hne="Zip64 extra field not found",mne="File contains encrypted entry",Yj="Encryption method not supported",Xj="Compression method not supported",Kj="Split zip file",pne="Overlapping entry found",gne="Entry data out of bounds",_ne="Ambiguous archive",yne="Encrypted central directory is not supported",Ane="Unsafe filename",bne="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",xne="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Tne="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ene="64-bit value exceeds Number.MAX_SAFE_INTEGER",Cne="unsorted central directory",vne="unknown version needed to extract",Sne="compressed patched data",u6="malformed extra field",wne="unknown zip64 extensible data",$j="wrapped entries count",Jj="appended data",Zj="prepended data",Ine="prepended central directory",Pne="trailing central directory data",Dne="duplicate filename",pw="mismatched zip64 end of central directory record",Rne="mismatched local file header (general purpose bit flag)",One="mismatched local file header (compression method)",Mne="mismatched local file header (crc32 or sizes)",qbt=63,Ybt=/^[a-zA-Z]:/,mwe="utf-8",Xbt="UTF8",pwe="cp437",gwe=2057,Iwe=1,Kbt=[[YR,4294967295],[Ete,4294967295],[Cte,4294967295],[vte,65535]],_we={65535:{getValue:Pi,bytes:4},4294967295:{getValue:wf,bytes:8}},$bt=BigInt(Number.MAX_SAFE_INTEGER),Jbt=64,Zbt=1032,ywe=0,Nne=1,Qj=2,pT=class{constructor(t,n={}){Object.assign(this,{reader:new Gg(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Ec(i),(i.size===ke||!i.readUint8Array)&&(i=new Uu(await Yp(i.readable)),await Ec(i)),i.size<22)throw new Error(mw);let r=n.warnings=[],o=Lne(t,n.options),s=o==_A,a=o!=zg,c=Nwe(ys(n,t,Gee),o),u=fxt(ys(n,t,Xve),o),f=ys(n,t,Kve),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await Lwe(i,a,c);if(!d)throw await sxt(i)?new Error(Kj):new Error(lne);a&&p>1&&Wj("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&&Wj(Jj),T>0&&Wd(r,Jj);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+=gw(i,S)),N){let He=d.offset>=20?await Do(i,d.offset-20,20):dr,Ye=li(He);if(He.length==20&&Pi(Ye,0)==117853008){y=gw(i,Pi(Ye,4))+wf(Ye,8);let Ke=await Do(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 Do(i,y,56),Pe=li(Ke)}if(Ke.length<56||Pi(Pe,0)!=101075792)throw new Error(une);if(_=!0,C=wf(Pe,4)>44,C){let st=Math.min(wf(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Do(i,y+56,st);D=ext(vt)}}E==65535?E=Pi(Pe,16):E!=Pi(Pe,16)&&$p(s,r,pw),S==65535?S=Pi(Pe,20):S!=Pi(Pe,20)&&$p(s,r,pw),I==65535?I=wf(Pe,32):I!=wf(Pe,32)&&$p(s,r,pw),m==4294967295?m=wf(Pe,40):m!=wf(Pe,40)&&$p(s,r,pw),y=gw(i,S)+wf(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(Kj);if(y<0)throw new Error(mw);let B=0,j=await Do(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)||Gte(k),Ke=!Ye;if(!Ke&&He>=0&&He+4<=i.size){let Pe=await Do(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 Do(i,y,m),k=li(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Do(i,y,m),k=li(j)),y<0||y>=i.size)throw new Error(mw);n.directoryOffset=y,n.directoryLength=F;let q=wwe(n,t,$ve),Q,W;if(q&&I&&j.length>=4&&Pi(k,0)!=33639248&&(C||Gte(k))){let He=Qbt(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)&&Wd(r,wne),L=y;let J=ys(n,t,bve),Z=ys(n,t,xve),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=Awe(k,j,B),I&&Wd(r,$j));for(let He=0;He<I;He++){let Ye=new Yte(i,n.options);if(B+46>j.length||Pi(k,B)!=33639248)throw He==0&&!Q&&(C||Gte(k))?new Error(yne):new Error(fne);Dwe(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),yi=Yn&255,zi={readOnly:!!(yi&1),hidden:!!(yi&2),system:!!(yi&4),directory:!!(yi&16),archive:!!(yi&32)},Si=Pi(k,B+42),ui=wwe(n,t,Tve)||jR,Ai=ht?mwe:J||pwe,zn=Li?mwe:Z||pwe,tn=ui(mt,Ai,rj);if(tn===ke&&(tn=jR(mt,Ai)),f){let Fi=f(tn);Fi!==ke&&(tn=Fi)}if(dxt(tn,u)){let Fi=new Error(Ane);throw Fi.filename=tn,Fi}let Hn=ui(rt,zn,oj);Hn===ke&&(Hn=jR(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:yi,msdosAttributes:zi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Li,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:tn,comment:Hn}),Rwe(Ye,Ye,k,B+6)&&Wd(r,u6,tn),Ye.offset+=R;let Ki=gw(i,Ye.diskNumberStart)+Ye.offset;L=Math.min(Ki,L),Ki<fe&&Wd(r,Cne,tn),fe=Ki,(Ye.version&255)>qbt&&Wd(r,vne,tn),(Ye.rawBitFlag&32)==32&&Wd(r,Sne,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),pi=((Ye.unixMode===ke?wr:Ye.unixMode)&61440)==40960,ao=!pi&&(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:pi,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 TA(Ye);if(Fn.getData=(Fi,Ir)=>Ye.getData(Fi,Fn,n.readRanges,Ir),Fn.arrayBuffer=async Fi=>{let Ir=new TransformStream,Mc=Yp(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=Awe(k,j,B);Fi&&(I+=Fi,Wd(r,$j))}let{onprogress:Vi}=t;if(Vi)try{await Vi(He+1,I,new TA(Ye))}catch{}yield Fn}let ge=B,we=Wte(j.subarray(B))||(Q?Wte(W):ke);if(!we&&!Q){let He=y+B,Ye=Math.min(V-He,65541);Ye>=6&&(we=Wte(await Do(i,He,Ye)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&$p(s,r,Pne),Ae&&$p(s,r,Dne);let ve=ys(n,t,Eve),Re=ys(n,t,Cve),Qe=(s||ve)&&I&&L==4&&await axt(i)?4:0;return s&&(R||I&&L>Qe)&&Wj(Zj),(R||I&&L>4)&&Wd(r,Zj),O&&Wd(r,Ine),ve&&(n.prependedData=L>Qe?await Do(i,Qe,L-Qe):dr),n.comment=b?await Do(i,A+22,b):dr,Re&&(n.appendedData=x<i.size?await Do(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()}},e6=class{constructor(t={}){let{readable:n,writable:i}=new TransformStream,r=new pT(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}};Yte=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=Vg(),{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=gw(a,f)+u,R=await Do(a,I,30),O=li(R),L=ys(o,r,$8),_=ys(o,r,J8),C=ys(o,r,Z8);if(cj(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(Xj);if(R.length<30||Pi(O,0)!=67324752)throw new Error(dne);Dwe(v,O,4);let{extraFieldLength:w,filenameLength:D}=v,N=v.dataOffset=I+30+D+w,F=ys(o,r,Pve),V=Lne(r,o.options),B=lxt(F,V),j=uxt(F,V),k=dr;if(j&&(D||w)){let ft=await Do(a,I+30,D+w);k=ft.subarray(0,D),v.rawExtraField=ft.subarray(D)}else v.rawExtraField=w?await Do(a,I+30+D,w):dr;j&&(v.rawFilename=k),Rwe(o,v,O,4,!0)&&Wd(S,u6),mxt(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(Yj);let ae=C?ke:yj(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(Xj);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(Yj);if(!L&&!_)throw new Error(mne)}if(N+T>a.size)throw new Error(gne);let Ae=T,fe=sm(a.createReadable({offset:N,size:Ae})),xe=aj(ys(o,r,Q8)),ge=ys(o,r,vve),we=ys(o,r,wve),ve=ys(o,r,Sve);ve&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Ye=g!=0&&!C,Ke=C?T:x,Pe=g==9,qe=ys(o,r,tj);Pe&&(qe=!1);let st=ys(o,r,Rve),vt=(st===ke?ys(o,r,Dve):st)&&!C&&(!J||Z||d&&d.vendorVersion==Iwe),jt={options:{codecType:vj,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:ys(o,r,Ove),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:Ke,crc32:A,compressed:Ye,encrypted:J,useWebWorkers:ys(o,r,ej),useCompressionStream:qe,transferStreams:ys(o,r,nj),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 oxt({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 fw(t),await Ec(t,cxt(Ke,T,Ye)),{writable:lt}=t;let{outputSize:ft}=await Mj({readable:fe,writable:lt},jt);if(t.size+=ft,ft!=Ke)throw new Error(xA)}}catch(ft){if(ft.outputSize!==ke&&(t.size+=ft.outputSize),!ge||ft.message!=jg)throw mt=ft,ft}finally{if(!(!kj(t)&&ys(o,r,ij))&<&&!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 Ire=uh((Y6i,MO)=>{/*! * 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(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 J1=="object"&&J1&&J1.exports&&(J1.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 qCe=uh((MEi,kj)=>{/* 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 kj<"u"&&kj.exports?kj.exports=i:this.Lerc=i})()});var wte,cS,ke,Xx,Bu,Po,kve,Kx,Uve,zve,fr,cc=Cs(()=>{wte=new Date(2107,11,31,23,59,58),cS=new Date(1980,0,1),ke=void 0,Xx=1/0,Bu="undefined",Po="function",kve="object",Kx="string",Uve="number",zve="boolean",fr=new Uint8Array});function uS(e){if(e&&typeof e!=Po)throw new Error(ASe);return e}function c6(e){if(e&&(typeof e.addEventListener!=Po||typeof e.aborted!=zve))throw new Error(bSe);return e||ke}function l6(e,t){if(e&&typeof e!=Kx||t&&!(t instanceof Uint8Array))throw new Error(Dte)}function Rte(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function fS(e,t,n){e!==ke&&Rte(e,t,n)}function $x(e){return typeof e==Kx&&e.trim()?Number(e):e}var Vve,jve,Hve,Gve,Wve,Jj,Zj,Qj,e6,qve,Yve,Xve,Kve,$ve,Jve,Zve,Qve,t6,n6,i6,r6,eSe,tSe,nSe,iSe,rSe,oSe,sSe,aSe,cSe,Ite,lSe,uSe,cR,lS,fSe,dSe,hSe,mSe,pSe,gSe,Pte,_Se,ySe,o6,s6,nA,a6,Vg,ASe,bSe,Dte,lR=Cs(()=>{cc();Vve="filenameEncoding",jve="commentEncoding",Hve="decodeText",Gve="extractPrependedData",Wve="extractAppendedData",Jj="password",Zj="rawPassword",Qj="passThrough",e6="signal",qve="checkPasswordOnly",Yve="checkOverlappingEntryOnly",Xve="checkOverlappingEntry",Kve="checkAmbiguity",$ve="checkLocalDirectory",Jve="checkSignature",Zve="checkCrc32",Qve="checkAuthenticationCode",t6="useWebWorkers",n6="useCompressionStream",i6="transferStreams",r6="preventClose",eSe="encryptionStrength",tSe="extendedTimestamp",nSe="ntfsTimestamp",iSe="keepOrder",rSe="level",oSe="bufferedWrite",sSe="createTempStream",aSe="dataDescriptorSignature",cSe="useUnicodeFileNames",Ite="dataDescriptor",lSe="supportZip64SplitFile",uSe="encodeText",cR="offset",lS="usdz",fSe="unixExtraFieldType",dSe="localExtraField",hSe="centralExtraField",mSe="strictness",pSe="filenameValidation",gSe="normalizeFilename",Pte="maxAppendedDataSize",_Se="decryptCentralDirectory",ySe="signCentralDirectory",o6="filename",s6="comment",nA="strict",a6="balanced",Vg="tolerant",ASe="Invalid option (must be a function)",bSe="Invalid signal (must be an AbortSignal instance)",Dte="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function jg(){return Ote}function uR(e){return Mte(e.chunkSize)}function Mte(e){return e=$x(e),Number.isInteger(e)&&e>=TSe?Math.max(e,CEt):xSe}function fR(e){Object.assign(Ote,PSe(DSe(e)))}function PSe(e){let t={};for(let n of wEt){let i=e[n];i!==ke&&(t[n]=IEt(n,i))}return t}function IEt(e,t){if(wSe.includes(e)){if(t=$x(t),e==SSe&&(!Number.isInteger(t)||t<TSe))throw new Error(ESe)}else ISe.includes(e)&&uS(t);return t}function DSe(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 dS(e){let t=PSe(DSe(e));Object.assign(vSe,t),Object.assign(Ote,t)}var xSe,CEt,TSe,ESe,CSe,vSe,SSe,vEt,SEt,wSe,ISe,wEt,Ote,jp=Cs(()=>{cc();lR();xSe=64*1024,CEt=64,TSe=1,ESe="Invalid maxWorkers (must be an integer greater than 0)",CSe=2;try{typeof navigator!=Bu&&navigator.hardwareConcurrency&&(CSe=navigator.hardwareConcurrency)}catch{}vSe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:xSe,maxWorkers:CSe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=Bu&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Bu&&DecompressionStream},SSe="maxWorkers",vEt=["baseURI","wasmURI","workerURI"],SEt=["useCompressionStream","useWebWorkers","transferStreams"],wSe=["chunkSize",SSe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],ISe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],wEt=[...vEt,...SEt,...wSe,...ISe],Ote={...vSe}});function Ud(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function u6(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 Jx=Cs(()=>{});var dR,RSe,PEt,DEt,REt,OEt,MEt,NEt,LEt,om,hR=Cs(()=>{dR=[[],[],[],[],[],[],[],[]];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;dR[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=dR[t-1][e];dR[t][e]=n>>>8^dR[0][n&255]}[RSe,PEt,DEt,REt,OEt,MEt,NEt,LEt]=dR,om=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=LEt[a&255]^NEt[a>>>8&255]^MEt[a>>>16&255]^OEt[a>>>24&255]^REt[c&255]^DEt[c>>>8&255]^PEt[c>>>16&255]^RSe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^RSe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var mR,OSe=Cs(()=>{hR();mR=class extends TransformStream{constructor(){let t,n=new om;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 hS(e){if(typeof TextEncoder==Bu){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 Nte=Cs(()=>{cc()});var Ul,pR,MSe,Lte,Fte,iA,NSe=Cs(()=>{Ul={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Ul.getPartial(n);return i===32?e.concat(t):Ul._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+Ul.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]=Ul.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=Ul.getPartial(r);return i.push(Ul.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},pR={bytes:{fromBits(e){let n=Ul.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(Ul.partial(8*(n&3),i)),t}}},MSe={};MSe.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=pR.utf8String.toBits(e));let n=t._buffer=Ul.concat(t._buffer,e),i=t._length,r=t._length=i+Ul.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=Ul.concat(t,[Ul.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}};Lte={};Lte.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}};Fte={};Fte.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=Ul.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 Ul.clamp(t,r)}};iA={importKey(e){return new iA.hmacSha1(pR.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=Ul;for(t=pR.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)}};iA.hmacSha1=class{constructor(e){let t=this,n=t._hash=MSe.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 f6(e){if(FEt)return crypto.getRandomValues(e);throw new Error(mS)}var FEt,Hp,rA,oA,Hg,mS,d6=Cs(()=>{cc();FEt=typeof crypto!=Bu&&typeof crypto.getRandomValues==Po,Hp="Invalid password",rA="Invalid signature",oA=rA,Hg="zipjs-abort-check-password",mS="Crypto API not supported"});function USe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:$Et(t,n),strength:i-1,pendingInput:fr})}function zSe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Ud(c,t));let u=t.length-r;n=JEt(n,i+(u-u%pS));let f;for(f=0;f<=u-pS;f+=pS){let d=AR(Gp,zd(t,f,f+pS));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(yR(Gp,p),f+i)}return e.pendingInput=zd(t,f),n}async function qEt(e,t,n,i){let r=await VSe(e,t,n,zd(i,0,_R[t])),o=zd(i,_R[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(Hp)}async function YEt(e,t,n){let i=f6(new Uint8Array(_R[t])),r=await VSe(e,t,n,i);return Ud(i,r)}async function VSe(e,t,n,i){e.password=null;let r=await XEt(BEt,n,zEt,!1,VEt),o=await KEt(Object.assign({salt:i},Bte),r,8*(gR[t]*2+2)),s=new Uint8Array(o),a=AR(Gp,zd(s,0,gR[t])),c=AR(Gp,zd(s,gR[t],gR[t]*2)),u=zd(s,gR[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new GEt(new HEt(a),Array.from(jEt)),hmac:new WEt(c)}),u}async function XEt(e,t,n,i,r){if(LSe)try{return await bR.importKey(e,t,n,i,r)}catch{return LSe=!1,iA.importKey(t)}else return iA.importKey(t)}async function KEt(e,t,n){if(FSe)try{return await bR.deriveBits(e,t,n)}catch{return FSe=!1,iA.pbkdf2(t,e.salt,Bte.iterations,n)}else return iA.pbkdf2(t,e.salt,Bte.iterations,n)}function $Et(e,t){return t===ke?hS(e):t}function JEt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function zd(e,t,n){return e.subarray(t,n)}function yR(e,t){return e.fromBits(t)}function AR(e,t){return e.toBits(t)}var pS,BEt,BSe,kEt,UEt,zEt,Bte,VEt,_R,gR,Gg,jEt,p6,bR,kSe,Gp,HEt,GEt,WEt,LSe,FSe,h6,m6,jSe=Cs(()=>{cc();Nte();Jx();NSe();d6();pS=16,BEt="raw",BSe={name:"PBKDF2"},kEt={name:"HMAC"},UEt="SHA-1",zEt=Object.assign({hash:kEt},BSe),Bte=Object.assign({iterations:1e3,hash:{name:UEt}},BSe),VEt=["deriveBits"],_R=[8,12,16],gR=[16,24,32],Gg=10,jEt=[0,0,0,0],p6=typeof crypto!=Bu,bR=p6&&crypto.subtle,kSe=p6&&typeof bR!=Bu,Gp=pR.bytes,HEt=Lte.aes,GEt=Fte.ctrGladman,WEt=iA.hmacSha1,LSe=p6&&kSe&&typeof bR.importKey==Po,FSe=p6&&kSe&&typeof bR.deriveBits==Po,h6=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){USe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await qEt(c,f,u,zd(s,0,_R[f]+2)),s=zd(s,_R[f]+2),r?a.error(new Error(Hg)):d()):await p;let g=new Uint8Array(s.length-Gg-(s.length-Gg)%pS);a.enqueue(zSe(c,s,g,0,Gg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=zd(u,0,u.length-Gg),p=zd(u,u.length-Gg),g=fr;if(d.length){let A=AR(Gp,d);c.update(A);let b=a.update(A);g=yR(Gp,b)}let m=zd(yR(Gp,c.digest()),0,Gg),y=u.length<Gg?1:0;for(let A=0;A<Gg;A++)y|=m[A]^p[A];if(y&&o)throw new Error(oA);s.enqueue(g)}}})}},m6=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){USe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=fr;a?(d=await YEt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%pS);p.set(d,0),o.enqueue(zSe(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=fr;if(a.length){let d=o.update(AR(Gp,a));s.update(d),u=yR(Gp,d)}let f=yR(Gp,s.digest()).slice(0,Gg);r.enqueue(Ud(u,f))}}})}}});function qSe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),ZEt(e,t,n)}function HSe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=YSe(e)^t[i],y6(e,n[i]);return n}function GSe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=YSe(e)^t[i],y6(e,t[i]);return n}function ZEt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new om(i[0]),crcKey2:new om(i[2])}),n)for(let r=0;r<n.length;r++)y6(e,n[r]);else for(let r=0;r<t.length;r++)y6(e,t.charCodeAt(r))}function y6(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=WSe(Math.imul(WSe(n+XSe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function YSe(e){let t=e.keys[2]|2;return XSe(Math.imul(t,t^1)>>>8)}function XSe(e){return e&255}function WSe(e){return e&4294967295}var gS,g6,_6,KSe=Cs(()=>{hR();d6();gS=12,g6=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){qSe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=HSe(a,o.subarray(0,gS));if(a.password=a.rawPassword=null,(c[gS-1]^a.passwordVerification)!=0)throw new Error(Hp);o=o.subarray(gS)}r?s.error(new Error(Hg)):s.enqueue(HSe(a,o))}})}},_6=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){qSe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=f6(new Uint8Array(gS));u[gS-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(GSe(s,u),0),c=gS}else a=new Uint8Array(r.length),c=0;a.set(GSe(s,r),c),o.enqueue(a)}})}}});function sm(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 Wp(e,t){e=sm(e);let n=t?{type:t}:{};if(QEt())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 QEt(){return typeof Blob.prototype.stream!=Po||new Blob([]).stream()instanceof ReadableStream}function $Se(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 _S=Cs(()=>{cc()});function A6(e){return eCt.get(e)}function b6(e){return kte.get(e)}function tCt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Po&&typeof i!=Po)throw new Error(JSe);kte.set(e,{CompressionStream:n,DecompressionStream:i})}async function ZSe(e,t){!kte.has(e)&&t&&tCt(e,await import(t))}var JSe,eCt,kte,Qx=Cs(()=>{cc();JSe="Invalid codec module",eCt=new Map,kte=new Map});function oCt(e,t,n){let i=new om,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(twe);y.set(iCt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(Ute),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=am(e,f),e=AS(e,t),am(e,d);function p(){g(),s=setTimeout(()=>c(new Error(sA)),rCt)}function g(){clearTimeout(s)}}function Vte(e,t){if(!e)return!1;let n=QSe.get(e);n||(n=new Map,QSe.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 C6(e){return Vte(e,zte)}function jte(e){return Vte(e,TR)}function nwe(e,t,n){t=am(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function iwe(e,t,n){if(!e)throw new Error(nCt);return new e(t,n)}function rwe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?ewe:zte,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return AS(e,a)}function am(e,t){return sm(e).pipeThrough(t)}function AS(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 sCt(n,o),await aCt(i,o)}}}async function sCt(e,t){try{await e.abort(t)}catch{}}async function aCt(e,t){try{await e.cancel(t)}catch{}}function cCt(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(bS);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var sA,bS,xS,nCt,zte,ewe,TR,twe,Ute,iCt,rCt,x6,T6,E6,QSe,Hte=Cs(()=>{hR();OSe();jSe();KSe();d6();cc();Jx();_S();Qx();sA="Invalid uncompressed size",bS="Invalid compressed data",xS=rA,nCt="Compression method not supported",zte="deflate-raw",ewe="deflate64-raw",TR="gzip",twe=10,Ute=8,iCt=[31,139,8],rCt=5e3,x6=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&&b6(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new mR,T=am(T,A)),o)if(E)T=AS(T,iwe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new T6,T=AS(T,new r(TR)),T=am(T,x);else try{T=rwe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(TR)}catch{throw S}T=AS(T,I),T=am(T,new T6)}s&&(c?T=am(T,new _6(t)):(b=new m6(t),T=am(T,b))),nwe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},T6=class extends TransformStream{constructor(){let t,n=twe,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<=Ute){i=Ud(i,r);return}let a=s-Ute,c=Math.min(a,i.length);o.enqueue(Ud(i.subarray(0,c),r.subarray(0,a-c))),i=Ud(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}};E6=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=am(x,new g6(t)):(b=new h6(t),x=am(x,b))),u){let T=p&&b6(p);if(T)x=AS(x,iwe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=rwe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===ke)throw E;let v;try{v=new r(TR)}catch{throw E}x=oCt(x,v,y)}x=cCt(x)}a&&(A=new mR,x=am(x,A)),nwe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(xS)}})}},QSe=new Map});var lCt,owe,swe,awe,Gte,cwe,lwe,TS,S6,v6,ER,w6=Cs(()=>{cc();Hte();lCt=64*1024,owe="message",swe="start",awe="pull",Gte="data",cwe="ack",lwe="close",TS="deflate",S6="inflate",v6=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(TS)?o=x6:r.startsWith(S6)&&(o=E6),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(sA)},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)}})}},ER=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=lCt),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 fwe({initModule:e}){P6=e}function dwe(e){qte=e}async function hwe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||C6(t)||jte(t))return!0;if(n)try{return await P6(e),!0}catch{return!1}return!1}function Xte(e){e.createWorker?uwe=!0:I6=!1}async function Wte(e,...t){try{await e(...t)}catch{}}function Kte(e,t){return{run:()=>D6(e,t)}}async function D6({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(TS),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!C6(d))try{await P6(r)}catch{}}else try{await P6(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new v6(e,r),await t.pipeThrough(o).pipeThrough(new ER(uR(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 tT,I6,uwe,qte,P6,eT,Yte,CR=Cs(()=>{cc();jp();w6();tT="Worker startup timeout",P6=()=>{};eT=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 uwe&&(f=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new ER(uR(o))).pipeThrough(new Yte(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)}}}),I6===ke&&(I6=typeof Worker!=Bu),(a&&qte&&(I6&&u||f)?qte:Kte)(t,o)}},Yte=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await Wte(t,i)},async transform(s,a){o+=s.length,n&&await Wte(n,o,i),a.enqueue(s)},async flush(){r&&await Wte(r,o)}})}}});async function N6(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=gCt(p,i.baseURI)),await ZSe(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=nT.find(v=>!v.busy);if(E)return xwe(E),new eT(E,e,t,T);if(nT.length<y){let v={indexWorker:bwe};return bwe++,nT.push(v),new eT(v,e,t,T)}else return new Promise(v=>{ES.push({resolve:v,stream:e,workerOptions:t}),O6=i.workerStarvationTimeout,M6()})}function T(E){if(Twe(),ES.length){let[{resolve:v,stream:S,workerOptions:I}]=ES.splice(0,1);v(new eT(E,S,I,T)),M6()}else E.worker?(xwe(E),ACt(E,t)):nT=nT.filter(v=>v!=E)}}function gCt(e,t){try{return new URL(e,t).toString()}catch{return e}}function M6(){!CS&&ES.length&&Number.isFinite(O6)&&O6>=0&&(CS=setTimeout(_Ct,O6))}function Twe(){CS&&(clearTimeout(CS),CS=null)}function _Ct(){if(CS=null,ES.length){let[{resolve:e,stream:t,workerOptions:n}]=ES.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new eT({},t,i,yCt)),M6()}}function yCt(){Twe(),M6()}function ACt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{nT=nT.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function xwe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var nT,ES,CS,O6,bwe,L6=Cs(()=>{cc();w6();Qx();CR();nT=[],ES=[],bwe=0});function Cwe(e){if(bCt){let t="";for(let n=0;n<e.length;n++)t+=Ewe[e[n]];return t}else return new TextDecoder().decode(e)}var Ewe,bCt,vwe=Cs(()=>{Ewe="\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(""),bCt=Ewe.length==256});function vR(e,t){return wwe(e,t,!0)}function Swe(e,t){return wwe(e,t,!1)}function wwe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?Cwe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var tne=Cs(()=>{vwe()});function TCt(){Rwe=(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();nne=n==1}catch{nne=!1}})()}function U6(e){return!!(e&&e.getData)}async function vc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function ECt(e){return e=new Wg(e),await vc(e),(e.size===ke||!e.readUint8Array)&&(e=new ku(await Wp(e.readable)),await vc(e)),e}function Do(e,t,n){return e.readUint8Array(t,n)}function rne(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?SS.prototype.createReadable.call(e,t):e.readable}var Pwe,Dwe,xCt,kwi,Uwi,ine,Iwe,vS,SS,F6,SR,nne,Rwe,ku,wS,wR,IR,B6,k6,Wg,IS,z6=Cs(()=>{cc();jp();Jx();_S();tne();Pwe="Writer iterator completed too soon",Dwe="Writer not initialized",xCt="text/plain",kwi=256*1024,Uwi=16*1024*1024,ine="writable",Iwe=Symbol(),vS=class{constructor(){this.size=0}init(){this.initialized=!0}},SS=class extends vS{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=uR(jg())}={}){let r=this,o=0;return i=Mte(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-o),c=await Do(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},F6=class extends vS{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(Dwe);return t.writeUint8Array(u6(i))}});Object.defineProperty(t,ine,{get(){return n}})}writeUint8Array(){}},SR=class extends F6{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)}};ku=class extends SS{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),Rwe||TCt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?sm(i.stream()):nne?sm(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)}},wS=class extends vS{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,ine,{get(){return i.writable}}),n.contentType=t,n.blobPromise=Wp(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},wR=class extends ku{constructor(t){super(new Blob([t],{type:xCt}))}},IR=class extends wS{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():Swe(new Uint8Array(await i.arrayBuffer()),t)}},B6=class extends SS{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(ECt));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 Do(c,a,n);else{let f=u-a,d=await Do(c,a,f),p=await i.readUint8Array(t+f,n-f);o=Ud(d,p)}}else o=fr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},k6=class extends vS{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===Iwe){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(Pwe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await vc(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,ine,{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(Iwe)}finally{t.releaseLock()}}},Wg=class{constructor(t){return Array.isArray(t)&&(t=new B6(t)),(t instanceof ReadableStream||typeof t.getReader==Po)&&(t={readable:sm(t)}),t}},IS=class{constructor(t){return t.writable===ke&&typeof t.next==Po&&(t=new k6(t)),(t instanceof WritableStream||typeof t.getWriter==Po)&&(t={writable:$Se(t)}),t.size===ke&&(t.size=0),t}}});var one,sne,PR,ane,DR,cne,lne,une,PS,DS,RR,fne,OR,dne,hne,mne,V6,j6,pne,gne,_ne,H6,yne,Ane,bne,xne,iT,Tne,CCt,Ene,G6,vCt,W6,SCt,wCt,ICt,PCt,Cne,vne,Sne,wne,DCt,RCt,OCt,MCt,NCt,LCt,FCt,BCt,kCt,UCt,zCt,VCt,jCt,HCt,GCt,WCt,aA,Ine=Cs(()=>{one="filename",sne="rawFilename",PR="comment",ane="rawComment",DR="uncompressedSize",cne="compressedSize",lne="offset",une="diskNumberStart",PS="lastModDate",DS="rawLastModDate",RR="lastAccessDate",fne="rawLastAccessDate",OR="creationDate",dne="rawCreationDate",hne="internalFileAttributes",mne="externalFileAttributes",V6="internalFileAttribute",j6="externalFileAttribute",pne="msdosAttributesRaw",gne="msdosAttributes",_ne="msDosCompatible",H6="zip64",yne="encrypted",Ane="version",bne="versionMadeBy",xne="zipCrypto",iT="directory",Tne="executable",CCt="symlink",Ene="compressionMethod",G6="signature",vCt="crc32",W6="extraField",SCt="extraFieldInfoZip",wCt="extraFieldUnix",ICt="extraFieldUnixType1",PCt="extraFieldPkwareUnix",Cne="unixMode",vne="setuid",Sne="setgid",wne="sticky",DCt="bitFlag",RCt="rawBitFlag",OCt="filenameLength",MCt="extraFieldLength",NCt="unixExternalUpper",LCt="filenameUTF8",FCt="commentUTF8",BCt="rawExtraField",kCt="extraFieldZip64",UCt="extraFieldUnicodePath",zCt="extraFieldUnicodeComment",VCt="extraFieldAES",jCt="extraFieldNTFS",HCt="extraFieldExtendedTimestamp",GCt="extraFieldUSDZ",WCt=[one,sne,DR,cne,PS,DS,PR,ane,RR,fne,OR,dne,lne,une,hne,mne,V6,j6,pne,gne,_ne,H6,yne,Ane,bne,xne,iT,Tne,CCt,Ene,G6,vCt,W6,wCt,SCt,ICt,PCt,"uid","gid",Cne,NCt,vne,Sne,wne,DCt,RCt,OCt,MCt,LCt,FCt,BCt,kCt,UCt,zCt,VCt,jCt,HCt,GCt],aA=class{constructor(t){WCt.forEach(n=>this[n]=t[n])}}});var oIe={};zke(oIe,{ERR_AMBIGUOUS_ARCHIVE:()=>nie,ERR_BAD_FORMAT:()=>RS,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>$ne,ERR_ENCRYPTED:()=>Qne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>iie,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>tie,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>Kne,ERR_EOCDR_NOT_FOUND:()=>Xne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>Zne,ERR_INVALID_AUTHENTICATION_CODE:()=>oA,ERR_INVALID_COMPRESSED_DATA:()=>bS,ERR_INVALID_CRC32:()=>xS,ERR_INVALID_FILENAME_VALIDATION:()=>sie,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>aie,ERR_INVALID_PASSWORD:()=>Hp,ERR_INVALID_SIGNATURE:()=>rA,ERR_INVALID_STRICTNESS:()=>oie,ERR_INVALID_UNCOMPRESSED_SIZE:()=>sA,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Jne,ERR_OVERLAPPING_ENTRY:()=>eie,ERR_SPLIT_ZIP_FILE:()=>$6,ERR_UNSAFE_FILENAME:()=>rie,ERR_UNSUPPORTED_COMPRESSION:()=>K6,ERR_UNSUPPORTED_ENCRYPTION:()=>X6,ERR_UNSUPPORTED_UINT64:()=>cie,ERR_WORKER_STARTUP_TIMEOUT:()=>tT,WARNING_APPENDED_DATA:()=>Z6,WARNING_COMPRESSED_PATCHED_DATA:()=>fie,WARNING_DUPLICATE_FILENAME:()=>pie,WARNING_MALFORMED_EXTRA_FIELD:()=>fH,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>gie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>_ie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>yie,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>OS,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>hie,WARNING_PREPENDED_DATA:()=>Q6,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>mie,WARNING_UNKNOWN_VERSION:()=>uie,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>die,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>lie,WARNING_WRAPPED_ENTRIES_COUNT:()=>J6,ZipReader:()=>aT,ZipReaderStream:()=>tH,isZipFile:()=>$we});async function $we(e,t={}){if(e=new Wg(e),await vc(e),(e.size===ke||!e.readUint8Array)&&(e=new ku(await Wp(e.readable)),await vc(e)),e.size<22)return!1;let n=bie(t,{}),i=n!=Vg,r=tIe(t[Pte],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await nIe(e,i,r);if(!o||n==nA&&s>1)return!1;let a=dr(li(o),20),c=o.offset+22+a;return e.size-c<=r}function Pne(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 zwe(e,t,n){let i=0;for(;n+46<=t.length&&Pi(e,n)==33639248;)n+=46+dr(e,n+28)+dr(e,n+30)+dr(e,n+32),i++;return i%65536?0:i}function Dne(e){if(e.length>=6){let t=li(e);if(Pi(t,0)==84233040){let n=dr(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function ovt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function svt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=li(e),i=dr(n,26);Object.assign(t,{compressionMethod:dr(n,0),compressedSize:If(n,2),uncompressedSize:If(n,10),encryptionAlgorithm:dr(n,18),bitLength:dr(n,20),flags:dr(n,22),hashAlgorithm:dr(n,24),hashData:e.subarray(28,28+i)})}return t}function Jwe(e,t,n){let i=e.rawBitFlag=dr(t,n+2),r=(i&1)==1,o=Pi(t,n+6);Object.assign(e,{encrypted:r,version:dr(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:xvt(o),filenameLength:dr(t,n+22),extraFieldLength:dr(t,n+24)})}function Zwe(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=dr(a,c),I=dr(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=dr(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&&(avt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(Vwe(p,one,sne,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(Vwe(g,PR,ane,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(cvt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(jwe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(jwe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(lvt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=Hwe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(Hwe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(uvt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function avt(e,t){t.zip64=!0;let n=li(e.data),i=tvt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+kwe[s].bytes,0);if(e.data.length<r)throw new Error(Zne);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=kwe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function Vwe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=li(e.data),s=new om;s.append(r[n]);let a=li(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Pi(o,1),u=lA(o,0);Object.assign(e,{version:u,[t]:vR(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Pi(a,0)}),e.valid&&(i[t]=e[t],i[t+evt]=!0)}function cvt(e,t,n){let i=li(e.data),r=lA(i,4);Object.assign(e,{vendorVersion:lA(i,0),vendorId:lA(i,2),strength:r,originalCompressionMethod:n,compressionMethod:dr(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=Kwe&&(t.crc32=ke)}function lvt(e,t){let n=li(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=dr(n,i),s=dr(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=Rne(s),f=Rne(a),d=Rne(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function jwe(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=dr(n,8),o.gid=dr(n,10)),Object.assign(e,o),Object.assign(t,o)}function Hwe(e,t,n){try{let i=li(e.data),r,o;if(n){let s=0,a=lA(i,s++),c=lA(i,s++);r=Gwe(e.data.subarray(s,s+c)),s+=c;let u=lA(i,s++);o=Gwe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=dr(i,0),o=dr(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 Gwe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function uvt(e,t,n){if(!e.data.length)return;let i=li(e.data),r=lA(i,0),o=[],s=[];n?((r&1)==1&&(o.push(PS),s.push(DS)),(r&2)==2&&(o.push(RR),s.push(fne)),(r&4)==4&&(o.push(OR),s.push(dne))):e.data.length>=5&&(o.push(PS),s.push(DS));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 fvt({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 Do(e,a+o,d+4),m=li(g),y=g.length==d+4&&Pi(m,0)==134695760;if(y){let A=Wwe(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=Wwe(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(eie);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function Wwe(e,t,n){let i=Pi(e,t),r,o;return n?(r=If(e,t+4),o=If(e,t+12)):(r=Pi(e,t+4),o=Pi(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function MS(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function dvt(e){return await Qwe(e)==134695760}async function hvt(e){let t=await Qwe(e);return t==134695760||t==808471376}async function Qwe(e){let t=await Do(e,0,4);return Pi(li(t))}function eIe(e){return e===nA||e===a6||e===Vg}function mvt(e,t,n){return Math.min(e,n?t*rvt:t)}function bie(e,t){return qwe(e,qwe(t,a6))}function qwe(e,t){let n=e[mSe];if(n!==ke){if(!eIe(n))throw new Error(oie);return n}let i=e[Kve];return i===ke?t:i?nA:t==Vg?Vg:a6}function pvt(e,t){return e===ke?t!=Vg:!!e}function gvt(e,t){return e===ke?t==nA:!!e}function _vt(e,t){if(e===ke)return t;if(!eIe(e))throw new Error(sie);return e}function yvt(e,t){if(t==Vg)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||QCt.test(e)?!0:t==nA&&(n.includes(".")||n.includes(""))}function tIe(e,t){if(e!==ke){let n=$x(e);if(typeof n!=Uve||Number.isNaN(n)||n<0)throw new Error(aie);return n}return t==nA?0:t==Vg?1/0:65535}async function nIe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:ivt},s,a,c=0;for await(let[u,f,d,p,g]of iIe(e,r)){let m=dr(u,p+20);if(g+22+m==i){let y=await rIe(e,u,f,p,g,i,o);if(y==eH){if(s||(s=Mne(d,p,g)),c++,!t||c>1)break}else y==Aie&&!a&&(a=Mne(d,p,g))}}return s||(s=a),s||(s=await Avt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function Avt(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 iIe(e,r)){let p=Mne(u,f,d);o||(o=p);let g=await rIe(e,a,c,f,d,i,n);if(g==eH)return p;g==Aie&&!s&&(s=p)}return s||o}async function*iIe(e,t){let n=e.size-t,i=await Do(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 Mne(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function rIe(e,t,n,i,r,o,s){let a=dr(t,i+10),c=Pi(t,i+12),u=Pi(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await Ywe(e,t,n,r-20,o,s)==117853008?eH:Uwe;if(!a&&!c)return Aie;let f=dr(t,i+6);for(let d of[r-c,MS(e,f)+u])if(await Ywe(e,t,n,d,o,s)==33639248)return eH;return Uwe}async function Ywe(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 Do(e,i,4);return Pi(li(s),0)}return ke}function bvt(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]))&&Xp(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&Bwe)!=(e.rawBitFlag&Bwe)&&Xp(s,r,gie),t.compressionMethod!=e.compressionMethod&&Xp(s,r,_ie),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&Xp(s,r,yie)}function Xp(e,t,n){e?q6(n):Vd(t,n)}function Vd(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function q6(e){let t=new Error(nie);throw t.reason=e,t}function As(e,t,n){return t[n]===ke?e.options[n]:t[n]}function Xwe(e,t,n){return uS(As(e,t,n))}function xvt(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<cS?cS:i}function Rne(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function lA(e,t){return e.getUint8(t)}function dr(e,t){return e.getUint16(t,!0)}function Pi(e,t){return e.getUint32(t,!0)}function If(e,t){let n=e.getBigUint64(t,!0);if(n>nvt)throw new Error(cie);return Number(n)}var RS,Xne,Kne,$ne,Jne,Zne,Qne,X6,K6,$6,eie,tie,nie,iie,rie,oie,sie,aie,cie,lie,uie,fie,fH,die,J6,Z6,Q6,hie,mie,pie,OS,gie,_ie,yie,ZCt,QCt,Lwe,evt,Fwe,Bwe,Kwe,tvt,kwe,nvt,ivt,rvt,Uwe,Aie,eH,aT,tH,One,xie=Cs(()=>{cc();jp();Qx();L6();z6();tne();Jx();_S();hR();Ine();lR();RS="File format is not recognized",Xne="End of central directory not found",Kne="End of Zip64 central directory locator not found",$ne="Central directory header not found",Jne="Local file header not found",Zne="Zip64 extra field not found",Qne="File contains encrypted entry",X6="Encryption method not supported",K6="Compression method not supported",$6="Split zip file",eie="Overlapping entry found",tie="Entry data out of bounds",nie="Ambiguous archive",iie="Encrypted central directory is not supported",rie="Unsafe filename",oie="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",sie="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",aie="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",cie="64-bit value exceeds Number.MAX_SAFE_INTEGER",lie="unsorted central directory",uie="unknown version needed to extract",fie="compressed patched data",fH="malformed extra field",die="unknown zip64 extensible data",J6="wrapped entries count",Z6="appended data",Q6="prepended data",hie="prepended central directory",mie="trailing central directory data",pie="duplicate filename",OS="mismatched zip64 end of central directory record",gie="mismatched local file header (general purpose bit flag)",_ie="mismatched local file header (compression method)",yie="mismatched local file header (crc32 or sizes)",ZCt=63,QCt=/^[a-zA-Z]:/,Lwe="utf-8",evt="UTF8",Fwe="cp437",Bwe=2057,Kwe=1,tvt=[[DR,4294967295],[cne,4294967295],[lne,4294967295],[une,65535]],kwe={65535:{getValue:Pi,bytes:4},4294967295:{getValue:If,bytes:8}},nvt=BigInt(Number.MAX_SAFE_INTEGER),ivt=64,rvt=1032,Uwe=0,Aie=1,eH=2,aT=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 vc(i),(i.size===ke||!i.readUint8Array)&&(i=new ku(await Wp(i.readable)),await vc(i)),i.size<22)throw new Error(RS);let r=n.warnings=[],o=bie(t,n.options),s=o==nA,a=o!=Vg,c=tIe(As(n,t,Pte),o),u=_vt(As(n,t,pSe),o),f=As(n,t,gSe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await nIe(i,a,c);if(!d)throw await dvt(i)?new Error($6):new Error(Xne);a&&p>1&&q6("multiple end of central directory records");let g=li(d),m=Pi(g,12),y=Pi(g,16),A=d.offset,b=dr(g,20),x=A+22+b,T=i.size-x;T>c&&q6(Z6),T>0&&Vd(r,Z6);let E=dr(g,4),v=i.lastDiskNumber||0,S=dr(g,6),I=dr(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+=MS(i,S)),N){let He=d.offset>=20?await Do(i,d.offset-20,20):fr,Ye=li(He);if(He.length==20&&Pi(Ye,0)==117853008){y=MS(i,Pi(Ye,4))+If(Ye,8);let Ke=await Do(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 Do(i,y,56),Pe=li(Ke)}if(Ke.length<56||Pi(Pe,0)!=101075792)throw new Error(Kne);if(_=!0,C=If(Pe,4)>44,C){let st=Math.min(If(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Do(i,y+56,st);D=svt(vt)}}E==65535?E=Pi(Pe,16):E!=Pi(Pe,16)&&Xp(s,r,OS),S==65535?S=Pi(Pe,20):S!=Pi(Pe,20)&&Xp(s,r,OS),I==65535?I=If(Pe,32):I!=If(Pe,32)&&Xp(s,r,OS),m==4294967295?m=If(Pe,40):m!=If(Pe,40)&&Xp(s,r,OS),y=MS(i,S)+If(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($6);if(y<0)throw new Error(RS);let B=0,j=await Do(i,y,m),k=li(j);if(m){if(j.length<4)throw new Error(RS);let He=V-m;if(y!=He&&S==E){let Ye=Pi(k,B)==33639248||!!(D&&D.compressedSize)||Pne(k),Ke=!Ye;if(!Ke&&He>=0&&He+4<=i.size){let Pe=await Do(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 Do(i,y,m),k=li(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Do(i,y,m),k=li(j)),y<0||y>=i.size)throw new Error(RS);n.directoryOffset=y,n.directoryLength=F;let q=Xwe(n,t,_Se),Q,W;if(q&&I&&j.length>=4&&Pi(k,0)!=33639248&&(C||Pne(k))){let He=ovt(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)&&Vd(r,die),L=y;let J=As(n,t,Vve),Z=As(n,t,jve),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=zwe(k,j,B),I&&Vd(r,J6));for(let He=0;He<I;He++){let Ye=new One(i,n.options);if(B+46>j.length||Pi(k,B)!=33639248)throw He==0&&!Q&&(C||Pne(k))?new Error(iie):new Error($ne);Jwe(Ye,k,B+6);let Ke=!!Ye.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Ye.filenameLength,st=qe+Ye.extraFieldLength,vt=dr(k,B+4),jt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=dr(k,B+32),Yt=st+ft,rt=j.subarray(st,Yt),ht=Ke,Li=Ke,Yn=Pi(k,B+38),yi=Yn&255,zi={readOnly:!!(yi&1),hidden:!!(yi&2),system:!!(yi&4),directory:!!(yi&16),archive:!!(yi&32)},Si=Pi(k,B+42),ui=Xwe(n,t,Hve)||vR,Ai=ht?Lwe:J||Fwe,zn=Li?Lwe:Z||Fwe,tn=ui(mt,Ai,o6);if(tn===ke&&(tn=vR(mt,Ai)),f){let Fi=f(tn);Fi!==ke&&(tn=Fi)}if(yvt(tn,u)){let Fi=new Error(rie);throw Fi.filename=tn,Fi}let Hn=ui(rt,zn,s6);Hn===ke&&(Hn=vR(rt,zn)),Object.assign(Ye,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:jt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:Si,diskNumberStart:dr(k,B+34),internalFileAttributes:dr(k,B+36),externalFileAttributes:Yn,msdosAttributesRaw:yi,msdosAttributes:zi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Li,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:tn,comment:Hn}),Zwe(Ye,Ye,k,B+6)&&Vd(r,fH,tn),Ye.offset+=R;let Ki=MS(i,Ye.diskNumberStart)+Ye.offset;L=Math.min(Ki,L),Ki<fe&&Vd(r,lie,tn),fe=Ki,(Ye.version&255)>ZCt&&Vd(r,uie,tn),(Ye.rawBitFlag&32)==32&&Vd(r,fie,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),pi=((Ye.unixMode===ke?wr:Ye.unixMode)&61440)==40960,ao=!pi&&(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:pi,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 aA(Ye);if(Fn.getData=(Fi,Ir)=>Ye.getData(Fi,Fn,n.readRanges,Ir),Fn.arrayBuffer=async Fi=>{let Ir=new TransformStream,Mc=Wp(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=zwe(k,j,B);Fi&&(I+=Fi,Vd(r,J6))}let{onprogress:Vi}=t;if(Vi)try{await Vi(He+1,I,new aA(Ye))}catch{}yield Fn}let ge=B,we=Dne(j.subarray(B))||(Q?Dne(W):ke);if(!we&&!Q){let He=y+B,Ye=Math.min(V-He,65541);Ye>=6&&(we=Dne(await Do(i,He,Ye)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&Xp(s,r,mie),Ae&&Xp(s,r,pie);let ve=As(n,t,Gve),Re=As(n,t,Wve),Qe=(s||ve)&&I&&L==4&&await hvt(i)?4:0;return s&&(R||I&&L>Qe)&&q6(Q6),(R||I&&L>4)&&Vd(r,Q6),O&&Vd(r,hie),ve&&(n.prependedData=L>Qe?await Do(i,Qe,L-Qe):fr),n.comment=b?await Do(i,A+22,b):fr,Re&&(n.appendedData=x<i.size?await Do(i,x,i.size-x):fr),!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()}},tH=class{constructor(t={}){let{readable:n,writable:i}=new TransformStream,r=new aT(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}};One=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=jg(),{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=MS(a,f)+u,R=await Do(a,I,30),O=li(R),L=As(o,r,Jj),_=As(o,r,Zj),C=As(o,r,Qj);if(l6(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(K6);if(R.length<30||Pi(O,0)!=67324752)throw new Error(Jne);Jwe(v,O,4);let{extraFieldLength:w,filenameLength:D}=v,N=v.dataOffset=I+30+D+w,F=As(o,r,$ve),V=bie(r,o.options),B=pvt(F,V),j=gvt(F,V),k=fr;if(j&&(D||w)){let ft=await Do(a,I+30,D+w);k=ft.subarray(0,D),v.rawExtraField=ft.subarray(D)}else v.rawExtraField=w?await Do(a,I+30+D,w):fr;j&&(v.rawFilename=k),Zwe(o,v,O,4,!0)&&Vd(S,fH),bvt(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(X6);let ae=C?ke:A6(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(K6);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(X6);if(!L&&!_)throw new Error(Qne)}if(N+T>a.size)throw new Error(tie);let Ae=T,fe=sm(a.createReadable({offset:N,size:Ae})),xe=c6(As(o,r,e6)),ge=As(o,r,qve),we=As(o,r,Xve),ve=As(o,r,Yve);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,n6);Pe&&(qe=!1);let st=As(o,r,Zve),vt=(st===ke?As(o,r,Jve):st)&&!C&&(!J||Z||d&&d.vendorVersion==Kwe),jt={options:{codecType:S6,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:As(o,r,Qve),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:Ke,crc32:A,compressed:Ye,encrypted:J,useWebWorkers:As(o,r,t6),useCompressionStream:qe,transferStreams:As(o,r,i6),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 fvt({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 IS(t),await vc(t,mvt(Ke,T,Ye)),{writable:lt}=t;let{outputSize:ft}=await N6({readable:fe,writable:lt},jt);if(t.size+=ft,ft!=Ke)throw new Error(sA)}}catch(ft){if(ft.outputSize!==ke&&(t.size+=ft.outputSize),!ge||ft.message!=Hg)throw mt=ft,ft}finally{if(!(!U6(t)&&As(o,r,r6))&<&&!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 _ke=uh((IGr,gke)=>{gke.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw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AAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var Ake=uh((PGr,yke)=>{var{webm:KHt,mp4:$Ht}=_ke(),kae=()=>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,Uae=()=>"wakeLock"in navigator,zae=class{constructor(){if(this.enabled=!1,Uae()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else kae()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",KHt),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 Uae()?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}):kae()?(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 MO=="object"&&MO&&MO.exports&&(MO.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 GLe=uh((Asr,a9)=>{/* 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 a9<"u"&&a9.exports?a9.exports=i:this.Lerc=i})()});var yke=uh((PGr,_ke)=>{_ke.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUikt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AAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var bke=uh((DGr,Ake)=>{var{webm:$Ht,mp4:JHt}=yke(),kae=()=>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,Uae=()=>"wakeLock"in navigator,zae=class{constructor(){if(this.enabled=!1,Uae()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else kae()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",$Ht),this._addSourceToVideo(this.noSleepVideo,"mp4",JHt),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 Uae()?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}):kae()?(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(){Uae()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):kae()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};yke.exports=zae});var Gae={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(Gae);var P0=Gae;function Wae(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=Wae(r,t)),n[i]=r}return n}var Ze=Wae;function jke(e){return e!=null}var l=jke;function qae(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]=qae(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=qae;var lq={};lq.EMPTY_OBJECT=Object.freeze({});lq.EMPTY_ARRAY=Object.freeze([]);var H=lq;var Yae={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(Yae);var te=Yae;var Xae={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(Xae);var Nc=Xae;var Kae={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(Kae);var Jr=Kae;var $ae={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Nc.ADD,equationAlpha:Nc.ADD,functionSourceRgb:Jr.SOURCE_ALPHA,functionSourceAlpha:Jr.ONE,functionDestinationRgb:Jr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Nc.ADD,equationAlpha:Nc.ADD,functionSourceRgb:Jr.ONE,functionSourceAlpha:Jr.ONE,functionDestinationRgb:Jr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Nc.ADD,equationAlpha:Nc.ADD,functionSourceRgb:Jr.SOURCE_ALPHA,functionSourceAlpha:Jr.ONE,functionDestinationRgb:Jr.ONE,functionDestinationAlpha:Jr.ONE})};Object.freeze($ae);var nn=$ae;var Jae={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(Jae);var ji=Jae;function gE(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(gE.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}}});gE.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(` -`)};gE.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};gE.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ze(this.renderState,!1);return e?(t.depthMask=!1,t.blending=nn.ALPHA_BLEND):t.depthMask=!0,t};gE.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=nn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:ji.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var Pr=gE;var Zae={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Zae);var Fm=Zae;function mb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(mb.prototype=Object.create(Error.prototype),mb.prototype.constructor=mb);mb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};mb.throwInstantiationError=function(){throw new mb("This function defines an interface and should not be called directly.")};var pe=mb;var ia={};ia.typeOf={};function Hke(e){return`${e} is required, actual value was undefined`}function _E(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(Hke(e))};ia.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(_E(typeof t,"function",e))};ia.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(_E(typeof t,"string",e))};ia.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(_E(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(_E(typeof t,"object",e))};ia.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(_E(typeof t,"boolean",e))};ia.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(_E(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 uq=js(rN(),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 oN=[1];_t.factorial=function(e){let t=oN.length;if(e>=t){let n=oN[t-1];for(let i=t;i<=e;i++){let r=n*i;oN.push(r),n=r}}return oN[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 ece=new uq.default;_t.setRandomNumberSeed=function(e){ece=new uq.default(e)};_t.nextRandomNumber=function(){return ece.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 os=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,sN),e.magnitude(sN)}static distanceSquared(t,n){return e.subtract(t,n,sN),e.magnitudeSquared(sN)}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,Gke);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})`}};os.fromCartesian3=os.clone;os.fromCartesian4=os.clone;os.packedLength=2;os.fromArray=os.unpack;var sN=new os,tce=new os,nce=new os,ice=new os,Gke=new os;os.ZERO=Object.freeze(new os(0,0));os.ONE=Object.freeze(new os(1,1));os.UNIT_X=Object.freeze(new os(1,0));os.UNIT_Y=Object.freeze(new os(0,1));var U=os;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,aN),e.magnitude(aN)}static distanceSquared(t,n){return e.subtract(t,n,aN),e.magnitudeSquared(aN)}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,rce),r=e.multiplyByScalar(t,1-i,r),e.add(rce,r,r)}static angleBetween(t,n){e.normalize(t,cN),e.normalize(n,fq);let i=e.dot(cN,fq),r=e.magnitude(e.cross(cN,fq,cN));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Wke);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,yE);let c=Math.sqrt(e.dot(Yf,yE));return yE=e.divideByScalar(yE,c,yE),Yf=e.multiplyByScalar(Yf,i,Yf),l(o)||(o=new e),e.add(yE,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 aN=new lo,rce=new lo,cN=new lo,fq=new lo,Wke=new lo,Yf=new lo,yE=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 qke=new h,Yke=new h;function Xke(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,qke);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=Yke;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 AE=Xke;var bl=class bl{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 bl(t,n,i)}static fromDegrees(t,n,i,r){return t=P.toRadians(t),n=P.toRadians(n),bl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:bl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:bl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:bl._ellipsoidCenterToleranceSquared,a=AE(t,r,o,s,$ke);if(!l(a))return;let c=h.multiplyComponents(a,o,Kke);c=h.normalize(c,c);let u=h.subtract(t,a,Jke),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 bl(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 bl(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 bl.clone(this,t)}equals(t){return bl.equals(this,t)}equalsEpsilon(t,n){return bl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(bl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(bl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(bl,"_ellipsoidCenterToleranceSquared",P.EPSILON1);var LI=bl;LI.ZERO=Object.freeze(new LI(0,0,0));var Kke=new h,$ke=new h,Jke=new h,he=LI;/*! @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 oce(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 Zke(e){if(Array.isArray(e))return e}function Qke(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 e3e(){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 t3e(e,t){return Zke(e)||Qke(e,t)||n3e(e,t)||e3e()}function n3e(e,t){if(e){if(typeof e=="string")return oce(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)?oce(e,t):void 0}}var bce=Object.entries,sce=Object.setPrototypeOf,i3e=Object.isFrozen,r3e=Object.getPrototypeOf,o3e=Object.getOwnPropertyDescriptor,va=Object.freeze,Ga=Object.seal,bE=Object.create,xce=typeof Reflect<"u"&&Reflect,yq=xce.apply,Aq=xce.construct;va||(va=function(t){return t});Ga||(Ga=function(t){return t});yq||(yq=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)});Aq||(Aq=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 gb=ra(Array.prototype.forEach),s3e=ra(Array.prototype.lastIndexOf),ace=ra(Array.prototype.pop),FI=ra(Array.prototype.push),a3e=ra(Array.prototype.splice),xE=Array.isArray,UI=ra(String.prototype.toLowerCase),dq=ra(String.prototype.toString),cce=ra(String.prototype.match),BI=ra(String.prototype.replace),lce=ra(String.prototype.indexOf),c3e=ra(String.prototype.trim),l3e=ra(Number.prototype.toString),u3e=ra(Boolean.prototype.toString),uce=typeof BigInt>"u"?null:ra(BigInt.prototype.toString),fce=typeof Symbol>"u"?null:ra(Symbol.prototype.toString),ru=ra(Object.prototype.hasOwnProperty),kI=ra(Object.prototype.toString),Lc=ra(RegExp.prototype.test),pb=f3e(TypeError);function ra(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 yq(e,t,i)}}function f3e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Aq(e,n)}}function Tr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:UI;if(sce&&sce(e,null),!xE(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(i3e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function d3e(e){for(let t=0;t<e.length;t++)ru(e,t)||(e[t]=null);return e}function tf(e){let t=bE(null);for(let i of bce(e)){var n=t3e(i,2);let r=n[0],o=n[1];ru(e,r)&&(xE(o)?t[r]=d3e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=tf(o):t[r]=o)}return t}function h3e(e){switch(typeof e){case"string":return e;case"number":return l3e(e);case"boolean":return u3e(e);case"bigint":return uce?uce(e):"0";case"symbol":return fce?fce(e):"Symbol()";case"undefined":return kI(e);case"function":case"object":{if(e===null)return kI(e);let t=e,n=fh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:kI(i)}return kI(e)}default:return kI(e)}}function fh(e,t){for(;e!==null;){let i=o3e(e,t);if(i){if(i.get)return ra(i.get);if(typeof i.value=="function")return ra(i.value)}e=r3e(e)}function n(){return null}return n}function m3e(e){try{return Lc(e,""),!0}catch{return!1}}var dce=va(["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"]),hq=va(["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"]),mq=va(["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"]),p3e=va(["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"]),pq=va(["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"]),g3e=va(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hce=va(["#text"]),mce=va(["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"]),gq=va(["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"]),pce=va(["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"]),lN=va(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_3e=Ga(/{{[\w\W]*|^[\w\W]*}}/g),y3e=Ga(/<%[\w\W]*|^[\w\W]*%>/g),A3e=Ga(/\${[\w\W]*/g),b3e=Ga(/^data-[\-\w.\u00B7-\uFFFF]+$/),x3e=Ga(/^aria-[\-\w]+$/),gce=Ga(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),T3e=Ga(/^(?:\w+script|data):/i),E3e=Ga(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),C3e=Ga(/^html$/i),v3e=Ga(/^[a-z][.\w]*(-[.\w]+)+$/i),_ce=Ga(/<[/\w!]/g),yce=Ga(/<[/\w]/g),S3e=Ga(/<\/no(script|embed|frames)/i),w3e=Ga(/\/>/i),ef={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Tce=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],I3e=va(Tr({},Tce)),P3e=(function(){let e={};return gb(Tce,t=>{e[t]=Ga(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),va(e)})(),D3e=function(){return typeof window>"u"?null:window},R3e=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}},Ace=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},T_=function(t,n,i,r){return ru(t,n)&&xE(t[n])?Tr(r.base?tf(r.base):{},t[n],r.transform):i},_q=function(t,n,i){let r=ru(t,n)?t[n]:void 0;return r&&typeof r=="object"?tf(r):i()};function Ece(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:D3e(),t=Et=>Ece(Et);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==ef.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=fh(p,"cloneNode"),m=fh(p,"remove"),y=fh(p,"nextSibling"),A=fh(p,"childNodes"),b=fh(p,"parentNode"),x=fh(p,"shadowRoot"),T=fh(p,"attributes"),E=s&&s.prototype?fh(s.prototype,"nodeType"):null,v=s&&s.prototype?fh(s.prototype,"nodeName"):null,S=s&&s.prototype?fh(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||(_=R3e(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=Ace();t.isSupported=typeof bce=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=_3e,Z=y3e,ae=A3e,Ae=b3e,fe=x3e,xe=T3e,ge=E3e,we=v3e,ve=gce,Re=null,Qe=Tr({},[...dce,...hq,...mq,...pq,...hce]),He=null,Ye=Tr({},[...mce,...gq,...pce,...lN]),Ke=Object.seal(bE(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(bE(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,yi=!1,zi=!1,Si=!1,ui=!1,Ai=!0,zn=!1,tn="user-content-",Hn=!0,Ki=!1,wr={},so=null,Ts=Tr({},["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=Tr({},["audio","video","img","source","image","track"]),pi=null,ao=Tr({},["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=Tr({},[nr,jo,Fn],dq),qf=va(["mi","mo","mn","ms","mtext"]),Rm=Tr({},qf),ch=va(["annotation-xml"]),na=Tr({},ch),Om=Tr({},["title","style","font","a","script"]),Es=null,Ha=["application/xhtml+xml","text/html"],ub="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=tf(ye),Es=Ha.indexOf(ye.PARSER_MEDIA_TYPE)===-1?ub:ye.PARSER_MEDIA_TYPE,ii=Es==="application/xhtml+xml"?dq:UI,Re=T_(ye,"ALLOWED_TAGS",Qe,{transform:ii}),He=T_(ye,"ALLOWED_ATTR",Ye,{transform:ii}),Ir=T_(ye,"ALLOWED_NAMESPACES",Mc,{transform:dq}),pi=T_(ye,"ADD_URI_SAFE_ATTR",ao,{transform:ii,base:ao}),zs=T_(ye,"ADD_DATA_URI_TAGS",$r,{transform:ii,base:$r}),so=T_(ye,"FORBID_CONTENTS",Ts,{transform:ii}),Pe=T_(ye,"FORBID_TAGS",tf({}),{transform:ii}),qe=T_(ye,"FORBID_ATTR",tf({}),{transform:ii}),wr=ru(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?tf(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,yi=ye.FORCE_BODY||!1,Ai=ye.SANITIZE_DOM!==!1,zn=ye.SANITIZE_NAMED_PROPS||!1,Hn=ye.KEEP_CONTENT!==!1,Ki=ye.IN_PLACE||!1,ve=m3e(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:gce,Vi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Fn,Rm=_q(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>Tr({},qf)),na=_q(ye,"HTML_INTEGRATION_POINTS",()=>Tr({},ch));let Fe=_q(ye,"CUSTOM_ELEMENT_HANDLING",()=>bE(null));if(Ke=bE(null),ru(Fe,"tagNameCheck")&&w0(Fe.tagNameCheck)&&(Ke.tagNameCheck=Fe.tagNameCheck),ru(Fe,"attributeNameCheck")&&w0(Fe.attributeNameCheck)&&(Ke.attributeNameCheck=Fe.attributeNameCheck),ru(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),Ga(Ke),ft&&(jt=!1),Si&&(zi=!0),wr&&(Re=Tr({},hce),He=bE(null),wr.html===!0&&(Tr(Re,dce),Tr(He,mce)),wr.svg===!0&&(Tr(Re,hq),Tr(He,gq),Tr(He,lN)),wr.svgFilters===!0&&(Tr(Re,mq),Tr(He,gq),Tr(He,lN)),wr.mathMl===!0&&(Tr(Re,pq),Tr(He,pce),Tr(He,lN))),st.tagCheck=null,st.attributeCheck=null,ru(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:xE(ye.ADD_TAGS)&&(Re===Qe&&(Re=tf(Re)),Tr(Re,ye.ADD_TAGS,ii))),ru(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:xE(ye.ADD_ATTR)&&(He===Ye&&(He=tf(He)),Tr(He,ye.ADD_ATTR,ii))),ru(ye,"ADD_FORBID_CONTENTS")&&xE(ye.ADD_FORBID_CONTENTS)&&(so===Ts&&(so=tf(so)),Tr(so,ye.ADD_FORBID_CONTENTS,ii)),Hn&&(Re["#text"]=!0),rt&&Tr(Re,["html","head","body"]),Re.table&&(Tr(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("")));va&&va(ye),Wr=ye},Mm=Tr({},[...hq,...mq,...p3e]),b_=Tr({},[...pq,...g3e]),iq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="svg":Fe.namespaceURI===nr?ye==="svg"&&(gt==="annotation-xml"||Rm[gt]):!!Mm[ye]},rq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="math":Fe.namespaceURI===jo?ye==="math"&&na[gt]:!!b_[ye]},oq=function(ye,Fe,gt){return Fe.namespaceURI===jo&&!na[gt]||Fe.namespaceURI===nr&&!Rm[gt]?!1:!b_[ye]&&(Om[ye]||!Mm[ye])},sq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:Vi,tagName:"template"});let gt=UI(ye.tagName),on=UI(Fe.tagName);return Ir[ye.namespaceURI]?ye.namespaceURI===jo?iq(gt,Fe,on):ye.namespaceURI===nr?rq(gt,Fe,on):ye.namespaceURI===Fn?oq(gt,Fe,on):!!(Es==="application/xhtml+xml"&&Ir[ye.namespaceURI]):!1},Nm=function(ye){FI(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")}},hE=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},fb=function(ye){db(ye);let Fe=A(ye);if(Fe){let on=[];gb(Fe,wn=>{FI(on,wn)}),gb(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"&&hE(ye,wn,ri)}},lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}FI(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{}},aq=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)]||hE(ye,on,wn)}},db=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===ef.element&&aq(gt);let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},mE=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===ef.processingInstruction||on===ef.comment&&Lc(yce,gt.data)){try{m(gt)}catch{}continue}if(on===ef.element){let ri=gt,bo=ii(R(gt));try{ri.hasAttribute&&ri.hasAttribute("patchsrc")&&ri.removeAttribute("patchsrc"),ri.hasAttribute&&ri.hasAttribute("for")&&mE("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])}},hb=function(ye){let Fe=null,gt=null;if(yi)ye="<remove></remove>"+ye;else{let ri=cce(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},NI=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)},pE=function(ye){return ye=BI(ye,J," "),ye=BI(ye,Z," "),ye=BI(ye,ae," "),ye},x_=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=pE(wn.data),wn=on.nextNode();let ri=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");ri&&gb(ri,bo=>{ne(bo.content)&&x_(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)===ef.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&&gb(Et,gt=>{gt.call(t,ye,Fe,Wr)})}let Je=function(ye,Fe){return!!(Yt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&Lc(_ce,ye.textContent)&&Lc(_ce,ye.innerHTML)||Yt&&ye.namespaceURI===Fn&&I3e[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&Lc(P3e[Fe],ye.textContent))||ye.nodeType===ef.processingInstruction||Yt&&ye.nodeType===ef.comment&&Lc(yce,ye.data))},Tt=function(ye,Fe){if(ye instanceof RegExp)return Lc(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?tf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Ki&&db(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)===ef.element&&!sq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&Lc(S3e,ye.innerHTML))return Nm(ye),!0;if(ft&&ye.nodeType===ef.text){let wn=pE(ye.textContent);ye.textContent!==wn&&(FI(t.removed,{element:ye.cloneNode()}),ye.textContent=wn)}return Ce(W.afterSanitizeElements,ye,null),!1},mn=function(ye,Fe,gt){if(qe[Fe]||mE(Fe,ye)||Ai&&(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&&Lc(Ae,Fe)||vt&&Lc(fe,Fe)?!0:on?pi[Fe]||Lc(ve,BI(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&lce(gt,"data:")===0&&zs[ye]||lt&&!Lc(xe,BI(gt,ge,""))?!0:!gt:co(ye)&&Tt(Ke.tagNameCheck,ye)&&Tt(Ke.attributeNameCheck,Fe,ye)||Fe==="is"&&Ke.allowCustomizedBuiltInElements&&Tt(Ke.tagNameCheck,gt)},Ao=Tr({},["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[UI(ye)]&&Lc(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):ace(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),cq=nu,Al=bo==="value"?cq:c3e(cq);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")&&lce(Al,tn)!==0&&(lh(bo,ye,ri),Al=tn+Al),Yt&&Lc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Al)){lh(bo,ye,ri);continue}if(iu==="attributename"&&cce(Al,"href")){lh(bo,ye,ri);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){lh(bo,ye,ri);continue}if(!mt&&Lc(w3e,Al)){lh(bo,ye,ri);continue}if(ft&&(Al=pE(Al)),!mn(wn,iu,Al)){lh(bo,ye,ri);continue}Al=Vs(wn,iu,rs,Al),Al!==cq&&pc(ye,bo,rs,Al)}}Ce(W.afterSanitizeAttributes,ye,null)},tu=function(ye){let Fe=null,gt=NI(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)===ef.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)===ef.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=h3e(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=tf(Re)),W.uponSanitizeAttribute.length>0&&(He=tf(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 fb(Et),pb("root node is forbidden and cannot be sanitized in-place")}if(ce(Et))throw fb(Et),pb("root node is clobbered and cannot be sanitized in-place");try{I0(Et)}catch(iu){throw fb(Et),iu}}else if(Te(Et))Fe=hb("<!---->"),gt=Fe.ownerDocument.importNode(Et,!0),gt.nodeType===ef.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=hb(Et),!Fe)return zi?null:ui?L:""}Fe&&yi&&Nm(Fe.firstChild);let bo=ri?Et:Fe;try{let nu=NI(bo);for(;on=nu.nextNode();)Gn(on,bo),yl(on),ne(on.content)&&tu(on.content)}catch(nu){throw ri&&(fb(Et),gb(t.removed,iu=>{iu.element&&db(iu.element)})),nu}if(ri)return gb(t.removed,nu=>{nu.element&&db(nu.element)}),ft&&x_(Et),Et;if(zi){if(ft&&x_(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&&Lc(C3e,Fe.ownerDocument.doctype.name)&&(rs="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> -`+rs),ft&&(rs=pE(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"&&ru(W,Et)&&FI(W[Et],ye)},t.removeHook=function(Et,ye){if(ru(W,Et)){if(ye!==void 0){let Fe=s3e(W[Et],ye);return Fe===-1?void 0:a3e(W[Et],Fe,1)[0]}return ace(W[Et])}},t.removeHooks=function(Et){ru(W,Et)&&(W[Et]=[])},t.removeAllHooks=function(){W=Ace()},t}var Cce=Ece();var O3e=0,bq={},xq=class e{constructor(t,n){let i,r=t;l(bq[r])?i=bq[r]:(i=O3e++,bq[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=Cce.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=xq;function zI(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(zI.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});zI.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Eq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Eq(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)}zI.prototype.removeEventListener=function(e,t){let n=Tq(this,this._listeners,e,t),i=Tq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function Tq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!Eq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var fN,uN;function M3e(e){fN.apply(e,uN)}function N3e(e,t){l(t)&&(fN=t,e.forEach(M3e))}zI.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=fN,t=uN;uN=arguments;try{this._listeners.forEach(N3e)}finally{fN=e,uN=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)Eq(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)Tq(this,this._listeners,n,r);this._toRemove.clear()}};var be=zI;function vce(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 xl=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,vce(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)&&vce(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=L3e,r=F3e;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,k3e);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,B3e),o=h.subtract(t,i,U3e),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 AE(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,z3e),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 Sce(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Sce(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)})})}};xl.WGS84=Object.freeze(new xl(6378137,6378137,6356752314245179e-9));xl.UNIT_SPHERE=Object.freeze(new xl(1,1,1));xl.MOON=Object.freeze(new xl(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));xl.MARS=Object.freeze(new xl(3396190,3396190,3376200));xl._default=xl.WGS84;xl.packedLength=h.packedLength;xl.prototype.geocentricSurfaceNormal=h.normalize;var L3e=new h,F3e=new h,B3e=new h,k3e=new h,U3e=new h,z3e=new h,V3e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],j3e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Sce(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+=j3e[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=xl;var Cq=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)}},Hi=Cq;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,dN),e.magnitude(dN)}static distanceSquared(t,n){return e.subtract(t,n,dN),e.magnitudeSquared(dN)}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,wce),r=e.multiplyByScalar(t,1-i,r),e.add(wce,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,H3e);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),vq[0]=t,Ice?(n.x=Fc[0],n.y=Fc[1],n.z=Fc[2],n.w=Fc[3]):(n.x=Fc[3],n.y=Fc[2],n.z=Fc[1],n.w=Fc[0]),n}static unpackFloat(t){return Ice?(Fc[0]=t.x,Fc[1]=t.y,Fc[2]=t.z,Fc[3]=t.w):(Fc[0]=t.w,Fc[1]=t.z,Fc[2]=t.y,Fc[3]=t.x),vq[0]}};Hs.packedLength=4;Hs.fromArray=Hs.unpack;var dN=new Hs,wce=new Hs,H3e=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 vq=new Float32Array(1),Fc=new Uint8Array(vq.buffer),G3e=new Uint32Array([287454020]),W3e=new Uint8Array(G3e.buffer),Ice=W3e[0]===68,se=Hs;function q3e(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 Dr=q3e;function Y3e(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var _b=Y3e;function X3e(e){return e%4===0&&e%100!==0||e%400===0}var ou=X3e;var Pce=[31,28,31,30,31,30,31,31,30,31,30,31];function K3e(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&&ou(e)?Pce[t-1]+1:Pce[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Bm=K3e;function $3e(e,t){this.julianDate=e,this.offset=t}var _r=$3e;var Dce={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(Dce);var Un=Dce;var Rce={UTC:0,TAI:1};Object.freeze(Rce);var ai=Rce;var Oce=new Bm,mN=[31,28,31,30,31,30,31,31,30,31,30,31],pN=29;function wq(e,t){return fi.compare(e.julianDate,t.julianDate)}var TE=new _r;function gN(e){TE.julianDate=e;let t=fi.leapSeconds,n=Dr(t,TE,wq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&fi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),fi.addSeconds(e,i,e)}function Mce(e,t){TE.julianDate=e;let n=fi.leapSeconds,i=Dr(n,TE,wq);if(i<0&&(i=~i),i===0)return fi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return fi.addSeconds(e,-n[i-1].offset,t);let r=fi.secondsDifference(n[i].julianDate,e);if(r===0)return fi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return fi.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 Sq(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 J3e=/^(\d{4})$/,Z3e=/^(\d{4})-(\d{2})$/,Q3e=/^(\d{4})-?(\d{3})$/,eUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,tUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Iq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,nUe=/^(\d{2})(\.\d+)?/.source+Iq.source,iUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Iq.source,rUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Iq.source;var C_={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},oUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function R0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var Nce=NaN,Lce=0;function Fce(e,t,n,i,r,o,s){C_.year=e,C_.month=t,C_.day=n,C_.hour=i,C_.minute=r,C_.second=o,C_.millisecond=s}function sUe(e){let t=e.length;if(t===4){let m=R0(e,0),y=R0(e,2);return m<0||y<0?!1:(Fce(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=R0(e,0),o=R0(e,2),s=R0(e,5),a=R0(e,8),c=R0(e,11),u=R0(e,14),f=R0(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/oUe[y]*1e3}let p=r*100+o,g=ou(p);if((s!==2||!g?mN[s-1]:pN)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==Nce&&(Nce=m,Lce=new Date(m).getTimezoneOffset()),u=u+Lce}return Fce(p,s,a,c,u,f,d),!0}function Bce(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?pN:mN[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?pN:mN[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?pN:mN[t-1],n+=u;let d=Sq(e,t,n,i,r,o,s);return l(c)?(E_(d[0],d[1],c),gN(c)):c=new fi(d[0],d[1],ai.UTC),f&&fi.addSeconds(c,1,c),c}var fi=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&&gN(this)}static fromGregorianDate(t,n){let i=Sq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(E_(i[0],i[1],n),gN(n),n):new e(i[0],i[1],ai.UTC)}static fromDate(t,n){let i=Sq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(E_(i[0],i[1],n),gN(n),n):new e(i[0],i[1],ai.UTC)}static fromIso8601(t,n){if(sUe(t)){let A=C_;return Bce(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,ou(A.year),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(tUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(Z3e),i!==null)r=+i[1],o=+i[2];else if(i=d.match(J3e),i!==null)r=+i[1];else{let A;if(i=d.match(Q3e),i!==null)r=+i[1],A=+i[2],m=ou(r);else if(i=d.match(eUe),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=ou(r);let y;if(l(p)){i=p.match(rUe),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(nUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return Bce(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=Mce(t,hN);l(r)||(e.addSeconds(t,-1,hN),r=Mce(hN,hN),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 Bm(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,Oce),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,Oce),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){TE.julianDate=t;let n=e.leapSeconds,i=Dr(n,TE,wq);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)}},hN=new fi(0,0,ai.TAI);fi.leapSeconds=[new _r(new fi(2441317,43210,ai.TAI),10),new _r(new fi(2441499,43211,ai.TAI),11),new _r(new fi(2441683,43212,ai.TAI),12),new _r(new fi(2442048,43213,ai.TAI),13),new _r(new fi(2442413,43214,ai.TAI),14),new _r(new fi(2442778,43215,ai.TAI),15),new _r(new fi(2443144,43216,ai.TAI),16),new _r(new fi(2443509,43217,ai.TAI),17),new _r(new fi(2443874,43218,ai.TAI),18),new _r(new fi(2444239,43219,ai.TAI),19),new _r(new fi(2444786,43220,ai.TAI),20),new _r(new fi(2445151,43221,ai.TAI),21),new _r(new fi(2445516,43222,ai.TAI),22),new _r(new fi(2446247,43223,ai.TAI),23),new _r(new fi(2447161,43224,ai.TAI),24),new _r(new fi(2447892,43225,ai.TAI),25),new _r(new fi(2448257,43226,ai.TAI),26),new _r(new fi(2448804,43227,ai.TAI),27),new _r(new fi(2449169,43228,ai.TAI),28),new _r(new fi(2449534,43229,ai.TAI),29),new _r(new fi(2450083,43230,ai.TAI),30),new _r(new fi(2450630,43231,ai.TAI),31),new _r(new fi(2451179,43232,ai.TAI),32),new _r(new fi(2453736,43233,ai.TAI),33),new _r(new fi(2454832,43234,ai.TAI),34),new _r(new fi(2456109,43235,ai.TAI),35),new _r(new fi(2457204,43236,ai.TAI),36),new _r(new fi(2457754,43237,ai.TAI),37)];var K=fi;var nle=js(nf(),1);function aUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var bN=aUe;function cUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var rf=cUe;var Gce=js(nf(),1);function Pq(e,t){let n;return typeof document<"u"&&(n=document),Pq._implementation(e,t,n)}Pq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Gce.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var dh=Pq;var Wce=js(nf(),1);function lUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Wce.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var xN=lUe;var qce=js(nf(),1);function uUe(e){let t=new qce.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 v_=uUe;var Yce={};function fUe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Yce[t];l(i)||(i={},Yce[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 km=fUe;var dUe=/^blob:/i;function hUe(e){return dUe.test(e)}var vE=hUe;var Um;function mUe(e){l(Um)||(Um=document.createElement("a")),Um.href=window.location.href;let t=Um.host,n=Um.protocol;return Um.href=e,Um.href=Um.href,n!==Um.protocol||t!==Um.host}var yb=mUe;var pUe=/^data:/i;function gUe(e){return pUe.test(e)}var zm=gUe;function _Ue(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 SE=_Ue;function yUe(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 wE=yUe;function AUe(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 Xf=AUe;var Xce={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Xce);var wi=Xce;var Kce={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Kce);var oa=Kce;function TN(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}TN.prototype.cancel=function(){this.cancelled=!0};TN.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=wi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new TN(this)};var Oo=TN;function bUe(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 EN=bUe;function $ce(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=EN(this.responseHeaders))}$ce.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var O0=$ce;var vN=js(nf(),1);function Ab(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Ab.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 Dq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Ab.prototype.reserve=function(e){e=e??this._length,this._array.length=e};Ab.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?(Dq(i,r,e),e=r):o=!1}};Ab.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Ab.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)Dq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};Ab.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Dq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var CN=Ab;function VI(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(VI.prototype=Object.create(Error.prototype),VI.prototype.constructor=VI);VI.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var oe=VI;function xUe(e,t){return e.priority-t.priority}var Er={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},IE=20,Bc=new CN({comparator:xUe});Bc.maximumLength=IE;Bc.reserve(IE);var Vm=[],M0={},TUe=typeof document<"u"?new vN.default(document.location.href):new vN.default,SN=new be;function xo(){}xo.maximumRequests=50;xo.maximumRequestsPerServer=18;xo.requestsByServer={};xo.throttleRequests=!0;xo.debugShowStatistics=!1;xo.requestCompletedEvent=SN;Object.defineProperties(xo,{statistics:{get:function(){return Er}},priorityHeapLength:{get:function(){return IE},set:function(e){if(e<IE)for(;Bc.length>e;){let t=Bc.pop();bb(t)}IE=e,Bc.maximumLength=e,Bc.reserve(e)}}});function Jce(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}xo.serverHasOpenSlots=function(e,t){t=t??1;let n=xo.requestsByServer[e]??xo.maximumRequestsPerServer;return M0[e]+t<=n};xo.heapHasOpenSlots=function(e){return Bc.length+e<=IE};function Zce(e){return e.state===wi.UNISSUED&&(e.state=wi.ISSUED,e.deferred=rf()),e.deferred.promise}function EUe(e){return function(t){if(e.state===wi.CANCELLED)return;let n=e.deferred;--Er.numberOfActiveRequests,--M0[e.serverKey],SN.raiseEvent(),e.state=wi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function CUe(e){return function(t){e.state!==wi.CANCELLED&&(++Er.numberOfFailedRequests,--Er.numberOfActiveRequests,--M0[e.serverKey],SN.raiseEvent(t),e.state=wi.FAILED,e.deferred.reject(t))}}function Qce(e){let t=Zce(e);return e.state=wi.ACTIVE,Vm.push(e),++Er.numberOfActiveRequests,++Er.numberOfActiveRequestsEver,++M0[e.serverKey],e.requestFunction().then(EUe(e)).catch(CUe(e)),t}function bb(e){let t=e.state===wi.ACTIVE;if(e.state=wi.CANCELLED,++Er.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Er.numberOfActiveRequests,--M0[e.serverKey],++Er.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}xo.update=function(){let e,t,n=0,i=Vm.length;for(e=0;e<i;++e){if(t=Vm[e],t.cancelled&&bb(t),t.state!==wi.ACTIVE){++n;continue}n>0&&(Vm[e-n]=t)}Vm.length-=n;let r=Bc.internalArray,o=Bc.length;for(e=0;e<o;++e)Jce(r[e]);Bc.resort();let s=Math.max(xo.maximumRequests-Vm.length,0),a=0;for(;a<s&&Bc.length>0;){if(t=Bc.pop(),t.cancelled){bb(t);continue}if(t.throttleByServer&&!xo.serverHasOpenSlots(t.serverKey)){bb(t);continue}Qce(t),++a}vUe()};xo.getServerKey=function(e){let t=new vN.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=M0[n];return l(i)||(M0[n]=0),n};xo.request=function(e){if(zm(e.url)||vE(e.url))return SN.raiseEvent(),e.state=wi.RECEIVED,e.requestFunction();if(++Er.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 Qce(e);if(Vm.length>=xo.maximumRequests)return;Jce(e);let t=Bc.insert(e);if(l(t)){if(t===e)return;bb(t)}return Zce(e)};function vUe(){xo.debugShowStatistics&&(Er.numberOfActiveRequests===0&&Er.lastNumberOfActiveRequests>0&&(Er.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Er.numberOfAttemptedRequests}`),Er.numberOfAttemptedRequests=0),Er.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Er.numberOfCancelledRequests}`),Er.numberOfCancelledRequests=0),Er.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Er.numberOfCancelledActiveRequests}`),Er.numberOfCancelledActiveRequests=0),Er.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Er.numberOfFailedRequests}`),Er.numberOfFailedRequests=0)),Er.lastNumberOfActiveRequests=Er.numberOfActiveRequests)}xo.clearForSpecs=function(){for(;Bc.length>0;){let t=Bc.pop();bb(t)}let e=Vm.length;for(let t=0;t<e;++t)bb(Vm[t]);Vm.length=0,M0={},Er.numberOfAttemptedRequests=0,Er.numberOfActiveRequests=0,Er.numberOfCancelledRequests=0,Er.numberOfCancelledActiveRequests=0,Er.numberOfFailedRequests=0,Er.numberOfActiveRequestsEver=0,Er.lastNumberOfActiveRequests=0};xo.numberOfActiveRequestsByServer=function(e){return M0[e]};xo.requestHeap=Bc;var Tl=xo;var ele=js(nf(),1);var jI={},PE={};jI.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PE[n])||(PE[n]=!0)};jI.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PE[n])&&delete PE[n]};function SUe(e){let t=new ele.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}}jI.contains=function(e){let t=SUe(e);return!!(l(t)&&l(PE[t]))};jI.clear=function(){PE={}};var HI=jI;var ile=(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=jm(e.templateValues,{}),this._queryParameters=jm(e.queryParameters,{}),this.headers=jm(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 jm(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 DE;kt.supportsImageBitmapOptions=function(){return l(DE)?DE:typeof createImageBitmap!="function"?(DE=Promise.resolve(!1),DE):(DE=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=km(t[0]),i=km(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),DE)};Object.defineProperties(kt,{isBlobSupported:{get:function(){return ile}}});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 v_(this._url)}},isDataUri:{get:function(){return zm(this._url)}},isBlobUri:{get:function(){return vE(this._url)}},isCrossOriginUrl:{get:function(){return yb(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 nle.default(e),o=wUe(r.query());this._queryParameters=t?IN(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(dh(i))),this._url=r.toString()};function wUe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Xf(e)}function IN(e,t,n){if(!n)return Ot(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}${IUe(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 IUe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${wE(e)}`}kt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=IN(this._queryParameters,e,!1):this._queryParameters=IN(e,this._queryParameters,!1)};kt.prototype.appendQueryParameters=function(e){this._queryParameters=IN(e,this._queryParameters,!0)};kt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(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=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};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 xN(this.getUrlComponent(e),e)};kt.prototype.appendForwardSlash=function(){this._url=bN(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(Rq(this.request),!ile||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=rf();return kt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=Tl.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",Rq(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return rle(this,e,t)};function rle(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=rf();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=Tl.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,rle(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;Rq(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=rf(),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=Tl.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 Rq(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 PUe=/^data:(.*?)(;base64)?,(.*)$/;function wN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function tle(e,t){let n=wN(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 DUe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return wN(i,r);case"arraybuffer":return tle(i,r);case"blob":return o=tle(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(wN(i,r),n);case"json":return JSON.parse(wN(i,r));default:}}kt.prototype.fetch=function(e){return e=jm(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=jm(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=jm(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=jm(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=jm(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=jm(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=jm(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&&(HI.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=rf(),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 RUe(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 O0(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 O0)})}var OUe=typeof XMLHttpRequest>"u";kt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=PUe.exec(e);if(a!==null){o.resolve(DUe(a,t));return}if(OUe){RUe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(HI.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 O0(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 O0)},c.send(i),c};kt._Implementations.loadAndExecuteScript=function(e,t,n){return SE(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 WI(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)?ole(this,e.data):ole(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}WI.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 WI({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};WI.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 _b(0,0,0,0,0),t}});WI.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new _b(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,ale(this,n,this._samples,e,r,o,t),t}let s=Dr(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,ale(this,n,this._samples,e,r,o,t),t};function MUe(e,t){return K.compare(e.julianDate,t)}function ole(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=Dr(T,x,MUe);if(E<0){let v=new _r(x,A);T.splice(~E,0,v)}}d=A}}}function sle(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 GI(e,t,n){return t+e*(n-t)}function ale(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 sle(e,n,r,a,s),s;if(i.equals(u))return sle(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=GI(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=GI(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=GI(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=GI(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=GI(f,g,m),s}var PN=WI;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),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};kc.fromDegrees=function(e,t,n,i){return l(i)||(i=new kc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.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)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.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 Uc=kc;var cle=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function NUe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=cle.exec(i);if(r!==null)return r[1]}}var DN;function lle(e){return typeof document>"u"?e:(l(DN)||(DN=document.createElement("a")),DN.href=e,DN.href)}var xb;function ule(){if(l(xb))return xb;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=dh(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?e=dh("..",Tb("Core/buildModuleUrl.js")):e=NUe(),xb=new De({url:lle(e)}),xb.appendForwardSlash(),xb}function LUe(e){return lle(iN.toUrl(`../${e}`))}function fle(e){return ule().getDerivedResource({url:e}).url}var RN;function Tb(e){return l(RN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?RN=LUe:RN=fle),RN(e)}Tb._cesiumScriptRegex=cle;Tb._buildModuleUrlFromBaseUrl=fle;Tb._clearBaseResource=function(){xb=void 0};Tb.setBaseUrl=function(e){xb=De.DEFAULT.getDerivedResource({url:e})};Tb.getCesiumBaseUrl=ule;var Zt=Tb;function FUe(e,t,n){this.x=e,this.y=t,this.s=n}var RE=FUe;function ON(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 BUe=new K(0,0,ai.TAI);function Oq(e,t,n){let i=BUe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}ON.prototype.preload=function(e,t,n,i){let r=Oq(this,e,t),o=Oq(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(Mq(this,d));return Promise.all(f)};ON.prototype.computeXysRadians=function(e,t,n){let i=Oq(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])||(Mq(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(Mq(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new RE(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};ON.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 kUe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function Mq(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=kUe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var MN=ON;var UUe=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),yr=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,UUe,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,zUe),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,VUe),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],Nq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],Nq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],Nq)),n}static getMaximumScale(t){return e.getScale(t,dle),h.maximumComponent(dle)}static setRotation(t,n,i){let r=e.getScale(t,jUe);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,HUe);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*WUe(c);for(;s<r&&qUe(c)>u;)YUe(c,NN),e.transpose(NN,hle),e.multiply(c,NN,c),e.multiply(hle,c,c),e.multiply(a,NN,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,GUe),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]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};Ake.exports=zae});var lq={};lq.EMPTY_OBJECT=Object.freeze({});lq.EMPTY_ARRAY=Object.freeze([]);var H=lq;function Hke(e){return e!=null}var l=Hke;function mb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(mb.prototype=Object.create(Error.prototype),mb.prototype.constructor=mb);mb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};mb.throwInstantiationError=function(){throw new mb("This function defines an interface and should not be called directly.")};var pe=mb;var ia={};ia.typeOf={};function Gke(e){return`${e} is required, actual value was undefined`}function gE(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(Gke(e))};ia.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(gE(typeof t,"function",e))};ia.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(gE(typeof t,"string",e))};ia.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(gE(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(gE(typeof t,"object",e))};ia.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(gE(typeof t,"boolean",e))};ia.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(gE(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;function LI(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(LI.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});LI.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return fq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function fq(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)}LI.prototype.removeEventListener=function(e,t){let n=uq(this,this._listeners,e,t),i=uq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function uq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!fq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var oN,rN;function Wke(e){oN.apply(e,rN)}function qke(e,t){l(t)&&(oN=t,e.forEach(Wke))}LI.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=oN,t=rN;rN=arguments;try{this._listeners.forEach(qke)}finally{oN=e,rN=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)fq(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)uq(this,this._listeners,n,r);this._toRemove.clear()}};var be=LI;function T_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(T_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});T_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};T_.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))}};T_.prototype.equals=function(e){return this===e||e instanceof T_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};T_.prototype.valueOf=function(){return this._value};T_.prototype.toString=function(){return String(this._value)};var fi=T_;function Yke(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 Xke(e){return new fi(e)}function Kke(e,t,n){return Yke(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??Xke)}var me=Kke;function FI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(FI.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")});FI.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new FI(this)};FI.prototype.merge=function(e){this.show=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 bl=FI;var dq=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)}},kt=dq;var hq=js(sN(),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 aN=[1];_t.factorial=function(e){let t=aN.length;if(e>=t){let n=aN[t-1];for(let i=t;i<=e;i++){let r=n*i;aN.push(r),n=r}}return aN[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 Wae=new hq.default;_t.setRandomNumberSeed=function(e){Wae=new hq.default(e)};_t.nextRandomNumber=function(){return Wae.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 os=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,cN),e.magnitude(cN)}static distanceSquared(t,n){return e.subtract(t,n,cN),e.magnitudeSquared(cN)}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,qae),r=e.multiplyByScalar(t,1-i,r),e.add(qae,r,r)}static angleBetween(t,n){return e.normalize(t,Yae),e.normalize(n,Xae),P.acosClamped(e.dot(Yae,Xae))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,$ke);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})`}};os.fromCartesian3=os.clone;os.fromCartesian4=os.clone;os.packedLength=2;os.fromArray=os.unpack;var cN=new os,qae=new os,Yae=new os,Xae=new os,$ke=new os;os.ZERO=Object.freeze(new os(0,0));os.ONE=Object.freeze(new os(1,1));os.UNIT_X=Object.freeze(new os(1,0));os.UNIT_Y=Object.freeze(new os(0,1));var U=os;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,lN),e.magnitude(lN)}static distanceSquared(t,n){return e.subtract(t,n,lN),e.magnitudeSquared(lN)}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,Kae),r=e.multiplyByScalar(t,1-i,r),e.add(Kae,r,r)}static angleBetween(t,n){e.normalize(t,uN),e.normalize(n,mq);let i=e.dot(uN,mq),r=e.magnitude(e.cross(uN,mq,uN));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Jke);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,_E);let c=Math.sqrt(e.dot(Yf,_E));return _E=e.divideByScalar(_E,c,_E),Yf=e.multiplyByScalar(Yf,i,Yf),l(o)||(o=new e),e.add(_E,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 lN=new lo,Kae=new lo,uN=new lo,mq=new lo,Jke=new lo,Yf=new lo,_E=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 Zke=new h,Qke=new h;function e3e(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,Zke);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=Qke;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=e3e;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,n3e);if(!l(a))return;let c=h.multiplyComponents(a,o,t3e);c=h.normalize(c,c);let u=h.subtract(t,a,i3e),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 BI=xl;BI.ZERO=Object.freeze(new BI(0,0,0));var t3e=new h,n3e=new h,i3e=new h,he=BI;function $ae(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,$ae(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)&&$ae(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=r3e,r=o3e;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,a3e);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,s3e),o=h.subtract(t,i,c3e),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,l3e),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 Jae(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Jae(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 r3e=new h,o3e=new h,s3e=new h,a3e=new h,c3e=new h,l3e=new h,u3e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],f3e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Jae(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*u3e[s];o+=f3e[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Tl;var pq=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=pq;var Zae={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(Zae);var $t=Zae;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,fN),e.magnitude(fN)}static distanceSquared(t,n){return e.subtract(t,n,fN),e.magnitudeSquared(fN)}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,Qae),r=e.multiplyByScalar(t,1-i,r),e.add(Qae,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,d3e);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),gq[0]=t,ece?(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 ece?(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),gq[0]}};Hs.packedLength=4;Hs.fromArray=Hs.unpack;var fN=new Hs,Qae=new Hs,d3e=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 gq=new Float32Array(1),Nc=new Uint8Array(gq.buffer),h3e=new Uint32Array([287454020]),m3e=new Uint8Array(h3e.buffer),ece=m3e[0]===68,se=Hs;function p3e(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=p3e;function g3e(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var pb=g3e;function _3e(e){return e%4===0&&e%100!==0||e%400===0}var ru=_3e;var tce=[31,28,31,30,31,30,31,31,30,31,30,31];function y3e(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&&ru(e)?tce[t-1]+1:tce[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Fm=y3e;function A3e(e,t){this.julianDate=e,this.offset=t}var _r=A3e;var nce={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(nce);var Un=nce;var ice={UTC:0,TAI:1};Object.freeze(ice);var ai=ice;var rce=new Fm,hN=[31,28,31,30,31,30,31,31,30,31,30,31],mN=29;function yq(e,t){return di.compare(e.julianDate,t.julianDate)}var AE=new _r;function pN(e){AE.julianDate=e;let t=di.leapSeconds,n=Pr(t,AE,yq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&di.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),di.addSeconds(e,i,e)}function oce(e,t){AE.julianDate=e;let n=di.leapSeconds,i=Pr(n,AE,yq);if(i<0&&(i=~i),i===0)return di.addSeconds(e,-n[0].offset,t);if(i>=n.length)return di.addSeconds(e,-n[i-1].offset,t);let r=di.secondsDifference(n[i].julianDate,e);if(r===0)return di.addSeconds(e,-n[i].offset,t);if(!(r<=1))return di.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 _q(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 b3e=/^(\d{4})$/,x3e=/^(\d{4})-(\d{2})$/,T3e=/^(\d{4})-?(\d{3})$/,E3e=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,C3e=/^(\d{4})-?(\d{2})-?(\d{2})$/,Aq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,v3e=/^(\d{2})(\.\d+)?/.source+Aq.source,S3e=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Aq.source,w3e=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Aq.source;var C_={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},I3e=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function D0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var sce=NaN,ace=0;function cce(e,t,n,i,r,o,s){C_.year=e,C_.month=t,C_.day=n,C_.hour=i,C_.minute=r,C_.second=o,C_.millisecond=s}function P3e(e){let t=e.length;if(t===4){let m=D0(e,0),y=D0(e,2);return m<0||y<0?!1:(cce(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=D0(e,0),o=D0(e,2),s=D0(e,5),a=D0(e,8),c=D0(e,11),u=D0(e,14),f=D0(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/I3e[y]*1e3}let p=r*100+o,g=ru(p);if((s!==2||!g?hN[s-1]:mN)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==sce&&(sce=m,ace=new Date(m).getTimezoneOffset()),u=u+ace}return cce(p,s,a,c,u,f,d),!0}function lce(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?mN:hN[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?mN:hN[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?mN:hN[t-1],n+=u;let d=_q(e,t,n,i,r,o,s);return l(c)?(E_(d[0],d[1],c),pN(c)):c=new di(d[0],d[1],ai.UTC),f&&di.addSeconds(c,1,c),c}var di=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&&pN(this)}static fromGregorianDate(t,n){let i=_q(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(E_(i[0],i[1],n),pN(n),n):new e(i[0],i[1],ai.UTC)}static fromDate(t,n){let i=_q(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(E_(i[0],i[1],n),pN(n),n):new e(i[0],i[1],ai.UTC)}static fromIso8601(t,n){if(P3e(t)){let A=C_;return lce(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,ru(A.year),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(C3e),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(x3e),i!==null)r=+i[1],o=+i[2];else if(i=d.match(b3e),i!==null)r=+i[1];else{let A;if(i=d.match(T3e),i!==null)r=+i[1],A=+i[2],m=ru(r);else if(i=d.match(E3e),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=ru(r);let y;if(l(p)){i=p.match(w3e),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(S3e),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(v3e),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return lce(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=oce(t,dN);l(r)||(e.addSeconds(t,-1,dN),r=oce(dN,dN),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,rce),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,rce),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,yq);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)}},dN=new di(0,0,ai.TAI);di.leapSeconds=[new _r(new di(2441317,43210,ai.TAI),10),new _r(new di(2441499,43211,ai.TAI),11),new _r(new di(2441683,43212,ai.TAI),12),new _r(new di(2442048,43213,ai.TAI),13),new _r(new di(2442413,43214,ai.TAI),14),new _r(new di(2442778,43215,ai.TAI),15),new _r(new di(2443144,43216,ai.TAI),16),new _r(new di(2443509,43217,ai.TAI),17),new _r(new di(2443874,43218,ai.TAI),18),new _r(new di(2444239,43219,ai.TAI),19),new _r(new di(2444786,43220,ai.TAI),20),new _r(new di(2445151,43221,ai.TAI),21),new _r(new di(2445516,43222,ai.TAI),22),new _r(new di(2446247,43223,ai.TAI),23),new _r(new di(2447161,43224,ai.TAI),24),new _r(new di(2447892,43225,ai.TAI),25),new _r(new di(2448257,43226,ai.TAI),26),new _r(new di(2448804,43227,ai.TAI),27),new _r(new di(2449169,43228,ai.TAI),28),new _r(new di(2449534,43229,ai.TAI),29),new _r(new di(2450083,43230,ai.TAI),30),new _r(new di(2450630,43231,ai.TAI),31),new _r(new di(2451179,43232,ai.TAI),32),new _r(new di(2453736,43233,ai.TAI),33),new _r(new di(2454832,43234,ai.TAI),34),new _r(new di(2456109,43235,ai.TAI),35),new _r(new di(2457204,43236,ai.TAI),36),new _r(new di(2457754,43237,ai.TAI),37)];var K=di;var Dce=js(ef(),1);function D3e(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var AN=D3e;function gce(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=gce(r,t)),n[i]=r}return n}var Ze=gce;function _ce(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]=_ce(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=_ce;function R3e(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var tf=R3e;var yce=js(ef(),1);function bq(e,t){let n;return typeof document<"u"&&(n=document),bq._implementation(e,t,n)}bq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new yce.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var fh=bq;var Ace=js(ef(),1);function O3e(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Ace.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var bN=O3e;var bce=js(ef(),1);function M3e(e){let t=new bce.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 v_=M3e;var xce={};function N3e(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=xce[t];l(i)||(i={},xce[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=N3e;var L3e=/^blob:/i;function F3e(e){return L3e.test(e)}var TE=F3e;var km;function B3e(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 gb=B3e;var k3e=/^data:/i;function U3e(e){return k3e.test(e)}var Um=U3e;function z3e(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=z3e;function V3e(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=V3e;function j3e(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 Xf=j3e;var Tce={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Tce);var wi=Tce;var Ece={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Ece);var ra=Ece;function xN(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??ra.OTHER,this.serverKey=e.serverKey,this.state=wi.UNISSUED,this.deferred=void 0,this.cancelled=!1}xN.prototype.cancel=function(){this.cancelled=!0};xN.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 xN(this)};var Oo=xN;function H3e(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 TN=H3e;function Cce(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=TN(this.responseHeaders))}Cce.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var R0=Cce;var CN=js(ef(),1);function _b(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(_b.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 xq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}_b.prototype.reserve=function(e){e=e??this._length,this._array.length=e};_b.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?(xq(i,r,e),e=r):o=!1}};_b.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};_b.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)xq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};_b.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return xq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var EN=_b;function kI(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(kI.prototype=Object.create(Error.prototype),kI.prototype.constructor=kI);kI.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var oe=kI;function G3e(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,Lc=new EN({comparator:G3e});Lc.maximumLength=vE;Lc.reserve(vE);var zm=[],O0={},W3e=typeof document<"u"?new CN.default(document.location.href):new CN.default,vN=new be;function xo(){}xo.maximumRequests=50;xo.maximumRequestsPerServer=18;xo.requestsByServer={};xo.throttleRequests=!0;xo.debugShowStatistics=!1;xo.requestCompletedEvent=vN;Object.defineProperties(xo,{statistics:{get:function(){return Tr}},priorityHeapLength:{get:function(){return vE},set:function(e){if(e<vE)for(;Lc.length>e;){let t=Lc.pop();yb(t)}vE=e,Lc.maximumLength=e,Lc.reserve(e)}}});function vce(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 Lc.length+e<=vE};function Sce(e){return e.state===wi.UNISSUED&&(e.state=wi.ISSUED,e.deferred=tf()),e.deferred.promise}function q3e(e){return function(t){if(e.state===wi.CANCELLED)return;let n=e.deferred;--Tr.numberOfActiveRequests,--O0[e.serverKey],vN.raiseEvent(),e.state=wi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Y3e(e){return function(t){e.state!==wi.CANCELLED&&(++Tr.numberOfFailedRequests,--Tr.numberOfActiveRequests,--O0[e.serverKey],vN.raiseEvent(t),e.state=wi.FAILED,e.deferred.reject(t))}}function wce(e){let t=Sce(e);return e.state=wi.ACTIVE,zm.push(e),++Tr.numberOfActiveRequests,++Tr.numberOfActiveRequestsEver,++O0[e.serverKey],e.requestFunction().then(q3e(e)).catch(Y3e(e)),t}function yb(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&&yb(t),t.state!==wi.ACTIVE){++n;continue}n>0&&(zm[e-n]=t)}zm.length-=n;let r=Lc.internalArray,o=Lc.length;for(e=0;e<o;++e)vce(r[e]);Lc.resort();let s=Math.max(xo.maximumRequests-zm.length,0),a=0;for(;a<s&&Lc.length>0;){if(t=Lc.pop(),t.cancelled){yb(t);continue}if(t.throttleByServer&&!xo.serverHasOpenSlots(t.serverKey)){yb(t);continue}wce(t),++a}X3e()};xo.getServerKey=function(e){let t=new CN.default(e);t.scheme()===""&&(t=t.absoluteTo(W3e),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 vN.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 wce(e);if(zm.length>=xo.maximumRequests)return;vce(e);let t=Lc.insert(e);if(l(t)){if(t===e)return;yb(t)}return Sce(e)};function X3e(){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(;Lc.length>0;){let t=Lc.pop();yb(t)}let e=zm.length;for(let t=0;t<e;++t)yb(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=Lc;var El=xo;var Ice=js(ef(),1);var UI={},SE={};UI.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(SE[n])||(SE[n]=!0)};UI.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(SE[n])&&delete SE[n]};function K3e(e){let t=new Ice.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}}UI.contains=function(e){let t=K3e(e);return!!(l(t)&&l(SE[t]))};UI.clear=function(){SE={}};var zI=UI;var Rce=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function Ut(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}Ut.createIfNeeded=function(e){return e instanceof Ut?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Ut({url:e})};var wE;Ut.supportsImageBitmapOptions=function(){return l(wE)?wE:typeof createImageBitmap!="function"?(wE=Promise.resolve(!1),wE):(wE=Ut.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(Ut,{isBlobSupported:{get:function(){return Rce}}});Object.defineProperties(Ut.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 v_(this._url)}},isDataUri:{get:function(){return Um(this._url)}},isBlobUri:{get:function(){return TE(this._url)}},isCrossOriginUrl:{get:function(){return gb(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Ut.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ut.prototype.parseUrl=function(e,t,n,i){let r=new Dce.default(e),o=$3e(r.query());this._queryParameters=t?wN(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(fh(i))),this._url=r.toString()};function $3e(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Xf(e)}function wN(e,t,n){if(!n)return Ot(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}Ut.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${J3e(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 J3e(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${CE(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=wN(this._queryParameters,e,!1):this._queryParameters=wN(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=wN(e,this._queryParameters,!0)};Ut.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(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=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};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=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 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 bN(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=AN(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??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(Tq(this.request),!Rce||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 Ut.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return Ut.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new Ut({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)})};Ut.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=tf();return Ut._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)})})};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",Tq(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Oce(this,e,t)};function Oce(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=tf();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Ut._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,Oce(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;Tq(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=tf(),d=Ut._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 Tq(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 Z3e=/^data:(.*?)(;base64)?,(.*)$/;function SN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Pce(e,t){let n=SN(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 Q3e(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return SN(i,r);case"arraybuffer":return Pce(i,r);case"blob":return o=Pce(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(SN(i,r),n);case"json":return JSON.parse(SN(i,r));default:}}Ut.prototype.fetch=function(e){return e=Vm(e,{}),e.method="GET",this._makeRequest(e)};Ut.fetch=function(e){return new Ut(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.delete=function(e){return e=Vm(e,{}),e.method="DELETE",this._makeRequest(e)};Ut.delete=function(e){return new Ut(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Ut.prototype.head=function(e){return e=Vm(e,{}),e.method="HEAD",this._makeRequest(e)};Ut.head=function(e){return new Ut(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.options=function(e){return e=Vm(e,{}),e.method="OPTIONS",this._makeRequest(e)};Ut.options=function(e){return new Ut(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.post=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Ut.post=function(e){return new Ut(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.put=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Ut.put=function(e){return new Ut(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut.prototype.patch=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Ut.patch=function(e){return new Ut(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ut._Implementations={};Ut._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&&(zI.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Ut._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;Ut.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){Ut._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=tf(),p=Ut._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 Ut.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};Ut.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 eUe(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 tUe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=Z3e.exec(e);if(a!==null){o.resolve(Q3e(a,t));return}if(tUe){eUe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(zI.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};Ut._Implementations.loadAndExecuteScript=function(e,t,n){return EE(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 De=Ut;function jI(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)?Mce(this,e.data):Mce(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}jI.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 jI({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};jI.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 pb(0,0,0,0,0),t}});jI.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new pb(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,Lce(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,Lce(this,n,this._samples,e,r,o,t),t};function nUe(e,t){return K.compare(e.julianDate,t)}function Mce(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,nUe);if(E<0){let v=new _r(x,A);T.splice(~E,0,v)}}d=A}}}function Nce(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 VI(e,t,n){return t+e*(n-t)}function Lce(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 Nce(e,n,r,a,s),s;if(i.equals(u))return Nce(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=VI(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=VI(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=VI(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=VI(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=VI(f,g,m),s}var IN=jI;function Fc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Fc.fromQuaternion=function(e,t){l(t)||(t=new Fc);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};Fc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Fc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Fc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Fc(e.heading,e.pitch,e.roll)};Fc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Fc.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)};Fc.prototype.clone=function(e){return Fc.clone(this,e)};Fc.prototype.equals=function(e){return Fc.equals(this,e)};Fc.prototype.equalsEpsilon=function(e,t,n){return Fc.equalsEpsilon(this,e,t,n)};Fc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Bc=Fc;var Fce=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function iUe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Fce.exec(i);if(r!==null)return r[1]}}var PN;function Bce(e){return typeof document>"u"?e:(l(PN)||(PN=document.createElement("a")),PN.href=e,PN.href)}var Ab;function kce(){if(l(Ab))return Ab;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(iN.toUrl)?e=fh("..",bb("Core/buildModuleUrl.js")):e=iUe(),Ab=new De({url:Bce(e)}),Ab.appendForwardSlash(),Ab}function rUe(e){return Bce(iN.toUrl(`../${e}`))}function Uce(e){return kce().getDerivedResource({url:e}).url}var DN;function bb(e){return l(DN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?DN=rUe:DN=Uce),DN(e)}bb._cesiumScriptRegex=Fce;bb._buildModuleUrlFromBaseUrl=Uce;bb._clearBaseResource=function(){Ab=void 0};bb.setBaseUrl=function(e){Ab=De.DEFAULT.getDerivedResource({url:e})};bb.getCesiumBaseUrl=kce;var Zt=bb;function oUe(e,t,n){this.x=e,this.y=t,this.s=n}var IE=oUe;function RN(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 sUe=new K(0,0,ai.TAI);function Eq(e,t,n){let i=sUe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}RN.prototype.preload=function(e,t,n,i){let r=Eq(this,e,t),o=Eq(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(Cq(this,d));return Promise.all(f)};RN.prototype.computeXysRadians=function(e,t,n){let i=Eq(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])||(Cq(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(Cq(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};RN.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 aUe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function Cq(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=aUe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var ON=RN;var cUe=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),yr=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,cUe,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,lUe),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,uUe),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],vq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],vq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],vq)),n}static getMaximumScale(t){return e.getScale(t,zce),h.maximumComponent(zce)}static setRotation(t,n,i){let r=e.getScale(t,fUe);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,dUe);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*mUe(c);for(;s<r&&pUe(c)>u;)gUe(c,MN),e.transpose(MN,Vce),e.multiply(c,MN,c),e.multiply(Vce,c,c),e.multiply(a,MN,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,hUe),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]})`}};yr.packedLength=9;yr.fromArray=yr.unpack;yr.IDENTITY=new yr(1,0,0,0,1,0,0,0,1);yr.ZERO=new yr(0,0,0,0,0,0,0,0,0);yr.COLUMN0ROW0=0;yr.COLUMN0ROW1=1;yr.COLUMN0ROW2=2;yr.COLUMN1ROW0=3;yr.COLUMN1ROW1=4;yr.COLUMN1ROW2=5;yr.COLUMN2ROW0=6;yr.COLUMN2ROW1=7;yr.COLUMN2ROW2=8;var zUe=new h,VUe=new h,Nq=new h,dle=new h,jUe=new h,HUe=new h,NN=new yr,hle=new yr,GUe=new yr;function WUe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var Lq=[1,0,0],Fq=[2,2,1];function qUe(e){let t=0;for(let n=0;n<3;++n){let i=e[yr.getElementIndex(Fq[n],Lq[n])];t+=2*i*i}return Math.sqrt(t)}function YUe(e,t){let n=P.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[yr.getElementIndex(Fq[u],Lq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=Lq[r],c=Fq[r];if(Math.abs(e[yr.getElementIndex(c,a)])>n){let u=e[yr.getElementIndex(c,c)],f=e[yr.getElementIndex(a,a)],d=e[yr.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=yr.clone(yr.IDENTITY,t),t[yr.getElementIndex(a,a)]=t[yr.getElementIndex(c,c)]=o,t[yr.getElementIndex(c,a)]=s,t[yr.getElementIndex(a,c)]=-s,t}var $=yr;var XUe=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,XUe,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,OE),h.normalize(h.cross(OE,o,ME),ME),h.normalize(h.cross(ME,OE,qI),qI);let s=ME.x,a=ME.y,c=ME.z,u=OE.x,f=OE.y,d=OE.z,p=qI.x,g=qI.y,m=qI.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,KUe),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,$Ue),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],Bq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],Bq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],Bq)),n}static getMaximumScale(t){return e.getScale(t,mle),h.maximumComponent(mle)}static setRotation(t,n,i){let r=e.getScale(t,JUe);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,ZUe);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,QUe),eze,P.EPSILON7)&&se.equals(e.getRow(t,3,tze),nze))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,ize),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[2]}, ${this[5]}, ${this[8]})`}};yr.packedLength=9;yr.fromArray=yr.unpack;yr.IDENTITY=new yr(1,0,0,0,1,0,0,0,1);yr.ZERO=new yr(0,0,0,0,0,0,0,0,0);yr.COLUMN0ROW0=0;yr.COLUMN0ROW1=1;yr.COLUMN0ROW2=2;yr.COLUMN1ROW0=3;yr.COLUMN1ROW1=4;yr.COLUMN1ROW2=5;yr.COLUMN2ROW0=6;yr.COLUMN2ROW1=7;yr.COLUMN2ROW2=8;var lUe=new h,uUe=new h,vq=new h,zce=new h,fUe=new h,dUe=new h,MN=new yr,Vce=new yr,hUe=new yr;function mUe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var Sq=[1,0,0],wq=[2,2,1];function pUe(e){let t=0;for(let n=0;n<3;++n){let i=e[yr.getElementIndex(wq[n],Sq[n])];t+=2*i*i}return Math.sqrt(t)}function gUe(e,t){let n=P.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[yr.getElementIndex(wq[u],Sq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=Sq[r],c=wq[r];if(Math.abs(e[yr.getElementIndex(c,a)])>n){let u=e[yr.getElementIndex(c,c)],f=e[yr.getElementIndex(a,a)],d=e[yr.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=yr.clone(yr.IDENTITY,t),t[yr.getElementIndex(a,a)]=t[yr.getElementIndex(c,c)]=o,t[yr.getElementIndex(c,a)]=s,t[yr.getElementIndex(a,c)]=-s,t}var $=yr;var _Ue=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,_Ue,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,DE),DE),h.normalize(h.cross(DE,PE,HI),HI);let s=DE.x,a=DE.y,c=DE.z,u=PE.x,f=PE.y,d=PE.z,p=HI.x,g=HI.y,m=HI.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,yUe),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,AUe),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],Iq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],Iq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],Iq)),n}static getMaximumScale(t){return e.getScale(t,jce),h.maximumComponent(jce)}static setRotation(t,n,i){let r=e.getScale(t,bUe);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,xUe);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,TUe),EUe,P.EPSILON7)&&se.equals(e.getRow(t,3,CUe),vUe))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,SUe),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]})`}};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 OE=new h,ME=new h,qI=new h,KUe=new h,$Ue=new h,Bq=new h,mle=new h,JUe=new h,ZUe=new h,QUe=new $,eze=new $,tze=new se,nze=new se(0,0,0,1),ize=new uo,M=uo;var S_,ss={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},su={};Object.defineProperties(su,{element:{get:function(){if(su.supportsFullscreen())return document[ss.fullscreenElement]}},changeEventName:{get:function(){if(su.supportsFullscreen())return ss.fullscreenchange}},errorEventName:{get:function(){if(su.supportsFullscreen())return ss.fullscreenerror}},enabled:{get:function(){if(su.supportsFullscreen())return document[ss.fullscreenEnabled]}},fullscreen:{get:function(){if(su.supportsFullscreen())return su.element!==null}}});su.supportsFullscreen=function(){if(l(S_))return S_;S_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ss.requestFullscreen="requestFullscreen",ss.exitFullscreen="exitFullscreen",ss.fullscreenEnabled="fullscreenEnabled",ss.fullscreenElement="fullscreenElement",ss.fullscreenchange="fullscreenchange",ss.fullscreenerror="fullscreenerror",S_=!0,S_;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"?(ss.requestFullscreen=n,S_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ss.requestFullscreen=n,S_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ss.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ss.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ss.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ss.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ss.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ss.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ss.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ss.fullscreenerror=n)}return S_};su.requestFullscreen=function(e,t){su.supportsFullscreen()&&e[ss.requestFullscreen]({vrDisplay:t})};su.exitFullscreen=function(){su.supportsFullscreen()&&document[ss.exitFullscreen]()};su._names=ss;var as=su;var Kf;typeof navigator<"u"?Kf=navigator:Kf={};function YI(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var LN,ple;function jq(){if(!l(LN)&&(LN=!1,!VN())){let e=/ Chrome\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(LN=!0,ple=YI(e[1]))}return LN}function rze(){return jq()&&ple}var FN,gle;function _le(){if(!l(FN)&&(FN=!1,!jq()&&!VN()&&/ Safari\/[\.0-9]+/.test(Kf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(FN=!0,gle=YI(e[1]))}return FN}function oze(){return _le()&&gle}var BN,Vq;function yle(){if(!l(BN)){BN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Kf.userAgent);e!==null&&(BN=!0,Vq=YI(e[1]),Vq.isNightly=!!e[2])}return BN}function sze(){return yle()&&Vq}var kN,Ale;function VN(){if(!l(kN)){kN=!1;let e=/ Edg\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(kN=!0,Ale=YI(e[1]))}return kN}function aze(){return VN()&&Ale}var UN,Hq;function jN(){if(!l(UN)){UN=!1;let e=/Firefox\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(UN=!0,Hq=YI(e[1]))}return UN}var kq;function cze(){return l(kq)||(kq=/Windows/i.test(Kf.appVersion)),kq}var Uq;function lze(){return l(Uq)||(Uq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Uq}function uze(){return jN()&&Hq}var zq;function fze(){return l(zq)||(zq=!jN()&&typeof PointerEvent<"u"&&(!l(Kf.pointerEnabled)||Kf.pointerEnabled)),zq}var ble,zN;function xle(){if(!l(zN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;zN=l(t)&&t!=="",zN&&(ble=t)}return zN}function dze(){return xle()?ble:void 0}function El(){return El._result}El._promise=void 0;El._result=void 0;El.initialize=function(){return l(El._promise)||(El._promise=new Promise(e=>{let t=new Image;t.onload=function(){El._result=t.width>0&&t.height>0,e(El._result)},t.onerror=function(){El._result=!1,e(El._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),El._promise};Object.defineProperties(El,{initialized:{get:function(){return l(El._result)}}});var NE=[];typeof ArrayBuffer<"u"&&(NE.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&NE.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&NE.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&NE.push(BigInt64Array),typeof BigUint64Array<"u"&&NE.push(BigUint64Array));var $f={isChrome:jq,chromeVersion:rze,isSafari:_le,safariVersion:oze,isWebkit:yle,webkitVersion:sze,isEdge:VN,edgeVersion:aze,isFirefox:jN,firefoxVersion:uze,isWindows:cze,isIPadOrIOS:lze,hardwareConcurrency:Kf.hardwareConcurrency??3,supportsPointerEvents:fze,supportsImageRenderingPixelated:xle,supportsWebP:El,imageRenderingValue:dze,typedArrayTypes:NE};$f.supportsBasis=function(e){return $f.supportsWebAssembly()&&e.context.supportsBasis};$f.supportsFullscreen=function(){return as.supportsFullscreen()};$f.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};$f.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};$f.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};$f.supportsBigInt=function(){return typeof BigInt<"u"};$f.supportsWebWorkers=function(){return typeof Worker<"u"};$f.supportsWebAssembly=function(){return typeof WebAssembly<"u"};$f.supportsWebgl2=function(e){return e.context.webgl2};$f.supportsEsmWebWorkers=function(){return!jN()||parseInt(Hq)>=114};var dn=$f;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var XI=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);XI=h.normalize(e,XI);let o=XI.x*r,s=XI.y*r,a=XI.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 hze=[1,2,0],mze=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=hze,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=mze;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 Tle=new dt,Ele=new dt,Gq=new dt,Cle=new dt;dt.fromHeadingPitchRoll=function(e,t){return Cle=dt.fromAxisAngle(h.UNIT_X,e.roll,Tle),Gq=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(Gq,Cle,Gq),Ele=dt.fromAxisAngle(h.UNIT_Z,-e.heading,Tle),dt.multiply(Ele,t,t)};var HN=new h,Wq=new h,hh=new dt,vle=new dt,GN=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,GN),dt.conjugate(GN,GN);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,hh),dt.multiply(hh,GN,hh),hh.w<0&&dt.negate(hh,hh),dt.computeAxis(hh,HN);let a=dt.computeAngle(hh);l(i)||(i=[]),i[s]=HN.x*a,i[s+1]=HN.y*a,i[s+2]=HN.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,Wq);let o=h.magnitude(Wq);return dt.unpack(t,i*4,vle),o===0?dt.clone(dt.IDENTITY,hh):dt.fromAxisAngle(Wq,o,hh),dt.multiply(hh,vle,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 qq=new dt;dt.lerp=function(e,t,n,i){return qq=dt.multiplyByScalar(t,n,qq),i=dt.multiplyByScalar(e,1-n,i),dt.add(qq,i,i)};var Sle=new dt,Yq=new dt,Xq=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=Sle=dt.negate(t,Sle)),1-r<P.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return Yq=dt.multiplyByScalar(e,Math.sin((1-n)*s),Yq),Xq=dt.multiplyByScalar(o,Math.sin(n*s),Xq),i=dt.add(Yq,Xq,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 pze=new h,gze=new h,KI=new dt,LE=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,KI);dt.multiply(r,n,LE);let o=dt.log(LE,pze);dt.multiply(r,e,LE);let s=dt.log(LE,gze);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,KI),dt.multiply(t,KI,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,KI),a=dt.slerp(n,i,r,LE);return dt.slerp(s,a,2*r*(1-r),o)};var _ze=new dt,wle=1.9011074535173003,WN=dn.supportsTypedArrays()?new Float32Array(8):[],qN=dn.supportsTypedArrays()?new Float32Array(8):[],N0=dn.supportsTypedArrays()?new Float32Array(8):[],L0=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;WN[e]=1/(t*n),qN[e]=t/n}WN[7]=wle/136;qN[7]=wle*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)N0[g]=(WN[g]*c-qN[g])*s,L0[g]=(WN[g]*u-qN[g])*s;let f=o*n*(1+N0[0]*(1+N0[1]*(1+N0[2]*(1+N0[3]*(1+N0[4]*(1+N0[5]*(1+N0[6]*(1+N0[7])))))))),d=a*(1+L0[0]*(1+L0[1]*(1+L0[2]*(1+L0[3]*(1+L0[4]*(1+L0[5]*(1+L0[6]*(1+L0[7])))))))),p=dt.multiplyByScalar(e,d,_ze);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,KI),a=dt.fastSlerp(n,i,r,LE);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 bi={},Kq={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"}},FE={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$q={},au={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},w_=new h,I_=new h,P_=new h;bi.localFrameToFixedFrameGenerator=function(e,t){if(!Kq.hasOwnProperty(e)||!Kq[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=Kq[e][t],i,r=e+t;return l($q[r])?i=$q[r]:(i=function(o,s,a){if(l(a)||(a=new M),h.equalsEpsilon(o,h.ZERO,P.EPSILON14))h.unpack(FE[e],0,w_),h.unpack(FE[t],0,I_),h.unpack(FE[n],0,P_);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);h.unpack(FE[e],0,w_),e!=="east"&&e!=="west"&&h.multiplyByScalar(w_,c,w_),h.unpack(FE[t],0,I_),t!=="east"&&t!=="west"&&h.multiplyByScalar(I_,c,I_),h.unpack(FE[n],0,P_),n!=="east"&&n!=="west"&&h.multiplyByScalar(P_,c,P_)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,au.up);let c=au.up,u=au.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,au.east),h.cross(c,u,au.north),h.multiplyByScalar(au.up,-1,au.down),h.multiplyByScalar(au.east,-1,au.west),h.multiplyByScalar(au.north,-1,au.south),w_=au[e],I_=au[t],P_=au[n]}return a[0]=w_.x,a[1]=w_.y,a[2]=w_.z,a[3]=0,a[4]=I_.x,a[5]=I_.y,a[6]=I_.z,a[7]=0,a[8]=P_.x,a[9]=P_.y,a[10]=P_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},$q[r]=i),i};bi.eastNorthUpToFixedFrame=bi.localFrameToFixedFrameGenerator("east","north");bi.northEastDownToFixedFrame=bi.localFrameToFixedFrameGenerator("north","east");bi.northUpEastToFixedFrame=bi.localFrameToFixedFrameGenerator("north","up");bi.northWestUpToFixedFrame=bi.localFrameToFixedFrameGenerator("north","west");var yze=new Le,Aze=new h(1,1,1),bze=new M;bi.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??bi.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,yze),s=M.fromTranslationQuaternionRotationScale(h.ZERO,o,Aze,bze);return r=i(e,n,r),M.multiply(r,s,r)};var xze=new M,Tze=new $;bi.headingPitchRollQuaternion=function(e,t,n,i,r){let o=bi.headingPitchRollToFixedFrame(e,t,n,i,xze),s=M.getMatrix3(o,Tze);return Le.fromRotationMatrix(s,r)};var Eze=new h(1,1,1),Cze=new h,Ile=new M,vze=new M,Sze=new $,wze=new Le;bi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??bi.eastNorthUpToFixedFrame,l(i)||(i=new Uc);let r=M.getTranslation(e,Cze);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=M.inverseTransformation(n(r,t,Ile),Ile),s=M.setScale(e,Eze,vze);s=M.setTranslation(s,h.ZERO,s),o=M.multiply(o,s,o);let a=Le.fromRotationMatrix(M.getMatrix3(o,Sze),wze);return a=Le.normalize(a,a),Uc.fromQuaternion(a,i)};var Ize=6*3600+2460+50.54841,Pze=8640184812866e-6,Dze=.093104,Rze=-62e-7,Oze=11772758384668e-32,Mze=72921158553e-15,Nze=P.TWO_PI/86400,YN=new K;bi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=bi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=bi.computeTemeToPseudoFixedMatrix(e,t)),n};bi.computeTemeToPseudoFixedMatrix=function(e,t){YN=K.addSeconds(e,-K.computeTaiMinusUtc(e),YN);let n=YN.dayNumber,i=YN.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=(Ize+r*(Pze+r*(Dze+r*Rze)))*Nze%P.TWO_PI,c=Mze+Oze*(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)};bi.iau2006XysData=new MN;bi.earthOrientationParameters=PN.NONE;var Qq=32.184,Lze=2451545;bi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Qq,i=e.stop.dayNumber,r=e.stop.secondsOfDay+Qq;return bi.iau2006XysData.preload(t,n,i,r)};bi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Fze=32.184,Bze=2451545,XN=new Uc,kze=new $,Uze=new K;bi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,Fze,Uze),i=K.totalDays(n)-Bze,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 XN.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),XN.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),XN.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(XN,kze,t)};bi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var zze=new RE(0,0,0),Vze=new _b(0,0,0,0,0,0),Jq=new $,Zq=new $;bi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=bi.earthOrientationParameters.compute(e,Vze);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+Qq,o=bi.iau2006XysData.computeXysRadians(i,r,zze);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=Jq;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,Jq),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,Jq),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-Lze+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 jze=new se;bi.pointToWindowCoordinates=function(e,t,n,i){return i=bi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};bi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=jze;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 Hze=new h,Gze=new h,Wze=new h;bi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,Hze),o=h.cross(t,r,Gze);h.equalsEpsilon(o,h.ZERO,P.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,Wze);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};bi.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 Ple=new he,eY=new h,qze=new h,Yze=new $,tY=new M,Dle=new M;bi.basisTo2D=function(e,t,n){let i=M.getTranslation(t,qze),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,eY);else{let f=r.cartesianToCartographic(i,Ple);o=e.project(f,eY),h.fromElements(o.z,o.x,o.y,o)}let s=bi.eastNorthUpToFixedFrame(i,r,tY),a=M.inverseTransformation(s,Dle),c=M.getMatrix3(t,Yze),u=M.multiplyByMatrix3(a,c,n);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,o,n),n};bi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=bi.eastNorthUpToFixedFrame(t,i,tY),o=M.inverseTransformation(r,Dle),s=i.cartesianToCartographic(t,Ple),a=e.project(s,eY);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,tY);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,o,n),M.multiply(c,n,n),n};var At=bi;var BE=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,Xze),a=M.multiplyByPointAsVector(s,h.UNIT_X,Kze);h.normalize(a,a);let c=M.multiplyByPointAsVector(s,h.UNIT_Y,$ze);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,Zze),f=h.negate(a,Jze),d=nY,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=Qze;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}};BE.packedLength=4;var Xze=new M,Kze=new h,$ze=new h,Jze=new h,Zze=new h,nY=new Array(5);for(let e=0;e<nY.length;++e)nY[e]=new h;var Qze=new he;BE.MAX_VALUE=Object.freeze(new BE(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ie=BE;var iY=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new Hi(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=iY;var $I=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)}};$I.MaximumLatitude=$I.mercatorAngleToGeodeticLatitude(Math.PI);var xi=$I;var rY=new he,oY=new he,Rle=new h,Ole=new h,sY=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,Rle),this._projection.unproject(Rle,rY),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Ole),this._projection.unproject(Ole,oY),this._rectangle=new ie(rY.longitude,rY.latitude,oY.longitude,oY.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)}},Mo=sY;var aY,Mle="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",kE={};kE.defaultAccessToken=Mle;kE.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});kE.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});kE.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});kE.getDefaultTokenCredit=function(e){if(e===Mle){if(!l(aY)){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>';aY=new It(t,!0)}return aY}};var Jf=kE;function cY(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=km(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)}cY.prototype.isReady=function(){return this._isReady};cY.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=km(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 KN=cY;function lY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}lY.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])};lY.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 Hm=lY;function UE(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(UE.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}}});UE.clone=function(e){if(l(e))return new UE(e._format,e._datatype,e._width,e._height,e._buffer)};UE.prototype.clone=function(){return UE.clone(this)};var $N=UE;var Nle=js(nf(),1);function eVe(){return!0}function tVe(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=eVe}var le=tVe;function Lle(){if(!l(Wa._canTransferArrayBuffer)){let e=dY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Wa._canTransferArrayBuffer=!1,Wa._canTransferArrayBuffer}Wa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),Wa._canTransferArrayBuffer=s}})}return Wa._canTransferArrayBuffer}var fY=new be;function uY(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 dY(e){let t=new Nle.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(yb(e))s=e;else if(!n){let a=Zt(`${Wa._workerModulePrefix}/${i}.js`);yb(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=uY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` - importScripts("${uY(CESIUM_WORKERS)}"); - CesiumWorkers["${i}"](); - `;return o=uY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${Wa._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 nVe(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 Wa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var iVe=(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),fY.raiseEvent(s),i(s)}else fY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},rVe=[];async function oVe(e,t,n){let i=await Promise.resolve(Lle());l(n)?i||(n.length=0):n=rVe;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",iVe(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function sVe(e,t,n){++e._activeTasks;try{let i=await oVe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Wa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=dY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return sVe(this,e,t)};Wa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=dY(this._workerPath),i=await nVe(this,e),r=await Promise.resolve(Lle()),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};Wa.prototype.isDestroyed=function(){return!1};Wa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),le(this)};Wa.taskCompletedEvent=fY;Wa._defaultWorkerModulePrefix="Workers/";Wa._workerModulePrefix=Wa._defaultWorkerModulePrefix;Wa._canTransferArrayBuffer=void 0;var Kn=Wa;function F0(){}F0._transcodeTaskProcessor=new Kn("transcodeKTX2",Number.POSITIVE_INFINITY);F0._readyPromise=void 0;function aVe(){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)||aVe(),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 $N(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 JN=F0;var Fle;Ble.setKTX2SupportedFormats=function(e,t,n,i,r,o){Fle={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Ble(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return JN.transcode(n,Fle)})}var of=Ble;function zE(){pe.throwInstantiationError()}Object.defineProperties(zE.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}});zE.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};zE.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};zE.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var cVe=/\.ktx2$/i;zE.loadImage=function(e,t){let n=De.createIfNeeded(t);return cVe.test(n.url)?of(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Zf=zE;function kle(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}kle.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 KN({missingImageUrl:Ule(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 lVe(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 Mo({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 uVe(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 fVe(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();lVe(i,t)}catch(i){uVe(e,i)}}function Gm(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}Gm.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Fm.SATELLITE:{n=t.token??Jf.defaultAccessToken,i=De.createIfNeeded(Jf.defaultWorldImageryServer),i.appendForwardSlash();let o=Jf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Fm.OCEANS:{n=t.token??Jf.defaultAccessToken,i=De.createIfNeeded(Jf.defaultWorldOceanServer),i.appendForwardSlash();let o=Jf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Fm.HILLSHADE:{n=t.token??Jf.defaultAccessToken,i=De.createIfNeeded(Jf.defaultWorldHillshadeServer),i.appendForwardSlash();let o=Jf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Gm.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function Ule(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 Hi?(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(Gm.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}}});Gm.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 Gm(t);i._resource=n;let r=new kle(t);return(t.usePreCachedTilesIfAvailable??!0)&&await fVe(n,r),r.build(i),i};Gm.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Gm.prototype.requestImage=function(e,t,n,i){return Zf.loadImage(this,Ule(this,e,t,n,i))};Gm.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 Hi)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 Hm;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})};Gm._metadataCache={};var D_=Gm;var VE={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};VE.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?VE.SUNLIGHT:VE.SCENE_LIGHT:VE.NONE};Object.freeze(VE);var R_=VE;function zle(){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=R_.NONE}zle.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 jE=zle;var dVe=Object.freeze([NaN,NaN,NaN,NaN]),cu=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,dVe,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,hVe),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,mVe),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],Vle)),n.y=U.magnitude(U.fromElements(t[2],t[3],Vle)),n}static getMaximumScale(t){return e.getScale(t,jle),U.maximumComponent(jle)}static setRotation(t,n,i){let r=e.getScale(t,pVe);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,gVe);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]})`}};cu.packedLength=4;cu.fromArray=cu.unpack;cu.IDENTITY=new cu(1,0,0,1);cu.ZERO=new cu(0,0,0,0);cu.COLUMN0ROW0=0;cu.COLUMN0ROW1=1;cu.COLUMN1ROW0=2;cu.COLUMN1ROW1=3;var hVe=new U,mVe=new U,Vle=new U,jle=new U,pVe=new U,gVe=new U,$i=cu;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;function hY(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 pY[0]=t,e.fromBytes(B0[0],B0[1],B0[2],B0[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=hY(f,u,t+1/3),a=hY(f,u,t),c=hY(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=_Ve.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=yVe.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=AVe.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=bVe.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 B0[0]=t,B0[1]=n,B0[2]=i,B0[3]=r,pY[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}},mY,pY,B0;dn.supportsTypedArrays()&&(mY=new ArrayBuffer(4),pY=new Uint32Array(mY),B0=new Uint8Array(mY));var _Ve=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,yVe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,AVe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,bVe=/^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 ZN(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}ZN.ALL=Object.freeze(new ZN({color:new z(0,0,0,0),depth:1,stencil:0}));ZN.prototype.execute=function(e,t){e.clear(this,t)};var di=ZN;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 No={_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(No,{maximumCombinedTextureImageUnits:{get:function(){return No._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return No._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return No._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return No._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return No._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return No._maximumTextureSize}},maximum3DTextureSize:{get:function(){return No._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return No._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return No._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return No._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return No._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return No._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return No._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return No._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return No._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return No._maximumViewportWidth}},maximumViewportHeight:{get:function(){return No._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return No._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return No._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return No._maximumColorAttachments}},maximumSamples:{get:function(){return No._maximumSamples}},highpFloatSupported:{get:function(){return No._highpFloatSupported}},highpIntSupported:{get:function(){return No._highpIntSupported}}});var Ut=No;function gY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function QN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function mh(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;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;QN(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;QN(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;QN(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;QN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(mh.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)}}});mh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};mh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};mh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};mh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};mh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};mh.prototype.getColorTexture=function(e){return this._colorTextures[e]};mh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};mh.prototype.isDestroyed=function(){return!1};mh.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),le(this)};var vs=mh;function HE(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})}HE.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};HE.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};HE.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)};HE.prototype.isDestroyed=function(){return!1};HE.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var eL=HE;var Cl={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===Cl.RGBA4||e===Cl.RGBA8||e===Cl.RGBA16F||e===Cl.RGBA32F||e===Cl.RGB5_A1||e===Cl.RGB565||e===Cl.DEPTH_COMPONENT16||e===Cl.STENCIL_INDEX8||e===Cl.DEPTH_STENCIL||e===Cl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Cl.RGBA32F:e===te.HALF_FLOAT_OES?Cl.RGBA16F:Cl.RGBA8}};Object.freeze(Cl);var lu=Cl;function JI(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumRenderbufferSize,r=e.format??lu.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(JI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});JI.prototype._getRenderbuffer=function(){return this._renderbuffer};JI.prototype.isDestroyed=function(){return!1};JI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var Qf=JI;var ZI={NEAREST:te.NEAREST,LINEAR:te.LINEAR};ZI.validate=function(e){return e===ZI.NEAREST||e===ZI.LINEAR};Object.freeze(ZI);var $n=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=$n.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:$n.NEAREST}));var Ht=eP;function xVe(){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=xVe;var tP={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===tP.DONT_CARE||e===tP.FASTEST||e===tP.NICEST}};Object.freeze(tP);var ph=tP;function ed(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??Jn(),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,qle(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)?TVe(this,n):Hle(this,n):l(n.framebuffer)?CVe(this,n):Gle(this,n),this._initialized=!0):Wle(this),g.bindTexture(this._textureTarget,null)}function TVe(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=tL(c),u=tL(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Hle(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=tL(g),m=tL(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function EVe(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 CVe(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 Gle(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 vVe(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 tL(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Wle(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)}ed.create=function(e){return new ed(e)};ed.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 ed({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(ed.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){qle(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 qle(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=$n.NEAREST),o.webgl2&&$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=$n.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)}ed.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)?Hle(this,i):Gle(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Wle(this)),this._initialized=!0),f||(l(i.arrayBufferView)?EVe(this,i.arrayBufferView,t,n,c,u):vVe(this,i,t,n)),s.bindTexture(a,null)};ed.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};ed.prototype.generateMipmap=function(e){e=e??ph.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)};ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};ed.defaultColor=z.WHITE;var Dt=ed;function sa(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(sa.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}}});sa.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])};sa.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=lu.getColorFormat(r);this._colorRenderbuffers[s]=new Qf({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 Qf({context:e,width:t,height:n,format:lu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Qf({context:e,width:t,height:n,format:lu.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 Qf({context:e,width:t,height:n,format:lu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new eL({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})}};sa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};sa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};sa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};sa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};sa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};sa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};sa.prototype.getDepthTexture=function(){return this._depthTexture};sa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};sa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};sa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};sa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};sa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};sa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};sa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};sa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};sa.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=sa;function Eb(){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(Eb.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 Yle(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 SVe(e,t){Yle(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 Xle(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 wVe(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 IVe(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 PVe(e,t){Xle(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(IVe(o,i),{framebuffer:n[o].framebuffer,uniformMap:wVe(e,o)});e._commands=r}Eb.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new di({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)};Eb.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,SVe(this,e),PVe(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};Eb.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)};Eb.prototype.isDestroyed=function(){return!1};Eb.prototype.destroy=function(){return Yle(this),Xle(this),le(this)};var nL=Eb;var Wm={X:0,Y:1,Z:2};Wm.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Wm.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Wm.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Wm.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Wm.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Wm.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Wm.fromName=function(e){return Wm[e]};Object.freeze(Wm);var Gi=Wm;var yY=js(nf(),1);var _Y,Kle="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",iL={};iL.defaultAccessToken=Kle;iL.defaultServer=new De({url:"https://api.cesium.com/"});iL.getDefaultTokenCredit=function(e){if(e===Kle){if(!l(_Y)){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>`;_Y=new It(t,!0)}return _Y}};var sf=iL;function zc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:DVe};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 yY.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)&&(zc.prototype=Object.create(De.prototype),zc.prototype.constructor=zc);zc.fromAssetId=function(e,t){let n=zc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new zc(i,n)})};Object.defineProperties(zc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=zc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});zc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=sf.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};zc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(zc.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};zc.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)};zc.prototype._makeRequest=function(e){return this._isExternal||new yY.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=AY(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};zc._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??sf.defaultServer,i=t.accessToken??sf.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=AY(r.headers),n.getDerivedResource(r)};function AY(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}zc._addClientHeaders=AY;function DVe(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=zc;var $le=/{[^}]+}/g,Jle={x:NVe,y:FVe,z:UVe,s:zVe,reverseX:LVe,reverseY:BVe,reverseZ:kVe,westDegrees:VVe,southDegrees:jVe,eastDegrees:HVe,northDegrees:GVe,westProjected:WVe,southProjected:qVe,eastProjected:YVe,northProjected:XVe,width:KVe,height:$Ve},RVe=Ot(Jle,{i:JVe,j:ZVe,reverseI:QVe,reverseJ:e4e,longitudeDegrees:n4e,latitudeDegrees:i4e,longitudeProjected:r4e,latitudeProjected:o4e,format:a4e});function nP(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 Mo({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(Jle,o),a=Ot(RVe,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(nP.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}}});nP.prototype.getTileCredits=function(e,t,n){};nP.prototype.requestImage=function(e,t,n,i){return Zf.loadImage(this,OVe(this,e,t,n,i))};nP.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=MVe(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 rL=!1,af=new ie,oL=!1,iP=new ie;function OVe(e,t,n,i,r){rL=!1,oL=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match($le);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 bY=!1,WE=new U,xY=!1;function MVe(e,t,n,i,r,o,s){rL=!1,oL=!1,bY=!1,xY=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match($le);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 qE(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 NVe(e,t,n,i){return qE(e,"{x}",t)}function LVe(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return qE(e,"{reverseX}",r)}function FVe(e,t,n,i){return qE(e,"{y}",n)}function BVe(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return qE(e,"{reverseY}",r)}function kVe(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return qE(e,"{reverseZ}",o)}function UVe(e,t,n,i){return qE(e,"{z}",i)}function zVe(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function sL(e,t,n,i){rL||(e.tilingScheme.tileXYToRectangle(t,n,i,af),af.west=P.toDegrees(af.west),af.south=P.toDegrees(af.south),af.east=P.toDegrees(af.east),af.north=P.toDegrees(af.north),rL=!0)}function VVe(e,t,n,i){return sL(e,t,n,i),af.west}function jVe(e,t,n,i){return sL(e,t,n,i),af.south}function HVe(e,t,n,i){return sL(e,t,n,i),af.east}function GVe(e,t,n,i){return sL(e,t,n,i),af.north}function aL(e,t,n,i){oL||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,iP),oL=!0)}function WVe(e,t,n,i){return aL(e,t,n,i),iP.west}function qVe(e,t,n,i){return aL(e,t,n,i),iP.south}function YVe(e,t,n,i){return aL(e,t,n,i),iP.east}function XVe(e,t,n,i){return aL(e,t,n,i),iP.north}function KVe(e,t,n,i){return e.tileWidth}function $Ve(e,t,n,i){return e.tileHeight}function JVe(e,t,n,i,r,o,s){return cL(e,t,n,i,r,o),WE.x}function ZVe(e,t,n,i,r,o,s){return cL(e,t,n,i,r,o),WE.y}function QVe(e,t,n,i,r,o,s){return cL(e,t,n,i,r,o),e.tileWidth-WE.x-1}function e4e(e,t,n,i,r,o,s){return cL(e,t,n,i,r,o),e.tileHeight-WE.y-1}var t4e=new ie,GE=new h;function cL(e,t,n,i,r,o,s){if(bY)return;TY(e,t,n,i,r,o);let a=GE,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,t4e);WE.x=e.tileWidth*(a.x-c.west)/c.width|0,WE.y=e.tileHeight*(c.north-a.y)/c.height|0,bY=!0}function n4e(e,t,n,i,r,o,s){return P.toDegrees(r)}function i4e(e,t,n,i,r,o,s){return P.toDegrees(o)}function r4e(e,t,n,i,r,o,s){return TY(e,t,n,i,r,o),GE.x}function o4e(e,t,n,i,r,o,s){return TY(e,t,n,i,r,o),GE.y}var s4e=new he;function TY(e,t,n,i,r,o,s){if(!xY){if(e.tilingScheme.projection instanceof Hi)GE.x=P.toDegrees(r),GE.y=P.toDegrees(o);else{let a=s4e;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,GE)}xY=!0}}function a4e(e,t,n,i,r,o,s){return s}var Ss=nP;var c4e=/\/$/;function YE(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();c4e.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 Ss({...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(YE.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}}});YE.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};YE.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])};YE.prototype.pickFeatures=function(e,t,n,i,r){};YE.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(l4e(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 l4e(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 lL=YE;var Zle={};function rP(e,t){l(Zle[e])||(Zle[e]=!0,console.warn(t??e))}rP.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.";rP.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";rP.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";rP.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=rP;function u4e(e,t){yt(e,t)}var Yr=u4e;function O_(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),O_.decode(e)}O_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};O_.decodeWithFromCharCode=function(e){let t="",n=f4e(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 oP(e,t,n){return t<=e&&e<=n}function f4e(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(oP(u,0,127)){s.push(u);continue}if(oP(u,194,223)){i=1,t=u&31;continue}if(oP(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(oP(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!oP(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"?O_.decode=O_.decodeWithTextDecoder:O_.decode=O_.decodeWithFromCharCode;var cf=O_;function d4e(e,t,n){return JSON.parse(cf(e,t,n))}var Lo=d4e;var XE={};XE._deprecationWarning=Yr;var U0=Uint32Array.BYTES_PER_ELEMENT;XE.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=U0;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+=U0;let s=r.getUint32(t,!0);t+=U0;let a=r.getUint32(t,!0);t+=U0;let c=r.getUint32(t,!0);t+=U0;let u=r.getUint32(t,!0);t+=U0;let f=r.getUint32(t,!0);t+=U0;let d;u>=570425344?(t-=U0*2,d=a,u=c,f=0,a=0,c=0,XE._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-=U0,d=u,u=a,f=c,a=0,c=0,XE._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):(XE._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 uL=XE;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;function z0(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=h4e(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=m4e(t,o),a=p4e(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(z0.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function h4e(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 eue(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function m4e(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 p4e(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 sP=new se;function g4e(e,t,n){let i=se.unpack(e,t,sP),r=se.unpackFloat(i);i=se.unpack(e,t+4,sP);let o=se.unpackFloat(i);i=se.unpack(e,t+8,sP);let s=se.unpackFloat(i);i=se.unpack(e,t+12,sP);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function _4e(e,t,n){let i=se.packFloat(e.x,sP);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 Qle=new se;z0.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=g4e(this._batchValues,s,Qle):a=se.unpack(this._batchValues,s,Qle);let c=eue(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var y4e=[void 0,void 0,new U,new h,new se],A4e=new se;z0.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=y4e[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=eue(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=A4e;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?_4e(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function b4e(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 x4e(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}z0.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||b4e(this,e.context),x4e(this))};z0.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 T4e(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float numberOfAttributes = float(${t}); - return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); -} -`:`uniform vec4 batchTextureStep; -uniform vec2 batchTextureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = batchTextureStep.x; - float centerX = batchTextureStep.y; - float stepY = batchTextureStep.z; - float centerY = batchTextureStep.w; - float numberOfAttributes = float(${t}); - float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); - float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}function E4e(e){return e===1?"float":`vec${e}`}function C4e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function v4e(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=E4e(r),a=C4e(r),c=e._offsets[t],u=`${s} ${o}(float batchId) -{ - vec2 st = computeSt(batchId); - 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===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}z0.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${T4e(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=v4e(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} -${t} -${s}`}};z0.prototype.isDestroyed=function(){return!1};z0.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var KE=z0;var S4e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},w4e={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:$i,MAT3:$,MAT4:M};function I4e(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=S4e[e.type],r=w4e[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var gh=I4e;var qa={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};qa.isLines=function(e){return e===qa.LINES||e===qa.LINE_LOOP||e===qa.LINE_STRIP};qa.isTriangles=function(e){return e===qa.TRIANGLES||e===qa.TRIANGLE_STRIP||e===qa.TRIANGLE_FAN};qa.validate=function(e){return e===qa.POINTS||e===qa.LINES||e===qa.LINE_LOOP||e===qa.LINE_STRIP||e===qa.TRIANGLES||e===qa.TRIANGLE_STRIP||e===qa.TRIANGLE_FAN};Object.freeze(qa);var Oe=qa;var Go={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},EY=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 Vc(this,Go.CULL)}set cull(t){Vc(this,Go.CULL)!==t&&(M_(this,Go.CULL,t),this.dirty=!0)}get occlude(){return Vc(this,Go.OCCLUDE)}set occlude(t){Vc(this,Go.OCCLUDE)!==t&&(M_(this,Go.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 Vc(this,Go.CAST_SHADOWS)}set castShadows(t){Vc(this,Go.CAST_SHADOWS)!==t&&(M_(this,Go.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Vc(this,Go.RECEIVE_SHADOWS)}set receiveShadows(t){Vc(this,Go.RECEIVE_SHADOWS)!==t&&(M_(this,Go.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 Vc(this,Go.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Vc(this,Go.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(M_(this,Go.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 Vc(this,Go.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Vc(this,Go.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(M_(this,Go.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 Vc(this,Go.PICK_ONLY)}set pickOnly(t){Vc(this,Go.PICK_ONLY)!==t&&(M_(this,Go.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Vc(this,Go.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Vc(this,Go.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(M_(this,Go.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 Vc(e,t){return(e._flags&t)===t}function M_(e,t,n){n?e._flags|=t:e._flags&=~t}var at=EY;var tue={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(tue);var Ie=tue;var nue={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(nue);var $t=nue;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 iue=new Hi,P4e=new he,D4e=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;iue._ellipsoid=ee.default,t=t??iue;let i=t.project(ie.southwest(e,P4e)),r=t.project(ie.northeast(e,D4e));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 aP={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};aP.validate=function(e){return e===aP.CLOCKWISE||e===aP.COUNTER_CLOCKWISE};Object.freeze(aP);var aa=aP;function rue(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]=rue(e[t]));return Object.freeze(e)}var oue=rue;function Ym(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??aa.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 R4e=0,qm={};Ym.fromCache=function(e){let t=JSON.stringify(e),n=qm[t];if(l(n))return++n.referenceCount,n.state;let i=new Ym(e),r=JSON.stringify(i);return n=qm[r],l(n)||(i.id=R4e++,n={referenceCount:0,state:i},qm[r]=n),++n.referenceCount,qm[t]={referenceCount:1,state:n.state},n.state};Ym.removeFromCache=function(e){let t=new Ym(e),n=JSON.stringify(t),i=qm[n],r=JSON.stringify(e),o=qm[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete qm[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete qm[n]};Ym.getCache=function(){return qm};Ym.clearCache=function(){qm={}};function Cb(e,t,n){n?e.enable(t):e.disable(t)}function sue(e,t){e.frontFace(t.frontFace)}function aue(e,t){let n=t.cull,i=n.enabled;Cb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function cue(e,t){e.lineWidth(t.lineWidth)}function lue(e,t){let n=t.polygonOffset,i=n.enabled;Cb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function uue(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Cb(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 fue(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function due(e,t){let n=t.depthTest,i=n.enabled;Cb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function hue(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function mue(e,t){e.depthMask(t.depthMask)}function pue(e,t){e.stencilMask(t.stencilMask)}function O4e(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function gue(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Cb(e,e.BLEND,r),r&&(O4e(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function _ue(e,t){let n=t.stencilTest,i=n.enabled;if(Cb(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 yue(e,t){let n=t.sampleCoverage,i=n.enabled;Cb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var M4e=new et;function Aue(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=M4e,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)}Ym.apply=function(e,t,n){sue(e,t),aue(e,t),cue(e,t),lue(e,t),fue(e,t),due(e,t),hue(e,t),mue(e,t),pue(e,t),_ue(e,t),yue(e,t),uue(e,t,n),gue(e,t,n),Aue(e,t,n)};function N4e(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(sue),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(aue),e.lineWidth!==t.lineWidth&&n.push(cue),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(lue),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(fue),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(due),(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(hue),e.depthMask!==t.depthMask&&n.push(mue),e.stencilMask!==t.stencilMask&&n.push(pue),(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(_ue),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(yue),n}Ym.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=N4e(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)&&uue(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)&&gue(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Aue(e,n,r)};Ym.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=Ym;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 eF=`struct czm_material -{ -vec3 diffuse; -float specular; -float shininess; -vec3 normal; -vec3 emission; -float alpha; -}; -`;var tF=`struct czm_materialInput +(${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,DE=new h,HI=new h,yUe=new h,AUe=new h,Iq=new h,jce=new h,bUe=new h,xUe=new h,TUe=new $,EUe=new $,CUe=new se,vUe=new se(0,0,0,1),SUe=new uo,M=uo;var S_,ss={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},ou={};Object.defineProperties(ou,{element:{get:function(){if(ou.supportsFullscreen())return document[ss.fullscreenElement]}},changeEventName:{get:function(){if(ou.supportsFullscreen())return ss.fullscreenchange}},errorEventName:{get:function(){if(ou.supportsFullscreen())return ss.fullscreenerror}},enabled:{get:function(){if(ou.supportsFullscreen())return document[ss.fullscreenEnabled]}},fullscreen:{get:function(){if(ou.supportsFullscreen())return ou.element!==null}}});ou.supportsFullscreen=function(){if(l(S_))return S_;S_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ss.requestFullscreen="requestFullscreen",ss.exitFullscreen="exitFullscreen",ss.fullscreenEnabled="fullscreenEnabled",ss.fullscreenElement="fullscreenElement",ss.fullscreenchange="fullscreenchange",ss.fullscreenerror="fullscreenerror",S_=!0,S_;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"?(ss.requestFullscreen=n,S_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ss.requestFullscreen=n,S_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ss.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ss.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ss.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ss.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ss.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ss.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ss.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ss.fullscreenerror=n)}return S_};ou.requestFullscreen=function(e,t){ou.supportsFullscreen()&&e[ss.requestFullscreen]({vrDisplay:t})};ou.exitFullscreen=function(){ou.supportsFullscreen()&&document[ss.exitFullscreen]()};ou._names=ss;var as=ou;var Kf;typeof navigator<"u"?Kf=navigator:Kf={};function GI(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var NN,Hce;function Mq(){if(!l(NN)&&(NN=!1,!zN())){let e=/ Chrome\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(NN=!0,Hce=GI(e[1]))}return NN}function wUe(){return Mq()&&Hce}var LN,Gce;function Wce(){if(!l(LN)&&(LN=!1,!Mq()&&!zN()&&/ Safari\/[\.0-9]+/.test(Kf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(LN=!0,Gce=GI(e[1]))}return LN}function IUe(){return Wce()&&Gce}var FN,Oq;function qce(){if(!l(FN)){FN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Kf.userAgent);e!==null&&(FN=!0,Oq=GI(e[1]),Oq.isNightly=!!e[2])}return FN}function PUe(){return qce()&&Oq}var BN,Yce;function zN(){if(!l(BN)){BN=!1;let e=/ Edg\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(BN=!0,Yce=GI(e[1]))}return BN}function DUe(){return zN()&&Yce}var kN,Nq;function VN(){if(!l(kN)){kN=!1;let e=/Firefox\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(kN=!0,Nq=GI(e[1]))}return kN}var Pq;function RUe(){return l(Pq)||(Pq=/Windows/i.test(Kf.appVersion)),Pq}var Dq;function OUe(){return l(Dq)||(Dq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Dq}function MUe(){return VN()&&Nq}var Rq;function NUe(){return l(Rq)||(Rq=!VN()&&typeof PointerEvent<"u"&&(!l(Kf.pointerEnabled)||Kf.pointerEnabled)),Rq}var Xce,UN;function Kce(){if(!l(UN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;UN=l(t)&&t!=="",UN&&(Xce=t)}return UN}function LUe(){return Kce()?Xce:void 0}function Cl(){return Cl._result}Cl._promise=void 0;Cl._result=void 0;Cl.initialize=function(){return l(Cl._promise)||(Cl._promise=new Promise(e=>{let t=new Image;t.onload=function(){Cl._result=t.width>0&&t.height>0,e(Cl._result)},t.onerror=function(){Cl._result=!1,e(Cl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Cl._promise};Object.defineProperties(Cl,{initialized:{get:function(){return l(Cl._result)}}});var RE=[];typeof ArrayBuffer<"u"&&(RE.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&RE.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&RE.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&RE.push(BigInt64Array),typeof BigUint64Array<"u"&&RE.push(BigUint64Array));var $f={isChrome:Mq,chromeVersion:wUe,isSafari:Wce,safariVersion:IUe,isWebkit:qce,webkitVersion:PUe,isEdge:zN,edgeVersion:DUe,isFirefox:VN,firefoxVersion:MUe,isWindows:RUe,isIPadOrIOS:OUe,hardwareConcurrency:Kf.hardwareConcurrency??3,supportsPointerEvents:NUe,supportsImageRenderingPixelated:Kce,supportsWebP:Cl,imageRenderingValue:LUe,typedArrayTypes:RE};$f.supportsBasis=function(e){return $f.supportsWebAssembly()&&e.context.supportsBasis};$f.supportsFullscreen=function(){return as.supportsFullscreen()};$f.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};$f.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};$f.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};$f.supportsBigInt=function(){return typeof BigInt<"u"};$f.supportsWebWorkers=function(){return typeof Worker<"u"};$f.supportsWebAssembly=function(){return typeof WebAssembly<"u"};$f.supportsWebgl2=function(e){return e.context.webgl2};$f.supportsEsmWebWorkers=function(){return!VN()||parseInt(Nq)>=114};var dn=$f;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var WI=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);WI=h.normalize(e,WI);let o=WI.x*r,s=WI.y*r,a=WI.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 FUe=[1,2,0],BUe=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=FUe,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=BUe;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 $ce=new dt,Jce=new dt,Lq=new dt,Zce=new dt;dt.fromHeadingPitchRoll=function(e,t){return Zce=dt.fromAxisAngle(h.UNIT_X,e.roll,$ce),Lq=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(Lq,Zce,Lq),Jce=dt.fromAxisAngle(h.UNIT_Z,-e.heading,$ce),dt.multiply(Jce,t,t)};var jN=new h,Fq=new h,dh=new dt,Qce=new dt,HN=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,HN),dt.conjugate(HN,HN);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,HN,dh),dh.w<0&&dt.negate(dh,dh),dt.computeAxis(dh,jN);let a=dt.computeAngle(dh);l(i)||(i=[]),i[s]=jN.x*a,i[s+1]=jN.y*a,i[s+2]=jN.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,Fq);let o=h.magnitude(Fq);return dt.unpack(t,i*4,Qce),o===0?dt.clone(dt.IDENTITY,dh):dt.fromAxisAngle(Fq,o,dh),dt.multiply(dh,Qce,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 Bq=new dt;dt.lerp=function(e,t,n,i){return Bq=dt.multiplyByScalar(t,n,Bq),i=dt.multiplyByScalar(e,1-n,i),dt.add(Bq,i,i)};var ele=new dt,kq=new dt,Uq=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=ele=dt.negate(t,ele)),1-r<P.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return kq=dt.multiplyByScalar(e,Math.sin((1-n)*s),kq),Uq=dt.multiplyByScalar(o,Math.sin(n*s),Uq),i=dt.add(kq,Uq,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 kUe=new h,UUe=new h,qI=new dt,OE=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,qI);dt.multiply(r,n,OE);let o=dt.log(OE,kUe);dt.multiply(r,e,OE);let s=dt.log(OE,UUe);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,qI),dt.multiply(t,qI,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,qI),a=dt.slerp(n,i,r,OE);return dt.slerp(s,a,2*r*(1-r),o)};var zUe=new dt,tle=1.9011074535173003,GN=dn.supportsTypedArrays()?new Float32Array(8):[],WN=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;GN[e]=1/(t*n),WN[e]=t/n}GN[7]=tle/136;WN[7]=tle*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]=(GN[g]*c-WN[g])*s,N0[g]=(GN[g]*u-WN[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,zUe);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,qI),a=dt.fastSlerp(n,i,r,OE);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 bi={},zq={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"}},ME={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Vq={},su={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},w_=new h,I_=new h,P_=new h;bi.localFrameToFixedFrameGenerator=function(e,t){if(!zq.hasOwnProperty(e)||!zq[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=zq[e][t],i,r=e+t;return l(Vq[r])?i=Vq[r]:(i=function(o,s,a){if(l(a)||(a=new M),h.equalsEpsilon(o,h.ZERO,P.EPSILON14))h.unpack(ME[e],0,w_),h.unpack(ME[t],0,I_),h.unpack(ME[n],0,P_);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);h.unpack(ME[e],0,w_),e!=="east"&&e!=="west"&&h.multiplyByScalar(w_,c,w_),h.unpack(ME[t],0,I_),t!=="east"&&t!=="west"&&h.multiplyByScalar(I_,c,I_),h.unpack(ME[n],0,P_),n!=="east"&&n!=="west"&&h.multiplyByScalar(P_,c,P_)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,su.up);let c=su.up,u=su.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,su.east),h.cross(c,u,su.north),h.multiplyByScalar(su.up,-1,su.down),h.multiplyByScalar(su.east,-1,su.west),h.multiplyByScalar(su.north,-1,su.south),w_=su[e],I_=su[t],P_=su[n]}return a[0]=w_.x,a[1]=w_.y,a[2]=w_.z,a[3]=0,a[4]=I_.x,a[5]=I_.y,a[6]=I_.z,a[7]=0,a[8]=P_.x,a[9]=P_.y,a[10]=P_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},Vq[r]=i),i};bi.eastNorthUpToFixedFrame=bi.localFrameToFixedFrameGenerator("east","north");bi.northEastDownToFixedFrame=bi.localFrameToFixedFrameGenerator("north","east");bi.northUpEastToFixedFrame=bi.localFrameToFixedFrameGenerator("north","up");bi.northWestUpToFixedFrame=bi.localFrameToFixedFrameGenerator("north","west");var VUe=new Le,jUe=new h(1,1,1),HUe=new M;bi.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??bi.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,VUe),s=M.fromTranslationQuaternionRotationScale(h.ZERO,o,jUe,HUe);return r=i(e,n,r),M.multiply(r,s,r)};var GUe=new M,WUe=new $;bi.headingPitchRollQuaternion=function(e,t,n,i,r){let o=bi.headingPitchRollToFixedFrame(e,t,n,i,GUe),s=M.getMatrix3(o,WUe);return Le.fromRotationMatrix(s,r)};var qUe=new h(1,1,1),YUe=new h,nle=new M,XUe=new M,KUe=new $,$Ue=new Le;bi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??bi.eastNorthUpToFixedFrame,l(i)||(i=new Bc);let r=M.getTranslation(e,YUe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=M.inverseTransformation(n(r,t,nle),nle),s=M.setScale(e,qUe,XUe);s=M.setTranslation(s,h.ZERO,s),o=M.multiply(o,s,o);let a=Le.fromRotationMatrix(M.getMatrix3(o,KUe),$Ue);return a=Le.normalize(a,a),Bc.fromQuaternion(a,i)};var JUe=6*3600+2460+50.54841,ZUe=8640184812866e-6,QUe=.093104,eze=-62e-7,tze=11772758384668e-32,nze=72921158553e-15,ize=P.TWO_PI/86400,qN=new K;bi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=bi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=bi.computeTemeToPseudoFixedMatrix(e,t)),n};bi.computeTemeToPseudoFixedMatrix=function(e,t){qN=K.addSeconds(e,-K.computeTaiMinusUtc(e),qN);let n=qN.dayNumber,i=qN.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=(JUe+r*(ZUe+r*(QUe+r*eze)))*ize%P.TWO_PI,c=nze+tze*(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)};bi.iau2006XysData=new ON;bi.earthOrientationParameters=IN.NONE;var Gq=32.184,rze=2451545;bi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Gq,i=e.stop.dayNumber,r=e.stop.secondsOfDay+Gq;return bi.iau2006XysData.preload(t,n,i,r)};bi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var oze=32.184,sze=2451545,YN=new Bc,aze=new $,cze=new K;bi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,oze,cze),i=K.totalDays(n)-sze,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 YN.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),YN.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),YN.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(YN,aze,t)};bi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var lze=new IE(0,0,0),uze=new pb(0,0,0,0,0,0),jq=new $,Hq=new $;bi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=bi.earthOrientationParameters.compute(e,uze);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+Gq,o=bi.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=jq;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,Hq),d=$.multiply(u,f,jq),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,Hq),x=$.multiply(d,b,jq),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-rze+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),_=Hq;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 fze=new se;bi.pointToWindowCoordinates=function(e,t,n,i){return i=bi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};bi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=fze;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 dze=new h,hze=new h,mze=new h;bi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,dze),o=h.cross(t,r,hze);h.equalsEpsilon(o,h.ZERO,P.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,mze);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};bi.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 ile=new he,Wq=new h,pze=new h,gze=new $,qq=new M,rle=new M;bi.basisTo2D=function(e,t,n){let i=M.getTranslation(t,pze),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,Wq);else{let f=r.cartesianToCartographic(i,ile);o=e.project(f,Wq),h.fromElements(o.z,o.x,o.y,o)}let s=bi.eastNorthUpToFixedFrame(i,r,qq),a=M.inverseTransformation(s,rle),c=M.getMatrix3(t,gze),u=M.multiplyByMatrix3(a,c,n);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,o,n),n};bi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=bi.eastNorthUpToFixedFrame(t,i,qq),o=M.inverseTransformation(r,rle),s=i.cartesianToCartographic(t,ile),a=e.project(s,Wq);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,qq);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,o,n),M.multiply(c,n,n),n};var At=bi;var NE=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,_ze),a=M.multiplyByPointAsVector(s,h.UNIT_X,yze);h.normalize(a,a);let c=M.multiplyByPointAsVector(s,h.UNIT_Y,Aze);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,xze),f=h.negate(a,bze),d=Yq,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=Tze;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}};NE.packedLength=4;var _ze=new M,yze=new h,Aze=new h,bze=new h,xze=new h,Yq=new Array(5);for(let e=0;e<Yq.length;++e)Yq[e]=new h;var Tze=new he;NE.MAX_VALUE=Object.freeze(new NE(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ie=NE;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 ole=new ji,Eze=new he,Cze=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;ole._ellipsoid=ee.default,t=t??ole;let i=t.project(ie.southwest(e,Eze)),r=t.project(ie.northeast(e,Cze));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;function Xq(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 $q[0]=t,e.fromBytes(L0[0],L0[1],L0[2],L0[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=Xq(f,u,t+1/3),a=Xq(f,u,t),c=Xq(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=vze.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=Sze.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=wze.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=Ize.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 L0[0]=t,L0[1]=n,L0[2]=i,L0[3]=r,$q[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}},Kq,$q,L0;dn.supportsTypedArrays()&&(Kq=new ArrayBuffer(4),$q=new Uint32Array(Kq),L0=new Uint8Array(Kq));var vze=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,Sze=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,wze=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,Ize=/^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 Pze(){return!0}function Dze(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=Pze}var le=Dze;function nf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(nf.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}}});nf.packedLength=2;nf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};nf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new nf),n.near=e[t++],n.far=e[t],n};nf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};nf.clone=function(e,t){if(l(e))return l(t)||(t=new nf),t.near=e.near,t.far=e.far,t};nf.prototype.clone=function(e){return nf.clone(this,e)};nf.prototype.equals=function(e){return nf.equals(this,e)};var Ht=nf;function Jf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Jf.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 Jf(e.near,e.nearValue,e.far,e.farValue)};Jf.packedLength=4;Jf.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};Jf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Jf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Jf.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};Jf.prototype.clone=function(e){return Jf.clone(this,e)};Jf.prototype.equals=function(e){return Jf.equals(this,e)};var qt=Jf;var D_={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(D_);var We=D_;function ls(e){return e===D_.CLAMP_TO_GROUND||e===D_.CLAMP_TO_3D_TILE||e===D_.CLAMP_TO_TERRAIN}function R_(e){return e===D_.RELATIVE_TO_GROUND||e===D_.RELATIVE_TO_3D_TILE||e===D_.RELATIVE_TO_TERRAIN}var sle={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(sle);var Hi=sle;var ale={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(ale);var Wn=ale;var Rze=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=Rze;function hh(){pe.throwInstantiationError()}Object.defineProperties(hh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});hh.prototype.getValue=pe.throwInstantiationError;hh.prototype.equals=pe.throwInstantiationError;hh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};hh.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(!hh.equals(e[i],t[i]))return!1;return!0};hh.isConstant=function(e){return!l(e)||e.isConstant};hh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};hh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};hh.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=hh;var YI={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};YI.getMorphTime=function(e){return e===YI.SCENE3D?1:e===YI.MORPHING?void 0:0};Object.freeze(YI);var re=YI;var Oze=500;function Mze(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>Oze&&(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 jm=Mze;var Nze=new he;function Lze(e,t,n,i,r){let o=i.cartesianToCartographic(e,Nze);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):ls(n)?o.height=t:R_(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var O_=Lze;var cle={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(cle);var Ho=cle;var Fze=z.WHITE,Bze=h.ZERO,kze=We.NONE,Uze=U.ZERO,zze=1,Vze=0,jze=h.ZERO,Hze=Hi.CENTER,Gze=Wn.CENTER,Wze=!1,qze=Ho.NONE,Yze=new h,Xze=new z,Kze=new h,$ze=new U,Jze=new qt,Zze=new qt,Qze=new qt,eVe=new et,tVe=new Ht;function lle(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function M_(e,t){t.collectionChanged.addEventListener(M_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}M_.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,Yze),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){Jq(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,Fze,Xze),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,Bze,Kze),u.heightReference=X.getValueOrDefault(a._heightReference,e,kze),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,Uze,$ze),u.scale=X.getValueOrDefault(a._scale,e,zze),u.rotation=X.getValueOrDefault(a._rotation,e,Vze),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,jze),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,Hze),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,Gze),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,Jze),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Zze),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Qze),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,Wze),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,tVe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,qze),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,eVe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};M_.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=jm(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=O_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};M_.prototype.isDestroyed=function(){return!1};M_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(M_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};M_.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 lle(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 lle(o)):(Jq(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Jq(s.get(o.id),o,a),s.remove(o.id)};function Jq(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var XN=M_;function nVe(e,t){this.start=e??0,this.stop=t??0}var Gs=nVe;var KN=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],rY),r=h.clone(i,Zq),o=h.clone(i,Qq),s=h.clone(i,eY),a=h.clone(i,tY),c=h.clone(i,nY),u=h.clone(i,iY),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,Ga)),g=h.magnitudeSquared(h.subtract(c,o,Ga)),m=h.magnitudeSquared(h.subtract(u,s,Ga)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=oY;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,Ga)),E=Math.sqrt(T),v=sY;v.x=r.x,v.y=o.y,v.z=s.z;let S=aY;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,cY),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,Ga));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,Ga));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;ule._ellipsoid=ee.default,n=n??ule,ie.southwest(t,lY),lY.height=i,ie.northeast(t,uY),uY.height=r;let s=n.project(lY,rVe),a=n.project(uY,oVe),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,sVe);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=rY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,Zq),a=h.clone(o,Qq),c=h.clone(o,eY),u=h.clone(o,tY),f=h.clone(o,nY),d=h.clone(o,iY),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,Ga)),y=h.magnitudeSquared(h.subtract(f,a,Ga)),A=h.magnitudeSquared(h.subtract(d,c,Ga)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=oY;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,Ga)),S=Math.sqrt(v),I=sY;I.x=s.x,I.y=a.y,I.z=c.z;let R=aY;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,cY),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,Ga));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,Ga));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=rY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,Zq),s=h.clone(r,Qq),a=h.clone(r,eY),c=h.clone(r,tY),u=h.clone(r,nY),f=h.clone(r,iY),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,Ga)),m=h.magnitudeSquared(h.subtract(u,s,Ga)),y=h.magnitudeSquared(h.subtract(f,a,Ga)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=oY;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,Ga)),v=Math.sqrt(E),S=sY;S.x=o.x,S.y=s.y,S.z=a.z;let I=aY;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,cY),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,Ga));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,Ga));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,aVe),o=$.getColumn(i,1,cVe),s=$.getColumn(i,2,lVe);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,uVe),r=M.getScale(t,fVe),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,dVe),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,hVe);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,mVe));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,pVe),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,gVe),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){dle._ellipsoid=ee.default,n=n??dle;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,fle):a=r.geodeticSurfaceNormal(o,fle);let c=h.cross(h.UNIT_Z,a,_Ve);h.normalize(c,c);let u=h.cross(a,c,yVe);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,bVe),d=h.negate(c,AVe),p=hle,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,xVe);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 iVe*t*t*t}};KN.packedLength=4;var Zq=new h,Qq=new h,eY=new h,tY=new h,nY=new h,iY=new h,rY=new h,Ga=new h,oY=new h,sY=new h,aY=new h,cY=new h,iVe=4/3*P.PI,ule=new ji,rVe=new h,oVe=new h,lY=new he,uY=new he,sVe=[],aVe=new h,cVe=new h,lVe=new h,uVe=new h,fVe=new h,dVe=new h,hVe=new h,mVe=new h,pVe=new h,gVe=new h,fle=new h,_Ve=new h,yVe=new h,AVe=new h,bVe=new h,xVe=new he,hle=new Array(8);for(let e=0;e<8;++e)hle[e]=new h;var dle=new ji,ue=KN;var mle={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(mle);var te=mle;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 ple={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(ple);var mh=ple;var TVe=Object.freeze([NaN,NaN,NaN,NaN]),au=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,EVe),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,CVe),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],gle)),n.y=U.magnitude(U.fromElements(t[2],t[3],gle)),n}static getMaximumScale(t){return e.getScale(t,_le),U.maximumComponent(_le)}static setRotation(t,n,i){let r=e.getScale(t,vVe);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,SVe);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]})`}};au.packedLength=4;au.fromArray=au.unpack;au.IDENTITY=new au(1,0,0,1);au.ZERO=new au(0,0,0,0);au.COLUMN0ROW0=0;au.COLUMN0ROW1=1;au.COLUMN1ROW0=2;au.COLUMN1ROW1=3;var EVe=new U,CVe=new U,gle=new U,_le=new U,vVe=new U,SVe=new U,$i=au;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;function fY(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}fY.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 wVe=new he,IVe=new h,yle=new M,PVe=[new he,new he,new he],DVe=[new U,new U,new U],RVe=[new U,new U,new U],OVe=new h,MVe=new Le,NVe=new M,LVe=new $i;fY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,wVe),s=he.toCartesian(o,n,IVe),a=At.eastNorthUpToFixedFrame(s,n,yle),c=M.inverse(a,yle),u=DVe,f=PVe;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=OVe;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,MVe),g=$.fromQuaternion(p,NVe),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,LVe),E=RVe;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=fY;function FVe(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=FVe;function BVe(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=BVe;var Ale={NONE:0,TOP:1,ALL:2};Object.freeze(Ale);var pn=Ale;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 kVe=new h;function rf(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"}rf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new rf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};rf.fromAxisAlignedBoundingBox=function(e){return new rf({minimum:e.minimum,maximum:e.maximum})};rf.packedLength=2*h.packedLength+Be.packedLength+1;rf.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 xle=new h,Tle=new h,Ele=new Be,ble={minimum:xle,maximum:Tle,vertexFormat:Ele,offsetAttribute:void 0};rf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,xle),r=h.unpack(e,t+h.packedLength,Tle),o=Be.unpack(e,t+2*h.packedLength,Ele),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):(ble.offsetAttribute=s===-1?void 0:s,new rf(ble))};rf.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,kVe),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 ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var dY;rf.getUnitBox=function(){return l(dY)||(dY=rf.createGeometry(rf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),dY};var kc=rf;var UVe=new h;function Hm(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"}Hm.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Hm({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Hm.fromAxisAlignedBoundingBox=function(e){return new Hm({minimum:e.minimum,maximum:e.maximum})};Hm.packedLength=2*h.packedLength+1;Hm.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 vle=new h,Sle=new h,Cle={minimum:vle,maximum:Sle,offsetAttribute:void 0};Hm.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,vle),r=h.unpack(e,t+h.packedLength,Sle),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):(Cle.offsetAttribute=o===-1?void 0:o,new Hm(Cle))};Hm.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,UVe),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 ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Gm=Hm;function LE(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(LE.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});LE.fromColor=function(e){return new LE(e.red,e.green,e.blue,e.alpha)};LE.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};LE.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=LE;function XI(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(XI.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});XI.fromDistanceDisplayCondition=function(e){return new XI(e.near,e.far)};XI.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Kn=XI;function zVe(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=zVe;function To(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(To.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var FE={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};To.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):(FE.start=i,FE.stop=r,FE.isStartIncluded=o,FE.isStopIncluded=s,FE.data=a,new To(FE))};To.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};To.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 To(e)};To.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)))};To.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)))};To.intersect=function(e,t,n,i){if(!l(t))return To.clone(To.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 To.clone(To.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 To),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};To.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};To.prototype.clone=function(e){return To.clone(this,e)};To.prototype.equals=function(e,t){return To.equals(this,e,t)};To.prototype.equalsEpsilon=function(e,t,n){return To.equalsEpsilon(this,e,t,n)};To.prototype.toString=function(){return To.toIso8601(this)};To.EMPTY=Object.freeze(new To({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Cn=To;var wle=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),Ile=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),VVe=Object.freeze(new Cn({start:wle,stop:Ile})),jVe={MINIMUM_VALUE:wle,MAXIMUM_VALUE:Ile,MAXIMUM_INTERVAL:VVe},tt=jVe;function KI(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(KI.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});KI.fromCartesian3=function(e){return new KI(e.x,e.y,e.z)};KI.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 Er=KI;function $N(e){e=e??!0,this.value=$N.toValue(e)}Object.defineProperties($N.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});$N.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Pn=$N;var JN=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; +void main() { -float s; -vec2 st; -vec3 str; -vec3 normalEC; -mat3 tangentToEyeMatrix; -vec3 positionToEyeEC; -float height; -float slope; -float aspect; -float waterMask; -}; -`;var nF=`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; +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 -#ifdef USE_CLEARCOAT -float clearcoatFactor; -float clearcoatRoughness; -vec3 clearcoatNormal; +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.tangentToEyeMatrix = tangentToEyeMatrix; +materialInput.positionToEyeEC = positionToEyeEC; +materialInput.st = v_st; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif -}; -`;var iF=`struct czm_modelVertexOutput { -vec3 positionMC; -float pointSize; -}; -`;var rF=`struct czm_ray -{ -vec3 origin; -vec3 direction; -}; -`;var oF=`struct czm_raySegment +} +`;var ZN=`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 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 sF=`struct czm_shadowParameters +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 QN=`in vec3 v_positionEC; +in vec3 v_normalEC; +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; +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 aF=`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 cF=`float czm_alphaWeight(float a) +`;var eL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +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; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var lF=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) +`;var tL=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; +void main() { -float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); -float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); -val1 = val1 * (1.0 - val2); -val1 = val1 * val1 * (3.0 - (2.0 * val1)); -val1 = pow(val1, 0.5); -vec4 midColor = (color1 + color2) * 0.5; -return mix(midColor, currentColor, val1); +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 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) +`;var nL=`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() { -return czm_antialias(color1, color2, currentColor, dist, 0.1); +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;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); -if (ignoreBlackPixels) { -hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0; -} else { -hsb.z = hsb.z + hsbShift.z; +`;var Ple={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(Ple);var Uc=Ple;var Dle={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(Dle);var Jr=Dle;var Rle={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Uc.ADD,equationAlpha:Uc.ADD,functionSourceRgb:Jr.SOURCE_ALPHA,functionSourceAlpha:Jr.ONE,functionDestinationRgb:Jr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Uc.ADD,equationAlpha:Uc.ADD,functionSourceRgb:Jr.ONE,functionSourceAlpha:Jr.ONE,functionDestinationRgb:Jr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Uc.ADD,equationAlpha:Uc.ADD,functionSourceRgb:Jr.SOURCE_ALPHA,functionSourceAlpha:Jr.ONE,functionDestinationRgb:Jr.ONE,functionDestinationAlpha:Jr.ONE})};Object.freeze(Rle);var nn=Rle;var Ole={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(Ole);var Gi=Ole;function BE(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(BE.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}}});BE.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(` +`)};BE.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};BE.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ze(this.renderState,!1);return e?(t.depthMask=!1,t.blending=nn.ALPHA_BLEND):t.depthMask=!0,t};BE.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=nn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Gi.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var Dr=BE;function HVe(){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 $n=HVe;function kE(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(kE.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}}});kE.clone=function(e){if(l(e))return new kE(e._format,e._datatype,e._width,e._height,e._buffer)};kE.prototype.clone=function(){return kE.clone(this)};var iL=kE;var Mle=js(ef(),1);function Nle(){if(!l(qa._canTransferArrayBuffer)){let e=pY("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 mY=new be;function hY(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 pY(e){let t=new Mle.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(gb(e))s=e;else if(!n){let a=Zt(`${qa._workerModulePrefix}/${i}.js`);gb(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=hY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` + importScripts("${hY(CESIUM_WORKERS)}"); + CesiumWorkers["${i}"](); + `;return o=hY(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 GVe(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 WVe=(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),mY.raiseEvent(s),i(s)}else mY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},qVe=[];async function YVe(e,t,n){let i=await Promise.resolve(Nle());l(n)?i||(n.length=0):n=qVe;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",WVe(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function XVe(e,t,n){++e._activeTasks;try{let i=await YVe(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=pY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return XVe(this,e,t)};qa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=pY(this._workerPath),i=await GVe(this,e),r=await Promise.resolve(Nle()),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(),le(this)};qa.taskCompletedEvent=mY;qa._defaultWorkerModulePrefix="Workers/";qa._workerModulePrefix=qa._defaultWorkerModulePrefix;qa._canTransferArrayBuffer=void 0;var Jn=qa;function F0(){}F0._transcodeTaskProcessor=new Jn("transcodeKTX2",Number.POSITIVE_INFINITY);F0._readyPromise=void 0;function KVe(){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)||KVe(),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 iL(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 rL=F0;var Lle;Fle.setKTX2SupportedFormats=function(e,t,n,i,r,o){Lle={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Fle(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return rL.transcode(n,Lle)})}var of=Fle;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 Ble=1/256,$Ve=65536,_Y=256,Rr={};Rr.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};Rr.octEncode=function(e,t){return Rr.octEncodeInRange(e,255,t)};var $I=new U,kle=new Uint8Array(1);function oL(e){return kle[0]=e,kle[0]}Rr.octEncodeToCartesian4=function(e,t){return Rr.octEncodeInRange(e,65535,$I),t.x=oL($I.x*Ble),t.y=oL($I.x),t.z=oL($I.y*Ble),t.w=oL($I.y),t};Rr.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)};Rr.octDecode=function(e,t,n){return Rr.octDecodeInRange(e,t,255,n)};Rr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*_Y+i,a=r*_Y+o;return Rr.octDecodeInRange(s,a,65535,t)};Rr.octPackFloat=function(e){return 256*e.x+e.y};var yY=new U;Rr.octEncodeFloat=function(e){return Rr.octEncode(e,yY),Rr.octPackFloat(yY)};Rr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Rr.octDecode(i,r,t)};Rr.octPack=function(e,t,n,i){let r=Rr.octEncodeFloat(e),o=Rr.octEncodeFloat(t),s=Rr.octEncode(n,yY);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Rr.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;Rr.octDecodeFloat(s,t),Rr.octDecodeFloat(c,n),Rr.octDecode(o,a,i)};Rr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Rr.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 gY(e){return e>>1^-(e&1)}Rr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=gY(e[a]),o+=gY(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=gY(n[a]),n[a]=s)};Rr.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};Rr.encodeRGB8=function(e){return Math.round(P.clamp(e.red*255,0,255))*$Ve+Math.round(P.clamp(e.green*255,0,255))*_Y+Math.round(P.clamp(e.blue*255,0,255))};Rr.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};Rr.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=Rr;var Ule=new h,zle=new h,Vle=new h;function JVe(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,Ule),s=h.subtract(i,t,zle),a=h.subtract(e,t,Vle),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,Ule),s=U.subtract(i,t,zle),a=U.subtract(e,t,Vle),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 UE=JVe;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 AY=new Wm;Wm.writeElements=function(e,t,n){Wm.fromCartesian(e,AY);let i=AY.high,r=AY.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 oa={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};oa.getSizeInBytes=function(e){switch(e){case oa.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case oa.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case oa.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};oa.fromSizeInBytes=function(e){switch(e){case 2:return oa.UNSIGNED_SHORT;case 4:return oa.UNSIGNED_INT;case 1:return oa.UNSIGNED_BYTE}};oa.validate=function(e){return l(e)&&(e===oa.UNSIGNED_BYTE||e===oa.UNSIGNED_SHORT||e===oa.UNSIGNED_INT)};oa.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};oa.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};oa.fromTypedArray=function(e){if(e instanceof Uint8Array)return oa.UNSIGNED_BYTE;if(e instanceof Uint16Array)return oa.UNSIGNED_SHORT;if(e instanceof Uint32Array)return oa.UNSIGNED_INT};Object.freeze(oa);var je=oa;var bY={};bY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function jle(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}bY.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=jle(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*jle(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var cu=bY;var TY={};TY.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 xY(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]}TY.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return cu.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=cu.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return xY(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):xY(e,t,0,i);if(i===0)return r=cu.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 xY(e,t,n,i)};var zE=TY;var EY={};EY.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=zE.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=cu.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=cu.computeRealRoots(1,d,p),y=cu.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 JI(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=zE.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=cu.computeRealRoots(1,S,R),_=cu.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[]}EY.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return zE.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 JI(o,s,a,c);case 2:return JI(o,s,a,c);case 3:return ph(o,s,a,c);case 4:return ph(o,s,a,c);case 5:return JI(o,s,a,c);case 6:return ph(o,s,a,c);case 7:return ph(o,s,a,c);case 8:return JI(o,s,a,c);case 9:return ph(o,s,a,c);case 10:return ph(o,s,a,c);case 11:return JI(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 sL=EY;var CY=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=CY;var Zr={};Zr.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 ZVe=new h,QVe=new h,$le=new h,Hle=new h,Gle=new h;Zr.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,ZVe),c=h.subtract(i,t,QVe),u=h.cross(s,c,$le),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<P.EPSILON6||(d=h.subtract(o,t,Hle),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,Gle),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,Hle),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,Gle),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};Zr.rayTriangle=function(e,t,n,i,r,o){let s=Zr.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 e4e=new gn;Zr.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=e4e;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Zr.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 t4e(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 n4e={root0:0,root1:0};function Jle(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,$le),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=t4e(c,u,f,n4e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Zr.raySphere=function(e,t,n){if(n=Jle(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var i4e=new gn;Zr.lineSegmentSphere=function(e,t,n,i){let r=i4e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=Jle(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 r4e=new h,o4e=new h;Zr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,r4e),r=h.multiplyComponents(n,e.direction,o4e),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 s4e=new Gs,a4e=new Gs,c4e=new Gs;Zr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Gs);let i=vY(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,s4e),r=vY(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,a4e),o=vY(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,c4e);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 vY(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}Zr.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=cu.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=sL.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 SY=new h,Wle=new h,qle=new h,aL=new h,l4e=new h,u4e=new $,f4e=new $,d4e=new $,h4e=new $,m4e=new $,Yle=new $,Xle=new $,Kle=new h,p4e=new h,g4e=new he;Zr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,SY);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,SY),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,aL),c=h.normalize(h.cross(a,s,Wle),Wle),u=h.normalize(h.cross(s,c,qle),qle),f=u4e;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,f4e),p=$.fromScale(t.radii,d4e),g=$.fromScale(t.oneOverRadii,h4e),m=m4e;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,Yle),m,Yle),A=$.multiply($.multiply(y,p,Xle),f,Xle),b=$.multiplyByVector(y,n,l4e),x=Zr.quadraticVectorExpression(A,h.negate(b,SY),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,p4e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],Kle),Kle);let L=h.normalize(h.subtract(T,n,aL),aL),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,g4e);return I=P.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,aL))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var _4e=new h;Zr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,_4e),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};Zr.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 Zr.lineSegmentPlane(e,t,i,f),Zr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Zr.lineSegmentPlane(t,n,i,f),Zr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Zr.lineSegmentPlane(n,e,i,f),Zr.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 Zr.lineSegmentPlane(e,n,i,f),Zr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Zr.lineSegmentPlane(n,t,i,f),Zr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Zr.lineSegmentPlane(t,e,i,f),Zr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var xi=Zr;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 y4e=new h;va.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,y4e),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 A4e=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,A4e);return h.subtract(t,r,n)};var b4e=new M,x4e=new se,T4e=new h;va.transform=function(e,t,n){let i=e.normal,r=e.distance,o=M.inverseTranspose(t,b4e),s=se.fromElements(i.x,i.y,i.z,r,x4e);s=M.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,T4e);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 cL=wY;var vl={};function pL(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function E4e(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)pL(i,r,e[o],e[o+1],e[o+2]);return i}function C4e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);pL(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)pL(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function v4e(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)pL(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}vl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=E4e(t);break;case Oe.TRIANGLE_STRIP:e.indices=C4e(t);break;case Oe.TRIANGLE_FAN:e.indices=v4e(t);break}e.primitiveType=Oe.LINES}return e};vl.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 ue(u.center,u.radius+n)),new wt({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};vl.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};vl.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};vl.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=cL.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function Zle(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 S4e(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])}}vl.fitToUnsignedShortIndices=function(e){let t=[],n=wt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=Zle(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,S4e(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=Zle(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 Qle=new h,w4e=new he;vl.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,Qle),p=s.cartesianToCartographic(d,w4e),g=r.project(p,Qle);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 IY={high:0,low:0};vl.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],IY),a[f]=IY.high,c[f]=IY.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 PY(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 DY(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 lL=new M,uL=new $;vl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;PY(t,n.position),PY(t,n.prevPosition),PY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,lL),M.transpose(lL,lL),M.getMatrix3(lL,uL),DY(uL,n.normal),DY(uL,n.tangent),DY(uL,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function I4e(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 P4e=new h;function RY(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=I4e(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,P4e))+b.radius;x>A&&(A=x)}return new wt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}vl.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(RY(t,"geometry")),n.length>0&&(r.push(RY(n,"westHemisphereGeometry")),r.push(RY(n,"eastHemisphereGeometry"))),r};var Zf=new h,ZI=new h,VE=new h,jE=new h;vl.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;ZI.x=i[b],ZI.y=i[b+1],ZI.z=i[b+2],VE.x=i[x],VE.y=i[x+1],VE.z=i[x+2],jE.x=i[T],jE.y=i[T+1],jE.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(VE,ZI,VE),h.subtract(jE,ZI,jE),a[f]=h.cross(VE,jE,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,Zf),p.count>0){for(f=0;f<p.count;f++)h.add(Zf,a[c[p.indexOffset+f]],Zf);h.equalsEpsilon(h.ZERO,Zf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],Zf)}h.equalsEpsilon(h.ZERO,Zf,P.EPSILON10)&&(Zf.z=1),h.normalize(Zf,Zf),g[m]=Zf.x,g[m+1]=Zf.y,g[m+2]=Zf.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var D4e=new h,eue=new h,R4e=new h;vl.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,D4e),A=h.fromArray(c,f,R4e),b=h.dot(y,A);h.multiplyByScalar(y,b,eue),h.normalize(h.subtract(A,eue,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 QI=new U,gh=new h,tue=new h,nue=new h,fL=new U;vl.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}fL=cn.octEncodeInRange(gh,65535,fL),I[R++]=fL.x,I[R++]=fL.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,QI),E[v++]=cn.compressTextureCoordinates(QI));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,gh),h.fromArray(m,S,tue),h.fromArray(y,S,nue),cn.octPack(gh,tue,nue,QI),E[v++]=QI.x,E[v++]=QI.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 O4e(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 M4e(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 N4e(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 L4e(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 F4e(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 B4e(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 k4e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return M4e(e);case Oe.TRIANGLE_STRIP:return N4e(e);case Oe.TRIANGLES:return O4e(e);case Oe.LINE_STRIP:return F4e(e);case Oe.LINE_LOOP:return B4e(e);case Oe.LINES:return L4e(e)}return e}function N_(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function U4e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){N_(e,e.y<0),N_(t,t.y<0),N_(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;N_(e,a),N_(t,a),N_(n,a)}var iue=new h;function Qf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,iue),e.y/(e.y-t.y),iue),n),h.clone(n,i),N_(n,!0),N_(i,!1)}var Tb=new h,Eb=new h,Cb=new h,vb=new h,OY={positions:new Array(7),indices:new Array(9)};function z4e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;U4e(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=OY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Qf(e,t,Tb,Cb),Qf(e,n,Eb,vb),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Qf(t,n,Tb,Cb),Qf(t,e,Eb,vb),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Qf(n,e,Tb,Cb),Qf(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||(Qf(n,e,Tb,Cb),Qf(n,t,Eb,vb),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Qf(t,n,Tb,Cb),Qf(t,e,Eb,vb),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Qf(e,t,Tb,Cb),Qf(e,n,Eb,vb),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=OY.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),OY}function rue(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=ue.fromVertices(n.position.values)),e}function GE(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 FY(e,t,n){let i=l(e.geometry.boundingSphere);t=rue(t,i),n=rue(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 BY(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 V4e=BY(se,4),mL=BY(h,3),uue=BY(U,2),j4e=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},eP=new h,MY=new h,NY=new h,H4e=new h;function dL(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,eP),b=h.fromArray(r,t*3,MY),x=h.fromArray(r,n*3,NY),T=UE(i,A,b,x,H4e);if(l(T)){if(l(o)&&mL(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,eP),v=h.fromArray(u,t*3,MY),S=h.fromArray(u,n*3,NY);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=eP,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&j4e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&mL(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&mL(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&uue(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];G4e(e,t,n,T,y,m[v],d[v])}}}function G4e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:V4e(e,t,n,i,c,u,r,!1);break;case 3:mL(e,t,n,i,c,u,r,!1);break;case 2:uue(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 W4e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function oue(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)&&!W4e[I]&&l(n[I])&&d.push(I);let p=d.length,g=GE(t),m=GE(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=z4e(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),dL(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),dL(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+1,_),dL(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+2,C),dL(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}FY(e,m,g)}var fue=sn.fromPointNormal(h.ZERO,h.UNIT_Y),q4e=new h,Y4e=new h;function HE(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,eP);h.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function sue(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=GE(t),a=GE(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,eP),y=h.fromArray(i,g*3,MY),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=xi.lineSegmentPlane(m,y,fue,NY);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,q4e);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,Y4e);A=qm(b,x,T,o,c,m),HE(p,g,m,i,A,b,r),A=qm(b,x,T,o,-1,O),HE(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=qm(E,v,S,o,-1,O),HE(p,g,O,i,A,E,r),A=qm(E,v,S,o,c+1,y),HE(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),HE(p,g,m,i,A,R,r),A=qm(R,O,L,o,c+1,y),HE(p,g,y,i,A,R,r)}}FY(e,a,s)}var aue=new U,X4e=new U,due=new h,hue=new h,LY=new h,K4e=new h,$4e=new h,J4e=new h,cue=new se;function lue(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,due);if(a.x>0)continue;let c=h.unpack(i,s,hue);(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,LY);(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 Z4e=5*P.EPSILON9,hL=P.EPSILON6;function Q4e(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=GE(t),f=GE(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,due),T=h.fromArray(i,b*3,hue);if(Math.abs(x.y)<hL)for(x.y=hL*(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)<hL)for(T.y=hL*(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=xi.lineSegmentPlane(x,T,fue,K4e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,Z4e,$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,J4e);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,aue),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,LY));if(w/=h.magnitudeSquared(h.subtract(T,x,LY)),l(c)){let D=se.fromArray(c,A*4,cue),N=se.fromArray(c,b*4,cue),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,aue),N=U.fromArray(a,(d+3)*2,X4e),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&&(lue(f),lue(u)),FY(e,f,u)}vl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==mh.NONE)switch(t.geometryType){case mh.POLYLINES:Q4e(e);break;case mh.TRIANGLES:oue(e);break;case mh.LINES:sue(e);break}else k4e(t),t.primitiveType===Oe.TRIANGLES?oue(e):t.primitiveType===Oe.LINES&&sue(e);return e};var qn=vl;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 Sb={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};Sb.validate=function(e){return e===Sb.STREAM_DRAW||e===Sb.STATIC_DRAW||e===Sb.DYNAMIC_DRAW||e===Sb.DYNAMIC_READ};Object.freeze(Sb);var Me=Sb;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 zt=Mo;function tP(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(tP.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});tP.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)};tP.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};tP.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 gL=tP;function kY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function _L(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function yh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=zt.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;kY(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;_L(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;kY(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;_L(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;_L(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;kY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;_L(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(yh.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)}}});yh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};yh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};yh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};yh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};yh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};yh.prototype.getColorTexture=function(e){return this._colorTextures[e]};yh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};yh.prototype.isDestroyed=function(){return!1};yh.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),le(this)};var vs=yh;var nP={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===nP.DONT_CARE||e===nP.FASTEST||e===nP.NICEST}};Object.freeze(nP);var Ah=nP;var iP={NEAREST:te.NEAREST,LINEAR:te.LINEAR};iP.validate=function(e){return e===iP.NEAREST||e===iP.LINEAR};Object.freeze(iP);var Zn=iP;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 rP={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===rP.CLAMP_TO_EDGE||e===rP.REPEAT||e===rP.MIRRORED_REPEAT}};Object.freeze(rP);var hn=rP;function oP(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=Zn.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(oP.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}}});oP.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};oP.NEAREST=Object.freeze(new oP({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST}));var Gt=oP;function zc(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=$n(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}zc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new zc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};zc.createVertexBuffer=function(e){return new zc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};zc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new zc({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(zc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});zc.prototype._getBuffer=function(){return this._buffer};zc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};zc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};zc.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)};zc.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)};zc.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)};zc.prototype.isDestroyed=function(){return!1};zc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var nt=zc;function e8e(e,t){if(!e)throw new pe(t)}var mue=e8e;function t8e(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 gue(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 bh(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)t8e(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),gue(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 pue(e){return e.values.length/e.componentsPerAttribute}function n8e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function i8e(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=pue(e[r[0]]),t=1;t<s;++t){let u=pue(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+=n8e(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}}}bh.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=i8e(d);if(l(m)){u=nt.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=nt.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=nt.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=nt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=nt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new bh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(bh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});bh.prototype.getAttribute=function(e){return this._attributes[e]};function r8e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=zt.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 o8e(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)}}bh.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)};bh.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)};bh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&r8e(this),this._hasConstantAttributes&&o8e(this,this._gl)):gue(this._gl,this._attributes,this._indexBuffer)};bh.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)}};bh.prototype.isDestroyed=function(){return!1};bh.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),le(this)};var Vn=bh;function Eo(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 Gt}=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 gL(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,_ue(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 Eo.faceNames())UY(this[T],n?.[T],0);m.bindTexture(y,null)}Eo.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()};Eo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*s8e(){yield Eo.FaceName.POSITIVEX,yield Eo.FaceName.NEGATIVEX,yield Eo.FaceName.POSITIVEY,yield Eo.FaceName.NEGATIVEY,yield Eo.FaceName.POSITIVEZ,yield Eo.FaceName.NEGATIVEZ}Eo.faceNames=function(){return s8e()};function UY(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))}Eo.loadFace=UY;Object.defineProperties(Eo.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){_ue(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}}});Eo.getDirection=function(e,t){switch(e){case Eo.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Eo.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Eo.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Eo.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Eo.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Eo.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function _ue(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=Zn.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)}Eo.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 Eo.faceNames())UY(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};Eo.prototype.generateMipmap=function(e){e=e??Ah.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)};Eo.createVertexArray=function(e){let t=kc.createGeometry(kc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=qn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Eo.prototype.isDestroyed=function(){return!1};Eo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var us=Eo;function ed(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 Gt}=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??$n(),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,xue(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)?a8e(this,n):yue(this,n):l(n.framebuffer)?l8e(this,n):Aue(this,n),this._initialized=!0):bue(this),g.bindTexture(this._textureTarget,null)}function a8e(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=yL(c),u=yL(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function yue(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=yL(g),m=yL(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function c8e(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 l8e(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 Aue(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 u8e(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 yL(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function bue(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)}ed.create=function(e){return new ed(e)};ed.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 ed({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(ed.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){xue(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 xue(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=Zn.NEAREST),o.webgl2&&$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Zn.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)}ed.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)?yue(this,i):Aue(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),bue(this)),this._initialized=!0),f||(l(i.arrayBufferView)?c8e(this,i.arrayBufferView,t,n,c,u):u8e(this,i,t,n)),s.bindTexture(a,null)};ed.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};ed.prototype.generateMipmap=function(e){e=e??Ah.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)};ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};ed.defaultColor=z.WHITE;var Dt=ed;var AL=`uniform sampler2D image; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); +rampColor = czm_gammaCorrect(rampColor); +material.diffuse = rampColor.rgb; +material.alpha = rampColor.a; +return material; } -hsb.z = clamp(hsb.z, 0.0, 1.0); -return czm_HSBToRGB(hsb); +`;var bL=`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 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 xL=`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 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 TL=`uniform vec4 lightColor; +uniform vec4 darkColor; +uniform vec2 repeat; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +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 hF=`bool czm_backFacing() +`;var EL=`uniform sampler2D heights; +uniform sampler2D colors; +float getHeight(int idx, float invTexSize) { -return gl_FrontFacing == false; +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 } -`;var mF=`float czm_branchFreeTernary(bool comparison, float a, float 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; } -vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 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; } -vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { -float useA = float(comparison); -return a * useA + b * (1.0 - useA); +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 pF=`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 gF=`uniform vec4 shadowMap_cascadeDistances; -float czm_cascadeDistance(vec4 weights) -{ -return dot(shadowMap_cascadeDistances, weights); +color.rgb = czm_gammaCorrect(color.rgb); +material.diffuse = color.rgb; +material.alpha = color.a; +return material; } -`;var _F=`uniform mat4 shadowMap_cascadeMatrices[4]; -mat4 czm_cascadeMatrix(vec4 weights) +`;var CL=`uniform vec4 color; +uniform float spacing; +uniform float width; +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 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 yF=`uniform vec4 shadowMap_cascadeSplits[2]; -vec4 czm_cascadeWeights(float depthEye) +`;var vL=`uniform sampler2D image; +uniform float minimumHeight; +uniform float maximumHeight; +czm_material czm_getMaterial(czm_materialInput materialInput) { -vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); -vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); -return near * far; +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 AF=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) +`;var SL=`uniform vec4 fadeInColor; +uniform vec4 fadeOutColor; +uniform float maximumDistance; +uniform bool repeat; +uniform vec2 fadeDirection; +uniform vec2 time; +float getTime(float t, float coord) { -vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; -return vec4(p, 1.0); -} -`;var bF=`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 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); } -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); +return clamp(q, 0.0, 1.0); } -`;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); -float atmosphereInnerRadius = length(positionWC); -czm_computeScattering( -primaryRay, -length(cameraToPositionWC), -lightDirection, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); +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 TF=`vec4 czm_computePosition(); -`;var EF=`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; +`;var wL=`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 +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; } -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; +`;var IL=`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; } -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 PL=`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; } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +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 +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); } -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); +else +{ +float d1 = czm_infinity; +if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +{ +d1 = abs(st.s - base); } -rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = czm_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); +float d2 = abs(st.t - ptOnUpperLine); +float d3 = abs(st.t - ptOnLowerLine); +dist = min(min(d1, d2), d3); +} +vec4 outsideColor = vec4(0.0); +vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); +vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); +outColor = czm_gammaCorrect(outColor); +material.diffuse = outColor.rgb; +material.alpha = outColor.a; +return material; +} +`;var DL=`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 CF=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) +czm_material czm_getMaterial(czm_materialInput materialInput) { -return vec2(textureTransform * vec3(texCoord, 1.0)); +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; +} +fragColor = czm_gammaCorrect(fragColor); +material.emission = fragColor.rgb; +material.alpha = fragColor.a; +return material; } -`;var vF=`vec2 cordic(float angle) +`;var RL=`uniform vec4 color; +uniform float glowPower; +uniform float taperPower; +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); +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)); } -vec2 czm_cosineAndSine(float angle) -{ -if (angle < -czm_piOverTwo || angle > czm_piOverTwo) -{ -if (angle < 0.0) +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; +} +`;var OL=`uniform vec4 color; +uniform vec4 outlineColor; +uniform float outlineWidth; +in float v_width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle + czm_pi); +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; } -else +`;var ML=`uniform vec4 color; +uniform vec4 rimColor; +uniform float width; +czm_material czm_getMaterial(czm_materialInput materialInput) { -return -cordic(angle - czm_pi); +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 NL=`uniform sampler2D image; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); +rampColor = czm_gammaCorrect(rampColor); +material.diffuse = rampColor.rgb; +material.alpha = rampColor.a; +return material; } -else +`;var LL=`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_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; } +`;var FL=`uniform vec4 waterColor; +uniform vec4 landColor; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); +outColor = czm_gammaCorrect(outColor); +material.diffuse = outColor.rgb; +material.alpha = outColor.a; +return material; } -`;var 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 BL=`uniform sampler2D specularMap; +uniform sampler2D normalMap; +uniform vec4 baseWaterColor; +uniform vec4 blendColor; +uniform float frequency; +uniform float animationSpeed; +uniform float amplitude; +uniform float specularIntensity; +uniform float fadeFactor; +czm_material czm_getMaterial(czm_materialInput materialInput) +{ +czm_material material = czm_getDefaultMaterial(materialInput); +float time = czm_frameNumber * animationSpeed; +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 wF=`vec2 czm_decompressTextureCoordinates(float encoded) +`;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??Zn.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,f8e(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(Cue(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Cue(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];Cue(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 Gt({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 us({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Gt({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 le(this)};function f8e(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:$n(),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=Ot(t._template,o,!0),n=i.translucent}p8e(t),_8e(t),x8e(t),E8e(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 zY(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 Tue(e,t){}function d8e(e,t){}var h8e=["type","materials","uniforms","components","source"],m8e=["diffuse","specular","shininess","normal","emission","alpha"];function p8e(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;zY(t,h8e,Tue,!0),zY(r,m8e,Tue,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);zY(n,o,d8e,!1)}function g8e(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 _8e(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 r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&g8e(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 IF=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) -out float v_WindowZ; -#endif -vec4 czm_depthClamp(vec4 coords) +`}}var Eue={mat2:$i,mat3:$,mat4:M},y8e=/\.ktx2$/i;function A8e(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 Gt({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}vue(n,e)}}}function vue(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 y8e.test(r.url)?a=of(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 b8e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof us){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),Sue(t,e)}}function Sue(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 x8e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&wue(e,n)}function wue(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=T8e(r),s;if(o==="channels")s=sP(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;C8e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},wue(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=sP(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(A8e(t)),e._initializationPromises.push(vue(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(b8e(t)),e._initializationPromises.push(Sue(e,t));else if(o.indexOf("mat")!==-1){let u=new Eue[o];e._uniforms[c]=function(){return Eue[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function T8e(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 E8e(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++}`;sP(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=sP(e,i,a)}}function sP(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 C8e(e,t,n){return sP(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:bL},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:IL},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:wL},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:LL},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:xL},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:TL},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:BL},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:ML},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:SL},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:PL},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:DL},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:RL},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:OL},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:CL},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:vL},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:NL},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:AL},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:EL},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:FL,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var ir=it;function wb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??wb.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:ir.fromType(ir.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(wb.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}}});wb.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;wb.prototype.isTranslucent=Dr.prototype.isTranslucent;wb.prototype.getRenderState=Dr.prototype.getRenderState;wb.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:eL,fragmentShaderSource:QN}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:nL,fragmentShaderSource:tL}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:ZN,fragmentShaderSource:JN})};var Cr=wb;var kL=`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; +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 PF=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) +`;var UL=`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() { -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); +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var DF=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) +`;var WE=`in vec4 v_color; +void main() { -vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; -return (dot(scaled, scaled) <= 1.0); +out_FragColor = czm_gammaCorrect(v_color); } -`;var RF=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) +`;var zL=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() { -return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); -} -`;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) { -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))); +vec4 p = czm_computePosition(); +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -bool czm_equalsEpsilon(float left, float right, float epsilon) { -return (abs(left - right) <= epsilon); +`;function U0(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?zL:UL,o=i?WE:kL,s=i?U0.FLAT_VERTEX_FORMAT:U0.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(U0.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}}});U0.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;U0.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;U0.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;U0.prototype.isTranslucent=Dr.prototype.isTranslucent;U0.prototype.getRenderState=Dr.prototype.getRenderState;var An=U0;function qE(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(qE.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});qE.prototype.getType=function(e){return"Color"};var v8e=new K;qE.prototype.getValue=function(e,t){return l(e)||(e=K.now(v8e)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};qE.prototype.equals=function(e){return this===e||e instanceof qE&&X.equals(this._color,e._color)};var Kt=qE;var VY=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)}},rr=VY;var Iue=new h,Pue=new h,Due=new he,jY=new h,S8e=new h,Rue=new ue,w8e=new rr,aP=[new he,new he,new he,new he],cP=new U,Ss={};Ss.initialize=function(){let e=Ss._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){Ss._terrainHeights=t}),Ss._initPromise=e),e};Ss.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=Oue(e),i=Ss._defaultMinTerrainHeight,r=Ss._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Ss._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,Due),Iue),t.cartographicToCartesian(ie.southwest(e,Due),Pue),h.midpoint(Pue,Iue,jY);let a=t.scaleToGeodeticSurface(jY,S8e);if(l(a)){let c=h.distance(jY,a);i=Math.min(i,-c)}else i=Ss._defaultMinTerrainHeight}return i=Math.max(Ss._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Ss.getBoundingSphere=function(e,t){t=t??ee.default;let n=Oue(e),i=Ss._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Ss._terrainHeights[o];l(s)&&(i=s[1])}let r=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,Rue),ue.union(r,Rue,r)};function Oue(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=Ss._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=aP[c];if(w8e.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}}Ss._terrainHeightsMaxLevel=6;Ss._defaultMaxTerrainHeight=9e3;Ss._defaultMinTerrainHeight=-1e5;Ss._terrainHeights=void 0;Ss._initPromise=void 0;Object.defineProperties(Ss,{initialized:{get:function(){return l(Ss._terrainHeights)}}});var Ni=Ss;function Ya(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}Ya.fromCorners=function(e,t,n){return l(n)||(n=new Ya),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Ya.fromPoints=function(e,t){if(l(t)||(t=new Ya),!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};Ya.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 Ya(e.minimum,e.maximum,e.center)};Ya.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 VL=new h;Ya.intersectPlane=function(e,t){VL=h.subtract(e.maximum,e.minimum,VL);let n=h.multiplyByScalar(VL,.5,VL),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};Ya.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};Ya.prototype.clone=function(e){return Ya.clone(this,e)};Ya.prototype.intersectPlane=function(e){return Ya.intersectPlane(this,e)};Ya.prototype.intersectAxisAlignedBoundingBox=function(e){return Ya.intersectAxisAlignedBoundingBox(this,e)};Ya.prototype.equals=function(e){return Ya.equals(this,e)};var td=Ya;var HY=new se;function Ym(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,HY)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,HY));let i=h.fromCartesian4(M.getColumn(n,2,HY));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Ym.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 I8e=new td;Ym.fromPoints=function(e,t){let n=td.fromPoints(e,I8e);return new Ym(n.center,t)};var Mue=new gn,jL=new h;Ym.prototype.projectPointOntoPlane=function(e,t){let n=Mue;n.origin=e,h.normalize(e,n.direction);let i=xi.rayPlane(n,this._plane,jL);if(l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,jL)),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)}};Ym.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};Ym.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Mue;n.origin=e,h.clone(this._plane.normal,n.direction);let i=xi.rayPlane(n,this._plane,jL);l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,jL));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};Ym.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 P8e=new h;Ym.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=P8e;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};Ym.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=Ym;function or(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}or.packedLength=h.packedLength+$.packedLength;or.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};or.unpack=function(e,t,n){return t=t??0,l(n)||(n=new or),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var D8e=new h,R8e=new h,O8e=new h,M8e=new h,N8e=new h,L8e=new h,F8e=new $,B8e={unitary:new $,diagonal:new $};or.fromPoints=function(e,t){if(l(t)||(t=new or),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],D8e);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,R8e),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=F8e;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,B8e),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,M8e),b=$.getColumn(y,1,N8e),x=$.getColumn(y,2,L8e),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=O8e;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 Uue=new h,k8e=new h;function Nue(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new or);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Uue;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=k8e;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 Lue=new he,U8e=new h,z8e=new he,V8e=new he,j8e=new he,H8e=new he,G8e=new he,W8e=new h,Fue=new h,q8e=new h,Bue=new h,Y8e=new h,X8e=new U,K8e=new U,$8e=new U,J8e=new U,Z8e=new U,Q8e=new h,eje=new h,tje=new h,nje=new h,ije=new U,rje=new h,oje=new h,sje=new h,aje=new sn(h.UNIT_X,0);or.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,Lue),R=i.cartographicToCartesian(I,U8e),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,z8e),w=he.fromRadians(e.west,e.north,n,V8e),D=he.fromRadians(e.west,_,n,j8e),N=he.fromRadians(e.west,e.south,n,H8e),F=he.fromRadians(L,e.south,n,G8e),V=i.cartographicToCartesian(C,W8e),B=i.cartographicToCartesian(w,Fue),j=i.cartographicToCartesian(D,q8e),k=i.cartographicToCartesian(N,Bue),G=i.cartographicToCartesian(F,Y8e),q=O.projectPointToNearestOnPlane(V,X8e),Q=O.projectPointToNearestOnPlane(B,K8e),W=O.projectPointToNearestOnPlane(j,$8e),J=O.projectPointToNearestOnPlane(k,J8e),Z=O.projectPointToNearestOnPlane(G,Z8e);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,Fue),k=i.cartographicToCartesian(N,Bue),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,Nue(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,Lue).longitude,A=h.fromRadians(y,m,n,i,Q8e);A.z=0;let x=Math.abs(A.x)<P.EPSILON10&&Math.abs(A.y)<P.EPSILON10?h.UNIT_X:h.normalize(A,eje),T=h.UNIT_Z,E=h.cross(x,T,tje);d=sn.fromPointNormal(A,x,aje);let v=h.fromRadians(y+P.PI_OVER_TWO,m,n,i,nje);s=h.dot(sn.projectPointOntoPlane(d,v,ije),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,rje).z,a=h.fromRadians(0,e.south,p?t:n,i,oje).z;let S=h.fromRadians(e.east,m,n,i,sje);return u=sn.getPointDistance(d,S),f=0,Nue(A,E,T,x,o,s,a,c,u,f,r)};or.fromTransformation=function(e,t){return l(t)||(t=new or),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};or.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new or(e.center,e.halfAxes)};or.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 zue=new h,Vue=new h,jue=new h,cje=new h,kue=new h,lje=new h;or.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Uue),i=e.halfAxes,r=$.getColumn(i,0,zue),o=$.getColumn(i,1,Vue),s=$.getColumn(i,2,jue),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,kue),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,cje),h.normalize(y,y),A=h.cross(m,y,kue),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=lje;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 uje=new h,fje=new h;or.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,zue),u=$.getColumn(a,1,Vue),f=$.getColumn(a,2,jue),d=h.add(c,u,uje);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,fje),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 dje=new h,hje=new h,mje=new h;or.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,dje),o=$.getColumn(i,1,hje),s=$.getColumn(i,2,mje);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 pje=new $;or.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,pje);return M.fromRotationTranslation(i,n,t)};var gje=new ue;or.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,gje);return!t.isBoundingSphereVisible(n)};or.prototype.intersectPlane=function(e){return or.intersectPlane(this,e)};or.prototype.distanceSquaredTo=function(e){return or.distanceSquaredTo(this,e)};or.prototype.computePlaneDistances=function(e,t,n){return or.computePlaneDistances(this,e,t,n)};or.prototype.computeCorners=function(e){return or.computeCorners(this,e)};or.prototype.computeTransformation=function(e){return or.computeTransformation(this,e)};or.prototype.isOccluded=function(e){return or.isOccluded(this,e)};or.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};or.prototype.clone=function(e){return or.clone(this,e)};or.prototype.equals=function(e){return or.equals(this,e)};var Qt=or;var HL={};HL.getHeight=function(e,t,n){return(e-n)*t+n};var _je=new he;HL.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,_je);if(!l(o))return h.clone(e,r);let s=HL.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var br=HL;var Go={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},GY=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 Vc(this,Go.CULL)}set cull(t){Vc(this,Go.CULL)!==t&&(L_(this,Go.CULL,t),this.dirty=!0)}get occlude(){return Vc(this,Go.OCCLUDE)}set occlude(t){Vc(this,Go.OCCLUDE)!==t&&(L_(this,Go.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 Vc(this,Go.CAST_SHADOWS)}set castShadows(t){Vc(this,Go.CAST_SHADOWS)!==t&&(L_(this,Go.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Vc(this,Go.RECEIVE_SHADOWS)}set receiveShadows(t){Vc(this,Go.RECEIVE_SHADOWS)!==t&&(L_(this,Go.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 Vc(this,Go.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Vc(this,Go.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(L_(this,Go.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 Vc(this,Go.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Vc(this,Go.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(L_(this,Go.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 Vc(this,Go.PICK_ONLY)}set pickOnly(t){Vc(this,Go.PICK_ONLY)!==t&&(L_(this,Go.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Vc(this,Go.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Vc(this,Go.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(L_(this,Go.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 Vc(e,t){return(e._flags&t)===t}function L_(e,t,n){n?e._flags|=t:e._flags&=~t}var at=GY;var Hue={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(Hue);var Ie=Hue;var lP={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};lP.validate=function(e){return e===lP.CLOCKWISE||e===lP.COUNTER_CLOCKWISE};Object.freeze(lP);var sa=lP;function Gue(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]=Gue(e[t]));return Object.freeze(e)}var Wue=Gue;function Km(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 yje=0,Xm={};Km.fromCache=function(e){let t=JSON.stringify(e),n=Xm[t];if(l(n))return++n.referenceCount,n.state;let i=new Km(e),r=JSON.stringify(i);return n=Xm[r],l(n)||(i.id=yje++,n={referenceCount:0,state:i},Xm[r]=n),++n.referenceCount,Xm[t]={referenceCount:1,state:n.state},n.state};Km.removeFromCache=function(e){let t=new Km(e),n=JSON.stringify(t),i=Xm[n],r=JSON.stringify(e),o=Xm[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Xm[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Xm[n]};Km.getCache=function(){return Xm};Km.clearCache=function(){Xm={}};function Ib(e,t,n){n?e.enable(t):e.disable(t)}function que(e,t){e.frontFace(t.frontFace)}function Yue(e,t){let n=t.cull,i=n.enabled;Ib(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Xue(e,t){e.lineWidth(t.lineWidth)}function Kue(e,t){let n=t.polygonOffset,i=n.enabled;Ib(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function $ue(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Ib(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 Jue(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Zue(e,t){let n=t.depthTest,i=n.enabled;Ib(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Que(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function efe(e,t){e.depthMask(t.depthMask)}function tfe(e,t){e.stencilMask(t.stencilMask)}function Aje(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function nfe(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Ib(e,e.BLEND,r),r&&(Aje(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function ife(e,t){let n=t.stencilTest,i=n.enabled;if(Ib(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 rfe(e,t){let n=t.sampleCoverage,i=n.enabled;Ib(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var bje=new et;function ofe(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=bje,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)}Km.apply=function(e,t,n){que(e,t),Yue(e,t),Xue(e,t),Kue(e,t),Jue(e,t),Zue(e,t),Que(e,t),efe(e,t),tfe(e,t),ife(e,t),rfe(e,t),$ue(e,t,n),nfe(e,t,n),ofe(e,t,n)};function xje(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(que),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Yue),e.lineWidth!==t.lineWidth&&n.push(Xue),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Kue),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Jue),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Zue),(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(Que),e.depthMask!==t.depthMask&&n.push(efe),e.stencilMask!==t.stencilMask&&n.push(tfe),(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(ife),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(rfe),n}Km.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=xje(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)&&$ue(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)&&nfe(e,n,r),(t!==n||i!==r||i.context!==r.context)&&ofe(e,n,r)};Km.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=Km;var Tje=new h;function Mt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Xa={};Xa[te.FLOAT]="float";Xa[te.FLOAT_VEC2]="vec2";Xa[te.FLOAT_VEC3]="vec3";Xa[te.FLOAT_VEC4]="vec4";Xa[te.INT]="int";Xa[te.INT_VEC2]="ivec2";Xa[te.INT_VEC3]="ivec3";Xa[te.INT_VEC4]="ivec4";Xa[te.BOOL]="bool";Xa[te.BOOL_VEC2]="bvec2";Xa[te.BOOL_VEC3]="bvec3";Xa[te.BOOL_VEC4]="bvec4";Xa[te.FLOAT_MAT2]="mat2";Xa[te.FLOAT_MAT3]="mat3";Xa[te.FLOAT_MAT4]="mat4";Xa[te.SAMPLER_2D]="sampler2D";Xa[te.SAMPLER_CUBE]="samplerCube";Mt.prototype.getDeclaration=function(e){let t=`uniform ${Xa[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var Eje={czm_viewport:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,Tje)}}),czm_frameNumber:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Mt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Mt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Mt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},F_=Eje;function Cje(e,t,n,i){switch(t.type){case e.FLOAT:return new WY(e,t,n,i);case e.FLOAT_VEC2:return new qY(e,t,n,i);case e.FLOAT_VEC3:return new YY(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 GL(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new GL(e,t,n,i);case e.INT:case e.BOOL:return new KY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new $Y(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new JY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new ZY(e,t,n,i);case e.FLOAT_MAT2:return new QY(e,t,n,i);case e.FLOAT_MAT3:return new eX(e,t,n,i);case e.FLOAT_MAT4:return new tX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var WY=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))}},qY=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))}},YY=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)))}},GL=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}},KY=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))}},$Y=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))}},JY=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))}},ZY=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))}},vje=new Float32Array(4),QY=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,vje);this._gl.uniformMatrix2fv(this._location,!1,t)}}},Sje=new Float32Array(9),eX=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,Sje);this._gl.uniformMatrix3fv(this._location,!1,t)}}},wje=new Float32Array(16),tX=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,wje);this._gl.uniformMatrix4fv(this._location,!1,t)}}},WL=Cje;function Ije(e,t,n,i){switch(t.type){case e.FLOAT:return new nX(e,t,n,i);case e.FLOAT_VEC2:return new iX(e,t,n,i);case e.FLOAT_VEC3:return new rX(e,t,n,i);case e.FLOAT_VEC4:return new oX(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new sX(e,t,n,i);case e.INT:case e.BOOL:return new aX(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new cX(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new lX(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new uX(e,t,n,i);case e.FLOAT_MAT2:return new fX(e,t,n,i);case e.FLOAT_MAT3:return new dX(e,t,n,i);case e.FLOAT_MAT4:return new hX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var nX=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)}},iX=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)}},rX=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)}},oX=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)}},sX=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}},aX=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)}},cX=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)}},lX=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)}},uX=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)}},fX=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)}},dX=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)}},hX=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)}},qL=Ije;var Pje=0;function z0(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=Dje(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=Pje++}z0.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};z0.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(z0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return YL(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return YL(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return YL(this),this._uniformsByName}}});function sfe(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 Dje(e,t){let n={};if(!zt.highpFloatSupported||!zt.highpIntSupported){let i,r,o,s,a=sfe(e),c=sfe(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 $m="[Cesium WebGL] ";function Rje(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(`${$m}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${$m}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${$m}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(`${$m}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(`${$m}Vertex shader compile log: ${c}`),console.error(`${$m} Vertex shader source: +${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${$m}Fragment shader compile log: ${c}`),console.error(`${$m} 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(`${$m}${g} shader translation failed.`);return}console.error(`${$m}Translated ${g} shaderSource: +${m}`)}}function Oje(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 Mje(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=WL(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=qL(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function Nje(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=F_[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function Lje(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 YL(e){l(e._program)||afe(e)}function afe(e){let t=e._program,n=e._gl,i=Rje(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=Mje(n,i),s=Nje(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=Oje(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Lje(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{afe(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)}})}z0.prototype._bind=function(){YL(this),this._gl.useProgram(this._program)};z0.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)}};z0.prototype.isDestroyed=function(){return!1};z0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};z0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var en=z0;var XL=`const float czm_degreesPerRadian = 57.29577951308232; +`;var KL=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); +`;var $L=`const float czm_epsilon1 = 0.1; +`;var JL=`const float czm_epsilon2 = 0.01; +`;var ZL=`const float czm_epsilon3 = 0.001; +`;var QL=`const float czm_epsilon4 = 0.0001; +`;var eF=`const float czm_epsilon5 = 0.00001; +`;var tF=`const float czm_epsilon6 = 0.000001; +`;var nF=`const float czm_epsilon7 = 0.0000001; +`;var iF=`const float czm_infinity = 5906376272000.0; +`;var rF=`const float czm_oneOverPi = 0.3183098861837907; +`;var oF=`const float czm_oneOverTwoPi = 0.15915494309189535; +`;var sF=`const float czm_passCesium3DTile = 6.0; +`;var aF=`const float czm_passCesium3DTileClassification = 7.0; +`;var cF=`const float czm_passCesium3DTileClassificationIgnoreShow = 8.0; +`;var lF=`const float czm_passCesium3DTileEdges = 4.0; +`;var uF=`const float czm_passCesium3DTileEdgesDirect = 12.0; +`;var fF=`const float czm_passCesium3DTilePlanarFillId = 5.0; +`;var dF=`const float czm_passClassification = 8.0; +`;var hF=`const float czm_passCompute = 1.0; +`;var mF=`const float czm_passEnvironment = 0.0; +`;var pF=`const float czm_passGaussianSplats = 12.0; +`;var gF=`const float czm_passGlobe = 2.0; +`;var _F=`const float czm_passOpaque = 9.0; +`;var yF=`const float czm_passOverlay = 13.0; +`;var AF=`const float czm_passTerrainClassification = 3.0; +`;var bF=`const float czm_passTranslucent = 10.0; +`;var xF=`const float czm_passVoxels = 11.0; +`;var TF=`const float czm_pi = 3.141592653589793; +`;var EF=`const float czm_piOverFour = 0.7853981633974483; +`;var CF=`const float czm_piOverSix = 0.5235987755982988; +`;var vF=`const float czm_piOverThree = 1.0471975511965976; +`;var SF=`const float czm_piOverTwo = 1.5707963267948966; +`;var wF=`const float czm_radiansPerDegree = 0.017453292519943295; +`;var IF=`const float czm_sceneMode2D = 2.0; +`;var PF=`const float czm_sceneMode3D = 3.0; +`;var DF=`const float czm_sceneModeColumbusView = 1.0; +`;var RF=`const float czm_sceneModeMorphing = 0.0; +`;var OF=`const float czm_solarRadius = 695500000.0; +`;var MF=`const float czm_threePiOver2 = 4.71238898038469; +`;var NF=`const float czm_twoPi = 6.283185307179586; +`;var LF=`const float czm_webMercatorMaxLatitude = 1.4844222297453324; +`;var FF=`struct czm_depthRangeStruct +{ +float near; +float far; +}; +`;var BF=`struct czm_material +{ +vec3 diffuse; +float specular; +float shininess; +vec3 normal; +vec3 emission; +float alpha; +}; +`;var kF=`struct czm_materialInput +{ +float s; +vec2 st; +vec3 str; +vec3 normalEC; +mat3 tangentToEyeMatrix; +vec3 positionToEyeEC; +float height; +float slope; +float aspect; +float waterMask; +}; +`;var UF=`struct czm_modelMaterial { +vec4 baseColor; +vec3 diffuse; +float alpha; +vec3 specular; +float roughness; +vec3 normalEC; +float occlusion; +vec3 emissive; +#ifdef USE_SPECULAR +float specularWeight; +#endif +#ifdef USE_ANISOTROPY +vec3 anisotropicT; +vec3 anisotropicB; +float anisotropyStrength; +#endif +#ifdef USE_CLEARCOAT +float clearcoatFactor; +float clearcoatRoughness; +vec3 clearcoatNormal; +#endif +}; +`;var zF=`struct czm_modelVertexOutput { +vec3 positionMC; +float pointSize; +}; +`;var VF=`struct czm_ray +{ +vec3 origin; +vec3 direction; +}; +`;var jF=`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 HF=`struct czm_shadowParameters +{ +#ifdef USE_CUBE_MAP_SHADOW +vec3 texCoords; +#else +vec2 texCoords; +#endif +float depthBias; +float depth; +float nDotL; +vec2 texelStepSize; +float normalShadingSmooth; +float darkness; +}; +`;var GF=`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 MF=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) +`;var WF=`float czm_alphaWeight(float a) { -vec4 p = positionEC; -vec4 zEyeOffset = normalize(p) * eyeOffset.z; -p.xy += eyeOffset.xy + zEyeOffset.xy; -p.z += zEyeOffset.z; -return p; +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 NF=`vec3 czm_eyeToCartographicDelta(vec3 positionEC) +`;var qF=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) { -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); +float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); +float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); +val1 = val1 * (1.0 - val2); +val1 = val1 * val1 * (3.0 - (2.0 * val1)); +val1 = pow(val1, 0.5); +vec4 midColor = (color1 + color2) * 0.5; +return mix(midColor, currentColor, val1); } -`;var LF=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) +vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { -vec4 q = czm_projection * positionEC; -q.xyz /= q.w; -q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; -return q; +return czm_antialias(color1, color2, currentColor, dist, 0.1); } -`;var FF=`float czm_fastApproximateAtan(float x) { -return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); +`;var YF=`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); +if (ignoreBlackPixels) { +hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0; +} else { +hsb.z = hsb.z + hsbShift.z; } -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; +hsb.z = clamp(hsb.z, 0.0, 1.0); +return czm_HSBToRGB(hsb); } -`;var BF=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) -{ -float scalar = distanceToCamera * czm_fogDensity; -float fog = 1.0 - exp(-(scalar * scalar)); -return mix(color, fogColor, fog); +`;var XF=`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); } -vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) -{ -float scalar = distanceToCamera * czm_fogDensity; -float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); -return mix(color, fogColor, fog); +`;var KF=`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 kF=`vec3 czm_gammaCorrect(vec3 color) { -#ifdef HDR -color = pow(color, vec3(czm_gamma)); -#endif -return color; +`;var $F=`bool czm_backFacing() +{ +return gl_FrontFacing == false; } -vec4 czm_gammaCorrect(vec4 color) { -#ifdef HDR -color.rgb = pow(color.rgb, vec3(czm_gamma)); -#endif -return color; +`;var JF=`float czm_branchFreeTernary(bool comparison, float a, float b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var UF=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) -{ -return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); +vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var zF=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) -{ -czm_material material; -material.diffuse = vec3(0.0); -material.specular = 0.0; -material.shininess = 1.0; -material.normal = materialInput.normalEC; -material.emission = vec3(0.0); -material.alpha = 1.0; -return material; +vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;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; -vec3 lightDirection = -positionWC * float(lightEnum == NONE) + -czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) + -czm_sunDirectionWC * float(lightEnum == SUNLIGHT); -return normalize(lightDirection); +vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { +float useA = float(comparison); +return a * useA + b * (1.0 - useA); } -`;var jF=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) +`;var ZF=`vec4 czm_cascadeColor(vec4 weights) { -return max(dot(lightDirectionEC, normalEC), 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; } -`;var HF=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) +`;var QF=`uniform vec4 shadowMap_cascadeDistances; +float czm_cascadeDistance(vec4 weights) { -vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); -float specular = max(dot(toReflectedLight, toEyeEC), 0.0); -return pow(specular, max(shininess, czm_epsilon2)); +return dot(shadowMap_cascadeDistances, weights); } -`;var GF=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) +`;var eB=`uniform mat4 shadowMap_cascadeMatrices[4]; +mat4 czm_cascadeMatrix(vec4 weights) { -float cosAngle = cos(angleInRadians); -float sinAngle = sin(angleInRadians); -vec2 s0 = vec2(1.0/17.0, 0.0); -vec2 s1 = vec2(-1.0/29.0, 0.0); -vec2 s2 = vec2(1.0/101.0, 1.0/59.0); -vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); -s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); -s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); -s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); -s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); -vec2 uv0 = (uv/103.0) + (time * s0); -vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); -vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); -vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); -uv0 = fract(uv0); -uv1 = fract(uv1); -uv2 = fract(uv2); -uv3 = fract(uv3); -vec4 noise = (texture(normalMap, uv0)) + -(texture(normalMap, uv1)) + -(texture(normalMap, uv2)) + -(texture(normalMap, uv3)); -return ((noise / 4.0) - 0.5) * 2.0; +return shadowMap_cascadeMatrices[0] * weights.x + +shadowMap_cascadeMatrices[1] * weights.y + +shadowMap_cascadeMatrices[2] * weights.z + +shadowMap_cascadeMatrices[3] * weights.w; } -`;var WF=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); -vec3 czm_HSBToRGB(vec3 hsb) +`;var tB=`uniform vec4 shadowMap_cascadeSplits[2]; +vec4 czm_cascadeWeights(float depthEye) { -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); +vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); +vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); +return near * far; } -`;var qF=`vec3 hueToRGB(float hue) +`;var nB=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { -float r = abs(hue * 6.0 - 3.0) - 1.0; -float g = 2.0 - abs(hue * 6.0 - 2.0); -float b = 2.0 - abs(hue * 6.0 - 4.0); -return clamp(vec3(r, g, b), 0.0, 1.0); -} -vec3 czm_HSLToRGB(vec3 hsl) -{ -vec3 rgb = hueToRGB(hsl.x); -float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; -return (rgb - 0.5) * c + hsl.z; -} -`;var YF=`vec3 czm_hue(vec3 rgb, float adjustment) -{ -const mat3 toYIQ = mat3(0.299, 0.587, 0.114, -0.595716, -0.274453, -0.321263, -0.211456, -0.522591, 0.311135); -const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, -1.0, -0.2721, -0.6474, -1.0, -1.107, 1.7046); -vec3 yiq = toYIQ * rgb; -float hue = atan(yiq.z, yiq.y) + adjustment; -float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); -vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); -return toRGB * color; -} -`;var XF=`vec3 czm_inverseGamma(vec3 color) { -return pow(color, vec3(1.0 / czm_gamma)); -} -`;var KF=`bool czm_isEmpty(czm_raySegment interval) -{ -return (interval.stop < 0.0); -} -`;var $F=`bool czm_isFull(czm_raySegment interval) -{ -return (interval.start == 0.0 && interval.stop == czm_infinity); -} -`;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 ZF=`vec3 czm_linearToSrgb(vec3 linearIn) -{ -return pow(linearIn, vec3(1.0/2.2)); -} -vec4 czm_linearToSrgb(vec4 linearIn) -{ -vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); -return vec4(srgbOut, linearIn.a); -} -`;var 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 eB=`float czm_luminance(vec3 rgb) -{ -const vec3 W = vec3(0.2125, 0.7154, 0.0721); -return dot(rgb, W); -} -`;var tB=`float czm_maximumComponent(vec2 v) -{ -return max(v.x, v.y); -} -float czm_maximumComponent(vec3 v) -{ -return max(max(v.x, v.y), v.z); -} -float czm_maximumComponent(vec4 v) -{ -return max(max(max(v.x, v.y), v.z), v.w); -} -`;var nB=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) -{ -float width = czm_viewport.z; -float height = czm_viewport.w; -float pixelWidth; -float pixelHeight; -float top = czm_frustumPlanes.x; -float bottom = czm_frustumPlanes.y; -float left = czm_frustumPlanes.z; -float right = czm_frustumPlanes.w; -if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) -{ -float frustumWidth = right - left; -float frustumHeight = top - bottom; -pixelWidth = frustumWidth / width; -pixelHeight = frustumHeight / height; -} -else -{ -float distanceToPixel = -positionEC.z; -float inverseNear = 1.0 / czm_currentFrustum.x; -float tanTheta = top * inverseNear; -pixelHeight = 2.0 * distanceToPixel * tanTheta / height; -tanTheta = right * inverseNear; -pixelWidth = 2.0 * distanceToPixel * tanTheta / width; -} -return max(pixelWidth, pixelHeight) * pixelRatio; +vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time; +return vec4(p, 1.0); } -float czm_metersPerPixel(vec4 positionEC) -{ -return czm_metersPerPixel(positionEC, czm_pixelRatio); +`;var iB=`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); } -`;var iB=`vec4 czm_modelToWindowCoordinates(vec4 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; +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); } -`;var rB=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) -{ -const vec3 W = vec3(0.2125, 0.7154, 0.0721); -vec3 target = left * right; -float leftLuminance = dot(left, W); -float rightLuminance = dot(right, W); -float targetLuminance = dot(target, W); -return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; +`;var rB=`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 oB=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) -{ -float valueAtMin = nearFarScalar.y; -float valueAtMax = nearFarScalar.w; -float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; -float farDistanceSq = nearFarScalar.z * nearFarScalar.z; -float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); -t = pow(clamp(t, 0.0, 1.0), 0.2); -return mix(valueAtMin, valueAtMax, t); +`;var oB=`vec4 czm_computePosition(); +`;var sB=`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; } -`;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); +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; } -encoded = encoded / range * 2.0 - 1.0; -vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); -if (v.z < 0.0) -{ -v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); +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; } -return normalize(v); +vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); +float lightHeight = length(lightPosition) - atmosphereInnerRadius; +lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; +lightPositionLength += lightStepLength; } -vec3 czm_octDecode(vec2 encoded) -{ -return czm_octDecode(encoded, 255.0); +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); } -vec3 czm_octDecode(float encoded) -{ -float temp = encoded / 256.0; -float x = floor(temp); -float y = (temp - x) * 256.0; -return czm_octDecode(vec2(x, y)); +rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation; +mieColor = czm_atmosphereMieCoefficient * mieAccumulation; +opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x)))); } -void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) +`;var aB=`vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform) { -float temp = encoded.x / 65536.0; -float x = floor(temp); -float encodedFloat1 = (temp - x) * 65536.0; -temp = encoded.y / 65536.0; -float y = floor(temp); -float encodedFloat2 = (temp - y) * 65536.0; -vector1 = czm_octDecode(encodedFloat1); -vector2 = czm_octDecode(encodedFloat2); -vector3 = czm_octDecode(vec2(x, y)); +return vec2(textureTransform * vec3(texCoord, 1.0)); } -`;var aB=`vec4 czm_packDepth(float depth) +`;var cB=`vec2 cordic(float angle) { -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; +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; } -`;var cB=`vec3 lambertianDiffuse(vec3 diffuseColor) +vec2 czm_cosineAndSine(float angle) { -return diffuseColor / czm_pi; +if (angle < -czm_piOverTwo || angle > czm_piOverTwo) +{ +if (angle < 0.0) +{ +return -cordic(angle + czm_pi); } -vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) +else { -float versine = 1.0 - VdotH; -float versineSquared = versine * versine; -return f0 + (f90 - f0) * versineSquared * versineSquared * versine; +return -cordic(angle - czm_pi); } -#ifdef USE_ANISOTROPY -float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection) +} +else { -vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0); -float GGXV = lightDirection.z * length(roughnessScale * viewDirection); -float GGXL = viewDirection.z * length(roughnessScale * lightDirection); -float v = 0.5 / (GGXV + GGXL); -return clamp(v, 0.0, 1.0); +return cordic(angle); } -float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection) +} +`;var lB=`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 uB=`vec2 czm_decompressTextureCoordinates(float encoded) { -float roughnessSquared = bitangentRoughness * tangentialRoughness; -vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared); -float w2 = roughnessSquared / dot(f, f); -return roughnessSquared * w2 * w2 / czm_pi; +float temp = encoded / 4096.0; +float xZeroTo4095 = floor(temp); +float stx = xZeroTo4095 / 4095.0; +float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; +return vec2(stx, sty); } +`;var fB=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) +out float v_WindowZ; #endif -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +vec4 czm_depthClamp(vec4 coords) { -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) +#ifndef LOG_DEPTH +#if __VERSION__ == 300 || defined(GL_EXT_frag_depth) +v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; +coords.z = 0.0; +#else +coords.z = min(coords.z, coords.w); +#endif +#endif +return coords; +} +`;var dB=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { -return 0.5 / GGX; +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); } -return 0.0; +`;var hB=`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); } -float GGX(float alphaRoughness, float NdotH) +`;var mB=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal) { -float alphaRoughnessSquared = alphaRoughness * alphaRoughness; -float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0; -return alphaRoughnessSquared / (czm_pi * f * f); +return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } -float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness) +`;var pB=`bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { +return all(lessThanEqual(abs(left - right), vec4(epsilon))); +} +bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { +return all(lessThanEqual(abs(left - right), vec3(epsilon))); +} +bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { +return all(lessThanEqual(abs(left - right), vec2(epsilon))); +} +bool czm_equalsEpsilon(float left, float right, float epsilon) { +return (abs(left - right) <= epsilon); +} +`;var gB=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { -float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0); -float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); -float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); -float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0); -float D = GGX(alphaRoughness, NdotH); -return G * D; +vec4 p = positionEC; +vec4 zEyeOffset = normalize(p) * eyeOffset.z; +p.xy += eyeOffset.xy + zEyeOffset.xy; +p.z += zEyeOffset.z; +return p; } -vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material) +`;var _B=`vec3 czm_eyeToCartographicDelta(vec3 positionEC) { -vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC); -float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0); -float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0); -vec3 f0 = material.specular; -float reflectance = czm_maximumComponent(f0); -vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); -vec3 F = fresnelSchlick2(f0, f90, VdotH); -#if defined(USE_SPECULAR) -F *= material.specularWeight; -#endif -float alphaRoughness = material.roughness * material.roughness; -#ifdef USE_ANISOTROPY -mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC); -vec3 lightDirection = lightDirectionEC * tbn; -vec3 viewDirection = viewDirectionEC * tbn; -vec3 halfwayDirection = halfwayDirectionEC * tbn; -float anisotropyStrength = material.anisotropyStrength; -float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength); -float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0); -float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection); -float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection); -vec3 specularContribution = F * G * D; -#else -float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness); -vec3 specularContribution = F * specularStrength; -#endif -vec3 diffuseColor = material.diffuse; -vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); -return (diffuseContribution + specularContribution) * NdotL; -} -`;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)); -float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04); -color -= offset; -float peak = max(color.r, max(color.g, color.b)); -if (peak < startCompression) return color; -const float d = 1.0 - startCompression; -float newPeak = 1.0 - d * d / (peak + d - startCompression); -color *= newPeak / peak; -float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0); -return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g); +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 uB=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) +`;var yB=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { -return czm_getLambertDiffuse(lightDirectionEC, material.normal); +vec4 q = czm_projection * positionEC; +q.xyz /= q.w; +q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; +return q; } -float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) -{ -return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); +`;var AB=`float czm_fastApproximateAtan(float x) { +return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } -vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) -{ -float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); -if (czm_sceneMode == czm_sceneMode3D) { -diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); +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; } -float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); -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 bB=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) +{ +float scalar = distanceToCamera * czm_fogDensity; +float fog = 1.0 - exp(-(scalar * scalar)); +return mix(color, fogColor, fog); } -vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) { -float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); -float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); -vec3 ambient = vec3(0.0); -vec3 color = ambient + material.emission; -color += material.diffuse * diffuse * czm_lightColor; -color += material.specular * specular * czm_lightColor; -return vec4(color, material.alpha); +float scalar = distanceToCamera * czm_fogDensity; +float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); +return mix(color, fogColor, fog); } -`;var fB=`float czm_planeDistance(vec4 plane, vec3 point) { -return (dot(plane.xyz, point) + plane.w); +`;var xB=`vec3 czm_gammaCorrect(vec3 color) { +#ifdef HDR +color = pow(color, vec3(czm_gamma)); +#endif +return color; } -float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { -return (dot(planeNormal, point) + planeDistance); +vec4 czm_gammaCorrect(vec4 color) { +#ifdef HDR +color.rgb = pow(color.rgb, vec3(czm_gamma)); +#endif +return color; } -`;var dB=`vec3 czm_pointAlongRay(czm_ray ray, float time) +`;var TB=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { -return ray.origin + (time * ray.direction); +return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } -`;var hB=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) +`;var EB=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput) { -vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; -vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; -q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; -float q2 = dot(q, q); -float qw = dot(q, w); -if (q2 > 1.0) +czm_material material; +material.diffuse = vec3(0.0); +material.specular = 0.0; +material.shininess = 1.0; +material.normal = materialInput.normalEC; +material.emission = vec3(0.0); +material.alpha = 1.0; +return material; +} +`;var CB=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) { +const float NONE = 0.0; +const float SCENE_LIGHT = 1.0; +const float SUNLIGHT = 2.0; +vec3 lightDirection = +positionWC * float(lightEnum == NONE) + +czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) + +czm_sunDirectionWC * float(lightEnum == SUNLIGHT); +return normalize(lightDirection); +} +`;var vB=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { -if (qw >= 0.0) +return max(dot(lightDirectionEC, normalEC), 0.0); +} +`;var SB=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { -return czm_emptyRaySegment; +vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); +float specular = max(dot(toReflectedLight, toEyeEC), 0.0); +return pow(specular, max(shininess, czm_epsilon2)); } -else +`;var wB=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) { -float qw2 = qw * qw; -float difference = q2 - 1.0; -float w2 = dot(w, w); -float product = w2 * difference; -if (qw2 < product) +float cosAngle = cos(angleInRadians); +float sinAngle = sin(angleInRadians); +vec2 s0 = vec2(1.0/17.0, 0.0); +vec2 s1 = vec2(-1.0/29.0, 0.0); +vec2 s2 = vec2(1.0/101.0, 1.0/59.0); +vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); +s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); +s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); +s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); +s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); +vec2 uv0 = (uv/103.0) + (time * s0); +vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); +vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); +vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); +uv0 = fract(uv0); +uv1 = fract(uv1); +uv2 = fract(uv2); +uv3 = fract(uv3); +vec4 noise = (texture(normalMap, uv0)) + +(texture(normalMap, uv1)) + +(texture(normalMap, uv2)) + +(texture(normalMap, uv3)); +return ((noise / 4.0) - 0.5) * 2.0; +} +`;var IB=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 czm_HSBToRGB(vec3 hsb) { -return czm_emptyRaySegment; +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); } -else if (qw2 > product) +`;var PB=`vec3 hueToRGB(float hue) { -float discriminant = qw * qw - product; -float temp = -qw + sqrt(discriminant); -float root0 = temp / w2; -float root1 = difference / temp; -if (root0 < root1) +float r = abs(hue * 6.0 - 3.0) - 1.0; +float g = 2.0 - abs(hue * 6.0 - 2.0); +float b = 2.0 - abs(hue * 6.0 - 4.0); +return clamp(vec3(r, g, b), 0.0, 1.0); +} +vec3 czm_HSLToRGB(vec3 hsl) { -czm_raySegment i = czm_raySegment(root0, root1); -return i; +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; } -else +`;var DB=`vec3 czm_hue(vec3 rgb, float adjustment) { -czm_raySegment i = czm_raySegment(root1, root0); -return i; +const mat3 toYIQ = mat3(0.299, 0.587, 0.114, +0.595716, -0.274453, -0.321263, +0.211456, -0.522591, 0.311135); +const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, +1.0, -0.2721, -0.6474, +1.0, -1.107, 1.7046); +vec3 yiq = toYIQ * rgb; +float hue = atan(yiq.z, yiq.y) + adjustment; +float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); +vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); +return toRGB * color; } +`;var RB=`vec3 czm_inverseGamma(vec3 color) { +return pow(color, vec3(1.0 / czm_gamma)); } -else +`;var OB=`bool czm_isEmpty(czm_raySegment interval) { -float root = sqrt(difference / w2); -czm_raySegment i = czm_raySegment(root, root); -return i; +return (interval.stop < 0.0); } +`;var MB=`bool czm_isFull(czm_raySegment interval) +{ +return (interval.start == 0.0 && interval.stop == czm_infinity); } +`;var NB=`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; } -else if (q2 < 1.0) +`;var LB=`vec3 czm_linearToSrgb(vec3 linearIn) { -float difference = q2 - 1.0; -float w2 = dot(w, w); -float product = w2 * difference; -float discriminant = qw * qw - product; -float temp = -qw + sqrt(discriminant); -czm_raySegment i = czm_raySegment(0.0, temp / w2); -return i; +return pow(linearIn, vec3(1.0/2.2)); } -else +vec4 czm_linearToSrgb(vec4 linearIn) { -if (qw < 0.0) +vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); +return vec4(srgbOut, linearIn.a); +} +`;var FB=`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 BB=`float czm_luminance(vec3 rgb) { -float w2 = dot(w, w); -czm_raySegment i = czm_raySegment(0.0, -qw / w2); -return i; +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +return dot(rgb, W); } -else +`;var kB=`float czm_maximumComponent(vec2 v) { -return czm_emptyRaySegment; +return max(v.x, v.y); } +float czm_maximumComponent(vec3 v) +{ +return max(max(v.x, v.y), v.z); } +float czm_maximumComponent(vec4 v) +{ +return max(max(max(v.x, v.y), v.z), v.w); } -`;var mB=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +`;var UB=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio) { -vec3 o = ray.origin; -vec3 d = ray.direction; -vec3 oc = o - center; -float a = dot(d, d); -float b = 2.0 * dot(d, oc); -float c = dot(oc, oc) - (radius * radius); -float det = (b * b) - (4.0 * a * c); -if (det < 0.0) { -return czm_emptyRaySegment; -} -float sqrtDet = sqrt(det); -float t0 = (-b - sqrtDet) / (2.0 * a); -float t1 = (-b + sqrtDet) / (2.0 * a); -czm_raySegment result = czm_raySegment(t0, t1); -return result; -} -`;var pB=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +float width = czm_viewport.z; +float height = czm_viewport.w; +float pixelWidth; +float pixelHeight; +float top = czm_frustumPlanes.x; +float bottom = czm_frustumPlanes.y; +float left = czm_frustumPlanes.z; +float right = czm_frustumPlanes.w; +if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) { -return czm_reverseLogDepth(texture(depthTexture, texCoords).r); -} -`;var gB=`float czm_readNonPerspective(float value, float oneOverW) { -return value * oneOverW; -} -vec2 czm_readNonPerspective(vec2 value, float oneOverW) { -return value * oneOverW; +float frustumWidth = right - left; +float frustumHeight = top - bottom; +pixelWidth = frustumWidth / width; +pixelHeight = frustumHeight / height; } -vec3 czm_readNonPerspective(vec3 value, float oneOverW) { -return value * oneOverW; +else +{ +float distanceToPixel = -positionEC.z; +float inverseNear = 1.0 / czm_currentFrustum.x; +float tanTheta = top * inverseNear; +pixelHeight = 2.0 * distanceToPixel * tanTheta / height; +tanTheta = right * inverseNear; +pixelWidth = 2.0 * distanceToPixel * tanTheta / width; } -vec4 czm_readNonPerspective(vec4 value, float oneOverW) { -return value * oneOverW; +return max(pixelWidth, pixelHeight) * pixelRatio; } -`;var _B=`float czm_reverseLogDepth(float logZ) +float czm_metersPerPixel(vec4 positionEC) { -#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; +return czm_metersPerPixel(positionEC, czm_pixelRatio); } -`;var yB=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); -vec3 czm_RGBToHSB(vec3 rgb) +`;var zB=`vec4 czm_modelToWindowCoordinates(vec4 position) { -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); +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 AB=`vec3 RGBtoHCV(vec3 rgb) +`;var VB=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { -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); +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +vec3 target = left * right; +float leftLuminance = dot(left, W); +float rightLuminance = dot(right, W); +float targetLuminance = dot(target, W); +return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } -vec3 czm_RGBToHSL(vec3 rgb) +`;var jB=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { -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); +float valueAtMin = nearFarScalar.y; +float valueAtMax = nearFarScalar.w; +float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; +float farDistanceSq = nearFarScalar.z * nearFarScalar.z; +float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); +t = pow(clamp(t, 0.0, 1.0), 0.2); +return mix(valueAtMin, valueAtMax, t); } -`;var bB=`vec3 czm_RGBToXYZ(vec3 rgb) +`;var HB=`vec3 czm_octDecode(vec2 encoded, float range) { -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 xB=`float czm_round(float value) { -return floor(value + 0.5); -} -vec2 czm_round(vec2 value) { -return floor(value + 0.5); +if (encoded.x == 0.0 && encoded.y == 0.0) { +return vec3(0.0, 0.0, 0.0); } -vec3 czm_round(vec3 value) { -return floor(value + 0.5); +encoded = encoded / range * 2.0 - 1.0; +vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); +if (v.z < 0.0) +{ +v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); } -vec4 czm_round(vec4 value) { -return floor(value + 0.5); +return normalize(v); } -`;var TB=`vec3 czm_saturation(vec3 rgb, float adjustment) +vec3 czm_octDecode(vec2 encoded) { -const vec3 W = vec3(0.2125, 0.7154, 0.0721); -vec3 intensity = vec3(dot(rgb, W)); -return mix(intensity, rgb, adjustment); +return czm_octDecode(encoded, 255.0); } -`;var EB=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) +vec3 czm_octDecode(float encoded) { -return czm_unpackDepth(czm_textureCube(shadowMap, d)); +float temp = encoded / 256.0; +float x = floor(temp); +float y = (temp - x) * 256.0; +return czm_octDecode(vec2(x, y)); } -float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) +void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) { -#ifdef USE_SHADOW_DEPTH_TEXTURE -return texture(shadowMap, uv).r; -#else -return czm_unpackDepth(texture(shadowMap, uv)); -#endif +float temp = encoded.x / 65536.0; +float x = floor(temp); +float encodedFloat1 = (temp - x) * 65536.0; +temp = encoded.y / 65536.0; +float y = floor(temp); +float encodedFloat2 = (temp - y) * 65536.0; +vector1 = czm_octDecode(encodedFloat1); +vector2 = czm_octDecode(encodedFloat2); +vector3 = czm_octDecode(vec2(x, y)); } -float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) +`;var GB=`vec4 czm_packDepth(float depth) { -return step(depth, czm_sampleShadowMap(shadowMap, uv)); +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; } -float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) +`;var WB=`vec3 lambertianDiffuse(vec3 diffuseColor) { -return step(depth, czm_sampleShadowMap(shadowMap, uv)); +return diffuseColor / czm_pi; } -`;var CB=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) { -#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; +float versine = 1.0 - VdotH; +float versineSquared = versine * versine; +return f0 + (f90 - f0) * versineSquared * versineSquared * versine; } -#ifdef USE_CUBE_MAP_SHADOW -float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +#ifdef USE_ANISOTROPY +float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection) { -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); +vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0); +float GGXV = lightDirection.z * length(roughnessScale * viewDirection); +float GGXL = viewDirection.z * length(roughnessScale * lightDirection); +float v = 0.5 / (GGXV + GGXL); +return clamp(v, 0.0, 1.0); } -#else -float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) +float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection) { -float depthBias = shadowParameters.depthBias; -float depth = shadowParameters.depth; -float nDotL = shadowParameters.nDotL; -float normalShadingSmooth = shadowParameters.normalShadingSmooth; -float darkness = shadowParameters.darkness; -vec2 uv = shadowParameters.texCoords; -depth -= depthBias; -#ifdef USE_SOFT_SHADOWS -vec2 texelStepSize = shadowParameters.texelStepSize; -float radius = 1.0; -float dx0 = -texelStepSize.x * radius; -float dy0 = -texelStepSize.y * radius; -float dx1 = texelStepSize.x * radius; -float dy1 = texelStepSize.y * radius; -float visibility = ( -czm_shadowDepthCompare(shadowMap, uv, depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + -czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) -) * (1.0 / 9.0); -#else -float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); -#endif -return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); +float roughnessSquared = bitangentRoughness * tangentialRoughness; +vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared); +float w2 = roughnessSquared / dot(f, f); +return roughnessSquared * w2 * w2 / czm_pi; } #endif -`;var vB=`float czm_signNotZero(float value) +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) { -return value >= 0.0 ? 1.0 : -1.0; -} -vec2 czm_signNotZero(vec2 value) +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 vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); +return 0.5 / GGX; } -vec3 czm_signNotZero(vec3 value) +return 0.0; +} +float GGX(float alphaRoughness, float NdotH) { -return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0; +return alphaRoughnessSquared / (czm_pi * f * f); } -vec4 czm_signNotZero(vec4 value) +float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness) { -return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); +float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0); +float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); +float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); +float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0); +float D = GGX(alphaRoughness, NdotH); +return G * D; } -`;var SB=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial 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 wB=`vec3 czm_srgbToLinear(vec3 srgbIn) -{ -return pow(srgbIn, vec3(2.2)); -} -vec4 czm_srgbToLinear(vec4 srgbIn) -{ -vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); -return vec4(linearOut, srgbIn.a); -} -`;var IB=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) -{ -vec3 normal = normalize(normalEC); -vec3 tangent = normalize(tangentEC); -vec3 bitangent = normalize(bitangentEC); -return mat3(tangent.x , tangent.y , tangent.z, -bitangent.x, bitangent.y, bitangent.z, -normal.x , normal.y , normal.z); -} -`;var PB=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { -#if __VERSION__ == 300 -return texture(sampler, p); -#else -return textureCube(sampler, p); +vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC); +float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0); +float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0); +vec3 f0 = material.specular; +float reflectance = czm_maximumComponent(f0); +vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); +vec3 F = fresnelSchlick2(f0, f90, VdotH); +#if defined(USE_SPECULAR) +F *= material.specularWeight; #endif -} -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); +float alphaRoughness = material.roughness * material.roughness; +#ifdef USE_ANISOTROPY +mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC); +vec3 lightDirection = lightDirectionEC * tbn; +vec3 viewDirection = viewDirectionEC * tbn; +vec3 halfwayDirection = halfwayDirectionEC * tbn; +float anisotropyStrength = material.anisotropyStrength; +float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength); +float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0); +float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection); +float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection); +vec3 specularContribution = F * G * D; +#else +float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness); +vec3 specularContribution = F * specularStrength; #endif +vec3 diffuseColor = material.diffuse; +vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); +return (diffuseContribution + specularContribution) * NdotL; } -`;var DB=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { -vec4 transformedPlane = transform * plane; -float normalMagnitude = length(transformedPlane.xyz); -return transformedPlane / normalMagnitude; +`;var qB=`vec3 czm_pbrNeutralTonemapping(vec3 color) { +const float startCompression = 0.8 - 0.04; +const float desaturation = 0.15; +float x = min(color.r, min(color.g, color.b)); +float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04); +color -= offset; +float peak = max(color.r, max(color.g, color.b)); +if (peak < startCompression) return color; +const float d = 1.0 - startCompression; +float newPeak = 1.0 - d * d / (peak + d - startCompression); +color *= newPeak / peak; +float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0); +return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g); } -`;var RB=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +`;var YB=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { -vec3 highDifference = high - czm_encodedCameraPositionMCHigh; -if (length(highDifference) == 0.0) { -highDifference = vec3(0); +return czm_getLambertDiffuse(lightDirectionEC, material.normal); } -vec3 lowDifference = low - czm_encodedCameraPositionMCLow; -return vec4(highDifference + lowDifference, 1.0); +float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) +{ +return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); } -`;var OB=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); +float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); if (czm_sceneMode == czm_sceneMode3D) { -diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); +diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); } -diffuse = clamp(diffuse, 0.0, 1.0); -float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); +float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); vec3 materialDiffuse = material.diffuse * 0.5; vec3 ambient = materialDiffuse; vec3 color = ambient + material.emission; @@ -1557,2580 +1728,1714 @@ color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var MB=`mat2 czm_transpose(mat2 matrix) +vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -return mat2( -matrix[0][0], matrix[1][0], -matrix[0][1], matrix[1][1]); +float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); +float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); +vec3 ambient = vec3(0.0); +vec3 color = ambient + material.emission; +color += material.diffuse * diffuse * czm_lightColor; +color += material.specular * specular * czm_lightColor; +return vec4(color, material.alpha); } -mat3 czm_transpose(mat3 matrix) +`;var XB=`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 KB=`vec3 czm_pointAlongRay(czm_ray ray, float time) { -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]); +return ray.origin + (time * ray.direction); } -mat4 czm_transpose(mat4 matrix) +`;var $B=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { -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]); +vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; +vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; +q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; +float q2 = dot(q, q); +float qw = dot(q, w); +if (q2 > 1.0) +{ +if (qw >= 0.0) +{ +return czm_emptyRaySegment; } -`;var NB=`float czm_unpackDepth(vec4 packedDepth) +else { -return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); +float qw2 = qw * qw; +float difference = q2 - 1.0; +float w2 = dot(w, w); +float product = w2 * difference; +if (qw2 < product) +{ +return czm_emptyRaySegment; } -`;var LB=`float czm_unpackFloat(vec4 packedFloat) +else if (qw2 > product) { -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) +float discriminant = qw * qw - product; +float temp = -qw + sqrt(discriminant); +float root0 = temp / w2; +float root1 = difference / temp; +if (root0 < root1) { -return 0.0; +czm_raySegment i = czm_raySegment(root0, root1); +return i; } -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; +else +{ +czm_raySegment i = czm_raySegment(root1, root0); +return i; } -`;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); +else +{ +float root = sqrt(difference / w2); +czm_raySegment i = czm_raySegment(root, root); +return i; } -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); +else if (q2 < 1.0) +{ +float difference = q2 - 1.0; +float w2 = dot(w, w); +float product = w2 * difference; +float discriminant = qw * qw - product; +float temp = -qw + sqrt(discriminant); +czm_raySegment i = czm_raySegment(0.0, temp / w2); +return i; } -int czm_unpackUint(vec2 packedValue) { -vec2 rounded = czm_round(packedValue * 255.0); -return int(dot(rounded, vec2(1.0, 256.0))); +else +{ +if (qw < 0.0) +{ +float w2 = dot(w, w); +czm_raySegment i = czm_raySegment(0.0, -qw / w2); +return i; } -int czm_unpackUint(vec3 packedValue) { -vec3 rounded = czm_round(packedValue * 255.0); -return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); +else +{ +return czm_emptyRaySegment; } -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 kB=`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; +`;var JB=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) +{ +vec3 o = ray.origin; +vec3 d = ray.direction; +vec3 oc = o - center; +float a = dot(d, d); +float b = 2.0 * dot(d, oc); +float c = dot(oc, oc) - (radius * radius); +float det = (b * b) - (4.0 * a * c); +if (det < 0.0) { +return czm_emptyRaySegment; } -vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { -return scale * value + offset; +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; } -vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { -return scale * value + offset; +`;var ZB=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) +{ +return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } -mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { -return matrixCompMult(scale, value) + offset; +`;var QB=`float czm_readNonPerspective(float value, float oneOverW) { +return value * oneOverW; } -mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { -return matrixCompMult(scale, value) + offset; +vec2 czm_readNonPerspective(vec2 value, float oneOverW) { +return value * oneOverW; } -mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { -return matrixCompMult(scale, value) + offset; +vec3 czm_readNonPerspective(vec3 value, float oneOverW) { +return value * oneOverW; } -`;var UB=`#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; +vec4 czm_readNonPerspective(vec4 value, float oneOverW) { +return value * oneOverW; } -void czm_vertexLogDepth() +`;var e2=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH -v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; -gl_Position = czm_updatePositionDepth(gl_Position); +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; } -void czm_vertexLogDepth(vec4 clipCoords) +`;var t2=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec3 czm_RGBToHSB(vec3 rgb) { -#ifdef LOG_DEPTH -v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; -czm_updatePositionDepth(clipCoords); -#endif +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 zB=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var n2=`vec3 RGBtoHCV(vec3 rgb) { -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))) +vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); +vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); +float c = q.x - min(q.w, q.y); +float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); +return vec3(h, c, q.x); +} +vec3 czm_RGBToHSL(vec3 rgb) { -q = czm_inverseProjection * q; +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); } -else +`;var i2=`vec3 czm_RGBToXYZ(vec3 rgb) { -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; +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; } -return q; +`;var r2=`float czm_round(float value) { +return floor(value + 0.5); } -vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) +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 o2=`vec3 czm_saturation(vec3 rgb, float adjustment) { -vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; -return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); +const vec3 W = vec3(0.2125, 0.7154, 0.0721); +vec3 intensity = vec3(dot(rgb, W)); +return mix(intensity, rgb, adjustment); } -vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) +`;var s2=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { -#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; +return czm_unpackDepth(czm_textureCube(shadowMap, d)); +} +float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) +{ +#ifdef USE_SHADOW_DEPTH_TEXTURE +return texture(shadowMap, uv).r; #else -vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); -vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); +return czm_unpackDepth(texture(shadowMap, uv)); #endif -return eyeCoordinate; } -vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) +float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) { -vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; -return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); +return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var VB=`#if !defined(LOG_DEPTH) -in float v_WindowZ; -#endif -void czm_writeDepthClamp() +float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { -#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) -gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); -#endif +return step(depth, czm_sampleShadowMap(shadowMap, uv)); } -`;var jB=`#ifdef LOG_DEPTH -in float v_depthFromNearPlusOne; -#ifdef POLYGON_OFFSET -uniform vec2 u_polygonOffset; +`;var a2=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) +{ +#ifdef USE_NORMAL_SHADING +#ifdef USE_NORMAL_SHADING_SMOOTH +float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); +#else +float strength = step(0.0, nDotL); #endif +visibility *= strength; #endif -void czm_writeLogDepth(float depth) -{ -#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) -if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { -discard; +visibility = max(visibility, darkness); +return visibility; } -#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; +#ifdef USE_CUBE_MAP_SHADOW +float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) +{ +float depthBias = shadowParameters.depthBias; +float depth = shadowParameters.depth; +float nDotL = shadowParameters.nDotL; +float normalShadingSmooth = shadowParameters.normalShadingSmooth; +float darkness = shadowParameters.darkness; +vec3 uvw = shadowParameters.texCoords; +depth -= depthBias; +float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); +return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } +#else +float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) +{ +float depthBias = shadowParameters.depthBias; +float depth = shadowParameters.depth; +float nDotL = shadowParameters.nDotL; +float normalShadingSmooth = shadowParameters.normalShadingSmooth; +float darkness = shadowParameters.darkness; +vec2 uv = shadowParameters.texCoords; +depth -= depthBias; +#ifdef USE_SOFT_SHADOWS +vec2 texelStepSize = shadowParameters.texelStepSize; +float radius = 1.0; +float dx0 = -texelStepSize.x * radius; +float dy0 = -texelStepSize.y * radius; +float dx1 = texelStepSize.x * radius; +float dy1 = texelStepSize.y * radius; +float visibility = ( +czm_shadowDepthCompare(shadowMap, uv, depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + +czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) +) * (1.0 / 9.0); +#else +float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); #endif -#endif -gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; -#ifdef POLYGON_OFFSET -gl_FragDepth += czm_epsilon7 * units; -#endif -#endif +return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } -void czm_writeLogDepth() { -#ifdef LOG_DEPTH -czm_writeLogDepth(v_depthFromNearPlusOne); #endif +`;var c2=`float czm_signNotZero(float value) +{ +return value >= 0.0 ? 1.0 : -1.0; } -`;var HB=`float czm_writeNonPerspective(float value, float w) { -return value * w; +vec2 czm_signNotZero(vec2 value) +{ +return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); } -vec2 czm_writeNonPerspective(vec2 value, float w) { -return value * w; +vec3 czm_signNotZero(vec3 value) +{ +return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); } -vec3 czm_writeNonPerspective(vec3 value, float w) { -return value * w; +vec4 czm_signNotZero(vec4 value) +{ +return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -vec4 czm_writeNonPerspective(vec4 value, float w) { -return value * w; +`;var l2=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +{ +vec3 L00 = coefficients[0]; +vec3 L1_1 = coefficients[1]; +vec3 L10 = coefficients[2]; +vec3 L11 = coefficients[3]; +vec3 L2_2 = coefficients[4]; +vec3 L2_1 = coefficients[5]; +vec3 L20 = coefficients[6]; +vec3 L21 = coefficients[7]; +vec3 L22 = coefficients[8]; +float x = normal.x; +float y = normal.y; +float z = normal.z; +vec3 L = +L00 ++ L1_1 * y ++ L10 * z ++ L11 * x ++ L2_2 * (y * x) ++ L2_1 * (y * z) ++ L20 * (3.0 * z * z - 1.0) ++ L21 * (z * x) ++ L22 * (x * x - y * y); +return max(L, vec3(0.0)); } -`;var GB=`vec3 czm_XYZToRGB(vec3 Yxy) +`;var u2=`vec3 czm_srgbToLinear(vec3 srgbIn) { -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; +return pow(srgbIn, vec3(2.2)); } -`;var $E={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};var L4e=new h;function Mt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ya={};Ya[te.FLOAT]="float";Ya[te.FLOAT_VEC2]="vec2";Ya[te.FLOAT_VEC3]="vec3";Ya[te.FLOAT_VEC4]="vec4";Ya[te.INT]="int";Ya[te.INT_VEC2]="ivec2";Ya[te.INT_VEC3]="ivec3";Ya[te.INT_VEC4]="ivec4";Ya[te.BOOL]="bool";Ya[te.BOOL_VEC2]="bvec2";Ya[te.BOOL_VEC3]="bvec3";Ya[te.BOOL_VEC4]="bvec4";Ya[te.FLOAT_MAT2]="mat2";Ya[te.FLOAT_MAT3]="mat3";Ya[te.FLOAT_MAT4]="mat4";Ya[te.SAMPLER_2D]="sampler2D";Ya[te.SAMPLER_CUBE]="samplerCube";Mt.prototype.getDeclaration=function(e){let t=`uniform ${Ya[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var F4e={czm_viewport:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Mt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Mt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,L4e)}}),czm_frameNumber:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Mt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Mt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Mt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Mt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Mt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Mt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Mt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Mt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},N_=F4e;function B4e(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 WB=B4e;function bue(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 xue(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=bue(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Tue(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=xue(i,Sa._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),Tue(r,t)}}))}function k4e(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 U4e(e){let t=[],n=xue("main",e,t);Tue(n,t),k4e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} -`;return i.replace(n.glslSource,"")}function Eue(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` -#line 0 -${r[g]}`;i=bue(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; +vec4 czm_srgbToLinear(vec4 srgbIn) +{ +vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); +return vec4(linearOut, srgbIn.a); +} +`;var f2=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +{ +vec3 normal = normalize(normalEC); +vec3 tangent = normalize(tangentEC); +vec3 bitangent = normalize(bitangentEC); +return mat3(tangent.x , tangent.y , tangent.z, +bitangent.x, bitangent.y, bitangent.z, +normal.x , normal.y , normal.z); +} +`;var d2=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { +#if __VERSION__ == 300 +return texture(sampler, p); #else - precision mediump float; - precision mediump int; - #define highp mediump -#endif -`),n.webgl2&&(c+=`precision highp sampler3D; - -`);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&&(c+=`#define OES_texture_float - -`);let d="";e.includeBuiltIns&&(d=U4e(i)),c+=` -#line 0 -`;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; - -`),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 Eue(this,!1,e)};Sa.prototype.createCombinedFragmentShader=function(e){return Eue(this,!0,e)};Sa._czmBuiltinsAndUniforms={};for(let e in $E)$E.hasOwnProperty(e)&&(Sa._czmBuiltinsAndUniforms[e]=$E[e]);for(let e in N_)if(N_.hasOwnProperty(e)){let t=N_[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; -}`};Sa.createPickFragmentShaderSource=function(e,t){let n=Sa.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; -void main() -{ - czm_old_main(); - if (out_FragColor.a == 0.0) { - discard; - } - out_FragColor = czm_pickColor; -}`;return`${n} -${i}`};function z4e(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 Cue(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 vue(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Cue(e,r))return r}}var V4e=["v_normalEC","v_normal"];Sa.findNormalVarying=function(e){return Cue(e,"#ifdef HAS_NORMALS")?z4e(e,"HAS_NORMALS")?"v_normalEC":void 0:vue(e,V4e)};var j4e=["v_positionEC"];Sa.findPositionVarying=function(e){return vue(e,j4e)};var Xe=Sa;function jc(e){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 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(jc.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}}});jc.DEFAULT_COLOR_VALUE=z.WHITE;jc.DEFAULT_SHOW_VALUE=!0;function Sue(e){let t=e._textureDimensions;return t.x*t.y*4}function wue(e){if(!l(e._batchValues)){let t=Sue(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Iue(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}jc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Iue(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=wue(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};jc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};jc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var H4e=new Array(4);jc.prototype.setColor=function(e,t){if(z.equals(t,jc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(H4e),i=n[3],r=wue(this),o=e*4,s=Iue(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)}};jc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};jc.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(jc.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)};jc.prototype.getPickColor=function(e){return this._pickIds[e]};function Pue(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 G4e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=Sue(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=Pue(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function W4e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}jc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&G4e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Pue(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),W4e(this))};jc.prototype.isDestroyed=function(){return!1};jc.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 le(this)};var uu=jc;var Due={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(Due);var lf=Due;var Rue={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(Rue);var Zn=Rue;var Oue={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(Oue);var Rt=Oue;var qB={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};qB.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Zn.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:Zn.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:qB.CESIUM_3D_TILE_MASK,mask:qB.CESIUM_3D_TILE_MASK}};var Xt=Object.freeze(qB);function q4e(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 Qn=q4e;var CY=uu.DEFAULT_COLOR_VALUE,vY=uu.DEFAULT_SHOW_VALUE;function jr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=Y4e(n);this._properties=s,this._batchTableHierarchy=X4e(this,n,i);let a=Nue(t,s,i);this._binaryPropertiesByteLength=K4e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new uu({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}jr._deprecationWarning=Yr;Object.defineProperties(jr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Y4e(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 X4e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(jr._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 JE({extension:i,binaryBody:n})}function Nue(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=gh(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 K4e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}jr.getBinaryProperties=function(e,t,n){return Nue(e,t,n)};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)};var $4e=new z;jr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(CY),this.setAllShow(vY);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,$4e)??CY:CY,s=l(e.show)?e.show.evaluate(r)??vY:vY;this.setColor(i,o),this.setShow(i,s)}};function J4e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Z4e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}jr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};jr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};jr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};jr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};jr.prototype.hasPropertyBySemantic=function(){return!1};jr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Qn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Qn(t,i)}return t};jr.prototype.getPropertyBySemantic=function(e,t){};jr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return J4e(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}};jr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){Z4e(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 Q4e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}jr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=Lue(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; -void main() -{ - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; -void main() -{ - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${Q4e(i)}${s}`}};function Mue(e,t){return e=Xe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function e8e(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 Lue(e,t,n){if(!l(t))return Mue(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return Mue(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))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); -} -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,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=e8e(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${o} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}jr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Lue(i,t,!0),Ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};function t8e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===lf.HIGHLIGHT)return 0;if(n===lf.REPLACE)return 1;if(n===lf.MIX)return P.clamp(i,P.EPSILON4,1)}jr.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 t8e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var L_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jr.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=n8e(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=i8e(f),f.dirty=!1);let p=d.originalCommand;c!==L_.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=r8e(p))),c!==L_.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=o8e(p)),a&&(o||(l(d.zback)||(d.zback=a8e(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==l8e(d.stencil))&&(f.renderState.depthMask?d.stencil=c8e(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===L_.ALL_OPAQUE&&(n[u]=g),c===L_.ALL_TRANSLUCENT&&(n[u]=m),c===L_.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function n8e(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?L_.ALL_OPAQUE:t===e.featuresLength?L_.ALL_TRANSLUCENT:L_.OPAQUE_AND_TRANSLUCENT}function i8e(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 r8e(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=u8e(e.renderState),t}function o8e(e){let t=at.shallowClone(e);return t.renderState=f8e(e.renderState),t}function s8e(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 a8e(e,t){let n=at.shallowClone(t),i=Ze(n.renderState,!0);i.cull.enabled=!0,i.cull.face=ji.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=s8e(e,t.shaderProgram),n}function c8e(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=Zn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=Zn.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 l8e(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function u8e(e){let t=Ze(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=nn.ALPHA_BLEND,t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function f8e(e){let t=Ze(e,!0);return t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}jr.prototype.update=function(e,t){this._batchTexture.update(e,t)};jr.prototype.isDestroyed=function(){return!1};jr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var Xm=jr;function V0(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,d8e(this,e.extension,e.binaryBody)}Object.defineProperties(V0.prototype,{byteLength:{get:function(){return this._byteLength}}});function d8e(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=gh(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=gh(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=gh(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=Xm.getBinaryProperties(b,x,n);p+=h8e(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 h8e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var m8e=[],p8e=[],g8e=0;function _8e(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=m8e;c.length=Math.max(c.length,a);let u=++g8e,f=p8e;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 y8e(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 cP(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return _8e(e,t,n)}else return n(e,t);return y8e(e,t,n)}V0.prototype.hasProperty=function(e,t){let n=cP(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};V0.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};V0.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,cP(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};V0.prototype.getProperty=function(e,t){return cP(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)?A8e(a,s):Ze(a[s],!0)})};function A8e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}V0.prototype.setProperty=function(e,t,n){let i=cP(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)?b8e(u,c,n):u[c]=Ze(n,!0),!0});return l(i)};function b8e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}V0.prototype.isClass=function(e,t){let n=cP(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};V0.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var JE=V0;function uf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(uf.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}}});uf.packedLength=2;uf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};uf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new uf),n.near=e[t++],n.far=e[t],n};uf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};uf.clone=function(e,t){if(l(e))return l(t)||(t=new uf),t.near=e.near,t.far=e.far,t};uf.prototype.clone=function(e){return uf.clone(this,e)};uf.prototype.equals=function(e){return uf.equals(this,e)};var Gt=uf;function td(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}td.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 td(e.near,e.nearValue,e.far,e.farValue)};td.packedLength=4;td.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};td.unpack=function(e,t,n){return t=t??0,l(n)||(n=new td),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};td.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};td.prototype.clone=function(e){return td.clone(this,e)};td.prototype.equals=function(e){return td.equals(this,e)};var qt=td;var x8e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Gs=x8e;function _h(e){this._billboardCollection=e,this._id=void 0,this._loadState=Gs.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(_h.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Gs.LOADED}},hasImage:{get:function(){return this._loadState!==Gs.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});_h.prototype.unload=async function(){this._loadState!==Gs.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Gs.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};_h.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===Gs.LOADING||t.loadState===Gs.LOADED){_h.clone(s,this);return}l(s)||(s=new _h(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Gs.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=Gs.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Gs.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Gs.FAILED,s._index=-1,this._id!==e)return;this._loadState=Gs.FAILED,this._index=-1;return}s._index=a,s._loadState=Gs.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Gs.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};_h.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)};_h.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Gs.LOADING,i=await n}catch(r){this._loadState=Gs.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Gs.LOADED,this.setImageSubRegion(i,t))};_h.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Gs.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}};_h.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};_h.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 F_=_h;var B_={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(B_);var We=B_;function ls(e){return e===B_.CLAMP_TO_GROUND||e===B_.CLAMP_TO_3D_TILE||e===B_.CLAMP_TO_TERRAIN}function k_(e){return e===B_.RELATIVE_TO_GROUND||e===B_.RELATIVE_TO_3D_TILE||e===B_.RELATIVE_TO_TERRAIN}var Fue={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Fue);var Wi=Fue;var lP={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};lP.getMorphTime=function(e){return e===lP.SCENE3D?1:e===lP.MORPHING?void 0:0};Object.freeze(lP);var re=lP;function wa(e,t){this.normal=h.clone(e),this.distance=t}wa.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new wa(t,i)};var T8e=new h;wa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,T8e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new wa(n,i)};wa.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var E8e=new h;wa.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=wa.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,E8e);return h.subtract(t,r,n)};var C8e=new M,v8e=new se,S8e=new h;wa.transform=function(e,t,n){let i=e.normal,r=e.distance,o=M.inverseTranspose(t,C8e),s=se.fromElements(i.x,i.y,i.z,r,v8e);s=M.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,S8e);return s=se.divideByScalar(s,h.magnitude(a),s),wa.fromCartesian4(s,n)};wa.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new wa(e.normal,e.distance)};wa.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};wa.ORIGIN_XY_PLANE=Object.freeze(new wa(h.UNIT_Z,0));wa.ORIGIN_YZ_PLANE=Object.freeze(new wa(h.UNIT_X,0));wa.ORIGIN_ZX_PLANE=Object.freeze(new wa(h.UNIT_Y,0));var sn=wa;function nd(e){this.planes=e??[]}var uP=[new h,new h,new h];h.clone(h.UNIT_X,uP[0]);h.clone(h.UNIT_Y,uP[1]);h.clone(h.UNIT_Z,uP[2]);var U_=new h,w8e=new h,Bue=new sn(new h(1,0,0),0);function kue(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=uP.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=uP[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,U_),h.add(r,U_,U_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,U_),h.multiplyByScalar(c,o,U_),h.add(r,U_,U_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,w8e),U_),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(kue(t[i],Bue));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(kue(i[r],Bue));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 ca=nd;function Km(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 ca,this._orthographicMatrix=new M}function Uue(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(Km.prototype,{projectionMatrix:{get:function(){return Uue(this),this._orthographicMatrix}}});var I8e=new h,P8e=new h,D8e=new h,SY=new h;Km.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,I8e);h.normalize(f,f);let d=P8e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=D8e;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,SY),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,SY),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,SY),p),this._cullingVolume};Km.prototype.getPixelDimensions=function(e,t,n,i,r){Uue(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};Km.prototype.clone=function(e){return l(e)||(e=new Km),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};Km.prototype.equals=function(e){return l(e)&&e instanceof Km&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Km.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Km&&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 ws=Km;function fu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new ws,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}fu.packedLength=4;fu.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};fu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new fu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function z_(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(fu.prototype,{projectionMatrix:{get:function(){return z_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return z_(this),this._offCenterFrustum}}});fu.prototype.computeCullingVolume=function(e,t,n){return z_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};fu.prototype.getPixelDimensions=function(e,t,n,i,r){return z_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};fu.prototype.clone=function(e){return l(e)||(e=new fu),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};fu.prototype.equals=function(e){return!l(e)||!(e instanceof fu)?!1:(z_(this),z_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};fu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof fu)?!1:(z_(this),z_(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 pn=fu;var gc={},R8e=new se(0,0,0,1),Hc=new se,O8e=new et,wY=new U,IY=new U;gc.worldToWindowCoordinates=function(e,t,n){return gc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var zue=new se,Vue=new h;function fP(e,t,n,i){let r=n.viewMatrix,o=M.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,zue),zue),s=h.multiplyComponents(t,h.normalize(o,Vue),Vue);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 M8e=new he(Math.PI,P.PI_OVER_TWO),N8e=new h,L8e=new h;gc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=gc.computeActualEllipsoidPosition(r,t,R8e);if(!l(o))return;let s=e.canvas,a=O8e;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=M8e,p=f.project(d,N8e),g=h.clone(c.position,L8e),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,Hc=fP(o,n,c,Hc),gc.clipToGLWindowCoordinates(a,Hc,wY),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,Hc=fP(o,n,c,Hc),gc.clipToGLWindowCoordinates(a,Hc,IY)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,Hc=fP(o,n,c,Hc),gc.clipToGLWindowCoordinates(a,Hc,wY),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,Hc=fP(o,n,c,Hc),gc.clipToGLWindowCoordinates(a,Hc,IY)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(wY,i),(i.x<0||i.x>s.clientWidth)&&(i.x=IY.x)}}if(r.mode!==re.SCENE2D||u){if(Hc=fP(o,n,c,Hc),Hc.z<0&&!(c.frustum instanceof pn)&&!(c.frustum instanceof ws))return;i=gc.clipToGLWindowCoordinates(a,Hc,i)}return i.y=s.clientHeight-i.y,i};gc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=gc.worldToWindowCoordinates(e,t,n),!!l(n))return gc.transformWindowToDrawingBuffer(e,n,n)};var j0=new h,F8e=new he;gc.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,F8e);if(!l(o))return;if(r.project(o,j0),i===re.COLUMBUS_VIEW)return h.fromElements(j0.z,j0.x,j0.y,n);if(i===re.SCENE2D)return h.fromElements(0,j0.x,j0.y,n);let s=e.morphTime;return h.fromElements(P.lerp(j0.z,t.x,s),P.lerp(j0.x,t.y,s),P.lerp(j0.y,t.z,s),n)};var jue=new h,Hue=new h,Gue=new M;gc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,jue),M.computeViewportTransformation(e,0,1,Gue),M.multiplyByPoint(Gue,jue,Hue),U.fromCartesian3(Hue,n)};gc.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 B8e=new se,Wue=new se;gc.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,B8e);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,Wue);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=Wue,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 pr=gc;var que={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(que);var Wn=que;var Yue={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(Yue);var Wo=Yue;function Ri(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??Wn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Wi.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 F_(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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!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??Wo.NONE,this._positionFromParent=!1}var Xue=Ri.SHOW_INDEX=0,XB=Ri.POSITION_INDEX=1,ife=Ri.PIXEL_OFFSET_INDEX=2,k8e=Ri.EYE_OFFSET_INDEX=3,U8e=Ri.HORIZONTAL_ORIGIN_INDEX=4,z8e=Ri.VERTICAL_ORIGIN_INDEX=5,V8e=Ri.SCALE_INDEX=6,Kue=Ri.IMAGE_INDEX_INDEX=7,$ue=Ri.COLOR_INDEX=8,j8e=Ri.ROTATION_INDEX=9,H8e=Ri.ALIGNED_AXIS_INDEX=10,G8e=Ri.SCALE_BY_DISTANCE_INDEX=11,W8e=Ri.TRANSLUCENCY_BY_DISTANCE_INDEX=12,q8e=Ri.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Y8e=Ri.DISTANCE_DISPLAY_CONDITION=14,X8e=Ri.DISABLE_DEPTH_DISTANCE=15;Ri.TEXTURE_COORDINATE_BOUNDS=16;var Jue=Ri.SDF_INDEX=17,K8e=Ri.SPLIT_DIRECTION_INDEX=18;Ri.NUMBER_OF_PROPERTIES=19;function To(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function PY(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function vb(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Ri.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,To(this,Xue))}},position:{get:function(){return this._position},set:function(e){let t=this._position;PY(t,e)||(vb(e,t),vb(e,this._actualPosition),this._updateClamping(),To(this,XB))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),To(this,XB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),To(this,ife))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),To(this,G8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),To(this,W8e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),To(this,q8e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),To(this,k8e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,To(this,U8e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,To(this,z8e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,To(this,V8e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),To(this,$ue))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,To(this,j8e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),To(this,H8e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,To(this,Kue))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,To(this,Kue))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,To(this,$ue))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),To(this,Y8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,To(this,X8e))}},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=vb(e,this._actualClampedPosition),To(this,XB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,To(this,Xue))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),To(this,Jue))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,To(this,Jue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,To(this,K8e))}}});Ri.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ri.prototype._updateClamping=function(){Ri._updateClamping(this._billboardCollection,this)};var KB=new he,$8e=new he,Zue=200,Que=30;function efe(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);k_(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}Ri._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;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<Que){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+Zue){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,$8e);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=vb(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<Que,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+Zue,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,efe(t,i,A,b)},t._heightReference)}he.clone(a,KB);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(KB.height=y),efe(t,i,a,KB)};Ri.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Ri.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Ri.prototype.setImageTexture=function(e){F_.clone(e,this._imageTexture)};var tfe=512;Ri.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Jn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Jn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&J8e(n)&&(this._imageWidth=Math.min(this._width,tfe),this._imageHeight=Math.min(this._height,tfe))};function J8e(e){return l(e)?zm(e)?e.startsWith("data:image/svg+xml"):v_(e)==="svg":!1}Ri.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Ri.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),To(this,ife))};Ri.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ri.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),To(this,XB)};var nfe=new se;Ri._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,nfe),pr.computeActualEllipsoidPosition(n,nfe))};var rfe=new h;Ri._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=M.multiplyByPoint(e,t,rfe),a=pr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var YB=new U(0,0);Ri.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,YB),U.add(YB,this._translate,YB);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,KB);r=a.cartographicToCartesian(c,rfe),i=M.IDENTITY}return Ri._computeScreenSpacePosition(i,r,this._eyeOffset,YB,e,t)};Ri.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===Wi.RIGHT?s-=i:e.horizontalOrigin===Wi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?a-=r:e.verticalOrigin===Wn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Ri.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};Ri.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 Lr=Ri;var ofe=1/256,Z8e=65536,RY=256,Rr={};Rr.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};Rr.octEncode=function(e,t){return Rr.octEncodeInRange(e,255,t)};var dP=new U,sfe=new Uint8Array(1);function $B(e){return sfe[0]=e,sfe[0]}Rr.octEncodeToCartesian4=function(e,t){return Rr.octEncodeInRange(e,65535,dP),t.x=$B(dP.x*ofe),t.y=$B(dP.x),t.z=$B(dP.y*ofe),t.w=$B(dP.y),t};Rr.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)};Rr.octDecode=function(e,t,n){return Rr.octDecodeInRange(e,t,255,n)};Rr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*RY+i,a=r*RY+o;return Rr.octDecodeInRange(s,a,65535,t)};Rr.octPackFloat=function(e){return 256*e.x+e.y};var OY=new U;Rr.octEncodeFloat=function(e){return Rr.octEncode(e,OY),Rr.octPackFloat(OY)};Rr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Rr.octDecode(i,r,t)};Rr.octPack=function(e,t,n,i){let r=Rr.octEncodeFloat(e),o=Rr.octEncodeFloat(t),s=Rr.octEncode(n,OY);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Rr.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;Rr.octDecodeFloat(s,t),Rr.octDecodeFloat(c,n),Rr.octDecode(o,a,i)};Rr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Rr.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 DY(e){return e>>1^-(e&1)}Rr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=DY(e[a]),o+=DY(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=DY(n[a]),n[a]=s)};Rr.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};Rr.encodeRGB8=function(e){return Math.round(P.clamp(e.red*255,0,255))*Z8e+Math.round(P.clamp(e.green*255,0,255))*RY+Math.round(P.clamp(e.blue*255,0,255))};Rr.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};Rr.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=Rr;function Q8e(e,t){this.start=e??0,this.stop=t??0}var Ws=Q8e;var JB=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],UY),r=h.clone(i,MY),o=h.clone(i,NY),s=h.clone(i,LY),a=h.clone(i,FY),c=h.clone(i,BY),u=h.clone(i,kY),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,Xa)),g=h.magnitudeSquared(h.subtract(c,o,Xa)),m=h.magnitudeSquared(h.subtract(u,s,Xa)),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,Xa)),E=Math.sqrt(T),v=VY;v.x=r.x,v.y=o.y,v.z=s.z;let S=jY;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,HY),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,Xa));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,Xa));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;afe._ellipsoid=ee.default,n=n??afe,ie.southwest(t,GY),GY.height=i,ie.northeast(t,WY),WY.height=r;let s=n.project(GY,tje),a=n.project(WY,nje),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,ije);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=UY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,MY),a=h.clone(o,NY),c=h.clone(o,LY),u=h.clone(o,FY),f=h.clone(o,BY),d=h.clone(o,kY),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,Xa)),y=h.magnitudeSquared(h.subtract(f,a,Xa)),A=h.magnitudeSquared(h.subtract(d,c,Xa)),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,Xa)),S=Math.sqrt(v),I=VY;I.x=s.x,I.y=a.y,I.z=c.z;let R=jY;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,HY),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,Xa));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,Xa));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=UY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,MY),s=h.clone(r,NY),a=h.clone(r,LY),c=h.clone(r,FY),u=h.clone(r,BY),f=h.clone(r,kY),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,Xa)),m=h.magnitudeSquared(h.subtract(u,s,Xa)),y=h.magnitudeSquared(h.subtract(f,a,Xa)),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,Xa)),v=Math.sqrt(E),S=VY;S.x=o.x,S.y=s.y,S.z=a.z;let I=jY;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,HY),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,Xa));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,Xa));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,rje),o=$.getColumn(i,1,oje),s=$.getColumn(i,2,sje);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,aje),r=M.getScale(t,cje),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,lje),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,uje);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,fje));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,dje),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 Ws);let o=h.subtract(t.center,n,hje),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){lfe._ellipsoid=ee.default,n=n??lfe;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,cfe):a=r.geodeticSurfaceNormal(o,cfe);let c=h.cross(h.UNIT_Z,a,mje);h.normalize(c,c);let u=h.cross(a,c,pje);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,_je),d=h.negate(c,gje),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,yje);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 eje*t*t*t}};JB.packedLength=4;var MY=new h,NY=new h,LY=new h,FY=new h,BY=new h,kY=new h,UY=new h,Xa=new h,zY=new h,VY=new h,jY=new h,HY=new h,eje=4/3*P.PI,afe=new Hi,tje=new h,nje=new h,GY=new he,WY=new he,ije=[],rje=new h,oje=new h,sje=new h,aje=new h,cje=new h,lje=new h,uje=new h,fje=new h,dje=new h,hje=new h,cfe=new h,mje=new h,pje=new h,gje=new h,_je=new h,yje=new he,ufe=new Array(8);for(let e=0;e<8;++e)ufe[e]=new h;var lfe=new Hi,ue=JB;function $m(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}$m.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 H0={high:0,low:0};$m.fromCartesian=function(e,t){l(t)||(t=new $m);let n=t.high,i=t.low;return $m.encode(e.x,H0),n.x=H0.high,i.x=H0.low,$m.encode(e.y,H0),n.y=H0.high,i.y=H0.low,$m.encode(e.z,H0),n.z=H0.high,i.z=H0.low,t};var qY=new $m;$m.writeElements=function(e,t,n){$m.fromCartesian(e,qY);let i=qY.high,r=qY.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=$m;var la={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};la.getSizeInBytes=function(e){switch(e){case la.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case la.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case la.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};la.fromSizeInBytes=function(e){switch(e){case 2:return la.UNSIGNED_SHORT;case 4:return la.UNSIGNED_INT;case 1:return la.UNSIGNED_BYTE}};la.validate=function(e){return l(e)&&(e===la.UNSIGNED_BYTE||e===la.UNSIGNED_SHORT||e===la.UNSIGNED_INT)};la.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};la.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};la.fromTypedArray=function(e){if(e instanceof Uint8Array)return la.UNSIGNED_BYTE;if(e instanceof Uint16Array)return la.UNSIGNED_SHORT;if(e instanceof Uint32Array)return la.UNSIGNED_INT};Object.freeze(la);var je=la;var Sb={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};Sb.validate=function(e){return e===Sb.STREAM_DRAW||e===Sb.STATIC_DRAW||e===Sb.DYNAMIC_DRAW||e===Sb.DYNAMIC_READ};Object.freeze(Sb);var Me=Sb;function Gc(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=Jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Gc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Gc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Gc.createVertexBuffer=function(e){return new Gc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Gc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Gc({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(Gc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Gc.prototype._getBuffer=function(){return this._buffer};Gc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Gc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Gc.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)};Gc.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)};Gc.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)};Gc.prototype.isDestroyed=function(){return!1};Gc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var tt=Gc;function Aje(e,t,n,i){switch(t.type){case e.FLOAT:return new YY(e,t,n,i);case e.FLOAT_VEC2:return new XY(e,t,n,i);case e.FLOAT_VEC3:return new KY(e,t,n,i);case e.FLOAT_VEC4:return new $Y(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new ZB(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new ZB(e,t,n,i);case e.INT:case e.BOOL:return new JY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new ZY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new QY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new eX(e,t,n,i);case e.FLOAT_MAT2:return new tX(e,t,n,i);case e.FLOAT_MAT3:return new nX(e,t,n,i);case e.FLOAT_MAT4:return new iX(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))}},XY=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))}},KY=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)))}},$Y=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)))}},ZB=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}},JY=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))}},ZY=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))}},QY=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))}},eX=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))}},bje=new Float32Array(4),tX=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,bje);this._gl.uniformMatrix2fv(this._location,!1,t)}}},xje=new Float32Array(9),nX=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,xje);this._gl.uniformMatrix3fv(this._location,!1,t)}}},Tje=new Float32Array(16),iX=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,Tje);this._gl.uniformMatrix4fv(this._location,!1,t)}}},QB=Aje;function Eje(e,t,n,i){switch(t.type){case e.FLOAT:return new rX(e,t,n,i);case e.FLOAT_VEC2:return new oX(e,t,n,i);case e.FLOAT_VEC3:return new sX(e,t,n,i);case e.FLOAT_VEC4:return new aX(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new cX(e,t,n,i);case e.INT:case e.BOOL:return new lX(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new uX(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new fX(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new dX(e,t,n,i);case e.FLOAT_MAT2:return new hX(e,t,n,i);case e.FLOAT_MAT3:return new mX(e,t,n,i);case e.FLOAT_MAT4:return new pX(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var rX=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)}},oX=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)}},sX=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)}},aX=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)}},cX=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}},lX=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)}},uX=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)}},fX=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)}},dX=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)}},hX=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)}},mX=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)}},pX=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)}},e2=Eje;var Cje=0;function G0(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=vje(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=Cje++}G0.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};G0.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(G0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return t2(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return t2(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return t2(this),this._uniformsByName}}});function ffe(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 vje(e,t){let n={};if(!Ut.highpFloatSupported||!Ut.highpIntSupported){let i,r,o,s,a=ffe(e),c=ffe(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 Jm="[Cesium WebGL] ";function Sje(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(`${Jm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Jm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Jm}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(`${Jm}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(`${Jm}Vertex shader compile log: ${c}`),console.error(`${Jm} Vertex shader source: -${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Jm}Fragment shader compile log: ${c}`),console.error(`${Jm} 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(`${Jm}${g} shader translation failed.`);return}console.error(`${Jm}Translated ${g} shaderSource: -${m}`)}}function wje(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 Ije(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=QB(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=e2(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function Pje(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=N_[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function Dje(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 t2(e){l(e._program)||dfe(e)}function dfe(e){let t=e._program,n=e._gl,i=Sje(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=Ije(n,i),s=Pje(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=wje(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Dje(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{dfe(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)}})}G0.prototype._bind=function(){t2(this),this._gl.useProgram(this._program)};G0.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)}};G0.prototype.isDestroyed=function(){return!1};G0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};G0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var Qt=G0;var hfe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(hfe);var yh=hfe;function gX(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??yh.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}gX.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 Rje=new he,Oje=new h,mfe=new M,Mje=[new he,new he,new he],Nje=[new U,new U,new U],Lje=[new U,new U,new U],Fje=new h,Bje=new Le,kje=new M,Uje=new $i;gX._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,Rje),s=he.toCartesian(o,n,Oje),a=At.eastNorthUpToFixedFrame(s,n,mfe),c=M.inverse(a,mfe),u=Nje,f=Mje;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=Fje;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,Bje),g=$.fromQuaternion(p,kje),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,Uje),E=Lje;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=gX;function zje(e,t){if(!e)throw new pe(t)}var pfe=zje;function Vje(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 _fe(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)Vje(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),_fe(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 gfe(e){return e.values.length/e.componentsPerAttribute}function jje(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function Hje(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=gfe(e[r[0]]),t=1;t<s;++t){let u=gfe(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+=jje(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=Hje(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 Gje(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 Wje(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&&Gje(this),this._hasConstantAttributes&&Wje(this,this._gl)):_fe(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),le(this)};var Vn=Ah;function Ia(e,t,n,i){let r=Ia._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=Ia._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ia._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)}Ia._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};Ia._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};Ia._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};Ia.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];Ia._resize(r,this._size),Ia._appendWriters(this.writers,r)}_X(this)};Ia._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 qje=[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}}];Ia._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]=qje[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Ia.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=Yje(this,i)||t;if(t||!l(this.va)){_X(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);Ia._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 Yje(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}Ia._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})}};Ia.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)Xje(n[i],e,t)};function Xje(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)}}Ia.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function _X(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}Ia.prototype.isDestroyed=function(){return!1};Ia.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 _X(this),le(this)};var V_=Ia;var n2=`uniform sampler2D u_atlas; -uniform float u_coarseDepthTestDistance; -uniform float u_threePointDepthTestDistance; -#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; +return textureCube(sampler, p); #endif -in vec2 v_textureCoordinates; -in vec4 v_pickColor; -in vec4 v_color; -flat in vec2 v_splitDirectionAndEllipsoidDepthEC; -#ifdef SDF -in vec4 v_outlineColor; -in float v_outlineWidth; +} +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 -in vec4 v_compressed; -const float SHIFT_LEFT1 = 2.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; -float getGlobeDepthAtCoords(vec2 st) +} +`;var h2=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { +vec4 transformedPlane = transform * plane; +float normalMagnitude = length(transformedPlane.xyz); +return transformedPlane / normalMagnitude; +} +`;var m2=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); -if (logDepthOrDepth == 0.0) +vec3 highDifference = high - czm_encodedCameraPositionMCHigh; +if (length(highDifference) == 0.0) { +highDifference = vec3(0); +} +vec3 lowDifference = low - czm_encodedCameraPositionMCLow; +return vec4(highDifference + lowDifference, 1.0); +} +`;var p2=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { -return 0.0; +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 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -return eyeCoordinate.z / eyeCoordinate.w; +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); } -#ifdef SDF -float getDistance(vec2 position) +`;var g2=`mat2 czm_transpose(mat2 matrix) { -return texture(u_atlas, position).r; +return mat2( +matrix[0][0], matrix[1][0], +matrix[0][1], matrix[1][1]); } -vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) +mat3 czm_transpose(mat3 matrix) { -float distance = getDistance(position); -if (outlineWidth > 0.0) +return mat3( +matrix[0][0], matrix[1][0], matrix[2][0], +matrix[0][1], matrix[1][1], matrix[2][1], +matrix[0][2], matrix[1][2], matrix[2][2]); +} +mat4 czm_transpose(mat4 matrix) { -float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); -float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); -vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); -float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); -return vec4(sdfColor.rgb, sdfColor.a * alpha); +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]); } -else +`;var _2=`float czm_unpackDepth(vec4 packedDepth) { -float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); -return vec4(v_color.rgb, v_color.a * alpha); +return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } +`;var y2=`float czm_unpackFloat(vec4 packedFloat) +{ +packedFloat = floor(packedFloat * 255.0 + 0.5); +float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; +float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; +if (exponent == -127.0) +{ +return 0.0; } -#endif -bool getDepthTestEnabled() { -float temp = v_compressed.y; -temp = temp * SHIFT_RIGHT1; -float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; -return temp2 != 0.0; +float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); +float result = sign * exp2(exponent - 23.0) * mantissa; +return result; } -float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) { -float depthDifferential = eyeDepth - distanceToEllipsoid; -float depthRatio = abs(depthDifferential / distanceToEllipsoid); -if (depthRatio < epsilon) { -return 0.0; +`;var A2=`uint czm_unpackTexture(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return uint(rounded); } -return depthDifferential; +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); } -void doDepthTest(float eyeDepth, float globeDepth) { -#ifdef VS_THREE_POINT_DEPTH_CHECK -if (eyeDepth > -u_threePointDepthTestDistance) { -if (eyeDepth == 0.0) { -discard; +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); } -return; +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); } -#endif -bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; -if (useGlobeDepth && globeDepth == 0.0) { -return; +`;var b2=`int czm_unpackUint(float packedValue) { +float rounded = czm_round(packedValue * 255.0); +return int(rounded); } -if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { -discard; +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))); } -#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); +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))); } -czm_writeLogDepth(depthArg); +`;var x2=`float czm_valueTransform(float offset, float scale, float value) { +return scale * value + offset; } -#endif -void main() -{ -if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { -discard; +vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { +return scale * value + offset; } -if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) { -discard; +vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { +return scale * value + offset; } -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 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { +return scale * value + offset; } -vec4 color = texture(u_atlas, v_textureCoordinates); -#ifdef SDF -float outlineWidth = v_outlineWidth; -vec4 outlineColor = v_outlineColor; -float distance = getDistance(v_textureCoordinates); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float smoothing = fwidth(distance); -vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); -vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); -vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); -color = (center + color1 + color2 + color3 + color4)/5.0; -#else -float smoothing = 1.0/32.0; -color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); -#endif -color = czm_gammaCorrect(color); -#else -color = czm_gammaCorrect(color); -color *= czm_gammaCorrect(v_color); -#endif -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; +mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { +return matrixCompMult(scale, value) + offset; } -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; +mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { +return matrixCompMult(scale, value) + offset; } -#else -if (color.a >= 0.995) -{ -discard; +mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { +return matrixCompMult(scale, value) + offset; } +`;var T2=`#ifdef LOG_DEPTH +out float v_depthFromNearPlusOne; +#ifdef SHADOW_MAP +out vec3 v_logPositionEC; #endif #endif -#ifdef VECTOR_TILE -color *= u_highlightColor; -#endif -out_FragColor = color; -} -`;var i2=`uniform float u_threePointDepthTestDistance; -in vec2 direction; -in vec4 positionHighAndScale; -in vec4 positionLowAndRotation; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 compressedAttribute2; -in vec4 eyeOffset; -in vec4 scaleByDistance; -in vec4 pixelOffsetScaleByDistance; -in vec4 compressedAttribute3; -in vec2 sdf; -in float splitDirection; -#ifdef VS_THREE_POINT_DEPTH_CHECK -in vec4 textureCoordinateBoundsOrLabelTranslate; +vec4 czm_updatePositionDepth(vec4 coords) { +#if defined(LOG_DEPTH) +#ifdef SHADOW_MAP +vec3 logPositionEC = (czm_inverseProjection * coords).xyz; +v_logPositionEC = logPositionEC; #endif -#ifdef VECTOR_TILE -in float a_batchId; +coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; #endif -out vec2 v_textureCoordinates; -out vec4 v_compressed; -out vec4 v_pickColor; -out vec4 v_color; -flat out vec2 v_splitDirectionAndEllipsoidDepthEC; -#ifdef SDF -out vec4 v_outlineColor; -out float v_outlineWidth; +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 -const float UPPER_BOUND = 32768.0; -const float SHIFT_LEFT16 = 65536.0; -const float SHIFT_LEFT12 = 4096.0; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_LEFT7 = 128.0; -const float SHIFT_LEFT5 = 32.0; -const float SHIFT_LEFT3 = 8.0; -const float SHIFT_LEFT2 = 4.0; -const float SHIFT_LEFT1 = 2.0; -const float SHIFT_RIGHT12 = 1.0 / 4096.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -const float SHIFT_RIGHT7 = 1.0 / 128.0; -const float SHIFT_RIGHT5 = 1.0 / 32.0; -const float SHIFT_RIGHT3 = 1.0 / 8.0; -const float SHIFT_RIGHT2 = 1.0 / 4.0; -const float SHIFT_RIGHT1 = 1.0 / 2.0; -vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) +} +void czm_vertexLogDepth(vec4 clipCoords) { -vec2 halfSize = imageSize * scale * 0.5; -halfSize *= ((direction * 2.0) - 1.0); -vec2 originTranslate = origin * abs(halfSize); -#if defined(ROTATION) || defined(ALIGNED_AXIS) -if (validAlignedAxis || rotation != 0.0) +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; +czm_updatePositionDepth(clipCoords); +#endif +} +`;var E2=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { -float angle = rotation; -if (validAlignedAxis) +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))) { -vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); -angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / -(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); -} -float cosTheta = cos(angle); -float sinTheta = sin(angle); -rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); -halfSize = rotationMatrix * halfSize; +q = czm_inverseProjection * q; } else { -rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); +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; } -#endif -mpp = czm_metersPerPixel(positionEC); -positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); -positionEC.xy += (translate + pixelOffset) * mpp; -return positionEC; +return q; } -#ifdef VS_THREE_POINT_DEPTH_CHECK -float getGlobeDepth(vec4 positionEC) +vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) { -vec4 posWC = czm_eyeToWindowCoordinates(positionEC); -float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); -if (globeDepth == 0.0) -{ -return 0.0; -} -vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); -return eyeCoordinate.z / eyeCoordinate.w; +vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; +return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); } -#endif -void main() +vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) { -vec3 positionHigh = positionHighAndScale.xyz; -vec3 positionLow = positionLowAndRotation.xyz; -float scale = positionHighAndScale.w; -#if defined(ROTATION) || defined(ALIGNED_AXIS) -float rotation = positionLowAndRotation.w; -#else -float rotation = 0.0; -#endif -float compressed = compressedAttribute0.x; -vec2 pixelOffset; -pixelOffset.x = floor(compressed * SHIFT_RIGHT7); -compressed -= pixelOffset.x * SHIFT_LEFT7; -pixelOffset.x -= UPPER_BOUND; -vec2 origin; -origin.x = floor(compressed * SHIFT_RIGHT5); -compressed -= origin.x * SHIFT_LEFT5; -origin.y = floor(compressed * SHIFT_RIGHT3); -compressed -= origin.y * SHIFT_LEFT3; -origin -= vec2(1.0); -float show = floor(compressed * SHIFT_RIGHT2); -compressed -= show * SHIFT_LEFT2; -vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); -vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); -vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; -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 EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -#ifdef VS_THREE_POINT_DEPTH_CHECK -temp = compressedAttribute3.w; -temp = temp * SHIFT_RIGHT12; -vec2 dimensions; -dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; -dimensions.x = floor(temp); -#endif -#ifdef ALIGNED_AXIS -vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); -temp = compressedAttribute2.z * SHIFT_RIGHT5; -bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; +#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 -vec3 alignedAxis = vec3(0.0); -bool validAlignedAxis = false; +vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); +vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); #endif -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.a /= 255.0; -color.a = floor(temp); -color.a /= 255.0; -vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); -vec4 positionEC = czm_modelViewRelativeToEye * p; -positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); -positionEC.xyz *= show; -#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; +return eyeCoordinate; } -else +vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) { -lengthSq = dot(positionEC.xyz, positionEC.xyz); +vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; +return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } +`;var C2=`#if !defined(LOG_DEPTH) +in float v_WindowZ; #endif -#ifdef EYE_DISTANCE_SCALING -float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); -scale *= distanceScale; -translate *= distanceScale; -if (scale == 0.0) +void czm_writeDepthClamp() { -positionEC.xyz = vec3(0.0); -} +#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) +gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency == 0.0) -{ -positionEC.xyz = vec3(0.0); } +`;var v2=`#ifdef LOG_DEPTH +in float v_depthFromNearPlusOne; +#ifdef POLYGON_OFFSET +uniform vec2 u_polygonOffset; #endif -#ifdef EYE_DISTANCE_PIXEL_OFFSET -float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); -pixelOffset *= pixelOffsetScale; #endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = compressedAttribute3.x; -float farSq = compressedAttribute3.y; -if (lengthSq < nearSq || lengthSq > farSq) +void czm_writeLogDepth(float depth) { -positionEC.xyz = vec3(0.0); +#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) +if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { +discard; } -#endif -mat2 rotationMatrix; -float mpp; -float enableDepthCheck = 1.0; -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistanceSq = compressedAttribute3.z; -if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; +#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; } -if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) -{ -enableDepthCheck = 0.0; +#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 -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 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), 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), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); -float globeDepth3 = getGlobeDepth(pEC3); -if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) -{ -positionEC.xyz = vec3(0.0); +`;var S2=`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; } -#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; -#ifdef LOG_DEPTH -czm_vertexLogDepth(); -#endif -#ifdef DISABLE_DEPTH_DISTANCE -if (disableDepthTestDistanceSq != 0.0) -{ -float zclip = gl_Position.z / gl_Position.w; -bool clipped = (zclip < -1.0 || zclip > 1.0); -if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) +`;var w2=`vec3 czm_XYZToRGB(vec3 Yxy) { -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -v_depthFromNearPlusOne = 1.0; -#endif -} +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 YE={czm_degreesPerRadian:XL,czm_depthRange:KL,czm_epsilon1:$L,czm_epsilon2:JL,czm_epsilon3:ZL,czm_epsilon4:QL,czm_epsilon5:eF,czm_epsilon6:tF,czm_epsilon7:nF,czm_infinity:iF,czm_oneOverPi:rF,czm_oneOverTwoPi:oF,czm_passCesium3DTile:sF,czm_passCesium3DTileClassification:aF,czm_passCesium3DTileClassificationIgnoreShow:cF,czm_passCesium3DTileEdges:lF,czm_passCesium3DTileEdgesDirect:uF,czm_passCesium3DTilePlanarFillId:fF,czm_passClassification:dF,czm_passCompute:hF,czm_passEnvironment:mF,czm_passGaussianSplats:pF,czm_passGlobe:gF,czm_passOpaque:_F,czm_passOverlay:yF,czm_passTerrainClassification:AF,czm_passTranslucent:bF,czm_passVoxels:xF,czm_pi:TF,czm_piOverFour:EF,czm_piOverSix:CF,czm_piOverThree:vF,czm_piOverTwo:SF,czm_radiansPerDegree:wF,czm_sceneMode2D:IF,czm_sceneMode3D:PF,czm_sceneModeColumbusView:DF,czm_sceneModeMorphing:RF,czm_solarRadius:OF,czm_threePiOver2:MF,czm_twoPi:NF,czm_webMercatorMaxLatitude:LF,czm_depthRangeStruct:FF,czm_material:BF,czm_materialInput:kF,czm_modelMaterial:UF,czm_modelVertexOutput:zF,czm_ray:VF,czm_raySegment:jF,czm_shadowParameters:HF,czm_acesTonemapping:GF,czm_alphaWeight:WF,czm_antialias:qF,czm_applyHSBShift:YF,czm_approximateSphericalCoordinates:XF,czm_approximateTanh:KF,czm_backFacing:$F,czm_branchFreeTernary:JF,czm_cascadeColor:ZF,czm_cascadeDistance:QF,czm_cascadeMatrix:eB,czm_cascadeWeights:tB,czm_columbusViewMorph:nB,czm_computeAtmosphereColor:iB,czm_computeGroundAtmosphereScattering:rB,czm_computePosition:oB,czm_computeScattering:sB,czm_computeTextureTransform:aB,czm_cosineAndSine:cB,czm_decodeRGB8:lB,czm_decompressTextureCoordinates:uB,czm_depthClamp:fB,czm_eastNorthUpToEyeCoordinates:dB,czm_ellipsoidContainsPoint:hB,czm_ellipsoidTextureCoordinates:mB,czm_equalsEpsilon:pB,czm_eyeOffset:gB,czm_eyeToCartographicDelta:_B,czm_eyeToWindowCoordinates:yB,czm_fastApproximateAtan:AB,czm_fog:bB,czm_gammaCorrect:xB,czm_geodeticSurfaceNormal:TB,czm_getDefaultMaterial:EB,czm_getDynamicAtmosphereLightDirection:CB,czm_getLambertDiffuse:vB,czm_getSpecular:SB,czm_getWaterNoise:wB,czm_HSBToRGB:IB,czm_HSLToRGB:PB,czm_hue:DB,czm_inverseGamma:RB,czm_isEmpty:OB,czm_isFull:MB,czm_latitudeToWebMercatorFraction:NB,czm_linearToSrgb:LB,czm_lineDistance:FB,czm_luminance:BB,czm_maximumComponent:kB,czm_metersPerPixel:UB,czm_modelToWindowCoordinates:zB,czm_multiplyWithColorBalance:VB,czm_nearFarScalar:jB,czm_octDecode:HB,czm_packDepth:GB,czm_pbrLighting:WB,czm_pbrNeutralTonemapping:qB,czm_phong:YB,czm_planeDistance:XB,czm_pointAlongRay:KB,czm_rayEllipsoidIntersectionInterval:$B,czm_raySphereIntersectionInterval:JB,czm_readDepth:ZB,czm_readNonPerspective:QB,czm_reverseLogDepth:e2,czm_RGBToHSB:t2,czm_RGBToHSL:n2,czm_RGBToXYZ:i2,czm_round:r2,czm_saturation:o2,czm_shadowDepthCompare:s2,czm_shadowVisibility:a2,czm_signNotZero:c2,czm_sphericalHarmonics:l2,czm_srgbToLinear:u2,czm_tangentToEyeSpaceMatrix:f2,czm_textureCube:d2,czm_transformPlane:h2,czm_translateRelativeToEye:m2,czm_translucentPhong:p2,czm_transpose:g2,czm_unpackDepth:_2,czm_unpackFloat:y2,czm_unpackTexture:A2,czm_unpackUint:b2,czm_valueTransform:x2,czm_vertexLogDepth:T2,czm_windowToEyeCoordinates:E2,czm_writeDepthClamp:C2,czm_writeLogDepth:v2,czm_writeNonPerspective:S2,czm_XYZToRGB:w2};function Fje(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 -#ifdef SDF -vec4 outlineColor = czm_decodeRGB8(sdf.x); -float outlineWidth; -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.a /= 255.0; -v_outlineWidth = outlineWidth / 255.0; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency; +${n}`,n=`#ifdef GL_OES_standard_derivatives +#extension GL_OES_standard_derivatives : enable #endif -v_pickColor = pickColor; -v_color = color; -v_color.a *= translucency; -v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; -} -`;var yfe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(yfe);var Bi=yfe;var Kje={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ka=Object.freeze(Kje);function hP({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 yX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new hP({x:n,y:n,width:e-2*n,height:t-2*n})}yX.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};yX.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 hP({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new hP({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new hP({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new hP({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 mP=yX;var Afe=16;function vl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(Afe,Afe);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=Jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(vl.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}}});vl.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};vl.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};vl.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 bfe({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 mP({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=Jn()};vl.prototype.getImageIndex=function(e){return this._indexById.get(e)};vl.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 bfe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}vl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new bfe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};vl.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};vl.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 mP({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function $je(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}vl.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 $je(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)};vl.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};vl.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}))};vl.prototype.isDestroyed=function(){return!1};vl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var ZE=vl;var Jje=Lr.SHOW_INDEX,pP=Lr.POSITION_INDEX,Tfe=Lr.PIXEL_OFFSET_INDEX,Efe=Lr.EYE_OFFSET_INDEX,Zje=Lr.HORIZONTAL_ORIGIN_INDEX,Qje=Lr.VERTICAL_ORIGIN_INDEX,e6e=Lr.SCALE_INDEX,wb=Lr.IMAGE_INDEX_INDEX,Cfe=Lr.COLOR_INDEX,t6e=Lr.ROTATION_INDEX,n6e=Lr.ALIGNED_AXIS_INDEX,vfe=Lr.SCALE_BY_DISTANCE_INDEX,Sfe=Lr.TRANSLUCENCY_BY_DISTANCE_INDEX,wfe=Lr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Ife=Lr.DISTANCE_DISPLAY_CONDITION,i6e=Lr.DISABLE_DEPTH_DISTANCE,r6e=Lr.TEXTURE_COORDINATE_BOUNDS,Pfe=Lr.SDF_INDEX,Dfe=Lr.SPLIT_DIRECTION_INDEX,CX=Lr.NUMBER_OF_PROPERTIES,Fr={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 rd(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new ZE),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(CX),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??Bi.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(rd.prototype,{length:{get:function(){return vX(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 Rfe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}rd.prototype.add=function(e){let t=new Lr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};rd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};rd.prototype.removeAll=function(){Rfe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function vX(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}}rd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};rd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};rd.prototype.get=function(e){return vX(this),this._billboards[e]};function xfe(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 o6e(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}rd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<CX;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function s6e(e,t,n,i,r){let o=[{index:Fr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[pP]},{index:Fr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[pP]},{index:Fr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Tfe]},{index:Fr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Sfe]},{index:Fr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Cfe]},{index:Fr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Efe]},{index:Fr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[vfe]},{index:Fr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[wfe]},{index:Fr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Ife]},{index:Fr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[r6e]},{index:Fr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[Dfe]},{index:Fr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:o6e(e)}];return l(i)&&o.push({index:Fr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:Fr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[Pfe]}),new V_(e,o,t,!0)}var AX=new Sn;function Ofe(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function Mfe(e,t,n,i){let r=n[Fr.positionHighAndScale],o=n[Fr.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(Ofe(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,AX);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=AX.high,f=AX.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var j_=new U,id=32768,SX=65536,bX=4096,Ib=256,a6e=128,c6e=32,l6e=8,r2=4,u6e=1/256,Nfe=new et;function Lfe(e,t,n,i){let r=n[Fr.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===Wn.BASELINE&&(p=Wn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Wi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Wn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(Nfe);m=I.x,y=I.y}let A=Math.floor(P.clamp(s,-id,id)+id)*a6e;A+=(d+1)*c6e,A+=(p+1)*l6e,A+=(g?1:0)*r2;let b=Math.floor(P.clamp(a,-id,id)+id)*Ib,x=Math.floor(P.clamp(u*r2,-id,id)+id)*Ib,T=(P.clamp(f*r2,-id,id)+id)*u6e,E=Math.floor(T),v=Math.floor((T-E)*Ib);b+=E,x+=v,j_.x=m,j_.y=y;let S=cn.compressTextureCoordinates(j_);r(i._index,A,b,x,S)}function Ffe(e,t,n,i){let r=n[Fr.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,SX),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*Ib+a,u=P.clamp(u,0,1),u=u===1?255:u*255|0,g=g*Ib+u,r(i._index,p,g,s,c)}function TX(e,t,n,i){let r=n[Fr.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)*SX+z.floatToByte(s.alpha)*Ib+(a*2+f),A=d*r2+p;r(i._index,g,m,y,A)}function EX(e,t,n,i){let r=n[Fr.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)),j_.x=0,j_.y=0,i.ready){let c=i.computeTextureCoordinates(Nfe);j_.x=c.width,j_.y=c.height}let a=cn.compressTextureCoordinates(j_);r(i._index,o.x,o.y,s,a)}function Bfe(e,t,n,i){let r=n[Fr.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 kfe(e,t,n,i){let r=n[Fr.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 Ufe(e,t,n,i){let r=n[Fr.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=ls(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,bX)),g=Math.floor(P.clamp(f,0,bX)),m=p*bX+g;r(i._index,o,s,c,m)}function zfe(e,t,n,i){if(ls(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[Fr.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function f6e(e,t,n,i){if(!l(e._batchTable))return;let r=n[Fr.a_batchId],o=i._batchIndex;r(i._index,o)}function Vfe(e,t,n,i){if(!e._sdf)return;let r=n[Fr.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/Ka.RADIUS,u=z.floatToByte(o.alpha)*SX+z.floatToByte(c)*Ib;r(i._index,a,u)}function jfe(e,t,n,i){let r=n[Fr.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function d6e(e,t,n,i){Mfe(e,t,n,i),Lfe(e,t,n,i),Ffe(e,t,n,i),TX(e,t,n,i),EX(e,t,n,i),Bfe(e,t,n,i),kfe(e,t,n,i),Ufe(e,t,n,i),zfe(e,t,n,i),f6e(e,t,n,i),Vfe(e,t,n,i),jfe(e,t,n,i)}function xX(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=Lr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):Ofe(s,d))}o&&ue.fromPoints(a,s)}function h6e(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)&&xX(e,i,i.length,t,o,!0)):n===re.MORPHING?xX(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&xX(e,r,e._billboardsToUpdateIndex,t,o,!1)}function m6e(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 p6e(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; -void main() +${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 I2=Fje;function cfe(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 lfe(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=cfe(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function ufe(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=lfe(i,Sa._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),ufe(r,t)}}))}function Bje(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 kje(e){let t=[],n=lfe("main",e,t);ufe(n,t),Bje(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +`;return i.replace(n.glslSource,"")}function ffe(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` +#line 0 +${r[g]}`;i=cfe(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 + precision mediump float; + precision mediump int; + #define highp mediump +#endif +`),n.webgl2&&(c+=`precision highp sampler3D; + +`);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&&(c+=`#define OES_texture_float + +`);let d="";e.includeBuiltIns&&(d=kje(i)),c+=` +#line 0 +`;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; + +`),c+=d,c+=i,n.webgl2?c=`#version 300 es +${c}`:c=I2(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 ffe(this,!1,e)};Sa.prototype.createCombinedFragmentShader=function(e){return ffe(this,!0,e)};Sa._czmBuiltinsAndUniforms={};for(let e in YE)YE.hasOwnProperty(e)&&(Sa._czmBuiltinsAndUniforms[e]=YE[e]);for(let e in F_)if(F_.hasOwnProperty(e)){let t=F_[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() { - out_FragColor = texture(billboard_texture, v_textureCoordinates); -} -`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var g6e=[];rd.prototype.update=function(e){if(vX(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,wb),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;h6e(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<CX;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=s6e(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,d6e(this,e,d,R)}this._vaf.commit(xfe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=g6e;I.length=0,(c[pP]||c[t6e]||c[e6e])&&I.push(Mfe),(c[wb]||c[Tfe]||c[Zje]||c[Qje]||c[Jje])&&(I.push(Lfe),I.push(EX)),(c[wb]||c[n6e]||c[Sfe])&&(I.push(Ffe),I.push(TX)),(c[wb]||c[Cfe])&&I.push(TX),(c[wb]||c[Efe])&&I.push(EX),c[vfe]&&I.push(Bfe),c[wfe]&&I.push(kfe),(c[Ife]||c[i6e]||c[wb]||c[pP])&&I.push(Ufe),(c[wb]||c[pP])&&I.push(zfe),c[Pfe]&&I.push(Vfe),c[Dfe]&&I.push(jfe);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(xfe(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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=M.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),m6e(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Bi.OPAQUE||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===Bi.TRANSLUCENT;this._blendOption===Bi.TRANSLUCENT||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:nn.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=i2,x=n2,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-Ka.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Bi.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:Fr}),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:Fr})),this._blendOption===Bi.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:Fr})),this._blendOption===Bi.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:Fr})),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===Bi.OPAQUE,O=this._blendOption===Bi.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=p6e(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};rd.prototype.isDestroyed=function(){return!1};rd.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(),Rfe(this._billboards),le(this)};var od=rd;function _6e(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 W0=_6e;function o2(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}o2.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 o2(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}": ${W0(i)}`),c};o2.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zr=o2;var Hfe={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(Hfe);var gP=Hfe;function _P(e){}_P.prototype.isReady=function(){return!0};_P.prototype.shouldDiscardImage=function(e){return _P.EMPTY_IMAGE===e};var s2;Object.defineProperties(_P,{EMPTY_IMAGE:{get:function(){return l(s2)||(s2=new Image,s2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),s2}}});var yP=_P;function Gfe(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}Gfe.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 y6e(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 A6e(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 b6e(e,t,n){let i=e.url,r=ua._metadataCache[i];l(r)||(r=e.fetchJson(),ua._metadataCache[i]=r);try{let o=await r;return y6e(o,t)}catch(o){A6e(e,o,n)}}function ua(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??gP.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new yP),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${ua.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Mo({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(ua.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)}}});ua.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??gP.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 ua(t);a._resource=r;let c=new Gfe(t);return await b6e(s,c),c.build(a),a};var x6e=new ie;ua.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,x6e);return C6e(this._attributionList,n,i)};ua.prototype.requestImage=function(e,t,n,i){let r=Zf.loadImage(this,T6e(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?yP.EMPTY_IMAGE:Promise.reject(o)})};ua.prototype.pickFeatures=function(e,t,n,i,r){};ua.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};ua.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}};ua._logoUrl=void 0;Object.defineProperties(ua,{logoUrl:{get:function(){return l(ua._logoUrl)||(ua._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),ua._logoUrl},set:function(e){ua._logoUrl=e}}});function T6e(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:ua.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var E6e=new ie;function C6e(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,E6e);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ua._metadataCache={};var a2=ua;var H_={};H_.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:H_.parseBoundingVolumeSemantic(e,t),minimumHeight:H_._parseMinimumHeight(e,t),maximumHeight:H_._parseMaximumHeight(e,t)}};H_.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}};H_._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};H_._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var Pb=H_;var v6e=new h(1,1,1);function wX(e){e=e??v6e,this._dimensions=h.clone(e)}Object.defineProperties(wX.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var S6e=new h;wX.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,S6e),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 Wfe=wX;var c2=`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) + czm_old_main(); + czm_pickColor = pickColor; +}`};Sa.createPickFragmentShaderSource=function(e,t){let n=Sa.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor; +void main() +{ + czm_old_main(); + if (out_FragColor.a == 0.0) { + discard; + } + out_FragColor = czm_pickColor; +}`;return`${n} +${i}`};function Uje(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 dfe(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 hfe(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(dfe(e,r))return r}}var zje=["v_normalEC","v_normal"];Sa.findNormalVarying=function(e){return dfe(e,"#ifdef HAS_NORMALS")?Uje(e,"HAS_NORMALS")?"v_normalEC":void 0:hfe(e,zje)};var Vje=["v_positionEC"];Sa.findPositionVarying=function(e){return hfe(e,Vje)};var Xe=Sa;var P2=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +#ifdef EXTRUDED_GEOMETRY +in vec3 extrudeDirection; +uniform float u_globeMinimumAltitude; +#endif // EXTRUDED_GEOMETRY +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif // PER_INSTANCE_COLOR +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +out vec4 v_sphericalExtents; +#else // SPHERICAL +out vec2 v_inversePlaneExtents; +out vec4 v_westPlane; +out vec4 v_southPlane; +#endif // SPHERICAL +out vec3 v_uvMinAndSphericalLongitudeRotation; +out vec3 v_uMaxAndInverseDistance; +out vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES +void main() { -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +vec4 position = czm_computePosition(); +#ifdef EXTRUDED_GEOMETRY +float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); +delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; +position = position + vec4(extrudeDirection * delta, 0.0); +#endif +#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); +v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); +#else // SPHERICAL +#ifdef COLUMBUS_VIEW_2D +vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); +vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); +vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); +bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; +planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); +planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); +idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; +idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); +planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); +planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); +vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; +vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; +vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; +#else // COLUMBUS_VIEW_2D +vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; +vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; +vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; +#endif // COLUMBUS_VIEW_2D +vec3 eastWard = southEastCorner - southWestCorner; +float eastExtent = length(eastWard); +eastWard /= eastExtent; +vec3 northWard = northWestCorner - southWestCorner; +float northExtent = length(northWard); +northWard /= northExtent; +v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); +v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); +v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); +#endif // SPHERICAL +vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); +vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); +v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); +v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); +v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; +#endif // TEXTURE_COORDINATES +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#endif +gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +`;var Pb=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; +#endif +void main(void) { -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; +#ifdef VECTOR_TILE +out_FragColor = czm_gammaCorrect(u_highlightColor); +#else +out_FragColor = vec4(1.0); +#endif +czm_writeDepthClamp(); } -float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) -{ -float alphaRoughnessSq = alphaRoughness * alphaRoughness; -float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); -float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); -float GGX = GGXV + GGXL; -if (GGX > 0.0) +`;var mX={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};mX.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(mX);var Qn=mX;var mfe={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(mfe);var gc=mfe;function jje(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 D2=jje;function V0(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=Hje(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=Gje(t,o),a=Wje(s,t,o),c=Math.floor(zt.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(V0.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function Hje(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 gfe(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function Gje(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 Wje(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 uP=new se;function qje(e,t,n){let i=se.unpack(e,t,uP),r=se.unpackFloat(i);i=se.unpack(e,t+4,uP);let o=se.unpackFloat(i);i=se.unpack(e,t+8,uP);let s=se.unpackFloat(i);i=se.unpack(e,t+12,uP);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function Yje(e,t,n){let i=se.packFloat(e.x,uP);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 pfe=new se;V0.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=qje(this._batchValues,s,pfe):a=se.unpack(this._batchValues,s,pfe);let c=gfe(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var Xje=[void 0,void 0,new U,new h,new se],Kje=new se;V0.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=Xje[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=gfe(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=Kje;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?Yje(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function $je(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:Gt.NEAREST,flipY:!1})}function Jje(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}V0.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||$je(this,e.context),Jje(this))};V0.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 Zje(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float numberOfAttributes = float(${t}); + return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); +} +`:`uniform vec4 batchTextureStep; +uniform vec2 batchTextureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = batchTextureStep.x; + float centerX = batchTextureStep.y; + float stepY = batchTextureStep.z; + float centerY = batchTextureStep.w; + float numberOfAttributes = float(${t}); + float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); + float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}function Qje(e){return e===1?"float":`vec${e}`}function e6e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function t6e(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=Qje(r),a=e6e(r),c=e._offsets[t],u=`${s} ${o}(float batchId) +{ + vec2 st = computeSt(batchId); + 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===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}V0.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${Zje(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=t6e(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} +${t} +${s}`}};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var XE=V0;var fP=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)}};fP.MaximumLatitude=fP.mercatorAngleToGeodeticLatitude(Math.PI);var Ti=fP;function n6e(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)&&qn.transformToWorldCoordinates(e[o]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function pX(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 i6e(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?pX(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(pX(i.westHemisphereGeometry,n),pX(i.eastHemisphereGeometry,n))}}function r6e(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(n6e(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&qn.splitLongitude(t[c]);if(i6e(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(qn.reorderForPostVertexCache(g.geometry),qn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(qn.reorderForPostVertexCache(g.westHemisphereGeometry),qn.reorderForPreVertexCache(g.westHemisphereGeometry),qn.reorderForPostVertexCache(g.eastHemisphereGeometry),qn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=qn.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&&qn.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`;qn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),qn.encodeAttribute(u,y,`${y}High`,`${y}Low`),qn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&qn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(qn.fitToUnsignedShortIndices(u));p=g}return p}function gX(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 o6e(e,t){let n=[];return gX(e,"geometry",t,n),gX(e,"westHemisphereGeometry",t,n),gX(e,"eastHemisphereGeometry",t,n),n}var j0={};j0.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=r6e(e),t.length>0&&(n=qn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=o6e(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]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function s6e(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 a6e(e,t){let n=e.length;for(let i=0;i<n;++i)s6e(e[i],t)}function c6e(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*ue.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}j0.packCreateGeometryResults=function(e,t){let n=new Float64Array(c6e(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&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.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}};j0.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=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.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 l6e(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 u6e(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 Er(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}j0.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:l6e(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}};j0.unpackCombineGeometryParameters=function(e){let t=u6e(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=j0.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 Ti(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 _fe(e){let t=e.length,n=1+(ue.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,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function yfe(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}j0.packCombineGeometryResults=function(e,t){l(e.geometries)&&a6e(e.geometries,t);let n=_fe(e.boundingSpheres),i=_fe(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}};j0.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:yfe(e.boundingSpheres),boundingSpheresCV:yfe(e.boundingSpheresCV)}};var KE=j0;var Afe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(Afe);var fs=Afe;var lu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};lu.NUMBER_OF_SHADOW_MODES=4;lu.castShadows=function(e){return e===lu.ENABLED||e===lu.CAST_ONLY};lu.receiveShadows=function(e){return e===lu.ENABLED||e===lu.RECEIVE_ONLY};lu.fromCastReceive=function(e,t){return e&&t?lu.ENABLED:e?lu.CAST_ONLY:t?lu.RECEIVE_ONLY:lu.DISABLED};Object.freeze(lu);var Dn=lu;function Wo(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=fs.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(Wo.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 f6e(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 d6e=new U,h6e=new h,Ife=new se;function Pfe(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,d6e);if(t===3)return h.unpack(e,0,h6e);if(t===4)return se.unpack(e,0,Ife)}function m6e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=f6e(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 XE(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=Pfe(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=Ife;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 p6e(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 g6e(e){let t=e.attributes,n=new En;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=p6e(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:ue.clone(e.boundingSphere)})}function _6e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var y6e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Wo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=y6e.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 0.5 / GGX; -} -return 0.0; + return u_modifiedModelView * position; } -vec2 integrateBrdf(float roughness, float NdotV) -{ -vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); -float A = 0.0; -float B = 0.0; -const int NumSamples = 1024; -float alphaRoughness = roughness * roughness; -for (int i = 0; i < NumSamples; i++) -{ -vec2 xi = hammersley2D(i, NumSamples); -vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); -vec3 L = 2.0 * dot(V, H) * H - V; -float NdotL = clamp(L.z, 0.0, 1.0); -float NdotH = clamp(H.z, 0.0, 1.0); -float VdotH = clamp(dot(V, H), 0.0, 1.0); -if (NdotL > 0.0) + +`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c} { -float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); -float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; -float Fc = pow(1.0 - VdotH, 5.0); -A += (1.0 - Fc) * G_Vis; -B += Fc * G_Vis; -} -} -return vec2(A, B) / float(NumSamples); + return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); } -void main() + +`:(o+=`in vec3 ${a}2DHigh; +in vec3 ${a}2DLow; +`,s+=`${c} { -out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); + vec4 p; + if (czm_morphTime == 1.0) + { + p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); + } + else if (czm_morphTime == 0.0) + { + p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); + } + else + { + p = czm_columbusViewMorph( + czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), + czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), + czm_morphTime); + } + return p; } -`;function AP(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(AP.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function w6e(e,t,n){let i=t.createViewportQuadCommand(c2,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}AP.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});w6e(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};AP.prototype.isDestroyed=function(){return!1};AP.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var l2=AP;var IX=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(),le(this)}},rr=IX;var qfe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(qfe);var Ct=qfe;var u2=class extends rr{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=I6e(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function I6e(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await u2._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 QE=u2;var bh=class bh{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(bh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(bh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(bh.Layout.SHOW_U8)===1}set show(t){this._setUint8(bh.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(bh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+bh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(bh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(bh.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(bh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var PX=bh,us=PX;var bP=class bP{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??Bi.TRANSLUCENT,this._modelMatrix=M.clone(t.modelMatrix??M.IDENTITY),this._boundingVolume=ue.clone(t.boundingVolume??new ue,new ue),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??bP.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??bP.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)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.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&&!ls(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(bP,"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 f2=bP;f2.DEFAULT_CAPACITY=1024;var fa=f2;var{ERR_CAPACITY:Jcn}=fa.Error,P6e=new h,d2=class d2 extends us{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(P6e)),i}get vertexOffset(){return this._getUint32(d2.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(d2,"Layout",{...us.Layout,POSITION_OFFSET_U32:us.Layout.__BYTE_LENGTH,__BYTE_LENGTH:us.Layout.__BYTE_LENGTH+4});var DX=d2,Wc=DX;var h2=`#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; + +`)}return[r,o,t,s].join(` +`)};Wo._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};Wo._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 bfe(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 xfe(e){return`in vec4 v_pickColor; +${e}`}Wo._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};Wo._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};Wo._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?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) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); + } + else if (czm_morphTime == 0.0) + { + centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); + } + else + { + centerRTE = czm_columbusViewMorph( + czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), + czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), + czm_morphTime); + } +`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; + float distanceSq; + if (czm_sceneMode == czm_sceneMode2D) + { + distanceSq = czm_eyeHeight2D.y - radiusSq; + } + else + { + distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; + } + distanceSq = max(distanceSq, 0.0); + float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; + float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; + float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; + gl_Position *= show; +}`,`${i} +${r}`};function Tfe(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; +`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); +`):(n&&(f+=`vec3 normal; +`,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() +{ +${d} czm_non_compressed_main(); +}`;return[u,f,p,g].join(` +`)}function A6e(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 b6e(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(); + #else + czm_writeDepthClamp(); + #endif } -`;var m2=`in vec4 v_pickColor; +`,t}function Efe(e,t){let n=e.vertexAttributes}function x6e(e,t){return function(){return e[t]}}var _X=Math.max(dn.hardwareConcurrency-1,1),R2,T6e=new Jn("combineGeometry");function E6e(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===fs.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(R2))for(R2=new Array(_X),r=0;r<_X;r++)R2[r]=new Jn("createGeometry");let f;for(u=D2(u,_X),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(R2[r].scheduleTask({subTasks:u[r]},m))}e._state=fs.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=fs.CREATED}).catch(function(d){hP(e,t,fs.FAILED,d)})}else if(e._state===fs.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=T6e.scheduleTask(KE.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=fs.COMBINING,Promise.resolve(f).then(function(d){let p=KE.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=fs.COMBINED):hP(e,t,fs.FAILED,void 0)}).catch(function(d){hP(e,t,fs.FAILED,d)})}}function C6e(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=g6e(p):g=p.constructor.createGeometry(p),r[c++]=_6e(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=KE.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=fs.COMBINED):hP(e,t,fs.FAILED,void 0)}function v6e(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 ue;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),Mfe(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.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=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.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]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}Wo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Cfe=new Sn,Dfe=new he,Rfe=new h,Ofe=new ue;function S6e(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=ue.transform(y,A,Ofe));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,Cfe);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,Dfe),v=u.project(E,Rfe);T=Sn.fromCartesian(v,Cfe),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var yX=new h,w6e=new h;function vfe(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=ue.transform(f,p,Ofe));let g=f.center;g=o.scaleToGeodeticSurface(g,w6e);let m=o.cartesianToCartographic(g,Dfe),y=r.project(m,Rfe),A=h.add(d,g,yX);m=o.cartesianToCartographic(A,m);let b=r.project(m,yX),x=h.subtract(b,y,yX),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function I6e(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(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!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(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,hP(e,t,fs.COMPLETE,void 0)}function P6e(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=gc.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 D6e(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=Wo._appendOffsetToShader(e,o),o=Wo._appendShowToShader(e,o),o=Wo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=bfe(o),o=Wo._updateColorAttribute(e,o,!1),o=Tfe(e,o),o=Wo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=xfe(s),e._sp=en.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Efe(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=Wo._appendShowToShader(e,o),o=Wo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=bfe(o),o=Wo._updateColorAttribute(e,o,!0),o=Tfe(e,o),o=Wo._modifyShaderPosition(e,o,t.scene3DOnly),o=A6e(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=xfe(s),s=b6e(s),e._spDepthFail=en.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Efe(e._spDepthFail,r))}var dP=new M,Sfe=new h;function wfe(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]=x6e(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 M.multiply(c,e._modelMatrix,dP),M.multiplyByPoint(dP,e.rtcCenter,Sfe),M.setTranslation(dP,Sfe,dP),dP}),a}function R6e(e,t,n,i,r,o,s,a){let c=wfe(e,t,n,a),u;l(e._depthFailAppearance)&&(u=wfe(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}}Wo._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]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.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 O6e(e,t,n,i,r,o,s,a){Wo._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)}}}Wo.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===fs.FAILED)return;let t=e.context;if(l(this._batchTable)||m6e(this,t),this._batchTable.attributes.length>0){if(zt.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!==fs.COMPLETE&&this._state!==fs.COMBINED&&(this.asynchronous?E6e(this,e):C6e(this,e)),this._state===fs.COMBINED&&(S6e(this,e),vfe(this,e),I6e(this,e)),!this.show||this._state!==fs.COMPLETE)return;this._batchTableOffsetsUpdated||vfe(this,e),this._recomputeBoundingSpheres&&v6e(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??P6e)(this,t,n,u),o&&(this._createShaderProgramFunction??D6e)(this,e,n),(r||o)&&(this._createCommandsFunction??R6e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??O6e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var M6e=new ue,N6e=new ue;function Mfe(e,t,n){if(n===pn.TOP){let i=ue.clone(e,M6e),r=ue.clone(e,N6e);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===pn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function L6e(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 F6e(e,t,n,i,r){return function(o){let s=Pfe(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var B6e=new h;function k6e(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)&&Mfe(i,h.fromArray(o.get(),0,B6e),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function U6e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Wo.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:L6e(s,n,f),set:F6e(s,n,f,this,u)}}return k6e(this,c,n),U6e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Wo.prototype.isDestroyed=function(){return!1};Wo.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,le(this)};function hP(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===fs.COMPLETE||e._state===fs.FAILED,!0})}var Mn=Wo;function z6e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Sl=z6e;var mP=`#ifdef TEXTURE_COORDINATES +#ifdef SPHERICAL +in vec4 v_sphericalExtents; +#else // SPHERICAL +in vec2 v_inversePlaneExtents; +in vec4 v_westPlane; +in vec4 v_southPlane; +#endif // SPHERICAL +in vec3 v_uvMinAndSphericalLongitudeRotation; +in vec3 v_uMaxAndInverseDistance; +in vec3 v_vMaxAndInverseDistance; +#endif // TEXTURE_COORDINATES +#ifdef PER_INSTANCE_COLOR in vec4 v_color; -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; +#endif +#ifdef NORMAL_EC +vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { +vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); +return eyeCoordinate.xyz / eyeCoordinate.w; } -out_FragColor = czm_gammaCorrect(color); -czm_writeLogDepth(); +vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { +vec2 glFragCoordXY = gl_FragCoord.xy; +float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); +float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); +bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); +float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); +float useDownOrLeft = float(useUpOrRight == 0.0); +vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); +vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); +return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; } -`;var xP=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(xP,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(xP,"DEFAULT_MATERIAL");var du=xP;var TP=class TP extends du{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(TP,"Layout",{...du.Layout,SIZE_U8:du.Layout.__BYTE_LENGTH,__BYTE_LENGTH:du.Layout.__BYTE_LENGTH+4}),ut(TP,"DEFAULT_MATERIAL",Object.freeze(new TP));var RX=TP,Zm=RX;var OX={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},Yfe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Db=new Wc,xh=new Zm,EP=new z,Xfe=new h,MX=new Sn;function D6e(e,t,n){let i=t.context;n=n||{destroy:R6e};let r=e._positionDatatype===Y.DOUBLE,o=r?OX:Yfe;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,Db),Db._dirty&&(r&&(Db.getPosition(Xfe),Sn.fromCartesian(Xfe,MX),h.pack(MX.high,c,y*3),h.pack(MX.low,u,y*3)),Db.getMaterial(xh),z.fromRgba(Db._pickId,EP),f[y*4]=z.floatToByte(EP.red),f[y*4+1]=z.floatToByte(EP.green),f[y*4+2]=z.floatToByte(EP.blue),f[y*4+3]=z.floatToByte(EP.alpha),d[y*4]=Db.show?1:0,d[y*4+1]=xh.size,d[y*4+2]=cn.encodeRGB8(xh.color),d[y*4+3]=xh.color.alpha,p[y*3]=xh.outlineWidth,p[y*3+1]=cn.encodeRGB8(xh.outlineWidth>0?xh.outlineColor:xh.color),p[y*3+2]=xh.outlineWidth>0?xh.outlineColor.alpha:xh.color.alpha,Db._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:OX.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:OX.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:Yfe.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===Bi.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[h2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[m2]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===Bi.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 R6e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var p2=D6e;var NX=class e extends fa{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Wc}_getMaterialClass(){return Zm}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Wc){return super.add(t,n),n._setUint32(Wc.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=p2(this,t,this._renderContext))}},ff=NX;var{ERR_CAPACITY:jln,ERR_RESIZE:Hln,ERR_OUT_OF_RANGE:Gln}=fa.Error,sd=class sd extends us{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(sd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(sd.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(sd.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(sd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(sd.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(sd.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(sd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(sd.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(sd.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(sd,"Layout",{...us.Layout,POSITION_OFFSET_U32:us.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:us.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:us.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:us.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:us.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:us.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:us.Layout.__BYTE_LENGTH+24});var LX=sd,Fo=LX;var g2=`#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() +#endif // NORMAL_EC +void main(void) { -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); +#ifdef REQUIRES_EC +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); #endif -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -v_pickColor = pickColor / 255.0; -v_color = color; -v_color.a *= alpha * show; -gl_Position *= show; -} -`;var _2=`in vec4 v_pickColor; -in vec4 v_color; -void main() -{ -if (v_color.a < 0.005) -{ +#ifdef REQUIRES_WC +vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; +vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +#endif +#ifdef TEXTURE_COORDINATES +vec2 uv; +#ifdef SPHERICAL +vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); +sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; +sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); +uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; +uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; +#else // SPHERICAL +uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; +uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; +#endif // SPHERICAL +#endif // TEXTURE_COORDINATES +#ifdef CULL_FRAGMENTS +if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { discard; } -out_FragColor = czm_gammaCorrect(v_color); -czm_writeLogDepth(); -} -`;var y2=class y2 extends du{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(y2,"DEFAULT_MATERIAL",Object.freeze(new y2));var FX=y2,ad=FX;var BX={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},Kfe={position:0,pickColor:1,showColorAlpha:2},da=new Fo,kX=new ad,CP=new z,$fe=new h,UX=new Sn;function O6e(e,t,n){let i=t.context;n=n||{destroy:N6e};let r=e._positionDatatype===Y.DOUBLE,o=r?BX:Kfe;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,da),!da._dirty)continue;let x=da.triangleOffset,T=da.vertexOffset,E=da.getTriangles();for(let R=0,O=da.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=da.show,S=r?da.getPositions():null;da.getMaterial(kX);let I=cn.encodeRGB8(kX.color);z.fromRgba(da._pickId,CP);for(let R=0,O=da.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,$fe),Sn.fromCartesian($fe,UX),h.pack(UX.high,d,T*3),h.pack(UX.low,p,T*3)),m[T*4]=z.floatToByte(CP.red),m[T*4+1]=z.floatToByte(CP.green),m[T*4+2]=z.floatToByte(CP.blue),m[T*4+3]=z.floatToByte(CP.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=kX.color.alpha,T++;da._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=M6e(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:BX.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:BX.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:Kfe.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===Bi.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[g2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[_2]}),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===Bi.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 M6e(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,da);let i=da.vertexOffset,r=da.triangleOffset*3;e.get(t+n-1,da);let o=da.vertexOffset+da.vertexCount-i,s=(da.triangleOffset+da.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function N6e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var A2=O6e;var{ERR_CAPACITY:Pun}=fa.Error,zX=class e extends fa{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??fa.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??fa.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=A2(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}},$a=zX;var{ERR_RESIZE:Nun,ERR_CAPACITY:Lun}=fa.Error,eC=class eC extends us{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(eC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(eC.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(eC.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(eC,"Layout",{...us.Layout,POSITION_OFFSET_U32:us.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:us.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:us.Layout.__BYTE_LENGTH+8});var VX=eC,Pa=VX;var b2=`#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); +#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)); +vec3 normalEC = normalize(cross(leftRight, downUp)); #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); +#ifdef PER_INSTANCE_COLOR +vec4 color = czm_gammaCorrect(v_color); +#ifdef FLAT +out_FragColor = color; +#else // FLAT +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = -eyeCoordinate.xyz; +czm_material material = czm_getDefaultMaterial(materialInput); +material.diffuse = color.rgb; +material.alpha = color.a; +out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT +out_FragColor.rgb *= out_FragColor.a; +#else // PER_INSTANCE_COLOR +czm_materialInput materialInput; +#ifdef USES_NORMAL_EC +materialInput.normalEC = normalEC; #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; +#ifdef USES_POSITION_TO_EYE_EC +materialInput.positionToEyeEC = -eyeCoordinate.xyz; +#endif +#ifdef USES_TANGENT_TO_EYE +materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +#endif +#ifdef USES_ST +materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; +materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +#endif +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else // FLAT +out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); +#endif // FLAT +out_FragColor.rgb *= out_FragColor.a; +#endif // PER_INSTANCE_COLOR +czm_writeDepthClamp(); +#endif // PICK } -`;var x2=`in vec4 v_pickColor; +`;function nd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new AX;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new AX;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}nd.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,mP]})};nd.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:[mP],pickColorQualifier:"in"})};nd.prototype.createVertexShader=function(e,t,n,i){return Vfe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};nd.prototype.createPickVertexShader=function(e,t,n,i){return Vfe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Nfe=new h,Lfe=new he,Ffe={high:0,low:0};function Vfe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Lfe;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,Nfe),d=Sn.encode(f.x,Ffe);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=Lfe;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,Nfe);d=Sn.encode(g.x,Ffe),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 AX(){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(AX.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 Bfe(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 V6e=[new U,new U,new U,new U];function jfe(e,t){let n=V6e,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Bfe(i,r,o),a=1/Bfe(i,o,r);e.uvMinAndExtents=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Hfe=new he,Gfe=new h,j6e=new h,H6e=new h,O2={high:0,low:0};function Wfe(e,t,n){let i=Hfe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,Gfe);i.latitude=e.north;let o=t.project(i,j6e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,H6e),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,O2);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,O2),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,O2),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,O2),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var G6e=new M,W6e=new M,kfe=new h,q6e=new he,Y6e=[new he,new he,new he,new he,new he,new he,new he,new he];function X6e(e,t,n,i,r,o){let s=ie.center(e,q6e);s.height=n;let a=he.toCartesian(s,t,kfe),c=At.eastNorthUpToFixedFrame(a,t,G6e),u=M.inverse(c,W6e),f=e.west,d=e.east,p=e.north,g=e.south,m=Y6e;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,kfe);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 K6e=new h,$6e=new h,J6e=new Sn;nd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=Gfe,s=K6e,a=$6e;X6e(e,n,r??0,o,s,a);let c={};jfe(c,t);let u=Sn.fromCartesian(o,J6e);return c.southWest_HIGH=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Wfe(e,i,c),c};var Z6e=new h;function Ufe(e,t,n,i){let r=Hfe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,Z6e),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 zfe=new U;nd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Ufe(e.south,e.west,n,zfe),o=r.x,s=r.y,a=Ufe(e.north,e.east,n,zfe),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 Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Sl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return jfe(g,t),Wfe(e,i,g),g};nd.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)};nd.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 Q6e(e){return Math.max(e.width,e.height)>nd.MAX_WIDTH_FOR_PLANAR_EXTENTS}nd.shouldUseSphericalCoordinates=function(e){return Q6e(e)};nd.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var id=nd;var qfe={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(qfe);var ei=qfe;var Yfe={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(Yfe);var Rt=Yfe;var M2={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};M2.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ei.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ei.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:M2.CESIUM_3D_TILE_MASK,mask:M2.CESIUM_3D_TILE_MASK}};var Xt=Object.freeze(M2);function Db(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.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(Db.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}}});Db.isSupported=function(e){return e.context.stencilBuffer};function $E(e,t){let n=t?ei.EQUAL:ei.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:gc.LESS_OR_EQUAL},depthMask:!1}}function xX(e){return{stencilTest:{enabled:e,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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:nn.PRE_MULTIPLIED_ALPHA_BLEND}}var eHe={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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 tHe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache($E(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache($E(r,!0)),e._rsColorPass=Ge.fromCache(xX(r,!1)),e._rsPickPass=Ge.fromCache(eHe)}function nHe(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() +{ +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function iHe(e,t){let n=t.context,i=e._primitive,r=P2;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=nHe(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Xe({defines:[a],sources:[r]}),u=new Xe({sources:[Pb]}),f=e._primitive._attributeLocations,d=new id(s,o,e.appearance);if(e._spStencil=en.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Xe.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=en.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=en.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Mn._appendShowToShader(i,r),c=new Xe({defines:[a],sources:[r]}),e._sp=en.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=en.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 rHe(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 oHe(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 sHe(e,t,n,i,r,o,s){rHe(e,o),oHe(e,s)}function Xfe(e,t){return Math.floor(e%t/2)}function bX(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Kfe(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function aHe(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!==Qn.CESIUM_3D_TILE,p=f!==Qn.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[Xfe(m,b)],d&&(A=n[m],bX(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,bX(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],bX(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[Xfe(m,b)];y=u[T.index],d&&(A=i[m],Kfe(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,Kfe(A,t,r,o,y))}}}Db.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=id.hasAttributesForSphericalExtents(c),g=id.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){tHe(n,A)},i._createShaderProgramFunction=function(y,A,b){iHe(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){sHe(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){aHe(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($E(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache($E(!1,!0)),this._rsColorPass=Ge.fromCache(xX(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache($E(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache($E(!0,!0)),this._rsColorPass=Ge.fromCache(xX(!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))})};Db.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Db.prototype.isDestroyed=function(){return!1};Db.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,le(this)};var pP=Db;var cHe={u_globeMinimumAltitude:function(){return 55e3}};function uu(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??Qn.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:cHe}}Object.defineProperties(uu.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}}});uu.isSupported=pP.isSupported;function $fe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function Jfe(e){return function(t,n){return e._minHeight}}var lHe=new h,uHe=new h,fHe=new h,dHe=new he,hHe=new ie;function N2(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,lHe),g=h.unpack(r,d,uHe),m=h.add(p,g,fHe),y=n.cartesianToCartographic(m,dHe),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=hHe;return f.north=c,f.south=s,f.east=u,f.west=a,f}function mHe(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function pHe(e,t,n){let i=t.mapProjection.ellipsoid,r=N2(t,n),o=Qt.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.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 TX(e,t){return Math.floor(e%t/2)}function EX(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 Zfe(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 gHe(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!==Qn.CESIUM_3D_TILE,d=u!==Qn.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[TX(m,b)],f&&(A=n[m],EX(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,EX(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],EX(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[TX(m,b)],!e._useFragmentCulling){let T=x[TX(m,b)];y=c[T.index]}f&&(A=i[m],Zfe(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,Zfe(e,A,t,r,o,y))}}}uu.initializeTerrainHeights=function(){return Ni.initialize()};uu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){uu.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=N2(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)}mHe(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=uu._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=N2(e,o),id.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=N2(e,o),x=o.textureCoordinateRotationPoints;A?y=id.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=id.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,Jfe(this),$fe(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,Jfe(this),$fe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){pHe(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){gHe(t,A,b,x,T,E,v,S)},this._primitive=new pP(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))})};uu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};uu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};uu.prototype.isDestroyed=function(){return!1};uu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};uu._supportsMaterials=function(e){return e.depthTexture};uu.supportsMaterials=function(e){return uu._supportsMaterials(e.frameState.context)};var fu=uu;function JE(){pe.throwInstantiationError()}Object.defineProperties(JE.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});JE.prototype.getType=pe.throwInstantiationError;JE.prototype.getValue=pe.throwInstantiationError;JE.prototype.equals=pe.throwInstantiationError;var _He=new K;JE.getValue=function(e,t,n){let i;return l(e)||(e=K.now(_He)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ir.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ir.ColorType)&&(n=ir.fromType(ir.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Co=JE;function Rb(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}Rb.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Rb.prototype._setOptions=pe.throwInstantiationError;Rb.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=Co.getValue(e,u,this._material);this._material=g,d=new Cr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=An.VERTEX_FORMAT,this._primitive=r.add(new fu({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 An({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Rb.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))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};Rb.prototype.isDestroyed=function(){return!1};Rb.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),le(this)};var Ri=Rb;var Qfe={};function gP(e,t){l(Qfe[e])||(Qfe[e]=!0,console.warn(t??e))}gP.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.";gP.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";gP.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";gP.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=gP;var ede={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(ede);var B_=ede;var tde={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(tde);var ln=tde;var nde=P.EPSILON10;function yHe(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,nde)?(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],nde)&&(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=yHe;function AHe(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 bHe(e,t){return e*t*(4+e*(4-3*t))/16}function ide(e,t,n,i,r,o,s){let a=bHe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function xHe(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+ide(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 THe=new h,CX=new h;function rde(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,CX),THe),o=h.normalize(i.cartographicToCartesian(n,CX),CX);xHe(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,AHe(e)}function _P(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)&&rde(this,e,t,i)}Object.defineProperties(_P.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}}});_P.prototype.setEndPoints=function(e,t){rde(this,e,t,this._ellipsoid)};_P.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};_P.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)-ide(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 k_=_P;function SX(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 EHe(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 ZE(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 CHe(e,t,n,i,r){let o=ZE(e._ellipticity,n),s=ZE(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function vHe(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=SX(e._ellipticity,t,r);u=(SX(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var SHe=new h,vX=new h;function ode(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,vX),SHe),o=h.normalize(i.cartographicToCartesian(n,vX),vX),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=CHe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=vHe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function sde(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=SX(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=EHe(p,r,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=ZE(r,e.latitude),m=ZE(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 H0(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)&&ode(this,e,t,i)}Object.defineProperties(H0.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}}});H0.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=sde(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new H0(e,d,o):(r.setEndPoints(e,d),r)};H0.prototype.setEndPoints=function(e,t){ode(this,e,t,this._ellipsoid)};H0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};H0.prototype.interpolateUsingSurfaceDistance=function(e,t){return sde(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};H0.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};H0.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=ZE(n,r.latitude),s=ZE(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 jc=H0;var NX=[ji,Ti],wHe=NX.length,Sde=Math.cos(P.toRadians(30)),ade=Math.cos(P.toRadians(150)),wde=0,Ide=1e3;function z_(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(z_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});z_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<wHe;i++)if(t instanceof NX[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var IHe=new h,cde=new h,lde=new h;function MX(e,t,n,i,r){let o=wl(i,e,0,IHe),s=wl(i,e,n,cde),a=wl(i,t,0,lde),c=G0(s,o,cde),u=G0(a,o,lde);return h.cross(u,c,r),h.normalize(r,r)}var PHe=new he,DHe=new h,RHe=new h,OHe=new h;function wX(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new k_(e,t,s):o===ln.RHUMB&&(d=new jc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=MX(e,t,i,s,OHe),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,PHe),v=wl(s,E,n,DHe),S=wl(s,E,i,RHe);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 IX=new he;function wl(e,t,n,i){return he.clone(t,IX),IX.height=n,he.toCartesian(IX,e,i)}z_.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};z_.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 z_({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 G0(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function ude(e,t,n,i){return i=G0(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var MHe=new h,NHe=new h,LHe=new h,Pde=new h,FHe=0,BHe=-1;function PX(e,t,n,i,r){let o=G0(n,t,Pde),s=ude(e,t,o,MHe),a=ude(i,t,o,NHe);if(P.equalsEpsilon(h.dot(s,a),BHe,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,LHe);return h.dot(a,c)<FHe&&(r=h.negate(r,r)),r}var k2=sn.fromPointNormal(h.ZERO,h.UNIT_Y),kHe=new h,UHe=new h,zHe=new h,VHe=new h,jHe=new h,L2=new h,F2=new he,fde=new he,dde=new he;z_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new NX[e._projectionIndex](i),a=wde,c=Ide,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new jc(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=xi.lineSegmentPlane(g,m,k2,L2),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,F2).longitude,y=i.cartesianToCartographic(g,F2),A=i.cartesianToCartographic(m,fde),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,dde),x=i.cartographicToCartesian(T,L2),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=xi.lineSegmentPlane(g,m,k2,L2),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,F2).longitude,y=i.cartesianToCartographic(g,F2),A=i.cartesianToCartographic(m,fde),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,dde),x=i.cartographicToCartesian(T,L2),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=kHe,w=UHe,D=zHe,N=VHe,F=jHe,V=I[0],B=I[1],j=I[S-1];for(C=wl(i,j,a,C),N=wl(i,B,a,N),w=wl(i,V,a,w),D=wl(i,V,c,D),n?F=PX(C,w,D,N,F):F=MX(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),wX(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];wl(i,q,c,D),wl(i,I[f+1],a,N),PX(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),wX(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=wl(i,k,a,w),D=wl(i,k,c,D),n){let q=I[0];C=wl(i,G,a,C),N=wl(i,q,a,N),F=PX(C,w,D,N,F)}else F=MX(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(wX(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 mGe(n,s,L,_,O,R,t)};var HHe=new h,GHe=new $,WHe=new Le;function hde(e,t,n,i){let r=G0(n,t,HHe),o=h.dot(r,e);if(o>Sde||o<ade){let s=G0(i,n,Pde),a=o<ade?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,WHe),u=$.fromQuaternion(c,GHe);return $.multiplyByVector(u,e,e),!0}return!1}var mde=new he,qHe=new h,pde=new h;function yP(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,qHe),s=h.add(o,n,pde),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,mde);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,pde),u=c.cartesianToCartographic(s,mde)),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 YHe=new h,gde=new h;function _de(e,t,n,i,r,o){let s=h.subtract(t,e,YHe);h.normalize(s,s);let a=n-wde,c=h.multiplyByScalar(s,a,gde);h.add(e,c,r);let u=i-Ide;c=h.multiplyByScalar(s,u,gde),h.add(t,c,o)}var XHe=new h;function B2(e,t){let n=sn.getPointDistance(k2,e),i=sn.getPointDistance(k2,t),r=XHe;P.equalsEpsilon(n,0,P.EPSILON2)?(r=G0(t,e,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=G0(e,t,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(t,r,t))}function KHe(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 Dde=new he,Rde=new he,yde=new h,DX=new h,Ade=new h,bde=new h,$He=new h,xde=new h,JHe=[Dde,Rde],ZHe=new ie,QHe=new h,eGe=new h,tGe=new h,nGe=new h,iGe=new h,rGe=new h,RX=new h,OX=new h,oGe=new h,sGe=new h,aGe=new h,Tde=new h,cGe=new h,lGe=new h,uGe=new Sn,fGe=new Sn,Ede=new h,dGe=new h,Cde=new h,hGe=[new ue,new ue],Ode=[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],vde=Ode.length;function mGe(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,_=Dde;_.height=0;let C=Rde;C.height=0;let w=yde,D=DX;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,bde),W=h.unpack(i,0,DX),J=h.unpack(r,0,xde);if(e){let ve=h.unpack(n,n.length-6,Ade);hde(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,Ade),Re=h.clone(W,yde),Qe=h.clone(J,$He);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,bde),W=h.unpack(i,c,DX),J=h.unpack(r,c,xde),q=hde(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 pi=KHe(_,C);He=t.project(_,iGe),Ye=t.project(C,rGe);let ao=G0(Ye,He,Ede);ao.y=Math.abs(ao.y),Ke=RX,Pe=OX,pi===0||h.dot(ao,h.UNIT_Y)>Sde?(Ke=yP(t,_,Qe,He,RX),Pe=yP(t,C,J,Ye,OX)):pi===1?(Pe=yP(t,C,J,Ye,OX),Ke.x=0,Ke.y=P.sign(_.longitude-Math.abs(C.longitude)),Ke.z=0):(Ke=yP(t,_,Qe,He,RX),Pe.x=0,Pe.y=P.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(ve,uGe),vt=h.subtract(Q,ve,oGe),jt=h.normalize(vt,Tde),lt=h.subtract(Re,ve,sGe);lt=h.normalize(lt,lt);let mt=h.cross(jt,lt,Tde);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,cGe);ft=h.normalize(ft,ft);let Yt=h.subtract(W,Q,aGe);Yt=h.normalize(Yt,Yt);let rt=h.cross(J,Yt,lGe);rt=h.normalize(rt,rt);let ht=qe/F,Li=Z/F,Yn=0,yi,zi,Si,ui=0,Ai=0;if(s){Yn=h.distance(He,Ye),yi=Sn.fromCartesian(He,fGe),zi=h.subtract(Ye,He,Ede),Si=h.normalize(zi,dGe);let pi=Si.x;Si.x=Si.y,Si.y=-pi,ui=Yn/L,Ai=ae/L}for(V=0;V<8;V++){let pi=G+V*4,ao=j+V*2,nr=pi+3,jo=V<4?1:-1,Fn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,pi),A[nr]=vt.x,h.pack(st.low,b,pi),b[nr]=vt.y,h.pack(ft,x,pi),x[nr]=vt.z,h.pack(rt,T,pi),T[nr]=ht*jo,h.pack(mt,E,pi);let Vi=Li*Fn;Vi===0&&Fn<0&&(Vi=9),E[nr]=Vi,s&&(v[pi]=yi.high.x,v[pi+1]=yi.high.y,v[pi+2]=yi.low.x,v[pi+3]=yi.low.y,I[pi]=-Ke.y,I[pi+1]=Ke.x,I[pi+2]=Pe.y,I[pi+3]=-Pe.x,S[pi]=zi.x,S[pi+1]=zi.y,S[pi+2]=Si.x,S[pi+3]=Si.y,R[ao]=ui*jo,Vi=Ai*Fn,Vi===0&&Fn<0&&(Vi=9),R[ao+1]=Vi)}let zn=tGe,tn=nGe,Hn=QHe,Ki=eGe,wr=ie.fromCartographicArray(JHe,ZHe),so=Ni.getMinimumMaximumHeights(wr,u),Ts=so.minimumTerrainHeight,zs=so.maximumTerrainHeight;Ae+=Math.abs(Ts),Ae+=Math.abs(zs),_de(ve,Re,Ts,zs,zn,Hn),_de(Q,W,Ts,zs,tn,Ki);let $r=h.multiplyByScalar(mt,P.EPSILON5,Cde);h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),B2(zn,tn),B2(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,Cde),h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),B2(zn,tn),B2(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<vde;V++)m[c+V]=Ode[V]+fe;fe+=8,c+=vde}let xe=hGe;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:U_(A),startLoAndForwardOffsetY:U_(b),startNormalAndForwardOffsetZ:U_(x),endNormalAndTextureCoordinateNormalizationX:U_(T),rightNormalAndTextureCoordinateNormalizationY:U_(E)};return s&&(we.startHiLo2D=U_(v),we.offsetAndRight2D=U_(S),we.startEndNormals2D=U_(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new wt({attributes:we,indices:m,boundingSphere:ge})}function U_(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}z_._projectNormal=yP;var QE=z_;var U2=`in vec4 v_startPlaneNormalEcAndHalfWidth; +in vec4 v_endPlaneNormalEcAndBatchId; +in vec4 v_rightPlaneEC; +in vec4 v_endEcAndStartEcX; +in vec4 v_texcoordNormalizationAndStartEcYZ; +#ifdef PER_INSTANCE_COLOR in vec4 v_color; -void main() -{ -if (v_color.a < 0.005) +#endif +void main(void) { +float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); +vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); +if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME discard; +#endif // DEBUG_SHOW_VOLUME } -out_FragColor = czm_gammaCorrect(v_color); -czm_writeLogDepth(); -} -`;var hu=`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); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +eyeCoordinate /= eyeCoordinate.w; +float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); +float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); +float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); +float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); +if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -else { -lineDir = normalize(nextWindow.xy - positionWindow.xy); +vec3 alignedPlaneNormal; +alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); +alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); +distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); +alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); +alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); +distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); +#ifdef PER_INSTANCE_COLOR +out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR +float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); +s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; +float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); +czm_materialInput materialInput; +materialInput.s = s; +materialInput.st = vec2(s, t); +materialInput.str = vec3(s, t, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR +out_FragColor.rgb *= out_FragColor.a; +czm_writeDepthClamp(); } -angle = atan(lineDir.x, lineDir.y) - 1.570796327; -angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; +`;var z2=`in vec3 v_forwardDirectionEC; +in vec3 v_texcoordNormalizationAndHalfWidth; +in float v_batchId; +#ifdef PER_INSTANCE_COLOR +in vec4 v_color; +#else +in vec2 v_alignedPlaneDistances; +in float v_texcoordT; #endif -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; +float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { +return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -vec2 thisSegmentForwardWC, otherSegmentForwardWC; -if (usePrevious) +void main(void) { -thisSegmentForwardWC = -directionToPrevWC; -otherSegmentForwardWC = directionToNextWC; +vec4 eyeCoordinate = gl_FragCoord; +eyeCoordinate /= eyeCoordinate.w; +#ifdef PER_INSTANCE_COLOR +out_FragColor = czm_gammaCorrect(v_color); +#else // PER_INSTANCE_COLOR +float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); +float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); +distanceFromStart = max(0.0, distanceFromStart); +distanceFromEnd = max(0.0, distanceFromEnd); +float s = distanceFromStart / (distanceFromStart + distanceFromEnd); +s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; +czm_materialInput materialInput; +materialInput.s = s; +materialInput.st = vec2(s, v_texcoordT); +materialInput.str = vec3(s, v_texcoordT, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#endif // PER_INSTANCE_COLOR } -else +`;var V2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +in float batchId; +out vec3 v_forwardDirectionEC; +out vec3 v_texcoordNormalizationAndHalfWidth; +out float v_batchId; +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#else +out vec2 v_alignedPlaneDistances; +out float v_texcoordT; +#endif +void main() { -thisSegmentForwardWC = directionToNextWC; -otherSegmentForwardWC = -directionToPrevWC; +v_batchId = batchId; +vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); +vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); +vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); +vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; +vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; +vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +vec4 startPlane2D; +vec4 startPlane3D; +startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); +startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; +startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); +startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); +vec4 rightPlane2D; +vec4 rightPlane3D; +rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); +rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; +rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); +rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); +posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); +posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); +posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); +posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; +posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; +vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; +vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); +vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); +vec4 endPlane2D; +vec4 endPlane3D; +endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); +endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; +endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); +endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); +v_forwardDirectionEC = normalize(endEC - startEC); +vec2 cleanTexcoordNormalization2D; +cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); +cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); +vec2 cleanTexcoordNormalization3D; +cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); +cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; +cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); +v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#else // PER_INSTANCE_COLOR +v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); +v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); +#endif // PER_INSTANCE_COLOR +#ifdef WIDTH_VARYING +float width = czm_batchTable_width(batchId); +float halfWidth = width * 0.5; +v_width = width; +v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#else +float halfWidth = 0.5 * czm_batchTable_width(batchId); +v_texcoordNormalizationAndHalfWidth.z = halfWidth; +#endif +vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); +float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); +float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); +vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); +vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); +vec3 normalEC = normalize(cross(planeDirection, upOrDown)); +vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); +geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); +geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; +positionEc3D.xyz += geodeticSurfaceNormal; +normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; +vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); +absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); +absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); +planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); +upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); +normalEC = normalize(cross(planeDirection, upOrDown)); +geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); +geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); +geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; +positionEc2D.xyz += geodeticSurfaceNormal; +normalEC *= sign(texcoordNormalization2D.x); +#ifndef PER_INSTANCE_COLOR +v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); +#endif +positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; +gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); +#ifdef ANGLE_VARYING +vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); +approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); +v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } -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)) +`;var j2=`in vec3 position3DHigh; +in vec3 position3DLow; +#ifndef COLUMBUS_VIEW_2D +in vec4 startHiAndForwardOffsetX; +in vec4 startLoAndForwardOffsetY; +in vec4 startNormalAndForwardOffsetZ; +in vec4 endNormalAndTextureCoordinateNormalizationX; +in vec4 rightNormalAndTextureCoordinateNormalizationY; +#else +in vec4 startHiLo2D; +in vec4 offsetAndRight2D; +in vec4 startEndNormals2D; +in vec2 texcoordNormalization2D; +#endif +in float batchId; +out vec4 v_startPlaneNormalEcAndHalfWidth; +out vec4 v_endPlaneNormalEcAndBatchId; +out vec4 v_rightPlaneEC; +out vec4 v_endEcAndStartEcX; +out vec4 v_texcoordNormalizationAndStartEcYZ; +#ifdef WIDTH_VARYING +out float v_width; +#endif +#ifdef ANGLE_VARYING +out float v_polylineAngle; +#endif +#ifdef PER_INSTANCE_COLOR +out vec4 v_color; +#endif +void main() { -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); +#ifdef COLUMBUS_VIEW_2D +vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; +vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); +vec3 ecEnd = forwardDirectionEC + ecStart; +forwardDirectionEC = normalize(forwardDirectionEC); +v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); +v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); +vec4 startPlaneEC; +startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); +startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); +vec4 endPlaneEC; +endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); +endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); +v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); +v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; +#else // COLUMBUS_VIEW_2D +vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; +vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); +vec3 ecEnd = ecStart + offset; +vec3 forwardDirectionEC = normalize(offset); +vec4 startPlaneEC; +startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; +startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); +vec4 endPlaneEC; +endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; +endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); +v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; +v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); +v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); +v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; +#endif // COLUMBUS_VIEW_2D +v_endEcAndStartEcX.xyz = ecEnd; +v_endEcAndStartEcX.w = ecStart.x; +v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; +#ifdef PER_INSTANCE_COLOR +v_color = czm_batchTable_color(batchId); +#endif // PER_INSTANCE_COLOR +vec4 positionRelativeToEye = czm_computePosition(); +vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; +float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); +float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); +vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); +vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); +vec3 normalEC = normalize(cross(planeDirection, upOrDown)); +upOrDown = cross(forwardDirectionEC, normalEC); +upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; +upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; +upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; +positionEC.xyz += upOrDown; +v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); +float width = czm_batchTable_width(batchId); +#ifdef WIDTH_VARYING +v_width = width; +#endif +v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; +v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; +v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; +v_endPlaneNormalEcAndBatchId.w = batchId; +width = width * max(0.0, czm_metersPerPixel(positionEC)); +width = width / dot(normalEC, v_rightPlaneEC.xyz); +#ifdef COLUMBUS_VIEW_2D +normalEC *= sign(texcoordNormalization2D.x); +#else +normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +#endif +positionEC.xyz += width * normalEC; +gl_Position = czm_depthClamp(czm_projection * positionEC); +#ifdef ANGLE_VARYING +vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); +approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); +v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +#endif } -vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; -return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; +`;var H2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; +in float batchId; +out vec4 v_color; +void main() +{ +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = czm_computePosition(); +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_color = color; } -vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) +`;var du=`void clipLineSegmentToNearPlane( +vec3 p0, +vec3 p1, +out vec4 positionWC, +out bool clipped, +out bool culledByNearPlane, +out vec4 clippedPositionEC) { -vec4 positionEC = czm_modelViewRelativeToEye * position; -vec4 prevEC = czm_modelViewRelativeToEye * previous; -vec4 nextEC = czm_modelViewRelativeToEye * next; -return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); +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; } -`;var vP=class vP extends du{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(vP,"Layout",{...du.Layout,WIDTH_F32:du.Layout.__BYTE_LENGTH,__BYTE_LENGTH:du.Layout.__BYTE_LENGTH+4}),ut(vP,"DEFAULT_MATERIAL",Object.freeze(new vP));var jX=vP,cd=jX;var Rb={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},T2={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},qc=new Pa,SP=new cd,wP=new z,Jfe=new h,Zfe=new h,Qfe=new h,HX=new Sn,GX=new Sn,WX=new Sn;function L6e(e,t,n){let i=t.context;n=n||{destroy:k6e};let r=e._positionDatatype===Y.DOUBLE,o=r?Rb:T2;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(SP);let L=cn.encodeRGB8(SP.color),_=SP.color.alpha,C=f?-SP.width:SP.width;z.fromRgba(qc._pickId,wP);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,Jfe),h.fromElements(J,Z,ae,Zfe),h.fromElements(Ae,fe,xe,Qfe),Sn.fromCartesian(Jfe,HX),Sn.fromCartesian(Zfe,GX),Sn.fromCartesian(Qfe,WX));for(let ge=0;ge<2;ge++)r?(h.pack(HX.high,x,D*3),h.pack(HX.low,T,D*3),h.pack(GX.high,E,D*3),h.pack(GX.low,v,D*3),h.pack(WX.high,S,D*3),h.pack(WX.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(wP.red),p[D*4+1]=z.floatToByte(wP.green),p[D*4+2]=z.floatToByte(wP.blue),p[D*4+3]=z.floatToByte(wP.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}=B6e(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:Rb.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Rb.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:Rb.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Rb.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:Rb.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Rb.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:T2.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:T2.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:T2.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===Bi.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[hu,b2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[x2]}),attributeLocations:o}));let s=F6e(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Bi.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 F6e(e){return(e.vertexCount-e.primitiveCount)*6}function B6e(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 k6e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var E2=L6e;var qX=class e extends fa{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 Pa}_getMaterialClass(){return cd}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Pa){super.add(t,n);let i=this._positionCount;return n._setUint32(Pa.Layout.POSITION_OFFSET_U32,i),n._setUint32(Pa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=E2(this,t,this._renderContext))}},Sl=qX;function KX(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=tde(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=H6e(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 PP(o,s,n,a,c,u,0),s}function tde(e,t,n,i,r){let o;if(r===eHe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=ede(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=ede(s/i|0,e[s],e[s+1],o);return o&&tC(o,o.next)&&(RP(o),o=o.next),o}function Ob(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(tC(n,n.next)||fs(n.prev,n,n.next)===0)){if(RP(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function PP(e,t,n,i,r,o,s){if(!e)return;!s&&o&&X6e(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?z6e(e,i,r,o):U6e(e)){t.push(c.i,e.i,u.i),RP(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=V6e(Ob(e),t),PP(e,t,n,i,r,o,2)):s===2&&j6e(e,t,n,i,r,o):PP(Ob(e),t,n,i,r,o,1);break}}}function U6e(e){let t=e.prev,n=e,i=e.next;if(fs(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&&IP(r,a,o,c,s,u,m.x,m.y)&&fs(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function z6e(e,t,n,i){let r=e.prev,o=e,s=e.next;if(fs(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=YX(g,m,t,n,i),x=YX(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&&IP(a,f,c,d,u,p,T.x,T.y)&&fs(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&&IP(a,f,c,d,u,p,E.x,E.y)&&fs(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&&IP(a,f,c,d,u,p,T.x,T.y)&&fs(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&&IP(a,f,c,d,u,p,E.x,E.y)&&fs(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function V6e(e,t){let n=e;do{let i=n.prev,r=n.next.next;!tC(i,r)&&ide(i,n,n.next,r)&&DP(i,r)&&DP(r,i)&&(t.push(i.i,n.i,r.i),RP(n),RP(n.next),n=e=r),n=n.next}while(n!==e);return Ob(n)}function j6e(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&J6e(s,a)){let c=rde(s,a);s=Ob(s,s.next),c=Ob(c,c.next),PP(s,t,n,i,r,o,0),PP(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function H6e(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=tde(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push($6e(u))}r.sort(G6e);for(let o=0;o<r.length;o++)n=W6e(r[o],n);return n}function G6e(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 W6e(e,t){let n=q6e(e,t);if(!n)return t;let i=rde(n,e);return Ob(i,i.next),Ob(n,n.next)}function q6e(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(tC(e,n))return n;do{if(tC(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&&nde(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);DP(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&Y6e(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function Y6e(e,t){return fs(e.prev,e,t.prev)<0&&fs(t.next,e,e.next)<0}function X6e(e,t,n,i){let r=e;do r.z===0&&(r.z=YX(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,K6e(r)}function K6e(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 YX(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 $6e(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 nde(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 IP(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&nde(e,t,n,i,r,o,s,a)}function J6e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Z6e(e,t)&&(DP(e,t)&&DP(t,e)&&Q6e(e,t)&&(fs(e.prev,e,t.prev)||fs(e,t.prev,t))||tC(e,t)&&fs(e.prev,e,e.next)>0&&fs(t.prev,t,t.next)>0)}function fs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function tC(e,t){return e.x===t.x&&e.y===t.y}function ide(e,t,n,i){let r=v2(fs(e,t,n)),o=v2(fs(e,t,i)),s=v2(fs(n,i,e)),a=v2(fs(n,i,t));return!!(r!==o&&s!==a||r===0&&C2(e,n,t)||o===0&&C2(e,i,t)||s===0&&C2(n,e,i)||a===0&&C2(n,t,i))}function C2(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 v2(e){return e>0?1:e<0?-1:0}function Z6e(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&&ide(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function DP(e,t){return fs(e.prev,e,e.next)<0?fs(e,t,e.next)>=0&&fs(e,e.prev,t)>=0:fs(e,t,e.prev)<0||fs(e,e.next,t)<0}function Q6e(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 rde(e,t){let n=XX(e.i,e.x,e.y),i=XX(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 ede(e,t,n,i){let r=XX(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 RP(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 XX(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function eHe(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}function JX(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 tHe(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 nC(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 nHe(e,t,n,i,r){let o=nC(e._ellipticity,n),s=nC(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function iHe(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=JX(e._ellipticity,t,r);u=(JX(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var rHe=new h,$X=new h;function ode(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,$X),rHe),o=h.normalize(i.cartographicToCartesian(n,$X),$X),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=nHe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=iHe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function sde(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=JX(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=tHe(p,r,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=nC(r,e.latitude),m=nC(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 q0(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)&&ode(this,e,t,i)}Object.defineProperties(q0.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}}});q0.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=sde(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new q0(e,d,o):(r.setEndPoints(e,d),r)};q0.prototype.setEndPoints=function(e,t){ode(this,e,t,this._ellipsoid)};q0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};q0.prototype.interpolateUsingSurfaceDistance=function(e,t){return sde(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};q0.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};q0.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=nC(n,r.latitude),s=nC(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=q0;function oHe(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=oHe;var sHe=new h,aHe=new h,G_={};G_.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};G_.computeWindingOrder2D=function(e){return G_.computeArea2D(e)>0?aa.COUNTER_CLOCKWISE:aa.CLOCKWISE};G_.triangulate=function(e,t){let n=U.packArray(e);return KX(n,t,2)};var ude=new h,fde=new h,dde=new h,ade=new h,cde=new h,lde=new h,Y0=new h,hde=new U,mde=new U,pde=new U,iC=new U;G_.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,ude),I=h.fromArray(u,E*3,fde),R=h.fromArray(u,T*3,dde),O,L,_;o&&(O=U.fromArray(f,v*2,hde),L=U.fromArray(f,E*2,mde),_=U.fromArray(f,T*2,pde));let C=h.multiplyByScalar(h.normalize(S,ade),y,ade),w=h.multiplyByScalar(h.normalize(I,cde),y,cde),D=h.multiplyByScalar(h.normalize(R,lde),y,lde),N=h.magnitudeSquared(h.subtract(C,w,Y0)),F=h.magnitudeSquared(h.subtract(w,D,Y0)),V=h.magnitudeSquared(h.subtract(D,C,Y0)),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,Y0),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,iC),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,Y0),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,_,iC),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,Y0),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,iC),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 cHe=new he,lHe=new he,uHe=new he,ZX=new he;G_.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,ude),O=h.fromArray(u,S*3,fde),L=h.fromArray(u,v*3,dde),_,C,w;o&&(_=U.fromArray(f,I*2,hde),C=U.fromArray(f,S*2,mde),w=U.fromArray(f,v*2,pde));let D=e.cartesianToCartographic(R,cHe),N=e.cartesianToCartographic(O,lHe),F=e.cartesianToCartographic(L,uHe);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,ZX),Q=(D.height+N.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Y0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,iC),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,ZX),Q=(N.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Y0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,iC),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,ZX),Q=(F.height+D.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Y0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,iC),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)};G_.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=sHe,o=aHe;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 hi=G_;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;var QX=0,gde=new h,S2=new h,fHe=new Mo;function dHe(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=fHe.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)?mHe(He,s,g)??d:hHe(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)eK(Pe,i,r,o,j,QX,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)eK(st,i,r,o,j,QX,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=pHe(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)),eK(Yn,i,r,o,j,QX,u,jt),mt++}if(vt.length<3)continue;let ft=hi.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=AHe(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}),yHe(V,D)}function hHe(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function mHe(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 pHe(e){let t=[];for(let n of e){let i=_He(n);if(i.length<3)continue;gHe(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function gHe(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 _He(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 eK(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,gde),h.subtract(gde,s,S2),a.push(S2.x,S2.y,S2.z)}function yHe(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 AHe(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var w2=dHe;function bHe(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 I2=bHe;var tK={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};tK.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(tK);var W_=tK;var _de={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(_de);var X0=_de;function xHe(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 P2=xHe;function THe(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 Mb=THe;function rC(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}rC.prototype.getTexture=function(e){return this._textures[e]};function EHe(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})}rC.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):EHe(this,e,t)};function CHe(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?D2(r,o,n):vHe(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function D2(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?Ade(e,n):new Dt({context:n,source:t,sampler:r});return yde(r)&&o.generateMipmap(),o}function vHe(e,t,n){let{typedArray:i,sampler:r}=e,o=yde(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=P2(i,a,c),p=Mb(d);return D2({sampler:r},p,n)}}else{let d=Mb(t);return D2(e,d,n)}else return D2(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."),Ade(e,n)}function yde(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function Ade(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})}rC.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];CHe(this,r,t)}n.length=0};rC.prototype.isDestroyed=function(){return!1};rC.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 le(this)};var R2=rC;var bde={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(bde);var Nb=bde;function OP(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??W_.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??Nb.INHERIT,this._textureManager=new R2,this._defaultTexture=void 0,this.uniformMap=SHe(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},PHe(this),DHe(this)}function SHe(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===X0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=wHe(e,i)):n[i]=IHe(e,i)}return n}function wHe(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function IHe(e,t){return function(){return e.uniforms[t].value}}function Lb(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function PHe(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,Lb(o,t,r),r=e.usedVariablesVertex.featureIdSet,Lb(o,n,r),r=e.usedVariablesVertex.metadataSet,Lb(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,Lb(s,t,r),r=e.usedVariablesFragment.featureIdSet,Lb(s,n,r),r=e.usedVariablesFragment.metadataSet,Lb(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;Lb(s,a,c)}}function xde(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 Xc(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${xde(t)} is not available in the ${i} shader. Did you mean ${xde(n)} instead?`;throw new pe(r)}}function DHe(e){let t=e.usedVariablesVertex.attributeSet;Xc(t,"position","positionMC","vertex"),Xc(t,"normal","normalMC","vertex"),Xc(t,"tangent","tangentMC","vertex"),Xc(t,"bitangent","bitangentMC","vertex"),Xc(t,"positionWC","positionMC","vertex"),Xc(t,"positionEC","positionMC","vertex"),Xc(t,"normalEC","normalMC","vertex"),Xc(t,"tangentEC","tangentMC","vertex"),Xc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Xc(n,"position","positionEC","fragment"),Xc(n,"normal","normalEC","fragment"),Xc(n,"tangent","tangentEC","fragment"),Xc(n,"bitangent","bitangentEC","fragment"),Xc(n,"normalMC","normalEC","fragment"),Xc(n,"tangentMC","tangentEC","fragment"),Xc(n,"bitangentMC","bitangentEC","fragment")}OP.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===X0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};OP.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};OP.prototype.isDestroyed=function(){return!1};OP.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var K0=OP;var ln={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Kc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};ln.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Kc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Kc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Kc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Kc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Kc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Kc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Kc.INTEGER,downcastFunction:e=>ln.clampToLimits(e,ln.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Kc.UNSIGNED_INTEGER,downcastFunction:e=>ln.clampToLimits(e,ln.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Kc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Kc.FLOAT,downcastFunction:e=>Math.fround(e)}};ln.getMinimum=function(e){return ln.typeInfo[e].minimumValue};ln.getMaximum=function(e){return ln.typeInfo[e].maximumValue};ln.isIntegerType=function(e){return ln.typeInfo[e].category!==Kc.FLOAT};ln.isUnsignedIntegerType=function(e){return ln.typeInfo[e].category===Kc.UNSIGNED_INTEGER};ln.isVectorCompatible=function(e){return ln.typeInfo[e].vectorCompatible};ln.category=function(e){return ln.typeInfo[e].category};ln.gpuComponentType=function(e){switch(e){case ln.INT64:return"INT32";case ln.UINT64:return"UINT32";case ln.FLOAT64:return"FLOAT32";default:return e}};ln.normalize=function(e,t){return Math.max(Number(e)/Number(ln.getMaximum(t)),-1)};ln.unnormalize=function(e,t){let n=ln.getMaximum(t),i=ln.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===ln.INT64||t===ln.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};ln.applyValueTransform=function(e,t,n){return n*e+t};ln.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};ln.getSizeInBytes=function(e){return ln.typeInfo[e].size};ln.clampToLimits=function(e,t){let n=ln.getMinimum(t),i=ln.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))};ln.downcastFunction=function(e){let n=ln.typeInfo[e].downcastFunction;return l(n)?n:i=>i};ln.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return ln.INT8;case Y.UNSIGNED_BYTE:return ln.UINT8;case Y.SHORT:return ln.INT16;case Y.UNSIGNED_SHORT:return ln.UINT16;case Y.INT:return ln.INT32;case Y.UNSIGNED_INT:return ln.UINT32;case Y.FLOAT:return ln.FLOAT32;case Y.DOUBLE:return ln.FLOAT64}};ln.toComponentDatatype=function(e){switch(e){case ln.INT8:return Y.BYTE;case ln.UINT8:return Y.UNSIGNED_BYTE;case ln.INT16:return Y.SHORT;case ln.UINT16:return Y.UNSIGNED_SHORT;case ln.INT32:return Y.INT;case ln.UINT32:return Y.UNSIGNED_INT;case ln.FLOAT32:return Y.FLOAT;case ln.FLOAT64:return Y.DOUBLE}};ln.getDataViewAccessors=function(e,t){return{[ln.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[ln.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[ln.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[ln.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[ln.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[ln.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[ln.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[ln.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[ln.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[ln.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(ln);var Lt=ln;function RHe(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 O2=RHe;function OHe(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!MHe(r?.[s],o?.[s]))continue;let a=NHe(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function MHe(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function NHe(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return LHe(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return FHe(e,i,r)}function LHe(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new K0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +else if (endPoint0Distance > 0.0) { - material.diffuse = fsInput.metadata.${e}.rgb; - material.alpha = fsInput.metadata.${e}.a; -}`})}function FHe(e,t,n){let r=I2([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 O2({typedArray:r,width:128,height:1});return new K0({uniforms:{u_colorMap:{type:X0.SAMPLER_2D,value:o},u_minimumValue:{type:X0.FLOAT,value:t[0]},u_maximumValue:{type:X0.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 MP=OHe;function oC(e,t){this._distance=t,this._normal=new Tde(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(oC.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)}}});oC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new oC(e.normal,e.distance),t};oC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new oC(e.normal,e.distance)};function Tde(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Tde.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 ha=oC;function $c(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?wde:Ide,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 wde(e){return e===$t.OUTSIDE}function Ide(e){return e===$t.INSIDE}Object.defineProperties($c.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?wde:Ide)}},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 Ede(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}$c.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Ede(n,i)},e.index=t,Ede(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};$c.prototype.get=function(e){return this._planes[e]};function Pde(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}$c.prototype.contains=function(e){return Pde(this._planes,e)!==-1};$c.prototype.remove=function(e){let t=this._planes,n=Pde(t,e);if(n===-1)return!1;e instanceof ha&&(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 ha&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};$c.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ha&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var BHe=new se,kHe=new se;function Cde(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,kHe);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,BHe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function vde(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 Dde(e,t){let n=Ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var UHe=new U;$c.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=$c.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=Dde(r,UHe);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?(vde(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Cde(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),vde(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),Cde(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 zHe=new M,Sde=new sn(h.UNIT_X,0);$c.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=M.multiply(t,r,zHe));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,Sde);let c=e.intersectPlane(Sde);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};$c.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};$c.useFloatTexture=function(e){return e.floatingPointTexture};$c.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=$c.useFloatTexture(t)?e.length:e.length*2,o=Dde(r,n);return o.y*=2,o};$c.prototype.isDestroyed=function(){return!1};$c.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Is=$c;var q_={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};q_.includesVertexShader=function(e){return(e&q_.VERTEX)!==0};q_.includesFragmentShader=function(e){return(e&q_.FRAGMENT)!==0};q_.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};q_.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(q_);var de=q_;function VHe(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=M2(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=M2(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=M2(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=M2(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=HHe(D,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${Rde(B)};`,`${p}.${w}.max${V} = ${Rde(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=jHe(w,D);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${N};`])}n.addFunctionLines(_,[`return ${L};`])}}function M2(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 jHe(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 Rde(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function HHe(e,t){return e===bt.SCALAR?"":`[${t}]`}var N2=VHe;function Th(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?Ode:Mde,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function Ode(e){return e===$t.OUTSIDE}function Mde(e){return e===$t.INSIDE}Object.defineProperties(Th.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?Ode:Mde)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});Th.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Th.prototype.get=function(e){return this._planes[e]};function Nde(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}Th.prototype.contains=function(e){return Nde(this._planes,e)!==-1};Th.prototype.remove=function(e){let t=this._planes,n=Nde(t,e);if(n===-1)return!1;e instanceof ha&&(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 ha&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Th.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ha&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var GHe=new sn(h.fromElements(1,0,0),0);function WHe(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=YHe(i[o],t,GHe);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var nK=new se,qHe=new h;function YHe(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,nK),s=M.multiplyByVector(t,o,nK),a=h.fromCartesian4(s,qHe);return s=se.divideByScalar(s,h.magnitude(a),nK),sn.fromCartesian4(s,n)}function Lde(e,t){return t.x=Math.min(e,Ut.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var XHe=new U;Th.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=Lde(i,XHe);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;WHe(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};Th.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=Lde(r,n);return o.y*=2,o};Th.prototype.isDestroyed=function(){return!1};Th.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Y_=Th;function iK(e){this.name=e,this.fields=[]}iK.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};iK.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var L2=iK;function rK(e){this.signature=e,this.body=[]}rK.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}`)};rK.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var F2=rK;function wl(){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(wl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});wl.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)};wl.prototype.addStruct=function(e,t,n){this._structs[e]=new L2(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};wl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};wl.prototype.addFunction=function(e,t,n){this._functions[e]=new F2(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};wl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};wl.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)};wl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};wl.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+=$He(e),i};wl.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}`)};wl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Qn(t,e):t.push(e)};wl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Qn(t,e):t.push(e)};wl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=KHe(this),i=JHe(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})};wl.prototype.clone=function(){return Ze(this,!0)};function KHe(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(),Qn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Qn(n,a);return{vertexLines:t,fragmentLines:n}}function $He(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function JHe(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(),Qn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Qn(n,a);return{vertexLines:t,fragmentLines:n}}var X_=wl;var B2=`struct Ray { -vec3 pos; -vec3 dir; -}; -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); +float t = endPoint0Distance / denominator; +if (t < 0.0 || t > magnitude) +{ +culledByNearPlane = true; } -`;var k2=`#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); +else +{ +p0 = p0 + t * direction; +p0.z = min(p0.z, -czm_currentFrustum.x); +clipped = true; } -#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); } -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; +clippedPositionEC = vec4(p0, 1.0); +positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); } -float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); -return vec4(entry.xyz, stepSize); +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); } -vec2 packIntToVec2(int value) { -float shifted = float(value) / 255.0; -float lowBits = fract(shifted); -float highBits = floor(shifted) / 255.0; -return vec2(highBits, lowBits); +else { +lineDir = normalize(nextWindow.xy - positionWindow.xy); } -vec2 packFloatToVec2(float value) { -float lowBits = fract(value); -float highBits = floor(value) / 255.0; -return vec2(highBits, lowBits); +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); } -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); +vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); +vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); +if (prevSegmentCulled) +{ +directionToPrevWC = -directionToNextWC; } -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); +else if (nextSegmentCulled) +{ +directionToNextWC = -directionToPrevWC; } -return Ray(origin, direction); +vec2 thisSegmentForwardWC, otherSegmentForwardWC; +if (usePrevious) +{ +thisSegmentForwardWC = -directionToPrevWC; +otherSegmentForwardWC = directionToNextWC; } -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); +else +{ +thisSegmentForwardWC = directionToNextWC; +otherSegmentForwardWC = -directionToPrevWC; } -void main() +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)) { -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; +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); } -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 -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; +vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; +return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; } -if (step.w == 0.0) { -step.w = 0.001; +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); } -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; +`;var pGe=`#define CLIP_POLYLINE +${du} +${H2}`,gGe=WE;function Ob(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ob.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??pGe,this._fragmentShaderSource=e.fragmentShaderSource??gGe,this._renderState=Dr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ob.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}}});Ob.VERTEX_FORMAT=Be.POSITION_ONLY;Ob.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;Ob.prototype.isTranslucent=Dr.prototype.isTranslucent;Ob.prototype.getRenderState=Dr.prototype.getRenderState;var Ys=Ob;var G2=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec2 st; +in float batchId; +out float v_width; +out vec2 v_st; +out float v_polylineAngle; +void main() +{ +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = czm_computePosition(); +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_width = width; +v_st.s = st.s; +v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); +v_polylineAngle = angle; } +`;var eC=`#ifdef VECTOR_TILE +uniform vec4 u_highlightColor; #endif -} -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 -out_FragColor = colorAccum; -#endif -} -`;var U2=`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 z2=`#define NO_HIT (-czm_infinity) -#define INF_HIT (czm_infinity * 0.5) -struct RayShapeIntersection { -vec4 entry; -vec4 exit; -}; -vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1) -{ -if (intersect0.w == NO_HIT) { -return intersect1; -} else if (intersect1.w == NO_HIT) { -return intersect0; -} -return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; -} -vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) -{ -return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; -} -RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) +in vec2 v_st; +void main() { -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; +czm_materialInput materialInput; +vec2 st = v_st; +st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); +materialInput.s = st.s; +materialInput.st = st; +materialInput.str = vec3(st, 0.0); +czm_material material = czm_getMaterial(materialInput); +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#ifdef VECTOR_TILE +out_FragColor *= u_highlightColor; #endif -}; -RayShapeIntersection getFirstIntersection(in Intersections ix) -{ -return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); +czm_writeLogDepth(); } -vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) +`;var _Ge=`#define CLIP_POLYLINE +${du} +${G2}`,yGe=eC;function Mb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Mb.VERTEX_FORMAT;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??_Ge,this._fragmentShaderSource=e.fragmentShaderSource??yGe,this._renderState=Dr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Mb.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}}});Mb.VERTEX_FORMAT=Be.POSITION_AND_ST;Mb.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;Mb.prototype.isTranslucent=Dr.prototype.isTranslucent;Mb.prototype.getRenderState=Dr.prototype.getRenderState;var _c=Mb;function W0(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new _c),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.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=Mde(!1),this._renderState3DTiles=Mde(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},depthTest:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(W0.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}}});W0.initializeTerrainHeights=function(){return Ni.initialize()};function AGe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(j2);s=Mn._appendShowToShader(r,s),s=Mn._appendDistanceDisplayConditionToShader(r,s),s=Mn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(V2);a=Mn._appendShowToShader(r,a),a=Mn._appendDistanceDisplayConditionToShader(r,a),a=Mn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(U2),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=en.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()(z2);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 Mde(e){return Ge.fromCache({cull:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function bGe(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Ys?{}: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 Nde(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 xGe(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!==Qn.CESIUM_3D_TILE,p=f!==Qn.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],Nde(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,Nde(e,g,t,r,o,b,s))}}}W0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){W0.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 Sl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,QE.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){AGe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){bGe(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){xGe(n,u,f,d,p,g,m)},this._primitive=new Mn(i)}if(this.appearance instanceof Ys&&!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))})};W0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};W0.isSupported=function(e){return e.frameState.context.depthTexture};W0.prototype.isDestroyed=function(){return!1};W0.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,le(this)};var Jm=W0;var TGe=new U(1,1),EGe=!1,CGe=z.WHITE;function tC(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(tC.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")});tC.prototype.getType=function(e){return"Image"};var vGe=new K;tC.prototype.getValue=function(e,t){return l(e)||(e=K.now(vGe)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,TGe,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,CGe,t.color),X.getValueOrDefault(this._transparent,e,EGe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};tC.prototype.equals=function(e){return this===e||e instanceof tC&&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 Nb=tC;function SGe(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 Nb;return t.image=e,t}}function wGe(e,t){return me(e,t,SGe)}var fo=wGe;function AP(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(AP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});AP.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 AP(this)};AP.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 nC=AP;var Lde={FIXED:0,INERTIAL:1};Object.freeze(Lde);var Wi=Lde;function iC(){pe.throwInstantiationError()}Object.defineProperties(iC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});iC.prototype.getValue=pe.throwInstantiationError;iC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;iC.prototype.equals=pe.throwInstantiationError;var Fde=new $;iC.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,Fde);if(n===Wi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Wi.FIXED)return $.multiplyByVector($.transpose(o,Fde),t,r)};var Zm=iC;function Lb(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Wi.FIXED}Object.defineProperties(Lb.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 IGe=new K;Lb.prototype.getValue=function(e,t){return l(e)||(e=K.now(IGe)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Lb.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)};Lb.prototype.getValueInReferenceFrame=function(e,t,n){return Zm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Lb.prototype.equals=function(e){return this===e||e instanceof Lb&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var hu=Lb;function bP(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(bP.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:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});bP.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 bP(this)};bP.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 rC=bP;function PGe(e){return e}function DGe(e,t){return me(e,t,PGe)}var mu=DGe;function xP(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(xP.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:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});xP.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 xP(this)};xP.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 oC=xP;function TP(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(TP.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:fo("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")});TP.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 TP(this)};TP.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 sC=TP;function EP(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(EP.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:fo("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")});EP.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 EP(this)};EP.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 aC=EP;function CP(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(CP.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")});CP.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 CP(this)};CP.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 Qm=CP;var RGe=new h(1,1,1),OGe=h.ZERO,MGe=Le.IDENTITY;function Bde(e,t,n){this.translation=h.clone(e??OGe),this.rotation=Le.clone(t??MGe),this.scale=h.clone(n??RGe)}Bde.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 Fb=Bde;var LX=new Fb;function vP(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(vP.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 NGe=new K;vP.prototype.getValue=function(e,t){return l(e)||(e=K.now(NGe)),l(t)||(t=new Fb),t.translation=X.getValueOrClonedDefault(this._translation,e,LX.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,LX.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,LX.scale,t.scale),t};vP.prototype.equals=function(e){return this===e||e instanceof vP&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var cC=vP;function q0(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(q0.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}}});q0.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function LGe(e){return new fi(e)}q0.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??LGe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};q0.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var FGe=new K;q0.prototype.getValue=function(e,t){l(e)||(e=K.now(FGe)),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};q0.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 BGe(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}q0.prototype.equals=function(e){return this===e||e instanceof q0&&BGe(this,e)};var pu=q0;function kde(e){return new cC(e)}function kGe(e){return new pu(e,kde)}function UGe(e){return new pu(e)}function zGe(e){return new pu(e)}function SP(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(SP.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,zGe),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,kGe),articulations:me("articulations",void 0,UGe),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});SP.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 SP(this)};SP.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,kde)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new pu(n)}};var V_=SP;function wP(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(wP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});wP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new wP(this)};wP.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var lC=wP;function IP(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(IP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:fo("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});IP.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 IP(this)};IP.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 j_=IP;function PP(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(PP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});PP.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 PP(this)};PP.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 W2=PP;function DP(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(DP.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")});DP.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 DP(this)};DP.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 uC=DP;function VGe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Hc=VGe;function jGe(e){return Array.isArray(e)&&(e=new Hc(e)),new fi(e)}function RP(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(RP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,jGe),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("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")});RP.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 RP(this)};RP.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=RP;function OP(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(OP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:fo("material"),depthFailMaterial:fo("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});OP.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 OP(this)};OP.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 Il=OP;function MP(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(MP.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:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});MP.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 MP(this)};MP.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 fC=MP;function NP(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(NP.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:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});NP.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 NP(this)};NP.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 tp=NP;function LP(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(LP.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:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});LP.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 LP(this)};LP.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 H_=LP;var HGe=new he,FX=[];function GGe(e){return new hu(e)}function WGe(e){return me(e,void 0,GGe)}function wa(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function rd(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=$n()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??B_.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",...FX],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 BX(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)&&BX(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(rd.prototype,{availability:mu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:mu("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&&BX(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:mu("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&&BX(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:wa("billboard",bl),box:wa("box",nC),corridor:wa("corridor",rC),cylinder:wa("cylinder",oC),description:me("description"),ellipse:wa("ellipse",sC),ellipsoid:wa("ellipsoid",aC),label:wa("label",Qm),model:wa("model",V_),tileset:wa("tileset",lC),orientation:me("orientation"),path:wa("path",j_),plane:wa("plane",W2),point:wa("point",uC),polygon:wa("polygon",ep),polyline:wa("polyline",Il),polylineVolume:wa("polylineVolume",fC),properties:wa("properties",pu),position:WGe("position"),rectangle:wa("rectangle",tp),viewFrom:me("viewFrom"),wall:wa("wall",H_)});rd.registerEntityType=function(e,t){Object.defineProperties(rd.prototype,{[e]:wa(e,t)}),FX.includes(e)||FX.push(e)};rd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};rd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,mu(e,!0))};rd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};rd.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 Ude=new $,zde=new h,Vde=new Le;rd.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,zde);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,Vde);return l(i)?t=M.fromRotationTranslation($.fromQuaternion(i,Ude),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};rd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,zde);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,HGe);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):ls(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,Vde);return l(c)?r=M.fromRotationTranslation($.fromQuaternion(c,Ude),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};rd.supportsMaterialsforEntitiesOnTerrain=function(e){return fu.supportsMaterials(e)};rd.supportsPolylinesOnTerrain=function(e){return Jm.isSupported(e)};var Qr=rd;var qGe=new Kt(z.WHITE),YGe=new fi(!0),XGe=new fi(!0),KGe=new fi(!1),$Ge=new fi(z.BLACK),JGe=new fi(Dn.DISABLED),ZGe=new fi(new Ht),QGe=new fi(Qn.BOTH);function Pl(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(Pl.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}}});Pl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Pl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Pl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Pl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Pl.prototype.isDestroyed=function(){return!1};Pl.prototype.destroy=function(){le(this)};Pl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(tt.MINIMUM_VALUE)};Pl.prototype._isOnTerrain=function(e,t){return!1};Pl.prototype._getIsClosed=function(e){return!0};Pl.prototype._isDynamic=pe.throwInstantiationError;Pl.prototype._setStaticOptions=pe.throwInstantiationError;Pl.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(tt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(tt.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??qGe,this._fillProperty=o??XGe,this._showProperty=u??YGe,this._showOutlineProperty=r.outline??KGe,this._outlineColorProperty=c?r.outlineColor??$Ge:void 0,this._shadowsProperty=r.shadows??JGe,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??ZGe,this._classificationTypeProperty=r.classificationType??QGe,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(tt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Pl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Oi=Pl;function dC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(dC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var e5e=new K;dC.prototype.getValue=function(e,t){return l(e)||(e=K.now(e5e)),this._callback(e,t)};dC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};dC.prototype.equals=function(e){return this===e||e instanceof dC&&this._callback===e._callback&&this._isConstant===e._isConstant};var np=dC;var jde=new h;function hC(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(tt.MINIMUM_VALUE,jde);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(hC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});hC.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 t5e=new K;hC.prototype.getValue=function(e,t){l(e)||(e=K.now(t5e));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!R_(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,jde);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)};hC.prototype.isDestroyed=function(){return!1};hC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var mC=hC;function n5e(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 np(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new mC(this._scene,s,o)}}var G_=n5e;var Hde=h.ZERO,Gde=new h,i5e=new h,Wde=new z;function r5e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function sf(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new r5e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(sf.prototype=Object.create(Oi.prototype),sf.prototype.constructor=sf);Object.defineProperties(sf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});sf.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=Kn.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,Wde)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Hde,Gde))),new Bt({id:t,geometry:kc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};sf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Wde),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Hde,Gde))),new Bt({id:t,geometry:Gm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};sf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};sf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Oi.prototype._isHidden.call(this,e,t)};sf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};sf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(tt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};sf.prototype._onEntityPropertyChanged=G_;sf.DynamicGeometryUpdater=pC;function pC(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(pC.prototype=Object.create(Ri.prototype),pC.prototype.constructor=pC);pC.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,i5e),r=this._options.dimensions;return!l(i)||!l(r)||Ri.prototype._isHidden.call(this,e,t,n)};pC.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 q2=sf;function Bb(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(Bb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var o5e=new K;Bb.prototype.getValue=function(e,t){return l(e)||(e=K.now(o5e)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Bb.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Bb.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Zm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Bb.prototype.equals=function(e){return this===e||e instanceof Bb&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var Y2=Bb;/*! @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 qde(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 s5e(e){if(Array.isArray(e))return e}function a5e(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 c5e(){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 l5e(e,t){return s5e(e)||a5e(e,t)||u5e(e,t)||c5e()}function u5e(e,t){if(e){if(typeof e=="string")return qde(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)?qde(e,t):void 0}}var ahe=Object.entries,Yde=Object.setPrototypeOf,f5e=Object.isFrozen,d5e=Object.getPrototypeOf,h5e=Object.getOwnPropertyDescriptor,Ia=Object.freeze,Ka=Object.seal,gC=Object.create,che=typeof Reflect<"u"&&Reflect,GX=che.apply,WX=che.construct;Ia||(Ia=function(t){return t});Ka||(Ka=function(t){return t});GX||(GX=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)});WX||(WX=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 Ub=aa(Array.prototype.forEach),m5e=aa(Array.prototype.lastIndexOf),Xde=aa(Array.prototype.pop),FP=aa(Array.prototype.push),p5e=aa(Array.prototype.splice),_C=Array.isArray,UP=aa(String.prototype.toLowerCase),kX=aa(String.prototype.toString),Kde=aa(String.prototype.match),BP=aa(String.prototype.replace),$de=aa(String.prototype.indexOf),g5e=aa(String.prototype.trim),_5e=aa(Number.prototype.toString),y5e=aa(Boolean.prototype.toString),Jde=typeof BigInt>"u"?null:aa(BigInt.prototype.toString),Zde=typeof Symbol>"u"?null:aa(Symbol.prototype.toString),gu=aa(Object.prototype.hasOwnProperty),kP=aa(Object.prototype.toString),Gc=aa(RegExp.prototype.test),kb=A5e(TypeError);function aa(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 GX(e,t,i)}}function A5e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return WX(e,n)}}function vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:UP;if(Yde&&Yde(e,null),!_C(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(f5e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function b5e(e){for(let t=0;t<e.length;t++)gu(e,t)||(e[t]=null);return e}function cf(e){let t=gC(null);for(let i of ahe(e)){var n=l5e(i,2);let r=n[0],o=n[1];gu(e,r)&&(_C(o)?t[r]=b5e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=cf(o):t[r]=o)}return t}function x5e(e){switch(typeof e){case"string":return e;case"number":return _5e(e);case"boolean":return y5e(e);case"bigint":return Jde?Jde(e):"0";case"symbol":return Zde?Zde(e):"Symbol()";case"undefined":return kP(e);case"function":case"object":{if(e===null)return kP(e);let t=e,n=xh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:kP(i)}return kP(e)}default:return kP(e)}}function xh(e,t){for(;e!==null;){let i=h5e(e,t);if(i){if(i.get)return aa(i.get);if(typeof i.value=="function")return aa(i.value)}e=d5e(e)}function n(){return null}return n}function T5e(e){try{return Gc(e,""),!0}catch{return!1}}var Qde=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"]),UX=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"]),zX=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"]),E5e=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"]),VX=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"]),C5e=Ia(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ehe=Ia(["#text"]),the=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"]),jX=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"]),nhe=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"]),X2=Ia(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),v5e=Ka(/{{[\w\W]*|^[\w\W]*}}/g),S5e=Ka(/<%[\w\W]*|^[\w\W]*%>/g),w5e=Ka(/\${[\w\W]*/g),I5e=Ka(/^data-[\-\w.\u00B7-\uFFFF]+$/),P5e=Ka(/^aria-[\-\w]+$/),ihe=Ka(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),D5e=Ka(/^(?:\w+script|data):/i),R5e=Ka(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),O5e=Ka(/^html$/i),M5e=Ka(/^[a-z][.\w]*(-[.\w]+)+$/i),rhe=Ka(/<[/\w!]/g),ohe=Ka(/<[/\w]/g),N5e=Ka(/<\/no(script|embed|frames)/i),L5e=Ka(/\/>/i),af={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lhe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],F5e=Ia(vr({},lhe)),B5e=(function(){let e={};return Ub(lhe,t=>{e[t]=Ka(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ia(e)})(),k5e=function(){return typeof window>"u"?null:window},U5e=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}},she=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},W_=function(t,n,i,r){return gu(t,n)&&_C(t[n])?vr(r.base?cf(r.base):{},t[n],r.transform):i},HX=function(t,n,i){let r=gu(t,n)?t[n]:void 0;return r&&typeof r=="object"?cf(r):i()};function uhe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k5e(),t=Et=>uhe(Et);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==af.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 kb('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||(_=U5e(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=she();t.isSupported=typeof ahe=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=v5e,Z=S5e,ae=w5e,Ae=I5e,fe=P5e,xe=D5e,ge=R5e,we=M5e,ve=ihe,Re=null,Qe=vr({},[...Qde,...UX,...zX,...VX,...ehe]),He=null,Ye=vr({},[...the,...jX,...nhe,...X2]),Ke=Object.seal(gC(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(gC(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,yi=!1,zi=!1,Si=!1,ui=!1,Ai=!0,zn=!1,tn="user-content-",Hn=!0,Ki=!1,wr={},so=null,Ts=vr({},["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=vr({},["audio","video","img","source","image","track"]),pi=null,ao=vr({},["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=vr({},[nr,jo,Fn],kX),qf=Ia(["mi","mo","mn","ms","mtext"]),Rm=vr({},qf),ch=Ia(["annotation-xml"]),na=vr({},ch),Om=vr({},["title","style","font","a","script"]),Es=null,Ha=["application/xhtml+xml","text/html"],ub="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=cf(ye),Es=Ha.indexOf(ye.PARSER_MEDIA_TYPE)===-1?ub:ye.PARSER_MEDIA_TYPE,ii=Es==="application/xhtml+xml"?kX:UP,Re=W_(ye,"ALLOWED_TAGS",Qe,{transform:ii}),He=W_(ye,"ALLOWED_ATTR",Ye,{transform:ii}),Ir=W_(ye,"ALLOWED_NAMESPACES",Mc,{transform:kX}),pi=W_(ye,"ADD_URI_SAFE_ATTR",ao,{transform:ii,base:ao}),zs=W_(ye,"ADD_DATA_URI_TAGS",$r,{transform:ii,base:$r}),so=W_(ye,"FORBID_CONTENTS",Ts,{transform:ii}),Pe=W_(ye,"FORBID_TAGS",cf({}),{transform:ii}),qe=W_(ye,"FORBID_ATTR",cf({}),{transform:ii}),wr=gu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?cf(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,yi=ye.FORCE_BODY||!1,Ai=ye.SANITIZE_DOM!==!1,zn=ye.SANITIZE_NAMED_PROPS||!1,Hn=ye.KEEP_CONTENT!==!1,Ki=ye.IN_PLACE||!1,ve=T5e(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:ihe,Vi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Fn,Rm=HX(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>vr({},qf)),na=HX(ye,"HTML_INTEGRATION_POINTS",()=>vr({},ch));let Fe=HX(ye,"CUSTOM_ELEMENT_HANDLING",()=>gC(null));if(Ke=gC(null),gu(Fe,"tagNameCheck")&&w0(Fe.tagNameCheck)&&(Ke.tagNameCheck=Fe.tagNameCheck),gu(Fe,"attributeNameCheck")&&w0(Fe.attributeNameCheck)&&(Ke.attributeNameCheck=Fe.attributeNameCheck),gu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),Ka(Ke),ft&&(jt=!1),Si&&(zi=!0),wr&&(Re=vr({},ehe),He=gC(null),wr.html===!0&&(vr(Re,Qde),vr(He,the)),wr.svg===!0&&(vr(Re,UX),vr(He,jX),vr(He,X2)),wr.svgFilters===!0&&(vr(Re,zX),vr(He,jX),vr(He,X2)),wr.mathMl===!0&&(vr(Re,VX),vr(He,nhe),vr(He,X2))),st.tagCheck=null,st.attributeCheck=null,gu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:_C(ye.ADD_TAGS)&&(Re===Qe&&(Re=cf(Re)),vr(Re,ye.ADD_TAGS,ii))),gu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:_C(ye.ADD_ATTR)&&(He===Ye&&(He=cf(He)),vr(He,ye.ADD_ATTR,ii))),gu(ye,"ADD_FORBID_CONTENTS")&&_C(ye.ADD_FORBID_CONTENTS)&&(so===Ts&&(so=cf(so)),vr(so,ye.ADD_FORBID_CONTENTS,ii)),Hn&&(Re["#text"]=!0),rt&&vr(Re,["html","head","body"]),Re.table&&(vr(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw kb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kb('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=vr({},[...UX,...zX,...E5e]),b_=vr({},[...VX,...C5e]),iq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="svg":Fe.namespaceURI===nr?ye==="svg"&&(gt==="annotation-xml"||Rm[gt]):!!Mm[ye]},rq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="math":Fe.namespaceURI===jo?ye==="math"&&na[gt]:!!b_[ye]},oq=function(ye,Fe,gt){return Fe.namespaceURI===jo&&!na[gt]||Fe.namespaceURI===nr&&!Rm[gt]?!1:!b_[ye]&&(Om[ye]||!Mm[ye])},sq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:Vi,tagName:"template"});let gt=UP(ye.tagName),on=UP(Fe.tagName);return Ir[ye.namespaceURI]?ye.namespaceURI===jo?iq(gt,Fe,on):ye.namespaceURI===nr?rq(gt,Fe,on):ye.namespaceURI===Fn?oq(gt,Fe,on):!!(Es==="application/xhtml+xml"&&Ir[ye.namespaceURI]):!1},Nm=function(ye){FP(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw kb("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},hE=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},fb=function(ye){db(ye);let Fe=A(ye);if(Fe){let on=[];Ub(Fe,wn=>{FP(on,wn)}),Ub(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"&&hE(ye,wn,ri)}},lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}FP(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{}},aq=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)]||hE(ye,on,wn)}},db=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===af.element&&aq(gt);let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},mE=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===af.processingInstruction||on===af.comment&&Gc(ohe,gt.data)){try{m(gt)}catch{}continue}if(on===af.element){let ri=gt,bo=ii(R(gt));try{ri.hasAttribute&&ri.hasAttribute("patchsrc")&&ri.removeAttribute("patchsrc"),ri.hasAttribute&&ri.hasAttribute("for")&&mE("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])}},hb=function(ye){let Fe=null,gt=null;if(yi)ye="<remove></remove>"+ye;else{let ri=Kde(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},NI=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)},pE=function(ye){return ye=BP(ye,J," "),ye=BP(ye,Z," "),ye=BP(ye,ae," "),ye},x_=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=pE(wn.data),wn=on.nextNode();let ri=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");ri&&Ub(ri,bo=>{ne(bo.content)&&x_(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)===af.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&&Ub(Et,gt=>{gt.call(t,ye,Fe,Wr)})}let Je=function(ye,Fe){return!!(Yt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&Gc(rhe,ye.textContent)&&Gc(rhe,ye.innerHTML)||Yt&&ye.namespaceURI===Fn&&F5e[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&Gc(B5e[Fe],ye.textContent))||ye.nodeType===af.processingInstruction||Yt&&ye.nodeType===af.comment&&Gc(ohe,ye.data))},Tt=function(ye,Fe){if(ye instanceof RegExp)return Gc(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?cf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Ki&&db(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)===af.element&&!sq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&Gc(N5e,ye.innerHTML))return Nm(ye),!0;if(ft&&ye.nodeType===af.text){let wn=pE(ye.textContent);ye.textContent!==wn&&(FP(t.removed,{element:ye.cloneNode()}),ye.textContent=wn)}return Ce(W.afterSanitizeElements,ye,null),!1},mn=function(ye,Fe,gt){if(qe[Fe]||mE(Fe,ye)||Ai&&(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&&Gc(Ae,Fe)||vt&&Gc(fe,Fe)?!0:on?pi[Fe]||Gc(ve,BP(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&$de(gt,"data:")===0&&zs[ye]||lt&&!Gc(xe,BP(gt,ge,""))?!0:!gt:co(ye)&&Tt(Ke.tagNameCheck,ye)&&Tt(Ke.attributeNameCheck,Fe,ye)||Fe==="is"&&Ke.allowCustomizedBuiltInElements&&Tt(Ke.tagNameCheck,gt)},Ao=vr({},["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[UP(ye)]&&Gc(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):Xde(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),cq=nu,Al=bo==="value"?cq:g5e(cq);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")&&$de(Al,tn)!==0&&(lh(bo,ye,ri),Al=tn+Al),Yt&&Gc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Al)){lh(bo,ye,ri);continue}if(iu==="attributename"&&Kde(Al,"href")){lh(bo,ye,ri);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){lh(bo,ye,ri);continue}if(!mt&&Gc(L5e,Al)){lh(bo,ye,ri);continue}if(ft&&(Al=pE(Al)),!mn(wn,iu,Al)){lh(bo,ye,ri);continue}Al=Vs(wn,iu,rs,Al),Al!==cq&&pc(ye,bo,rs,Al)}}Ce(W.afterSanitizeAttributes,ye,null)},tu=function(ye){let Fe=null,gt=NI(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)===af.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)===af.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=x5e(Et),typeof Et!="string"))throw kb("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=cf(Re)),W.uponSanitizeAttribute.length>0&&(He=cf(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 fb(Et),kb("root node is forbidden and cannot be sanitized in-place")}if(ce(Et))throw fb(Et),kb("root node is clobbered and cannot be sanitized in-place");try{I0(Et)}catch(iu){throw fb(Et),iu}}else if(Te(Et))Fe=hb("<!---->"),gt=Fe.ownerDocument.importNode(Et,!0),gt.nodeType===af.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=hb(Et),!Fe)return zi?null:ui?L:""}Fe&&yi&&Nm(Fe.firstChild);let bo=ri?Et:Fe;try{let nu=NI(bo);for(;on=nu.nextNode();)Gn(on,bo),yl(on),ne(on.content)&&tu(on.content)}catch(nu){throw ri&&(fb(Et),Ub(t.removed,iu=>{iu.element&&db(iu.element)})),nu}if(ri)return Ub(t.removed,nu=>{nu.element&&db(nu.element)}),ft&&x_(Et),Et;if(zi){if(ft&&x_(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&&Gc(O5e,Fe.ownerDocument.doctype.name)&&(rs="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> +`+rs),ft&&(rs=pE(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"&&gu(W,Et)&&FP(W[Et],ye)},t.removeHook=function(Et,ye){if(gu(W,Et)){if(ye!==void 0){let Fe=m5e(W[Et],ye);return Fe===-1?void 0:p5e(W[Et],Fe,1)[0]}return Xde(W[Et])}},t.removeHooks=function(Et){gu(W,Et)&&(W[Et]=[])},t.removeAllHooks=function(){W=she()},t}var fhe=uhe();var z5e=0,qX={},YX=class e{constructor(t,n){let i,r=t;l(qX[r])?i=qX[r]:(i=z5e++,qX[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=fhe.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=YX;function V5e(e,t){yt(e,t)}var Yr=V5e;function zb(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(zb.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}}});zb.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function XX(e){e._cubeMapBuffers=void 0}zb.prototype.update=function(e){let{context:t}=e;if(!zb.isSupported(t))return;if(l(this._texture)){XX(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(XX(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;of(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(us.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new Gt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new us({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};zb.prototype.isDestroyed=function(){return!1};zb.prototype.destroy=function(){return XX(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var ip=zb;function zP(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(zP.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 j5e(e,t){if(ip.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new ip(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}zP.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&&(j5e(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)};zP.prototype.isDestroyed=function(){return!1};zP.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var yC=zP;var $X=js(ef(),1);var KX,dhe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",K2={};K2.defaultAccessToken=dhe;K2.defaultServer=new De({url:"https://api.cesium.com/"});K2.getDefaultTokenCredit=function(e){if(e===dhe){if(!l(KX)){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>`;KX=new It(t,!0)}return KX}};var lf=K2;function Wc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:H5e};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 $X.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)&&(Wc.prototype=Object.create(De.prototype),Wc.prototype.constructor=Wc);Wc.fromAssetId=function(e,t){let n=Wc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Wc(i,n)})};Object.defineProperties(Wc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Wc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Wc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=lf.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};Wc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(Wc.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};Wc.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)};Wc.prototype._makeRequest=function(e){return this._isExternal||new $X.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=JX(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Wc._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??lf.defaultServer,i=t.accessToken??lf.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=JX(r.headers),n.getDerivedResource(r)};function JX(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}Wc._addClientHeaders=JX;function H5e(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 qo=Wc;function rp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(rp.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}}});rp.prototype.get=function(e){return this._array[e]};rp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};rp.prototype.peek=function(){return this._array[this._length-1]};rp.prototype.push=function(e){let t=this.length++;this._array[t]=e};rp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};rp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};rp.prototype.resize=function(e){this.length=e};rp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var _u=rp;function $2(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}$2.ALL=Object.freeze(new $2({color:new z(0,0,0,0),depth:1,stencil:0}));$2.prototype.execute=function(e,t){e.clear(this,t)};var hi=$2;var op={X:0,Y:1,Z:2};op.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));op.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));op.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));op.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));op.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));op.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));op.fromName=function(e){return op[e]};Object.freeze(op);var qi=op;function od(e){this.planes=e??[]}var VP=[new h,new h,new h];h.clone(h.UNIT_X,VP[0]);h.clone(h.UNIT_Y,VP[1]);h.clone(h.UNIT_Z,VP[2]);var q_=new h,G5e=new h,hhe=new sn(new h(1,0,0),0);function mhe(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}od.fromBoundingSphere=function(e,t){l(t)||(t=new od);let n=VP.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=VP[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,q_),h.add(r,q_,q_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,q_),h.multiplyByScalar(c,o,q_),h.add(r,q_,q_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,G5e),q_),s+=2}return t};od.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(mhe(t[i],hhe));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};od.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===od.MASK_OUTSIDE||t===od.MASK_INSIDE)return t;let n=od.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(mhe(i[r],hhe));if(a===$t.OUTSIDE)return od.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};od.MASK_OUTSIDE=4294967295;od.MASK_INSIDE=0;od.MASK_INDETERMINATE=2147483647;var ca=od;function sp(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 ca,this._orthographicMatrix=new M}function phe(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(sp.prototype,{projectionMatrix:{get:function(){return phe(this),this._orthographicMatrix}}});var W5e=new h,q5e=new h,Y5e=new h,ZX=new h;sp.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,W5e);h.normalize(f,f);let d=q5e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=Y5e;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,ZX),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,ZX),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,ZX),p),this._cullingVolume};sp.prototype.getPixelDimensions=function(e,t,n,i,r){phe(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};sp.prototype.clone=function(e){return l(e)||(e=new sp),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};sp.prototype.equals=function(e){return l(e)&&e instanceof sp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};sp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof sp&&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 ws=sp;function yu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new ws,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}yu.packedLength=4;yu.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};yu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new yu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Y_(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(yu.prototype,{projectionMatrix:{get:function(){return Y_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Y_(this),this._offCenterFrustum}}});yu.prototype.computeCullingVolume=function(e,t,n){return Y_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};yu.prototype.getPixelDimensions=function(e,t,n,i,r){return Y_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};yu.prototype.clone=function(e){return l(e)||(e=new yu),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};yu.prototype.equals=function(e){return!l(e)||!(e instanceof yu)?!1:(Y_(this),Y_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};yu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof yu)?!1:(Y_(this),Y_(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=yu;function ghe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(ghe.prototype,{metadata:{get:function(){return this._metadata}}});var AC=ghe;function X_(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),X_.decode(e)}X_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};X_.decodeWithFromCharCode=function(e){let t="",n=X5e(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 jP(e,t,n){return t<=e&&e<=n}function X5e(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(jP(u,0,127)){s.push(u);continue}if(jP(u,194,223)){i=1,t=u&31;continue}if(jP(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(jP(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!jP(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"?X_.decode=X_.decodeWithTextDecoder:X_.decode=X_.decodeWithFromCharCode;var uf=X_;function K5e(e,t){return t=t??0,uf(e,t,Math.min(4,e.length))}var ap=K5e;var QX=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+=HP;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=HP,o+=HP;let f=c.getUint32(o,!0);o+=HP;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=ap(a,o),b=c.getUint32(o+HP*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 le(this)}},HP=Uint32Array.BYTES_PER_ELEMENT,J2=QX;function $5e(e,t,n){return JSON.parse(uf(e,t,n))}var No=$5e;function qc(e){this._id=$n();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,zt.maximumTextureSize),o=Math.ceil(t/zt.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(qc.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}}});qc.DEFAULT_COLOR_VALUE=z.WHITE;qc.DEFAULT_SHOW_VALUE=!0;function _he(e){let t=e._textureDimensions;return t.x*t.y*4}function yhe(e){if(!l(e._batchValues)){let t=_he(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Ahe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}qc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Ahe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=yhe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};qc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};qc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var J5e=new Array(4);qc.prototype.setColor=function(e,t){if(z.equals(t,qc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(J5e),i=n[3],r=yhe(this),o=e*4,s=Ahe(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)}};qc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};qc.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(qc.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)};qc.prototype.getPickColor=function(e){return this._pickIds[e]};function bhe(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:Gt.NEAREST})}function Z5e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=_he(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=bhe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function Q5e(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}qc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Z5e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=bhe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),Q5e(this))};qc.prototype.isDestroyed=function(){return!1};qc.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 le(this)};var Au=qc;var e9e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},t9e={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:$i,MAT3:$,MAT4:M};function n9e(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=e9e[e.type],r=t9e[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Th=n9e;function Y0(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,i9e(this,e.extension,e.binaryBody)}Object.defineProperties(Y0.prototype,{byteLength:{get:function(){return this._byteLength}}});function i9e(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=Th(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=Th(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=Th(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=cp.getBinaryProperties(b,x,n);p+=r9e(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 r9e(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var o9e=[],s9e=[],a9e=0;function c9e(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=o9e;c.length=Math.max(c.length,a);let u=++a9e,f=s9e;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 l9e(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 GP(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return c9e(e,t,n)}else return n(e,t);return l9e(e,t,n)}Y0.prototype.hasProperty=function(e,t){let n=GP(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Y0.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};Y0.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,GP(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};Y0.prototype.getProperty=function(e,t){return GP(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)?u9e(a,s):Ze(a[s],!0)})};function u9e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Y0.prototype.setProperty=function(e,t,n){let i=GP(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)?f9e(u,c,n):u[c]=Ze(n,!0),!0});return l(i)};function f9e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Y0.prototype.isClass=function(e,t){let n=GP(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Y0.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var bC=Y0;var xhe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(xhe);var ff=xhe;function d9e(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 ti=d9e;var eK=Au.DEFAULT_COLOR_VALUE,tK=Au.DEFAULT_SHOW_VALUE;function jr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=h9e(n);this._properties=s,this._batchTableHierarchy=m9e(this,n,i);let a=Ehe(t,s,i);this._binaryPropertiesByteLength=p9e(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Au({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}jr._deprecationWarning=Yr;Object.defineProperties(jr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function h9e(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 m9e(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(jr._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 bC({extension:i,binaryBody:n})}function Ehe(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=Th(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 p9e(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}jr.getBinaryProperties=function(e,t,n){return Ehe(e,t,n)};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)};var g9e=new z;jr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(eK),this.setAllShow(tK);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,g9e)??eK:eK,s=l(e.show)?e.show.evaluate(r)??tK:tK;this.setColor(i,o),this.setShow(i,s)}};function _9e(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function y9e(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}jr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};jr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};jr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};jr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};jr.prototype.hasPropertyBySemantic=function(){return!1};jr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(ti(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);ti(t,i)}return t};jr.prototype.getPropertyBySemantic=function(e,t){};jr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return _9e(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}};jr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){y9e(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 A9e(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}jr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=Che(r,n,!1),s;return zt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${o} +${A9e(i)}${s}`}};function The(e,t){return e=Xe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function b9e(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 Che(e,t,n){if(!l(t))return The(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return The(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))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,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=b9e(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${o} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}jr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Che(i,t,!0),zt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};function x9e(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===ff.HIGHLIGHT)return 0;if(n===ff.REPLACE)return 1;if(n===ff.MIX)return P.clamp(i,P.EPSILON4,1)}jr.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 x9e(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var K_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jr.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=T9e(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=E9e(f),f.dirty=!1);let p=d.originalCommand;c!==K_.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=C9e(p))),c!==K_.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=v9e(p)),a&&(o||(l(d.zback)||(d.zback=w9e(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==P9e(d.stencil))&&(f.renderState.depthMask?d.stencil=I9e(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===K_.ALL_OPAQUE&&(n[u]=g),c===K_.ALL_TRANSLUCENT&&(n[u]=m),c===K_.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function T9e(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?K_.ALL_OPAQUE:t===e.featuresLength?K_.ALL_TRANSLUCENT:K_.OPAQUE_AND_TRANSLUCENT}function E9e(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 C9e(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=D9e(e.renderState),t}function v9e(e){let t=at.shallowClone(e);return t.renderState=R9e(e.renderState),t}function S9e(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 w9e(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=S9e(e,t.shaderProgram),n}function I9e(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=ei.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ei.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 P9e(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function D9e(e){let t=Ze(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=nn.ALPHA_BLEND,t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function R9e(e){let t=Ze(e,!0);return t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}jr.prototype.update=function(e,t){this._batchTexture.update(e,t)};jr.prototype.isDestroyed=function(){return!1};jr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var cp=jr;function O9e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var X0=O9e;var WP=`in vec3 position; +in float a_batchId; +uniform mat4 u_modifiedModelViewProjection; +void main() { -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; +gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -for (int i = 0; i < passCount; ++i) { -if (i < ix.index) { -continue; +`;var nK=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)}},la=nK;var iK=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)})}},rK=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)})}},bu=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)}}},M9e=new iK;Object.assign(bu,{hooks:M9e,plugins:new rK(bu),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"});bu.max_unop_len=bu.getMaxKeyLen(bu.unary_ops);bu.max_binop_len=bu.getMaxKeyLen(bu.binary_ops);var $_=e=>new bu(e).parse(),N9e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(bu).filter(e=>!N9e.includes(e)&&$_[e]===void 0).forEach(e=>{$_[e]=bu[e]});$_.Jsep=bu;var L9e="ConditionalExpression",F9e={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:L9e,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 :")}})}};$_.plugins.register(F9e);var vhe={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(vhe);var Nt=vhe;function Eh(e,t){this._expression=e,e=K9e(e,t),e=J9e($9e(e)),$_.addBinaryOp("=~",0),$_.addBinaryOp("!~",0);let n;try{n=$_(e)}catch(i){throw new oe(i)}this._runtimeAst=Yi(this,n)}Object.defineProperties(Eh.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++]}};Eh.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};Eh.prototype.evaluateColor=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Eh.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} +{ + return ${r}; } -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 V2=`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 j2=`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 NP=`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 H2=`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 G2=`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 W2=`#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)); -} -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); -} -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 = u_ellipsoidRadii.x * inversesqrt(1.0 - x2); -return primeVerticalRadius * u_eccentricitySquared * sinLatitude; -} -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; -} -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; -} -} -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); -} -float tmin = intersect.x; -float tmax = intersect.y; -vec3 p0 = ray.pos + tmin * ray.dir; -vec3 p1 = ray.pos + tmax * ray.dir; -vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); -vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); -bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); -bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); -if (p0InShadowCone && p1InShadowCone) { -return RayShapeIntersection(miss, miss); -} else if (p0InShadowCone) { -return RayShapeIntersection(intersect1, farSide); -} else if (p1InShadowCone) { -return RayShapeIntersection(-1.0 * farSide, intersect0); -} else { -return RayShapeIntersection(intersect0, intersect1); -} -} -void intersectShape(in Ray ray, 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 -#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 sC=`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; -} -} -#else -intersection.entry.w = max(intersection.entry.w, 0.0); -#endif -return intersection; -} -`;var q2=`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); -} -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 Y2=`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); -} -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); -} -#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 X2=`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; -} -return vec3(v * sign(pos), length(v - evolute)); -} -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); -} -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); -} -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 K2=`#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 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); -} -int normU8x2_toInt(in vec2 value) { -return int(value.x * 255.0) + 256 * int(value.y * 255.0); -} -float normU8x2_toFloat(in vec2 value) { -return float(normU8x2_toInt(value)) / 65535.0; -} -OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { -vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); -OctreeNodeData data; -data.data = normU8x2_toInt(texData.xy); -data.flag = normU8x2_toInt(texData.zw); -return data; -} -OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { -int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; -int octreeCoordX = (parentOctreeIndex % u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; -int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; -vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); -return getOctreeNodeData(octreeUv); -} -int getOctreeParentIndex(in int octreeIndex) { -int octreeCoordX = (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 -#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); -} -#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; -} -traversalData.parentOctreeIndex = childData.data; -} -return childData; -} -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 -getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); -addSampleCoordinates(tileAndUv, sampleDatas[0]); -addSampleCoordinates(tileAndUv, sampleDatas[1]); -#endif -} -bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { -int levelDifference = tileCoordinate.w - octreeCoords.w; -if (levelDifference < 0) { -return false; -} -ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; -return coordinateAtLevel == octreeCoords.xyz; -} -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]); -} -return; -} -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); -} -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 -} -`;var $2=`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); -} -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 Fde={Z_UP:0,Y_UP:1};Object.freeze(Fde);var $0=Fde;function ZHe(e){let t=new X_;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([U2]),e.provider.metadataOrder===$0.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",K2,B2,$2,z2,j2,V2]),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([q2,H2,sC]):u==="CYLINDER"?t.addFragmentLines([Y2,NP,G2,sC]):u==="ELLIPSOID"&&t.addFragmentLines([X2,NP,W2,sC]),t.addFragmentLines([k2]);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 J2=ZHe;var Bde=new U;function QHe(e,t){let n=new J2(e);N2(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,Bde),S=kde(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=Y_.getTextureResolution(s,t,Bde),S=kde(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:ji.BACK},depthTest:{enabled:!1},depthMask:!1,blending:nn.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 kde(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 Z2=QHe;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}}}}),LP=function(){return performance.now()},eGe=(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=LP()),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})(),aC={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=aC.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=aC.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=aC.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=aC.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}}},Ude=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),oK=new eGe,zde=(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=aC.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Ude.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=oK,oK.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=LP()),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=LP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=LP()),!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=aC.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=LP()),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 rpn=Ude.nextId,Qm=oK,opn=Qm.getAll.bind(Qm),spn=Qm.removeAll.bind(Qm),apn=Qm.add.bind(Qm),cpn=Qm.remove.bind(Qm),lpn=Qm.update.bind(Qm);var tGe={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},Ps=Object.freeze(tGe);function nGe(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 iGe(e,t){return e*t*(4+e*(4-3*t))/16}function Vde(e,t,n,i,r,o,s){let a=iGe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function rGe(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+Vde(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 oGe=new h,sK=new h;function jde(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,sK),oGe),o=h.normalize(i.cartographicToCartesian(n,sK),sK);rGe(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,nGe(e)}function FP(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)&&jde(this,e,t,i)}Object.defineProperties(FP.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}}});FP.prototype.setEndPoints=function(e,t){jde(this,e,t,this._ellipsoid)};FP.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};FP.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)-Vde(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 K_=FP;var aK;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?aK=function(){return performance.now()}:aK=function(){return Date.now()};var xn=aK;function cK(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}cK.clone=function(e,t){if(l(e))return l(t)||(t=new cK),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Eh=cK;var lK={};lK.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Hde(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}lK.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=Hde(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*Hde(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var mu=lK;var fK={};fK.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 uK(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]}fK.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return mu.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=mu.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return uK(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):uK(e,t,0,i);if(i===0)return r=mu.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 uK(e,t,n,i)};var cC=fK;var dK={};dK.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 Ch(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=cC.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=mu.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=mu.computeRealRoots(1,d,p),y=mu.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 BP(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=cC.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=mu.computeRealRoots(1,S,R),_=mu.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[]}dK.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return cC.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 Ch(o,s,a,c);case 1:return BP(o,s,a,c);case 2:return BP(o,s,a,c);case 3:return Ch(o,s,a,c);case 4:return Ch(o,s,a,c);case 5:return BP(o,s,a,c);case 6:return Ch(o,s,a,c);case 7:return Ch(o,s,a,c);case 8:return BP(o,s,a,c);case 9:return Ch(o,s,a,c);case 10:return Ch(o,s,a,c);case 11:return BP(o,s,a,c);case 12:return Ch(o,s,a,c);case 13:return Ch(o,s,a,c);case 14:return Ch(o,s,a,c);case 15:return Ch(o,s,a,c);default:return}};var Q2=dK;var hK=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=hK;var eo={};eo.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 sGe=new h,aGe=new h,Jde=new h,Gde=new h,Wde=new h;eo.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,sGe),c=h.subtract(i,t,aGe),u=h.cross(s,c,Jde),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<P.EPSILON6||(d=h.subtract(o,t,Gde),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,Wde),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,Gde),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,Wde),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};eo.rayTriangle=function(e,t,n,i,r,o){let s=eo.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 cGe=new gn;eo.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=cGe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=eo.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 lGe(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 uGe={root0:0,root1:0};function Zde(e,t,n){l(n)||(n=new Ws);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,Jde),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=lGe(c,u,f,uGe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}eo.raySphere=function(e,t,n){if(n=Zde(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var fGe=new gn;eo.lineSegmentSphere=function(e,t,n,i){let r=fGe;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=Zde(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 dGe=new h,hGe=new h;eo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,dGe),r=h.multiplyComponents(n,e.direction,hGe),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 Ws(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Ws(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 Ws(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Ws(0,-s/c)};var mGe=new Ws,pGe=new Ws,gGe=new Ws;eo.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Ws);let i=mK(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,mGe),r=mK(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,pGe),o=mK(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,gGe);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 mK(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 Fb(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}eo.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*Fb(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*Fb(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),d=r*(i*Fb(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=mu.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=Q2.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=Fb(a*L+u,c*O,P.EPSILON12):P.sign(u)===P.sign(c*O)?w=Fb(a*L,c*O+u,P.EPSILON12):w=Fb(a*L+c*O,u,P.EPSILON12);let D=Fb(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 pK=new h,qde=new h,Yde=new h,ek=new h,_Ge=new h,yGe=new $,AGe=new $,bGe=new $,xGe=new $,TGe=new $,Xde=new $,Kde=new $,$de=new h,EGe=new h,CGe=new he;eo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,pK);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,pK),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,ek),c=h.normalize(h.cross(a,s,qde),qde),u=h.normalize(h.cross(s,c,Yde),Yde),f=yGe;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,AGe),p=$.fromScale(t.radii,bGe),g=$.fromScale(t.oneOverRadii,xGe),m=TGe;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,Xde),m,Xde),A=$.multiply($.multiply(y,p,Kde),f,Kde),b=$.multiplyByVector(y,n,_Ge),x=eo.quadraticVectorExpression(A,h.negate(b,pK),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,EGe),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],$de),$de);let L=h.normalize(h.subtract(T,n,ek),ek),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,CGe);return I=P.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,ek))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var vGe=new h;eo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,vGe),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};eo.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 eo.lineSegmentPlane(e,t,i,f),eo.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return eo.lineSegmentPlane(t,n,i,f),eo.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return eo.lineSegmentPlane(n,e,i,f),eo.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 eo.lineSegmentPlane(e,n,i,f),eo.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return eo.lineSegmentPlane(n,t,i,f),eo.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return eo.lineSegmentPlane(t,e,i,f),eo.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var Ti=eo;function ep(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 ca,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function gK(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(ep.prototype,{projectionMatrix:{get:function(){return gK(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return gK(this),this._infinitePerspective}}});var SGe=new h,wGe=new h,IGe=new h,PGe=new h;ep.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,SGe),d=wGe;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=IGe;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=PGe;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};ep.prototype.getPixelDimensions=function(e,t,n,i,r){gK(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};ep.prototype.clone=function(e){return l(e)||(e=new ep),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};ep.prototype.equals=function(e){return l(e)&&e instanceof ep&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};ep.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof ep&&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 pu=ep;function gu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new pu,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 vh(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 vh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return vh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return vh(this),this._fovy}},sseDenominator:{get:function(){return vh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return vh(this),this._offCenterFrustum}}});gu.prototype.computeCullingVolume=function(e,t,n){return vh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};gu.prototype.getPixelDimensions=function(e,t,n,i,r){return vh(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:(vh(this),vh(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:(vh(this),vh(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=gu;var nhe={};function DGe(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 pu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var RGe=new h,Qde=new h;function ihe(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 yK(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,RGe),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),Qde)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),Qde));o=Math.min(DGe(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 kP(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 rhe=new h;function OGe(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,rhe),f=c.pitch,d=kP(c.heading,i),p=kP(c.roll,o),g=yK(c,n,u.z,n.z,s),m=ihe(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 MGe(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function NGe(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 LGe=new he,FGe=new he;function BGe(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,LGe),m=f.pitch,y=kP(f.heading,i),A=kP(f.roll,o),b=p.cartesianToCartographic(n,FGe);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?MGe(g,b):NGe(g,b);let T=yK(f,n,g.height,b.height,s),E=ihe(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 kGe(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,rhe),u=kP(a.heading,i),f=a.frustum.right-a.frustum.left,d=yK(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 ehe=new he,UGe=new h;function _K(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function the(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}nhe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return _K();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,ehe),n=o.project(ehe,UGe));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=the(x,t.complete),E=the(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 _K(T,E);let I=new Array(4);if(I[re.SCENE2D]=kGe,I[re.SCENE3D]=BGe,I[re.COLUMBUS_VIEW]=OGe,m<=0)return _K(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=Ps.CUBIC_OUT:d=Ps.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var tk=nhe;var ohe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(ohe);var _u=ohe;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,ghe(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,Ihe(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 Eh(0,-P.PI_OVER_FOUR,0);function ghe(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 zGe(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(zGe(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 VGe(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var jGe=new he,HGe=new h,nk=new h,GGe=new se,WGe=new se,qGe=new se,YGe=new se,XGe=new se;function KGe(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,GGe),r=n.cartesianToCartographic(i,jGe),o=t.project(r,HGe),s=WGe;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,XGe),c=se.add(M.getColumn(e._transform,0,nk),i,nk);n.cartesianToCartographic(c,r),t.project(r,o);let u=qGe;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=YGe;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=se.add(M.getColumn(e._transform,1,nk),i,nk);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 AK=new h;function Zc(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?VGe(e):KGe(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=AK;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,AK));if(Math.abs(1-m)>P.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,AK);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)&&ghe(e)}function _he(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 yhe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function Ahe(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 ok=new M,sk=new M;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Zc(this),this._invTransform}},viewMatrix:{get:function(){return Zc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Zc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Zc(this),this._positionCartographic}},positionWC:{get:function(){return Zc(this),this._positionWC}},directionWC:{get:function(){return Zc(this),this._directionWC}},upWC:{get:function(){return Zc(this),this._upWC}},rightWC:{get:function(){return Zc(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,ok),n=At.eastNorthUpToFixedFrame(this.positionWC,e,sk);this._setTransform(n);let i=_he(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,ok),n=At.eastNorthUpToFixedFrame(this.positionWC,e,sk);this._setTransform(n);let i=yhe(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,ok),n=At.eastNorthUpToFixedFrame(this.positionWC,e,sk);this._setTransform(n);let i=Ahe(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&&Ehe(this,this.position)};var $Ge=new h,JGe=new h,ZGe=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,$Ge),n=h.clone(this.upWC,JGe),i=h.clone(this.directionWC,ZGe);M.clone(e,this._transform),this._transformChanged=!0,Zc(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),Zc(this)};var QGe=new U,e5e=new gn,t5e=new h,n5e=new h;function bhe(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=QGe;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,e5e);r=n.pickWorldCoordinates(a,t,!0,t5e)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,n5e));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 pn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=bhe(this)))};var ak=new h,CK=new M,i5e=new M,vK=new Le,SK=new $,xhe=new he;function r5e(e,t,n){let i=M.clone(e.transform,CK),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,i5e);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,vK),s=$.fromQuaternion(o,SK);$.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 o5e(e,t,n,i){let r=M.clone(e.transform,CK);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,xhe);t=a.project(c,ak)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,vK),s=$.fromQuaternion(o,SK);$.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 s5e(e,t,n,i){let r=M.clone(e.transform,CK);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,xhe);t=c.project(u,ak)}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===_u.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,vK),s=$.fromQuaternion(o,SK);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var a5e=new h,c5e=new h,l5e=new h;function The(e,t,n,i){let r=h.clone(n.direction,a5e),o=h.clone(n.up,c5e);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,ok),u=M.inverseTransformation(c,sk);M.multiplyByPointAsVector(u,r,r),M.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,l5e);return i.heading=_he(r,o),i.pitch=yhe(r),i.roll=Ahe(r,o,s),i}var EK={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},lC=new Uc;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,ak);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,ak),i=!1),l(t.direction)&&(t=The(this,r,t,EK.orientation)),lC.heading=t.heading??0,lC.pitch=t.pitch??-P.PI_OVER_TWO,lC.roll=t.roll??0,n===re.SCENE3D?r5e(this,r,lC):n===re.SCENE2D?s5e(this,r,lC,i):o5e(this,r,lC,i)};var u5e=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,u5e).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Zc(this),M.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Zc(this),M.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Zc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function Ehe(e,t){let n=e._scene.mapMode2D===_u.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 she=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,she),h.add(n,she,n),this._mode===re.SCENE2D&&Ehe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?ck(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?ck(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 f5e=new Le,d5e=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,f5e),r=$.fromQuaternion(i,d5e),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 h5e=new Le,m5e=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,h5e),r=$.fromQuaternion(i,m5e);$.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,Che(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,Che(this,-e)};var p5e=new h,g5e=new h,_5e=new h,ahe=new h;function Che(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,p5e),r=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,ahe),P.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,g5e),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,ahe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,_5e);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,vhe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,vhe(this,e)};function vhe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function ck(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===_u.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===_u.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 She(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?ck(this,e):She(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?ck(this,-e):She(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 y5e=new M;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,y5e);this.lookAtTransform(r,t)};var A5e=new h,b5e=new Le,x5e=new Le,T5e=new $;function whe(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,b5e),o=Le.fromAxisAngle(h.UNIT_Z,-e,x5e),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,T5e),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=whe(t.heading,t.pitch,t.range,A5e):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 E5e=new M,che=new h,C5e=new h,lhe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=M.clone(this._transform,E5e);this._setTransform(M.IDENTITY);let i=h.subtract(e,this.positionWC,che);h.magnitudeSquared(i)<P.EPSILON8&&(i=h.clone(this.directionWC,che)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,C5e),o=h.cross(i,r,lhe);h.magnitudeSquared(o)<P.EPSILON8&&(o=h.clone(this.rightWC,lhe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var UP=new he,v5e=new he,S5e=new h,w5e=new h,I5e=new h,P5e=new h,D5e=new h,R5e=new h,O5e=new h,bK=new h,M5e={direction:new h,right:new h,up:new h},uhe;function Jc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function Ihe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:M5e,{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=UP;O.longitude=f,O.latitude=s,O.height=0;let L=v5e;L.longitude=f,L.latitude=a,L.height=0;let _=uhe;(!l(_)||_.ellipsoid!==r)&&(uhe=_=new K_(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,UP).latitude}let p=UP;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,O5e),m=UP;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,S5e);m.longitude=c;let A=r.cartographicToCartesian(m,I5e);m.longitude=f;let b=r.cartographicToCartesian(m,D5e);m.latitude=a;let x=r.cartographicToCartesian(m,R5e);m.longitude=u;let T=r.cartographicToCartesian(m,P5e);m.longitude=c;let E=r.cartographicToCartesian(m,w5e);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 pn){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(Jc(v,I,A,O),Jc(v,I,T,O),Jc(v,I,y,O),Jc(v,I,E,O),Jc(v,I,b,O),Jc(v,I,x,O),Jc(v,S,A,L),Jc(v,S,T,L),Jc(v,S,y,L),Jc(v,S,E,L),Jc(v,S,b,L),Jc(v,S,x,L)),a<0&&s>0){let _=UP;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,bK);h.subtract(C,g,C),R=Math.max(R,Jc(v,I,C,O),Jc(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,bK),h.subtract(C,g,C),R=Math.max(R,Jc(v,I,C,O),Jc(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,bK),n)}var N5e=new he,L5e=new h,F5e=new h;function B5e(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=N5e;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,L5e);M.multiplyByPoint(r,a,a),M.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,F5e);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 k5e=new he,U5e=new h,z5e=new h;function V5e(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===_u.INFINITE_SCROLL?r+=P.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=k5e;o.longitude=r,o.latitude=t.north;let s=i.project(o,U5e);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,z5e),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 Ihe(this,e,t);if(n===re.COLUMBUS_VIEW)return B5e(this,e,t);if(n===re.SCENE2D)return V5e(this,e,t)};var j5e=new gn;function H5e(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,j5e),o=Ti.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return gn.getPoint(r,s,i)}var G5e=new gn;function W5e(e,t,n,i){let o=e.getPickRay(t,G5e).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 q5e=new gn;function Y5e(e,t,n,i){let r=e.getPickRay(t,q5e),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=H5e(this,e,t,n);else if(this._mode===re.SCENE2D)n=W5e(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=Y5e(this,e,this._projection,n);else return;return n}};var X5e=new h,K5e=new h,$5e=new h;function J5e(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,X5e);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,K5e),m=h.multiplyByScalar(e.upWC,f*c*s,$5e),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var ik=new h;function Z5e(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,ik),h.add(ik,f,f),h.multiplyByScalar(e.upWC,u,ik),h.add(ik,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===_u.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)?J5e(this,e,t):Z5e(this,e,t)};var Q5e=new h,e9e=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,Q5e),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),e9e);return Math.max(0,h.magnitude(n)-e.radius)};var t9e=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,t9e);return Math.max(r.x,r.y)};function n9e(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:Ps.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var i9e=new h,fhe=new h,r9e=new h,o9e=new h;function s9e(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,i9e),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,fhe),fhe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,r9e);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,o9e)),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 n9e(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return s9e(this,e)};var a9e=new h,Da={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=Da.destination,e.orientation.heading=Da.heading,e.orientation.pitch=Da.pitch,e.orientation.roll=Da.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,a9e));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=The(this,t,r,EK.orientation)),l(e.duration)&&e.duration<=0){let f=EK;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;Da.destination=t,Da.heading=r.heading,Da.pitch=r.pitch,Da.roll=r.roll,Da.duration=e.duration,Da.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Da.cancel=e.cancel,Da.endTransform=e.endTransform,Da.convert=i?!1:e.convert,Da.maximumHeight=e.maximumHeight,Da.pitchAdjustHeight=e.pitchAdjustHeight,Da.flyOverLongitude=e.flyOverLongitude,Da.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Da.easingFunction=e.easingFunction;let a=this._scene,c=tk.createTween(a,Da);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 c9e(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function l9e(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 u9e=100;function Phe(e,t,n){n=Eh.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=u9e:e.frustum instanceof pn||e._mode===re.SCENE2D?n.range=l9e(e,s):n.range=c9e(e,s),n.range=P.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=Phe(this,e,t),this.lookAt(e.center,t)};var f9e=new M,dhe=new h,d9e=new h,h9e=new h,m9e=new h,p9e=new se,g9e=new Le,_9e=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=Phe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,dhe):r=whe(i.heading,i.pitch,i.range,dhe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,f9e);M.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,d9e),h.normalize(c,c),u=M.multiplyByPointAsVector(a,h.UNIT_Z,h9e),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,g9e),p=$.fromQuaternion(d,_9e);h.fromCartesian4(M.getColumn(a,1,p9e),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,m9e);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 hhe=new h,mhe=new h,xK=new h,phe=new h,zP=[new h,new h,new h,new h];function y9e(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,hhe),o=h.magnitude(r),s=h.normalize(r,mhe),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,xK),xK),c=h.normalize(h.cross(s,a,phe),phe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,hhe),d=u/o,p=h.multiplyByScalar(a,d,mhe),g=h.multiplyByScalar(c,d,xK),m=h.add(f,g,zP[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,zP[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,zP[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,zP[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),zP}var TK=new U,A9e=new h,$_=[new he,new he,new he,new he];function rk(e,t,n,i,r,o){TK.x=e,TK.y=t;let s=i.pickEllipsoid(TK,r,A9e);return l(s)?($_[n]=r.cartesianToCartographic(s,$_[n]),1):($_[n]=r.cartesianToCartographic(o[n],$_[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 ue(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=y9e(this,e);if(c+=rk(0,0,0,this,e,u),c+=rk(0,a,1,this,e,u),c+=rk(s,a,2,this,e,u),c+=rk(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray($_,t);let f=0,d=$_[3].longitude;for(let p=0;p<4;++p){let g=$_[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,$_[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 pn)return;let e=bhe(this),t=this._scene;this.frustum=new pn,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 Or=an;var Dhe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(Dhe);var to=Dhe;var wK=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=wK;var Rhe={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(Rhe);var un=Rhe;function J_(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 MK(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function Bb(e){let t=[];if(e.shiftKey&&t.push(to.SHIFT),e.ctrlKey&&t.push(to.CTRL),e.altKey&&t.push(to.ALT),t.length)return t}var ds={LEFT:0,MIDDLE:1,RIGHT:2};function df(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 b9e(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(df(e,"pointerdown",t,S9e),df(e,"pointerup",t,Vhe),df(e,"pointermove",t,w9e),df(e,"pointercancel",t,Vhe)):(df(e,"mousedown",t,jhe),df(e,"mouseup",n,Hhe),df(e,"mousemove",n,Ghe),df(e,"touchstart",t,C9e),df(e,"touchend",n,Fhe),df(e,"touchmove",n,v9e),df(e,"touchcancel",n,Fhe)),df(e,"dblclick",t,T9e);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",df(e,i,t,E9e)}function x9e(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Ohe={position:new U};function NK(e){e._lastSeenTouchEvent=xn()}function LK(e){return xn()-e._lastSeenTouchEvent>Sh.mouseEmulationIgnoreMilliseconds}function OK(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function jhe(e,t){if(!LK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===ds.LEFT)i=un.LEFT_DOWN;else if(n===ds.MIDDLE)i=un.MIDDLE_DOWN;else if(n===ds.RIGHT)i=un.RIGHT_DOWN;else return;let r=J_(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=Bb(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,Ohe.position),s(Ohe),t.preventDefault())}var Mhe={position:new U},Nhe={position:new U};function IK(e,t,n,i){let r=Bb(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=J_(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,Mhe.position),o(Mhe)),l(s)){let c=e._primaryStartPosition;OK(c,a,e._clickPixelTolerance)&&(U.clone(a,Nhe.position),s(Nhe))}}}function Hhe(e,t){if(!LK(e))return;let n=t.button;n!==ds.LEFT&&n!==ds.MIDDLE&&n!==ds.RIGHT||(e._buttonDown[ds.LEFT]&&(IK(e,un.LEFT_UP,un.LEFT_CLICK,t),e._buttonDown[ds.LEFT]=!1),e._buttonDown[ds.MIDDLE]&&(IK(e,un.MIDDLE_UP,un.MIDDLE_CLICK,t),e._buttonDown[ds.MIDDLE]=!1),e._buttonDown[ds.RIGHT]&&(IK(e,un.RIGHT_UP,un.RIGHT_CLICK,t),e._buttonDown[ds.RIGHT]=!1))}var PK={startPosition:new U,endPosition:new U};function Ghe(e,t){if(!LK(e))return;let n=Bb(t),i=J_(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(un.MOUSE_MOVE,n);l(o)&&(U.clone(r,PK.startPosition),U.clone(i,PK.endPosition),o(PK)),U.clone(i,r),(e._buttonDown[ds.LEFT]||e._buttonDown[ds.MIDDLE]||e._buttonDown[ds.RIGHT])&&t.preventDefault()}var Lhe={position:new U};function T9e(e,t){let n=t.button,i;if(n===ds.LEFT)i=un.LEFT_DOUBLE_CLICK;else return;let r=Bb(t),o=e.getInputAction(i,r);l(o)&&(J_(e,t,Lhe.position),o(Lhe))}function E9e(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=Bb(t),r=e.getInputAction(un.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function C9e(e,t){NK(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,J_(e,o,new U));lk(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 Fhe(e,t){NK(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);lk(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var Bhe={position:new U},DK={position1:new U,position2:new U},khe={position:new U},Uhe={position:new U},zhe={position:new U};function lk(e,t){let n=Bb(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(un.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,khe.position),o(khe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(un.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];OK(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,Uhe.position),s(Uhe))}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[ds.LEFT]=!0,o=e.getInputAction(un.LEFT_DOWN,n),l(o)&&(U.clone(c,Bhe.position),o(Bhe)),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];OK(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,zhe.position),s(zhe))}},Sh.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(un.PINCH_START,n),l(o)&&(U.clone(i.values[0],DK.position1),U.clone(i.values[1],DK.position2),o(DK),t.preventDefault()))}function v9e(e,t){NK(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)&&J_(e,o,u)}Whe(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 RK={startPosition:new U,endPosition:new U},VP={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function Whe(e,t){let n=Bb(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(un.MOUSE_MOVE,n),l(s)&&(U.clone(c,RK.startPosition),U.clone(a,RK.endPosition),s(RK)),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,VP.distance.startPosition),U.fromElements(0,g,VP.distance.endPosition),U.fromElements(E,x,VP.angleAndHeight.startPosition),U.fromElements(T,b,VP.angleAndHeight.endPosition),s(VP)}}function S9e(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,J_(e,t,new U)),lk(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else jhe(e,t)}function Vhe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),lk(e,t),e._previousPositions.remove(i)}else Hhe(e,t)}function w9e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;J_(e,t,r),Whe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else Ghe(e,t)}function Sh(e){this._inputEvents={},this._buttonDown={[ds.LEFT]:!1,[ds.MIDDLE]:!1,[ds.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Sh.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,b9e(this)}Sh.prototype.setInputAction=function(e,t,n){let i=MK(t,n);this._inputEvents[i]=e};Sh.prototype.getInputAction=function(e,t){let n=MK(e,t);return this._inputEvents[n]};Sh.prototype.removeInputAction=function(e,t){let n=MK(e,t);delete this._inputEvents[n]};Sh.prototype.isDestroyed=function(){return!1};Sh.prototype.destroy=function(){return x9e(this),le(this)};Sh.mouseEmulationIgnoreMilliseconds=800;Sh.touchHoldDelayMilliseconds=1500;var ma=Sh;var qhe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(qhe);var or=qhe;var Jhe=[to.SHIFT,to.CTRL,to.ALT,[to.SHIFT,to.CTRL],[to.SHIFT,to.ALT],[to.CTRL,to.ALT],[to.SHIFT,to.CTRL,to.ALT]];function Ra(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function I9e(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 Yhe(e,t,n){let i=Ra(or.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]?(I9e(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 Xhe(e,t){let n=Ra(or.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},un.WHEEL,t)}function uC(e,t,n){let i=Ra(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===or.LEFT_DRAG?(c=un.LEFT_DOWN,u=un.LEFT_UP):n===or.RIGHT_DRAG?(c=un.RIGHT_DOWN,u=un.RIGHT_UP):n===or.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(){FK(Ra(n,void 0),e);for(let f of Jhe){let d=Ra(n,f);FK(d,e)}},u,t)}function FK(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 Khe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function P9e(e,t,n){let i=n._isDown,r=!1,o=Ra(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,FK(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 $he(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in or)if(or.hasOwnProperty(s)){let a=or[s];if(l(a)){let c=Ra(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 or)if(or.hasOwnProperty(a)){let c=or[a];if(l(c)){let u=Ra(c,t);P9e(c,t,e),o[u]&&(n[u]?(Khe(i[u],r[u]),r[u].valid=!0,Khe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},un.MOUSE_MOVE,t)}function ld(e){this._eventHandler=new ma(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,Xhe(this,void 0),Yhe(this,void 0,e),uC(this,void 0,or.LEFT_DRAG),uC(this,void 0,or.RIGHT_DRAG),uC(this,void 0,or.MIDDLE_DRAG),$he(this,void 0);for(let t of Jhe)Xhe(this,t),Yhe(this,t,e),uC(this,t,or.LEFT_DRAG),uC(this,t,or.RIGHT_DRAG),uC(this,t,or.MIDDLE_DRAG),$he(this,t)}Object.defineProperties(ld.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Ra(or.WHEEL)]||!this._update[Ra(or.WHEEL,to.SHIFT)]||!this._update[Ra(or.WHEEL,to.CTRL)]||!this._update[Ra(or.WHEEL,to.ALT)];return this._buttonsDown>0||e}}});ld.prototype.isMoving=function(e,t){let n=Ra(e,t);return!this._update[n]};ld.prototype.getMovement=function(e,t){let n=Ra(e,t);return this._movement[n]};ld.prototype.getLastMovement=function(e,t){let n=Ra(e,t),i=this._lastMovement[n];if(i.valid)return i};ld.prototype.isButtonDown=function(e,t){let n=Ra(e,t);return this._isDown[n]};ld.prototype.getStartMousePosition=function(e,t){if(e===or.WHEEL)return this._currentMousePosition;let n=Ra(e,t);return this._eventStartPosition[n]};ld.prototype.getButtonPressTime=function(e,t){let n=Ra(e,t);return this._pressTime[n]};ld.prototype.getButtonReleaseTime=function(e,t){let n=Ra(e,t);return this._releaseTime[n]};ld.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};ld.prototype.isDestroyed=function(){return!1};ld.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var uk=ld;function Zhe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Zhe.prototype,{metadata:{get:function(){return this._metadata}}});var fC=Zhe;function dC(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(dC.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});dC.fromColor=function(e){return new dC(e.red,e.green,e.blue,e.alpha)};dC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};dC.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=dC;function Ja(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}Ja.fromCorners=function(e,t,n){return l(n)||(n=new Ja),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Ja.fromPoints=function(e,t){if(l(t)||(t=new Ja),!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};Ja.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 Ja(e.minimum,e.maximum,e.center)};Ja.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 fk=new h;Ja.intersectPlane=function(e,t){fk=h.subtract(e.maximum,e.minimum,fk);let n=h.multiplyByScalar(fk,.5,fk),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};Ja.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};Ja.prototype.clone=function(e){return Ja.clone(this,e)};Ja.prototype.intersectPlane=function(e){return Ja.intersectPlane(this,e)};Ja.prototype.intersectAxisAlignedBoundingBox=function(e){return Ja.intersectAxisAlignedBoundingBox(this,e)};Ja.prototype.equals=function(e){return Ja.equals(this,e)};var ud=Ja;var BK=new se;function tp(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,BK)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,BK));let i=h.fromCartesian4(M.getColumn(n,2,BK));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(tp.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 D9e=new ud;tp.fromPoints=function(e,t){let n=ud.fromPoints(e,D9e);return new tp(n.center,t)};var Qhe=new gn,dk=new h;tp.prototype.projectPointOntoPlane=function(e,t){let n=Qhe;n.origin=e,h.normalize(e,n.direction);let i=Ti.rayPlane(n,this._plane,dk);if(l(i)||(h.negate(n.direction,n.direction),i=Ti.rayPlane(n,this._plane,dk)),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)}};tp.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};tp.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=Ti.rayPlane(n,this._plane,dk);l(i)||(h.negate(n.direction,n.direction),i=Ti.rayPlane(n,this._plane,dk));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};tp.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 R9e=new h;tp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=R9e;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};tp.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=tp;function sr(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}sr.packedLength=h.packedLength+$.packedLength;sr.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};sr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new sr),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var O9e=new h,M9e=new h,N9e=new h,L9e=new h,F9e=new h,B9e=new h,k9e=new $,U9e={unitary:new $,diagonal:new $};sr.fromPoints=function(e,t){if(l(t)||(t=new sr),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],O9e);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,M9e),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=k9e;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,U9e),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,L9e),b=$.getColumn(y,1,F9e),x=$.getColumn(y,2,B9e),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=N9e;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,z9e=new h;function eme(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new sr);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=z9e;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,V9e=new h,j9e=new he,H9e=new he,G9e=new he,W9e=new he,q9e=new he,Y9e=new h,nme=new h,X9e=new h,ime=new h,K9e=new h,$9e=new U,J9e=new U,Z9e=new U,Q9e=new U,e7e=new U,t7e=new h,n7e=new h,i7e=new h,r7e=new h,o7e=new U,s7e=new h,a7e=new h,c7e=new h,l7e=new sn(h.UNIT_X,0);sr.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,tme),R=i.cartographicToCartesian(I,V9e),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,j9e),w=he.fromRadians(e.west,e.north,n,H9e),D=he.fromRadians(e.west,_,n,G9e),N=he.fromRadians(e.west,e.south,n,W9e),F=he.fromRadians(L,e.south,n,q9e),V=i.cartographicToCartesian(C,Y9e),B=i.cartographicToCartesian(w,nme),j=i.cartographicToCartesian(D,X9e),k=i.cartographicToCartesian(N,ime),G=i.cartographicToCartesian(F,K9e),q=O.projectPointToNearestOnPlane(V,$9e),Q=O.projectPointToNearestOnPlane(B,J9e),W=O.projectPointToNearestOnPlane(j,Z9e),J=O.projectPointToNearestOnPlane(k,Q9e),Z=O.projectPointToNearestOnPlane(G,e7e);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,nme),k=i.cartographicToCartesian(N,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,t7e);A.z=0;let x=Math.abs(A.x)<P.EPSILON10&&Math.abs(A.y)<P.EPSILON10?h.UNIT_X:h.normalize(A,n7e),T=h.UNIT_Z,E=h.cross(x,T,i7e);d=sn.fromPointNormal(A,x,l7e);let v=h.fromRadians(y+P.PI_OVER_TWO,m,n,i,r7e);s=h.dot(sn.projectPointOntoPlane(d,v,o7e),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,s7e).z,a=h.fromRadians(0,e.south,p?t:n,i,a7e).z;let S=h.fromRadians(e.east,m,n,i,c7e);return u=sn.getPointDistance(d,S),f=0,eme(A,E,T,x,o,s,a,c,u,f,r)};sr.fromTransformation=function(e,t){return l(t)||(t=new sr),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};sr.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new sr(e.center,e.halfAxes)};sr.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,u7e=new h,rme=new h,f7e=new h;sr.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,P.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,u7e),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=f7e;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 d7e=new h,h7e=new h;sr.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ws);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,d7e);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,h7e),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 m7e=new h,p7e=new h,g7e=new h;sr.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,m7e),o=$.getColumn(i,1,p7e),s=$.getColumn(i,2,g7e);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 _7e=new $;sr.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,_7e);return M.fromRotationTranslation(i,n,t)};var y7e=new ue;sr.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,y7e);return!t.isBoundingSphereVisible(n)};sr.prototype.intersectPlane=function(e){return sr.intersectPlane(this,e)};sr.prototype.distanceSquaredTo=function(e){return sr.distanceSquaredTo(this,e)};sr.prototype.computePlaneDistances=function(e,t,n){return sr.computePlaneDistances(this,e,t,n)};sr.prototype.computeCorners=function(e){return sr.computeCorners(this,e)};sr.prototype.computeTransformation=function(e){return sr.computeTransformation(this,e)};sr.prototype.isOccluded=function(e){return sr.isOccluded(this,e)};sr.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};sr.prototype.clone=function(e){return sr.clone(this,e)};sr.prototype.equals=function(e){return sr.equals(this,e)};var en=sr;function A7e(e,t){return t=t??0,cf(e,t,Math.min(4,e.length))}var np=A7e;var kK=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+=jP;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=jP,o+=jP;let f=c.getUint32(o,!0);o+=jP;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=np(a,o),b=c.getUint32(o+jP*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 le(this)}},jP=Uint32Array.BYTES_PER_ELEMENT,hk=kK;var UK={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};UK.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(UK);var ei=UK;function b7e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var J0=b7e;var kb=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif -void main(void) -{ -#ifdef VECTOR_TILE -out_FragColor = czm_gammaCorrect(u_highlightColor); -#else -out_FragColor = vec4(1.0); -#endif -czm_writeDepthClamp(); -} -`;var HP=`in vec3 position; -in float a_batchId; -uniform mat4 u_modifiedModelViewProjection; -void main() -{ -gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); -} -`;var zK=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=zK;var lme={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(lme);var _c=lme;var VK=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)})}},jK=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)})}},yu=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)}}},x7e=new VK;Object.assign(yu,{hooks:x7e,plugins:new jK(yu),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"});yu.max_unop_len=yu.getMaxKeyLen(yu.unary_ops);yu.max_binop_len=yu.getMaxKeyLen(yu.binary_ops);var Z_=e=>new yu(e).parse(),T7e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(yu).filter(e=>!T7e.includes(e)&&Z_[e]===void 0).forEach(e=>{Z_[e]=yu[e]});Z_.Jsep=yu;var E7e="ConditionalExpression",C7e={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:E7e,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 :")}})}};Z_.plugins.register(C7e);var ume={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(ume);var Nt=ume;function wh(e,t){this._expression=e,e=B7e(e,t),e=U7e(k7e(e)),Z_.addBinaryOp("=~",0),Z_.addBinaryOp("!~",0);let n;try{n=Z_(e)}catch(i){throw new oe(i)}this._runtimeAst=qi(this,n)}Object.defineProperties(wh.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++]}};wh.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};wh.prototype.evaluateColor=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};wh.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} -{ - return ${r}; -} -`,r};wh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};wh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var v7e=["!","-","+"],fme=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],GP=/\${(.*?)}/g,S7e=/\\/g,w7e="@#%",I7e=/@#%/g,gk=new z,_k={abs:Oa(Math.abs),sqrt:Oa(Math.sqrt),cos:Oa(Math.cos),sin:Oa(Math.sin),tan:Oa(Math.tan),acos:Oa(Math.acos),asin:Oa(Math.asin),atan:Oa(Math.atan),radians:Oa(P.toRadians),degrees:Oa(P.toDegrees),sign:Oa(P.sign),floor:Oa(Math.floor),ceil:Oa(Math.ceil),round:Oa(Math.round),exp:Oa(Math.exp),exp2:Oa(D7e),log:Oa(Math.log),log2:Oa(R7e),fract:Oa(P7e),length:O7e,normalize:M7e},yk={atan2:mk(Math.atan2,!1),pow:mk(Math.pow,!1),min:mk(Math.min,!0),max:mk(Math.max,!0),distance:N7e,dot:L7e,cross:F7e},WK={clamp:dme(P.clamp,!0),mix:dme(P.lerp,!0)};function P7e(e){return e-Math.floor(e)}function D7e(e){return Math.pow(2,e)}function R7e(e){return P.log2(e)}function Oa(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 mk(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 dme(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 O7e(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 M7e(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 N7e(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 L7e(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 F7e(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,K7e(this)}function B7e(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 k7e(e){return e.replace(S7e,w7e)}function GK(e){return e.replace(I7e,"\\")}function U7e(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 z7e(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,GK(e.value))}function V7e(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=qi(e,c),a=qi(e,n[0]),new Ft(Nt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=qi(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=qi(e,n[0]),l(n[1])){let c=qi(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=[qi(e,n[0]),qi(e,n[1]),qi(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=[qi(e,n[0]),qi(e,n[1]),qi(e,n[2]),qi(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]=qi(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=qi(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=qi(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(_k[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=qi(e,n[0]),new Ft(Nt.UNARY,r,o)}else if(l(yk[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=qi(e,n[0]),a=qi(e,n[1]),new Ft(Nt.BINARY,r,s,a)}else if(l(WK[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=qi(e,n[0]),a=qi(e,n[1]);let c=qi(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=qi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="Number")return i===0?new Ft(Nt.LITERAL_NUMBER,0):(o=qi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="String")return i===0?new Ft(Nt.LITERAL_STRING,""):(o=qi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="regExp")return j7e(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function j7e(e,t){let n=t.arguments;if(n.length===0)return new Ft(Nt.LITERAL_REGEX,new RegExp);let i=qi(e,n[0]),r;if(n.length>1){let o=qi(e,n[1]);if(HK(i)&&HK(o)){try{r=new RegExp(GK(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(HK(i)){try{r=new RegExp(GK(String(i._value)))}catch(o){throw new oe(o)}return new Ft(Nt.LITERAL_REGEX,r)}return new Ft(Nt.REGEX,i)}function H7e(e){if(Y7e(e.name)){let t=X7e(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 G7e(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 W7e(e){if(e.property.name==="POSITIVE_INFINITY")return new Ft(Nt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function q7e(e,t){if(t.object.name==="Math")return G7e(t);if(t.object.name==="Number")return W7e(t);let n,i=qi(e,t.object);return t.computed?(n=qi(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 HK(e){return e._type>=Nt.LITERAL_NULL}function Y7e(e){return e.substr(0,4)==="czm_"}function X7e(e){return e.substr(4)}function qi(e,t){let n,i,r,o;if(t.type==="Literal")n=z7e(t);else if(t.type==="CallExpression")n=V7e(e,t);else if(t.type==="Identifier")n=H7e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=qi(e,t.argument);if(v7e.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=qi(e,t.left),o=qi(e,t.right),fme.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=qi(e,t.left),o=qi(e,t.right),fme.indexOf(i)>-1&&(n=new Ft(Nt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=qi(e,t.test);r=qi(e,t.consequent),o=qi(e,t.alternate),n=new Ft(Nt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=q7e(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=qi(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 K7e(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(_k[e._value])&&(e.evaluate=J7e(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(yk[e._value])&&(e.evaluate=Z7e(e._value)):e._type===Nt.TERNARY?e.evaluate=Q7e(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=$7e):e.evaluate=e._evaluateLiteral}function $7e(e){return l(e)?e.content.tileset.timeSinceLoad:0}function J7e(e){let t=_k[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Z7e(e){let t=yk[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function Q7e(e){let t=WK[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 Ak(e,t){if(l(e))return e.getPropertyInherited(t)}Ft.prototype._evaluateLiteral=function(){return this._value};Ft.prototype._evaluateLiteralColor=function(e){let t=gk,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=GP.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=Ak(e,r);l(o)||(o=""),t=t.replace(i,o),GP.lastIndex+=o.length-i.length,n=GP.exec(t)}return t};Ft.prototype._evaluateVariable=function(e){return Ak(e,this._value)};function Ub(e){return e._value==="feature"}Ft.prototype._evaluateMemberDot=function(e){if(Ub(this._left))return Ak(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(Ub(this._left))return Ak(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 hme(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,gk)}function mme(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=gk;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 Q_(e){return e%1===0?e.toFixed(1):e.toString()}function eWe(e){let t=Q_(e.red),n=Q_(e.green),i=Q_(e.blue);return`vec3(${t}, ${n}, ${i})`}function pk(e){let t=Q_(e.red),n=Q_(e.green),i=Q_(e.blue),r=Q_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function pme(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 gme(e,t){return l(t[e])?t[e]:wh.NULL_SENTINEL}wh.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=pme(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=pme(this._value,e,t,this));let u,f,d;switch(a){case Nt.VARIABLE:return Ub(this)?void 0:gme(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(_k[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(yk[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Nt.TERNARY:if(l(WK[c]))return`${c}(${r}, ${o}, ${s})`;break;case Nt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Nt.MEMBER:return Ub(this._left)?gme(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 wh.NULL_SENTINEL;case Nt.LITERAL_BOOLEAN:return c?"true":"false";case Nt.LITERAL_NUMBER:return Q_(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"||Ub(n._left)))return c;if(i=z.fromCssColorString(c,gk),l(i))return eWe(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=mme(this),l(i)?pk(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=mme(this),l(i)?pk(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=hme(this),l(i)?pk(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=hme(this),l(i)?(i.alpha!==1&&(t.translucent=!0),pk(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 wh.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:Ub(this)||e.push(s);break;case Nt.VARIABLE_IN_STRING:for(a=GP.exec(s);a!==null;)e.push(a[1]),a=GP.exec(s);break;case Nt.LITERAL_STRING:l(t)&&t._type===Nt.MEMBER&&Ub(t._left)&&e.push(s);break}};var Ih=wh;function Z0(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??ei.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(Z0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var tWe={position:0,a_batchId:1};function nWe(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 iWe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??tWe,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() +`,r};Eh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Eh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var B9e=["!","-","+"],She=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],qP=/\${(.*?)}/g,k9e=/\\/g,U9e="@#%",z9e=/@#%/g,ek=new z,tk={abs:Pa(Math.abs),sqrt:Pa(Math.sqrt),cos:Pa(Math.cos),sin:Pa(Math.sin),tan:Pa(Math.tan),acos:Pa(Math.acos),asin:Pa(Math.asin),atan:Pa(Math.atan),radians:Pa(P.toRadians),degrees:Pa(P.toDegrees),sign:Pa(P.sign),floor:Pa(Math.floor),ceil:Pa(Math.ceil),round:Pa(Math.round),exp:Pa(Math.exp),exp2:Pa(j9e),log:Pa(Math.log),log2:Pa(H9e),fract:Pa(V9e),length:G9e,normalize:W9e},nk={atan2:Z2(Math.atan2,!1),pow:Z2(Math.pow,!1),min:Z2(Math.min,!0),max:Z2(Math.max,!0),distance:q9e,dot:Y9e,cross:X9e},aK={clamp:whe(P.clamp,!0),mix:whe(P.lerp,!0)};function V9e(e){return e-Math.floor(e)}function j9e(e){return Math.pow(2,e)}function H9e(e){return P.log2(e)}function Pa(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 Z2(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 whe(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 G9e(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 W9e(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 q9e(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 Y9e(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 X9e(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 Lt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,a7e(this)}function K9e(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 $9e(e){return e.replace(k9e,U9e)}function sK(e){return e.replace(z9e,"\\")}function J9e(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 Z9e(e){let t=typeof e.value;if(e.value===null)return new Lt(Nt.LITERAL_NULL,null);if(t==="boolean")return new Lt(Nt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Lt(Nt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Lt(Nt.VARIABLE_IN_STRING,e.value):new Lt(Nt.LITERAL_STRING,sK(e.value))}function Q9e(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 Lt(Nt.LITERAL_BOOLEAN,!1):new Lt(Nt.LITERAL_NULL,null):(s=Yi(e,c),a=Yi(e,n[0]),new Lt(Nt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Yi(e,c),new Lt(Nt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Lt(Nt.LITERAL_COLOR,r);if(o=Yi(e,n[0]),l(n[1])){let c=Yi(e,n[1]);return new Lt(Nt.LITERAL_COLOR,r,[o,c])}return new Lt(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 Lt(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 Lt(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 Lt(Nt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Lt(Nt.LITERAL_BOOLEAN,!0):new Lt(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Lt(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 Lt(Nt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Lt(Nt.UNARY,r)}else if(l(tk[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o)}else if(l(nk[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Yi(e,n[0]),a=Yi(e,n[1]),new Lt(Nt.BINARY,r,s,a)}else if(l(aK[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 Lt(Nt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Lt(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="Number")return i===0?new Lt(Nt.LITERAL_NUMBER,0):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="String")return i===0?new Lt(Nt.LITERAL_STRING,""):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="regExp")return e7e(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function e7e(e,t){let n=t.arguments;if(n.length===0)return new Lt(Nt.LITERAL_REGEX,new RegExp);let i=Yi(e,n[0]),r;if(n.length>1){let o=Yi(e,n[1]);if(oK(i)&&oK(o)){try{r=new RegExp(sK(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Lt(Nt.LITERAL_REGEX,r)}return new Lt(Nt.REGEX,i,o)}if(oK(i)){try{r=new RegExp(sK(String(i._value)))}catch(o){throw new oe(o)}return new Lt(Nt.LITERAL_REGEX,r)}return new Lt(Nt.REGEX,i)}function t7e(e){if(o7e(e.name)){let t=s7e(e.name);return t.substr(0,8)==="tiles3d_"?new Lt(Nt.BUILTIN_VARIABLE,t):new Lt(Nt.VARIABLE,t)}else{if(e.name==="NaN")return new Lt(Nt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Lt(Nt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Lt(Nt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function n7e(e){let t=e.property.name;if(t==="PI")return new Lt(Nt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Lt(Nt.LITERAL_NUMBER,Math.E)}function i7e(e){if(e.property.name==="POSITIVE_INFINITY")return new Lt(Nt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function r7e(e,t){if(t.object.name==="Math")return n7e(t);if(t.object.name==="Number")return i7e(t);let n,i=Yi(e,t.object);return t.computed?(n=Yi(e,t.property),new Lt(Nt.MEMBER,"brackets",i,n)):(n=new Lt(Nt.LITERAL_STRING,t.property.name),new Lt(Nt.MEMBER,"dot",i,n))}function oK(e){return e._type>=Nt.LITERAL_NULL}function o7e(e){return e.substr(0,4)==="czm_"}function s7e(e){return e.substr(4)}function Yi(e,t){let n,i,r,o;if(t.type==="Literal")n=Z9e(t);else if(t.type==="CallExpression")n=Q9e(e,t);else if(t.type==="Identifier")n=t7e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Yi(e,t.argument);if(B9e.indexOf(i)>-1)n=new Lt(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),She.indexOf(i)>-1)n=new Lt(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),She.indexOf(i)>-1&&(n=new Lt(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 Lt(Nt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=r7e(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 Lt(Nt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function a7e(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(tk[e._value])&&(e.evaluate=l7e(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(nk[e._value])&&(e.evaluate=u7e(e._value)):e._type===Nt.TERNARY?e.evaluate=f7e(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=c7e):e.evaluate=e._evaluateLiteral}function c7e(e){return l(e)?e.content.tileset.timeSinceLoad:0}function l7e(e){let t=tk[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function u7e(e){let t=nk[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function f7e(e){let t=aK[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 ik(e,t){if(l(e))return e.getPropertyInherited(t)}Lt.prototype._evaluateLiteral=function(){return this._value};Lt.prototype._evaluateLiteralColor=function(e){let t=ek,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())};Lt.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())};Lt.prototype._evaluateLiteralString=function(){return this._value};Lt.prototype._evaluateVariableString=function(e){let t=this._value,n=qP.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=ik(e,r);l(o)||(o=""),t=t.replace(i,o),qP.lastIndex+=o.length-i.length,n=qP.exec(t)}return t};Lt.prototype._evaluateVariable=function(e){return ik(e,this._value)};function Vb(e){return e._value==="feature"}Lt.prototype._evaluateMemberDot=function(e){if(Vb(this._left))return ik(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]};Lt.prototype._evaluateMemberBrackets=function(e){if(Vb(this._left))return ik(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]};Lt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Lt.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};Lt.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}.`)};Lt.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};Lt.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};Lt.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};Lt.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};Lt.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};Lt.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};Lt.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};Lt.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}.`)};Lt.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}.`)};Lt.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}.`)};Lt.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}.`)};Lt.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}.`)};Lt.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};Lt.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};Lt.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)};Lt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Lt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Lt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Lt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Lt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Lt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Lt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Lt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Lt.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};Lt.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)};Lt.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}.`)};Lt.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}.`)};Lt.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};Lt.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 Ihe(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,ek)}function Phe(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=ek;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 J_(e){return e%1===0?e.toFixed(1):e.toString()}function d7e(e){let t=J_(e.red),n=J_(e.green),i=J_(e.blue);return`vec3(${t}, ${n}, ${i})`}function Q2(e){let t=J_(e.red),n=J_(e.green),i=J_(e.blue),r=J_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function Dhe(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 Rhe(e,t){return l(t[e])?t[e]:Eh.NULL_SENTINEL}Eh.NULL_SENTINEL="czm_infinity";Lt.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=Dhe(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=Dhe(this._value,e,t,this));let u,f,d;switch(a){case Nt.VARIABLE:return Vb(this)?void 0:Rhe(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(tk[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(nk[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Nt.TERNARY:if(l(aK[c]))return`${c}(${r}, ${o}, ${s})`;break;case Nt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Nt.MEMBER:return Vb(this._left)?Rhe(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 Eh.NULL_SENTINEL;case Nt.LITERAL_BOOLEAN:return c?"true":"false";case Nt.LITERAL_NUMBER:return J_(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"||Vb(n._left)))return c;if(i=z.fromCssColorString(c,ek),l(i))return d7e(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=Phe(this),l(i)?Q2(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=Phe(this),l(i)?Q2(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=Ihe(this),l(i)?Q2(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=Ihe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),Q2(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 Eh.NULL_SENTINEL;case Nt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Lt.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:Vb(this)||e.push(s);break;case Nt.VARIABLE_IN_STRING:for(a=qP.exec(s);a!==null;)e.push(a[1]),a=qP.exec(s);break;case Nt.LITERAL_STRING:l(t)&&t._type===Nt.MEMBER&&Vb(t._left)&&e.push(s);break}};var Ch=Eh;function K0(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??Qn.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(K0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var h7e={position:0,a_batchId:1};function m7e(e,t){if(l(e._va))return;let n=nt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=nt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=nt.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:nt.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 p7e(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??h7e,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=en.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 = ${r}; } -`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(HP),c=n.getFragmentShaderCallback(!1,void 0,!0)(kb);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:[HP]}),f=new Xe({defines:["VECTOR_TILE"],sources:[kb]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Xe.replaceMain(c,"czm_non_pick_main"),c=`${c} +`,e._spPick=en.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(WP),c=n.getFragmentShaderCallback(!1,void 0,!0)(Pb);r=n.getPickId();let u=new Xe({sources:[a]}),f=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._sp=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Xe({sources:[WP]}),f=new Xe({defines:["VECTOR_TILE"],sources:[Pb]}),e._spStencil=en.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 = ${r}; } -`;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 _me(e){let t=e?Zn.EQUAL:Zn.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:_c.LESS_OR_EQUAL},depthMask:!1}}var rWe={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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:nn.PRE_MULTIPLIED_ALPHA_BLEND},oWe={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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 sWe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(_me(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(_me(!0)),e._rsColorPass=Ge.fromCache(rWe),e._rsPickPass=Ge.fromCache(oWe))}var zb=new M,yme=new h;function aWe(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,zb),M.multiplyByPoint(zb,e._center,yme),M.setTranslation(zb,yme,zb),M.multiply(r,zb,zb),zb},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function qK(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 cWe(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=qK(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=qK(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=qK(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 YK(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 lWe(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=YK(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=YK(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=YK(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 uWe(e,t){return t.color.toRgba()-e.color.toRgba()}function fWe(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(uWe),t.webgl2?lWe(e,n):cWe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function dWe(e,t){let n=fWe(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 hWe(e,t){if(e.classificationType===ei.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 mWe(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}Z0.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)}};Z0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function pWe(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 gWe=new z,_We=z.WHITE,yWe=!0,AWe=/\$/;Z0.prototype.applyStyle=function(e,t){if(!l(e)){pWe(this,t);return}let n=e.color,i=n instanceof Ih&&!AWe.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,gWe):_We,c.show=l(e.show)?e.show.evaluate(c):yWe}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}};Z0.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 J0({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 J0({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 Ame(e,t,n,i){let r=e.classificationType,o=r!==ei.CESIUM_3D_TILE,s=r!==ei.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 bWe(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 xWe(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}Z0.prototype.update=function(e){let t=e.context;nWe(this,t),iWe(this,t),sWe(this),aWe(this,t);let n=e.passes;n.render&&(dWe(this,t),hWe(this,e),xWe(this),this._debugWireframe?bWe(e,this._commands):Ame(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(mWe(this),Ame(this,e,this._pickCommands))};Z0.prototype.isDestroyed=function(){return!1};Z0.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(),le(this)};var hC=Z0;function hf(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=ei.BOTH}Object.defineProperties(hf.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}}});hf.packedBoxLength=M.packedLength+h.packedLength;hf.packedCylinderLength=M.packedLength+2;hf.packedEllipsoidLength=M.packedLength+h.packedLength;hf.packedSphereLength=h.packedLength+1;function TWe(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 EWe(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]=ue.unpack(t,n),n+=ue.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 J0({color:u,offset:f,count:d,batchIds:g})}return i}var CWe=new Kn("createVectorTileGeometries",5),vWe=new z;function SWe(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,vWe);u[A]=b.toRgba()}f=e._packedBuffer=TWe(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=CWe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);EWe(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),wWe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function wWe(e){l(e._primitive)||(e._primitive=new hC({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)}hf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};hf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};hf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};hf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};hf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=SWe(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)};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var ey=hf;var XK=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,DWe(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 bme(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){bme(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(),le(this)}};function IWe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function PWe(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 Vb=Uint32Array.BYTES_PER_ELEMENT;function DWe(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Vb;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=Vb;let s=r.getUint32(n,!0);if(n+=Vb,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Vb,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Vb;let u=r.getUint32(n,!0);n+=Vb;let f=r.getUint32(n,!0);n+=Vb;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 Xm(e,T,g,m,IWe(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=PWe(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,ey.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,ey.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,ey.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,ey.packedSphereLength*x)}return e._geometries=new ey({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 bme(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 bk=XK;var KK={};KK.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),xme(i,r,o,s);return c};KK.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)),xme(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function xme(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 WP=KK;var jb=30,RWe=1<<jb,OWe=1<<jb+1>>>0,$K=2*jb+1,ty=4,Cme=[],vme=[],MWe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ny=1,mC=2,xk=[ny,0,0,ny|mC];function Ds(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Ds.getLevel(e)}Ds.fromToken=function(e){return new Ds(Ds.getIdFromToken(e))};Ds.isValidId=function(e){return!(e<=0||e>>BigInt($K)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ds.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ds.isValidId(Ds.getIdFromToken(e)):!1};Ds.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ds.getTokenFromId=function(e){let t=Math.floor(HWe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ds.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return jb-(t>>1)};Ds.prototype.getChild=function(e){let t=Ime(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ds(n)};Ds.prototype.getParent=function(){let e=Ime(this._cellId)<<BigInt(2);return new Ds(this._cellId&~e+BigInt(1)|e)};Ds.prototype.getParentAtLevel=function(e){let t=VWe(e);return new Ds(this._cellId&-t|t)};Ds.prototype.getCenter=function(e){e=e??ee.WGS84;let t=NWe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Ds.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=LWe(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)};Ds.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($K-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Ds(a)};function NWe(e,t){let n=FWe(e,t);return BWe(n[0],n[1],n[2])}function LWe(e,t,n){let i=Sme(e,t),r=kWe([i[1],i[2]],t),o=n>>1&1;return wme(i[0],r[0][o^n&1],r[1][o])}function FWe(e,t){let n=Sme(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 Sme(e){Cme.length===0&&zWe();let t=Number(e>>BigInt($K)),n=t&ny,i=(1<<ty)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?jb-7*ty:ty))-1;n+=Number(e>>BigInt(s*2*ty+1)&BigInt(c))<<2,n=vme[n];let u=s*ty;r+=n>>ty+2<<u,o+=(n>>2&i)<<u,n&=ny|mC}return[t,r,o]}function BWe(e,t,n){let i=Tme(t),r=Tme(n),o=Tk(i),s=Tk(r);return wme(e,o,s)}function wme(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 Tk(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Tme(e){return 1/OWe*e}function kWe(e,t){let n=[[],[]],i=UWe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=Tk(Eme(o)),n[r][1]=Tk(Eme(s))}return n}function UWe(e){return 1<<jb-e>>>0}function Eme(e){return 1/RWe*e}function iy(e,t,n,i,r,o){if(e===ty){let s=(t<<ty)+n;Cme[(s<<2)+i]=(r<<2)+o,vme[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=MWe[o];iy(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^xk[0]),iy(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^xk[1]),iy(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^xk[2]),iy(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^xk[3])}}function zWe(){iy(0,0,0,0,0,0),iy(0,0,0,ny,0,ny),iy(0,0,0,mC,0,mC),iy(0,0,0,ny|mC,0,ny|mC)}function Ime(e){return e&~e+BigInt(1)}function VWe(e){return BigInt(1)<<BigInt(2*(jb-e))}var jWe=[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 HWe(e){return jWe[(-e&e)%BigInt(67)]}var ry=Ds;function GWe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ar=GWe;function JK(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=WWe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function WWe(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(JK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});JK.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 qP=JK;function Q0(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(Q0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Q0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Q0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Q0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Q0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Q0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Q0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Q0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var YP=Q0;var XP={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};XP.getBranchingFactor=function(e){switch(e){case XP.OCTREE:return 8;case XP.QUADTREE:return 4}};Object.freeze(XP);var Ys=XP;function Za(){}Object.defineProperties(Za.prototype,{class:{get:function(){pe.throwInstantiationError()}}});Za.prototype.hasProperty=function(e){pe.throwInstantiationError()};Za.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};Za.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};Za.prototype.getProperty=function(e){pe.throwInstantiationError()};Za.prototype.setProperty=function(e,t){pe.throwInstantiationError()};Za.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};Za.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};Za.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))};Za.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};Za.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};Za.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)};Za.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};Za.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return Za.getProperty(r.id,t,n)};Za.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?Za.setProperty(o.id,t,n,i):!1};var Xn=Za;function eg(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(eg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});eg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};eg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};eg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};eg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};eg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};eg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};eg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var Ek=eg;function qo(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)}qo.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=qWe(n),r=YWe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new qo({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(qo.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 qWe(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 YWe(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}}qo.prototype.normalize=function(e){return this._normalized?ZK(e,this._valueType,Lt.normalize):e};qo.prototype.unnormalize=function(e){return this._normalized?ZK(e,this._valueType,Lt.unnormalize):e};qo.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:qo.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};qo.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:qo.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};qo.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)};qo.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Ome(e,t))return e};function KP(e){return Array.isArray(e)&&!(e instanceof $i)&&!(e instanceof $)&&!(e instanceof M)}function Ome(e,t){if(!KP(e))return e===t;if(!KP(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ome(e[n],t[n]))return!1;return!0}qo.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};qo.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};qo.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?XWe(this,e):Mme(this,e)};function XWe(e,t){if(!KP(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=Mme(e,t[i]);if(l(r))return r}}function Mme(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?KWe(t,n,i):bt.isMatrixType(n)?$We(t,n,i):n===bt.STRING?JWe(t):n===bt.BOOLEAN?ZWe(t):n===bt.ENUM?QWe(t,r):eqe(t,i,o)}function KWe(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 $We(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 JWe(e){if(typeof e!="string")return Ck(e,bt.STRING)}function ZWe(e){if(typeof e!="boolean")return Ck(e,bt.BOOLEAN)}function QWe(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 eqe(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"?Ck(e,t):isFinite(e)?Dme(e,t,n):Rme(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?Ck(e,t):i==="number"&&!isFinite(e)?Rme(e,t):Dme(e,t,n)}}function Ck(e,t){return`value ${e} does not match type ${t}`}function Pme(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Dme(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Pme(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return Pme(e,t,n)}function Rme(e,t){return`value ${e} of type ${t} must be finite`}function ZK(e,t,n){if(!KP(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=ZK(e[i],t,n);return e}qo.valueTransformInPlace=function(e,t,n,i){if(!KP(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=qo.valueTransformInPlace(e[r],t[r],n[r],i);return e};qo.prototype.cpuBytesPerElement=function(){return Nme(this,this.valueType)};qo.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return Nme(this,e)};function Nme(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}qo.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var QK=[void 0,"float","vec2","vec3","vec4"],Lme=[void 0,"int","ivec2","ivec3","ivec4"],tqe=[void 0,"uint","uvec2","uvec3","uvec4"],nqe={[Kc.FLOAT]:"uintBitsToFloat",[Kc.INTEGER]:"int",[Kc.UNSIGNED_INTEGER]:""};qo.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?QK[e]:Lme[e]};qo.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?QK[t]:Lt.isUnsignedIntegerType(e)?tqe[t]:Lme[t]};qo.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=`${QK[s]} ${f} = ${e};`;i.push(y);let A=nqe[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};qo.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var tg=qo;function $P(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 e$(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 e$(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 e$(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=Fme(v),S=Fme(S);let R,O,L=this;f?R=function(_){return oqe(_,L._values,L._stringOffsets)}:d?(R=function(_){return sqe(_,L._values)},O=function(_,C){aqe(_,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($P.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}}});$P.prototype.get=function(e){let t=iqe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=pqe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};$P.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=gqe(this,t),t=n.unnormalize(t),rqe(this,e,t)};$P.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Fme(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)?Qn(t,i):t.push(i)}return t}function iqe(e,t){kme(e)&&Ume(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):Bme(e,n,t)}function Bme(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 rqe(e,t,n){hqe(e,t,n)&&Ume(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 oqe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return cf(t.typedArray,i,r)}function sqe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function aqe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function cqe(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 lqe(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 uqe(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 fqe(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 dqe(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 kme(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 hqe(e,t,n){if(kme(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 Ume(e){e._unpackedValues=mqe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function mqe(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]=Bme(e,i,a);return n}function pqe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:tg.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function gqe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:tg.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function e$(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 lqe(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 cqe(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 fqe(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 uqe(a,i)});else{let a=dqe(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 vk=$P;function Ph(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 vk({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(Ph.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}}});Ph.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Ph.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Ph.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Ph.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=_qe(this._class,t),i};Ph.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Ph.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)};Ph.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};Ph.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Ph.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function _qe(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 Dh=Ph;function yqe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var Hb=yqe;var xAn=(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 oy=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9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fcbaha8J9c8L1: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:cjbggpsaoRbeg8J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mPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;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 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 CAn=(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:tjjjb8AkdnadTmbcbhKabhHina8NaH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dwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1: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:cjbHjjjjb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IdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8Pa8FaC2gacdtfhHa8RaKaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8Vxekaga8Fc8S2fgAIdwa8NaKcx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKh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8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna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8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRb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nahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR: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:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecif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aOJbbbZMgO: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 SAn=(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: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 IAn=(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:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59B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OavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz: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 t$=class extends rr{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=Hb(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=Aqe(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 Aqe(e){try{let t=bqe(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);oy.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 bqe(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 JP=t$;var Gb=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Kn("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])}};Gb._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Gb._decoderTaskProcessor=void 0;Gb._taskProcessorReady=!1;Gb._error=void 0;var sy=Gb;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 xqe(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=xqe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Rn);var ct=Rn;var n$=class extends rr{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=Tqe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._dracoError)&&zme(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=Cqe(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=sy.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=Eqe(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 Tqe(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;zme(e,n)}}function zme(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load Draco",t)}async function Eqe(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 Wb={};Wb[ct.POSITION]="POSITION";Wb[ct.NORMAL]="NORMAL";Wb[ct.COLOR]="COLOR";Wb[ct.TEXCOORD]="TEX_COORD";function Cqe(e){for(let t in Wb)if(Wb.hasOwnProperty(t)&&e.startsWith(t))return Wb[t]}var ZP=n$;function vqe(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 ay=vqe;var QP=class extends rr{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=Sqe(this),this._promise):(this._promise=wqe(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 Vme(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 Sqe(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 Pqe(i);if(e.isDestroyed())return;let o=Vme(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(n){return e.isDestroyed()?void 0:jme(e,n,"Failed to load embedded image")}}async function wqe(e){e._state=Ct.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await Rqe(i);if(e.isDestroyed())return;let o=Vme(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(r){return e.isDestroyed()?void 0:jme(e,r,`Failed to load image: ${n}`)}}function jme(e,t,n){return e.unload(),e._state=Ct.FAILED,Promise.reject(e.getError(n,t))}function Iqe(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 Pqe(e){let t=Iqe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return of(n)}return QP._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var Dqe=/(^data:image\/ktx2)|(\.ktx2$)/i;function Rqe(e){let t=e.getUrlComponent(!1,!0);return Dqe.test(t)?of(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}QP._loadImageFromTypedArray=ay;var eD=QP;var Hme={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Hme);var Qc=Hme;var i$=class extends rr{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=Mqe(this),this._promise):(this._promise=Nqe(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){o$(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=Oqe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Qc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=Gme(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}},r$=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=Gme(this.typedArray,this.indexDatatype,this.context)}};function Gme(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var Oqe=new r$;async function Mqe(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;o$(e,n)}}async function Nqe(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=Lqe(e,a),e._state=Ct.PROCESSING,e}catch(s){if(e.isDestroyed())return;o$(e,s)}}function Lqe(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 o$(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load index buffer",t)}var tD=i$;function Fqe(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 Ma=Fqe;function Bqe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Yo=Bqe;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 Yo(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 Yo(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 Yo(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 Ue=rn;function kqe(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 fd=kqe;function Uqe(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)*fd(t.type)}var mf=Uqe;function zqe(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=Ma(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=mf(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)&&qb(c)}),qb(n.emissiveTexture),qb(n.normalTexture),qb(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,qb(s.baseColorTexture),qb(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,qb(a.specularGlossinessTexture))}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=Vqe(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 Vqe(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 qb(e){l(e)&&(e.texCoord=e.texCoord??0)}var Sk=zqe;function jqe(e){return Ue.shader(e,function(t){wk(t)}),Ue.buffer(e,function(t){wk(t)}),Ue.image(e,function(t){wk(t)}),wk(e),e}function wk(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Yb=jqe;function Hqe(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 Ik=Hqe;function Gqe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),Ik(e,t),n.length===0&&delete e.extensionsUsed}}var pC=Gqe;var Wqe=4;function qqe(e){if(np(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=Wme(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?Yqe(e,n):Xqe(e,n)}function Wme(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*Wqe,!0);return r}function Yqe(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);Yb(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 pC(c,"KHR_binary_glTF"),c}function Xqe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Wme(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),Yb(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 gC=qqe;function Kqe(e){return Ue.shader(e,function(t){Pk(t)}),Ue.buffer(e,function(t){Pk(t)}),Ue.image(e,function(t){Pk(t)}),Pk(e),e}function Pk(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var Dk=Kqe;function $qe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ma(n,t,!0)}var Rh=$qe;function Jqe(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 cy=Jqe;function Zqe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=fd(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=mf(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=cy(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 _C=Zqe;var Qqe=[te.FUNC_ADD,te.FUNC_ADD],eYe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function qme(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var tYe=[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 nYe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(tYe.indexOf(e[n])===-1)return t;return e}function iYe(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(qme(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??Qqe,blendFactors:nYe(c.blendFuncSeparate,eYe)})}qme(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Rh(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 Rk=iYe;function rYe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ma(n,t,!0),Rh(e,t)}var Ok=rYe;function oYe(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=Ma(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Ma(o.shaders,m,!0),u.program=Ma(o.programs,p),r[a.program]=u.program}i[c]=Ma(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Rh(e,"KHR_techniques_webgl"),Ok(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 Mk=oYe;function sYe(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 nD=sYe;var Yme=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function aYe(e,t){return t=t??Yme,Yme.forEach(function(n){t.indexOf(n)>-1&&lYe(e,n)}),e}var cYe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function lYe(e,t){let n=cYe[t],i=e[n];if(l(i)){let r=0,o=rp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(ip[t](e,a-r),r++)}}function ip(){}ip.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--})})};ip.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--}})};ip.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--}),Yo(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--})}),Yo(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(Yo(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--}}}}};ip.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})};ip.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)})};ip.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})})};ip.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--})})};ip.sampler=function(e,t){e.samplers.splice(t,1),Ue.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};ip.texture=function(e,t){if(e.textures.splice(t,1),Ue.material(e,function(i){nD(i,function(r,o){o.index>t&&--o.index})}),Yo(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(Yo(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}}}})}),Yo(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 rp(){}rp.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)})}),Yo(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})}),Yo(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};rp.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};rp.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)}),Yo(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)})}),Yo(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(Yo(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};rp.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};rp.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 Xme(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!Xme(e,r,n)}).length===0}rp.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){Xme(e,i,t)||(t[i]=!0)}),t};rp.material=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};rp.texture=function(e){let t={};if(Ue.material(e,function(n){nD(n,function(i){t[i]=!0})}),Yo(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(Yo(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)}}}})}),Yo(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};rp.sampler=function(e){let t={};return Ue.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var Nk=aYe;function uYe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:Ma(e.buffers,n),byteOffset:0,byteLength:t.length};return Ma(e.bufferViews,r)}var Lk=uYe;function fYe(e,t){let n=mf(e,t),i=Y.getSizeInBytes(t.componentType),r=fd(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=cy(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 Fk=fYe;function dYe(e){let t;return Ue.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?Bk(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&Bk(e,i,Y.UNSIGNED_SHORT)}),Ue.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?Bk(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&Bk(e,i,Y.UNSIGNED_SHORT)}),e}function Bk(e,t,n){let i=Y.createTypedArray(n,Fk(e,t)),r=new Uint8Array(i.buffer);t.bufferView=Lk(e,r),t.componentType=n,t.byteOffset=0}var kk=dYe;function hYe(e,t){return pC(e,t),t==="CESIUM_RTC"&&mYe(e),s$(e,t)}function mYe(e){Ue.technique(e,function(t){Ue.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function s$(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)s$(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)&&s$(e[r],t);return i}}var yC=hYe;var Uk={.8:bYe,"1.0":VYe,"2.0":void 0};function pYe(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(Uk,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(Uk,i)||(i="1.0"));let r=Uk[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=Uk[i];return t.keepLegacyExtensions||(GYe(e,t),WYe(e)),e}function Jme(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 gYe(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 _Ye(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 yYe(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=fd(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 AYe(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 bYe(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,Jme(e),gYe(e),_Ye(e),yYe(e),AYe(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,Rh(e,"KHR_materials_common")}}function xYe(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 Kme(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 TYe(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]=Kme(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=Ma(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=Kme(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 EYe(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){delete n.name})})}function CYe(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 vYe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var SYe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function wYe(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(SYe[r])&&e.extensionsRequired.push(r)}}}function IYe(e){Ue.buffer(e,function(t){delete t.type})}function PYe(e){Ue.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function DYe(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 RYe={POSITION:!0,NORMAL:!0,TANGENT:!0},OYe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function MYe(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=OYe[a];l(f)?(u=f+c,t[o]=u):l(RYe[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 NYe(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 c$(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:mf(e,t)}function LYe(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=c$(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function FYe(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=c$(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?c$(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=Ma(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}}}Nk(e,["accessor","bufferView","buffer"])}function BYe(e){Ue.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=_C(e,n);n.min=i.min,n.max=i.max}})}function Zme(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 Qme(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),Zme(n)&&Qme(e,i))}}),delete e.nodes[t]}function kYe(e){return Ue.node(e,function(t,n){Zme(t)&&Qme(e,n)}),e}function UYe(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=_C(e,i);i.min=r.min,i.max=r.max}})})}function zYe(e){Ue.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=_C(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function VYe(e){e.asset=e.asset??{},e.asset.version="2.0",Jme(e),xYe(e),kYe(e),TYe(e),EYe(e),vYe(e),wYe(e),LYe(e),FYe(e),BYe(e),UYe(e),zYe(e),IYe(e),PYe(e),DYe(e),MYe(e),kk(e),NYe(e),Rk(e),Mk(e),CYe(e)}var jYe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],HYe=["u_diffuse","u_diffuse_mat"];function l$(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function u$(e){return l(e.index)}function f$(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 GYe(e,t){t=t??{};let n=t.baseColorTextureNames??jYe,i=t.baseColorFactorNames??HYe;Ue.material(e,function(r){Ue.materialValue(r,function(o,s){n.indexOf(s)!==-1&&u$(o)?(l$(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&f$(o)&&(l$(r),r.pbrMetallicRoughness.baseColorFactor=epe(o))})}),yC(e,"KHR_techniques_webgl"),yC(e,"KHR_blend")}function a$(e,t){l(t)&&(f$(t)?e.pbrMetallicRoughness.baseColorFactor=epe(t):u$(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function $me(e,t){l(t)&&(f$(t)?e.emissiveFactor=t.slice(0,3):u$(t)&&(e.emissiveTexture=t))}function WYe(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;l$(t),n.technique==="CONSTANT"?(Rh(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},a$(t,s),a$(t,r)):(a$(t,o),$me(t,r),$me(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")}),yC(e,"KHR_materials_common")}var zk=pYe;function el(){}el.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +`;let d=new Xe({sources:[a]}),p=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._spPick=en.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function Ohe(e){let t=e?ei.EQUAL:ei.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:gc.LESS_OR_EQUAL},depthMask:!1}}var g7e={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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:nn.PRE_MULTIPLIED_ALPHA_BLEND},_7e={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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 y7e(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(Ohe(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(Ohe(!0)),e._rsColorPass=Ge.fromCache(g7e),e._rsPickPass=Ge.fromCache(_7e))}var jb=new M,Mhe=new h;function A7e(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,jb),M.multiplyByPoint(jb,e._center,Mhe),M.setTranslation(jb,Mhe,jb),M.multiply(r,jb,jb),jb},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function cK(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 b7e(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=cK(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=cK(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=cK(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 lK(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 x7e(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=lK(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=lK(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=lK(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 T7e(e,t){return t.color.toRgba()-e.color.toRgba()}function E7e(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(T7e),t.webgl2?x7e(e,n):b7e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function C7e(e,t){let n=E7e(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 v7e(e,t){if(e.classificationType===Qn.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 S7e(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}K0.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 la(e,o)}};K0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function w7e(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 I7e=new z,P7e=z.WHITE,D7e=!0,R7e=/\$/;K0.prototype.applyStyle=function(e,t){if(!l(e)){w7e(this,t);return}let n=e.color,i=n instanceof Ch&&!R7e.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,I7e):P7e,c.show=l(e.show)?e.show.evaluate(c):D7e}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}};K0.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 X0({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 X0({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 Nhe(e,t,n,i){let r=e.classificationType,o=r!==Qn.CESIUM_3D_TILE,s=r!==Qn.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 O7e(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 M7e(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}K0.prototype.update=function(e){let t=e.context;m7e(this,t),p7e(this,t),y7e(this),A7e(this,t);let n=e.passes;n.render&&(C7e(this,t),v7e(this,e),M7e(this),this._debugWireframe?O7e(e,this._commands):Nhe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(S7e(this),Nhe(this,e,this._pickCommands))};K0.prototype.isDestroyed=function(){return!1};K0.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(),le(this)};var xC=K0;function df(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=Qn.BOTH}Object.defineProperties(df.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}}});df.packedBoxLength=M.packedLength+h.packedLength;df.packedCylinderLength=M.packedLength+2;df.packedEllipsoidLength=M.packedLength+h.packedLength;df.packedSphereLength=h.packedLength+1;function N7e(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 L7e(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]=ue.unpack(t,n),n+=ue.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 X0({color:u,offset:f,count:d,batchIds:g})}return i}var F7e=new Jn("createVectorTileGeometries",5),B7e=new z;function k7e(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,B7e);u[A]=b.toRgba()}f=e._packedBuffer=N7e(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=F7e.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);L7e(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),U7e(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function U7e(e){l(e._primitive)||(e._primitive=new xC({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)}df.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};df.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};df.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};df.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};df.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=k7e(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)};df.prototype.isDestroyed=function(){return!1};df.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var Z_=df;var uK=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,j7e(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 Lhe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){Lhe(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(),le(this)}};function z7e(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function V7e(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 Hb=Uint32Array.BYTES_PER_ELEMENT;function j7e(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Hb;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=Hb;let s=r.getUint32(n,!0);if(n+=Hb,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Hb,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Hb;let u=r.getUint32(n,!0);n+=Hb;let f=r.getUint32(n,!0);n+=Hb;let d=No(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=No(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 cp(e,T,g,m,z7e(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=V7e(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,Z_.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,Z_.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,Z_.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,Z_.packedSphereLength*x)}return e._geometries=new Z_({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 Lhe(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 rk=uK;var fK={};fK.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),Fhe(i,r,o,s);return c};fK.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)),Fhe(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function Fhe(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 YP=fK;var Gb=30,H7e=1<<Gb,G7e=1<<Gb+1>>>0,dK=2*Gb+1,Q_=4,Uhe=[],zhe=[],W7e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],ey=1,TC=2,ok=[ey,0,0,ey|TC];function Is(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Is.getLevel(e)}Is.fromToken=function(e){return new Is(Is.getIdFromToken(e))};Is.isValidId=function(e){return!(e<=0||e>>BigInt(dK)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Is.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Is.isValidId(Is.getIdFromToken(e)):!1};Is.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Is.getTokenFromId=function(e){let t=Math.floor(tWe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Is.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Gb-(t>>1)};Is.prototype.getChild=function(e){let t=Hhe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Is(n)};Is.prototype.getParent=function(){let e=Hhe(this._cellId)<<BigInt(2);return new Is(this._cellId&~e+BigInt(1)|e)};Is.prototype.getParentAtLevel=function(e){let t=Q7e(e);return new Is(this._cellId&-t|t)};Is.prototype.getCenter=function(e){e=e??ee.WGS84;let t=q7e(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Is.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=Y7e(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)};Is.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(dK-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Is(a)};function q7e(e,t){let n=X7e(e,t);return K7e(n[0],n[1],n[2])}function Y7e(e,t,n){let i=Vhe(e,t),r=$7e([i[1],i[2]],t),o=n>>1&1;return jhe(i[0],r[0][o^n&1],r[1][o])}function X7e(e,t){let n=Vhe(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 Vhe(e){Uhe.length===0&&Z7e();let t=Number(e>>BigInt(dK)),n=t&ey,i=(1<<Q_)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Gb-7*Q_:Q_))-1;n+=Number(e>>BigInt(s*2*Q_+1)&BigInt(c))<<2,n=zhe[n];let u=s*Q_;r+=n>>Q_+2<<u,o+=(n>>2&i)<<u,n&=ey|TC}return[t,r,o]}function K7e(e,t,n){let i=Bhe(t),r=Bhe(n),o=sk(i),s=sk(r);return jhe(e,o,s)}function jhe(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 sk(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Bhe(e){return 1/G7e*e}function $7e(e,t){let n=[[],[]],i=J7e(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=sk(khe(o)),n[r][1]=sk(khe(s))}return n}function J7e(e){return 1<<Gb-e>>>0}function khe(e){return 1/H7e*e}function ty(e,t,n,i,r,o){if(e===Q_){let s=(t<<Q_)+n;Uhe[(s<<2)+i]=(r<<2)+o,zhe[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=W7e[o];ty(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^ok[0]),ty(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^ok[1]),ty(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^ok[2]),ty(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^ok[3])}}function Z7e(){ty(0,0,0,0,0,0),ty(0,0,0,ey,0,ey),ty(0,0,0,TC,0,TC),ty(0,0,0,ey|TC,0,ey|TC)}function Hhe(e){return e&~e+BigInt(1)}function Q7e(e){return BigInt(1)<<BigInt(2*(Gb-e))}var eWe=[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 tWe(e){return eWe[(-e&e)%BigInt(67)]}var ny=Is;function nWe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var sr=nWe;function hK(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=iWe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function iWe(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(hK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});hK.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 XP=hK;function $0(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($0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});$0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};$0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};$0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};$0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};$0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};$0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};$0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var KP=$0;var $P={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};$P.getBranchingFactor=function(e){switch(e){case $P.OCTREE:return 8;case $P.QUADTREE:return 4}};Object.freeze($P);var Xs=$P;function $a(){}Object.defineProperties($a.prototype,{class:{get:function(){pe.throwInstantiationError()}}});$a.prototype.hasProperty=function(e){pe.throwInstantiationError()};$a.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};$a.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};$a.prototype.getProperty=function(e){pe.throwInstantiationError()};$a.prototype.setProperty=function(e,t){pe.throwInstantiationError()};$a.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};$a.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};$a.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))};$a.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};$a.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};$a.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)};$a.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};$a.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return $a.getProperty(r.id,t,n)};$a.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?$a.setProperty(o.id,t,n,i):!1};var Xn=$a;function J0(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(J0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});J0.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};J0.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};J0.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};J0.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};J0.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};J0.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};J0.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var ak=J0;var un={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Yc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};un.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Yc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Yc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Yc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Yc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Yc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Yc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Yc.INTEGER,downcastFunction:e=>un.clampToLimits(e,un.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Yc.UNSIGNED_INTEGER,downcastFunction:e=>un.clampToLimits(e,un.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Yc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Yc.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!==Yc.FLOAT};un.isUnsignedIntegerType=function(e){return un.typeInfo[e].category===Yc.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 Ft=un;var eo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};eo.isVectorType=function(e){switch(e){case eo.VEC2:case eo.VEC3:case eo.VEC4:return!0;default:return!1}};eo.isMatrixType=function(e){switch(e){case eo.MAT2:case eo.MAT3:case eo.MAT4:return!0;default:return!1}};eo.getComponentCount=function(e){switch(e){case eo.SCALAR:case eo.STRING:case eo.ENUM:case eo.BOOLEAN:return 1;case eo.VEC2:return 2;case eo.VEC3:return 3;case eo.VEC4:return 4;case eo.MAT2:return 4;case eo.MAT3:return 9;case eo.MAT4:return 16}};eo.getMathType=function(e){switch(e){case eo.VEC2:return U;case eo.VEC3:return h;case eo.VEC4:return se;case eo.MAT2:return $i;case eo.MAT3:return $;case eo.MAT4:return M;default:return}};Object.freeze(eo);var bt=eo;function Yo(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)&&Ft.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)}Yo.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=rWe(n),r=oWe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new Yo({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(Yo.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 rWe(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(Ft[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function oWe(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(Ft[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Ft[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}Yo.prototype.normalize=function(e){return this._normalized?mK(e,this._valueType,Ft.normalize):e};Yo.prototype.unnormalize=function(e){return this._normalized?mK(e,this._valueType,Ft.unnormalize):e};Yo.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Yo.valueTransformInPlace(e,this._offset,this._scale,Ft.applyValueTransform)};Yo.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Yo.valueTransformInPlace(e,this._offset,this._scale,Ft.unapplyValueTransform)};Yo.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)};Yo.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Yhe(e,t))return e};function JP(e){return Array.isArray(e)&&!(e instanceof $i)&&!(e instanceof $)&&!(e instanceof M)}function Yhe(e,t){if(!JP(e))return e===t;if(!JP(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Yhe(e[n],t[n]))return!1;return!0}Yo.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};Yo.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};Yo.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?sWe(this,e):Xhe(this,e)};function sWe(e,t){if(!JP(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=Xhe(e,t[i]);if(l(r))return r}}function Xhe(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?aWe(t,n,i):bt.isMatrixType(n)?cWe(t,n,i):n===bt.STRING?lWe(t):n===bt.BOOLEAN?uWe(t):n===bt.ENUM?fWe(t,r):dWe(t,i,o)}function aWe(e,t,n){if(!Ft.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 cWe(e,t,n){if(!Ft.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 lWe(e){if(typeof e!="string")return ck(e,bt.STRING)}function uWe(e){if(typeof e!="boolean")return ck(e,bt.BOOLEAN)}function fWe(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 dWe(e,t,n){let i=typeof e;switch(t){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return i!=="number"?ck(e,t):isFinite(e)?Whe(e,t,n):qhe(e,t);case Ft.INT64:case Ft.UINT64:return i!=="number"&&i!=="bigint"?ck(e,t):i==="number"&&!isFinite(e)?qhe(e,t):Whe(e,t,n)}}function ck(e,t){return`value ${e} does not match type ${t}`}function Ghe(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Whe(e,t,n){if(n){let i=Ft.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Ghe(e,t,n):void 0}if(e<Ft.getMinimum(t)||e>Ft.getMaximum(t))return Ghe(e,t,n)}function qhe(e,t){return`value ${e} of type ${t} must be finite`}function mK(e,t,n){if(!JP(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=mK(e[i],t,n);return e}Yo.valueTransformInPlace=function(e,t,n,i){if(!JP(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=Yo.valueTransformInPlace(e[r],t[r],n[r],i);return e};Yo.prototype.cpuBytesPerElement=function(){return Khe(this,this.valueType)};Yo.prototype.gpuBytesPerElement=function(){let e=Ft.gpuComponentType(this.valueType);return Khe(this,e)};function Khe(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Ft.getSizeInBytes(t);return i*r*o}Yo.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var pK=[void 0,"float","vec2","vec3","vec4"],$he=[void 0,"int","ivec2","ivec3","ivec4"],hWe=[void 0,"uint","uvec2","uvec3","uvec4"],mWe={[Yc.FLOAT]:"uintBitsToFloat",[Yc.INTEGER]:"int",[Yc.UNSIGNED_INTEGER]:""};Yo.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?pK[e]:$he[e]};Yo.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Ft.isIntegerType(e)||this.normalized?pK[t]:Ft.isUnsignedIntegerType(e)?hWe[t]:$he[t]};Yo.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Ft.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=`${pK[s]} ${f} = ${e};`;i.push(y);let A=mWe[Ft.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=Ft.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};Yo.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Z0=Yo;function ZP(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;_=Ft[_]??Ft.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new gK(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;_=Ft[_]??Ft.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new gK(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Ft.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 gK(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=Jhe(v),S=Jhe(S);let R,O,L=this;f?R=function(_){return _We(_,L._values,L._stringOffsets)}:d?(R=function(_){return yWe(_,L._values)},O=function(_,C){AWe(_,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(ZP.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}}});ZP.prototype.get=function(e){let t=pWe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=wWe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};ZP.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=IWe(this,t),t=n.unnormalize(t),gWe(this,e,t)};ZP.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Jhe(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)?ti(t,i):t.push(i)}return t}function pWe(e,t){Qhe(e)&&eme(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):Zhe(e,n,t)}function Zhe(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 gWe(e,t,n){vWe(e,t,n)&&eme(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 _We(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return uf(t.typedArray,i,r)}function yWe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function AWe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function bWe(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 xWe(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 TWe(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 EWe(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 CWe(e){switch(e){case Ft.INT8:return Y.BYTE;case Ft.UINT8:return Y.UNSIGNED_BYTE;case Ft.INT16:return Y.SHORT;case Ft.UINT16:return Y.UNSIGNED_SHORT;case Ft.INT32:return Y.INT;case Ft.UINT32:return Y.UNSIGNED_INT;case Ft.FLOAT32:return Y.FLOAT;case Ft.FLOAT64:return Y.DOUBLE}}function Qhe(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Ft.INT64&&!dn.supportsBigInt64Array()||i===Ft.UINT64&&!dn.supportsBigUint64Array()}function vWe(e,t,n){if(Qhe(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 eme(e){e._unpackedValues=SWe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function SWe(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]=Zhe(e,i,a);return n}function wWe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Z0.valueTransformInPlace(t,e._offset,e._scale,Ft.applyValueTransform)}function IWe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Z0.valueTransformInPlace(t,e._offset,e._scale,Ft.unapplyValueTransform)}function gK(e,t,n){let i=this,r,o,s;if(t===Ft.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 xWe(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 bWe(a,i)});else if(t===Ft.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 EWe(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 TWe(a,i)});else{let a=CWe(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 lk=ZP;function vh(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 lk({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(vh.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}}});vh.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};vh.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};vh.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};vh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=PWe(this._class,t),i};vh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};vh.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)};vh.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};vh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};vh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function PWe(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 Sh=vh;var _K=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(),le(this)}},ar=_K;var tme={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(tme);var Ct=tme;var uk=class extends ar{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=DWe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function DWe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await uk._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 EC=uk;function RWe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var Wb=RWe;var Ibn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9F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hkaqci2gxal2hmarc;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 iy=(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:meaapmbzeHdOiAlCvXoQrLpxssssssss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ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;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 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 Rbn=(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;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg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Jbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1: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:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxf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AIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a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jjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU: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:lJbbb9p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rxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC: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 Mbn=(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: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 Lbn=(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:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfyd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kcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN: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 yK=class extends ar{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=Wb(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=OWe(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 OWe(e){try{let t=MWe(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);iy.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 MWe(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 QP=yK;var qb=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Jn("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])}};qb._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);qb._decoderTaskProcessor=void 0;qb._taskProcessorReady=!1;qb._error=void 0;var ry=qb;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 NWe(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=NWe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Rn);var ct=Rn;var AK=class extends ar{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=LWe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._dracoError)&&nme(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=BWe(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=ry.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=FWe(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 LWe(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;nme(e,n)}}function nme(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load Draco",t)}async function FWe(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 Yb={};Yb[ct.POSITION]="POSITION";Yb[ct.NORMAL]="NORMAL";Yb[ct.COLOR]="COLOR";Yb[ct.TEXCOORD]="TEX_COORD";function BWe(e){for(let t in Yb)if(Yb.hasOwnProperty(t)&&e.startsWith(t))return Yb[t]}var eD=AK;function kWe(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 oy=kWe;var tD=class extends ar{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=UWe(this),this._promise):(this._promise=zWe(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 ime(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 UWe(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 jWe(i);if(e.isDestroyed())return;let o=ime(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(n){return e.isDestroyed()?void 0:rme(e,n,"Failed to load embedded image")}}async function zWe(e){e._state=Ct.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await GWe(i);if(e.isDestroyed())return;let o=ime(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(r){return e.isDestroyed()?void 0:rme(e,r,`Failed to load image: ${n}`)}}function rme(e,t,n){return e.unload(),e._state=Ct.FAILED,Promise.reject(e.getError(n,t))}function VWe(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 jWe(e){let t=VWe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return of(n)}return tD._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var HWe=/(^data:image\/ktx2)|(\.ktx2$)/i;function GWe(e){let t=e.getUrlComponent(!1,!0);return HWe.test(t)?of(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}tD._loadImageFromTypedArray=oy;var nD=tD;var ome={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(ome);var Xc=ome;var bK=class extends ar{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=qWe(this),this._promise):(this._promise=YWe(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){TK(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=WWe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Xc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=sme(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}},xK=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=sme(this.typedArray,this.indexDatatype,this.context)}};function sme(e,t,n){let i=nt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var WWe=new xK;async function qWe(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;TK(e,n)}}async function YWe(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=XWe(e,a),e._state=Ct.PROCESSING,e}catch(s){if(e.isDestroyed())return;TK(e,s)}}function XWe(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 TK(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load index buffer",t)}var iD=bK;function KWe(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 Da=KWe;function $We(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Xo=$We;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 Xo(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 Xo(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 Xo(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 Ue=rn;function JWe(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 sd=JWe;function ZWe(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)*sd(t.type)}var hf=ZWe;function QWe(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=Da(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=hf(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)&&Xb(c)}),Xb(n.emissiveTexture),Xb(n.normalTexture),Xb(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,Xb(s.baseColorTexture),Xb(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,Xb(a.specularGlossinessTexture))}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=eqe(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 eqe(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 Xb(e){l(e)&&(e.texCoord=e.texCoord??0)}var fk=QWe;function tqe(e){return Ue.shader(e,function(t){dk(t)}),Ue.buffer(e,function(t){dk(t)}),Ue.image(e,function(t){dk(t)}),dk(e),e}function dk(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Kb=tqe;function nqe(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 hk=nqe;function iqe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),hk(e,t),n.length===0&&delete e.extensionsUsed}}var CC=iqe;var rqe=4;function oqe(e){if(ap(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=ame(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?sqe(e,n):aqe(e,n)}function ame(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*rqe,!0);return r}function sqe(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=uf(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 CC(c,"KHR_binary_glTF"),c}function aqe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=ame(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=uf(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 vC=oqe;function cqe(e){return Ue.shader(e,function(t){mk(t)}),Ue.buffer(e,function(t){mk(t)}),Ue.image(e,function(t){mk(t)}),mk(e),e}function mk(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var pk=cqe;function lqe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Da(n,t,!0)}var wh=lqe;function uqe(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 sy=uqe;function fqe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=sd(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=hf(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=sy(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 SC=fqe;var dqe=[te.FUNC_ADD,te.FUNC_ADD],hqe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function cme(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var mqe=[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 pqe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(mqe.indexOf(e[n])===-1)return t;return e}function gqe(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(cme(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??dqe,blendFactors:pqe(c.blendFuncSeparate,hqe)})}cme(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),wh(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 gk=gqe;function _qe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Da(n,t,!0),wh(e,t)}var _k=_qe;function yqe(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=Da(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Da(o.shaders,m,!0),u.program=Da(o.programs,p),r[a.program]=u.program}i[c]=Da(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,wh(e,"KHR_techniques_webgl"),_k(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 yk=yqe;function Aqe(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 rD=Aqe;var lme=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function bqe(e,t){return t=t??lme,lme.forEach(function(n){t.indexOf(n)>-1&&Tqe(e,n)}),e}var xqe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Tqe(e,t){let n=xqe[t],i=e[n];if(l(i)){let r=0,o=up[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(lp[t](e,a-r),r++)}}function lp(){}lp.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--})})};lp.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--}})};lp.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--}),Xo(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--})}),Xo(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(Xo(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--}}}}};lp.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})};lp.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)})};lp.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})})};lp.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--})})};lp.sampler=function(e,t){e.samplers.splice(t,1),Ue.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};lp.texture=function(e,t){if(e.textures.splice(t,1),Ue.material(e,function(i){rD(i,function(r,o){o.index>t&&--o.index})}),Xo(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(Xo(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}}}})}),Xo(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 up(){}up.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)})}),Xo(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})}),Xo(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};up.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};up.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)}),Xo(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)})}),Xo(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(Xo(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};up.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};up.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 ume(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!ume(e,r,n)}).length===0}up.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){ume(e,i,t)||(t[i]=!0)}),t};up.material=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};up.texture=function(e){let t={};if(Ue.material(e,function(n){rD(n,function(i){t[i]=!0})}),Xo(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(Xo(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)}}}})}),Xo(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};up.sampler=function(e){let t={};return Ue.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var Ak=bqe;function Eqe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:Da(e.buffers,n),byteOffset:0,byteLength:t.length};return Da(e.bufferViews,r)}var bk=Eqe;function Cqe(e,t){let n=hf(e,t),i=Y.getSizeInBytes(t.componentType),r=sd(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=sy(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 xk=Cqe;function vqe(e){let t;return Ue.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?Tk(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&Tk(e,i,Y.UNSIGNED_SHORT)}),Ue.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?Tk(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&Tk(e,i,Y.UNSIGNED_SHORT)}),e}function Tk(e,t,n){let i=Y.createTypedArray(n,xk(e,t)),r=new Uint8Array(i.buffer);t.bufferView=bk(e,r),t.componentType=n,t.byteOffset=0}var Ek=vqe;function Sqe(e,t){return CC(e,t),t==="CESIUM_RTC"&&wqe(e),EK(e,t)}function wqe(e){Ue.technique(e,function(t){Ue.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function EK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)EK(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)&&EK(e[r],t);return i}}var wC=Sqe;var Ck={.8:Mqe,"1.0":eYe,"2.0":void 0};function Iqe(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(Ck,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(Ck,i)||(i="1.0"));let r=Ck[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=Ck[i];return t.keepLegacyExtensions||(iYe(e,t),rYe(e)),e}function hme(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 Pqe(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 Dqe(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 Rqe(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=sd(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 Oqe(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 Mqe(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,hme(e),Pqe(e),Dqe(e),Rqe(e),Oqe(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,wh(e,"KHR_materials_common")}}function Nqe(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 fme(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 Lqe(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]=fme(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=Da(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=fme(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 Fqe(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){delete n.name})})}function Bqe(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 kqe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var Uqe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function zqe(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(Uqe[r])&&e.extensionsRequired.push(r)}}}function Vqe(e){Ue.buffer(e,function(t){delete t.type})}function jqe(e){Ue.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Hqe(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 Gqe={POSITION:!0,NORMAL:!0,TANGENT:!0},Wqe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function qqe(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=Wqe[a];l(f)?(u=f+c,t[o]=u):l(Gqe[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 Yqe(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 vK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:hf(e,t)}function Xqe(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=vK(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function Kqe(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=vK(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?vK(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=Da(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}}}Ak(e,["accessor","bufferView","buffer"])}function $qe(e){Ue.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=SC(e,n);n.min=i.min,n.max=i.max}})}function mme(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 pme(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),mme(n)&&pme(e,i))}}),delete e.nodes[t]}function Jqe(e){return Ue.node(e,function(t,n){mme(t)&&pme(e,n)}),e}function Zqe(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=SC(e,i);i.min=r.min,i.max=r.max}})})}function Qqe(e){Ue.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=SC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function eYe(e){e.asset=e.asset??{},e.asset.version="2.0",hme(e),Nqe(e),Jqe(e),Lqe(e),Fqe(e),kqe(e),zqe(e),Xqe(e),Kqe(e),$qe(e),Zqe(e),Qqe(e),Vqe(e),jqe(e),Hqe(e),qqe(e),Ek(e),Yqe(e),gk(e),yk(e),Bqe(e)}var tYe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],nYe=["u_diffuse","u_diffuse_mat"];function SK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function wK(e){return l(e.index)}function IK(e){return Array.isArray(e)&&e.length===4}function gme(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 iYe(e,t){t=t??{};let n=t.baseColorTextureNames??tYe,i=t.baseColorFactorNames??nYe;Ue.material(e,function(r){Ue.materialValue(r,function(o,s){n.indexOf(s)!==-1&&wK(o)?(SK(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&IK(o)&&(SK(r),r.pbrMetallicRoughness.baseColorFactor=gme(o))})}),wC(e,"KHR_techniques_webgl"),wC(e,"KHR_blend")}function CK(e,t){l(t)&&(IK(t)?e.pbrMetallicRoughness.baseColorFactor=gme(t):wK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function dme(e,t){l(t)&&(IK(t)?e.emissiveFactor=t.slice(0,3):wK(t)&&(e.emissiveTexture=t))}function rYe(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;SK(t),n.technique==="CONSTANT"?(wh(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},CK(t,s),CK(t,r)):(CK(t,o),dme(t,r),dme(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")}),wC(e,"KHR_materials_common")}var vk=Iqe;function Kc(){}Kc.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};el.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)};el.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}};el.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}};el.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}};el.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};el.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 qYe=new h,YYe=new h;el.getPositionMinMax=function(e,t,n){let i=el.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,YYe),r=h.add(r,n,qYe)),{min:o,max:r}};el.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===Gi.Y?n=M.clone(Gi.Y_UP_TO_Z_UP,n):e===Gi.X&&(n=M.clone(Gi.X_UP_TO_Z_UP,n)),t===Gi.Z&&(n=M.multiplyTransformation(n,Gi.Z_UP_TO_X_UP,n)),n};var XYe=new $;el.getCullFace=function(e,t){if(!Oe.isTriangles(t))return ji.BACK;let n=M.getMatrix3(e,XYe);return $.determinant(n)<0?ji.FRONT:ji.BACK};el.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};el.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};el.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!el.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=el;var d$=class extends rr{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=tpe(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=npe(this,this._typedArray),this._promise):(this._promise=KYe(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 KYe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;h$(e,n)}return npe(e,t)}function h$(e,t){e.unload(),e._state=Ct.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function $Ye(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Yo(t,"KHR_techniques_webgl")&&!Yo(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),zk(t)}function JYe(e){let t=[];return Ue.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&zm(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function ZYe(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 tpe(e,t){try{Yb(t),await JYe(t),await $Ye(e,t),Sk(t),await ZYe(e,t),Dk(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;h$(e,n)}}async function npe(e,t){let n;try{np(t)==="glTF"?n=gC(t):n=Lo(t)}catch(i){if(e.isDestroyed())return;h$(e,i)}return tpe(e,n)}var iD=d$;var Cr={},m$=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}},p$=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}},g$=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},_$=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}},y$=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}},A$=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}},b$=class{constructor(){this.attributes=[]}},x$=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}},T$=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},E$=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},C$=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}},v$=class{constructor(){this.nodes=[]}},QYe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},S$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},w$=class{constructor(){this.node=void 0,this.path=void 0}},I$=class{constructor(){this.sampler=void 0,this.target=void 0}},P$=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},D$=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},R$=class{constructor(){this.name=void 0,this.stages=[]}},Vk=class{constructor(){this.credits=[]}},O$=class{constructor(){this.asset=new Vk,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={}}},M$=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}},ly=class ly{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(ly.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=ly.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=ly.DEFAULT_ROUGHNESS_FACTOR}};ut(ly,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(ly,"DEFAULT_METALLIC_FACTOR",1),ut(ly,"DEFAULT_ROUGHNESS_FACTOR",1);var jk=ly,uy=class uy{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(uy.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(uy.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=uy.DEFAULT_GLOSSINESS_FACTOR}};ut(uy,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(uy,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(uy,"DEFAULT_GLOSSINESS_FACTOR",1);var N$=uy,AC=class AC{constructor(){this.specularFactor=AC.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(AC.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(AC,"DEFAULT_SPECULAR_FACTOR",1),ut(AC,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var L$=AC,bC=class bC{constructor(){this.anisotropyStrength=bC.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=bC.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(bC,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(bC,"DEFAULT_ANISOTROPY_ROTATION",0);var F$=bC,xC=class xC{constructor(){this.clearcoatFactor=xC.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=xC.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(xC,"DEFAULT_CLEARCOAT_FACTOR",0),ut(xC,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var B$=xC,k$=class{constructor(){ut(this,"width");ut(this,"pattern")}},Hk=class Hk{constructor(t={}){let{wireframeFill:n=Hk.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(Hk,"DEFAULT_WIREFRAME_FILL",0);var U$=Hk,Gk=class Gk{constructor(){this.metallicRoughness=new jk,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(Gk.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=P0.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(Gk,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var z$=Gk,V$=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},j$=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Cr.Quantization=m$;Cr.Attribute=p$;Cr.Indices=g$;Cr.FeatureIdAttribute=_$;Cr.FeatureIdTexture=A$;Cr.FeatureIdImplicitRange=y$;Cr.MorphTarget=b$;Cr.Primitive=x$;Cr.Instances=T$;Cr.Skin=E$;Cr.Node=C$;Cr.Scene=v$;Cr.AnimatedPropertyType=Object.freeze(QYe);Cr.AnimationSampler=S$;Cr.AnimationTarget=w$;Cr.AnimationChannel=I$;Cr.Animation=P$;Cr.ArticulationStage=D$;Cr.Articulation=R$;Cr.Asset=Vk;Cr.Components=O$;Cr.TextureReader=M$;Cr.MetallicRoughness=jk;Cr.SpecularGlossiness=N$;Cr.Specular=L$;Cr.Anisotropy=F$;Cr.Clearcoat=B$;Cr.PlanarFill=U$;Cr.LineStyle=k$;Cr.Material=z$;Cr.Vector=j$;Cr.Polygon=V$;var En=Cr;var Wk={};Wk.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};Wk.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=$n.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),$n.validate(a)||(a=$n.LINEAR),new Ht({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var eXe=new U(1,1);Wk.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):eXe;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 pf=Wk;var H$=class extends rr{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=pf.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=nXe(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=tXe;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Qc.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=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}},G$=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;$e.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=pf.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=Mb(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var tXe=new G$;async function nXe(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 rD=H$;var W$=class extends rr{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=oXe(this),this._promise):iXe(this._draco,this._attributeSemantic)?(this._promise=lXe(this),this._promise):(this._promise=fXe(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){qk(this,r)}uXe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){qk(this,r)}cXe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=dXe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Qc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=rpe(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 iXe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function rXe(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 oXe(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 sXe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function aXe(e){let t=sXe(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 cXe(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}=aXe(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 lXe(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;qk(e)}}function uXe(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=rXe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function fXe(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;qk(e,n)}}function qk(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load vertex buffer",t)}var q$=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=rpe(this.typedArray,this.context)}};function rpe(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var dXe=new q$,oD=W$;async function hXe(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(()=>yXe);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=hb.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 yi(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]},Ai=(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:yi,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=NI.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=db(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}) { +${r.stack}`),r};Kc.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)};Kc.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}};Kc.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}};Kc.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}};Kc.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};Kc.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 oYe=new h,sYe=new h;Kc.getPositionMinMax=function(e,t,n){let i=Kc.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,sYe),r=h.add(r,n,oYe)),{min:o,max:r}};Kc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===qi.Y?n=M.clone(qi.Y_UP_TO_Z_UP,n):e===qi.X&&(n=M.clone(qi.X_UP_TO_Z_UP,n)),t===qi.Z&&(n=M.multiplyTransformation(n,qi.Z_UP_TO_X_UP,n)),n};var aYe=new $;Kc.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Gi.BACK;let n=M.getMatrix3(e,aYe);return $.determinant(n)<0?Gi.FRONT:Gi.BACK};Kc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Kc.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};Kc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Kc.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=Kc;var PK=class extends ar{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=_me(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=yme(this,this._typedArray),this._promise):(this._promise=cYe(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 cYe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;DK(e,n)}return yme(e,t)}function DK(e,t){e.unload(),e._state=Ct.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function lYe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Xo(t,"KHR_techniques_webgl")&&!Xo(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),vk(t)}function uYe(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 fYe(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 _me(e,t){try{Kb(t),await uYe(t),await lYe(e,t),fk(t),await fYe(e,t),pk(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;DK(e,n)}}async function yme(e,t){let n;try{ap(t)==="glTF"?n=vC(t):n=No(t)}catch(i){if(e.isDestroyed())return;DK(e,i)}return _me(e,n)}var oD=PK;var Ame={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(Ame);var Q0=Ame;var Sr={},RK=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}},OK=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}},NK=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}},LK=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}},FK=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}},BK=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}},UK=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},zK=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},VK=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}},jK=class{constructor(){this.nodes=[]}},dYe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},HK=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},GK=class{constructor(){this.node=void 0,this.path=void 0}},WK=class{constructor(){this.sampler=void 0,this.target=void 0}},qK=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},YK=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},XK=class{constructor(){this.name=void 0,this.stages=[]}},Sk=class{constructor(){this.credits=[]}},KK=class{constructor(){this.asset=new Sk,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={}}},$K=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}},ay=class ay{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(ay.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=ay.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=ay.DEFAULT_ROUGHNESS_FACTOR}};ut(ay,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(ay,"DEFAULT_METALLIC_FACTOR",1),ut(ay,"DEFAULT_ROUGHNESS_FACTOR",1);var wk=ay,cy=class cy{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(cy.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(cy.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=cy.DEFAULT_GLOSSINESS_FACTOR}};ut(cy,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(cy,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(cy,"DEFAULT_GLOSSINESS_FACTOR",1);var JK=cy,IC=class IC{constructor(){this.specularFactor=IC.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(IC.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(IC,"DEFAULT_SPECULAR_FACTOR",1),ut(IC,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var ZK=IC,PC=class PC{constructor(){this.anisotropyStrength=PC.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=PC.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(PC,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(PC,"DEFAULT_ANISOTROPY_ROTATION",0);var QK=PC,DC=class DC{constructor(){this.clearcoatFactor=DC.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=DC.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(DC,"DEFAULT_CLEARCOAT_FACTOR",0),ut(DC,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var e$=DC,t$=class{constructor(){ut(this,"width");ut(this,"pattern")}},Ik=class Ik{constructor(t={}){let{wireframeFill:n=Ik.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(Ik,"DEFAULT_WIREFRAME_FILL",0);var n$=Ik,Pk=class Pk{constructor(){this.metallicRoughness=new wk,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(Pk.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(Pk,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var i$=Pk,r$=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},o$=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Sr.Quantization=RK;Sr.Attribute=OK;Sr.Indices=MK;Sr.FeatureIdAttribute=NK;Sr.FeatureIdTexture=FK;Sr.FeatureIdImplicitRange=LK;Sr.MorphTarget=BK;Sr.Primitive=kK;Sr.Instances=UK;Sr.Skin=zK;Sr.Node=VK;Sr.Scene=jK;Sr.AnimatedPropertyType=Object.freeze(dYe);Sr.AnimationSampler=HK;Sr.AnimationTarget=GK;Sr.AnimationChannel=WK;Sr.Animation=qK;Sr.ArticulationStage=YK;Sr.Articulation=XK;Sr.Asset=Sk;Sr.Components=KK;Sr.TextureReader=$K;Sr.MetallicRoughness=wk;Sr.SpecularGlossiness=JK;Sr.Specular=ZK;Sr.Anisotropy=QK;Sr.Clearcoat=e$;Sr.PlanarFill=n$;Sr.LineStyle=t$;Sr.Material=i$;Sr.Vector=o$;Sr.Polygon=r$;var vn=Sr;var Dk={};Dk.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};Dk.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=Zn.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),Zn.validate(a)||(a=Zn.LINEAR),new Gt({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var hYe=new U(1,1);Dk.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):hYe;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 vn.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 mf=Dk;function mYe(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 $b=mYe;var s$=class extends ar{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=mf.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=gYe(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=pYe;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Xc.TEXTURE))return!1;n=i.texture}else n=bme(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}},a$=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=bme(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function bme(e,t,n,i,r,o){let s=i.internalFormat,a=!1;$e.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=mf.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=$b(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var pYe=new a$;async function gYe(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 sD=s$;var c$=class extends ar{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=AYe(this),this._promise):_Ye(this._draco,this._attributeSemantic)?(this._promise=EYe(this),this._promise):(this._promise=vYe(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){Rk(this,r)}CYe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){Rk(this,r)}TYe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=SYe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Xc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=xme(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 _Ye(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function yYe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new vn.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 AYe(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 bYe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function xYe(e){let t=bYe(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 TYe(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}=xYe(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 EYe(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;Rk(e)}}function CYe(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=yYe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function vYe(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;Rk(e,n)}}function Rk(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load vertex buffer",t)}var l$=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=xme(this.typedArray,this.context)}};function xme(e,t){let n=nt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var SYe=new l$,aD=c$;async function wYe(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(()=>OYe);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=hb.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 yi(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]},Ai=(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:yi,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=NI.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=db(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}); @@ -5160,7 +4465,46 @@ OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEv \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,x_.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 TC=(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},mXe=e=>1/(1+Math.exp(-e)),pXe=e=>t=>t*e+.5,gXe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:TC(e,t.positions),scales:TC(e,t.scales,Math.exp),rotations:TC(e,t.rotations),alphas:TC(e,t.alphas,mXe),colors:TC(e,t.colors,pXe(i)),sh:TC(e,t.sh)}},_Xe=(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))},ope=async(e,t)=>{var n;let i=await hXe(),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=gXe(i,a,t);return _Xe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var yXe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var AXe=[0,9,24,45],bXe=14,xXe=1.6*1024*1024*1024;function TXe(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 EXe(e,t){let n=bXe+(AXe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var Y$=class extends rr{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=CXe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._spzError)&&X$(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=TXe(this._gltf,this._primitive);if(l(n)){let r=EXe(n.numPoints,n.shDegree);if(r>xXe){let o=Math.round(r/1048576);return X$(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=ope(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=vXe(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 CXe(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;X$(e,n)}}function X$(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load SPZ",t)}async function vXe(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 Yk=Y$;function sD(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)}sD.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=tg.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new sD({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(sD.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}}});sD.BATCH_TABLE_CLASS_NAME="_batchTable";var op=sD;function Xk(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)}Xk.fromJson=function(e){return new Xk({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Xk.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 Kk=Xk;function $k(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)}$k.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return Kk.fromJson(r)});return new $k({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties($k.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 Jk=$k;function Zk(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)}Zk.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=Jk.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]=op.fromJson({id:i,class:e.classes[i],enums:t}));return new Zk({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Zk.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 Au=Zk;var K$=class extends rr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Au.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=SXe(this),this._promise)}unload(){this._schema=void 0}};async function SXe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Au.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 Xb=K$;var dd={};function EC(e){return dh(e.url)}function aD(e){let{byteOffset:t,byteLength:n}=e,i=Hb(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function wXe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function spe(e,t){return`${EC(e)}-buffer-id-${t}`}function CC(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return EC(r)}return spe(n,t)}function $$(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=CC(a,s,n,i),u=aD(o);return`${c}-range-${u}`}function ape(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=CC(a,s,n,i),u=aD(o);return`${c}-range-${u}`}function cpe(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 EC(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=CC(u,c,n,i),d=aD(a);return`${f}-range-${d}`}function IXe(e,t){let n=pf.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}dd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${EC(n)}`};dd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${EC(t)}`};dd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${spe(t,n)}`};dd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${EC(t)}`};dd.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=Hb(o);l(c)&&(s=c.buffer);let u=CC(a,s,i,r),f=aD(o);return`buffer-view:${u}-range-${f}`};dd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${$$(t,n,i,r)}`};dd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${ape(t,n,i,r)}`};dd.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:${ape(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${$$(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=CC(y,m,n,i),b=aD(g);return`vertex-buffer:${A}-range-${b}${p}`};dd.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:${$$(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=CC(m,g,i,r),A=wXe(f,p);return`index-buffer:${y}-accessor-${A}${u}`};dd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${cpe(t,n,i,r)}`};dd.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=pf.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=cpe(t,c,i,r),f=IXe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var bu=dd;function cD(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}cD.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};cD.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};cD.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};cD.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 Qk=cD;function Mn(){}Mn.cacheEntries={};Mn.statistics=new Qk;function PXe(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 PXe(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=bu.getSchemaCacheKey({schema:t,resource:n}),r=Mn.get(i);return l(r)?r:(r=new Xb({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=bu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Mn.get(r);return l(o)?o:(o=new QE({typedArray:i,cacheKey:r}),Mn.add(o))};Mn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=bu.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return l(i)?i:(i=new QE({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=bu.getGltfCacheKey({gltfResource:t}),s=Mn.get(o);return l(s)?s:(s=new iD({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=bu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Mn.get(o);return l(s)?s:(s=new JP({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=bu.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Mn.get(s);return l(a)?a:(a=new ZP({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=bu.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Mn.get(s);return l(a)?a:(a=new Yk({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=bu.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 oD({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=bu.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 tD({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=bu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Mn.get(o);return l(s)?s:(s=new eD({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=bu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Mn.get(c);return l(u)?u:(u=new rD({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[oD,tD,ZP,rD,eD,JP,QE,Xb,iD],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 ki=Mn;function Qa(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(Qa.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}}});Qa.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Qa.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Qa.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Qa.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Qa.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Qa.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Qa.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Qa.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Ys.OCTREE&&(t=3),e>>t};Qa.fromSubtreeJson=async function(e,t,n,i,r){let o=new Qa(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=DXe(n);let a=s.json;o._subtreeJson=a;let c;if(ar(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 Ek({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ar(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=RXe(a.buffers),y=OXe(a.bufferViews,m);MXe(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 NXe(o,m,s.binary),b=FXe(y,A);return BXe(o,a,i,b),l(c)&&(kXe(o,i,b),zXe(o)),UXe(o,i,b),VXe(o),o._ready=!0,o};function DXe(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 RXe(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 OXe(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 MXe(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 NXe(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=LXe(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 LXe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=ki.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function FXe(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 BXe(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=ar(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=J$(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=J$(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=J$(t.childSubtreeAvailability,i,a)}function J$(e,t,n,i){if(l(e.constant))return new qP({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 qP({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function kXe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new Dh({class:a,count:r,properties:i.properties,bufferViews:n})}function UXe(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 Dh({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function upe(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 zXe(e){let t=upe(e._tileAvailability);e._tileJumpBuffer=t}function VXe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=upe(r);t.push(o)}}Qa.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};Qa.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 jXe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function HXe(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]}Qa.prototype.getTileMetadataView=function(e){let t=jXe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new YP({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Qa.prototype.getContentMetadataView=function(e,t){let n=HXe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new YP({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};Qa.prototype.isDestroyed=function(){return!1};Qa.prototype.destroy=function(){return l(this._bufferLoader)&&ki.unload(this._bufferLoader),le(this)};var fy=Qa;var fpe={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(fpe);var Oh=fpe;var vC=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 fy.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,GXe(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(),le(this)}};function GXe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=qXe(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=WXe(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=tKe(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function WXe(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 qXe(e,t,n,i){let s=dpe(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=dpe(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function hpe(e,t,n){let i=Oh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function dpe(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=Pb.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=KXe(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=Pb.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=$Xe(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=hpe(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=Ot(A,x,b),E=ype(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function e3(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ar(e,"3DTILES_bounding_volume_S2")||l(e.region))}function Q$(e,t){l(t)&&(ar(e,"3DTILES_bounding_volume_S2")?XXe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&YXe(e.region,t.minimumHeight,t.maximumHeight))}function YXe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function XXe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function KXe(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!e3(o.boundingVolume,o)&&e3(e.boundingVolume,o)?s=mpe(e,t,n,i??!1,r):s=o.boundingVolume,Q$(s,o),s}function $Xe(e,t){let n;return l(t)&&(n=t.boundingVolume),e3(n,t)?Q$(n,t):e3(e,t)&&(n=Ze(e,!0),Q$(n,t)),n}function mpe(e,t,n,i,r){let o=e.boundingVolume;return ar(o,"3DTILES_bounding_volume_S2")?ppe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:_pe(o.region,t.level,t.x,t.y,t.z)}:{box:gpe(o.box,t.level,t.x,t.y,t.z)}}function ppe(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:ry.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?WP.encode2D(i,r,o):WP.encode2D(i,o,r),f=ry.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:ry.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var JXe=new h,ZXe=new h,Z$=new h,QXe=new $;function gpe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,ZXe),s=$.unpack(e,3,QXe),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,JXe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,Z$);p=$.multiplyByVector(s,p,Z$),p=h.add(p,o,Z$);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 eKe=new ie;function _pe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,eKe),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 tKe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=mpe(i,r,n,!1,t),s=hpe(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=ype(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function ype(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}vC._deriveBoundingBox=gpe;vC._deriveBoundingRegion=_pe;vC._deriveBoundingVolumeS2=ppe;var lD=vC;var Ape={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Ape);var gf=Ape;var bpe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(bpe);var fn=bpe;function nKe(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=nKe;var xpe={NONE:0,TOP:1,ALL:2};Object.freeze(xpe);var _n=xpe;var Tpe=new h,Epe=new h,Cpe=new h;function iKe(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,Tpe),s=h.subtract(i,t,Epe),a=h.subtract(e,t,Cpe),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,Tpe),s=U.subtract(i,t,Epe),a=U.subtract(e,t,Cpe),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 SC=iKe;var eJ={};eJ.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)};eJ.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 t3=eJ;var Il={};function c3(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function rKe(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)c3(i,r,e[o],e[o+1],e[o+2]);return i}function oKe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);c3(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)c3(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function sKe(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)c3(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Il.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=rKe(t);break;case Oe.TRIANGLE_STRIP:e.indices=oKe(t);break;case Oe.TRIANGLE_FAN:e.indices=sKe(t);break}e.primitiveType=Oe.LINES}return e};Il.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 ue(u.center,u.radius+n)),new wt({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};Il.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};Il.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};Il.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=t3.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function vpe(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 aKe(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])}}Il.fitToUnsignedShortIndices=function(e){let t=[],n=wt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=vpe(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,aKe(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=vpe(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 Spe=new h,cKe=new he;Il.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Hi;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,Spe),p=s.cartesianToCartographic(d,cKe),g=r.project(p,Spe);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 tJ={high:0,low:0};Il.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],tJ),a[f]=tJ.high,c[f]=tJ.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 Nh=new h;function nJ(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Nh),M.multiplyByPoint(e,Nh,Nh),h.pack(Nh,n,r)}}function iJ(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Nh),$.multiplyByVector(e,Nh,Nh),Nh=h.normalize(Nh,Nh),h.pack(Nh,n,r)}}var n3=new M,i3=new $;Il.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;nJ(t,n.position),nJ(t,n.prevPosition),nJ(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,n3),M.transpose(n3,n3),M.getMatrix3(n3,i3),iJ(i3,n.normal),iJ(i3,n.tangent),iJ(i3,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function lKe(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 uKe=new h;function rJ(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=lKe(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,uKe))+b.radius;x>A&&(A=x)}return new wt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}Il.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(rJ(t,"geometry")),n.length>0&&(r.push(rJ(n,"westHemisphereGeometry")),r.push(rJ(n,"eastHemisphereGeometry"))),r};var hd=new h,uD=new h,wC=new h,IC=new h;Il.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;uD.x=i[b],uD.y=i[b+1],uD.z=i[b+2],wC.x=i[x],wC.y=i[x+1],wC.z=i[x+2],IC.x=i[T],IC.y=i[T+1],IC.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(wC,uD,wC),h.subtract(IC,uD,IC),a[f]=h.cross(wC,IC,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,hd),p.count>0){for(f=0;f<p.count;f++)h.add(hd,a[c[p.indexOffset+f]],hd);h.equalsEpsilon(h.ZERO,hd,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],hd)}h.equalsEpsilon(h.ZERO,hd,P.EPSILON10)&&(hd.z=1),h.normalize(hd,hd),g[m]=hd.x,g[m+1]=hd.y,g[m+2]=hd.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var fKe=new h,wpe=new h,dKe=new h;Il.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,fKe),A=h.fromArray(c,f,dKe),b=h.dot(y,A);h.multiplyByScalar(y,b,wpe),h.normalize(h.subtract(A,wpe,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 fD=new U,Mh=new h,Ipe=new h,Ppe=new h,r3=new U;Il.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,Mh),h.equals(Mh,h.ZERO)){R+=2;continue}r3=cn.octEncodeInRange(Mh,65535,r3),I[R++]=r3.x,I[R++]=r3.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,fD),E[v++]=cn.compressTextureCoordinates(fD));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,Mh),h.fromArray(m,S,Ipe),h.fromArray(y,S,Ppe),cn.octPack(Mh,Ipe,Ppe,fD),E[v++]=fD.x,E[v++]=fD.y):(s&&(h.fromArray(p,S,Mh),E[v++]=cn.octEncodeFloat(Mh)),f&&(h.fromArray(m,S,Mh),E[v++]=cn.octEncodeFloat(Mh)),d&&(h.fromArray(y,S,Mh),E[v++]=cn.octEncodeFloat(Mh)))}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 hKe(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 mKe(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 pKe(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 gKe(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 _Ke(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 yKe(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 AKe(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return mKe(e);case Oe.TRIANGLE_STRIP:return pKe(e);case Oe.TRIANGLES:return hKe(e);case Oe.LINE_STRIP:return _Ke(e);case Oe.LINE_LOOP:return yKe(e);case Oe.LINES:return gKe(e)}return e}function dy(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function bKe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){dy(e,e.y<0),dy(t,t.y<0),dy(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;dy(e,a),dy(t,a),dy(n,a)}var Dpe=new h;function md(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Dpe),e.y/(e.y-t.y),Dpe),n),h.clone(n,i),dy(n,!0),dy(i,!1)}var Kb=new h,$b=new h,Jb=new h,Zb=new h,oJ={positions:new Array(7),indices:new Array(9)};function xKe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;bKe(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=oJ.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(md(e,t,Kb,Jb),md(e,n,$b,Zb),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(md(t,n,Kb,Jb),md(t,e,$b,Zb),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(md(n,e,Kb,Jb),md(n,t,$b,Zb),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||(md(n,e,Kb,Jb),md(n,t,$b,Zb),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(md(t,n,Kb,Jb),md(t,e,$b,Zb),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(md(e,t,Kb,Jb),md(e,n,$b,Zb),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=oJ.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Kb,c[4]=$b,c[5]=Jb,c[6]=Zb,c.length=7),oJ}function Rpe(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=ue.fromVertices(n.position.values)),e}function DC(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 lJ(e,t,n){let i=l(e.geometry.boundingSphere);t=Rpe(t,i),n=Rpe(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 uJ(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 TKe=uJ(se,4),a3=uJ(h,3),Bpe=uJ(U,2),EKe=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},dD=new h,sJ=new h,aJ=new h,CKe=new h;function o3(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,sJ),x=h.fromArray(r,n*3,aJ),T=SC(i,A,b,x,CKe);if(l(T)){if(l(o)&&a3(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,sJ),S=h.fromArray(u,n*3,aJ);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)&&EKe(e,t,n,T,f,d.applyOffset.values,y),l(s)&&a3(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&a3(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&Bpe(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];vKe(e,t,n,T,y,m[v],d[v])}}}function vKe(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:TKe(e,t,n,i,c,u,r,!1);break;case 3:a3(e,t,n,i,c,u,r,!1);break;case 2:Bpe(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 sp(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 SKe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Ope(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)&&!SKe[I]&&l(n[I])&&d.push(I);let p=d.length,g=DC(t),m=DC(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=xKe(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=sp(y,A,b,f,B<3?T+B:-1,j),o3(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=sp(y,A,b,f,T,L),o3(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=sp(y,A,b,f,T+1,_),o3(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=sp(y,A,b,f,T+2,C),o3(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}lJ(e,m,g)}var kpe=sn.fromPointNormal(h.ZERO,h.UNIT_Y),wKe=new h,IKe=new h;function PC(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,dD);h.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function Mpe(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=DC(t),a=DC(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,sJ),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=Ti.lineSegmentPlane(m,y,kpe,aJ);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,wKe);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,IKe);A=sp(b,x,T,o,c,m),PC(p,g,m,i,A,b,r),A=sp(b,x,T,o,-1,O),PC(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=sp(E,v,S,o,-1,O),PC(p,g,O,i,A,E,r),A=sp(E,v,S,o,c+1,y),PC(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=sp(R,O,L,o,c,m),PC(p,g,m,i,A,R,r),A=sp(R,O,L,o,c+1,y),PC(p,g,y,i,A,R,r)}}lJ(e,a,s)}var Npe=new U,PKe=new U,Upe=new h,zpe=new h,cJ=new h,DKe=new h,RKe=new h,OKe=new h,Lpe=new se;function Fpe(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,Upe);if(a.x>0)continue;let c=h.unpack(i,s,zpe);(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,cJ);(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 MKe=5*P.EPSILON9,s3=P.EPSILON6;function NKe(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=DC(t),f=DC(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,Upe),T=h.fromArray(i,b*3,zpe);if(Math.abs(x.y)<s3)for(x.y=s3*(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)<s3)for(T.y=s3*(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=Ti.lineSegmentPlane(x,T,kpe,DKe);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,MKe,RKe);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,OKe);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,Npe),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,cJ));if(w/=h.magnitudeSquared(h.subtract(T,x,cJ)),l(c)){let D=se.fromArray(c,A*4,Lpe),N=se.fromArray(c,b*4,Lpe),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,Npe),N=U.fromArray(a,(d+3)*2,PKe),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&&(Fpe(f),Fpe(u)),lJ(e,f,u)}Il.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==yh.NONE)switch(t.geometryType){case yh.POLYLINES:NKe(e);break;case yh.TRIANGLES:Ope(e);break;case yh.LINES:Mpe(e);break}else AKe(t),t.primitiveType===Oe.TRIANGLES?Ope(e):t.primitiveType===Oe.LINES&&Mpe(e);return e};var qn=Il;var Vpe=P.EPSILON10;function LKe(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,Vpe)?(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],Vpe)&&(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 Br=LKe;function FKe(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 Cn=FKe;function BKe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var tl=BKe;function hy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(hy.prototype,{length:{get:function(){return this._length}}});hy.prototype.enqueue=function(e){this._array.push(e),this._length++};hy.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};hy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};hy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};hy.prototype.clear=function(){this._array.length=this._offset=this._length=0};hy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Qb=hy;var Eo={};Eo.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};Eo.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};Eo.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]=Eo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var ex=new U;function Gpe(e,t,n,i){return U.subtract(t,e,ex),U.multiplyByScalar(ex,n/i,ex),U.add(e,ex,ex),[ex.x,ex.y]}var my=new h;function kKe(e,t,n,i){return h.subtract(t,e,my),h.multiplyByScalar(my,n/i,my),h.add(e,my,my),[my.x,my.y,my.z]}Eo.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 u3=new he,f3=new he,UKe=new he,zKe=new h,l3=new Yc;Eo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,u3),o=e.cartesianToCartographic(n,f3),a=new Yc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};Eo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=Eo.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=Gpe(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Eo.subdivideLine=function(e,t,n,i){let r=Eo.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=kKe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Eo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,u3),c=n.cartesianToCartographic(r,f3);l3.setEndPoints(a,c);let u=l3.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=Gpe(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};Eo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,u3),s=e.cartesianToCartographic(n,f3),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,UKe),A=e.cartographicToCartesian(y,zKe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var VKe=new h,jKe=new h,HKe=new h,GKe=new h;Eo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=VKe,s=jKe,a=HKe,c=GKe;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};Eo.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=Br(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=Br(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 WKe=new he;function qKe(e,t,n){let i=n.cartesianToCartographic(e,u3),r=n.cartesianToCartographic(t,f3);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;l3.setEndPoints(i,r);let o=l3.findIntersectionWithLatitude(0,WKe);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 YKe(e,t,n,i){if(i===fn.RHUMB)return qKe(e,t,n);let r=Ti.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var XKe=new he;function KKe(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,XKe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=YKe(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 Wpe(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=Wpe(e,t+1,n,i,0,d,!s);return t}Eo.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=KKe(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=Wpe(i,r,s,a,1,0,c)}return i};Eo.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=Br(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=hi.computeWindingOrder2D(y);if(b===aa.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 tl(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=Br(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=hi.computeWindingOrder2D(R),b===aa.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 $Ke=new U,JKe=new h,ZKe=new Le,QKe=new $;Eo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,ZKe),s=$.fromQuaternion(o,QKe),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],JKe);$.multiplyByVector(s,g,g);let m=t(g,$Ke);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};Eo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=hi.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?qn.computeNormal(y):y}if(s===fn.GEODESIC)return hi.computeSubdivision(e,c,a,f,i);if(s===fn.RHUMB)return hi.computeRhumbLineSubdivision(e,c,a,f,i)};var jpe=[],Hpe=[],e$e=new h,t$e=new h;Eo.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===fn.GEODESIC)for(c=0;c<y;c++)O+=Eo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===fn.RHUMB)for(c=0;c<y;c++)O+=Eo.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===fn.GEODESIC?(L=Eo.subdivideLine(u,f,R,Hpe),x&&(_=Eo.subdivideTexcoordLine(d,p,u,f,R,jpe))):o===fn.RHUMB&&(L=Eo.subdivideRhumbLine(n,u,f,R,Hpe),x&&(_=Eo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,jpe)));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,e$e),f=h.fromArray(s,O*3,t$e),!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 Cn({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 ti=Eo;function hs(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=hs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(hs.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 RC=new he,n$e=new h;hs.prototype.getLatitude=function(e){l(e)||(e=ee.default),RC.latitude=this.conformalLatitude,RC.longitude=this.longitude,RC.height=0;let t=this.ellipsoid.cartographicToCartesian(RC,n$e);return e.cartesianToCartographic(t,RC),RC.latitude};var i$e=new gn,r$e=new h,o$e=new h;hs.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=hs.NORTH_POLE_TANGENT_PLANE,r=hs.SOUTH_POLE;n<0&&(i=hs.SOUTH_POLE_TANGENT_PLANE,r=hs.NORTH_POLE);let o=i$e;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,r$e),h.normalize(o.direction,o.direction);let s=Ti.rayPlane(o,i.plane,o$e),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 hs(new U(c,u),i)};hs.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]=hs.fromCartesian(e[i],t[i]);return t};hs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new hs(e.position,e.tangentPlane)};hs.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));hs.NORTH_POLE=Object.freeze(new h(0,0,.5));hs.SOUTH_POLE=Object.freeze(new h(0,0,-.5));hs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new qs(hs.NORTH_POLE,hs.HALF_UNIT_SPHERE));hs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new qs(hs.SOUTH_POLE,hs.HALF_UNIT_SPHERE));var Pl=hs;function Xs(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}Xs.POSITION_ONLY=Object.freeze(new Xs({position:!0}));Xs.POSITION_AND_NORMAL=Object.freeze(new Xs({position:!0,normal:!0}));Xs.POSITION_NORMAL_AND_ST=Object.freeze(new Xs({position:!0,normal:!0,st:!0}));Xs.POSITION_AND_ST=Object.freeze(new Xs({position:!0,st:!0}));Xs.POSITION_AND_COLOR=Object.freeze(new Xs({position:!0,color:!0}));Xs.ALL=Object.freeze(new Xs({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Xs.DEFAULT=Xs.POSITION_NORMAL_AND_ST;Xs.packedLength=6;Xs.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};Xs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Xs),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};Xs.clone=function(e,t){if(l(e))return l(t)||(t=new Xs),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=Xs;var s$e=new he,qpe=new he;function a$e(e,t,n,i){let o=i.cartesianToCartographic(e,s$e).height,s=i.cartesianToCartographic(t,qpe);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,qpe);a.height=o-100,i.cartographicToCartesian(a,n)}var Ype=new et,c$e=new h,l$e=new h,u$e=new h,f$e=new h,d$e=new h,h$e=new h,d3=new h,ap=new h,OC=new h,m$e=new U,p$e=new U,g$e=new h,Xpe=new Le,_$e=new $,y$e=new $;function fJ(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=m$e;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=l$e,O=u$e,L=f$e,_=!0,C=_$e,w=y$e;if(m!==0){let F=Le.fromAxisAngle(d,m,Xpe);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,Xpe),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,g$e);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,c$e);B=g.scaleToGeodeticSurface(B,B);let j=p([B],p$e)[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,d$e);if(_){let G=h.fromArray(r,F+s,h$e);y&&a$e(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&&(d3=h.fromArray(x,I,d3),ap=h.cross(h.UNIT_Z,d3,ap),ap=h.normalize($.multiplyByVector(w,ap,ap),ap),t.bitangent&&(OC=h.normalize(h.cross(d3,ap,OC),OC))),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]=ap.x,T[B]=ap.y,T[j]=ap.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]=OC.x,E[B]=OC.y,E[j]=OC.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===_n.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===_n.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Kpe=[];function A$e(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ti.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,Kpe),y=hi.computeWindingOrder2D(m);y===aa.CLOCKWISE&&(p=p.slice().reverse());let A=ti.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,Kpe),y=hi.computeWindingOrder2D(m),y===aa.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ti.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??fn.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ti.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ti.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=ti.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=ti.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var b$e=ee.clone(ee.UNIT_SPHERE),x$e=new Be,T$e={polygonHierarchy:{}};gd.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,b$e);t+=ee.packedLength;let o=Be.unpack(e,t,x$e);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:ti.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new gd(T$e)),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 E$e=new U,C$e=new U,v$e=new Pl;function $pe(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!==fn.RHUMB){let p=U.subtract(t.position,e.position,E$e),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),C$e),y=Pl.clone(t,v$e);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 Jpe=new Pl,S$e=new Pl,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=Pl.fromCartesian(e[0],S$e);for(let s=1;s<r;s++){let a=Pl.fromCartesian(e[s],Jpe);$pe(a,o,t,n,pd,i),o=Pl.clone(a,o)}return $pe(Pl.fromCartesian(e[0],Jpe),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 w$e=new Pl;function I$e(e,t,n){return e.height>=P.PI||e.width>=P.PI?Pl.fromCartesian(t[0],w$e).tangentPlane:qs.fromPoints(t,n)}var Zpe=new he;function P$e(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],Zpe);r[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return r.length=i.length,r}return Pl.fromCartesianArray(i,r)}return qs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function D$e(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,Zpe);return l(o)||(o=new U),o.x=s.longitude/P.PI,o.y=s.latitude/P.PI_OVER_TWO,o}return Pl.fromCartesian(r,o)};let i=qs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function R$e(e,t,n,i){return(r,o)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?ti.splitPolygonsOnEquator(r,t,n,o):r}function O$e(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return et.fromRectangle(t,void 0,Ype);let r=e,o=qs.fromPoints(r,n);return ti.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,Ype)}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=ti.polygonsFromHierarchy(o,d,P$e(g,p,n),!s,n,R$e(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(D){return D},x=d?ti.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=O$e(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:I$e(g,T,n).plane.normal,projectTo2d:D$e(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=A$e(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=D.topAndBottom,O.geometry=ti.scaleToGeodeticHeightExtruded(N.geometry,S,I,n,s)):a?(N=D.topAndBottom,N.geometry.attributes.position.values=hi.scaleToGeodeticHeight(N.geometry.attributes.position.values,S,n,!s),O.geometry=N.geometry):c&&(N=D.topAndBottom,N.geometry.attributes.position.values=hi.scaleToGeodeticHeight(N.geometry.attributes.position.values,I,n,!0),O.geometry=N.geometry),(a||c)&&(O.wall=!1,N.geometry=fJ(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=ti.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=fJ(O),v.push(B)}}else for(L=0;L<A.length;L++){let D=new Bt({geometry:ti.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(D.geometry.attributes.position.values=hi.scaleToGeodeticHeight(D.geometry.attributes.position.values,S,n,!s),O.geometry=D.geometry,D.geometry=fJ(O),l(e._offsetAttribute)){let N=D.geometry.attributes.position.values.length,F=e._offsetAttribute===_n.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 _=qn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.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 M$e(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=M$e(this)),this._textureCoordinateRotationPoints}}});var ng=gd;function MC(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=h3(e.positions),this._holes=l(e.holes)?e.holes.map(h3):[],this._rectangle=ng.computeRectangleFromPositions(this._positions,this._ellipsoid),dJ(this._positions),Qpe(this._holes)}function h3(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 dJ(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function Qpe(e){for(let t=0;t<e.length;t++)dJ(e[t]);return Object.freeze(e)}function N$e(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 L$e(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!N$e(e[n],t[n]))return!1;return!0}Object.defineProperties(MC.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}}});MC.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=h3(e.positions),t._holes=e.holes.map(h3),t._rectangle=ng.computeRectangleFromPositions(t._positions,t._ellipsoid),dJ(t._positions),Qpe(t._holes),t):new MC({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};MC.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&L$e(e.holes,t.holes)};MC.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 hD=MC;var e0e=16,F$e=.35,t0e=new Pa,B$e=new cd,n0e=new Fo,k$e=new ad,U$e=new h,z$e=new h,V$e=new he,j$e=new U,H$e=new U,mD=new z,mJ=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=l0e(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,t0e),m=g.getMaterial(B$e);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),i0e(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,t0e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(P.EPSILON3,r0e(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,j$e),y=U.fromArray(a,(d+g+1)*2,H$e);G$e(m,y,i,o),W$e(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/e0e))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=F$e/r,c=m3(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,r0e(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=py(Math.floor(T*r),r),R=py(Math.floor(E*r),r),O=py(Math.floor(v*r),r),L=py(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]=p3(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=l0e(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,n0e),g=p.getMaterial(k$e);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),i0e(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,n0e);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=q$e(a,f+m,A,i,o),x=a0e(b,A,-P.EPSILON3,1+P.EPSILON3,-P.EPSILON3,1+P.EPSILON3,s0e);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/e0e))),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=py(Math.floor(T*o),o),R=py(Math.floor(v*o),o),O=py(Math.floor(E*o),o),L=py(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=a0e(A,x,C/o-P.EPSILON5,(C+1)/o+P.EPSILON5,_/o-P.EPSILON5,(_+1)/o+P.EPSILON5,s0e),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]=p3(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]=p3(n.primitiveCount),o=new Float32Array(i*r);o.set(m3(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(m3(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(m3(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=c0e(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=c0e(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 i0e(e,t,n){z.fromRgba(n,mD),e[t*4]=z.floatToByte(mD.red),e[t*4+1]=z.floatToByte(mD.green),e[t*4+2]=z.floatToByte(mD.blue),e[t*4+3]=z.floatToByte(mD.alpha)}function r0e(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 G$e(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 W$e(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 py(e,t){return Math.max(0,Math.min(t-1,e))}var hJ=new Float64Array(512),o0e=new Float64Array(512),s0e={positions:new Float64Array(512),vertexCount:0};function q$e(e,t,n,i,r){hJ.length<n*2&&(hJ=new Float64Array(n*4));let o=hJ,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 a0e(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?o0e:s.positions;y.length<g&&(y=new Float64Array(g*2),m?o0e=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 p3(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 c0e(e,t){let[n,i]=p3(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 l0e(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,U$e),a=M.multiplyByPoint(r,s,z$e),c=t.cartesianToCartographic(a,V$e);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function m3(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 Rs=mJ;var _J=new Fo,pJ="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.",gJ="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.",Y$e="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.",X$e="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 $a({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(f0e(t[r]),_J),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&Yr("ClippingPolygonCollection.debugShowDistanceTexture",gJ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&Yr("ClippingPolygonCollection.quality",pJ),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=Rs.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(nl.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return Yr("ClippingPolygonCollection.debugShowDistanceTexture",gJ),this._debugShowDistanceTexture},set:function(e){Yr("ClippingPolygonCollection.debugShowDistanceTexture",gJ),this._debugShowDistanceTexture=e}},quality:{get:function(){return Yr("ClippingPolygonCollection.quality",pJ),this._quality},set:function(e){Yr("ClippingPolygonCollection.quality",pJ),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function f0e(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 K$e(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=$a.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 d0e(e,t){e._bufferPolygonCollection.get(t.bufferIndex,_J).show=!1,t.bufferIndex=-1}nl.prototype.add=function(e){let t=this._polygons.length,n=K$e(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(f0e(e),_J),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=>hD.equals(t.clippingPolygon,e))};nl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>hD.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return d0e(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];d0e(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=Rs.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var u0e=new ie,$$e=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,u0e)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,u0e));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,$$e);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||(Rs.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Rs.packPolygonGrid(n),Rs.packPolygonTextures(t,n)),n};nl.releaseRectangleData=function(e){Rs.freeResources(e)};nl.isSupported=function(e){return e?.context.webgl2};nl.prototype.isDestroyed=function(){return Yr("ClippingPolygonCollection.isDestroyed",Y$e),!1};nl.prototype.destroy=function(){return Yr("ClippingPolygonCollection.destroy",X$e),le(this)};var il=nl;function h0e(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}h0e.prototype.execute=function(e){e.execute(this)};var _d=h0e;var J$e=new h;function _f(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"}_f.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new _f({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};_f.fromAxisAlignedBoundingBox=function(e){return new _f({minimum:e.minimum,maximum:e.maximum})};_f.packedLength=2*h.packedLength+Be.packedLength+1;_f.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 p0e=new h,g0e=new h,_0e=new Be,m0e={minimum:p0e,maximum:g0e,vertexFormat:_0e,offsetAttribute:void 0};_f.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,p0e),r=h.unpack(e,t+h.packedLength,g0e),o=Be.unpack(e,t+2*h.packedLength,_0e),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):(m0e.offsetAttribute=s===-1?void 0:s,new _f(m0e))};_f.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new Cn,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,J$e),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===_n.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 ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var yJ;_f.getUnitBox=function(){return l(yJ)||(yJ=_f.createGeometry(_f.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),yJ};var rl=_f;function pD(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(pD.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});pD.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)};pD.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};pD.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 g3=pD;function Co(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 g3(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,y0e(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 Co.faceNames())AJ(this[T],n?.[T],0);m.bindTexture(y,null)}Co.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()};Co.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Z$e(){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 Z$e()};function AJ(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))}Co.loadFace=AJ;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){y0e(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 h.clone(h.UNIT_X,t);case Co.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Co.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Co.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Co.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Co.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function y0e(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=$n.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)}Co.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 Co.faceNames())AJ(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};Co.prototype.generateMipmap=function(e){e=e??ph.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)};Co.createVertexArray=function(e){let t=rl.createGeometry(rl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=qn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var ms=Co;var cp=`uniform vec3 u_radiiAndDynamicAtmosphereColor; +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,x_.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 RC=(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},IYe=e=>1/(1+Math.exp(-e)),PYe=e=>t=>t*e+.5,DYe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:RC(e,t.positions),scales:RC(e,t.scales,Math.exp),rotations:RC(e,t.rotations),alphas:RC(e,t.alphas,IYe),colors:RC(e,t.colors,PYe(i)),sh:RC(e,t.sh)}},RYe=(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))},Tme=async(e,t)=>{var n;let i=await wYe(),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=DYe(i,a,t);return RYe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var OYe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var MYe=[0,9,24,45],NYe=14,LYe=1.6*1024*1024*1024;function FYe(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 BYe(e,t){let n=NYe+(MYe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var u$=class extends ar{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=kYe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._spzError)&&f$(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=FYe(this._gltf,this._primitive);if(l(n)){let r=BYe(n.numPoints,n.shDegree);if(r>LYe){let o=Math.round(r/1048576);return f$(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=Tme(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=UYe(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 kYe(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;f$(e,n)}}function f$(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load SPZ",t)}async function UYe(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 Ok=u$;function cD(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)}cD.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=Z0.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new cD({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(cD.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}}});cD.BATCH_TABLE_CLASS_NAME="_batchTable";var fp=cD;function Mk(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)}Mk.fromJson=function(e){return new Mk({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Mk.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 Nk=Mk;function Lk(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??Ft.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)}Lk.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return Nk.fromJson(r)});return new Lk({id:t,values:i,valueType:Ft[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Lk.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 Fk=Lk;function Bk(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)}Bk.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=Fk.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]=fp.fromJson({id:i,class:e.classes[i],enums:t}));return new Bk({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Bk.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 xu=Bk;var d$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?xu.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=zYe(this),this._promise)}unload(){this._schema=void 0}};async function zYe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=xu.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 Jb=d$;var ad={};function OC(e){return fh(e.url)}function lD(e){let{byteOffset:t,byteLength:n}=e,i=Wb(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function VYe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function Eme(e,t){return`${OC(e)}-buffer-id-${t}`}function MC(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return OC(r)}return Eme(n,t)}function h$(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=MC(a,s,n,i),u=lD(o);return`${c}-range-${u}`}function Cme(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=MC(a,s,n,i),u=lD(o);return`${c}-range-${u}`}function vme(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 OC(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=MC(u,c,n,i),d=lD(a);return`${f}-range-${d}`}function jYe(e,t){let n=mf.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}ad.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${OC(n)}`};ad.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${OC(t)}`};ad.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Eme(t,n)}`};ad.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${OC(t)}`};ad.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=Wb(o);l(c)&&(s=c.buffer);let u=MC(a,s,i,r),f=lD(o);return`buffer-view:${u}-range-${f}`};ad.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${h$(t,n,i,r)}`};ad.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${Cme(t,n,i,r)}`};ad.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:${Cme(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${h$(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=MC(y,m,n,i),b=lD(g);return`vertex-buffer:${A}-range-${b}${p}`};ad.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:${h$(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=MC(m,g,i,r),A=VYe(f,p);return`index-buffer:${y}-accessor-${A}${u}`};ad.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${vme(t,n,i,r)}`};ad.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=mf.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=vme(t,c,i,r),f=jYe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Tu=ad;function uD(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}uD.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};uD.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};uD.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};uD.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 kk=uD;function Nn(){}Nn.cacheEntries={};Nn.statistics=new kk;function HYe(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 HYe(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=Tu.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new Jb({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=Tu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new EC({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=Tu.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new EC({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=Tu.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new oD({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=Tu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new QP({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=Tu.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new eD({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=Tu.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new Ok({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=Tu.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 aD({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=Tu.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 iD({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=Tu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new nD({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=Tu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new sD({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[aD,iD,eD,sD,nD,QP,EC,Jb,oD],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 Bi=Nn;function Ja(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(Ja.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}}});Ja.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Ja.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Ja.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Ja.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Ja.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Ja.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Ja.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Ja.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Xs.OCTREE&&(t=3),e>>t};Ja.fromSubtreeJson=async function(e,t,n,i,r){let o=new Ja(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=GYe(n);let a=s.json;o._subtreeJson=a;let c;if(sr(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 ak({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],sr(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=WYe(a.buffers),y=qYe(a.bufferViews,m);YYe(a,y),l(c)&&Sme(c,y);for(let x=0;x<u.length;x++){let T=u[x];Sme(T,y)}let A=await XYe(o,m,s.binary),b=$Ye(y,A);return JYe(o,a,i,b),l(c)&&(ZYe(o,i,b),eXe(o)),QYe(o,i,b),tXe(o),o._ready=!0,o};function GYe(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=No(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function WYe(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 qYe(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 YYe(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 Sme(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 XYe(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=KYe(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 KYe(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 $Ye(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 JYe(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=sr(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=m$(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=m$(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=m$(t.childSubtreeAvailability,i,a)}function m$(e,t,n,i){if(l(e.constant))return new XP({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 XP({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function ZYe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new Sh({class:a,count:r,properties:i.properties,bufferViews:n})}function QYe(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 Sh({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function wme(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 eXe(e){let t=wme(e._tileAvailability);e._tileJumpBuffer=t}function tXe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=wme(r);t.push(o)}}Ja.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};Ja.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 nXe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function iXe(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]}Ja.prototype.getTileMetadataView=function(e){let t=nXe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new KP({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Ja.prototype.getContentMetadataView=function(e,t){let n=iXe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new KP({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};Ja.prototype.isDestroyed=function(){return!1};Ja.prototype.destroy=function(){return l(this._bufferLoader)&&Bi.unload(this._bufferLoader),le(this)};var ly=Ja;var Ime={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(Ime);var Ih=Ime;var uy={};uy.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:uy.parseBoundingVolumeSemantic(e,t),minimumHeight:uy._parseMinimumHeight(e,t),maximumHeight:uy._parseMaximumHeight(e,t)}};uy.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}};uy._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};uy._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var Zb=uy;var NC=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 ly.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,rXe(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(),le(this)}};function rXe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=sXe(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=oXe(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=pXe(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function oXe(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 sXe(e,t,n,i){let s=Pme(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=Pme(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Dme(e,t,n){let i=Ih.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Pme(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=Zb.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=lXe(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=Zb.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=uXe(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=Dme(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=Ot(A,x,b),E=Lme(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function Uk(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(sr(e,"3DTILES_bounding_volume_S2")||l(e.region))}function g$(e,t){l(t)&&(sr(e,"3DTILES_bounding_volume_S2")?cXe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&aXe(e.region,t.minimumHeight,t.maximumHeight))}function aXe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function cXe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function lXe(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!Uk(o.boundingVolume,o)&&Uk(e.boundingVolume,o)?s=Rme(e,t,n,i??!1,r):s=o.boundingVolume,g$(s,o),s}function uXe(e,t){let n;return l(t)&&(n=t.boundingVolume),Uk(n,t)?g$(n,t):Uk(e,t)&&(n=Ze(e,!0),g$(n,t)),n}function Rme(e,t,n,i,r){let o=e.boundingVolume;return sr(o,"3DTILES_bounding_volume_S2")?Ome(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:Nme(o.region,t.level,t.x,t.y,t.z)}:{box:Mme(o.box,t.level,t.x,t.y,t.z)}}function Ome(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:ny.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?YP.encode2D(i,r,o):YP.encode2D(i,o,r),f=ny.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:ny.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var fXe=new h,dXe=new h,p$=new h,hXe=new $;function Mme(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,dXe),s=$.unpack(e,3,hXe),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,fXe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,p$);p=$.multiplyByVector(s,p,p$),p=h.add(p,o,p$);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 mXe=new ie;function Nme(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,mXe),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 pXe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=Rme(i,r,n,!1,t),s=Dme(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Lme(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Lme(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}NC._deriveBoundingBox=Mme;NC._deriveBoundingRegion=Nme;NC._deriveBoundingVolumeS2=Ome;var fD=NC;var Fme={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Fme);var pf=Fme;function LC(e,t){this._distance=t,this._normal=new Bme(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(LC.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)}}});LC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new LC(e.normal,e.distance),t};LC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new LC(e.normal,e.distance)};function Bme(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Bme.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 ua=LC;function $c(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?jme:Hme,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 jme(e){return e===$t.OUTSIDE}function Hme(e){return e===$t.INSIDE}Object.defineProperties($c.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?jme:Hme)}},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 kme(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}$c.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){kme(n,i)},e.index=t,kme(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};$c.prototype.get=function(e){return this._planes[e]};function Gme(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}$c.prototype.contains=function(e){return Gme(this._planes,e)!==-1};$c.prototype.remove=function(e){let t=this._planes,n=Gme(t,e);if(n===-1)return!1;e instanceof ua&&(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 ua&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};$c.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ua&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var gXe=new se,_Xe=new se;function Ume(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,_Xe);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,gXe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function zme(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 Wme(e,t){let n=zt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var yXe=new U;$c.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=$c.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=Wme(r,yXe);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Gt.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:Gt.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?(zme(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Ume(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),zme(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),Ume(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 AXe=new M,Vme=new sn(h.UNIT_X,0);$c.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=M.multiply(t,r,AXe));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,Vme);let c=e.intersectPlane(Vme);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};$c.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};$c.useFloatTexture=function(e){return e.floatingPointTexture};$c.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=$c.useFloatTexture(t)?e.length:e.length*2,o=Wme(r,n);return o.y*=2,o};$c.prototype.isDestroyed=function(){return!1};$c.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Ps=$c;function A$(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=Yme(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=CXe(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 hD(o,s,n,a,c,u,0),s}function Yme(e,t,n,i,r){let o;if(r===LXe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=qme(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=qme(s/i|0,e[s],e[s+1],o);return o&&FC(o,o.next)&&(pD(o),o=o.next),o}function Qb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(FC(n,n.next)||ds(n.prev,n,n.next)===0)){if(pD(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function hD(e,t,n,i,r,o,s){if(!e)return;!s&&o&&PXe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?xXe(e,i,r,o):bXe(e)){t.push(c.i,e.i,u.i),pD(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=TXe(Qb(e),t),hD(e,t,n,i,r,o,2)):s===2&&EXe(e,t,n,i,r,o):hD(Qb(e),t,n,i,r,o,1);break}}}function bXe(e){let t=e.prev,n=e,i=e.next;if(ds(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&&dD(r,a,o,c,s,u,m.x,m.y)&&ds(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function xXe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(ds(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,m,t,n,i),x=_$(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&&dD(a,f,c,d,u,p,T.x,T.y)&&ds(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&&dD(a,f,c,d,u,p,E.x,E.y)&&ds(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&&dD(a,f,c,d,u,p,T.x,T.y)&&ds(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&&dD(a,f,c,d,u,p,E.x,E.y)&&ds(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function TXe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!FC(i,r)&&Kme(i,n,n.next,r)&&mD(i,r)&&mD(r,i)&&(t.push(i.i,n.i,r.i),pD(n),pD(n.next),n=e=r),n=n.next}while(n!==e);return Qb(n)}function EXe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&OXe(s,a)){let c=$me(s,a);s=Qb(s,s.next),c=Qb(c,c.next),hD(s,t,n,i,r,o,0),hD(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function CXe(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=Yme(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(RXe(u))}r.sort(vXe);for(let o=0;o<r.length;o++)n=SXe(r[o],n);return n}function vXe(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 SXe(e,t){let n=wXe(e,t);if(!n)return t;let i=$me(n,e);return Qb(i,i.next),Qb(n,n.next)}function wXe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(FC(e,n))return n;do{if(FC(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&&Xme(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);mD(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&IXe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function IXe(e,t){return ds(e.prev,e,t.prev)<0&&ds(t.next,e,e.next)<0}function PXe(e,t,n,i){let r=e;do r.z===0&&(r.z=_$(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,DXe(r)}function DXe(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 _$(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 RXe(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 Xme(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 dD(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&Xme(e,t,n,i,r,o,s,a)}function OXe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!MXe(e,t)&&(mD(e,t)&&mD(t,e)&&NXe(e,t)&&(ds(e.prev,e,t.prev)||ds(e,t.prev,t))||FC(e,t)&&ds(e.prev,e,e.next)>0&&ds(t.prev,t,t.next)>0)}function ds(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function FC(e,t){return e.x===t.x&&e.y===t.y}function Kme(e,t,n,i){let r=Vk(ds(e,t,n)),o=Vk(ds(e,t,i)),s=Vk(ds(n,i,e)),a=Vk(ds(n,i,t));return!!(r!==o&&s!==a||r===0&&zk(e,n,t)||o===0&&zk(e,i,t)||s===0&&zk(n,e,i)||a===0&&zk(n,t,i))}function zk(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 Vk(e){return e>0?1:e<0?-1:0}function MXe(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&&Kme(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function mD(e,t){return ds(e.prev,e,e.next)<0?ds(e,t,e.next)>=0&&ds(e,e.prev,t)>=0:ds(e,t,e.prev)<0||ds(e,e.next,t)<0}function NXe(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 $me(e,t){let n=y$(e.i,e.x,e.y),i=y$(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 qme(e,t,n,i){let r=y$(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 pD(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 y$(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function LXe(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 FXe=new h,BXe=new h,fy={};fy.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};fy.computeWindingOrder2D=function(e){return fy.computeArea2D(e)>0?sa.COUNTER_CLOCKWISE:sa.CLOCKWISE};fy.triangulate=function(e,t){let n=U.packArray(e);return A$(n,t,2)};var epe=new h,tpe=new h,npe=new h,Jme=new h,Zme=new h,Qme=new h,eg=new h,ipe=new U,rpe=new U,ope=new U,BC=new U;fy.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,epe),I=h.fromArray(u,E*3,tpe),R=h.fromArray(u,T*3,npe),O,L,_;o&&(O=U.fromArray(f,v*2,ipe),L=U.fromArray(f,E*2,rpe),_=U.fromArray(f,T*2,ope));let C=h.multiplyByScalar(h.normalize(S,Jme),y,Jme),w=h.multiplyByScalar(h.normalize(I,Zme),y,Zme),D=h.multiplyByScalar(h.normalize(R,Qme),y,Qme),N=h.magnitudeSquared(h.subtract(C,w,eg)),F=h.magnitudeSquared(h.subtract(w,D,eg)),V=h.magnitudeSquared(h.subtract(D,C,eg)),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,eg),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,BC),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,eg),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,_,BC),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,eg),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,BC),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 kXe=new he,UXe=new he,zXe=new he,b$=new he;fy.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 jc(void 0,void 0,e),x=new jc(void 0,void 0,e),T=new jc(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,epe),O=h.fromArray(u,S*3,tpe),L=h.fromArray(u,v*3,npe),_,C,w;o&&(_=U.fromArray(f,I*2,ipe),C=U.fromArray(f,S*2,rpe),w=U.fromArray(f,v*2,ope));let D=e.cartesianToCartographic(R,kXe),N=e.cartesianToCartographic(O,UXe),F=e.cartesianToCartographic(L,zXe);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,b$),Q=(D.height+N.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,eg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,BC),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,b$),Q=(N.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,eg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,BC),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,b$),Q=(F.height+D.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,eg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,BC),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)};fy.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=FXe,o=BXe;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 mi=fy;function dy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(dy.prototype,{length:{get:function(){return this._length}}});dy.prototype.enqueue=function(e){this._array.push(e),this._length++};dy.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};dy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};dy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};dy.prototype.clear=function(){this._array.length=this._offset=this._length=0};dy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var ex=dy;var vo={};vo.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};vo.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};vo.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]=vo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var tx=new U;function cpe(e,t,n,i){return U.subtract(t,e,tx),U.multiplyByScalar(tx,n/i,tx),U.add(e,tx,tx),[tx.x,tx.y]}var hy=new h;function VXe(e,t,n,i){return h.subtract(t,e,hy),h.multiplyByScalar(hy,n/i,hy),h.add(e,hy,hy),[hy.x,hy.y,hy.z]}vo.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 Hk=new he,Gk=new he,jXe=new he,HXe=new h,jk=new jc;vo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,Hk),o=e.cartesianToCartographic(n,Gk),a=new jc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};vo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=vo.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=cpe(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};vo.subdivideLine=function(e,t,n,i){let r=vo.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=VXe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};vo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,Hk),c=n.cartesianToCartographic(r,Gk);jk.setEndPoints(a,c);let u=jk.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=cpe(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};vo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,Hk),s=e.cartesianToCartographic(n,Gk),a=new jc(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,jXe),A=e.cartographicToCartesian(y,HXe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var GXe=new h,WXe=new h,qXe=new h,YXe=new h;vo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=GXe,s=WXe,a=qXe,c=YXe;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};vo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new ex;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 XXe=new he;function KXe(e,t,n){let i=n.cartesianToCartographic(e,Hk),r=n.cartesianToCartographic(t,Gk);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;jk.setEndPoints(i,r);let o=jk.findIntersectionWithLatitude(0,XXe);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 $Xe(e,t,n,i){if(i===ln.RHUMB)return KXe(e,t,n);let r=xi.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var JXe=new he;function ZXe(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,JXe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=$Xe(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 lpe(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=lpe(e,t+1,n,i,0,d,!s);return t}vo.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=ZXe(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=lpe(i,r,s,a,1,0,c)}return i};vo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new ex;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=mi.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 Hc(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=mi.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 QXe=new U,eKe=new h,tKe=new Le,nKe=new $;vo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,tKe),s=$.fromQuaternion(o,nKe),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],eKe);$.multiplyByVector(s,g,g);let m=t(g,QXe);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};vo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=mi.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?qn.computeNormal(y):y}if(s===ln.GEODESIC)return mi.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return mi.computeRhumbLineSubdivision(e,c,a,f,i)};var spe=[],ape=[],iKe=new h,rKe=new h;vo.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+=vo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=vo.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=vo.subdivideLine(u,f,R,ape),x&&(_=vo.subdivideTexcoordLine(d,p,u,f,R,spe))):o===ln.RHUMB&&(L=vo.subdivideRhumbLine(n,u,f,R,ape),x&&(_=vo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,spe)));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,iKe),f=h.fromArray(s,O*3,rKe),!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 ni=vo;function hs(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=hs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(hs.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 kC=new he,oKe=new h;hs.prototype.getLatitude=function(e){l(e)||(e=ee.default),kC.latitude=this.conformalLatitude,kC.longitude=this.longitude,kC.height=0;let t=this.ellipsoid.cartographicToCartesian(kC,oKe);return e.cartesianToCartographic(t,kC),kC.latitude};var sKe=new gn,aKe=new h,cKe=new h;hs.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=hs.NORTH_POLE_TANGENT_PLANE,r=hs.SOUTH_POLE;n<0&&(i=hs.SOUTH_POLE_TANGENT_PLANE,r=hs.NORTH_POLE);let o=sKe;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,aKe),h.normalize(o.direction,o.direction);let s=xi.rayPlane(o,i.plane,cKe),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 hs(new U(c,u),i)};hs.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]=hs.fromCartesian(e[i],t[i]);return t};hs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new hs(e.position,e.tangentPlane)};hs.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));hs.NORTH_POLE=Object.freeze(new h(0,0,.5));hs.SOUTH_POLE=Object.freeze(new h(0,0,-.5));hs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new qs(hs.NORTH_POLE,hs.HALF_UNIT_SPHERE));hs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new qs(hs.SOUTH_POLE,hs.HALF_UNIT_SPHERE));var Dl=hs;var lKe=new he,upe=new he;function uKe(e,t,n,i){let o=i.cartesianToCartographic(e,lKe).height,s=i.cartesianToCartographic(t,upe);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,upe);a.height=o-100,i.cartographicToCartesian(a,n)}var fpe=new et,fKe=new h,dKe=new h,hKe=new h,mKe=new h,pKe=new h,gKe=new h,Wk=new h,dp=new h,UC=new h,_Ke=new U,yKe=new U,AKe=new h,dpe=new Le,bKe=new $,xKe=new $;function x$(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=_Ke;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=dKe,O=hKe,L=mKe,_=!0,C=bKe,w=xKe;if(m!==0){let F=Le.fromAxisAngle(d,m,dpe);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,dpe),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,AKe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,fKe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],yKe)[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,pKe);if(_){let G=h.fromArray(r,F+s,gKe);y&&uKe(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&&(Wk=h.fromArray(x,I,Wk),dp=h.cross(h.UNIT_Z,Wk,dp),dp=h.normalize($.multiplyByVector(w,dp,dp),dp),t.bitangent&&(UC=h.normalize(h.cross(Wk,dp,UC),UC))),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]=dp.x,T[B]=dp.y,T[j]=dp.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]=UC.x,E[B]=UC.y,E[j]=UC.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 hpe=[];function TKe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ni.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,hpe),y=mi.computeWindingOrder2D(m);y===sa.CLOCKWISE&&(p=p.slice().reverse());let A=ni.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,hpe),y=mi.computeWindingOrder2D(m),y===sa.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ni.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Bt({geometry:A}))}return f}function ld(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=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ni.computeHierarchyPackedLength(s,U):1)+12}ld.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 ld(t)};ld.pack=function(e,t,n){return n=n??0,n=ni.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=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var EKe=ee.clone(ee.UNIT_SPHERE),CKe=new Be,vKe={polygonHierarchy:{}};ld.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,EKe);t+=ee.packedLength;let o=Be.unpack(e,t,CKe);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:ni.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new ld(vKe)),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 SKe=new U,wKe=new U,IKe=new Dl;function mpe(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,SKe),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),wKe),y=Dl.clone(t,IKe);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 ppe=new Dl,PKe=new Dl,cd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};ld.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,cd.northAngle=0,cd.southAngle=0,cd.westOverIdl=Number.POSITIVE_INFINITY,cd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=Dl.fromCartesian(e[0],PKe);for(let s=1;s<r;s++){let a=Dl.fromCartesian(e[s],ppe);mpe(a,o,t,n,cd,i),o=Dl.clone(a,o)}return mpe(Dl.fromCartesian(e[0],ppe),o,t,n,cd,i),i.east-i.west>cd.eastOverIdl-cd.westOverIdl&&(i.west=cd.westOverIdl,i.east=cd.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(cd.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(cd.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var DKe=new Dl;function RKe(e,t,n){return e.height>=P.PI||e.width>=P.PI?Dl.fromCartesian(t[0],DKe).tangentPlane:qs.fromPoints(t,n)}var gpe=new he;function OKe(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],gpe);r[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return r.length=i.length,r}return Dl.fromCartesianArray(i,r)}return qs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function MKe(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,gpe);return l(o)||(o=new U),o.x=s.longitude/P.PI,o.y=s.latitude/P.PI_OVER_TWO,o}return Dl.fromCartesian(r,o)};let i=qs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function NKe(e,t,n,i){return(r,o)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?ni.splitPolygonsOnEquator(r,t,n,o):r}function LKe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return et.fromRectangle(t,void 0,fpe);let r=e,o=qs.fromPoints(r,n);return ni.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,fpe)}ld.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=ni.polygonsFromHierarchy(o,d,OKe(g,p,n),!s,n,NKe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(D){return D},x=d?ni.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=LKe(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:RKe(g,T,n).plane.normal,projectTo2d:MKe(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=TKe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=D.topAndBottom,O.geometry=ni.scaleToGeodeticHeightExtruded(N.geometry,S,I,n,s)):a?(N=D.topAndBottom,N.geometry.attributes.position.values=mi.scaleToGeodeticHeight(N.geometry.attributes.position.values,S,n,!s),O.geometry=N.geometry):c&&(N=D.topAndBottom,N.geometry.attributes.position.values=mi.scaleToGeodeticHeight(N.geometry.attributes.position.values,I,n,!0),O.geometry=N.geometry),(a||c)&&(O.wall=!1,N.geometry=x$(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=ni.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=x$(O),v.push(B)}}else for(L=0;L<A.length;L++){let D=new Bt({geometry:ni.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(D.geometry.attributes.position.values=mi.scaleToGeodeticHeight(D.geometry.attributes.position.values,S,n,!s),O.geometry=D.geometry,D.geometry=x$(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 _=qn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new wt({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};ld.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new ld({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 FKe(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(ld.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=ld.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=FKe(this)),this._textureCoordinateRotationPoints}}});var tg=ld;function zC(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=qk(e.positions),this._holes=l(e.holes)?e.holes.map(qk):[],this._rectangle=tg.computeRectangleFromPositions(this._positions,this._ellipsoid),T$(this._positions),_pe(this._holes)}function qk(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 T$(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function _pe(e){for(let t=0;t<e.length;t++)T$(e[t]);return Object.freeze(e)}function BKe(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 kKe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!BKe(e[n],t[n]))return!1;return!0}Object.defineProperties(zC.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}}});zC.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=qk(e.positions),t._holes=e.holes.map(qk),t._rectangle=tg.computeRectangleFromPositions(t._positions,t._ellipsoid),T$(t._positions),_pe(t._holes),t):new zC({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};zC.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&kKe(e.holes,t.holes)};zC.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 gD=zC;var ype={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(ype);var ki=ype;var _D=class _D{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=ue.clone(t.boundingVolume??new ue,new ue),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??_D.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??_D.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)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.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&&!ls(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(_D,"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 Yk=_D;Yk.DEFAULT_CAPACITY=1024;var fa=Yk;var Ph=class Ph{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(Ph.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Ph.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Ph.Layout.SHOW_U8)===1}set show(t){this._setUint8(Ph.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(Ph.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Ph.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Ph.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Ph.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(Ph,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var E$=Ph,ms=E$;var{ERR_CAPACITY:tPn,ERR_RESIZE:nPn,ERR_OUT_OF_RANGE:iPn}=fa.Error,ud=class ud 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(ud.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(ud.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(ud.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(ud.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(ud.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(ud.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(ud.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(ud.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(ud.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(ud,"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 C$=ud,Lo=C$;var Xk=`#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 Kk=`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 yD=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(yD,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(yD,"DEFAULT_MATERIAL");var Eu=yD;var $k=class $k extends Eu{constructor(t=H.EMPTY_OBJECT){super(t)}};ut($k,"DEFAULT_MATERIAL",Object.freeze(new $k));var v$=$k,fd=v$;var S$={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},Ape={position:0,pickColor:1,showColorAlpha:2},da=new Lo,w$=new fd,AD=new z,bpe=new h,I$=new Sn;function UKe(e,t,n){let i=t.context;n=n||{destroy:VKe};let r=e._positionDatatype===Y.DOUBLE,o=r?S$:Ape;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,da),!da._dirty)continue;let x=da.triangleOffset,T=da.vertexOffset,E=da.getTriangles();for(let R=0,O=da.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=da.show,S=r?da.getPositions():null;da.getMaterial(w$);let I=cn.encodeRGB8(w$.color);z.fromRgba(da._pickId,AD);for(let R=0,O=da.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,bpe),Sn.fromCartesian(bpe,I$),h.pack(I$.high,d,T*3),h.pack(I$.low,p,T*3)),m[T*4]=z.floatToByte(AD.red),m[T*4+1]=z.floatToByte(AD.green),m[T*4+2]=z.floatToByte(AD.blue),m[T*4+3]=z.floatToByte(AD.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=w$.color.alpha,T++;da._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=zKe(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:nt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:S$.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:S$.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:Ape.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=en.fromCache({context:i,vertexShaderSource:new Xe({sources:[Xk],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[Kk]}),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 zKe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,da);let i=da.vertexOffset,r=da.triangleOffset*3;e.get(t+n-1,da);let o=da.vertexOffset+da.vertexCount-i,s=(da.triangleOffset+da.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function VKe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var Jk=UKe;var{ERR_CAPACITY:qPn}=fa.Error,P$=class e extends fa{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??fa.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??fa.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Lo}_getMaterialClass(){return fd}_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 Lo){super.add(t,n);let i=this._positionCount;n._setUint32(Lo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Lo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Lo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Lo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Lo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Lo.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=Jk(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=P$;var{ERR_RESIZE:JPn,ERR_CAPACITY:ZPn}=fa.Error,VC=class VC 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(VC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(VC.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(VC.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(VC,"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 D$=VC,Ra=D$;var bD=class bD extends Eu{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(bD,"Layout",{...Eu.Layout,WIDTH_F32:Eu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Eu.Layout.__BYTE_LENGTH+4}),ut(bD,"DEFAULT_MATERIAL",Object.freeze(new bD));var R$=bD,dd=R$;var xpe=16,jKe=.35,Tpe=new Ra,HKe=new dd,Epe=new Lo,GKe=new fd,WKe=new h,qKe=new h,YKe=new he,XKe=new U,KKe=new U,xD=new z,M$=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=Dpe(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,Tpe),m=g.getMaterial(HKe);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),Cpe(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,Tpe);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(P.EPSILON3,vpe(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,XKe),y=U.fromArray(a,(d+g+1)*2,KKe);$Ke(m,y,i,o),JKe(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/xpe))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=jKe/r,c=Zk(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,vpe(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=my(Math.floor(T*r),r),R=my(Math.floor(E*r),r),O=my(Math.floor(v*r),r),L=my(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]=Qk(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=Dpe(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,Epe),g=p.getMaterial(GKe);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),Cpe(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,Epe);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=ZKe(a,f+m,A,i,o),x=Ipe(b,A,-P.EPSILON3,1+P.EPSILON3,-P.EPSILON3,1+P.EPSILON3,wpe);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/xpe))),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=my(Math.floor(T*o),o),R=my(Math.floor(v*o),o),O=my(Math.floor(E*o),o),L=my(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=Ipe(A,x,C/o-P.EPSILON5,(C+1)/o+P.EPSILON5,_/o-P.EPSILON5,(_+1)/o+P.EPSILON5,wpe),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]=Qk(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]=Qk(n.primitiveCount),o=new Float32Array(i*r);o.set(Zk(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:Gt.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(Zk(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:Gt.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(Zk(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:Gt.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:Gt.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:Gt.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=Ppe(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:Gt.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:Gt.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=Ppe(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 Cpe(e,t,n){z.fromRgba(n,xD),e[t*4]=z.floatToByte(xD.red),e[t*4+1]=z.floatToByte(xD.green),e[t*4+2]=z.floatToByte(xD.blue),e[t*4+3]=z.floatToByte(xD.alpha)}function vpe(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 $Ke(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 JKe(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 my(e,t){return Math.max(0,Math.min(t-1,e))}var O$=new Float64Array(512),Spe=new Float64Array(512),wpe={positions:new Float64Array(512),vertexCount:0};function ZKe(e,t,n,i,r){O$.length<n*2&&(O$=new Float64Array(n*4));let o=O$,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 Ipe(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?Spe:s.positions;y.length<g&&(y=new Float64Array(g*2),m?Spe=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 Qk(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 Ppe(e,t){let[n,i]=Qk(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:Gt.NEAREST,flipY:!1})}function Dpe(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,WKe),a=M.multiplyByPoint(r,s,qKe),c=t.cartesianToCartographic(a,YKe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function Zk(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 Ds=M$;var F$=new Lo,N$="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.",L$="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.",QKe="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.",e$e="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 Jc(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(Ope(t[r]),F$),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&Yr("ClippingPolygonCollection.debugShowDistanceTexture",L$),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&Yr("ClippingPolygonCollection.quality",N$),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=Ds.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(Jc.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return Yr("ClippingPolygonCollection.debugShowDistanceTexture",L$),this._debugShowDistanceTexture},set:function(e){Yr("ClippingPolygonCollection.debugShowDistanceTexture",L$),this._debugShowDistanceTexture=e}},quality:{get:function(){return Yr("ClippingPolygonCollection.quality",N$),this._quality},set:function(e){Yr("ClippingPolygonCollection.quality",N$),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function Ope(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 t$e(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: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 Mpe(e,t){e._bufferPolygonCollection.get(t.bufferIndex,F$).show=!1,t.bufferIndex=-1}Jc.prototype.add=function(e){let t=this._polygons.length,n=t$e(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(Ope(e),F$),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};Jc.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};Jc.prototype.contains=function(e){return this._polygons.some(t=>gD.equals(t.clippingPolygon,e))};Jc.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>gD.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return Mpe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};Jc.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];Mpe(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};Jc.prototype.update=function(e){if(!Jc.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Ds.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var Rpe=new ie,n$e=new ie;Jc.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,Rpe)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,Rpe));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,n$e);if(l(c))return $t.INTERSECTING}return r};Jc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};Jc.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Ds.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Ds.packPolygonGrid(n),Ds.packPolygonTextures(t,n)),n};Jc.releaseRectangleData=function(e){Ds.freeResources(e)};Jc.isSupported=function(e){return e?.context.webgl2};Jc.prototype.isDestroyed=function(){return Yr("ClippingPolygonCollection.isDestroyed",QKe),!1};Jc.prototype.destroy=function(){return Yr("ClippingPolygonCollection.destroy",e$e),le(this)};var Zc=Jc;function Npe(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}Npe.prototype.execute=function(e){e.execute(this)};var hd=Npe;var jC={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};jC.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?jC.SUNLIGHT:jC.SCENE_LIGHT:jC.NONE};Object.freeze(jC);var py=jC;function Lpe(){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=py.NONE}Lpe.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 HC=Lpe;var hp=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; uniform float u_atmosphereMieScaleHeight; @@ -5179,3543 +4523,4849 @@ out vec3 rayleighColor, out vec3 mieColor, out float opacity ) { -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; +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; +} +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(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); +for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { +if (i >= PRIMARY_STEPS) { +break; +} +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; +} +vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); +float lightHeight = length(lightPosition) - atmosphereInnerRadius; +lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; +lightPositionLength += lightStepLength; +} +vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); +rayleighAccumulation += sampleDensity.x * attenuation; +mieAccumulation += sampleDensity.y * attenuation; +rayPositionLength += (rayStepLength += rayStepLengthIncrease); +} +rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; +mieColor = u_atmosphereMieCoefficient * mieAccumulation; +opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); +} +vec4 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 = u_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) * u_atmosphereLightIntensity; +return vec4(color, opacity); +} +`;var e3=`uniform samplerCube u_radianceMap; +in vec2 v_textureCoordinates; +const float twoSqrtPi = 2.0 * sqrt(czm_pi); +float computeShBasis(int index, vec3 s) { +if (index == 0) { +return 1.0 / twoSqrtPi; +} +if (index == 1) { +return -sqrt(3.0) * s.y / twoSqrtPi; +} +if (index == 2) { +return sqrt(3.0) * s.z / twoSqrtPi; +} +if (index == 3) { +return -sqrt(3.0) * s.x / twoSqrtPi; +} +if (index == 4) { +return sqrt(15.0) * s.y * s.x / twoSqrtPi; +} +if (index == 5) { +return -sqrt(15.0) * s.y * s.z / twoSqrtPi; +} +if (index == 6) { +return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; +} +if (index == 7) { +return -sqrt(15.0) * s.x * s.z / twoSqrtPi; +} +if (index == 8) { +return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; +} +return 0.0; +} +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +const int samples = 256; +const float solidAngle = 1.0 / float(samples); +void main() { +vec2 uv = v_textureCoordinates.xy * 3.0; +int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); +for (int i = 0; i < samples; ++i) { +vec2 xi = hammersley2D(i, samples); +float phi = czm_twoPi * xi.x; +float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); +float Ylm = computeShBasis(coefficientIndex, direction); +vec3 lookupDirection = -direction.xyz; +lookupDirection.z = -lookupDirection.z; +vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); +out_FragColor += Ylm * color * solidAngle * sinTheta; +} +} +`;var t3=`precision highp float; +in vec2 v_textureCoordinates; +uniform vec3 u_faceDirection; +uniform vec3 u_positionWC; +uniform mat4 u_enuToFixedFrame; +uniform vec4 u_brightnessSaturationGammaIntensity; +uniform vec4 u_groundColor; +vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { +vec2 scaledUV = uv * 2.0 - 1.0; +if (faceDir.x != 0.0) { +return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); +} else if (faceDir.y != 0.0) { +return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); +} else { +return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); +} +} +void main() { +float height = length(u_positionWC); +float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; +float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); +vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); +float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; +float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; +vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; +vec3 normalizedDirection = normalize(direction); +czm_ray ray = czm_ray(positionWC, normalizedDirection); +czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); +if (!czm_isEmpty(intersection)) { +intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); +} +bool onEllipsoid = intersection.start >= 0.0; +float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); +vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; +float lightEnum = u_radiiAndDynamicAtmosphereColor.z; +vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); +vec3 mieColor; +vec3 rayleighColor; +float opacity; +czm_computeScattering( +ray, +rayLength, +lightDirectionWC, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); +#ifdef ATMOSPHERE_COLOR_CORRECT +const bool ignoreBlackPixels = true; +atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); +#endif +vec3 lookupDirection = -normalizedDirection; +lookupDirection.x = -lookupDirection.x; +lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); +lookupDirection.x = -lookupDirection.x; +float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); +skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); +float intensity = u_brightnessSaturationGammaIntensity.w; +vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); +vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); +vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); +vec3 up = normalize(positionWC); +float occlusion = max(dot(lightDirectionWC, up), 0.05); +vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); +vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); +vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); +float brightness = u_brightnessSaturationGammaIntensity.x; +float saturation = u_brightnessSaturationGammaIntensity.y; +float gamma = u_brightnessSaturationGammaIntensity.z; +#ifdef ENVIRONMENT_COLOR_CORRECT +color.rgb = mix(vec3(0.0), color.rgb, brightness); +color.rgb = czm_saturation(color.rgb, saturation); +#endif +color.rgb = pow(color.rgb, vec3(gamma)); +color.rgb = czm_gammaCorrect(color.rgb); +out_FragColor = color; +} +`;var n3=`precision highp float; +in vec3 v_textureCoordinates; +uniform float u_roughness; +uniform samplerCube u_radianceTexture; +uniform vec3 u_faceDirection; +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float phi = czm_twoPi * xi.x; +float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); +vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); +vec3 tangentX = normalize(cross(upVector, N)); +vec3 tangentY = cross(N, tangentX); +return tangentX * H.x + tangentY * H.y + N * H.z; +} +const int samples = 128; +void main() { +vec3 normal = u_faceDirection; +vec3 V = normalize(v_textureCoordinates); +float roughness = u_roughness; +vec4 color = vec4(0.0); +float weight = 0.0; +for (int i = 0; i < samples; ++i) { +vec2 xi = hammersley2D(i, samples); +vec3 H = importanceSampleGGX(xi, roughness, V); +vec3 L = 2.0 * dot(V, H) * H - V; +float NdotL = max(dot(V, L), 0.0); +if (NdotL > 0.0) { +color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; +weight += NdotL; +} +} +out_FragColor = color / weight; +} +`;var i3=`in vec3 position; +out vec3 v_textureCoordinates; +uniform vec3 u_faceDirection; +vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { +vec2 scaledUV = uv; +if (faceDir.x != 0.0) { +return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); +} else if (faceDir.y != 0.0) { +return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); +} else { +return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); +} +} +void main() +{ +v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); +v_textureCoordinates.y = -v_textureCoordinates.y; +v_textureCoordinates.z = -v_textureCoordinates.z; +gl_Position = vec4(position, 1.0); +} +`;function 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(zt.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(zt.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 i$e=new h,r$e=new h;function o$e(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,r$e),s=1.025,a=i$e,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 Fpe=new h,s$e=new M,a$e=new se,c$e=new z;function l$e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new us({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:[hp,t3]}),e._radianceMapFS=r),HC.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,s$e),u=a$e;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 us.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 hd({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>us.getDirection(d,Fpe),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,c$e)},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 u$e(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 Gt({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 us.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=us.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=en.fromCache({context:a,vertexShaderSource:i3,fragmentShaderSource:n3,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new hd({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>us.getDirection(g,Fpe)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ei._queueCommand(b,t),++d}o/=2,s/=2}u()}var Bpe=new U(3,3);function f$e(e,t){let n=t.context,i=Bpe,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:[e3]}),e._irradianceMapFS=o);let s=new hd({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 d$e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new vs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=Bpe,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=o$e(this,e)||i===py.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&&(l$e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(u$e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(f$e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){d$e(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(),le(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 gy=Ei;var GC={HIGHLIGHT:0,REPLACE:1,MIX:2};GC.getColorBlend=function(e,t){if(e===GC.HIGHLIGHT)return 0;if(e===GC.REPLACE)return 1;if(e===GC.MIX)return P.clamp(t,P.EPSILON4,1)};Object.freeze(GC);var Rl=GC;var kpe={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(kpe);var Dh=kpe;var Upe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(Upe);var Ol=Upe;var zpe={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(zpe);var mp=zpe;var Vpe={};function TD(e){this._count=e.count,this._properties=Ze(e.properties,!0)}TD.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,Vpe)};TD.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,Vpe,e)};TD.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ze(n[e],!0)};TD.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 _y=TD;function yc(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(yc.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}}});yc.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))};yc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};yc.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))};yc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var B$=[];yc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(B$);ti(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,B$);ti(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(B$);ti(t,n)}return t};yc.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};yc.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 _y({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};yc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};yc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};yc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};yc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};yc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};yc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};yc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};yc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var Cu=yc;function jpe(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=mf.createModelTextureReader({textureInfo:o,channels:h$e(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(jpe.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 h$e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var r3=jpe;function k$(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 r3({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(k$.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}}});k$.prototype.getProperty=function(e){return this._properties[e]};var yy=k$;function Hpe(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(Hpe.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 o3=Hpe;function U$(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 o3({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(U$.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}}});U$.prototype.getProperty=function(e){return this._properties[e]};var WC=U$;function qC(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(qC.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}}});qC.prototype.getPropertyTable=function(e){return this._propertyTables[e]};qC.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};qC.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};qC.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var Qa=qC;function m$e(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=p$e(a,e.bufferViews,c,e.context),f=new Sh({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Cu({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 yy({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 WC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Qa({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var ED=4;function p$e(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=g$e(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>zt.maximumTextureSize||a>zt.maximumTextureSize){yt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${zt.maximumTextureSize}.`);return}let c=y$e(s,o),u=new Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.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 g$e(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(ED))continue;let c=e[s],u=l(c)?t[c.values]:_$e(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 _$e(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=Ft.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Ft.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 y$e(e,t){let n=e.length,i=new Uint8Array(n*t*ED),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*ED,u=a.valueType,f=Ft.gpuComponentType(u);if(u!==f){b$e(s,r,c);continue}A$e(s,i,c)}return i}function A$e(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*ED;t.set(i.subarray(a,a+r),c)}}function b$e(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Ft.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Ft.getDataViewAccessors(u,o),d=Ft.getDataViewAccessors(t,s),p=Ft.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*ED,A=f.get(m);d.set(y,p(A))}}var s3=m$e;function x$e(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 Sh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Cu({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 yy({id:a,propertyTexture:T$e(c),class:n.classes[c.class],textures:e.textures}))}return new Qa({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function T$e(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:E$e(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function E$e(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 a3=x$e;var z$=class extends ar{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=C$e(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=s3({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=a3({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),Gpe(this),this._state=Ct.READY,!0}unload(){Gpe(this),F$e(this),l(this._schemaLoader)&&Bi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function C$e(e){try{let t=P$e(e),n=N$e(e),i=L$e(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 v$e(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 S$e(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 w$e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];v$e(r.properties,n)}return n}function I$e(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)&&S$e(o,n)}}return n}async function P$e(e){let t;l(e._extension)?t=w$e(e._extension):t=I$e(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 D$e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&R$e(o,t)}return t}function R$e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function O$e(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)&&M$e(o,t)}}return t}function M$e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function N$e(e){let t;l(e._extension)?t=D$e(e._extension):t=O$e(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 L$e(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 Gpe(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 F$e(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 c3=z$;var nx={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};nx.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return nx.TRANSLATION;case"ROTATION":return nx.ROTATION;case"SCALE":return nx.SCALE;case"_FEATURE_ID":return nx.FEATURE_ID}};Object.freeze(nx);var Fo=nx;var B$e=65534,k$e=255;function l3(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 Ype(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],U$e(this)}Object.defineProperties(l3.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function U$e(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=Wpe(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>B$e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>k$e&&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=Wpe(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Wpe(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=V$(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=V$(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=V$(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=j$(f),_=j$(m),C=j$(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 V$(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 j$(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}l3.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};l3.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,zt.maximumTextureSize),i=n,r=qpe(i),o=[];for(;i>1;)i>>=1,o.push(qpe(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:$e.LUMINANCE,sampler:new Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Zn.LINEAR})});return t.outlineTexture=s,s};function qpe(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 Ype(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)}}Ype.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 YC=l3;function Xpe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function z$e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function u3(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}u3.prototype.postProcess=function(e){this.needsOutlines&&(V$e(this),G$e(this,e)),this.needsGaussianSplats&&H$e(this,e)};function V$e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new YC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=j$e(r.outlineCoordinates),s=new Xpe(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 j$e(e){let t=new vn.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 H$e(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 G$e(e,t){W$e(e.attributePlans,t),l(e.indicesPlan)&&q$e(e.indicesPlan,t)}function W$e(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=nt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function q$e(e,t){let n=e.indices;if(e.loadBuffer){let i=nt.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)}u3.AttributeLoadPlan=Xpe;u3.IndicesLoadPlan=z$e;var XC=u3;function Y$e(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var f3=Y$e;function Kpe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Kpe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var d3=Kpe;function $pe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties($pe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var h3=$pe;function Jpe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Jpe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var m3=Jpe;var Zpe={Direct:"Direct",Indirect:"Indirect"};Object.freeze(Zpe);var ix=Zpe;function Qpe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(Qpe.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 CD=Qpe;function e0e(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(e0e.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 p3=e0e;function KC(){}function t0e(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function X$e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new d3({position:t,adjustmentParams:n})}function K$e(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=t0e(e.covarianceMatrix);return new h3({position:t,adjustmentParams:n,covarianceMatrix:i})}function $$e(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new p3({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new m3({groupFlags:t,rotationThetas:n,params:i})}KC.load=function(e){let t=e.storageType;if(t===ix.Direct)return KC.loadDirect(e);if(t===ix.Indirect)return KC.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};KC.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=X$e(o);t.push(s)}let i=t0e(e.covarianceDirectUpperTriangle);return new CD({storageType:ix.Direct,anchorPointsDirect:t,covarianceDirect:i})};KC.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=K$e(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=$$e(s);r.push(a)}return new CD({storageType:ix.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var g3=KC;function n0e(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(n0e.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 _3=n0e;function i0e(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(i0e.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var y3=i0e;function r0e(e){this._ppeTextures=e}Object.defineProperties(r0e.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var A3=r0e;function Ko(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)&&(Ko.prototype=Object.create(ar.prototype),Ko.prototype.constructor=Ko);Object.defineProperties(Ko.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Ko.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)}};Ko.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=this._loadResources(this),this._promise)};function J$e(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}Ko.prototype._loadTextures=function(){let e;l(this._extension)&&(e=J$e(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)};Ko.ppeTexturesMetadataSchemaCache=new Map;Ko._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}}}};Ko._obtainPpeTexturesMetadataSchema=function(e){let n=Ko._collectPpeTexturePropertyIdentifiers(e).toString(),i=Ko.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${Ko.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=Ko._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=xu.fromJson(o),Ko.ppeTexturesMetadataSchemaCache.set(n,i),i};Ko._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=Ko._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};Ko._convertToStructuralMetadata=function(e,t){let n=[],i=Ko._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 yy({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new Qa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Ko.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 y3({min:d.min,max:d.max,source:d.source}),g=new _3({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new A3(o);this._meshPrimitiveGpmLocal=a;let c=Ko._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Ct.READY,!0};Ko.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};Ko.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var b3=Ko;function Z$e(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];ti(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 x3=Z$e;var{Attribute:Q$e,Indices:eJe,FeatureIdAttribute:s0e,FeatureIdTexture:a0e,FeatureIdImplicitRange:c0e,MorphTarget:tJe,Primitive:nJe,Instances:iJe,Skin:rJe,Node:oJe,AnimatedPropertyType:sJe,AnimationSampler:aJe,AnimationTarget:cJe,AnimationChannel:lJe,Animation:uJe,ArticulationStage:fJe,Articulation:dJe,Asset:hJe,Scene:mJe,Components:pJe,MetallicRoughness:gJe,SpecularGlossiness:_Je,Specular:yJe,Anisotropy:H$,Clearcoat:G$,PlanarFill:AJe,LineStyle:bJe,Material:xJe,Vector:TJe,Polygon:EJe}=vn,to={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},W$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=qi.Y,forwardAxis:c=qi.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=to.NOT_LOADED,this._textureState=to.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=CJe(this),this._promise)}_process(t){return this._state===to.READY?!0:(this._state===to.PROCESSING&&SJe(this,t),this._resourcesLoaded&&this._state===to.POST_PROCESSING&&(wJe(this,t.context),this._state=to.PROCESSED),this._resourcesLoaded&&this._state===to.PROCESSED?(o0e(this),this._typedArray=void 0,this._state=to.READY,!0):!1)}_processTextures(t){if(this._textureState===to.READY)return!0;if(this._textureState!==to.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=to.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===to.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=vJe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=to.FAILED;let o=this._processError;this._processError=void 0,T3(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===to.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=to.FAILED,T3(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=to.FAILED,T3(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===to.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Bi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,UZe(this),o0e(this),zZe(this),VZe(this),jZe(this),HZe(this),this._components=void 0,this._typedArray=void 0,this._state=to.UNLOADED}};async function CJe(e){e._state=to.LOADING,e._textureState=to.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=to.LOADED,e._textureState=to.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=to.FAILED,e._textureState=to.FAILED,T3(e,t)}}async function vJe(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new f3({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=kZe(e,t);return e._state=to.PROCESSING,e._textureState=to.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Bi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function T3(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function SJe(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=to.POST_PROCESSING)}function wJe(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)&&IJe(e,r)}}function IJe(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 PJe(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 DJe(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 l0e(e,t){let n=Bi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function q$(e,t,n){let i=t.byteOffset,r=hf(e,t),o=t.count,s=sd(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=sy(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 RJe(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 OJe(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 MJe(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=q$(o,n,t.typedArray);i=i??!1,OJe(n,s,r,i)}function vD(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=l0e(e,r),s=MJe(e,o,t,n,i);return e._loaderPromises.push(s),i}return RJe(t,i)}function Rh(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=l0e(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=q$(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function vu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function NJe(e){return e===Number?0:new e}function LJe(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 FJe={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function BJe(e,t){let n=LJe(e.componentDatatype),i=FJe[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 kJe(e,t,n){let i=e.decodeMatrix,r=vu(n,e.decodedMin),o=vu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);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 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 UJe(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new Q$e;c.name=n,c.semantic=i,c.setIndex=r,c.constant=NJe(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=vu(s,o.min),c.max=vu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=hf(e,o),sr(o,"WEB3D_quantized_attributes")&&kJe(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&&BJe(c,s),c}function u0e(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var zJe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Y$(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=zJe;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function VJe(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function jJe(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 HJe(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 GJe(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=q$(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function f0e(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)?u0e(g):void 0,b=UJe(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=PJe(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])?jJe(b,x,s,a):l(o)?HJe(b,x,s,a):GJe(u,f,b,x,s,a)},b}function d0e(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=f0e(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new XC.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function WJe(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=Y$(e,Fo,i),u=c.modelSemantic,f=u===Fo.TRANSLATION||u===Fo.ROTATION||u===Fo.SCALE,d=u===Fo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return f0e(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function qJe(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 eJe;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=DJe(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 XC.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function YJe(e,t,n){return new Gt({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function Ml(e,t,n,i,r){let o=e.gltfJson,s=mf.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=mf.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=to.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=YJe(d.sampler,i,r))},c}function XJe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new _Je;return l(i)&&(c.diffuseTexture=Ml(e,i,n)),l(r)&&(c.specularGlossinessTexture=Ml(e,r,n)),c.diffuseFactor=vu(se,o),c.specularFactor=vu(h,s),c.glossinessFactor=a,c}function KJe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new gJe;return l(i)&&(c.baseColorTexture=Ml(e,i,n)),l(r)&&(c.metallicRoughnessTexture=Ml(e,r,n)),c.baseColorFactor=vu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function $Je(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new yJe;return l(r)&&(a.specularTexture=Ml(e,r,n)),l(s)&&(a.specularColorTexture=Ml(e,s,n)),a.specularFactor=i,a.specularColorFactor=vu(h,o),a}function JJe(e,t,n){let{anisotropyStrength:i=H$.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=H$.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new H$;return l(o)&&(s.anisotropyTexture=Ml(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function ZJe(e,t,n){let{clearcoatFactor:i=G$.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=G$.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new G$;return l(r)&&(c.clearcoatTexture=Ml(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=Ml(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Ml(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function QJe(e){return new AJe(e)}function eZe(e){if(!l(e))return;let t=new bJe;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 tZe(e,t,n){let i=new xJe,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=XJe(e,o,n):(l(u)&&(i.metallicRoughness=KJe(e,u,n)),l(s)&&!i.unlit&&(i.specular=$Je(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=JJe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=ZJe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ml(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ml(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ml(e,t.occlusionTexture,n)),i.emissiveFactor=vu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=QJe(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=eZe(r.BENTLEY_materials_line_style),i}function h0e(e,t){let n=new s0e;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 m0e(e,t,n,i){let r=new s0e,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=u0e(o.attribute),r.positionalLabel=i,r}function p0e(e,t){let n=new c0e;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 g0e(e,t,n,i){let r=new c0e,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 nZe(e,t,n,i){let r=new a0e;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=Ml(e,o,n,Wt.NEAREST,Zn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function iZe(e,t,n,i,r,o){let s=new a0e,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=Ml(e,c,i,Wt.NEAREST,Zn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function rZe(e,t,n,i,r){let o=new tJe,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=Y$(e,ct,f),g=d0e(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function oZe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function _0e(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=vu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function sZe(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 aZe(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=Rh(e,a),u=sZe(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:_0e(e,f)}}return i}function cZe(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=Rh(e,r)}if(n.materialColor=_0e(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=Rh(e,r))}return l(t.lineStrings)&&(n.lineStrings=aZe(e,t.lineStrings,t.material)),n}function lZe(e,t,n,i){let r=new nJe,o=new XC(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=tZe(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=fZe(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=dZe(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=uZe(e,d,o)),r.edgeVisibility=cZe(e,a.EXT_mesh_primitive_edge_visibility);let p=oZe(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],_=Y$(e,ct,O),C=_.modelSemantic;if(g&&!VJe(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=d0e(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(rZe(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=qJe(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)?hZe(e,r,E,i):S&&mZe(e,r,v,i),l(T)?pZe(r,T):S&&gZe(e,r,v),l(I)&&_Ze(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 uZe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return vD(e,i,!1)}function fZe(e,t,n){let i=new EJe,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=Rh(e,r[t.indices]),i.loopIndicesOffsets=Rh(e,r[n.indicesOffsets]),i.triangleIndices=Rh(e,r[n.triangleIndices]),i.triangleIndicesOffsets=Rh(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=Rh(e,r[n.loopIndices]),i.loopIndicesOffsets=Rh(e,r[n.loopIndicesOffsets]),i.triangleIndices=Rh(e,r[t.indices]),i.triangleIndicesOffsets=Rh(e,r[n.indicesOffsets])),i}function dZe(e,t){if(!l(t))return;let n=new TJe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return vD(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 hZe(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=nZe(e,s,i,a):l(s.attribute)?c=h0e(s,a):c=p0e(s,a),t.featureIds.push(c)}}function mZe(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=m0e(u,d,p,g):m=g0e(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=iZe(e,u,d,i,p,g);t.featureIds.push(m)}}function pZe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function gZe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function _Ze(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function yZe(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new iJe,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(WJe(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)?AZe(r,a):l(c)&&bZe(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function AZe(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=h0e(r,o):s=p0e(r,o),e.featureIds.push(s)}}function bZe(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=m0e(a,u,f,d):p=g0e(a,u,f,d),t.featureIds.push(p)}}function xZe(e,t,n){let i=new oJe;i.name=t.name,i.matrix=vu(M,t.matrix),i.translation=vu(h,t.translation),i.rotation=vu(Le,t.rotation),i.scale=vu(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=yZe(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=x3(u);for(let g=0;g<f.length;++g)i.primitives.push(lZe(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 TZe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=xZe(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 EZe(e,t,n){let i=new rJe,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=vD(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(M.IDENTITY);return i}function CZe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=EZe(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 vZe(e,t,n,i){let r=new c3({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 SZe(e,t,n,i){let r=new b3({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 wZe(e,t){let n=new aJe,i=e.gltfJson.accessors,r=i[t.input];n.input=vD(e,r);let o=t.interpolation;n.interpolation=mp[o]??mp.LINEAR;let s=i[t.output];return n.output=vD(e,s,!0),n}function IZe(e,t){let n=new cJe,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=sJe[r],n}function PZe(e,t,n){let i=new lJe,r=e.sampler;return i.sampler=t[r],i.target=IZe(e.target,n),i}function DZe(e,t,n){let i=new uJe;i.name=t.name;let r=t.samplers.map(function(s,a){let c=wZe(e,s);return c.index=a,c}),o=t.channels.map(function(s){return PZe(s,r,n)});return i.samplers=r,i.channels=o,i}function RZe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=DZe(e,r,t);return s.index=o,s})}function OZe(e){let t=new fJe;t.name=e.name;let n=e.type.toUpperCase();return t.type=Ol[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function MZe(e){let t=new dJe;return t.name=e.name,t.stages=e.stages.map(OZe),t}function NZe(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(MZe):[]}function LZe(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 FZe(e,t){let n=new mJe,i=LZe(e);return n.nodes=i.map(function(r){return t[r]}),n}var BZe=new h;function kZe(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=TZe(e,t),c=CZe(e,a),u=RZe(e,a),f=NZe(n),d=FZe(n,a),p=new pJe,g=new hJe,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,BZe);p.transform=M.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=vZe(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=g3.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=SZe(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return ti(b,e._loaderPromises),e._incrementallyLoadTextures||ti(b,e._texturesPromises),Promise.all(b)}function UZe(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 o0e(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 zZe(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 VZe(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 jZe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function HZe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var md=W$;function $C(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})}$C.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};$C.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};$C.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)};$C.prototype.isDestroyed=function(){return!1};$C.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var E3=$C;var Nl={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===Nl.RGBA4||e===Nl.RGBA8||e===Nl.RGBA16F||e===Nl.RGBA32F||e===Nl.RGB5_A1||e===Nl.RGB565||e===Nl.DEPTH_COMPONENT16||e===Nl.STENCIL_INDEX8||e===Nl.DEPTH_STENCIL||e===Nl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Nl.RGBA32F:e===te.HALF_FLOAT_OES?Nl.RGBA16F:Nl.RGBA8}};Object.freeze(Nl);var Su=Nl;function SD(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=zt.maximumRenderbufferSize,r=e.format??Su.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(SD.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});SD.prototype._getRenderbuffer=function(){return this._renderbuffer};SD.prototype.isDestroyed=function(){return!1};SD.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var pd=SD;function ha(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(ha.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}}});ha.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])};ha.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:Gt.NEAREST}),this._numSamples>1){let a=Su.getColorFormat(r);this._colorRenderbuffers[s]=new pd({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:Gt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new pd({context:e,width:t,height:n,format:Su.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new pd({context:e,width:t,height:n,format:Su.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:Gt.NEAREST}):this._depthRenderbuffer=new pd({context:e,width:t,height:n,format:Su.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new E3({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})}};ha.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};ha.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ha.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};ha.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ha.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ha.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ha.prototype.getDepthTexture=function(){return this._depthTexture};ha.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ha.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ha.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ha.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ha.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ha.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ha.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ha.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ha.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=ha;var C3=`uniform sampler2D u_pointCloud_colorGBuffer; +uniform sampler2D u_pointCloud_depthGBuffer; +uniform vec2 u_distanceAndEdlStrength; +in vec2 v_textureCoordinates; +vec2 neighborContribution(float log2Depth, vec2 offset) +{ +float dist = u_distanceAndEdlStrength.x; +vec2 texCoordOrig = v_textureCoordinates + offset * dist; +vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); +vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); +float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); +float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); +if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { +return vec2(0.0); +} +float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); +return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +} +void main() +{ +float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); +eyeCoordinate /= eyeCoordinate.w; +float log2Depth = log2(-eyeCoordinate.z); +if (depthOrLogDepth == 0.0) +{ +discard; +} +vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); +vec2 texelSize = 1.0 / czm_viewport.zw; +vec2 responseAndCount = vec2(0.0); +responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); +responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); +responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); +responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); +float response = responseAndCount.x / responseAndCount.y; +float strength = u_distanceAndEdlStrength.y; +float shade = exp(-response * 300.0 * strength); +color.rgb *= shade; +out_FragColor = vec4(color); +gl_FragDepth = depthOrLogDepth; +} +`;function JC(){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(JC.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 GZe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var X$=new U;function WZe(e,t){let n=new Xe({defines:["LOG_DEPTH_WRITE"],sources:[C3]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return X$.x=e._radius,X$.y=e._strength,X$}},r=Ge.fromCache({blending:nn.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 hi({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function qZe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),WZe(e,t)}function y0e(e){return e.drawBuffers&&e.fragmentDepth}JC.isSupported=y0e;function YZe(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 + czm_writeLogDepth(); + out_FragData_1 = czm_packDepth(gl_FragDepth); +#else + out_FragData_1 = czm_packDepth(gl_FragCoord.z); +#endif +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}JC.prototype.update=function(e,t,n,i){if(!y0e(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,qZe(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=YZe(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)};JC.prototype.isDestroyed=function(){return!1};JC.prototype.destroy=function(){return GZe(this),le(this)};var Ay=JC;function A0e(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}A0e.isSupported=function(e){return Ay.isSupported(e.context)};var ng=A0e;var Ac={},XZe=new se(0,0,0,1),Qc=new se,KZe=new et,K$=new U,$$=new U;Ac.worldToWindowCoordinates=function(e,t,n){return Ac.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var b0e=new se,x0e=new h;function wD(e,t,n,i){let r=n.viewMatrix,o=M.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,b0e),b0e),s=h.multiplyComponents(t,h.normalize(o,x0e),x0e);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 $Ze=new he(Math.PI,P.PI_OVER_TWO),JZe=new h,ZZe=new h;Ac.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Ac.computeActualEllipsoidPosition(r,t,XZe);if(!l(o))return;let s=e.canvas,a=KZe;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=$Ze,p=f.project(d,JZe),g=h.clone(c.position,ZZe),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,Qc=wD(o,n,c,Qc),Ac.clipToGLWindowCoordinates(a,Qc,K$),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,Qc=wD(o,n,c,Qc),Ac.clipToGLWindowCoordinates(a,Qc,$$)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,Qc=wD(o,n,c,Qc),Ac.clipToGLWindowCoordinates(a,Qc,K$),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,Qc=wD(o,n,c,Qc),Ac.clipToGLWindowCoordinates(a,Qc,$$)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(K$,i),(i.x<0||i.x>s.clientWidth)&&(i.x=$$.x)}}if(r.mode!==re.SCENE2D||u){if(Qc=wD(o,n,c,Qc),Qc.z<0&&!(c.frustum instanceof _n)&&!(c.frustum instanceof ws))return;i=Ac.clipToGLWindowCoordinates(a,Qc,i)}return i.y=s.clientHeight-i.y,i};Ac.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ac.worldToWindowCoordinates(e,t,n),!!l(n))return Ac.transformWindowToDrawingBuffer(e,n,n)};var ig=new h,QZe=new he;Ac.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,QZe);if(!l(o))return;if(r.project(o,ig),i===re.COLUMBUS_VIEW)return h.fromElements(ig.z,ig.x,ig.y,n);if(i===re.SCENE2D)return h.fromElements(0,ig.x,ig.y,n);let s=e.morphTime;return h.fromElements(P.lerp(ig.z,t.x,s),P.lerp(ig.x,t.y,s),P.lerp(ig.y,t.z,s),n)};var T0e=new h,E0e=new h,C0e=new M;Ac.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,T0e),M.computeViewportTransformation(e,0,1,C0e),M.multiplyByPoint(C0e,T0e,E0e),U.fromCartesian3(E0e,n)};Ac.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 eQe=new se,v0e=new se;Ac.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,eQe);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,v0e);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=v0e,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 pr=Ac;var ZC={};ZC._deprecationWarning=Yr;var rg=Uint32Array.BYTES_PER_ELEMENT;ZC.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=rg;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+=rg;let s=r.getUint32(t,!0);t+=rg;let a=r.getUint32(t,!0);t+=rg;let c=r.getUint32(t,!0);t+=rg;let u=r.getUint32(t,!0);t+=rg;let f=r.getUint32(t,!0);t+=rg;let d;u>=570425344?(t-=rg*2,d=a,u=c,f=0,a=0,c=0,ZC._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-=rg,d=u,u=a,f=c,a=0,c=0,ZC._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=No(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=No(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):(ZC._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 v3=ZC;function ID(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function S0e(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 tQe(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}ID.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,S0e(this,e,t,n,1,i.byteOffset)):i};ID.prototype.hasProperty=function(e){return l(this.json[e])};ID.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)),S0e(this,e,t,n,this.featuresLength,i.byteOffset)):tQe(this,e,t,i)};ID.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=ID;function PD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=nQe(n),a;l(s.jsonProperties)&&(a=new _y({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new bC({extension:s.hierarchy,binaryBody:i}));let u=fp.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=rQe(t,u,f,i,o);g=A.transcodedSchema,p=[new WC({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=iQe(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new Sh({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 Cu({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 Qa(y)}function nQe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(PD._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 iQe(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=Th(p);o[d]={bufferView:a},r[d]=w0e(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=xu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function rQe(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=w0e(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Th(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new vn.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)&&(PD._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=xu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function w0e(e){let t=oQe(e.componentType);return{type:e.type,componentType:t}}function oQe(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"}}PD._deprecationWarning=Yr;PD._oneTimeWarning=yt;var by=PD;var rx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},sQe=vn.FeatureIdAttribute,J$=class extends ar{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??qi.Y,f=t.forwardAxis??qi.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=rx.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=v3.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 md({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=rx.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=rx.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return aQe(f,d)}),this._promise}process(t){if(this._state===rx.READY)return!0;if(this._state!==rx.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),cQe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=rx.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function aQe(e,t){return e.unload(),e._state=rx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function cQe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=by({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Cu({name:fp.BATCH_TABLE_CLASS_NAME,count:i});r=new Qa({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)I0e(o[a]);t.structuralMetadata=r}function I0e(e){let t=e.children.length;for(let i=0;i<t;i++)I0e(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 sQe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var S3=J$;var Z$=class extends ar{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=xQe(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function lQe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function uQe(){this.features=[]}function Q$(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function eJ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=Q$(e[r]);return[n]}function fQe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=eJ(e[i])[0];return n}function P0e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=eJ(e[i])[0];return n}function dQe(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=P0e(e[i]);ti(n,r)}return n}function hQe(e){return[Q$(e)]}function mQe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=Q$(e[i]);return n}var pQe={LineString:eJ,MultiLineString:fQe,MultiPolygon:dQe,Polygon:P0e,MultiPoint:mQe,Point:hQe},gQe={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function D0e(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=pQe[n],r=gQe[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new lQe;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function _Qe(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)D0e(n[r],t)}var yQe={FeatureCollection:_Qe,Feature:D0e},w3=new h;function AQe(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,w3),B=M.multiplyByPoint(t,V,w3);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=nt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=nt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=nt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new vn.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 vn.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 vn.Material;E.unlit=!0;let v=new vn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new vn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new vn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function bQe(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,w3),O=M.multiplyByPoint(t,R,w3);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=nt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=nt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new vn.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 vn.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 vn.Material;y.unlit=!0;let A=new vn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new vn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function xQe(e,t){let n=new uQe,i=yQe[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 _y({count:o,properties:s}),u=[new Cu({id:0,count:o,jsonMetadataTable:a})],f=xu.fromJson({}),d=new Qa({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(AQe(r,T,t)),y&&E.push(bQe(r,T,t));let v=new vn.Node;v.index=0,v.primitives=E;let S=[v],I=new vn.Scene;I.nodes=S;let R=new vn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var I3=Z$;var P3={};P3._deprecationWarning=Yr;var xy=Uint32Array.BYTES_PER_ELEMENT;P3.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=No(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=No(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):(P3._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 D3=P3;var og={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},R3=vn.Attribute,TQe=vn.FeatureIdAttribute,O0e=vn.Instances,tJ=class extends ar{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??qi.Y,f=t.forwardAxis??qi.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=og.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=D3.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=uf(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 md(f);return this._gltfLoader=d,this._state=og.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=og.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw EQe(this,p)}),this._promise}process(t){if(this._state===og.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===og.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=M.multiplyTransformation(this._transform,r.transform,r.transform),SQe(this,r,t),CQe(this,r),this._components=r,this._arrayBuffer=void 0,this._state=og.READY,!0}isUnloaded(){return this._state===og.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),RQe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=og.UNLOADED}};function EQe(e,t){return e.unload(),e._state=og.FAILED,e.getError("Failed to load i3dm",t)}function CQe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=by({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Cu({name:fp.BATCH_TABLE_CLASS_NAME,count:i});r=new Qa({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var O3=new h,nJ=new Array(4),vQe=new M;function SQe(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=IQe(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=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,O3),f[3*i+0]=O3.x,f[3*i+1]=O3.y,f[3*i+2]=O3.z;let j=M.fromTranslation(B.center,vQe);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&&(PQe(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&&(DQe(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 O0e;O.transformInWorldSpace=!0;let L=e._buffers,_=new R3;if(_.name="Instance Translation",_.semantic=Fo.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=nt.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 R3;B.name="Instance Rotation",B.semantic=Fo.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new R3;if(B.name="Instance Scale",B.semantic=Fo.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=nt.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 R3;C.name="Instance Feature ID",C.setIndex=0,C.semantic=Fo.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=nt.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 TQe;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?wQe(O):O,V=!0)}}function wQe(e){let t=new O0e;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 IQe(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 R0e=new Array(4);function PQe(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,nJ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,R0e),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,nJ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,R0e);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 DQe(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,nJ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function RQe(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 M3=tJ;var M0e={STOPPED:0,ANIMATING:1};Object.freeze(M0e);var gp=M0e;function QC(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}QC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};QC.prototype.evaluate=pe.throwInstantiationError;QC.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};QC.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};QC.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var Or=QC;function ev(e){this._value=e,this._valueType=Or.getPointType(e)}Object.defineProperties(ev.prototype,{value:{get:function(){return this._value}}});ev.prototype.findTimeInterval=function(e){};ev.prototype.wrapTime=function(e){return 0};ev.prototype.clampTime=function(e){return 0};ev.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var N3=ev;function tv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(tv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});tv.prototype.findTimeInterval=Or.prototype.findTimeInterval;tv.prototype.wrapTime=Or.prototype.wrapTime;tv.prototype.clampTime=Or.prototype.clampTime;tv.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 ox=tv;var N0e={};N0e.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 DD=N0e;var L0e=[],F0e=[],B0e=[],k0e=[];function OQe(e,t,n){let i=L0e,r=B0e,o=F0e,s=k0e;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),DD.solve(i,o,r,s)}function MQe(e){let t=L0e,n=B0e,i=F0e,r=k0e;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),DD.solve(t,i,n,r)}function wu(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=Or.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(wu.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}}});wu.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 wu({times:t,points:n,inTangents:o,outTangents:r})};wu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new ox({points:n,times:t});let i=MQe(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new wu({times:t,points:n,inTangents:o,outTangents:r})};wu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Or.getPointType(n[0]);if(n.length<3)return new ox({points:n,times:t});let s=OQe(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new wu({times:t,points:n,inTangents:c,outTangents:a})};wu.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);wu.prototype.findTimeInterval=Or.prototype.findTimeInterval;var NQe=new se,nv=new h;wu.prototype.wrapTime=Or.prototype.wrapTime;wu.prototype.clampTime=Or.prototype.clampTime;wu.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=NQe;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(wu.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,nv),d.add(t,nv,t),d.multiplyByScalar(o[s],f.z,nv),d.add(t,nv,t),d.multiplyByScalar(r[s],f.w,nv),d.add(t,nv,t))};var sx=wu;function iv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(iv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});iv.prototype.findTimeInterval=Or.prototype.findTimeInterval;iv.prototype.wrapTime=Or.prototype.wrapTime;iv.prototype.clampTime=Or.prototype.clampTime;iv.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=iv;function LQe(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 rv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=LQe(this),this._lastTimeIndex=0}Object.defineProperties(rv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});rv.prototype.findTimeInterval=Or.prototype.findTimeInterval;rv.prototype.wrapTime=Or.prototype.wrapTime;rv.prototype.clampTime=Or.prototype.clampTime;rv.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var F3=rv;var ov=vn.AnimatedPropertyType;function iJ(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,zQe(this)}Object.defineProperties(iJ.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 FQe(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 sx({times:e,points:n,inTangents:i,outTangents:r})}function U0e(e,t,n,i){if(e.length===1&&t.length===1)return new N3(t[0]);switch(n){case mp.STEP:return new L3({times:e,points:t});case mp.CUBICSPLINE:return FQe(e,t);case mp.LINEAR:return i===ov.ROTATION?new F3({times:e,points:t}):new ox({times:e,points:t})}}function BQe(e,t,n,i,r){let o=[];if(i===ov.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===mp.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(U0e(e,f,n,i))}}else o.push(U0e(e,t,n,i));return o}var kQe=new h,UQe=new Le;function zQe(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=BQe(i,r,o,a,u);e._splines=f,e._path=a}iJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===ov.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===ov.TRANSLATION||n===ov.SCALE?r[n]=o.evaluate(s,kQe):n===ov.ROTATION&&(r[n]=o.evaluate(s,UQe))}}};var B3=iJ;function rJ(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??pf.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=gp.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,VQe(this)}Object.defineProperties(rJ.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 VQe(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 B3({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}rJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var k3=rJ;function sg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(sg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function oJ(e,t,n){let i=e._model,r=new k3(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}sg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return oJ(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 oJ(this,n[i],e)};sg.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=oJ(this,n[o],e);i.push(s)}return i};sg.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};sg.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])};sg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};sg.prototype.get=function(e){return this._runtimeAnimations[e]};var U3=[];function jQe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}sg.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===pf.REPEAT||a.loop===pf.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===gp.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===gp.ANIMATING){if(y&&a._state===gp.STOPPED&&(a._state=gp.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===pf.REPEAT)g=g-Math.floor(g);else if(a.loop===pf.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=gp.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&U3.push(a))}}n=U3.length;for(let s=0;s<n;++s){let a=U3[s];t.splice(t.indexOf(a),1),e.afterRender.push(jQe(this,o,a))}return U3.length=0,i};var z3=sg;function ax(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(ax.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}}});ax.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};ax.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};ax.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};ax.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};ax.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var V3=ax;var sv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};sv.getStyleCommandsNeeded=function(e,t){return t===0?sv.ALL_OPAQUE:t===e?sv.ALL_TRANSLUCENT:sv.OPAQUE_AND_TRANSLUCENT};Object.freeze(sv);var _p=sv;var ag={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};ag.is3DTiles=function(e){switch(e){case ag.TILE_GLTF:case ag.TILE_B3DM:case ag.TILE_I3DM:case ag.TILE_PNTS:case ag.TILE_GEOJSON:return!0;case ag.GLTF:return!1}};Object.freeze(ag);var $o=ag;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=_p.ALL_OPAQUE,HQe(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 HQe(e){let t=e._model,n=$o.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 la(s,r)}else for(r=0;r<i;r++)o[r]=new V3({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Au({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=_p.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 GQe=new z;ps.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Au.DEFAULT_COLOR_VALUE),this.setAllShow(Au.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,GQe)??Au.DEFAULT_COLOR_VALUE:Au.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Au.DEFAULT_SHOW_VALUE:Au.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(),le(this)};var j3=ps;var Ty={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};Ty.includesVertexShader=function(e){return(e&Ty.VERTEX)!==0};Ty.includesFragmentShader=function(e){return(e&Ty.FRAGMENT)!==0};Ty.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};Ty.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(Ty);var de=Ty;var z0e={name:"TilesetPipelineStage"};z0e.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=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK};var H3=z0e;var G3=`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; +vec2 tTrigs = vec2(0.70710678118); +vec2 v = radii * tTrigs; +vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; +vec2 q = normalize(p - evolute) * length(v - evolute); +tTrigs = (q + evolute) * inverseRadii; +tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); +v = radii * tTrigs; +return v * sign(pos); +} +vec3 computeEllipsoidPositionWC(vec3 positionMC) { +vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; +vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); +vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); +return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); +} +void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { +vec3 fogColor = groundAtmosphereColor.rgb; +const float NONE = 0.0; +if (czm_atmosphereDynamicLighting != NONE) { +float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); +fogColor *= darken; +} +#ifndef HDR +fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); +fogColor.rgb = czm_inverseGamma(fogColor.rgb); +#endif +vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); +color = vec4(withFog, color.a); +} +void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { +vec3 rayleighColor; +vec3 mieColor; +float opacity; +vec3 positionWC; +vec3 lightDirection; +if (false) { +positionWC = computeEllipsoidPositionWC(attributes.positionMC); +lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); +czm_computeGroundAtmosphereScattering( +positionWC, +lightDirection, +rayleighColor, +mieColor, +opacity +); +} else { +positionWC = attributes.positionWC; +lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); +rayleighColor = v_atmosphereRayleighColor; +mieColor = v_atmosphereMieColor; +opacity = v_atmosphereOpacity; +} +const bool ignoreBlackPixels = true; +rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); +mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); +vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); +if (u_isInFog) { +float distanceToCamera = length(attributes.positionEC); +applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); +} else { +} +} +`;var W3=`void atmosphereStage(ProcessedAttributes attributes) { +vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); +czm_computeGroundAtmosphereScattering( +v_positionWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); +} +`;var V0e={name:"AtmospherePipelineStage"};V0e.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([W3]),i.addFragmentLines([G3]),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 q3=V0e;var Y3=`#ifdef DIFFUSE_IBL +vec3 sampleDiffuseEnvironment(vec3 cubeDir) +{ +#ifdef CUSTOM_SPHERICAL_HARMONICS +return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); +#else +return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); +#endif +} +#endif +#ifdef SPECULAR_IBL +vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +{ +#ifdef CUSTOM_SPECULAR_IBL +float lod = roughness * model_specularEnvironmentMapsMaximumLOD; +return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; +#else +float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; +return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; +#endif +} +vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +{ +vec3 f90 = max(vec3(1.0 - roughness), f0); +vec3 F = fresnelSchlick2(f0, f90, NdotV); +vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; +vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); +return specularSample * (F * brdfLut.x + brdfLut.y); +} +#endif +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { +vec3 f0 = material.specular; +float roughness = material.roughness; +float specularWeight = 1.0; +#ifdef USE_SPECULAR +specularWeight = material.specularWeight; +#endif +float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); +vec3 f90 = max(vec3(1.0 - roughness), f0); +vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); +vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; +vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); +#ifdef DIFFUSE_IBL +vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); +vec3 irradiance = sampleDiffuseEnvironment(normalMC); +vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; +float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); +vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); +vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; +vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; +#else +vec3 diffuseContribution = vec3(0.0); +#endif +#ifdef USE_ANISOTROPY +vec3 anisotropyDirection = material.anisotropicB; +vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); +vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); +float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); +float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; +vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); +vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); +#else +vec3 reflectEC = reflect(-viewDirectionEC, normalEC); +#endif +#ifdef SPECULAR_IBL +vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); +vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); +vec3 specularContribution = radiance * FssEss * model_iblFactor.y; +#else +vec3 specularContribution = vec3(0.0); +#endif +return diffuseContribution + specularContribution; +} +#endif +`;var j0e={name:"ImageBasedLightingPipelineStage"},WQe=new U;j0e.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),ip.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(Y3);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,WQe)},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 X3=j0e;var qQe=P.EPSILON16;function aJ(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(aJ.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,qQe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var YQe=new h,sJ=new $;aJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=YQe,r;switch(t){case Ol.XROTATE:r=$.fromRotationX(P.toRadians(n),sJ),e=M.multiplyByMatrix3(e,r,e);break;case Ol.YROTATE:r=$.fromRotationY(P.toRadians(n),sJ),e=M.multiplyByMatrix3(e,r,e);break;case Ol.ZROTATE:r=$.fromRotationZ(P.toRadians(n),sJ),e=M.multiplyByMatrix3(e,r,e);break;case Ol.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Ol.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Ol.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case Ol.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case Ol.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case Ol.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case Ol.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var K3=aJ;function $3(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,XQe(this)}Object.defineProperties($3.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 XQe(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 K3({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}$3.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var KQe=new M,$Qe=new M;$3.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,KQe),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,$Qe);s.transform=a}};var J3=$3;var Z3=`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 av={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};av.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(Z3);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",av.COLOR_UNIFORM_NAME,de.FRAGMENT),r[av.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",av.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[av.COLOR_BLEND_UNIFORM_NAME]=function(){return Rl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var cx=av;var Q3=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +vec4 getClippingPlane( +highp sampler2D packedClippingPlanes, +int clippingPlaneNumber, +mat4 transform +) { +int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; +int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); +float u = (float(pixX) + 0.5) * pixelWidth; +float v = (float(pixY) + 0.5) * pixelHeight; +vec4 plane = texture(packedClippingPlanes, vec2(u, v)); +return czm_transformPlane(plane, transform); +} +#else +vec4 getClippingPlane( +highp sampler2D packedClippingPlanes, +int clippingPlaneNumber, +mat4 transform +) { +int clippingPlaneStartIndex = clippingPlaneNumber * 2; +int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; +int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); +float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); +float u = (float(pixX) + 0.5) * pixelWidth; +float v = (float(pixY) + 0.5) * pixelHeight; +vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; +vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); +vec4 plane; +plane.xyz = czm_octDecode(oct, 65535.0); +plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); +return czm_transformPlane(plane, transform); +} +#endif +float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { +vec4 position = czm_windowToEyeCoordinates(fragCoord); +vec3 clipNormal = vec3(0.0); +vec3 clipPosition = vec3(0.0); +float pixelWidth = czm_metersPerPixel(position); +#ifdef UNION_CLIPPING_REGIONS +float clipAmount; +#else +float clipAmount = 0.0; +bool clipped = true; +#endif +for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { +vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); +clipNormal = clippingPlane.xyz; +clipPosition = -clippingPlane.w * clipNormal; +float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; +#ifdef UNION_CLIPPING_REGIONS +clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); +if (amount <= 0.0) { +discard; +} +#else +clipAmount = max(amount, clipAmount); +clipped = clipped && (amount <= 0.0); +#endif +} +#ifndef UNION_CLIPPING_REGIONS +if (clipped) { +discard; +} +#endif +return clipAmount; +} +void modelClippingPlanesStage(inout vec4 color) +{ +float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); +vec4 clippingPlanesEdgeColor = vec4(1.0); +clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; +float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; +if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { +color = clippingPlanesEdgeColor; +} +} +`;var H0e={name:"ModelClippingPlanesPipelineStage"},JQe=new U,ZQe=new M,QQe=new M;H0e.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),Ps.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Ps.getTextureResolution(i,r,JQe);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(Q3);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,ZQe);return M.multiply(c,t._clippingPlanesMatrix,QQe)}};e.uniformMap=Ot(a,e.uniformMap)};var eU=H0e;var tU=`void modelClippingPolygonsStage() +{ +bool insideAny = vectorClip(v_clippingUv); +#ifdef CLIPPING_INVERSE +if (!insideAny) +{ +discard; +} +#else +if (insideAny) +{ +discard; +} +#endif +} +`;var nU=`void modelClippingPolygonsStage() +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; +} +`;var Ey=`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; +} +} +return inside; +} +`;var W0e={name:"ModelClippingPolygonsPipelineStage"},eet=new U,tet=new U,G0e=ie.MAX_VALUE;W0e.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(nU),r.addFragmentLines(Ey),r.addFragmentLines(tU);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??G0e,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,eet)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??G0e;return U.fromElements(1/s.width,1/s.height,tet)},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 iU=W0e;var rU=`void modelVectorLookupStage(ProcessedAttributes attributes) +{ +vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; +v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; +} +`;var oU=`void modelVectorLookupStage(inout vec4 color) +{ +color = vectorPolygonRender(v_vectorUv, color); +color = vectorPolylineRender(v_vectorUv, color); +} +`;var net={name:"ModelVectorLookupPipelineStage",process:oet},iet=new U,ret=new U;function oet(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(rU),i.addFragmentLines(Ey),i.addFragmentLines(oU);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,iet)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,ret)},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 sU=net;function q0e(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(q0e.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 aU=q0e;var cU=`mat4 getInstancingTransform() +{ +mat4 instancingTransform; +#ifdef HAS_INSTANCE_MATRICES +instancingTransform = mat4( +a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, +a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, +a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, +a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 +); +#else +vec3 translation = vec3(0.0, 0.0, 0.0); +vec3 scale = vec3(1.0, 1.0, 1.0); +#ifdef HAS_INSTANCE_TRANSLATION +translation = a_instanceTranslation; +#endif +#ifdef HAS_INSTANCE_SCALE +scale = a_instanceScale; +#endif +instancingTransform = mat4( +scale.x, 0.0, 0.0, 0.0, +0.0, scale.y, 0.0, 0.0, +0.0, 0.0, scale.z, 0.0, +translation.x, translation.y, translation.z, 1.0 +); +#endif +return instancingTransform; +} +#ifdef USE_2D_INSTANCING +mat4 getInstancingTransform2D() +{ +mat4 instancingTransform2D; +#ifdef HAS_INSTANCE_MATRICES +instancingTransform2D = mat4( +a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, +a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, +a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, +a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 +); +#else +vec3 translation2D = vec3(0.0, 0.0, 0.0); +vec3 scale = vec3(1.0, 1.0, 1.0); +#ifdef HAS_INSTANCE_TRANSLATION +translation2D = a_instanceTranslation2D; +#endif +#ifdef HAS_INSTANCE_SCALE +scale = a_instanceScale; +#endif +instancingTransform2D = mat4( +scale.x, 0.0, 0.0, 0.0, +0.0, scale.y, 0.0, 0.0, +0.0, 0.0, scale.z, 0.0, +translation2D.x, translation2D.y, translation2D.z, 1.0 +); +#endif +return instancingTransform2D; } -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(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); -for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { -if (i >= PRIMARY_STEPS) { -break; +#endif +`;var lU=`void instancingStage(inout ProcessedAttributes attributes) +{ +vec3 positionMC = attributes.positionMC; +mat4 instancingTransform = getInstancingTransform(); +attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; +#endif +#ifdef USE_2D_INSTANCING +mat4 instancingTransform2D = getInstancingTransform2D(); +attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#endif } -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 uU=`void legacyInstancingStage( +inout ProcessedAttributes attributes, +out mat4 instanceModelView, +out mat3 instanceModelViewInverseTranspose) +{ +vec3 positionMC = attributes.positionMC; +mat4 instancingTransform = getInstancingTransform(); +mat4 instanceModel = instancingTransform * u_instance_nodeTransform; +instanceModelView = u_instance_modifiedModelView; +instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); +attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; +#ifdef USE_2D_INSTANCING +mat4 instancingTransform2D = getInstancingTransform2D(); +attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +#endif } -vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); -float lightHeight = length(lightPosition) - atmosphereInnerRadius; -lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; -lightPositionLength += lightStepLength; +`;var fU=new M,set=new M,aet=new M,X0e={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Q0e,_transformsToTypedArray:lJ};X0e.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(cU);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=[];Eet(e,n,i,d,u,f),wet(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,fU);return u?M.multiplyTransformation(n.context.uniformState.view3D,g,fU):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,fU)),M.multiplyTransformation(n.context.uniformState.view,g,fU))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,set)},o.addVertexLines(uU)):o.addVertexLines(lU),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,aet)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,ti(e.attributes,d)};var RD=new M,cet=new h;function uet(e,t,n,i,r){let o=M.multiplyTransformation(t,e,RD);return o=M.multiplyTransformation(o,n,RD),r=At.basisTo2D(i.mapProjection,o,r),r}function fet(e,t,n,i,r){let o=M.fromTranslation(e,RD),s=M.multiplyTransformation(t,o,RD);s=M.multiplyTransformation(s,n,RD);let a=M.getTranslation(s,cet);return r=pr.computeActualEllipsoidPosition(i,a,r),r}function K0e(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 $0e=new M,J0e=new M,det=new M,het=new h;function met(e,t,n,i){let r=$0e,o=J0e;K0e(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=uet(f,r,o,n,det),p=M.getTranslation(d,het),g=h.subtract(p,a,p);i[u]=M.setTranslation(d,g,i[u])}return i}function pet(e,t,n,i){let r=$0e,o=J0e;K0e(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=fet(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var get=new h,_et=new h;function Z0e(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=M.multiplyByPoint(i,n.instancingTranslationMin,get),o=pr.computeActualEllipsoidPosition(t,r,r),s=M.multiplyByPoint(i,n.instancingTranslationMax,_et),a=pr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function lJ(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 yet(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 Aet=new h,bet=new Le,xet=new h;function Q0e(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,Fo.TRANSLATION),o=xt.getAttributeBySemantic(e,Fo.ROTATION),s=xt.getAttributeBySemantic(e,Fo.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],Aet);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,bet),T=new h(m[A*3],m[A*3+1],m[A*3+2],xet),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 Tet(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 uJ(e,t){let n=nt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Eet(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Fo.ROTATION);l(s)||o?Cet(e,n,i,t,r,o):vet(e,n,i,t,r)}function Cet(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=Q0e(t,a,e);let A=lJ(d);p=uJ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(Y0e(e,p,n,f),!r)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Z0e(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=met(d,e,g,d),b=lJ(A);m=uJ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Y0e(e,m,n,"Transform2D")}function vet(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,Fo.TRANSLATION),u=xt.getAttributeBySemantic(t,Fo.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),cJ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=Tet(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),cJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Z0e(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=pet(f,e,g,f),T=yet(x);o&&(a.transformsTypedArray=T),m=uJ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;cJ(e,m,0,void 0,n,"Translation2D")}function Y0e(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`),ti(n,a)}function cJ(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 wet(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===Fo.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 dU=X0e;var ege=[],fJ={};fJ.name="ModelMatrixUpdateStage";fJ.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;tge(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function Iet(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function tge(e,t,n,i,r){let o,s=ege[r];l(s)||(s=ege[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];Iet(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}tge(u,t,n,i,r+1),u._transformDirty=!1}}var hU=fJ;var nge={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:ige,_countGeneratedBuffers:rge};nge.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;ige(i,r),rge(i,o)};function ige(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 rge(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 mU=nge;function cv(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,Pet(this)}Object.defineProperties(cv.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),dJ(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),dJ(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),dJ(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 Pet(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 Fb(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 dJ(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}cv.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};cv.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(dU),t.push(mU),n.push(hU)};cv.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};cv.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 pU=cv;var oge={name:"AlphaPipelineStage"};oge.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=nn.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 gU=oge;var sge={name:"BatchTexturePipelineStage"};sge.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 _U=sge;var age={name:"ClassificationPipelineStage"};age.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||Det(t,r)};function Det(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 yU=age;var AU=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +{ +bool styleTranslucent = (featureColor.a != 1.0); +if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) +{ +#ifdef HAS_SILHOUETTE +positionMC *= float(model_silhouettePass); +#else +positionMC *= 0.0; +#endif } -vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); -rayleighAccumulation += sampleDensity.x * attenuation; -mieAccumulation += sampleDensity.y * attenuation; -rayPositionLength += (rayStepLength += rayStepLengthIncrease); +else if (czm_pass != czm_passTranslucent && styleTranslucent) +{ +positionMC *= 0.0; } -rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; -mieColor = u_atmosphereMieCoefficient * mieAccumulation; -opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); } -vec4 computeAtmosphereColor( -vec3 positionWC, -vec3 lightDirection, -vec3 rayleighColor, -vec3 mieColor, -float opacity +void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) +{ +float show = ceil(feature.color.a); +positionMC *= show; +#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) +filterByPassType(positionMC, feature.color); +#endif +} +`;var bU=`void filterByPassType(vec4 featureColor) +{ +bool styleTranslucent = (featureColor.a != 1.0); +if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) +{ +#ifdef HAS_SILHOUETTE +if(!model_silhouettePass) { +discard; +} +#else +discard; +#endif +} +else if (czm_pass != czm_passTranslucent && styleTranslucent) +{ +discard; +} +} +void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) +{ +vec4 featureColor = feature.color; +if (featureColor.a == 0.0) +{ +discard; +} +#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) +filterByPassType(featureColor); +#endif +featureColor = czm_gammaCorrect(featureColor); +#ifdef HAS_CLASSIFICATION +material.diffuse = featureColor.rgb * featureColor.a; +#else +float highlight = ceil(model_colorBlend); +material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); +#endif +material.alpha *= featureColor.a; +} +`;var cge={name:"CPUStylingPipelineStage"};cge.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(AU),r.addFragmentLines(bU),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",cx.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[cx.COLOR_BLEND_UNIFORM_NAME]=function(){return Rl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var xU=cge;var hJ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};hJ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(hJ);var Cy=hJ;var TU=`void customShaderStage( +inout czm_modelVertexOutput vsOutput, +inout ProcessedAttributes attributes, +FeatureIds featureIds, +Metadata metadata, +MetadataClass metadataClass, +MetadataStatistics metadataStatistics ) { -vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; -vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); -float cosAngle = dot(cameraToPositionWCDirection, lightDirection); -float cosAngleSq = cosAngle * cosAngle; -float G = u_atmosphereMieAnisotropy; -float GSq = G * G; -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) * u_atmosphereLightIntensity; -return vec4(color, opacity); +VertexInput vsInput; +initializeInputStruct(vsInput, attributes); +vsInput.featureIds = featureIds; +vsInput.metadata = metadata; +vsInput.metadataClass = metadataClass; +vsInput.metadataStatistics = metadataStatistics; +vertexMain(vsInput, vsOutput); +attributes.positionMC = vsOutput.positionMC; } -`;var _3=`uniform samplerCube u_radianceMap; -in vec2 v_textureCoordinates; -const float twoSqrtPi = 2.0 * sqrt(czm_pi); -float computeShBasis(int index, vec3 s) { -if (index == 0) { -return 1.0 / twoSqrtPi; +`;var EU=`void customShaderStage( +inout czm_modelMaterial material, +ProcessedAttributes attributes, +FeatureIds featureIds, +Metadata metadata, +MetadataClass metadataClass, +MetadataStatistics metadataStatistics +) { +FragmentInput fsInput; +initializeInputStruct(fsInput, attributes); +fsInput.featureIds = featureIds; +fsInput.metadata = metadata; +fsInput.metadataClass = metadataClass; +fsInput.metadataStatistics = metadataStatistics; +fragmentMain(fsInput, material); } -if (index == 1) { -return -sqrt(3.0) * s.y / twoSqrtPi; +`;var CU=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { +initializeFeatureIds(featureIds, attributes); +initializeFeatureIdAliases(featureIds); } -if (index == 2) { -return sqrt(3.0) * s.z / twoSqrtPi; +`;var vU=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +{ +initializeFeatureIds(featureIds, attributes); +initializeFeatureIdAliases(featureIds); +setFeatureIdVaryings(); } -if (index == 3) { -return -sqrt(3.0) * s.x / twoSqrtPi; +`;var cr={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()"};cr.process=function(e,t,n){let i=e.shaderBuilder;Ret(i);let r=e.runtimeNode.node.instances;l(r)&&Oet(e,r,n),Met(e,t,n),i.addVertexLines(vU),i.addFragmentLines(CU)};function Ret(e){e.addStruct(cr.STRUCT_ID_FEATURE_IDS_VS,cr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(cr.STRUCT_ID_FEATURE_IDS_FS,cr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,cr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function Oet(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 vn.FeatureIdAttribute?Net(e,s,a):lge(e,s,a,r,1,n);let c=s.label;l(c)&&uge(e,a,c,de.BOTH)}}function Met(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 vn.FeatureIdAttribute?Let(e,a,c):a instanceof vn.FeatureIdImplicitRange?lge(e,a,c,o,void 0,n):(Fet(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&uge(e,c,f,u)}}function Net(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Let(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function lge(e,t,n,i,r,o){Bet(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(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Fet(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(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function uge(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Bet(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=ket(t,n);s=nt.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 ket(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 lx=cr;var SU=`void metadataStage( +FeatureIds featureIds, +out Metadata metadata, +out MetadataClass metadataClass, +out MetadataStatistics metadataStatistics, +ProcessedAttributes attributes +) +{ +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); } -if (index == 4) { -return sqrt(15.0) * s.y * s.x / twoSqrtPi; +`;var wU=`void metadataStage( +FeatureIds featureIds, +out Metadata metadata, +out MetadataClass metadataClass, +out MetadataStatistics metadataStatistics, +ProcessedAttributes attributes +) +{ +initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); +setMetadataVaryings(); +} +`;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=itt(r,t),f=Uet(o.propertyAttributes,t,a),d=Vet(o.propertyTextures,a),p=Get(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);Yet(i,g),$et(i),i.addVertexLines(wU),i.addFragmentLines(SU);for(let m=0;m<f.length;m++){let y=f[m];Jet(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Qet(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];ttt(e,y,c)}};function Uet(e,t,n){return l(e)?e.flatMap(i=>zet(i,t,n)):[]}function zet(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 Vet(e,t){return l(e)?e.flatMap(n=>jet(n,t)):[]}function jet(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 Het=4;function Get(e,t,n,i,r){if(!l(e))return[];let o=qet(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Wet(s,o,i,r))}function Wet(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(Het))continue;let y=u[g],A=de.intersection(stt(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 qet(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 Yet(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"?Ket(c):c;e.addStructField(a,p,d)}}}var Xet={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Ket(e){let t=Xet[e];return l(t)?t:e}function $et(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 Jet(e,t){Zet(e,t),mJ(e.shaderBuilder,t),pJ(e.shaderBuilder,t)}function Zet(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=gJ({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 Qet(e,t,n){ett(e,t,n),mJ(e.shaderBuilder,t),pJ(e.shaderBuilder,t)}function ett(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=gJ({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 mJ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=fge(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 pJ(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=fge(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 ttt(e,t,n){ntt(e,t,n),mJ(e.shaderBuilder,t),pJ(e.shaderBuilder,t)}function ntt(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=gJ({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 fge(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 gJ(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 itt(e,t){let n=new Set,i=new Set;return rtt(e,n,i),ott(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function rtt(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 ott(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 stt(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 Oh=Ii;var dge={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(dge);var ux=dge;var Oa={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};Oa.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===ux.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===ux.OPAQUE&&(o.pass=void 0);let u=mtt(s,t,e);if(!u.customShaderEnabled)return;if(ytt(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=Cy.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 att(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var ctt={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},ltt={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 hge(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=ctt[t],i=ltt[t];if(l(n))return{attributeField:[n,e],value:i}}function utt(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!gge(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=mge(t,r,!1),s=pge(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=hge(d);if(!l(p))return Oa._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 ftt(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 dtt(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!gge(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=mge(t,r,!0),s=pge(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=hge(p);if(!l(g))return Oa._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=ftt(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var htt={positionWC:!0,positionEC:!0};function mge(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 pge(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||htt.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 mtt(e,t,n){let i=att(t.attributes),r=Att(t,n.model.structuralMetadata),o=utt(e,i,r),s=dtt(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function ptt(e,t){let n=Oa.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Oa.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=Oa.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Oa.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Oa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,lx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Oh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Oh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Oh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Oa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Oa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function gtt(e,t){let n=Oa.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Oa.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=Oa.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Oa.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Oa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,lx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Oh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Oh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Oh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Oa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Oa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var _tt=[];function ytt(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=_tt;i.enabled&&(ptt(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,TU),e.addVertexLines(o)),r.enabled&&(gtt(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,EU),e.addFragmentLines(o))}function Att(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 gge(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Oa._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 IU=Oa;var OD={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};OD.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(OD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,OD.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);xtt(i,p),btt(e,p)}};function btt(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=_ge(u,0),f=_ge(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function _ge(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function xtt(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=Ttt(n,i):r=Ett(n),e.addFunctionLines(OD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function Ttt(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 Ett(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var PU=OD;var DU=`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; } -if (index == 5) { -return -sqrt(15.0) * s.y * s.z / twoSqrtPi; } -if (index == 6) { -return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi; } -if (index == 7) { -return -sqrt(15.0) * s.x * s.z / twoSqrtPi; +`;var yge={name:"EdgeDetectionPipelineStage"};yge.process=function(e){e.shaderBuilder.addFragmentLines([DU])};var RU=yge;var OU=`#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; } -if (index == 8) { -return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi; +float edgeTypeInt = v_edgeType * 255.0; +if (edgeTypeInt < 0.5) { +discard; } -return 0.0; +if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { +if (v_shouldDiscard > 0.5) { +discard; } -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); +vec4 finalColor = color; +#ifdef HAS_EDGE_COLOR_ATTRIBUTE +if (v_edgeColor.a >= 0.0) { +finalColor = v_edgeColor; } -return value; +#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; } -vec2 hammersley2D(int i, int N) -{ -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +#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 } -const int samples = 256; -const float solidAngle = 1.0 / float(samples); -void main() { -vec2 uv = v_textureCoordinates.xy * 3.0; -int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x)); -for (int i = 0; i < samples; ++i) { -vec2 xi = hammersley2D(i, samples); -float phi = czm_twoPi * xi.x; -float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi))); -float Ylm = computeShBasis(coefficientIndex, direction); -vec3 lookupDirection = -direction.xyz; -lookupDirection.z = -lookupDirection.z; -vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); -out_FragColor += Ylm * color * solidAngle * sinTheta; +`;var MU=`#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; } } -`;var y3=`precision highp float; -in vec2 v_textureCoordinates; -uniform vec3 u_faceDirection; -uniform vec3 u_positionWC; -uniform mat4 u_enuToFixedFrame; -uniform vec4 u_brightnessSaturationGammaIntensity; -uniform vec4 u_groundColor; -vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) { -vec2 scaledUV = uv * 2.0 - 1.0; -if (faceDir.x != 0.0) { -return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0); -} else if (faceDir.y != 0.0) { -return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0); +#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 { -return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0); +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; } -void main() { -float height = length(u_positionWC); -float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y; -float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0); -vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius); -float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x; -float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius; -vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz; -vec3 normalizedDirection = normalize(direction); -czm_ray ray = czm_ray(positionWC, normalizedDirection); -czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius); -if (!czm_isEmpty(intersection)) { -intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii); +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; } -bool onEllipsoid = intersection.start >= 0.0; -float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius); -vec3 skyPositionWC = positionWC + normalizedDirection * rayLength; -float lightEnum = u_radiiAndDynamicAtmosphereColor.z; -vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum)); -vec3 mieColor; -vec3 rayleighColor; -float opacity; -czm_computeScattering( -ray, -rayLength, -lightDirectionWC, -atmosphereInnerRadius, -rayleighColor, -mieColor, -opacity -); -vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity); -#ifdef ATMOSPHERE_COLOR_CORRECT -const bool ignoreBlackPixels = true; -atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels); #endif -vec3 lookupDirection = -normalizedDirection; -lookupDirection.x = -lookupDirection.x; -lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection); -lookupDirection.x = -lookupDirection.x; -float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0); -skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); -float intensity = u_brightnessSaturationGammaIntensity.w; -vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection); -vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a); -vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0); -vec3 up = normalize(positionWC); -float occlusion = max(dot(lightDirectionWC, up), 0.05); -vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0); -vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0)); -vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor); -float brightness = u_brightnessSaturationGammaIntensity.x; -float saturation = u_brightnessSaturationGammaIntensity.y; -float gamma = u_brightnessSaturationGammaIntensity.z; -#ifdef ENVIRONMENT_COLOR_CORRECT -color.rgb = mix(vec3(0.0), color.rgb, brightness); -color.rgb = czm_saturation(color.rgb, saturation); +`;var _J=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,Fo.TRANSLATION),o=xt.getAttributeBySemantic(t,Fo.ROTATION),s=xt.getAttributeBySemantic(t,Fo.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)}}},Ma=_J;var lv=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),Age={name:"EdgeVisibilityPipelineStage"};Age.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(OU),i.addVertexLines(MU),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=vtt(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=Stt(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=Ctt(p.edgeIndices,p.edgeData,t.edgeVisibility),S=wtt(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 Ctt(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!==lv.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 vtt(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===lv.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===lv.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===lv.REPEATED_HARD?lv.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:lv.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function Stt(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=Ma.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 wtt(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:Ma.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:Ma.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[Pe+2]=0,F[Pe+3]=-1}function k(Ke,Pe){if(!N)return;let qe=Ke*4,st=l(Pe.x)?Pe.x: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g[Yn],zi=g[Yn+1],Si=g[Yn+2],ui=g[Yn+3],Ai=g[Yn+4],zn=g[Yn+5];for(let tn=0;tn<4;tn++)R[(ht+tn)*3]=yi,R[(ht+tn)*3+1]=zi,R[(ht+tn)*3+2]=Si,O[(ht+tn)*3]=ui,O[(ht+tn)*3+1]=Ai,O[(ht+tn)*3+2]=zn}let q=nt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=nt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=nt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=nt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=nt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=nt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=N?nt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?nt.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=nt.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:Ma.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=nt.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 NU=Age;var LU=`void geometryStage(out ProcessedAttributes attributes) +{ +attributes.positionMC = v_positionMC; +attributes.positionEC = v_positionEC; +#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) +attributes.positionWC = v_positionWC; +#endif +#ifdef HAS_NORMALS +attributes.normalEC = normalize(v_normalEC); +#endif +#ifdef HAS_TANGENTS +attributes.tangentEC = normalize(v_tangentEC); +#endif +#ifdef HAS_BITANGENTS +attributes.bitangentEC = normalize(v_bitangentEC); +#endif +setDynamicVaryings(attributes); +} +`;var FU=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +{ +vec4 computedPosition; +vec3 positionMC = attributes.positionMC; +v_positionMC = positionMC; +v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; +#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) +vec3 position2D = attributes.position2D; +vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; +computedPosition = czm_projection * vec4(positionEC, 1.0); +#else +computedPosition = czm_projection * vec4(v_positionEC, 1.0); +#endif +#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) +v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; +#endif +#ifdef HAS_NORMALS +v_normalEC = normalize(normal * attributes.normalMC); +#endif +#ifdef HAS_TANGENTS +v_tangentEC = normalize(normal * attributes.tangentMC); +#endif +#ifdef HAS_BITANGENTS +v_bitangentEC = normalize(normal * attributes.bitangentMC); +#endif +setDynamicVaryings(attributes); +return computedPosition; +} +`;var MD=`vec2 computeSt(float featureId) +{ +float stepX = model_textureStep.x; +float centerX = model_textureStep.y; +#ifdef MULTILINE_BATCH_TEXTURE +float stepY = model_textureStep.z; +float centerY = model_textureStep.w; +float xId = mod(featureId, model_textureDimensions.x); +float yId = floor(featureId / model_textureDimensions.x); +return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +#else +return vec2(centerX + (featureId * stepX), 0.5); #endif -color.rgb = pow(color.rgb, vec3(gamma)); -color.rgb = czm_gammaCorrect(color.rgb); -out_FragColor = color; } -`;var A3=`precision highp float; -in vec3 v_textureCoordinates; -uniform float u_roughness; -uniform samplerCube u_radianceTexture; -uniform vec3 u_faceDirection; -float vdcRadicalInverse(int i) +void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) { -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++) +int featureId = featureIds.SELECTED_FEATURE_ID; +if (featureId < model_featuresLength) { -if (i <= 0) +vec2 featureSt = computeSt(float(featureId)); +feature.id = featureId; +feature.st = featureSt; +feature.color = texture(model_batchTexture, featureSt); +} +else { -break; +feature.id = model_featuresLength + 1; +feature.st = vec2(0.0); +feature.color = vec4(1.0); } -r = mod(float(i), base); -value += r * invBi; -invBi *= invBase; -i = int(float(i) * invBase); +#ifdef HAS_NULL_FEATURE_ID +if (featureId == model_nullFeatureId) { +feature.id = featureId; +feature.st = vec2(0.0); +feature.color = vec4(1.0); } -return value; +#endif } -vec2 hammersley2D(int i, int N) +`;var ND={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};ND.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=Itt(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),Ptt(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(MD),i.addFragmentLines(MD)};function bge(e){return e instanceof vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function xge(e){return e instanceof vn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function Itt(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:xge(r),featureIdDefine:bge(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:xge(r),featureIdDefine:bge(r)})}function Ptt(e){e.addStructField(ND.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(ND.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(ND.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var fx=ND;var Na={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)"};Na.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Na.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Na.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(fx.STRUCT_ID_SELECTED_FEATURE,fx.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Na.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Na.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Na.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Na.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Na.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Na.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Na.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Na.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===$o.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;Dtt(e,f,g,d,o,s,m)}Utt(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(FU),i.addFragmentLines(LU)};function Dtt(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Mtt(e,t,n,i):Ott(e,t,n,u),Ltt(a,c,u),Ntt(a,c,s),l(t.semantic)&&Rtt(a,t),Ftt(a,c,r),Btt(a,c,u),ktt(a,c)}function Rtt(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 Ott(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 Mtt(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 Ntt(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 Ltt(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 Ftt(e,t,n){let i=Na.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Na.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 Btt(e,t,n){let i=Na.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 ktt(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Na.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Na.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Utt(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(Na.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Na.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var BU=Na;var yJ=new he,AJ=new he,Tge=new h,Ege=new h,bJ=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 Ti(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,Tge),this._projection.unproject(Tge,yJ),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Ege),this._projection.unproject(Ege,AJ),this._rectangle=new ie(yJ.longitude,yJ.latitude,AJ.longitude,AJ.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)}},Bo=bJ;var xJ,Cge="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",uv={};uv.defaultAccessToken=Cge;uv.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});uv.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});uv.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});uv.getDefaultTokenCredit=function(e){if(e===Cge){if(!l(xJ)){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>';xJ=new It(t,!0)}return xJ}};var gd=uv;function TJ(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)}TJ.prototype.isReady=function(){return this._isReady};TJ.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 kU=TJ;function EJ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}EJ.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])};EJ.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 yp=EJ;function fv(){pe.throwInstantiationError()}Object.defineProperties(fv.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}});fv.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};fv.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};fv.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var ztt=/\.ktx2$/i;fv.loadImage=function(e,t){let n=De.createIfNeeded(t);return ztt.test(n.url)?of(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var _d=fv;var vge={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(vge);var Ap=vge;function Sge(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new rr({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}Sge.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 kU({missingImageUrl:wge(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 Vtt(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 Bo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new rr({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 Ti,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 jtt(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 Htt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Vtt(i,t)}catch(i){jtt(e,i)}}function bp(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 rr({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}bp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Ap.SATELLITE:{n=t.token??gd.defaultAccessToken,i=De.createIfNeeded(gd.defaultWorldImageryServer),i.appendForwardSlash();let o=gd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Ap.OCEANS:{n=t.token??gd.defaultAccessToken,i=De.createIfNeeded(gd.defaultWorldOceanServer),i.appendForwardSlash();let o=gd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Ap.HILLSHADE:{n=t.token??gd.defaultAccessToken,i=De.createIfNeeded(gd.defaultWorldHillshadeServer),i.appendForwardSlash();let o=gd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return bp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function wge(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(bp.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}}});bp.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 bp(t);i._resource=n;let r=new Sge(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Htt(n,r),r.build(i),i};bp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};bp.prototype.requestImage=function(e,t,n,i){return _d.loadImage(this,wge(this,e,t,n,i))};bp.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 yp;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 Ti;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};bp._metadataCache={};var vy=bp;function Gtt(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 cg=Gtt;function UU(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}UU.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 UU(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}": ${cg(i)}`),c};UU.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var no=UU;var Ige={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(Ige);var LD=Ige;function FD(e){}FD.prototype.isReady=function(){return!0};FD.prototype.shouldDiscardImage=function(e){return FD.EMPTY_IMAGE===e};var zU;Object.defineProperties(FD,{EMPTY_IMAGE:{get:function(){return l(zU)||(zU=new Image,zU.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),zU}}});var BD=FD;function Pge(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}Pge.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 Wtt(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 qtt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function Ytt(e,t,n){let i=e.url,r=ma._metadataCache[i];l(r)||(r=e.fetchJson(),ma._metadataCache[i]=r);try{let o=await r;return Wtt(o,t)}catch(o){qtt(e,o,n)}}function ma(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??LD.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new BD),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${ma.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Bo({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(ma.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)}}});ma.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??LD.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 ma(t);a._resource=r;let c=new Pge(t);return await Ytt(s,c),c.build(a),a};var Xtt=new ie;ma.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Xtt);return Jtt(this._attributionList,n,i)};ma.prototype.requestImage=function(e,t,n,i){let r=_d.loadImage(this,Ktt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?BD.EMPTY_IMAGE:Promise.reject(o)})};ma.prototype.pickFeatures=function(e,t,n,i,r){};ma.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};ma.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}};ma._logoUrl=void 0;Object.defineProperties(ma,{logoUrl:{get:function(){return l(ma._logoUrl)||(ma._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),ma._logoUrl},set:function(e){ma._logoUrl=e}}});function Ktt(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:ma.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var $tt=new ie;function Jtt(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,$tt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ma._metadataCache={};var VU=ma;var Dge=/{[^}]+}/g,Rge={x:tnt,y:int,z:snt,s:ant,reverseX:nnt,reverseY:rnt,reverseZ:ont,westDegrees:cnt,southDegrees:lnt,eastDegrees:unt,northDegrees:fnt,westProjected:dnt,southProjected:hnt,eastProjected:mnt,northProjected:pnt,width:gnt,height:_nt},Ztt=Ot(Rge,{i:ynt,j:Ant,reverseI:bnt,reverseJ:xnt,longitudeDegrees:Ent,latitudeDegrees:Cnt,longitudeProjected:vnt,latitudeProjected:Snt,format:Int});function kD(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 Bo({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(Rge,o),a=Ot(Ztt,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(kD.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}}});kD.prototype.getTileCredits=function(e,t,n){};kD.prototype.requestImage=function(e,t,n,i){return _d.loadImage(this,Qtt(this,e,t,n,i))};kD.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=ent(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 jU=!1,gf=new ie,HU=!1,UD=new ie;function Qtt(e,t,n,i,r){jU=!1,HU=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(Dge);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 CJ=!1,hv=new U,vJ=!1;function ent(e,t,n,i,r,o,s){jU=!1,HU=!1,CJ=!1,vJ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Dge);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 mv(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 tnt(e,t,n,i){return mv(e,"{x}",t)}function nnt(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return mv(e,"{reverseX}",r)}function int(e,t,n,i){return mv(e,"{y}",n)}function rnt(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return mv(e,"{reverseY}",r)}function ont(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return mv(e,"{reverseZ}",o)}function snt(e,t,n,i){return mv(e,"{z}",i)}function ant(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function GU(e,t,n,i){jU||(e.tilingScheme.tileXYToRectangle(t,n,i,gf),gf.west=P.toDegrees(gf.west),gf.south=P.toDegrees(gf.south),gf.east=P.toDegrees(gf.east),gf.north=P.toDegrees(gf.north),jU=!0)}function cnt(e,t,n,i){return GU(e,t,n,i),gf.west}function lnt(e,t,n,i){return GU(e,t,n,i),gf.south}function unt(e,t,n,i){return GU(e,t,n,i),gf.east}function fnt(e,t,n,i){return GU(e,t,n,i),gf.north}function WU(e,t,n,i){HU||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,UD),HU=!0)}function dnt(e,t,n,i){return WU(e,t,n,i),UD.west}function hnt(e,t,n,i){return WU(e,t,n,i),UD.south}function mnt(e,t,n,i){return WU(e,t,n,i),UD.east}function pnt(e,t,n,i){return WU(e,t,n,i),UD.north}function gnt(e,t,n,i){return e.tileWidth}function _nt(e,t,n,i){return e.tileHeight}function ynt(e,t,n,i,r,o,s){return qU(e,t,n,i,r,o),hv.x}function Ant(e,t,n,i,r,o,s){return qU(e,t,n,i,r,o),hv.y}function bnt(e,t,n,i,r,o,s){return qU(e,t,n,i,r,o),e.tileWidth-hv.x-1}function xnt(e,t,n,i,r,o,s){return qU(e,t,n,i,r,o),e.tileHeight-hv.y-1}var Tnt=new ie,dv=new h;function qU(e,t,n,i,r,o,s){if(CJ)return;SJ(e,t,n,i,r,o);let a=dv,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Tnt);hv.x=e.tileWidth*(a.x-c.west)/c.width|0,hv.y=e.tileHeight*(c.north-a.y)/c.height|0,CJ=!0}function Ent(e,t,n,i,r,o,s){return P.toDegrees(r)}function Cnt(e,t,n,i,r,o,s){return P.toDegrees(o)}function vnt(e,t,n,i,r,o,s){return SJ(e,t,n,i,r,o),dv.x}function Snt(e,t,n,i,r,o,s){return SJ(e,t,n,i,r,o),dv.y}var wnt=new he;function SJ(e,t,n,i,r,o,s){if(!vJ){if(e.tilingScheme.projection instanceof ji)dv.x=P.toDegrees(r),dv.y=P.toDegrees(o);else{let a=wnt;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,dv)}vJ=!0}}function Int(e,t,n,i,r,o,s){return s}var Rs=kD;function yd(e){Rs.call(this,e)}yd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return yd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof R0)return yd._metadataFailure(e,t);throw r}};yd.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 yd._requestMetadata(t,i,r);return new yd(o)};l(Object.create)&&(yd.prototype=Object.create(Rs.prototype),yd.prototype.constructor=yd);function Oge(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 Mge(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}yd._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)&&no.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 rr({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Bo({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&no.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=Oge(S,v),x=Mge(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}};yd._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 Bo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Oge(a,s);let c=Mge(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 dx=yd;function Nge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Nge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Pnt(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 rr({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 Bo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Dnt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Rnt(e,t,n){try{let i=await e.fetchText();Pnt(i,t)}catch(i){Dnt(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 It(`<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 be}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){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 Nge(n);s.channel=t,await Rnt(o,s);let a=new Iu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Iu.prototype.getTileCredits=function(e,t,n){};Iu.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 _d.loadImage(this,r)};Iu.prototype.pickFeatures=function(e,t,n,i,r){};Iu._logoUrl=void 0;Object.defineProperties(Iu,{logoUrl:{get:function(){return l(Iu._logoUrl)||(Iu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Iu._logoUrl},set:function(e){Iu._logoUrl=e}}});var YU=Iu;var Ont=/\/$/,Lge=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 pv(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();Ont.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=Lge,this._resource=i,this._imageryProvider=new Rs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(pv.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}}});pv.prototype.getTileCredits=function(e,t,n){};pv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};pv.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};pv._defaultCredit=Lge;var XU=pv;function hx(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 rr({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(hx.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 Mnt(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=no.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return wJ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function wJ(e,t,n){try{return await _d.loadImage(null,e)}catch(i){return Mnt(e,i,t,n)}}hx.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await wJ(n);t=t??H.EMPTY_OBJECT;let r=new hx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};hx.prototype.getTileCredits=function(e,t,n){};hx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await wJ(this._resource,this);return this._image=r,no.reportSuccess(this._errorEvent),r}return this._image};hx.prototype.pickFeatures=function(e,t,n,i,r){};var KU=hx;function Nnt(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=Lnt:e==="xml"?n=Unt:(e==="html"||e==="text")&&(n=Fge)),this.callback=n}function Lnt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new yp;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 IJ="http://www.mapinfo.com/mxp",Fnt="http://www.esri.com/wms",Bnt="http://www.opengis.net/wfs",knt="http://www.opengis.net/gml";function Unt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===IJ)return znt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Fnt)return Vnt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Bnt)return jnt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Hnt(e):Gnt(e)}function znt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(IJ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(IJ,"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 yp;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Vnt(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($U(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($U(a,i))}}return n}function jnt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(knt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};PJ(o,s),t.push($U(o,s))}return t}function Hnt(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={};PJ(s,a),t.push($U(s,a))}}return t}function PJ(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()&&PJ(r,t)&&(t[r.localName]=r.textContent)}return n}function $U(e,t){let n=new yp;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Gnt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new yp;return r.data=e,r.description=n.innerHTML,[r]}var Wnt=/<body>\s*<\/body>/im,qnt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Ynt=/<title>([\s\S]*)<\/title>/im;function Fge(e){if(Wnt.test(e)||qnt.test(e))return;let t,n=Ynt.exec(e);n&&n.length>1&&(t=n[1]);let i=new yp;return i.name=t,i.description=e,i.data=e,[i]}var xp=Nnt;function zD(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(zD.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)}}});zD.prototype.getFromCache=function(e,t,n,i){let r=Bge(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};zD.prototype.checkApproachingInterval=function(e,t,n,i){let r=Bge(e,t,n),o=this._tilesRequestedForInterval,s=kge(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!Uge(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};zD.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=kge(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=Uge(this,c,o),a||s.push(c)}}};function Bge(e,t,n){return`${e}-${t}-${n}`}function Xnt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function kge(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 Uge(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=Xnt(s),c=new Oo({throttle:!1,throttleByServer:!0,type:ra.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 gv=zD;var Knt=[3034,3035,3042,3043,3044],$nt=[4471,4559];function Mh(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(Mh.DefaultParameters,!0),n.setQueryParameters(Mh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(zge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(zge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new gv({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return Vge(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 Ti?"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&&!$nt.includes(a)||Knt.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"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 Rs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new rr({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??Mh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Vge(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 Jnt(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(Mh.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}}});Mh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Mh.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=Vge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Mh.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Jnt(this,e,t,n,i,r,s)};Mh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Mh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Mh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new xp("json","application/json")),Object.freeze(new xp("xml","text/xml")),Object.freeze(new xp("text","text/html"))]);function zge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var JU=Mh;function _f(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(_f.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(_f.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(_f.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(jge(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(_f.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(jge(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 gv({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return Hge(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Rs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Bo({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??_f.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Qnt(this)})}function Hge(e,t,n,i,r,o){let s=e._tileProvider;return Gge(e,s._resource,o),s.requestImage(t,n,i,r)}function Znt(e,t,n,i,r,o,s){let a=e._tileProvider;return Gge(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(_f.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}}});_f.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};_f.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=Hge(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};_f.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Znt(this,e,t,n,i,r,s)};_f.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});_f.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});_f.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new xp("json","application/json")),Object.freeze(new xp("xml","text/xml")),Object.freeze(new xp("text","text/html"))]);function Gge(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 Qnt(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 jge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var ZU=_f;var _v={};_v.defaultApiKey=void 0;_v.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});_v.defaultStreetViewStaticApiKey=void 0;_v.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});_v.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var La=_v;var Wge=/\/$/;function lg(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 qo?e.url:De.createIfNeeded(e.url??La.mapTilesApiEndpoint),n=t.getUrlComponent();Wge.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 Rs({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(lg.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}}});lg.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=qge(e),i=qo._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},DJ(s,o,i)};lg.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??La.mapTilesApiEndpoint,e.key=e.key??La.defaultApiKey;let t=e.overlayLayerType,n=await tit(e);return new lg({...n,...e,credit:e.credit??La.getDefaultCredit()})};lg.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};lg.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])};lg.prototype.pickFeatures=function(e,t,n,i,r){};lg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(eit(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 eit(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 qge(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 tit(e){let{language:t,region:n,key:i,url:r}=e,o=qge(e),s=r.url??r;Wge.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 QU=lg;var nit=/\/$/;function yv(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 qo?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();nit.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 Rs({...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(yv.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}}});yv.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};yv.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])};yv.prototype.pickFeatures=function(e,t,n,i,r){};yv.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(iit(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 iit(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 ez=yv;var rit=async(e,t,n)=>dx.fromUrl(new qo(t,n)),oit=async(e,{options:t})=>vy.fromUrl(e,t),sit=async(e,{options:t})=>VU.fromUrl(e,t),ait=async(e,{options:t})=>{let n=t.channel;return delete t.channel,YU.fromUrl(e,n,t)},cit=async(e,{options:t})=>new XU({url:e,...t}),lit=async(e,{options:t})=>KU.fromUrl(e,t),uit=async(e,{options:t})=>dx.fromUrl(e,t),fit=async(e,{options:t})=>new Rs({url:e,...t}),dit=async(e,{options:t})=>new JU({url:e,...t}),hit=async(e,{options:t})=>new ZU({url:e,...t}),DJ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new qo(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 QU({...t.options,url:i})},mit=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new qo(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 ez({...t.options,url:i})},pit={ARCGIS_MAPSERVER:oit,BING:sit,GOOGLE_EARTH:ait,MAPBOX:cit,SINGLE_TILE:lit,TMS:uit,URL_TEMPLATE:fit,WMS:dit,WMTS:hit,GOOGLE_2D_MAPS:DJ,AZURE_MAPS:mit,defaultFactoryCallback:rit},VD=Object.freeze(pit);function Tp(){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(Tp.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(){}}});Tp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=qo._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Tp._endpointCache[i];l(r)||(r=n.fetchJson(),Tp._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=VD.defaultFactoryCallback;o=Ze(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=VD[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new Tp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=qo.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Tp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Tp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Tp.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Tp._endpointCache={};var Pu=Tp;var Yge={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(Yge);var Sy=Yge;function git(e){e=e??H.EMPTY_OBJECT;let t=e.style??Sy.AERIAL;return Pu.fromAssetId(t)}var wy=git;function Os(){pe.throwInstantiationError()}Object.defineProperties(Os.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 Xge=[];Os.getRegularGridIndices=function(e,t){let n=Xge[e];l(n)||(Xge[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),Zge(e,t,i,0)),i};var Kge=[];Os.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Kge[e];l(n)||(Kge[e]=n=[]);let i=n[t];if(!l(i)){let r=Os.getRegularGridIndices(e,t),o=Jge(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 $ge=[];Os.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=$ge[e];l(n)||($ge[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=Jge(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);Zge(e,t,y,0),Os.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};Os.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Os.getSkirtIndexCount=function(e){return(e-4)*2*3};Os.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Os.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=tz(e,a,o,s),a+=e.length,s=tz(t,a,o,s),a+=t.length,s=tz(n,a,o,s),a+=n.length,tz(i,a,o,s)};Os.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Os.addSkirtIndices(e,t,n,i,r,o,s);let a=Os.getSkirtVertexCount(e,t,n,i),c=Os.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 Jge(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 Zge(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 tz(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}Os.heightmapTerrainQuality=.25;Os.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Os.heightmapTerrainQuality/(t*n)};Os.prototype.requestTileGeometry=pe.throwInstantiationError;Os.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Os.prototype.getTileDataAvailable=pe.throwInstantiationError;Os.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Os;var nz=`uniform sampler2D u_texture; +in vec2 v_textureCoordinates; +void main() { -return vec2(float(i) / float(N), vdcRadicalInverse(i)); +out_FragColor = texture(u_texture, v_textureCoordinates); } -vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +`;var iz=`in vec4 position; +in float webMercatorT; +uniform vec2 u_textureDimensions; +out vec2 v_textureCoordinates; +void main() { -float alphaRoughnessSquared = alphaRoughness * alphaRoughness; -float phi = czm_twoPi * xi.x; -float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); -float sinTheta = sqrt(1.0 - cosTheta * cosTheta); -vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); -vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); -vec3 tangentX = normalize(cross(upVector, N)); -vec3 tangentY = cross(N, tangentX); -return tangentX * H.x + tangentY * H.y + N * H.z; +v_textureCoordinates = vec2(position.x, webMercatorT); +gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); } -const int samples = 128; -void main() { -vec3 normal = u_faceDirection; -vec3 V = normalize(v_textureCoordinates); -float roughness = u_roughness; -vec4 color = vec4(0.0); -float weight = 0.0; -for (int i = 0; i < samples; ++i) { -vec2 xi = hammersley2D(i, samples); -vec3 H = importanceSampleGGX(xi, roughness, V); -vec3 L = 2.0 * dot(V, H) * H - V; -float NdotL = max(dot(V, L), 0.0); -if (NdotL > 0.0) { -color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL; -weight += NdotL; +`;var Qge={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(Qge);var jn=Qge;function Av(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}Av.createPlaceholder=function(e){let t=new Av(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};Av.prototype.addReference=function(){++this.referenceCount};Av.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(),le(this),0):this.referenceCount};Av.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 jD=Av;function RJ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}RJ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};RJ.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 HD=RJ;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 HD(jD.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=Ho.NONE;Ui.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Ui.DEFAULT_MAGNIFICATION_FILTER=Zn.LINEAR;Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ui.fromProviderAsync=function(e,t){let n=new Ui(void 0,t);return xit(n,Promise.resolve(e)),n};Ui.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Ui.fromProviderAsync(wy({style:e.style}),e)};Ui.prototype.isBaseLayer=function(){return this._isBaseLayer};Ui.prototype.isDestroyed=function(){return!1};Ui.prototype.destroy=function(){return le(this)};var n_e=new ie,e_e=new ie,OJ=new ie,i_e=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 Ti&&e.rectangle.north<Ti.MaximumLatitude&&e.rectangle.south>-Ti.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,n_e),a=ie.intersection(e.rectangle,s,e_e);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=e_e,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=Ait(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,i_e),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,OJ),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,OJ),!!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,OJ),!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 HD(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,n_e),i=c.rectangleToNativeRectangle(i,i_e)}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,no.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=no.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:ra.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 Gt({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 Ti?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=jn.TEXTURE_LOADED};function t_e(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===Zn.LINEAR&&!$e.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=zt.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=t_e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Ah.NICEST),t.sampler=u}else{let o=t_e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new Gt({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 hd({persists:!0,owner:this,preExecute:function(c){yit(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=r_e(e,t,n),o=this._imageryCache[r];return l(o)||(o=new jD(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Ui.prototype.removeImageryFromCache=function(e){let t=r_e(e.x,e.y,e.level);delete this._imageryCache[t]};function r_e(e,t,n){return JSON.stringify([e,t,n])}var rz={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},_it=dn.supportsTypedArrays()?new Float32Array(128):void 0;function yit(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=Xr.getRegularGridIndices(2,64),E=nt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new Vn({context:t,attributes:[{index:x.position,vertexBuffer:nt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:nt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Xe({sources:[iz]});r.shaderProgram=en.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:nz,attributeLocations:x}),r.sampler=new Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;rz.textureDimensions.x=o,rz.textureDimensions.y=s,rz.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(Ah.NICEST);let p=i.south,g=i.north,m=_it,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=rz,e.vertexArray=r.vertexArray}function Ait(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 bit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function xit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){bit(e._errorEvent,i)}}var Ms=Ui;var MJ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},oz=MJ;var NJ=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}},GD=NJ;var Tit=new ie,o_e=new ie,Eit=new ie,Cit=new ie,vit=new ie,Sit=new ie,LJ=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,Tit),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=Cit;a.rectangleToNativeRectangle(t,u);let f=vit;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,Eit);if(!l(b))return;let x=Sit;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 GD;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,o_e);return l(i)?i:e._clampRectangle(t,n,o_e)}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 GD);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}},WD=LJ;var FJ=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=Ma.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}}},bv=FJ;var BJ=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}},sz=BJ;var kJ=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=nt.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=bv.createCartographicPositions(r,s,d),g=bv.computeCartographicBoundingRectangle(p),m=new sz(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=bv.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 WD.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 WD._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(),le(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}},xv=kJ;var UJ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},az=UJ;var wit=!1,Iit=new ie,Pit=new ie,zJ=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=xv._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 oz;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ms.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ms.DEFAULT_CONTRAST,n.hue|=r.hue!==Ms.DEFAULT_HUE,n.saturation|=r.saturation!==Ms.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ms.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));"]),wit&&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 az(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,Iit),s=r.rectangleToNativeRectangle(i,Pit);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}},cz=zJ;var lz=`#ifdef USE_IBL_LIGHTING +vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ +#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) +vec3 viewDirection = -normalize(position); +vec3 iblColor = textureIBL(viewDirection, normal, material); +return iblColor; +#endif +return vec3(0.0); } +#endif +#ifdef USE_CLEARCOAT +vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +{ +vec3 viewDirection = -normalize(position); +vec3 halfwayDirection = normalize(viewDirection + lightDirection); +vec3 normal = material.clearcoatNormal; +float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); +vec3 f0 = vec3(0.04); +vec3 f90 = vec3(1.0); +float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); +vec3 F = fresnelSchlick2(f0, f90, NdotV); +float roughness = material.clearcoatRoughness; +float alphaRoughness = roughness * roughness; +float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); +vec3 directReflection = F * directStrength * NdotL; +vec3 color = lightColorHdr * directReflection; +#ifdef SPECULAR_IBL +vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); +vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); +color += iblColor * material.occlusion; +#endif +float clearcoatFactor = material.clearcoatFactor; +vec3 clearcoatColor = color * clearcoatFactor; +return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; } -out_FragColor = color / weight; +#endif +#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) +vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +{ +#ifdef USE_CUSTOM_LIGHT_COLOR +vec3 lightColorHdr = model_lightColorHdr; +#else +vec3 lightColorHdr = czm_lightColorHdr; +#endif +vec3 viewDirection = -normalize(position); +vec3 normal = material.normalEC; +vec3 lightDirection = normalize(czm_lightDirectionEC); +vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); +vec3 directColor = lightColorHdr * directLighting; +vec3 color = directColor + material.emissive; +#ifdef USE_IBL_LIGHTING +color += computeIBL(position, normal, lightDirection, lightColorHdr, material); +#endif +#ifdef USE_CLEARCOAT +color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); +#endif +return color; } -`;var b3=`in vec3 position; -out vec3 v_textureCoordinates; -uniform vec3 u_faceDirection; -vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { -vec2 scaledUV = uv; -if (faceDir.x != 0.0) { -return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x); -} else if (faceDir.y != 0.0) { -return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y); -} else { -return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z); +#endif +void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +{ +#ifdef LIGHTING_PBR +#ifdef HAS_NORMALS +vec3 color = computePbrLighting(material, attributes.positionEC); +#else +vec3 color = material.diffuse * material.occlusion + material.emissive; +#endif +#ifndef HDR +color = czm_pbrNeutralTonemapping(color); +#endif +#else // unlit +vec3 color = material.diffuse; +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +color = czm_gammaCorrect(color); +#elif !defined(HDR) +color = czm_linearToSrgb(color); +#endif +material.diffuse = color; } +`;var s_e={UNLIT:0,PBR:1};Object.freeze(s_e);var ug=s_e;var a_e={name:"LightingPipelineStage"};a_e.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===ug.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(lz)};var uz=a_e;var fz=`bool isDefaultStyleColor(vec3 color) +{ +return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } -void main() +vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) { -v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection); -v_textureCoordinates.y = -v_textureCoordinates.y; -v_textureCoordinates.z = -v_textureCoordinates.z; -gl_Position = vec4(position, 1.0); +vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); +vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; +return color; } -`;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 Q$e=new h,eJe=new h;function tJe(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,eJe),s=1.025,a=Q$e,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 A0e=new h,nJe=new M,iJe=new se,rJe=new z;function oJe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ms({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:[cp,y3]}),e._radianceMapFS=r),jE.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,nJe),u=iJe;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 ms.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 _d({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ms.getDirection(d,A0e),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,rJe)},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 sJe(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 ms.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=ms.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:b3,fragmentShaderSource:A3,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new _d({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ms.getDirection(g,A0e)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ei._queueCommand(b,t),++d}o/=2,s/=2}u()}var b0e=new U(3,3);function aJe(e,t){let n=t.context,i=b0e,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:[_3]}),e._irradianceMapFS=o);let s=new _d({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 cJe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new vs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=b0e,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=tJe(this,e)||i===R_.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&&(oJe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(sJe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(aJe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){cJe(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(),le(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 gy=Ei;var NC={HIGHLIGHT:0,REPLACE:1,MIX:2};NC.getColorBlend=function(e,t){if(e===NC.HIGHLIGHT)return 0;if(e===NC.REPLACE)return 1;if(e===NC.MIX)return P.clamp(t,P.EPSILON4,1)};Object.freeze(NC);var Dl=NC;var x0e={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(x0e);var Lh=x0e;var T0e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(T0e);var Rl=T0e;var E0e={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(E0e);var lp=E0e;var C0e={};function gD(e){this._count=e.count,this._properties=Ze(e.properties,!0)}gD.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,C0e)};gD.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,C0e,e)};gD.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ze(n[e],!0)};gD.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 _y=gD;function yc(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(yc.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}}});yc.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))};yc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};yc.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))};yc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var bJ=[];yc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(bJ);Qn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,bJ);Qn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(bJ);Qn(t,n)}return t};yc.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};yc.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 _y({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};yc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};yc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};yc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};yc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};yc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};yc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};yc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};yc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var xu=yc;function v0e(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=pf.createModelTextureReader({textureInfo:o,channels:lJe(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(v0e.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 lJe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var x3=v0e;function xJ(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 x3({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(xJ.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}}});xJ.prototype.getProperty=function(e){return this._properties[e]};var yy=xJ;function S0e(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(S0e.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 T3=S0e;function TJ(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 T3({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(TJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});TJ.prototype.getProperty=function(e){return this._properties[e]};var LC=TJ;function FC(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(FC.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}}});FC.prototype.getPropertyTable=function(e){return this._propertyTables[e]};FC.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};FC.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};FC.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var ec=FC;function uJe(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=fJe(a,e.bufferViews,c,e.context),f=new Dh({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new xu({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 yy({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 LC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new ec({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var _D=4;function fJe(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=dJe(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=mJe(s,o),u=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:$n.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 dJe(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(_D))continue;let c=e[s],u=l(c)?t[c.values]:hJe(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 hJe(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 mJe(e,t){let n=e.length,i=new Uint8Array(n*t*_D),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*_D,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){gJe(s,r,c);continue}pJe(s,i,c)}return i}function pJe(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*_D;t.set(i.subarray(a,a+r),c)}}function gJe(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*_D,A=f.get(m);d.set(y,p(A))}}var E3=uJe;function _Je(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 Dh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new xu({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 yy({id:a,propertyTexture:yJe(c),class:n.classes[c.class],textures:e.textures}))}return new ec({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function yJe(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:AJe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function AJe(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 C3=_Je;var EJ=class extends rr{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=bJe(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=E3({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=C3({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),w0e(this),this._state=Ct.READY,!0}unload(){w0e(this),OJe(this),l(this._schemaLoader)&&ki.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function bJe(e){try{let t=vJe(e),n=DJe(e),i=RJe(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 xJe(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 TJe(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 EJe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];xJe(r.properties,n)}return n}function CJe(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)&&TJe(o,n)}}return n}async function vJe(e){let t;l(e._extension)?t=EJe(e._extension):t=CJe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=ki.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 SJe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&wJe(o,t)}return t}function wJe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function IJe(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)&&PJe(o,t)}}return t}function PJe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function DJe(e){let t;l(e._extension)?t=SJe(e._extension):t=IJe(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=ki.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 RJe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=ki.getSchemaLoader({resource:i})}else n=ki.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function w0e(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function OJe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var v3=EJ;var tx={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};tx.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return tx.TRANSLATION;case"ROTATION":return tx.ROTATION;case"SCALE":return tx.SCALE;case"_FEATURE_ID":return tx.FEATURE_ID}};Object.freeze(tx);var Bo=tx;var MJe=65534,NJe=255;function S3(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 D0e(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],LJe(this)}Object.defineProperties(S3.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function LJe(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=I0e(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>MJe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>NJe&&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=I0e(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function I0e(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=CJ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=CJ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=CJ(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=vJ(f),_=vJ(m),C=vJ(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 CJ(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 vJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}S3.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};S3.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=P0e(i),o=[];for(;i>1;)i>>=1,o.push(P0e(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:$n.LINEAR})});return t.outlineTexture=s,s};function P0e(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 D0e(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)}}D0e.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 BC=S3;function R0e(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function FJe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function w3(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}w3.prototype.postProcess=function(e){this.needsOutlines&&(BJe(this),zJe(this,e)),this.needsGaussianSplats&&UJe(this,e)};function BJe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new BC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=kJe(r.outlineCoordinates),s=new R0e(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 kJe(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 UJe(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 zJe(e,t){VJe(e.attributePlans,t),l(e.indicesPlan)&&jJe(e.indicesPlan,t)}function VJe(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 jJe(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)}w3.AttributeLoadPlan=R0e;w3.IndicesLoadPlan=FJe;var kC=w3;function HJe(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var I3=HJe;function O0e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(O0e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var P3=O0e;function M0e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(M0e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var D3=M0e;function N0e(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(N0e.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var R3=N0e;var L0e={Direct:"Direct",Indirect:"Indirect"};Object.freeze(L0e);var nx=L0e;function F0e(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(F0e.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 yD=F0e;function B0e(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(B0e.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 O3=B0e;function UC(){}function k0e(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function GJe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new P3({position:t,adjustmentParams:n})}function WJe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=k0e(e.covarianceMatrix);return new D3({position:t,adjustmentParams:n,covarianceMatrix:i})}function qJe(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new O3({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new R3({groupFlags:t,rotationThetas:n,params:i})}UC.load=function(e){let t=e.storageType;if(t===nx.Direct)return UC.loadDirect(e);if(t===nx.Indirect)return UC.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};UC.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=GJe(o);t.push(s)}let i=k0e(e.covarianceDirectUpperTriangle);return new yD({storageType:nx.Direct,anchorPointsDirect:t,covarianceDirect:i})};UC.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=WJe(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=qJe(s);r.push(a)}return new yD({storageType:nx.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var M3=UC;function U0e(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(U0e.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 N3=U0e;function z0e(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(z0e.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var L3=z0e;function V0e(e){this._ppeTextures=e}Object.defineProperties(V0e.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var F3=V0e;function Xo(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)&&(Xo.prototype=Object.create(rr.prototype),Xo.prototype.constructor=Xo);Object.defineProperties(Xo.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Xo.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)}};Xo.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=this._loadResources(this),this._promise)};function YJe(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}Xo.prototype._loadTextures=function(){let e;l(this._extension)&&(e=YJe(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=ki.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)};Xo.ppeTexturesMetadataSchemaCache=new Map;Xo._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}}}};Xo._obtainPpeTexturesMetadataSchema=function(e){let n=Xo._collectPpeTexturePropertyIdentifiers(e).toString(),i=Xo.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${Xo.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=Xo._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=Au.fromJson(o),Xo.ppeTexturesMetadataSchemaCache.set(n,i),i};Xo._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=Xo._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};Xo._convertToStructuralMetadata=function(e,t){let n=[],i=Xo._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 yy({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new ec({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Xo.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 L3({min:d.min,max:d.max,source:d.source}),g=new N3({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new F3(o);this._meshPrimitiveGpmLocal=a;let c=Xo._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Ct.READY,!0};Xo.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)ki.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Xo.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var B3=Xo;function XJe(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Qn(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 k3=XJe;var{Attribute:KJe,Indices:$Je,FeatureIdAttribute:H0e,FeatureIdTexture:G0e,FeatureIdImplicitRange:W0e,MorphTarget:JJe,Primitive:ZJe,Instances:QJe,Skin:eZe,Node:tZe,AnimatedPropertyType:nZe,AnimationSampler:iZe,AnimationTarget:rZe,AnimationChannel:oZe,Animation:sZe,ArticulationStage:aZe,Articulation:cZe,Asset:lZe,Scene:uZe,Components:fZe,MetallicRoughness:dZe,SpecularGlossiness:hZe,Specular:mZe,Anisotropy:SJ,Clearcoat:wJ,PlanarFill:pZe,LineStyle:gZe,Material:_Ze,Vector:yZe,Polygon:AZe}=En,no={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},IJ=class extends rr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=Gi.Y,forwardAxis:c=Gi.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=no.NOT_LOADED,this._textureState=no.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=bZe(this),this._promise)}_process(t){return this._state===no.READY?!0:(this._state===no.PROCESSING&&TZe(this,t),this._resourcesLoaded&&this._state===no.POST_PROCESSING&&(EZe(this,t.context),this._state=no.PROCESSED),this._resourcesLoaded&&this._state===no.PROCESSED?(j0e(this),this._typedArray=void 0,this._state=no.READY,!0):!1)}_processTextures(t){if(this._textureState===no.READY)return!0;if(this._textureState!==no.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=no.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===no.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=xZe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=no.FAILED;let o=this._processError;this._processError=void 0,U3(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===no.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=no.FAILED,U3(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=no.FAILED,U3(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===no.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&ki.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,LQe(this),j0e(this),FQe(this),BQe(this),kQe(this),UQe(this),this._components=void 0,this._typedArray=void 0,this._state=no.UNLOADED}};async function bZe(e){e._state=no.LOADING,e._textureState=no.LOADING;try{let t=ki.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=no.LOADED,e._textureState=no.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=no.FAILED,e._textureState=no.FAILED,U3(e,t)}}async function xZe(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new I3({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=NQe(e,t);return e._state=no.PROCESSING,e._textureState=no.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(ki.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function U3(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function TZe(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=no.POST_PROCESSING)}function EZe(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)&&CZe(e,r)}}function CZe(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 vZe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return ki.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 SZe(e,t,n,i,r,o,s){return ki.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 q0e(e,t){let n=ki.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function PJ(e,t,n){let i=t.byteOffset,r=mf(e,t),o=t.count,s=fd(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=cy(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 wZe(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 IZe(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 PZe(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=PJ(o,n,t.typedArray);i=i??!1,IZe(n,s,r,i)}function AD(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=q0e(e,r),s=PZe(e,o,t,n,i);return e._loaderPromises.push(s),i}return wZe(t,i)}function Fh(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=q0e(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=PJ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Tu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function DZe(e){return e===Number?0:new e}function RZe(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 OZe={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function MZe(e,t){let n=RZe(e.componentDatatype),i=OZe[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 NZe(e,t,n){let i=e.decodeMatrix,r=Tu(n,e.decodedMin),o=Tu(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 LZe(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new KJe;c.name=n,c.semantic=i,c.setIndex=r,c.constant=DZe(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Tu(s,o.min),c.max=Tu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=mf(e,o),ar(o,"WEB3D_quantized_attributes")&&NZe(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&&MZe(c,s),c}function Y0e(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var FZe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function DJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=FZe;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function BZe(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function kZe(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 UZe(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 zZe(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=PJ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function X0e(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)?Y0e(g):void 0,b=LZe(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=vZe(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])?kZe(b,x,s,a):l(o)?UZe(b,x,s,a):zZe(u,f,b,x,s,a)},b}function K0e(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=X0e(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new kC.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function VZe(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=DJ(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 X0e(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function jZe(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 $Je;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=SZe(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 kC.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function HZe(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 Ol(e,t,n,i,r){let o=e.gltfJson,s=pf.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=ki.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=pf.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=no.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=HZe(d.sampler,i,r))},c}function GZe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new hZe;return l(i)&&(c.diffuseTexture=Ol(e,i,n)),l(r)&&(c.specularGlossinessTexture=Ol(e,r,n)),c.diffuseFactor=Tu(se,o),c.specularFactor=Tu(h,s),c.glossinessFactor=a,c}function WZe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new dZe;return l(i)&&(c.baseColorTexture=Ol(e,i,n)),l(r)&&(c.metallicRoughnessTexture=Ol(e,r,n)),c.baseColorFactor=Tu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function qZe(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new mZe;return l(r)&&(a.specularTexture=Ol(e,r,n)),l(s)&&(a.specularColorTexture=Ol(e,s,n)),a.specularFactor=i,a.specularColorFactor=Tu(h,o),a}function YZe(e,t,n){let{anisotropyStrength:i=SJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=SJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new SJ;return l(o)&&(s.anisotropyTexture=Ol(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function XZe(e,t,n){let{clearcoatFactor:i=wJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=wJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new wJ;return l(r)&&(c.clearcoatTexture=Ol(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=Ol(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Ol(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function KZe(e){return new pZe(e)}function $Ze(e){if(!l(e))return;let t=new gZe;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 JZe(e,t,n){let i=new _Ze,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=GZe(e,o,n):(l(u)&&(i.metallicRoughness=WZe(e,u,n)),l(s)&&!i.unlit&&(i.specular=qZe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=YZe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=XZe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Ol(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Ol(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Ol(e,t.occlusionTexture,n)),i.emissiveFactor=Tu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=KZe(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=$Ze(r.BENTLEY_materials_line_style),i}function $0e(e,t){let n=new H0e;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 J0e(e,t,n,i){let r=new H0e,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=Y0e(o.attribute),r.positionalLabel=i,r}function Z0e(e,t){let n=new W0e;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 Q0e(e,t,n,i){let r=new W0e,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 ZZe(e,t,n,i){let r=new G0e;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=Ol(e,o,n,Wt.NEAREST,$n.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function QZe(e,t,n,i,r,o){let s=new G0e,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=Ol(e,c,i,Wt.NEAREST,$n.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function eQe(e,t,n,i,r){let o=new JJe,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=DJ(e,ct,f),g=K0e(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function tQe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function ege(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=Tu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function nQe(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 iQe(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=Fh(e,a),u=nQe(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:ege(e,f)}}return i}function rQe(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=Fh(e,r)}if(n.materialColor=ege(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=Fh(e,r))}return l(t.lineStrings)&&(n.lineStrings=iQe(e,t.lineStrings,t.material)),n}function oQe(e,t,n,i){let r=new ZJe,o=new kC(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=JZe(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=aQe(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=cQe(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=sQe(e,d,o)),r.edgeVisibility=rQe(e,a.EXT_mesh_primitive_edge_visibility);let p=tQe(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],_=DJ(e,ct,O),C=_.modelSemantic;if(g&&!BZe(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=K0e(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(eQe(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=jZe(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)?lQe(e,r,E,i):S&&uQe(e,r,v,i),l(T)?fQe(r,T):S&&dQe(e,r,v),l(I)&&hQe(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 sQe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return AD(e,i,!1)}function aQe(e,t,n){let i=new AZe,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=Fh(e,r[t.indices]),i.loopIndicesOffsets=Fh(e,r[n.indicesOffsets]),i.triangleIndices=Fh(e,r[n.triangleIndices]),i.triangleIndicesOffsets=Fh(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=Fh(e,r[n.loopIndices]),i.loopIndicesOffsets=Fh(e,r[n.loopIndicesOffsets]),i.triangleIndices=Fh(e,r[t.indices]),i.triangleIndicesOffsets=Fh(e,r[n.indicesOffsets])),i}function cQe(e,t){if(!l(t))return;let n=new yZe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return AD(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 lQe(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=ZZe(e,s,i,a):l(s.attribute)?c=$0e(s,a):c=Z0e(s,a),t.featureIds.push(c)}}function uQe(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=J0e(u,d,p,g):m=Q0e(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=QZe(e,u,d,i,p,g);t.featureIds.push(m)}}function fQe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function dQe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function hQe(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function mQe(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new QJe,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(VZe(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)?pQe(r,a):l(c)&&gQe(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function pQe(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=$0e(r,o):s=Z0e(r,o),e.featureIds.push(s)}}function gQe(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=J0e(a,u,f,d):p=Q0e(a,u,f,d),t.featureIds.push(p)}}function _Qe(e,t,n){let i=new tZe;i.name=t.name,i.matrix=Tu(M,t.matrix),i.translation=Tu(h,t.translation),i.rotation=Tu(Le,t.rotation),i.scale=Tu(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=mQe(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=k3(u);for(let g=0;g<f.length;++g)i.primitives.push(oQe(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 yQe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=_Qe(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 AQe(e,t,n){let i=new eZe,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=AD(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(M.IDENTITY);return i}function bQe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=AQe(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 xQe(e,t,n,i){let r=new v3({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 TQe(e,t,n,i){let r=new B3({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 EQe(e,t){let n=new iZe,i=e.gltfJson.accessors,r=i[t.input];n.input=AD(e,r);let o=t.interpolation;n.interpolation=lp[o]??lp.LINEAR;let s=i[t.output];return n.output=AD(e,s,!0),n}function CQe(e,t){let n=new rZe,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=nZe[r],n}function vQe(e,t,n){let i=new oZe,r=e.sampler;return i.sampler=t[r],i.target=CQe(e.target,n),i}function SQe(e,t,n){let i=new sZe;i.name=t.name;let r=t.samplers.map(function(s,a){let c=EQe(e,s);return c.index=a,c}),o=t.channels.map(function(s){return vQe(s,r,n)});return i.samplers=r,i.channels=o,i}function wQe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=SQe(e,r,t);return s.index=o,s})}function IQe(e){let t=new aZe;t.name=e.name;let n=e.type.toUpperCase();return t.type=Rl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function PQe(e){let t=new cZe;return t.name=e.name,t.stages=e.stages.map(IQe),t}function DQe(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(PQe):[]}function RQe(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 OQe(e,t){let n=new uZe,i=RQe(e);return n.nodes=i.map(function(r){return t[r]}),n}var MQe=new h;function NQe(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=yQe(e,t),c=bQe(e,a),u=wQe(e,a),f=DQe(n),d=OQe(n,a),p=new fZe,g=new lZe,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,MQe);p.transform=M.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=xQe(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=M3.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=TQe(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Qn(b,e._loaderPromises),e._incrementallyLoadTextures||Qn(b,e._texturesPromises),Promise.all(b)}function LQe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&ki.unload(t[n]);e._textureLoaders.length=0}function j0e(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&ki.unload(t[n]);e._bufferViewLoaders.length=0}function FQe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&ki.unload(t[n]);e._geometryLoaders.length=0}function BQe(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 kQe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function UQe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var yd=IJ;function ix(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(ix.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}}});ix.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function RJ(e){e._cubeMapBuffers=void 0}ix.prototype.update=function(e){let{context:t}=e;if(!ix.isSupported(t))return;if(l(this._texture)){RJ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(RJ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;of(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(ms.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 ms({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};ix.prototype.isDestroyed=function(){return!1};ix.prototype.destroy=function(){return RJ(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var up=ix;function bD(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(bD.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 zQe(e,t){if(up.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new up(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}bD.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&&(zQe(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)};bD.prototype.isDestroyed=function(){return!1};bD.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var zC=bD;var z3=`uniform sampler2D u_pointCloud_colorGBuffer; -uniform sampler2D u_pointCloud_depthGBuffer; -uniform vec2 u_distanceAndEdlStrength; -in vec2 v_textureCoordinates; -vec2 neighborContribution(float log2Depth, vec2 offset) +#ifdef HAS_NORMAL_TEXTURE +vec2 getNormalTexCoords() { -float dist = u_distanceAndEdlStrength.x; -vec2 texCoordOrig = v_textureCoordinates + offset * dist; -vec2 texCoord0 = v_textureCoordinates + offset * floor(dist); -vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist); -float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0)); -float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1)); -if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) { -return vec2(0.0); +vec2 texCoord = TEXCOORD_NORMAL; +#ifdef HAS_NORMAL_TEXTURE_TRANSFORM +texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); +#endif +return texCoord; +} +#endif +#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) +vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +{ +vec2 tex_dx = dFdx(normalTexCoords); +vec2 tex_dy = dFdy(normalTexCoords); +float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; +vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); +return tangent / determinant; +} +#endif +#ifdef USE_ANISOTROPY +struct NormalInfo { +vec3 tangent; +vec3 bitangent; +vec3 normal; +vec3 geometryNormal; +}; +NormalInfo getNormalInfo(ProcessedAttributes attributes) +{ +vec3 geometryNormal = attributes.normalEC; +#ifdef HAS_NORMAL_TEXTURE +vec2 normalTexCoords = getNormalTexCoords(); +#endif +#ifdef HAS_BITANGENTS +vec3 tangent = attributes.tangentEC; +vec3 bitangent = attributes.bitangentEC; +#else // Assume HAS_NORMAL_TEXTURE +vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); +tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); +vec3 bitangent = normalize(cross(geometryNormal, tangent)); +#endif +#ifdef HAS_NORMAL_TEXTURE +mat3 tbn = mat3(tangent, bitangent, geometryNormal); +vec3 normalSample; +#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; +#endif +vec3 normal = normalize(tbn * normalSample); +#else +vec3 normal = geometryNormal; +#endif +#ifdef HAS_DOUBLE_SIDED_MATERIAL +if (czm_backFacing()) { +tangent *= -1.0; +bitangent *= -1.0; +normal *= -1.0; +geometryNormal *= -1.0; } -float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix); -return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0); +#endif +NormalInfo normalInfo; +normalInfo.tangent = tangent; +normalInfo.bitangent = bitangent; +normalInfo.normal = normal; +normalInfo.geometryNormal = geometryNormal; +return normalInfo; } -void main() -{ -float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth); -eyeCoordinate /= eyeCoordinate.w; -float log2Depth = log2(-eyeCoordinate.z); -if (depthOrLogDepth == 0.0) +#endif +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) { -discard; -} -vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates); -vec2 texelSize = 1.0 / czm_viewport.zw; -vec2 responseAndCount = vec2(0.0); -responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0)); -responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0)); -responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y)); -responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y)); -float response = responseAndCount.x / responseAndCount.y; -float strength = u_distanceAndEdlStrength.y; -float shade = exp(-response * 300.0 * strength); -color.rgb *= shade; -out_FragColor = vec4(color); -gl_FragDepth = depthOrLogDepth; -} -`;function VC(){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(VC.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 VQe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var OJ=new U;function jQe(e,t){let n=new Xe({defines:["LOG_DEPTH_WRITE"],sources:[z3]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return OJ.x=e._radius,OJ.y=e._strength,OJ}},r=Ge.fromCache({blending:nn.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 di({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function HQe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),jQe(e,t)}function tge(e){return e.drawBuffers&&e.fragmentDepth}VC.isSupported=tge;function GQe(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 - czm_writeLogDepth(); - out_FragData_1 = czm_packDepth(gl_FragDepth); +vec2 normalTexCoords = getNormalTexCoords(); +#ifdef HAS_BITANGENTS +vec3 t = attributes.tangentEC; +vec3 b = attributes.bitangentEC; #else - out_FragData_1 = czm_packDepth(gl_FragCoord.z); +vec3 t = computeTangent(attributes.positionEC, normalTexCoords); +t = normalize(t - geometryNormal * dot(geometryNormal, t)); +vec3 b = normalize(cross(geometryNormal, t)); #endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}VC.prototype.update=function(e,t,n,i){if(!tge(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,HQe(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=GQe(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)};VC.prototype.isDestroyed=function(){return!1};VC.prototype.destroy=function(){return VQe(this),le(this)};var Ay=VC;function nge(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}nge.isSupported=function(e){return Ay.isSupported(e.context)};var ig=nge;var Eu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Eu.NUMBER_OF_SHADOW_MODES=4;Eu.castShadows=function(e){return e===Eu.ENABLED||e===Eu.CAST_ONLY};Eu.receiveShadows=function(e){return e===Eu.ENABLED||e===Eu.RECEIVE_ONLY};Eu.fromCastReceive=function(e,t){return e&&t?Eu.ENABLED:e?Eu.CAST_ONLY:t?Eu.RECEIVE_ONLY:Eu.DISABLED};Object.freeze(Eu);var Pn=Eu;function xD(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function ige(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 WQe(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}xD.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,ige(this,e,t,n,1,i.byteOffset)):i};xD.prototype.hasProperty=function(e){return l(this.json[e])};xD.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)),ige(this,e,t,n,this.featuresLength,i.byteOffset)):WQe(this,e,t,i)};xD.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 fp=xD;function TD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=qQe(n),a;l(s.jsonProperties)&&(a=new _y({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new JE({extension:s.hierarchy,binaryBody:i}));let u=op.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=XQe(t,u,f,i,o);g=A.transcodedSchema,p=[new LC({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=YQe(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new Dh({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 xu({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 ec(y)}function qQe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(TD._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 YQe(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=gh(p);o[d]={bufferView:a},r[d]=rge(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=Au.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function XQe(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=rge(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=gh(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)&&(TD._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=Au.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function rge(e){let t=KQe(e.componentType);return{type:e.type,componentType:t}}function KQe(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"}}TD._deprecationWarning=Yr;TD._oneTimeWarning=yt;var by=TD;var rx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},$Qe=En.FeatureIdAttribute,MJ=class extends rr{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??Gi.Y,f=t.forwardAxis??Gi.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=rx.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=uL.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new fp(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 yd({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=rx.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=rx.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return JQe(f,d)}),this._promise}process(t){if(this._state===rx.READY)return!0;if(this._state!==rx.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),ZQe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=rx.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function JQe(e,t){return e.unload(),e._state=rx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function ZQe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=by({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new xu({name:op.BATCH_TABLE_CLASS_NAME,count:i});r=new ec({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)oge(o[a]);t.structuralMetadata=r}function oge(e){let t=e.children.length;for(let i=0;i<t;i++)oge(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 $Qe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var V3=MJ;var NJ=class extends rr{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=det(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function QQe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function eet(){this.features=[]}function LJ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function FJ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=LJ(e[r]);return[n]}function tet(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=FJ(e[i])[0];return n}function sge(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=FJ(e[i])[0];return n}function net(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=sge(e[i]);Qn(n,r)}return n}function iet(e){return[LJ(e)]}function ret(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=LJ(e[i]);return n}var oet={LineString:FJ,MultiLineString:tet,MultiPolygon:net,Polygon:sge,MultiPoint:ret,Point:iet},set={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function age(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=oet[n],r=set[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new QQe;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function aet(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)age(n[r],t)}var cet={FeatureCollection:aet,Feature:age},j3=new h;function uet(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,j3),B=M.multiplyByPoint(t,V,j3);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 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 fet(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,j3),O=M.multiplyByPoint(t,R,j3);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 det(e,t){let n=new eet,i=cet[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 _y({count:o,properties:s}),u=[new xu({id:0,count:o,jsonMetadataTable:a})],f=Au.fromJson({}),d=new ec({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(uet(r,T,t)),y&&E.push(fet(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 H3=NJ;var G3={};G3._deprecationWarning=Yr;var xy=Uint32Array.BYTES_PER_ELEMENT;G3.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):(G3._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 W3=G3;var rg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},q3=En.Attribute,het=En.FeatureIdAttribute,lge=En.Instances,BJ=class extends rr{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??Gi.Y,f=t.forwardAxis??Gi.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=rg.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=W3.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new fp(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 yd(f);return this._gltfLoader=d,this._state=rg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=rg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw met(this,p)}),this._promise}process(t){if(this._state===rg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===rg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=M.multiplyTransformation(this._transform,r.transform,r.transform),_et(this,r,t),pet(this,r),this._components=r,this._arrayBuffer=void 0,this._state=rg.READY,!0}isUnloaded(){return this._state===rg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Tet(this),this._components=void 0,this._arrayBuffer=void 0,this._state=rg.UNLOADED}};function met(e,t){return e.unload(),e._state=rg.FAILED,e.getError("Failed to load i3dm",t)}function pet(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=by({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new xu({name:op.BATCH_TABLE_CLASS_NAME,count:i});r=new ec({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var Y3=new h,kJ=new Array(4),get=new M;function _et(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=Aet(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=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,Y3),f[3*i+0]=Y3.x,f[3*i+1]=Y3.y,f[3*i+2]=Y3.z;let j=M.fromTranslation(B.center,get);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&&(bet(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&&(xet(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 lge;O.transformInWorldSpace=!0;let L=e._buffers,_=new q3;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 q3;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 q3;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 q3;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 het;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?yet(O):O,V=!0)}}function yet(e){let t=new lge;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 Aet(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 cge=new Array(4);function bet(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,kJ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,cge),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,kJ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,cge);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 xet(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,kJ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Tet(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 X3=BJ;var uge={STOPPED:0,ANIMATING:1};Object.freeze(uge);var dp=uge;function jC(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}jC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};jC.prototype.evaluate=pe.throwInstantiationError;jC.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};jC.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};jC.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var Mr=jC;function HC(e){this._value=e,this._valueType=Mr.getPointType(e)}Object.defineProperties(HC.prototype,{value:{get:function(){return this._value}}});HC.prototype.findTimeInterval=function(e){};HC.prototype.wrapTime=function(e){return 0};HC.prototype.clampTime=function(e){return 0};HC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var K3=HC;function GC(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Mr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(GC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});GC.prototype.findTimeInterval=Mr.prototype.findTimeInterval;GC.prototype.wrapTime=Mr.prototype.wrapTime;GC.prototype.clampTime=Mr.prototype.clampTime;GC.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 ox=GC;var fge={};fge.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 ED=fge;var dge=[],hge=[],mge=[],pge=[];function Eet(e,t,n){let i=dge,r=mge,o=hge,s=pge;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),ED.solve(i,o,r,s)}function Cet(e){let t=dge,n=mge,i=hge,r=pge;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),ED.solve(t,i,n,r)}function Cu(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=Mr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Cu.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}}});Cu.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 Cu({times:t,points:n,inTangents:o,outTangents:r})};Cu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new ox({points:n,times:t});let i=Cet(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Cu({times:t,points:n,inTangents:o,outTangents:r})};Cu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Mr.getPointType(n[0]);if(n.length<3)return new ox({points:n,times:t});let s=Eet(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Cu({times:t,points:n,inTangents:c,outTangents:a})};Cu.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Cu.prototype.findTimeInterval=Mr.prototype.findTimeInterval;var vet=new se,WC=new h;Cu.prototype.wrapTime=Mr.prototype.wrapTime;Cu.prototype.clampTime=Mr.prototype.clampTime;Cu.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=vet;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(Cu.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,WC),d.add(t,WC,t),d.multiplyByScalar(o[s],f.z,WC),d.add(t,WC,t),d.multiplyByScalar(r[s],f.w,WC),d.add(t,WC,t))};var sx=Cu;function qC(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Mr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(qC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});qC.prototype.findTimeInterval=Mr.prototype.findTimeInterval;qC.prototype.wrapTime=Mr.prototype.wrapTime;qC.prototype.clampTime=Mr.prototype.clampTime;qC.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 $3=qC;function wet(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=wet(this),this._lastTimeIndex=0}Object.defineProperties(YC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});YC.prototype.findTimeInterval=Mr.prototype.findTimeInterval;YC.prototype.wrapTime=Mr.prototype.wrapTime;YC.prototype.clampTime=Mr.prototype.clampTime;YC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var J3=YC;var XC=En.AnimatedPropertyType;function UJ(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,Oet(this)}Object.defineProperties(UJ.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 Iet(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 sx({times:e,points:n,inTangents:i,outTangents:r})}function gge(e,t,n,i){if(e.length===1&&t.length===1)return new K3(t[0]);switch(n){case lp.STEP:return new $3({times:e,points:t});case lp.CUBICSPLINE:return Iet(e,t);case lp.LINEAR:return i===XC.ROTATION?new J3({times:e,points:t}):new ox({times:e,points:t})}}function Pet(e,t,n,i,r){let o=[];if(i===XC.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===lp.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(gge(e,f,n,i))}}else o.push(gge(e,t,n,i));return o}var Det=new h,Ret=new Le;function Oet(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=Pet(i,r,o,a,u);e._splines=f,e._path=a}UJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===XC.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===XC.TRANSLATION||n===XC.SCALE?r[n]=o.evaluate(s,Det):n===XC.ROTATION&&(r[n]=o.evaluate(s,Ret))}}};var Z3=UJ;function zJ(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??gf.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,Met(this)}Object.defineProperties(zJ.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 Met(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 Z3({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}zJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var Q3=zJ;function og(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(og.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function VJ(e,t,n){let i=e._model,r=new Q3(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}og.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return VJ(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 VJ(this,n[i],e)};og.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=VJ(this,n[o],e);i.push(s)}return i};og.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};og.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])};og.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};og.prototype.get=function(e){return this._runtimeAnimations[e]};var eU=[];function Net(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}og.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===gf.REPEAT||a.loop===gf.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===gf.REPEAT)g=g-Math.floor(g);else if(a.loop===gf.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&&eU.push(a))}}n=eU.length;for(let s=0;s<n;++s){let a=eU[s];t.splice(t.indexOf(a),1),e.afterRender.push(Net(this,o,a))}return eU.length=0,i};var tU=og;function ax(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(ax.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}}});ax.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};ax.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};ax.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};ax.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};ax.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var nU=ax;var KC={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};KC.getStyleCommandsNeeded=function(e,t){return t===0?KC.ALL_OPAQUE:t===e?KC.ALL_TRANSLUCENT:KC.OPAQUE_AND_TRANSLUCENT};Object.freeze(KC);var hp=KC;var sg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};sg.is3DTiles=function(e){switch(e){case sg.TILE_GLTF:case sg.TILE_B3DM:case sg.TILE_I3DM:case sg.TILE_PNTS:case sg.TILE_GEOJSON:return!0;case sg.GLTF:return!1}};Object.freeze(sg);var Ko=sg;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=hp.ALL_OPAQUE,Let(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 Let(e){let t=e._model,n=Ko.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 nU({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new uu({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=hp.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 Fet=new z;ps.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(uu.DEFAULT_COLOR_VALUE),this.setAllShow(uu.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,Fet)??uu.DEFAULT_COLOR_VALUE:uu.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??uu.DEFAULT_SHOW_VALUE:uu.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(),le(this)};var iU=ps;var _ge={name:"TilesetPipelineStage"};_ge.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=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK};var rU=_ge;var oU=`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; -vec2 tTrigs = vec2(0.70710678118); -vec2 v = radii * tTrigs; -vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs; -vec2 q = normalize(p - evolute) * length(v - evolute); -tTrigs = (q + evolute) * inverseRadii; -tTrigs = normalize(clamp(tTrigs, 0.0, 1.0)); -v = radii * tTrigs; -return v * sign(pos); -} -vec3 computeEllipsoidPositionWC(vec3 positionMC) { -vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; -vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z); -vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz); -return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y); +mat3 tbn = mat3(t, b, geometryNormal); +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; +#endif +return normalize(tbn * normalSample); } -void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) { -vec3 fogColor = groundAtmosphereColor.rgb; -const float NONE = 0.0; -if (czm_atmosphereDynamicLighting != NONE) { -float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0); -fogColor *= darken; +#endif +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +{ +vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM +normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); +#endif +#ifdef HAS_BITANGENTS +vec3 t = attributes.tangentEC; +vec3 b = attributes.bitangentEC; +#else +vec3 t = computeTangent(attributes.positionEC, normalTexCoords); +t = normalize(t - geometryNormal * dot(geometryNormal, t)); +vec3 b = normalize(cross(geometryNormal, t)); +#endif +mat3 tbn = mat3(t, b, geometryNormal); +vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; +normalSample = 2.0 * normalSample - 1.0; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE +normalSample.xy *= u_clearcoatNormalTextureScale; +#endif +return normalize(tbn * normalSample); } -#ifndef HDR -fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); #endif -vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar); -color = vec4(withFog, color.a); +#ifdef HAS_NORMALS +vec3 computeNormal(ProcessedAttributes attributes) +{ +vec3 normal = attributes.normalEC; +#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) +normal = getNormalFromTexture(attributes, normal); +#endif +#ifdef HAS_DOUBLE_SIDED_MATERIAL +if (czm_backFacing()) { +normal = -normal; } -void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) { -vec3 rayleighColor; -vec3 mieColor; -float opacity; -vec3 positionWC; -vec3 lightDirection; -if (false) { -positionWC = computeEllipsoidPositionWC(attributes.positionMC); -lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); -czm_computeGroundAtmosphereScattering( -positionWC, -lightDirection, -rayleighColor, -mieColor, -opacity -); -} else { -positionWC = attributes.positionWC; -lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting); -rayleighColor = v_atmosphereRayleighColor; -mieColor = v_atmosphereMieColor; -opacity = v_atmosphereOpacity; +#endif +return normal; } -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels); -vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); -if (u_isInFog) { -float distanceToCamera = length(attributes.positionEC); -applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); -} else { +#endif +#ifdef HAS_BASE_COLOR_TEXTURE +vec4 getBaseColorFromTexture() +{ +vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; +#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM +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; } +#endif +#ifdef HAS_EMISSIVE_TEXTURE +vec3 getEmissiveFromTexture() +{ +vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; +#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM +emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); +#endif +vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); +#ifdef HAS_EMISSIVE_FACTOR +emissive *= u_emissiveFactor; +#endif +return emissive; } -`;var sU=`void atmosphereStage(ProcessedAttributes attributes) { -vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); -czm_computeGroundAtmosphereScattering( -v_positionWC, -lightDirection, -v_atmosphereRayleighColor, -v_atmosphereMieColor, -v_atmosphereOpacity -); +#endif +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +void setSpecularGlossiness(inout czm_modelMaterial material) +{ +#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE +vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; +#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM +specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); +#endif +vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); +vec3 specular = specularGlossiness.rgb; +float glossiness = specularGlossiness.a; +#ifdef HAS_LEGACY_SPECULAR_FACTOR +specular *= u_legacySpecularFactor; +#endif +#ifdef HAS_GLOSSINESS_FACTOR +glossiness *= u_glossinessFactor; +#endif +#else +#ifdef HAS_LEGACY_SPECULAR_FACTOR +vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); +#else +vec3 specular = vec3(1.0); +#endif +#ifdef HAS_GLOSSINESS_FACTOR +float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); +#else +float glossiness = 1.0; +#endif +#endif +#ifdef HAS_DIFFUSE_TEXTURE +vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; +#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM +diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); +#endif +vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); +#ifdef HAS_DIFFUSE_FACTOR +diffuse *= u_diffuseFactor; +#endif +#elif defined(HAS_DIFFUSE_FACTOR) +vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); +#else +vec4 diffuse = vec4(1.0); +#endif +material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); +material.alpha = diffuse.a; +material.specular = specular; +material.roughness = 1.0 - glossiness; } -`;var yge={name:"AtmospherePipelineStage"};yge.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([sU]),i.addFragmentLines([oU]),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 aU=yge;var cU=`#ifdef DIFFUSE_IBL -vec3 sampleDiffuseEnvironment(vec3 cubeDir) +#elif defined(LIGHTING_PBR) +float setMetallicRoughness(inout czm_modelMaterial material) { -#ifdef CUSTOM_SPHERICAL_HARMONICS -return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); +#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE +vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; +#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM +metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); +#endif +vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; +float metalness = clamp(metallicRoughness.b, 0.0, 1.0); +float roughness = clamp(metallicRoughness.g, 0.0, 1.0); +#ifdef HAS_METALLIC_FACTOR +metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); +#endif +#ifdef HAS_ROUGHNESS_FACTOR +roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); +#endif #else -return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); +#ifdef HAS_METALLIC_FACTOR +float metalness = clamp(u_metallicFactor, 0.0, 1.0); +#else +float metalness = 1.0; #endif -} +#ifdef HAS_ROUGHNESS_FACTOR +float roughness = clamp(u_roughnessFactor, 0.0, 1.0); +#else +float roughness = 1.0; #endif -#ifdef SPECULAR_IBL -vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness) +#endif +const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); +vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); +material.specular = f0; +material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); +material.roughness = roughness; +return metalness; +} +#ifdef USE_SPECULAR +void setSpecular(inout czm_modelMaterial material, in float metalness) { -#ifdef CUSTOM_SPECULAR_IBL -float lod = roughness * model_specularEnvironmentMapsMaximumLOD; -return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb; +#ifdef HAS_SPECULAR_TEXTURE +vec2 specularTexCoords = TEXCOORD_SPECULAR; +#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM +specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); +#endif +float specularWeight = texture(u_specularTexture, specularTexCoords).a; +#ifdef HAS_SPECULAR_FACTOR +specularWeight *= u_specularFactor; +#endif #else -float lod = roughness * czm_specularEnvironmentMapsMaximumLOD; -return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb; +#ifdef HAS_SPECULAR_FACTOR +float specularWeight = u_specularFactor; +#else +float specularWeight = 1.0; +#endif +#endif +#ifdef HAS_SPECULAR_COLOR_TEXTURE +vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; +#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM +specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); +#endif +vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; +vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); +#ifdef HAS_SPECULAR_COLOR_FACTOR +specularColorFactor *= u_specularColorFactor; +#endif +#else +#ifdef HAS_SPECULAR_COLOR_FACTOR +vec3 specularColorFactor = u_specularColorFactor; +#else +vec3 specularColorFactor = vec3(1.0); +#endif #endif +material.specularWeight = specularWeight; +vec3 f0 = material.specular; +vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); +material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); } -vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness) +#endif +#ifdef USE_ANISOTROPY +void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) { -vec3 f90 = max(vec3(1.0 - roughness), f0); -vec3 F = fresnelSchlick2(f0, f90, NdotV); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness); -return specularSample * (F * brdfLut.x + brdfLut.y); +mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); +float anisotropyStrength = u_anisotropy.z; +vec2 direction = vec2(1.0, 0.0); +#ifdef HAS_ANISOTROPY_TEXTURE +vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; +#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM +anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); +#endif +vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; +direction = anisotropySample.rg * 2.0 - vec2(1.0); +anisotropyStrength *= anisotropySample.b; +#endif +direction = rotation * direction; +mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); +vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); +vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); +material.anisotropicT = anisotropicT; +material.anisotropicB = anisotropicB; +material.anisotropyStrength = anisotropyStrength; } #endif -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) { -vec3 f0 = material.specular; -float roughness = material.roughness; -float specularWeight = 1.0; -#ifdef USE_SPECULAR -specularWeight = material.specularWeight; +#ifdef USE_CLEARCOAT +void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +{ +#ifdef HAS_CLEARCOAT_TEXTURE +vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; +#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM +clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); +#endif +float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; +#ifdef HAS_CLEARCOAT_FACTOR +clearcoatFactor *= u_clearcoatFactor; #endif -float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0); -vec3 f90 = max(vec3(1.0 - roughness), f0); -vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV); -vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; -vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y); -#ifdef DIFFUSE_IBL -vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC); -vec3 irradiance = sampleDiffuseEnvironment(normalMC); -vec3 averageFresnel = f0 + (1.0 - f0) / 21.0; -float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y); -vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems); -vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse; -vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x; #else -vec3 diffuseContribution = vec3(0.0); +#ifdef HAS_CLEARCOAT_FACTOR +float clearcoatFactor = u_clearcoatFactor; +#else +float clearcoatFactor = 0.0; +#endif +#endif +#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE +vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; +#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM +clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); +#endif +float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; +#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR +clearcoatRoughness *= u_clearcoatRoughnessFactor; #endif -#ifdef USE_ANISOTROPY -vec3 anisotropyDirection = material.anisotropicB; -vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC); -vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection); -float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness); -float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor; -vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4)); -vec3 reflectEC = reflect(-viewDirectionEC, bentNormal); #else -vec3 reflectEC = reflect(-viewDirectionEC, normalEC); +#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR +float clearcoatRoughness = u_clearcoatRoughnessFactor; +#else +float clearcoatRoughness = 0.0; #endif -#ifdef SPECULAR_IBL -vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC); -vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness); -vec3 specularContribution = radiance * FssEss * model_iblFactor.y; +#endif +material.clearcoatFactor = clearcoatFactor; +material.clearcoatRoughness = clearcoatRoughness; +#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE +material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); #else -vec3 specularContribution = vec3(0.0); +material.clearcoatNormal = attributes.normalEC; #endif -return diffuseContribution + specularContribution; } #endif -`;var Age={name:"ImageBasedLightingPipelineStage"},Bet=new U;Age.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),up.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(cU);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Bet)},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 lU=Age;var ket=P.EPSILON16;function HJ(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(HJ.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,ket)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Uet=new h,jJ=new $;HJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Uet,r;switch(t){case Rl.XROTATE:r=$.fromRotationX(P.toRadians(n),jJ),e=M.multiplyByMatrix3(e,r,e);break;case Rl.YROTATE:r=$.fromRotationY(P.toRadians(n),jJ),e=M.multiplyByMatrix3(e,r,e);break;case Rl.ZROTATE:r=$.fromRotationZ(P.toRadians(n),jJ),e=M.multiplyByMatrix3(e,r,e);break;case Rl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Rl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Rl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case Rl.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case Rl.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case Rl.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case Rl.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var uU=HJ;function fU(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,zet(this)}Object.defineProperties(fU.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 zet(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 uU({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}fU.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Vet=new M,jet=new M;fU.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,Vet),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,jet);s.transform=a}};var dU=fU;var hU=`void modelColorStage(inout czm_modelMaterial material) +#endif +void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) { -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 $C={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};$C.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(hU);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",$C.COLOR_UNIFORM_NAME,de.FRAGMENT),r[$C.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",$C.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[$C.COLOR_BLEND_UNIFORM_NAME]=function(){return Dl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var cx=$C;var mU=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE -vec4 getClippingPlane( -highp sampler2D packedClippingPlanes, -int clippingPlaneNumber, -mat4 transform -) { -int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH; -int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); -float u = (float(pixX) + 0.5) * pixelWidth; -float v = (float(pixY) + 0.5) * pixelHeight; -vec4 plane = texture(packedClippingPlanes, vec2(u, v)); -return czm_transformPlane(plane, transform); -} -#else -vec4 getClippingPlane( -highp sampler2D packedClippingPlanes, -int clippingPlaneNumber, -mat4 transform -) { -int clippingPlaneStartIndex = clippingPlaneNumber * 2; -int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH; -int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH); -float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT); -float u = (float(pixX) + 0.5) * pixelWidth; -float v = (float(pixY) + 0.5) * pixelHeight; -vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0; -vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w); -vec4 plane; -plane.xyz = czm_octDecode(oct, 65535.0); -plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v))); -return czm_transformPlane(plane, transform); -} +#ifdef USE_ANISOTROPY +NormalInfo normalInfo = getNormalInfo(attributes); +material.normalEC = normalInfo.normal; +#elif defined(HAS_NORMALS) +material.normalEC = computeNormal(attributes); +#endif +vec4 baseColorWithAlpha = vec4(1.0); +#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) +vec4 color = attributes.color_0; +#ifdef HAS_SRGB_COLOR +color = czm_srgbToLinear(color); +#endif +baseColorWithAlpha *= color; +#endif +#ifdef USE_CPU_STYLING +baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); +#endif +material.baseColor = baseColorWithAlpha; +material.diffuse = baseColorWithAlpha.rgb; +material.alpha = baseColorWithAlpha.a; +#ifdef HAS_OCCLUSION_TEXTURE +vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; +#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM +occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif -float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -vec4 position = czm_windowToEyeCoordinates(fragCoord); -vec3 clipNormal = vec3(0.0); -vec3 clipPosition = vec3(0.0); -float pixelWidth = czm_metersPerPixel(position); -#ifdef UNION_CLIPPING_REGIONS -float clipAmount; -#else -float clipAmount = 0.0; -bool clipped = true; +material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; +#endif +#ifdef HAS_EMISSIVE_TEXTURE +material.emissive = getEmissiveFromTexture(); +#elif defined(HAS_EMISSIVE_FACTOR) +material.emissive = u_emissiveFactor; +#endif +#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) +setSpecularGlossiness(material); +#elif defined(LIGHTING_PBR) +float metalness = setMetallicRoughness(material); +#ifdef USE_SPECULAR +setSpecular(material, metalness); +#endif +#ifdef USE_ANISOTROPY +setAnisotropy(material, normalInfo); +#endif +#ifdef USE_CLEARCOAT +setClearcoat(material, attributes); #endif -for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) { -vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix); -clipNormal = clippingPlane.xyz; -clipPosition = -clippingPlane.w * clipNormal; -float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth; -#ifdef UNION_CLIPPING_REGIONS -clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount)); -if (amount <= 0.0) { -discard; -} -#else -clipAmount = max(amount, clipAmount); -clipped = clipped && (amount <= 0.0); #endif } -#ifndef UNION_CLIPPING_REGIONS -if (clipped) { -discard; -} +`;var dz=`#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 -return clipAmount; +`;var hz=`#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); } -void modelClippingPlanesStage(inout vec4 color) -{ -float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix); -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a; -if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { -color = clippingPlanesEdgeColor; +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); } -`;var bge={name:"ModelClippingPlanesPipelineStage"},Het=new U,Get=new M,Wet=new M;bge.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,Het);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(mU);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,Get);return M.multiply(c,t._clippingPlanesMatrix,Wet)}};e.uniformMap=Ot(a,e.uniformMap)};var pU=bge;var gU=`void modelClippingPolygonsStage() -{ -bool insideAny = vectorClip(v_clippingUv); -#ifdef CLIPPING_INVERSE -if (!insideAny) -{ -discard; +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); } -#else -if (insideAny) +#endif +`;var{Material:Dit,MetallicRoughness:VJ,SpecularGlossiness:jJ,Specular:c_e,Clearcoat:l_e}=vn,u_e={name:"MaterialPipelineStage",_processTexture:Du,_processTextureTransform:f_e};u_e.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;Lit(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Fit(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&Bit(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&Uit(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&zit(i.clearcoat,o,s,u,c),Vit(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Rit(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=ug.UNLIT:y.lightingModel=ug.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)&&Mit(i.lineStyle,t,n,o,s),s.addFragmentLines(fz),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function Rit(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 Oit(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(hz);let u=dz.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 Mit(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) { -discard; -} + float cumDist = attributes.${u}; +#ifdef LINE_CUM_DIST_NORMALIZED + cumDist *= u_cumulativeDistanceMax; #endif + const float textureCoordinateBase = 8192.0; + v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; } -`;var _U=`void modelClippingPolygonsStage() +#endif +`)}else l(s)&&r.addVertexLines(` +#ifdef HAS_LINE_PATTERN +void lineStyleStageVS(in ProcessedAttributes attributes) { -vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; -v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; + 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; + } } -`;var Ty=`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 +`)}function f_e(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 Nit(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 Du(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)&&f_e(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Nit(e,t,n,i,r),Oit(e,t,n,i,r,s)}function Lit(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Dit.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&&Du(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),Du(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Du(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Fit(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&&Du(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,jJ.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&&Du(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,jJ.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!==jJ.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 Bit(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&&Du(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==c_e.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&&Du(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,c_e.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 kit=new h;function Uit(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Du(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,kit)}}function zit(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!==l_e.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&&Du(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==l_e.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&&Du(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Du(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Vit(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Du(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,VJ.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&&Du(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==VJ.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!==VJ.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 mz=u_e;var Ll={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"};Ll.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Ll.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(Ll.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(Ll.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(Ll.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(Ll.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(Ll.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",[`${Ll.METADATA_PICKING_VALUE_TYPE} value = ${Ll.METADATA_PICKING_VALUE_TYPE}(${Ll.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Ll.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Ll.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Ll.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Ll.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Ad=Ll;var pz=`void morphTargetsStage(inout ProcessedAttributes attributes) +{ +vec3 positionMC = attributes.positionMC; +attributes.positionMC = getMorphedPosition(positionMC); +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = getMorphedNormal(normalMC); #endif -#ifdef HAS_VECTOR_POLYGONS -uniform highp sampler2D u_vectorPolygonEdgeTexture; -uniform highp sampler2D u_vectorPolygonEdgePrimitiveIndicesTexture; -uniform highp sampler2D u_vectorPolygonGridCellIndicesTexture; +#ifdef HAS_TANGENTS +vec3 tangentMC = attributes.tangentMC; +attributes.tangentMC = getMorphedTangent(tangentMC); #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); +`;var bc={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)"};bc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Yit(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||(Hit(e,d,e.attributeIndex,a),e.attributeIndex++)}}Xit(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(pz);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var jit={attributeString:void 0,functionId:void 0};function Hit(e,t,n,i){let r=e.shaderBuilder;Git(e,t,n);let o=Wit(t,jit);qit(r,o,i)}function Git(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 Wit(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=bc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=bc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=bc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function qit(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 Yit(e){e.addFunction(bc.FUNCTION_ID_GET_MORPHED_POSITION,bc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(bc.FUNCTION_ID_GET_MORPHED_NORMAL,bc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(bc.FUNCTION_ID_GET_MORPHED_TANGENT,bc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Xit(e){e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(bc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var gz=bc;var d_e={name:"PickingPipelineStage"};function HJ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}d_e.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)Kit(e,t,a,i);else if(l(a))$it(e,i);else{let c=h_e(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=HJ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function h_e(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($o.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 Kit(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=HJ(e.pickId)}function $it(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=h_e(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=nt.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=HJ(e.pickId)}var _z=d_e;var m_e={ADD:0,REPLACE:1};Object.freeze(m_e);var So=m_e;var yz=`float getPointSizeFromAttenuation(vec3 positionEC) { +float pointSize = model_pointCloudParameters.x; +float geometricError = model_pointCloudParameters.y; +float depthMultiplier = model_pointCloudParameters.z; +float depth = -positionEC.z; +return min((geometricError / depth) * depthMultiplier, pointSize); } -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 HAS_POINT_CLOUD_SHOW_STYLE +float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); } -#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; +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); } -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; -} +#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +float tiles3d_tileset_time = model_pointCloudParameters.w; +return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); } -if (nearestEdgeDistance > vectorCoverageRadius) -{ -return baseColor; +#elif defined(HAS_POINT_CLOUD_ATTENUATION) +float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { +return getPointSizeFromAttenuation(v_positionEC); } -#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); +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +float pointCloudBackFaceCullingStage() { +#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) +return step(-v_normalEC.z, 0.0); #else -return baseColor; +return 1.0; #endif } -vec4 vectorCompositePolygonFill(vec4 baseColor, int primitiveIndex, bool inside, ivec2 primitiveTextureSize) -{ -if (!inside || primitiveIndex < 0) -{ -return baseColor; +#endif +`;var Jit=new se,g_e={name:"PointCloudStylingPipelineStage"};g_e.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=trt(a),A=nrt(o,y);irt(i,A);let x=rrt(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;$o.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===So.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(yz);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Jit,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=Zit(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 p_e=new h;function Zit(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,p_e);a=M.multiplyByPointAsVector(s,a,p_e);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var Qit={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},ert={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function trt(e){let t=Ze(ert);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 GJ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function nrt(e,t){let n=Qit,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${GJ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${GJ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${GJ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function irt(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 WJ(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 rrt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&WJ(t,r),l(n)&&WJ(n,r),l(i)&&WJ(i,r),r}var Az=g_e;var bz=`void primitiveOutlineStage() { +v_outlineCoordinates = a_outlineCoordinates; } -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); +`;var xz=`void primitiveOutlineStage(inout czm_modelMaterial material) { +if (!model_showOutline) { +return; } -bool vectorEdgeCrossesRay(vec4 edge, vec2 p) -{ -if ((edge.y > p.y) == (edge.w > p.y)) +float outlineX = +texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; +float outlineY = +texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; +float outlineZ = +texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; +float outlineness = max(outlineX, max(outlineY, outlineZ)); +material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +} +`;var __e={name:"PrimitiveOutlinePipelineStage"};__e.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=YC.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(bz),i.addFragmentLines(xz)};var Tz=__e;var y_e={name:"PrimitiveStatisticsPipelineStage",_countGeometry:A_e,_count2DPositions:b_e,_countMorphTargetAttributes:x_e,_countMaterialTextures:T_e,_countFeatureIdTextures:E_e,_countBinaryMetadata:C_e};y_e.process=function(e,t,n){let i=e.model,r=i.statistics;A_e(r,t),b_e(r,e.runtimePrimitive),x_e(r,t),T_e(r,t.material),E_e(r,t.featureIds),C_e(r,i)};function A_e(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+=ort(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 ort(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 b_e(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function x_e(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 T_e(e,t){let n=srt(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 srt(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 E_e(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof vn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function C_e(e,t){let n=t.structuralMetadata;l(n)&&(art(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 art(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 Ez=y_e;var crt=new M,lrt=new M,v_e={name:"SceneMode2DPipelineStage"};v_e.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,crt),u=drt(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=prt(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,lrt)}};e.uniformMap=Ot(m,e.uniformMap)};var urt=new h,frt=new h;function drt(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,urt),r=pr.computeActualEllipsoidPosition(n,i,i),o=M.multiplyByPoint(t,e.positionMax,frt),s=pr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var S_e=new h;function hrt(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,S_e),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 mrt(e,t,n,i){let r;l(e.quantization)?r=hrt(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,S_e);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),d=pr.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 prt(e,t,n,i){let r=Ze(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=mrt(e,t,o,r),a=nt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var Cz=v_e;var vz=`void skinningStage(inout ProcessedAttributes attributes) { -return false; +mat4 skinningMatrix = getSkinningMatrix(); +mat3 skinningMatrixMat3 = mat3(skinningMatrix); +vec4 positionMC = vec4(attributes.positionMC, 1.0); +attributes.positionMC = vec3(skinningMatrix * positionMC); +#ifdef HAS_NORMALS +vec3 normalMC = attributes.normalMC; +attributes.normalMC = skinningMatrixMat3 * normalMC; +#endif +#ifdef HAS_TANGENTS +vec3 tangentMC = attributes.tangentMC; +attributes.tangentMC = skinningMatrixMat3 * tangentMC; +#endif } -float t = (p.y - edge.y) / (edge.w - edge.y); -float xIntersect = edge.x + t * (edge.z - edge.x); -return p.x < xIntersect; +`;var mx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};mx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),_rt(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(vz);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function grt(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 _rt(e,t){e.addFunction(mx.FUNCTION_ID_GET_SKINNING_MATRIX,mx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(mx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=grt(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(mx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(mx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var Sz=mx;var wz=`void verticalExaggerationStage( +inout ProcessedAttributes attributes +) { +vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); +vec2 vertexAzimuth = normalize(vertexPositionENU.xy); +float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); +float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; +vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; +vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; +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, vertexEllipsoidNormalEC); +float smallAngleVersine = 0.5 * sinTheta * sinTheta; +float versine = isSmallAngle ? smallAngleVersine : exactVersine; +float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; +float vertexHeight = czm_eyeHeight + dHeight; +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 * exaggerationDirectionScaledMC; } -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; +`;var w_e={name:"VerticalExaggerationPipelineStage"},yrt=new U;w_e.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(wz),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,yrt)}};var Iz=w_e;var qJ={};function Art(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 brt(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 xrt(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 Trt(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 Ert(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 Crt(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}qJ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?brt(t,n):Art(t);if(e===Oe.TRIANGLE_STRIP)return i?Trt(t,n):xrt(t);if(e===Oe.TRIANGLE_FAN)return i?Crt(t,n):Ert(t)};qJ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var qD=qJ;var I_e={name:"WireframePipelineStage"};I_e.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=vrt(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=qD.getWireframeIndicesCount(a,c)};function vrt(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=qD.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return nt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var Pz=I_e;function P_e(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=[]}P_e.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!==Cy.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=Srt(r,i,n),L=l(r.classificationType);u&&t.push(Cz),t.push(BU),x&&t.push(Pz),L&&t.push(yU),d&&t.push(gz),p&&t.push(Sz),S&&t.push(Az),b&&t.push(PU),g&&(I?yt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(cz)),A&&t.push(mz),t.push(lx),t.push(Oh),t.push(Ad),O.hasPropertyTable&&(t.push(fx),t.push(_U),t.push(xU)),f&&t.push(Iz),m&&t.push(IU),t.push(uz),r.allowPicking&&t.push(_z),I&&t.push(Tz),R&&(e.edgeVisibilityRequested=!0,t.push(NU),t.push(RU)),t.push(gU),t.push(Ez)};function Srt(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 Dz=P_e;function YJ(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=[],wrt(this)}Object.defineProperties(YJ.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 wrt(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=D_e(f,d,new M);a.push(p)}}function D_e(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}YJ.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]=D_e(i,r,e[n])}};var Rz=YJ;function Irt(){this.pass=void 0,this.alphaCutoff=void 0}var Tv=Irt;function XJ(e){this.name=e,this.fields=[]}XJ.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};XJ.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var Oz=XJ;function KJ(e){this.signature=e,this.body=[]}KJ.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}`)};KJ.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var Mz=KJ;function Fl(){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(Fl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Fl.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)};Fl.prototype.addStruct=function(e,t,n){this._structs[e]=new Oz(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Fl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Fl.prototype.addFunction=function(e,t,n){this._functions[e]=new Mz(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Fl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Fl.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)};Fl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Fl.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+=Drt(e),i};Fl.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}`)};Fl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?ti(t,e):t.push(e)};Fl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?ti(t,e):t.push(e)};Fl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=Prt(this),i=Rrt(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 en.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Fl.prototype.clone=function(){return Ze(this,!0)};function Prt(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(),ti(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),ti(n,a);return{vertexLines:t,fragmentLines:n}}function Drt(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Rrt(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(),ti(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),ti(n,a);return{vertexLines:t,fragmentLines:n}}var Iy=Fl;function Ort(e){this.shaderBuilder=new Iy,this.model=e,this.uniformMap={},this.alphaOptions=new Tv,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:gc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var Nz=Ort;var Lz=`void silhouetteStage(inout vec4 color) { +if(model_silhouettePass) { +color = czm_gammaCorrect(model_silhouetteColor); } -if (vectorEdgeCrossesRay(edge, vectorUv)) -{ -inside = !inside; } +`;var Fz=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +#ifdef HAS_NORMALS +if(model_silhouettePass) { +vec3 normal = normalize(czm_normal3D * attributes.normalMC); +normal.x *= czm_projection[0][0]; +normal.y *= czm_projection[1][1]; +positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; } -baseColor = vectorCompositePolygonFill(baseColor, currentPrimitive, inside, primitiveTextureSize); -return baseColor; -#else -return baseColor; #endif } -vec4 vectorPickColorOver(vec4 surfacePickColor) -{ -if (vectorPickPrimitiveIndex < 0) +`;var Bz={name:"ModelSilhouettePipelineStage"};Bz.silhouettesLength=0;Bz.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++Bz.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(Fz),i.addFragmentLines(Lz),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 kz=Bz;var Uz=`void modelSplitterStage() { -return surfacePickColor; +#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 } -ivec2 primitiveTextureSize = textureSize(u_vectorPickColorTexture, 0); -return texelFetch(u_vectorPickColorTexture, vectorIndexToUv(vectorPickPrimitiveIndex, primitiveTextureSize), 0); +`;var zz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};zz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(Uz);let r={};i.addUniform("float",zz.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[zz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var Vz=zz;function Mrt(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 jz=Mrt;function Nrt(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??ug.UNLIT}var Hz=Nrt;function Lrt(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=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new Hz,this.pickId=void 0,this.snapId=void 0}var Gz=Lrt;function JJ(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!==Qn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Qn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Urt(this)}function Frt(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:gc.LESS_OR_EQUAL},depthMask:!1}}var Brt={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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:nn.PRE_MULTIPLIED_ALPHA_BLEND},krt={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.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},M_e=[];function Urt(e){let t=e._command,n=M_e;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=YD(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=$J(t,o),a=R_e(t,o);n.length=0,n.push(s,a),e._commandListTerrain=YD(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=O_e(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=$J(t,o),a=R_e(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=YD(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=O_e(e,n,e._commandList3DTilesPicking))}}function YD(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 $J(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ei.ALWAYS:ei.EQUAL,r=Frt(i);return n.renderState=Ge.fromCache(r),n}function R_e(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Brt),n}var zrt=[];function O_e(e,t,n){let i=Ge.fromCache(krt),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=zrt;return c.length=0,c.push(s,a),YD(e,c,n)}Object.defineProperties(JJ.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}}});JJ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ti(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ti(t,this._commandListTerrain),this._classifies3DTiles&&ti(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=$J(this._command,r),s=M_e;s.length=0,s.push(o),this._commandListIgnoreShow=YD(this,s,this._commandListIgnoreShow)}ti(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ti(t,this._commandListTerrainPicking),this._classifies3DTiles&&ti(t,this._commandList3DTilesPicking)),t};var Wz=JJ;function Ev(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=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=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,Vrt(this)}function bd(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}bd.clone=function(e){return new bd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Vrt(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 bd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new bd({command:Xrt(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new bd({command:tot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new bd({command:not(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new bd({command:Krt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new bd({command:$rt(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 bd({command:N_e(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new bd({command:N_e(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new bd({command:Jrt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(Ev.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,Hrt(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Grt(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Wrt(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,qrt(this))}}});function jrt(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=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Hrt(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 Grt(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 Wrt(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 qrt(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}}}Ev.prototype.pushCommands=function(e,t){let n=qz(this,e);n&&!this._has2DCommands&&(Yrt(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(jrt(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==_p.ALL_OPAQUE&&Ep(t,this._translucentCommand,n),i===_p.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Ep(r._backfaceCommands,this._skipLodBackfaceCommand,n),Zrt(this,o,n),Ep(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Ep(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Dh.EDGES_ONLY&&this._needsEdgeCommands||Ep(t,this._originalCommand,n),t}};Ev.prototype.pushSilhouetteCommands=function(e,t){let n=qz(this,e);return Ep(t,this._silhouetteColorCommand,n),t};Ev.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=qz(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),Ep(t,s,r),t}if(i.pick){if(n!==Dh.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),Ep(t,s,r),t}if(n===Dh.SURFACES_ONLY)return t;let o=n===Dh.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),Ep(t,this._edgeCommand,r),t};Ev.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=qz(this,e);return Ep(t,this._planarFillIdCommand,n),t};function Ep(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function qz(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 fg(e,t){if(!l(t))return;let n=bd.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 Yrt(e){fg(e,e._originalCommand),fg(e,e._translucentCommand),fg(e,e._skipLodBackfaceCommand),fg(e,e._skipLodStencilCommand),fg(e,e._silhouetteModelCommand),fg(e,e._silhouetteColorCommand),fg(e,e._edgeCommand),fg(e,e._edgeSnapCommand),fg(e,e._planarFillIdCommand)}function Xrt(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=nn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function Krt(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 $rt(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=nn.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 N_e(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 Jrt(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 Zrt(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=Qrt(r);if(o!==s){let a=eot(o),c=Ze(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Qrt(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function eot(e){return Xt.CESIUM_3D_TILE_MASK|e<<Xt.SKIP_LOD_BIT_SHIFT}function tot(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 not(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=ei.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ei.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 Yz=Ev;var Xz=`precision highp float; +czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { +czm_modelVertexOutput vsOutput; +vsOutput.positionMC = positionMC; +vsOutput.pointSize = 1.0; +return vsOutput; } -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++) +void main() { -ivec2 edgeUv = vectorIndexToUv(i, edgeTextureSize); -int primitiveIndex = int(texelFetch(u_clippingEdgePrimitiveIndicesTexture, edgeUv, 0).r); -if (primitiveIndex != currentPrimitive) +ProcessedAttributes attributes; +initializeAttributes(attributes); +#ifdef HAS_IMAGERY +initializeImageryAttributes(); +#endif +#ifdef USE_DEQUANTIZATION +dequantizationStage(attributes); +#endif +#ifdef HAS_MORPH_TARGETS +morphTargetsStage(attributes); +#endif +#ifdef HAS_SKINNING +skinningStage(attributes); +#endif +#ifdef HAS_PRIMITIVE_OUTLINE +primitiveOutlineStage(); +#endif +#ifdef HAS_BITANGENTS +attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); +#endif +FeatureIds featureIds; +featureIdStage(featureIds, attributes); +#ifdef HAS_SELECTED_FEATURE_ID +SelectedFeature feature; +selectedFeatureIdStage(feature, featureIds); +cpuStylingStage(attributes.positionMC, feature); +#endif +#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) +mat4 modelView = czm_modelView3D; +mat3 normal = czm_normal3D; +#else +mat4 modelView = czm_modelView; +mat3 normal = czm_normal; +#endif +#ifdef HAS_INSTANCING +#ifdef USE_LEGACY_INSTANCING +mat4 instanceModelView; +mat3 instanceModelViewInverseTranspose; +legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); +modelView = instanceModelView; +normal = instanceModelViewInverseTranspose; +#else +instancingStage(attributes); +#endif +#ifdef USE_PICKING +v_pickColor = a_pickColor; +#endif +#endif +Metadata metadata; +MetadataClass metadataClass; +MetadataStatistics metadataStatistics; +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); +#ifdef HAS_VERTICAL_EXAGGERATION +verticalExaggerationStage(attributes); +#endif +#ifdef HAS_CUSTOM_VERTEX_SHADER +czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); +customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); +#endif +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 HAS_VECTOR_LOOKUP +modelVectorLookupStage(attributes); +#endif +#ifdef HAS_SILHOUETTE +silhouetteStage(attributes, positionClip); +#endif +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +float show = pointCloudShowStylingStage(attributes, metadata); +#else +float show = 1.0; +#endif +#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING +show *= pointCloudBackFaceCullingStage(); +#endif +#ifdef HAS_POINT_CLOUD_COLOR_STYLE +v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); +#endif +#ifdef PRIMITIVE_TYPE_POINTS +#ifdef HAS_CUSTOM_VERTEX_SHADER +gl_PointSize = vsOutput.pointSize; +#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) +gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); +#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 Kz=`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() { -if (inside) +czm_modelMaterial material; +material.diffuse = vec3(0.0); +material.specular = vec3(1.0); +material.roughness = 1.0; +material.occlusion = 1.0; +material.normalEC = vec3(0.0, 0.0, 1.0); +material.emissive = vec3(0.0); +material.alpha = 1.0; +return material; +} +vec4 handleAlpha(vec3 color, float alpha) { -return true; +#ifdef ALPHA_MODE_MASK +if (alpha < u_alphaCutoff) { +discard; } -currentPrimitive = primitiveIndex; -inside = false; +#endif +return vec4(color, alpha); } -vec4 edge = texelFetch(u_clippingEdgeTexture, edgeUv, 0); -if (vectorEdgeCrossesRay(edge, uv)) +void lineStyleStage() { -inside = !inside; -} +#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; } -return inside; +#endif } -`;var Tge={name:"ModelClippingPolygonsPipelineStage"},qet=new U,Yet=new U,xge=ie.MAX_VALUE;Tge.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(_U),r.addFragmentLines(Ty),r.addFragmentLines(gU);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??xge,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,qet)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??xge;return U.fromElements(1/s.width,1/s.height,Yet)},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 yU=Tge;var AU=`void modelVectorLookupStage(ProcessedAttributes attributes) +SelectedFeature selectedFeature; +bool isEdge = false; +void main() { -vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; -v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; +#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER) +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +if (distanceToCenter > 0.5) { +discard; } -`;var bU=`void modelVectorLookupStage(inout vec4 color) +#endif +#ifdef HAS_POINT_CLOUD_SHOW_STYLE +if (v_pointCloudShow == 0.0) { -color = vectorPolygonRender(v_vectorUv, color); -color = vectorPolylineRender(v_vectorUv, color); +discard; } -`;var Xet={name:"ModelVectorLookupPipelineStage",process:Jet},Ket=new U,$et=new U;function Jet(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(AU),i.addFragmentLines(Ty),i.addFragmentLines(bU);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,Ket)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,$et)},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 xU=Xet;function Ege(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Ege.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 TU=Ege;var Zet=new h(1,1,1),Qet=h.ZERO,ett=Le.IDENTITY;function Cge(e,t,n){this.translation=h.clone(e??Qet),this.rotation=Le.clone(t??ett),this.scale=h.clone(n??Zet)}Cge.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=Cge;var EU=`mat4 getInstancingTransform() -{ -mat4 instancingTransform; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform = mat4( -a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, -a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, -a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, -a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 -); -#else -vec3 translation = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation = a_instanceTranslation; #endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; +#ifdef HAS_MODEL_SPLITTER +modelSplitterStage(); #endif -instancingTransform = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation.x, translation.y, translation.z, 1.0 -); +czm_modelMaterial material = defaultModelMaterial(); +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 instancingTransform; +return; } -#ifdef USE_2D_INSTANCING -mat4 getInstancingTransform2D() -{ -mat4 instancingTransform2D; -#ifdef HAS_INSTANCE_MATRICES -instancingTransform2D = mat4( -a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, -a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, -a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, -a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 -); +#endif +Metadata metadata; +MetadataClass metadataClass; +MetadataStatistics metadataStatistics; +metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); +#ifndef METADATA_PICKING_ENABLED +#ifdef HAS_SELECTED_FEATURE_ID +selectedFeatureIdStage(selectedFeature, featureIds); +#endif +#ifndef CUSTOM_SHADER_REPLACE_MATERIAL +materialStage(material, attributes, selectedFeature); +#endif +#ifdef HAS_CUSTOM_FRAGMENT_SHADER +customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); +#endif +lightingStage(material, attributes); +#ifdef HAS_SELECTED_FEATURE_ID +cpuStylingStage(material, selectedFeature); +#endif +#ifdef HAS_MODEL_COLOR +modelColorStage(material); +#endif +#ifdef HAS_PRIMITIVE_OUTLINE +primitiveOutlineStage(material); +#endif +vec4 color = handleAlpha(material.diffuse, material.alpha); #else -vec3 translation2D = vec3(0.0, 0.0, 0.0); -vec3 scale = vec3(1.0, 1.0, 1.0); -#ifdef HAS_INSTANCE_TRANSLATION -translation2D = a_instanceTranslation2D; +vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0); +metadataPickingStage(metadata, metadataClass, metadataValues); +vec4 color = metadataValues; #endif -#ifdef HAS_INSTANCE_SCALE -scale = a_instanceScale; +lineStyleStage(); +#ifdef HAS_CLIPPING_PLANES +modelClippingPlanesStage(color); #endif -instancingTransform2D = mat4( -scale.x, 0.0, 0.0, 0.0, -0.0, scale.y, 0.0, 0.0, -0.0, 0.0, scale.z, 0.0, -translation2D.x, translation2D.y, translation2D.z, 1.0 -); +#ifdef ENABLE_CLIPPING_POLYGONS +modelClippingPolygonsStage(); #endif -return instancingTransform2D; +#ifdef HAS_VECTOR_LOOKUP +modelVectorLookupStage(color); +#endif +#ifndef METADATA_PICKING_ENABLED +#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS) +silhouetteStage(color); +#endif +#ifdef HAS_ATMOSPHERE +atmosphereStage(color, attributes); +#endif +#ifdef HAS_EDGE_VISIBILITY +edgeVisibilityStage(color, featureIds); +edgeDetectionStage(color, featureIds); +if (u_isEdgePass) { +isEdge = true; } #endif -`;var CU=`void instancingStage(inout ProcessedAttributes attributes) +#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 { -vec3 positionMC = attributes.positionMC; -mat4 instancingTransform = getInstancingTransform(); -attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; +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 -#ifdef USE_2D_INSTANCING -mat4 instancingTransform2D = getInstancingTransform2D(); -attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; +} +`;function L_e(){}L_e.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=iot(e,n,t),r=rot(e,i,t),o=e.model;return l(o.classificationType)?new Wz({primitiveRenderResources:e,command:r}):new Yz({primitiveRenderResources:e,command:r})};function iot(e,t,n){t.addVertexLines(Xz),t.addFragmentLines(Kz);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function rot(e,t,n){let i=oot(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=ue.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 oot(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var $z=L_e;function el(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={},sot(this)}Object.defineProperties(el.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 sot(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;F_e(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 J3({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=B_e(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 Rz({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 F_e(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 aot=new h;function cot(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,aot);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=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function B_e(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=B_e(e,d,p);i.push(g)}let s=new pU({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 Dz({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 aU(f,s);f._nodesByName[u]=d}return c}var lot=new h,uot=new h,fot=new h,dot=new h;el.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};el.prototype.buildRenderResources=function(e){let t=this._model,n=new Nz(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 jz(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 Gz(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};el.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,lot),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,uot);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=ue.clone(f.boundingSphere,new ue);let d=M.multiplyByPoint(a,f.positionMin,fot),p=M.multiplyByPoint(a,f.positionMax,dot);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=ue.fromCornerPoints(n,i,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};el.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=$z.buildModelDrawCommand(a,t);s.drawCommand=c}}};el.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(cx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(X3),n.isClippingEnabled()&&t.push(eU);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(iU),n.hasDrapedVectors()&&t.push(sU),n.hasSilhouette(e)&&t.push(kz),l(n.splitDirection)&&n.splitDirection!==Ho.NONE&&t.push(Vz),$o.is3DTiles(n.type)&&t.push(H3),i&&t.push(q3)};el.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)}}};el.prototype.updateModelMatrix=function(e,t){F_e(this,e),t.mode!==re.SCENE3D&&cot(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};el.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 k_e(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);k_e(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 Jz(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];k_e(e,c,t,n,i)}}var hot={backFaceCulling:void 0};el.prototype.updateBackFaceCulling=function(e){let t=hot;t.backFaceCulling=e,Jz(this,!1,mot,t)};function mot(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var pot={shadowMode:void 0};el.prototype.updateShadows=function(e){let t=pot;t.shadowMode=e,Jz(this,!1,got,t)};function got(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var _ot={debugShowBoundingVolume:void 0};el.prototype.updateShowBoundingVolume=function(e){let t=_ot;t.debugShowBoundingVolume=e,Jz(this,!1,yot,t)};function yot(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var U_e=[],z_e=[],V_e=[],Aot={frameState:void 0,hasSilhouette:void 0};el.prototype.pushDrawCommands=function(e){let t=U_e;t.length=0;let n=z_e;n.length=0;let i=V_e;i.length=0;let r=Aot;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,Jz(this,!0,bot,r),ti(e.commandList,t),ti(e.commandList,n),ti(e.commandList,i)};function bot(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=U_e,s=z_e,a=V_e,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)}el.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)};el.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var Zz=el;function Py(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new kt}Object.defineProperties(Py.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}}});Py.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()};Py.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};Py.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Py.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Py.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Py.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var Qz=Py;var W_e=js(sN(),1);var j_e={},px=Uint32Array.BYTES_PER_ELEMENT;j_e.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=px;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+=px,t+=px;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=px;let s=i.getUint32(t,!0);t+=px;let a=i.getUint32(t,!0);t+=px;let c=i.getUint32(t,!0);t+=px;let u=No(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=No(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=Tot(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=Eot(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=vot(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=Cot(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=Sot(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),xot(A),A};function xot(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 Tot(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 Eot(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 Cot(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 vot(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 Sot(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 Cv=j_e;var wot=vn.Components,Iot=vn.Scene,Pot=vn.Node,Dot=vn.Primitive,Rot=vn.Attribute,H_e=vn.Quantization,Oot=vn.FeatureIdAttribute,Mot=vn.Material,Not=vn.MetallicRoughness,ZJ=class extends ar{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=Cv.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=Lot(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 Lot(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=ry.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Fot(e,i,o),Yot(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 Fot(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:Bot(u.componentsPerAttribute),componentType:kot(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Bot(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function kot(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 XD(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new H_e,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new H_e;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 Rot;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=nt.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 G_e,eV;function Uot(e){if(!l(eV)){G_e=new W_e.default(0),eV=new Array(e);for(let t=0;t<e;++t)eV[t]=G_e.random()}return eV}var zot=new h,Vot=new h,jot=new h;function Hot(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Uot(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,zot),u=h.fromElements(a,a,a,Vot),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,jot),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Got={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Wot(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Hot(o),r=XD(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=XD(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=XD(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=XD(e,Got,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=XD(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function qot(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?by({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Qa({schema:{},propertyTables:[]})}function Yot(e,t){let n=e._parsedContent,i=new Not;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Mot;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 Dot;if(a.attributes=Wot(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new Oot;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Pot;c.index=0,c.primitives=[a];let u=new Iot;u.nodes=[c],u.upAxis=qi.Z,u.forwardAxis=qi.X;let f=new wot;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=qot(n,d),d.length>0&&Xot(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 Xot(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=nt.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 tV=ZJ;var nV=new h,q_e=new h,Y_e=new h,KD=new h,Kot=new h,$ot=new h,Jot=new he,Zot=new ue;function iV(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 Qot=32,QJ=new Map,eZ=[];function est(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 $D(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(Ma.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,Zot),E=xi.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=QJ.get(f);l(A)||(A={},l(y)&&(A.vertices=Ma.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=Ma.readIndicesAsTypedArray(f.indices)),QJ.set(f,A),eZ.push(f),eZ.length>Qot&&QJ.delete(eZ.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++)iV(g,O,m,nV),M.multiplyByPoint(T,nV,KD),R[O*3]=KD.x,R[O*3+1]=KD.y,R[O*3+2]=KD.z;A.world=R,A.worldTransform=M.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=est(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];iV(g,E,m,nV),iV(g,v,m,q_e),iV(g,S,m,Y_e);for(let I of d){let R=M.multiplyByPoint(I.transform,nV,KD),O=M.multiplyByPoint(I.transform,q_e,Kot),L=M.multiplyByPoint(I.transform,Y_e,$ot);i!==1&&(br.getPosition(R,o,i,r,R),br.getPosition(O,o,i,r,O),br.getPosition(L,o,i,r,L));let _=xi.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,Jot);f.cartographicToCartesian(d,s)}return s}}var tZ=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}},rV=tZ;var nZ=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 xv(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 rV(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},oV=nZ;function xr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??$o.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 z3(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??Rl.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 ue,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 ng(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Ps.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Zc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,$_e(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new oV(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new yC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new gy(e.environmentMapOptions);gy.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??Dh.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===$o.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??Ho.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new Qz,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 iZ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function tst(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 j3({model:e,propertyTable:s});n.push(a)}return n}function nst(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 sZ(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=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){sZ(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=sZ(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 Z_e(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===$o.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&&(Ps.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Zc.setOwner(e,this,"_clippingPolygons"),$_e(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Zc.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&&(gy.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 ist=new M,rst=new $,ost=new M;xr.prototype.update=function(e){let t=!1;try{t=sst(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")iZ(this,i);else{let r=xt.getError("model",this._resource,i);iZ(this,r)}}if(ast(this,e),cst(this,e),lst(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."));iZ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&tst(this,r);let o=new Zz({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(ust(this),fst(this),dst(this,e),hst(this),mst(this,e),pst(this,e),gst(this,e),_st(this,e),bst(this,e),xst(this,e),Tst(this,e),Est(this,e),this._defaultTexture=e.context.defaultTexture,Cst(this,e),Sst(this,e),Pst(this),Dst(this,e),Nst(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)),Ost(this),Lst(this,e),Fst(this),kst(this,e)}};function sst(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function ast(e,t){l(e._customShader)&&e._customShader.update(t)}function cst(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 lst(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function ust(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=nst(t,e),e._styleDirty=!0,e.resetDrawCommands())}function fst(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function dst(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&&K_e(e)}function K_e(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=_p.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function hst(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 mst(e,t){e._silhouetteDirty&&(eye(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function pst(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function gst(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 $_e(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 _st(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)&&(Zc.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 yst=new ie;function J_e(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function Ast(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function bst(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,yst);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 J_e(e);let r=Ast(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function xst(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Tst(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Est(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 Cst(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function vst(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function aZ(e,t){if(!l(e)||!l(t))return M.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function Sst(e,t){vst(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=aZ(e.modelMatrix,e._modelMatrix))}var Dy=new h,rZ=new he,wst=new he,Ist=200,X_e=30;function Pst(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=X_e;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;Dy.x=r[12],Dy.y=r[13],Dy.z=r[14];let o=i.cartesianToCartographic(Dy,wst);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(r,new M));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<X_e,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+Ist,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Gst(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,rZ),rZ.height=m,Q_e(e,i,o,rZ)):aZ(r,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;Z_e(e,n),Rst(e,n,t)}function Z_e(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=ue.transform(e._boundingSphere,t,e._boundingSphere)}function Rst(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,Dy),e._sceneMode!==re.SCENE3D&&pr.computeActualEllipsoidPosition(n,Dy,Dy);let s=e._boundingSphere.radius,a=Ust(Dy,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 Ost(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 Mst=new $(1,0,0,0,0,1,0,-1,0);function Nst(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=rst,s=ist;if(s=M.multiply(r.uniformState.view3D,i,s),o=M.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(Mst,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=M.multiply(i,e._clippingPlanes.modelMatrix,ost);e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function Lst(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 Fst(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 Bst(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function kst(e,t){let n=qst(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!Bst(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Yst(e,t),e._sceneGraph.pushDrawCommands(t))}var oZ=new ue;function Ust(e,t,n){return oZ.center=e,oZ.radius=t,n.camera.getPixelSize(oZ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var sV=new h,zst=new h,aV=new h,Vst=new h,jst=new M;function Hst(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,Vst),a=M.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,jst),c=e.scale,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,zst);h.multiplyByScalar(p,c,p),M.multiplyByPoint(a,p,aV),M.multiplyByPointAsVector(u,aV,aV);let g=h.dot(aV,s);g<f&&(f=g)}return-f}function Q_e(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Hst(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else R_(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,sV);let r=e._clampedModelMatrix;aZ(e.modelMatrix,r),r[12]=sV.x,r[13]=sV.y,r[14]=sV.z,e._heightDirty=!0}function Gst(e,t,n){return function(i){Q_e(e,t,n,i)}}var Wst=new h;function qst(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,Wst);pr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Yst(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 eye(e){return e.context.stencilBuffer}xr.prototype.hasSilhouette=function(e){return eye(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};xr.prototype.hasSkipLevelOfDetail=function(e){if(!$o.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 $D(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(),J_e(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)&&Zc.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,le(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 md(n),a=l(e.content)?$o.TILE_GLTF:$o.GLTF,c=n.gltfResource,u=JD(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 S3(t);try{await n.load();let i=JD(n,$o.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 tV(t);try{await n.load();let i=JD(n,$o.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 M3(t);try{await n.load();let i=JD(n,$o.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 I3(t),i=JD(n,$o.TILE_GEOJSON,e);return new xr(i)};var Xst=new z;xr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,Xst),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,sZ(t,this._color)&&this.resetDrawCommands()};xr.prototype.applyStyle=function(e){let t=this.type===$o.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),K_e(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function JD(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 xd=xr;var cZ=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:pf.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=ZD(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await xd.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=ZD(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await xd.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=ZD(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await xd.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=ZD(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await xd.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=ZD(t,n,o,{geoJson:r,resource:i}),c=await xd.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 ZD(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 Td=cZ;var lZ=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 le(this)}},cV=lZ;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)}uZ(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 Kst=[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]=Kst[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=$st(this,i)||t;if(t||!l(this.va)){uZ(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);Fa._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 $st(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=nt.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)Jst(n[i],e,t)};function Jst(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 uZ(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 uZ(this),le(this)};var Ry=Fa;var lV=`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; +flat in vec2 v_splitDirectionAndEllipsoidDepthEC; +#ifdef SDF +in vec4 v_outlineColor; +in float v_outlineWidth; #endif +in vec4 v_compressed; +const float SHIFT_LEFT1 = 2.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; +float getGlobeDepthAtCoords(vec2 st) +{ +float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); +if (logDepthOrDepth == 0.0) +{ +return 0.0; } -`;var vU=`void legacyInstancingStage( -inout ProcessedAttributes attributes, -out mat4 instanceModelView, -out mat3 instanceModelViewInverseTranspose) +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +return eyeCoordinate.z / eyeCoordinate.w; +} +#ifdef SDF +float getDistance(vec2 position) { -vec3 positionMC = attributes.positionMC; -mat4 instancingTransform = getInstancingTransform(); -mat4 instanceModel = instancingTransform * u_instance_nodeTransform; -instanceModelView = u_instance_modifiedModelView; -instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); -attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; -#ifdef USE_2D_INSTANCING -mat4 instancingTransform2D = getInstancingTransform2D(); -attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; -#endif +return texture(u_atlas, position).r; } -`;var SU=new M,ttt=new M,ntt=new M,Sge={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Rge,_transformsToTypedArray:WJ};Sge.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(EU);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=[];_tt(e,n,i,d,u,f),btt(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,SU);return u?M.multiplyTransformation(n.context.uniformState.view3D,g,SU):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,SU)),M.multiplyTransformation(n.context.uniformState.view,g,SU))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,ttt)},o.addVertexLines(vU)):o.addVertexLines(CU),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,ntt)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Qn(e.attributes,d)};var CD=new M,itt=new h;function rtt(e,t,n,i,r){let o=M.multiplyTransformation(t,e,CD);return o=M.multiplyTransformation(o,n,CD),r=At.basisTo2D(i.mapProjection,o,r),r}function ott(e,t,n,i,r){let o=M.fromTranslation(e,CD),s=M.multiplyTransformation(t,o,CD);s=M.multiplyTransformation(s,n,CD);let a=M.getTranslation(s,itt);return r=pr.computeActualEllipsoidPosition(i,a,r),r}function wge(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 Ige=new M,Pge=new M,stt=new M,att=new h;function ctt(e,t,n,i){let r=Ige,o=Pge;wge(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=rtt(f,r,o,n,stt),p=M.getTranslation(d,att),g=h.subtract(p,a,p);i[u]=M.setTranslation(d,g,i[u])}return i}function ltt(e,t,n,i){let r=Ige,o=Pge;wge(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=ott(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var utt=new h,ftt=new h;function Dge(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=M.multiplyByPoint(i,n.instancingTranslationMin,utt),o=pr.computeActualEllipsoidPosition(t,r,r),s=M.multiplyByPoint(i,n.instancingTranslationMax,ftt),a=pr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function WJ(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 dtt(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 htt=new h,mtt=new Le,ptt=new h;function Rge(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],htt);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,mtt),T=new h(m[A*3],m[A*3+1],m[A*3+2],ptt),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 gtt(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 qJ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function _tt(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Bo.ROTATION);l(s)||o?ytt(e,n,i,t,r,o):Att(e,n,i,t,r)}function ytt(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=Rge(t,a,e);let A=WJ(d);p=qJ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(vge(e,p,n,f),!r)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Dge(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=ctt(d,e,g,d),b=WJ(A);m=qJ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}vge(e,m,n,"Transform2D")}function Att(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"),GJ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=gtt(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),GJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Dge(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=ltt(f,e,g,f),T=dtt(x);o&&(a.transformsTypedArray=T),m=qJ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;GJ(e,m,0,void 0,n,"Translation2D")}function vge(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`),Qn(n,a)}function GJ(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 btt(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 wU=Sge;var Oge=[],YJ={};YJ.name="ModelMatrixUpdateStage";YJ.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;Mge(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function xtt(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function Mge(e,t,n,i,r){let o,s=Oge[r];l(s)||(s=Oge[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];xtt(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}Mge(u,t,n,i,r+1),u._transformDirty=!1}}var IU=YJ;var Nge={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Lge,_countGeneratedBuffers:Fge};Nge.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;Lge(i,r),Fge(i,o)};function Lge(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 Fge(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 PU=Nge;function JC(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,Ttt(this)}Object.defineProperties(JC.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),XJ(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),XJ(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),XJ(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 Ttt(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 XJ(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}JC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};JC.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(wU),t.push(PU),n.push(IU)};JC.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};JC.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 DU=JC;var Bge={name:"AlphaPipelineStage"};Bge.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=nn.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 RU=Bge;var kge={name:"BatchTexturePipelineStage"};kge.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 OU=kge;var Uge={name:"ClassificationPipelineStage"};Uge.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||Ett(t,r)};function Ett(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 MU=Uge;var NU=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing) { -bool styleTranslucent = (featureColor.a != 1.0); -if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) +float distance = getDistance(position); +if (outlineWidth > 0.0) { -#ifdef HAS_SILHOUETTE -positionMC *= float(model_silhouettePass); -#else -positionMC *= 0.0; -#endif +float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); +float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); +vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); +float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); +return vec4(sdfColor.rgb, sdfColor.a * alpha); } -else if (czm_pass != czm_passTranslucent && styleTranslucent) +else { -positionMC *= 0.0; +float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); +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; } -void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature) -{ -float show = ceil(feature.color.a); -positionMC *= show; -#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION) -filterByPassType(positionMC, feature.color); -#endif +return depthDifferential; } -`;var LU=`void filterByPassType(vec4 featureColor) -{ -bool styleTranslucent = (featureColor.a != 1.0); -if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) -{ -#ifdef HAS_SILHOUETTE -if(!model_silhouettePass) { +void doDepthTest(float eyeDepth, float globeDepth) { +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (eyeDepth > -u_threePointDepthTestDistance) { +if (eyeDepth == 0.0) { discard; } -#else -discard; +return; +} #endif +bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance; +if (useGlobeDepth && globeDepth == 0.0) { +return; } -else if (czm_pass != czm_passTranslucent && styleTranslucent) -{ +if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) { discard; } } -void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature) -{ -vec4 featureColor = feature.color; -if (featureColor.a == 0.0) +#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_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) { discard; } -#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION) -filterByPassType(featureColor); +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 -featureColor = czm_gammaCorrect(featureColor); -#ifdef HAS_CLASSIFICATION -material.diffuse = featureColor.rgb * featureColor.a; +} +vec4 color = texture(u_atlas, v_textureCoordinates); +#ifdef SDF +float outlineWidth = v_outlineWidth; +vec4 outlineColor = v_outlineColor; +float distance = getDistance(v_textureCoordinates); +#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) +float smoothing = fwidth(distance); +vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); +vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); +vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); +vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); +color = (center + color1 + color2 + color3 + color4)/5.0; #else -float highlight = ceil(model_colorBlend); -material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); +float smoothing = 1.0/32.0; +color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); #endif -material.alpha *= featureColor.a; -} -`;var zge={name:"CPUStylingPipelineStage"};zge.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(NU),r.addFragmentLines(LU),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",cx.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[cx.COLOR_BLEND_UNIFORM_NAME]=function(){return Dl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var FU=zge;var BU=`void customShaderStage( -inout czm_modelVertexOutput vsOutput, -inout ProcessedAttributes attributes, -FeatureIds featureIds, -Metadata metadata, -MetadataClass metadataClass, -MetadataStatistics metadataStatistics -) { -VertexInput vsInput; -initializeInputStruct(vsInput, attributes); -vsInput.featureIds = featureIds; -vsInput.metadata = metadata; -vsInput.metadataClass = metadataClass; -vsInput.metadataStatistics = metadataStatistics; -vertexMain(vsInput, vsOutput); -attributes.positionMC = vsOutput.positionMC; -} -`;var kU=`void customShaderStage( -inout czm_modelMaterial material, -ProcessedAttributes attributes, -FeatureIds featureIds, -Metadata metadata, -MetadataClass metadataClass, -MetadataStatistics metadataStatistics -) { -FragmentInput fsInput; -initializeInputStruct(fsInput, attributes); -fsInput.featureIds = featureIds; -fsInput.metadata = metadata; -fsInput.metadataClass = metadataClass; -fsInput.metadataStatistics = metadataStatistics; -fragmentMain(fsInput, material); -} -`;var UU=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { -initializeFeatureIds(featureIds, attributes); -initializeFeatureIdAliases(featureIds); -} -`;var zU=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +color = czm_gammaCorrect(color); +#else +color = czm_gammaCorrect(color); +color *= czm_gammaCorrect(v_color); +#endif +#if !defined(OPAQUE) && !defined(TRANSLUCENT) +if (color.a < 0.005) { -initializeFeatureIds(featureIds, attributes); -initializeFeatureIdAliases(featureIds); -setFeatureIdVaryings(); +discard; } -`;var cr={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()"};cr.process=function(e,t,n){let i=e.shaderBuilder;Ctt(i);let r=e.runtimeNode.node.instances;l(r)&&vtt(e,r,n),Stt(e,t,n),i.addVertexLines(zU),i.addFragmentLines(UU)};function Ctt(e){e.addStruct(cr.STRUCT_ID_FEATURE_IDS_VS,cr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(cr.STRUCT_ID_FEATURE_IDS_FS,cr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,cr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function vtt(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?wtt(e,s,a):Vge(e,s,a,r,1,n);let c=s.label;l(c)&&jge(e,a,c,de.BOTH)}}function Stt(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?Itt(e,a,c):a instanceof En.FeatureIdImplicitRange?Vge(e,a,c,o,void 0,n):(Ptt(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&jge(e,c,f,u)}}function wtt(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Itt(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Vge(e,t,n,i,r,o){Dtt(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(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Ptt(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(cr.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(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function jge(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Dtt(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=Rtt(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 Rtt(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 ux=cr;var VU=`void metadataStage( -FeatureIds featureIds, -out Metadata metadata, -out MetadataClass metadataClass, -out MetadataStatistics metadataStatistics, -ProcessedAttributes attributes -) +#else +#ifdef OPAQUE +if (color.a < 0.995) { -initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); +discard; } -`;var jU=`void metadataStage( -FeatureIds featureIds, -out Metadata metadata, -out MetadataClass metadataClass, -out MetadataStatistics metadataStatistics, -ProcessedAttributes attributes -) +#else +if (color.a >= 0.995) { -initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); -setMetadataVaryings(); -} -`;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=$tt(r,t),f=Ott(o.propertyAttributes,t,a),d=Ntt(o.propertyTextures,a),p=Btt(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);ztt(i,g),Htt(i),i.addVertexLines(jU),i.addFragmentLines(VU);for(let m=0;m<f.length;m++){let y=f[m];Gtt(e,y)}for(let m=0;m<d.length;m++){let y=d[m];qtt(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Xtt(e,y,c)}};function Ott(e,t,n){return l(e)?e.flatMap(i=>Mtt(i,t,n)):[]}function Mtt(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 Ntt(e,t){return l(e)?e.flatMap(n=>Ltt(n,t)):[]}function Ltt(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 Ftt=4;function Btt(e,t,n,i,r){if(!l(e))return[];let o=Utt(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>ktt(s,o,i,r))}function ktt(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(Ftt))continue;let y=u[g],A=de.intersection(Qtt(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 Utt(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 ztt(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"?jtt(c):c;e.addStructField(a,p,d)}}}var Vtt={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function jtt(e){let t=Vtt[e];return l(t)?t:e}function Htt(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 Gtt(e,t){Wtt(e,t),KJ(e.shaderBuilder,t),$J(e.shaderBuilder,t)}function Wtt(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=JJ({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 qtt(e,t,n){Ytt(e,t,n),KJ(e.shaderBuilder,t),$J(e.shaderBuilder,t)}function Ytt(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=JJ({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 KJ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=Hge(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 $J(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=Hge(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 Xtt(e,t,n){Ktt(e,t,n),KJ(e.shaderBuilder,t),$J(e.shaderBuilder,t)}function Ktt(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=JJ({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 Hge(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 JJ(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 $tt(e,t){let n=new Set,i=new Set;return Jtt(e,n,i),Ztt(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Jtt(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 Ztt(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 Qtt(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 Bh=Ii;var Na={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};Na.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===Nb.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===Nb.OPAQUE&&(o.pass=void 0);let u=ant(s,t,e);if(!u.customShaderEnabled)return;if(fnt(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=W_.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 ent(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var tnt={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},nnt={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 Gge(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=tnt[t],i=nnt[t];if(l(n))return{attributeField:[n,e],value:i}}function int(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!Yge(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=Wge(t,r,!1),s=qge(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=Gge(d);if(!l(p))return Na._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 rnt(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 ont(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!Yge(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=Wge(t,r,!0),s=qge(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=Gge(p);if(!l(g))return Na._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=rnt(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var snt={positionWC:!0,positionEC:!0};function Wge(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 qge(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||snt.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 ant(e,t,n){let i=ent(t.attributes),r=dnt(t,n.model.structuralMetadata),o=int(e,i,r),s=ont(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function cnt(e,t){let n=Na.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Na.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=Na.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Na.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Na.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,ux.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Bh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Bh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Bh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Na.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Na.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function lnt(e,t){let n=Na.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Na.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=Na.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Na.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Na.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,ux.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Bh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Bh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Bh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Na.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Na.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var unt=[];function fnt(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=unt;i.enabled&&(cnt(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,BU),e.addVertexLines(o)),r.enabled&&(lnt(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,kU),e.addFragmentLines(o))}function dnt(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 Yge(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Na._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 HU=Na;var vD={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};vD.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(vD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,vD.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);mnt(i,p),hnt(e,p)}};function hnt(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=Xge(u,0),f=Xge(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Xge(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function mnt(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=pnt(n,i):r=gnt(n),e.addFunctionLines(vD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function pnt(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 gnt(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var GU=vD;var WU=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { -if (u_isEdgePass) { -return; +discard; } -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; -} -} +#ifdef VECTOR_TILE +color *= u_highlightColor; +#endif +out_FragColor = color; } -`;var Kge={name:"EdgeDetectionPipelineStage"};Kge.process=function(e){e.shaderBuilder.addFragmentLines([WU])};var qU=Kge;var YU=`#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; +`;var uV=`uniform float u_threePointDepthTestDistance; +in vec2 direction; +in vec4 positionHighAndScale; +in vec4 positionLowAndRotation; +in vec4 compressedAttribute0; +in vec4 compressedAttribute1; +in vec4 compressedAttribute2; +in vec4 eyeOffset; +in vec4 scaleByDistance; +in vec4 pixelOffsetScaleByDistance; +in vec4 compressedAttribute3; +in vec2 sdf; +in float splitDirection; +#ifdef VS_THREE_POINT_DEPTH_CHECK +in vec4 textureCoordinateBoundsOrLabelTranslate; #endif -void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds) +#ifdef VECTOR_TILE +in float a_batchId; +#endif +out vec2 v_textureCoordinates; +out vec4 v_compressed; +out vec4 v_pickColor; +out vec4 v_color; +flat out vec2 v_splitDirectionAndEllipsoidDepthEC; +#ifdef SDF +out vec4 v_outlineColor; +out float v_outlineWidth; +#endif +const float UPPER_BOUND = 32768.0; +const float SHIFT_LEFT16 = 65536.0; +const float SHIFT_LEFT12 = 4096.0; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_LEFT7 = 128.0; +const float SHIFT_LEFT5 = 32.0; +const float SHIFT_LEFT3 = 8.0; +const float SHIFT_LEFT2 = 4.0; +const float SHIFT_LEFT1 = 2.0; +const float SHIFT_RIGHT12 = 1.0 / 4096.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +const float SHIFT_RIGHT7 = 1.0 / 128.0; +const float SHIFT_RIGHT5 = 1.0 / 32.0; +const float SHIFT_RIGHT3 = 1.0 / 8.0; +const float SHIFT_RIGHT2 = 1.0 / 4.0; +const float SHIFT_RIGHT1 = 1.0 / 2.0; +vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) { -#ifdef HAS_EDGE_VISIBILITY -if (!u_isEdgePass) { -return; +vec2 halfSize = imageSize * scale * 0.5; +halfSize *= ((direction * 2.0) - 1.0); +vec2 originTranslate = origin * abs(halfSize); +#if defined(ROTATION) || defined(ALIGNED_AXIS) +if (validAlignedAxis || rotation != 0.0) +{ +float angle = rotation; +if (validAlignedAxis) +{ +vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); +angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / +(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); } -float edgeTypeInt = v_edgeType * 255.0; -if (edgeTypeInt < 0.5) { -discard; +float cosTheta = cos(angle); +float sinTheta = sin(angle); +rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); +halfSize = rotationMatrix * halfSize; } -if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { -if (v_shouldDiscard > 0.5) { -discard; +else +{ +rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } +#endif +mpp = czm_metersPerPixel(positionEC); +positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); +positionEC.xy += (translate + pixelOffset) * mpp; +return positionEC; } -vec4 finalColor = color; -#ifdef HAS_EDGE_COLOR_ATTRIBUTE -if (v_edgeColor.a >= 0.0) { -finalColor = v_edgeColor; +#ifdef VS_THREE_POINT_DEPTH_CHECK +float getGlobeDepth(vec4 positionEC) +{ +vec4 posWC = czm_eyeToWindowCoordinates(positionEC); +float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); +if (globeDepth == 0.0) +{ +return 0.0; } -#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; +vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); +return eyeCoordinate.z / eyeCoordinate.w; } #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); +void main() +{ +vec3 positionHigh = positionHighAndScale.xyz; +vec3 positionLow = positionLowAndRotation.xyz; +float scale = positionHighAndScale.w; +#if defined(ROTATION) || defined(ALIGNED_AXIS) +float rotation = positionLowAndRotation.w; #else -out_id.g = 0.0; -#endif -out_edgeDepth = czm_packDepth(gl_FragCoord.z); -#endif +float rotation = 0.0; #endif -} -`;var XU=`#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; +float compressed = compressedAttribute0.x; +vec2 pixelOffset; +pixelOffset.x = floor(compressed * SHIFT_RIGHT7); +compressed -= pixelOffset.x * SHIFT_LEFT7; +pixelOffset.x -= UPPER_BOUND; +vec2 origin; +origin.x = floor(compressed * SHIFT_RIGHT5); +compressed -= origin.x * SHIFT_LEFT5; +origin.y = floor(compressed * SHIFT_RIGHT3); +compressed -= origin.y * SHIFT_LEFT3; +origin -= vec2(1.0); +float show = floor(compressed * SHIFT_RIGHT2); +compressed -= show * SHIFT_LEFT2; +vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); +vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); +vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; +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 EYE_DISTANCE_TRANSLUCENCY +vec4 translucencyByDistance; +translucencyByDistance.x = compressedAttribute1.z; +translucencyByDistance.z = compressedAttribute1.w; +translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +temp = compressedAttribute1.y * SHIFT_RIGHT8; +translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -#ifdef HAS_EDGE_COLOR_ATTRIBUTE -v_edgeColor = a_edgeColor; +#ifdef VS_THREE_POINT_DEPTH_CHECK +temp = compressedAttribute3.w; +temp = temp * SHIFT_RIGHT12; +vec2 dimensions; +dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; +dimensions.x = floor(temp); #endif -#ifdef HAS_LINE_PATTERN -#ifdef HAS_EDGE_CUMULATIVE_DISTANCE -v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld; +#ifdef ALIGNED_AXIS +vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); +temp = compressedAttribute2.z * SHIFT_RIGHT5; +bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; #else -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 +vec3 alignedAxis = vec3(0.0); +bool validAlignedAxis = false; #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; +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.a /= 255.0; +color.a = floor(temp); +color.a /= 255.0; +vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); +vec4 positionEC = czm_modelViewRelativeToEye * p; +positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); +positionEC.xyz *= show; +#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) +{ +lengthSq = czm_eyeHeight2D.y; } -gl_Position = posClip; +else +{ +lengthSq = dot(positionEC.xyz, positionEC.xyz); } #endif -`;var ZJ=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)}}},La=ZJ;var ZC=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),$ge={name:"EdgeVisibilityPipelineStage"};$ge.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(YU),i.addVertexLines(XU),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=ynt(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=Ant(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=_nt(p.edgeIndices,p.edgeData,t.edgeVisibility),S=bnt(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 _nt(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!==ZC.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 ynt(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===ZC.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===ZC.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===ZC.REPEATED_HARD?ZC.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:ZC.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function Ant(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=La.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 bnt(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:La.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:La.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[Pe+2]=0,F[Pe+3]=-1}function k(Ke,Pe){if(!N)return;let qe=Ke*4,st=l(Pe.x)?Pe.x:Pe[0],vt=l(Pe.y)?Pe.y:Pe[1],jt=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]=jt,F[qe+3]=lt}function G(Ke,Pe){if(!N)return;if(Pe>=B){j(Ke);return}let qe=Pe*4,st=Ke*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 Ke=0;Ke<A;Ke++){let Pe=e[Ke*2],qe=e[Ke*2+1],vt=t[Ke].edgeType/255,jt=v[Pe*3],lt=v[Pe*3+1],mt=v[Pe*3+2],ft=v[qe*3],Yt=v[qe*3+1],rt=v[qe*3+2],ht=Ke*4;S[ht*3]=jt,S[ht*3+1]=lt,S[ht*3+2]=mt,L[ht*3]=ft,L[ht*3+1]=Yt,L[ht*3+2]=rt,_[ht]=-1,I[ht]=vt,S[(ht+1)*3]=jt,S[(ht+1)*3+1]=lt,S[(ht+1)*3+2]=mt,L[(ht+1)*3]=ft,L[(ht+1)*3+1]=Yt,L[(ht+1)*3+2]=rt,_[ht+1]=1,I[ht+1]=vt,S[(ht+2)*3]=ft,S[(ht+2)*3+1]=Yt,S[(ht+2)*3+2]=rt,L[(ht+2)*3]=jt,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]=Yt,S[(ht+3)*3+2]=rt,L[(ht+3)*3]=jt,L[(ht+3)*3+1]=lt,L[(ht+3)*3+2]=mt,_[ht+3]=-1,I[ht+3]=vt;let Li=t[Ke].color;if(l(Li))for(let tn=0;tn<4;tn++)k(ht+tn,Li);else if(l(V))for(let tn=0;tn<4;tn++)G(ht+tn,Pe);else for(let tn=0;tn<4;tn++)j(ht+tn);if(C){let tn=D[Pe],Hn=D[qe];w[ht]=tn,w[ht+1]=tn,w[ht+2]=Hn,w[ht+3]=Hn}let Yn=Ke*6,yi=g[Yn],zi=g[Yn+1],Si=g[Yn+2],ui=g[Yn+3],Ai=g[Yn+4],zn=g[Yn+5];for(let tn=0;tn<4;tn++)R[(ht+tn)*3]=yi,R[(ht+tn)*3+1]=zi,R[(ht+tn)*3+2]=Si,O[(ht+tn)*3]=ui,O[(ht+tn)*3+1]=Ai,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:La.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 KU=$ge;var $U=`void geometryStage(out ProcessedAttributes attributes) +#ifdef EYE_DISTANCE_SCALING +float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); +scale *= distanceScale; +translate *= distanceScale; +if (scale == 0.0) { -attributes.positionMC = v_positionMC; -attributes.positionEC = v_positionEC; -#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) -attributes.positionWC = v_positionWC; -#endif -#ifdef HAS_NORMALS -attributes.normalEC = normalize(v_normalEC); -#endif -#ifdef HAS_TANGENTS -attributes.tangentEC = normalize(v_tangentEC); -#endif -#ifdef HAS_BITANGENTS -attributes.bitangentEC = normalize(v_bitangentEC); -#endif -setDynamicVaryings(attributes); +positionEC.xyz = vec3(0.0); } -`;var JU=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) -{ -vec4 computedPosition; -vec3 positionMC = attributes.positionMC; -v_positionMC = positionMC; -v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz; -#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) -vec3 position2D = attributes.position2D; -vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz; -computedPosition = czm_projection * vec4(positionEC, 1.0); -#else -computedPosition = czm_projection * vec4(v_positionEC, 1.0); #endif -#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS) -v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz; -#endif -#ifdef HAS_NORMALS -v_normalEC = normalize(normal * attributes.normalMC); +float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY +translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); +if (translucency == 0.0) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef HAS_TANGENTS -v_tangentEC = normalize(normal * attributes.tangentMC); +#ifdef EYE_DISTANCE_PIXEL_OFFSET +float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); +pixelOffset *= pixelOffsetScale; #endif -#ifdef HAS_BITANGENTS -v_bitangentEC = normalize(normal * attributes.bitangentMC); +#ifdef DISTANCE_DISPLAY_CONDITION +float nearSq = compressedAttribute3.x; +float farSq = compressedAttribute3.y; +if (lengthSq < nearSq || lengthSq > farSq) +{ +positionEC.xyz = vec3(0.0); +} #endif -setDynamicVaryings(attributes); -return computedPosition; +mat2 rotationMatrix; +float mpp; +float enableDepthCheck = 1.0; +#ifdef DISABLE_DEPTH_DISTANCE +float disableDepthTestDistanceSq = compressedAttribute3.z; +if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance; } -`;var SD=`vec2 computeSt(float featureId) +if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0) { -float stepX = model_textureStep.x; -float centerX = model_textureStep.y; -#ifdef MULTILINE_BATCH_TEXTURE -float stepY = model_textureStep.z; -float centerY = model_textureStep.w; -float xId = mod(featureId, model_textureDimensions.x); -float yId = floor(featureId / model_textureDimensions.x); -return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -#else -return vec2(centerX + (featureId * stepX), 0.5); +enableDepthCheck = 0.0; +} #endif +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; } -void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds) +v_compressed.y = enableDepthCheck; +#ifdef VS_THREE_POINT_DEPTH_CHECK +if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) { +float depthsilon = 10.0; +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) { -int featureId = featureIds.SELECTED_FEATURE_ID; -if (featureId < model_featuresLength) +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) { -vec2 featureSt = computeSt(float(featureId)); -feature.id = featureId; -feature.st = featureSt; -feature.color = texture(model_batchTexture, featureSt); +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) +{ +positionEC.xyz = vec3(0.0); } -else +} +} +} +#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; +#ifdef LOG_DEPTH +czm_vertexLogDepth(); +#endif +#ifdef DISABLE_DEPTH_DISTANCE +if (disableDepthTestDistanceSq != 0.0) { -feature.id = model_featuresLength + 1; -feature.st = vec2(0.0); -feature.color = vec4(1.0); +float zclip = gl_Position.z / gl_Position.w; +bool clipped = (zclip < -1.0 || zclip > 1.0); +if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq))) +{ +gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH +v_depthFromNearPlusOne = 1.0; +#endif } -#ifdef HAS_NULL_FEATURE_ID -if (featureId == model_nullFeatureId) { -feature.id = featureId; -feature.st = vec2(0.0); -feature.color = vec4(1.0); } #endif +#ifdef SDF +vec4 outlineColor = czm_decodeRGB8(sdf.x); +float outlineWidth; +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.a /= 255.0; +v_outlineWidth = outlineWidth / 255.0; +v_outlineColor = outlineColor; +v_outlineColor.a *= translucency; +#endif +v_pickColor = pickColor; +v_color = color; +v_color.a *= translucency; +v_splitDirectionAndEllipsoidDepthEC.x = splitDirection; } -`;var wD={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};wD.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=xnt(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),Tnt(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(SD),i.addFragmentLines(SD)};function Jge(e){return e instanceof En.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Zge(e){return e instanceof En.FeatureIdTexture?de.FRAGMENT:de.BOTH}function xnt(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:Zge(r),featureIdDefine:Jge(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:Zge(r),featureIdDefine:Jge(r)})}function Tnt(e){e.addStructField(wD.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(wD.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(wD.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var fx=wD;var Fa={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)"};Fa.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(fx.STRUCT_ID_SELECTED_FEATURE,fx.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Fa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Fa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Fa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Fa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Ko.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;Ent(e,f,g,d,o,s,m)}Ont(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(JU),i.addFragmentLines($U)};function Ent(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Snt(e,t,n,i):vnt(e,t,n,u),Int(a,c,u),wnt(a,c,s),l(t.semantic)&&Cnt(a,t),Pnt(a,c,r),Dnt(a,c,u),Rnt(a,c)}function Cnt(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 vnt(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 Snt(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 wnt(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 Int(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 Pnt(e,t,n){let i=Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Fa.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 Dnt(e,t,n){let i=Fa.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 Rnt(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Ont(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(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var ZU=Fa;function Ad(e){Ss.call(this,e)}Ad._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Ad._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof O0)return Ad._metadataFailure(e,t);throw r}};Ad.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 Ad._requestMetadata(t,i,r);return new Ad(o)};l(Object.create)&&(Ad.prototype=Object.create(Ss.prototype),Ad.prototype.constructor=Ad);function Qge(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 e_e(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}Ad._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 Mo({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 Hi||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=Qge(S,v),x=e_e(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}};Ad._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 Mo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Qge(a,s);let c=e_e(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 dx=Ad;function t_e(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}t_e.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Mnt(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 Mo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Nnt(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 Lnt(e,t,n){try{let i=await e.fetchText();Mnt(i,t)}catch(i){Nnt(i,e,n)}}function vu(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="${vu.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(vu.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}}});vu.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 t_e(n);s.channel=t,await Lnt(o,s);let a=new vu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};vu.prototype.getTileCredits=function(e,t,n){};vu.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 Zf.loadImage(this,r)};vu.prototype.pickFeatures=function(e,t,n,i,r){};vu._logoUrl=void 0;Object.defineProperties(vu,{logoUrl:{get:function(){return l(vu._logoUrl)||(vu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),vu._logoUrl},set:function(e){vu._logoUrl=e}}});var QU=vu;var Fnt=/\/$/,n_e=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 QC(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();Fnt.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=n_e,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(QC.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}}});QC.prototype.getTileCredits=function(e,t,n){};QC.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};QC.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};QC._defaultCredit=n_e;var ez=QC;function hx(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(hx.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 Bnt(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 QJ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function QJ(e,t,n){try{return await Zf.loadImage(null,e)}catch(i){return Bnt(e,i,t,n)}}hx.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await QJ(n);t=t??H.EMPTY_OBJECT;let r=new hx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};hx.prototype.getTileCredits=function(e,t,n){};hx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await QJ(this._resource,this);return this._image=r,Zr.reportSuccess(this._errorEvent),r}return this._image};hx.prototype.pickFeatures=function(e,t,n,i,r){};var tz=hx;function knt(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=Unt:e==="xml"?n=Hnt:(e==="html"||e==="text")&&(n=i_e)),this.callback=n}function Unt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Hm;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 eZ="http://www.mapinfo.com/mxp",znt="http://www.esri.com/wms",Vnt="http://www.opengis.net/wfs",jnt="http://www.opengis.net/gml";function Hnt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===eZ)return Gnt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===znt)return Wnt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Vnt)return qnt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Ynt(e):Xnt(e)}function Gnt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(eZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(eZ,"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 Hm;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Wnt(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(nz(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(nz(a,i))}}return n}function qnt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(jnt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};tZ(o,s),t.push(nz(o,s))}return t}function Ynt(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={};tZ(s,a),t.push(nz(s,a))}}return t}function tZ(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()&&tZ(r,t)&&(t[r.localName]=r.textContent)}return n}function nz(e,t){let n=new Hm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Xnt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Hm;return r.data=e,r.description=n.innerHTML,[r]}var Knt=/<body>\s*<\/body>/im,$nt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Jnt=/<title>([\s\S]*)<\/title>/im;function i_e(e){if(Knt.test(e)||$nt.test(e))return;let t,n=Jnt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Hm;return i.name=t,i.description=e,i.data=e,[i]}var mp=knt;function ID(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(ID.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)}}});ID.prototype.getFromCache=function(e,t,n,i){let r=r_e(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};ID.prototype.checkApproachingInterval=function(e,t,n,i){let r=r_e(e,t,n),o=this._tilesRequestedForInterval,s=o_e(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!s_e(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};ID.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=o_e(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=s_e(this,c,o),a||s.push(c)}}};function r_e(e,t,n){return`${e}-${t}-${n}`}function Znt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function o_e(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 s_e(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=Znt(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 ev=ID;var Qnt=[3034,3035,3042,3043,3044],eit=[4471,4559];function kh(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(kh.DefaultParameters,!0),n.setQueryParameters(kh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(a_e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(a_e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new ev({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return c_e(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&&!eit.includes(a)||Qnt.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 Ss({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??kh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function c_e(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 tit(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(kh.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}}});kh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};kh.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=c_e(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};kh.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return tit(this,e,t,n,i,r,s)};kh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});kh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});kh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new mp("json","application/json")),Object.freeze(new mp("xml","text/xml")),Object.freeze(new mp("text","text/html"))]);function a_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var iz=kh;function yf(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(yf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(yf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(yf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(l_e(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(yf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(l_e(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 ev({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return u_e(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Ss({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Mo({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??yf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:iit(this)})}function u_e(e,t,n,i,r,o){let s=e._tileProvider;return f_e(e,s._resource,o),s.requestImage(t,n,i,r)}function nit(e,t,n,i,r,o,s){let a=e._tileProvider;return f_e(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(yf.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}}});yf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};yf.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=u_e(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};yf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return nit(this,e,t,n,i,r,s)};yf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});yf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});yf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new mp("json","application/json")),Object.freeze(new mp("xml","text/xml")),Object.freeze(new mp("text","text/html"))]);function f_e(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 iit(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 l_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var rz=yf;var tv={};tv.defaultApiKey=void 0;tv.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});tv.defaultStreetViewStaticApiKey=void 0;tv.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});tv.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ba=tv;var d_e=/\/$/;function ag(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??Ba.mapTilesApiEndpoint),n=t.getUrlComponent();d_e.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 Ss({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(ag.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}}});ag.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=h_e(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},nZ(s,o,i)};ag.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??Ba.mapTilesApiEndpoint,e.key=e.key??Ba.defaultApiKey;let t=e.overlayLayerType,n=await oit(e);return new ag({...n,...e,credit:e.credit??Ba.getDefaultCredit()})};ag.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};ag.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])};ag.prototype.pickFeatures=function(e,t,n,i,r){};ag.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(rit(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 rit(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 h_e(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 oit(e){let{language:t,region:n,key:i,url:r}=e,o=h_e(e),s=r.url??r;d_e.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 oz=ag;var sit=async(e,t,n)=>dx.fromUrl(new Ho(t,n)),ait=async(e,{options:t})=>D_.fromUrl(e,t),cit=async(e,{options:t})=>a2.fromUrl(e,t),lit=async(e,{options:t})=>{let n=t.channel;return delete t.channel,QU.fromUrl(e,n,t)},uit=async(e,{options:t})=>new ez({url:e,...t}),fit=async(e,{options:t})=>tz.fromUrl(e,t),dit=async(e,{options:t})=>dx.fromUrl(e,t),hit=async(e,{options:t})=>new Ss({url:e,...t}),mit=async(e,{options:t})=>new iz({url:e,...t}),pit=async(e,{options:t})=>new rz({url:e,...t}),nZ=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 oz({...t.options,url:i})},git=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 lL({...t.options,url:i})},_it={ARCGIS_MAPSERVER:ait,BING:cit,GOOGLE_EARTH:lit,MAPBOX:uit,SINGLE_TILE:fit,TMS:dit,URL_TEMPLATE:hit,WMS:mit,WMTS:pit,GOOGLE_2D_MAPS:nZ,AZURE_MAPS:git,defaultFactoryCallback:sit},PD=Object.freeze(_it);function pp(){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(pp.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(){}}});pp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Ho._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=pp._endpointCache[i];l(r)||(r=n.fetchJson(),pp._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=PD.defaultFactoryCallback;o=Ze(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=PD[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new pp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Ho.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};pp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};pp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};pp.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};pp._endpointCache={};var Su=pp;var m_e={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(m_e);var Ey=m_e;function yit(e){e=e??H.EMPTY_OBJECT;let t=e.style??Ey.AERIAL;return Su.fromAssetId(t)}var Cy=yit;function Os(){pe.throwInstantiationError()}Object.defineProperties(Os.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 p_e=[];Os.getRegularGridIndices=function(e,t){let n=p_e[e];l(n)||(p_e[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),A_e(e,t,i,0)),i};var g_e=[];Os.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=g_e[e];l(n)||(g_e[e]=n=[]);let i=n[t];if(!l(i)){let r=Os.getRegularGridIndices(e,t),o=y_e(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 __e=[];Os.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=__e[e];l(n)||(__e[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=y_e(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);A_e(e,t,y,0),Os.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};Os.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Os.getSkirtIndexCount=function(e){return(e-4)*2*3};Os.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Os.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=sz(e,a,o,s),a+=e.length,s=sz(t,a,o,s),a+=t.length,s=sz(n,a,o,s),a+=n.length,sz(i,a,o,s)};Os.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Os.addSkirtIndices(e,t,n,i,r,o,s);let a=Os.getSkirtVertexCount(e,t,n,i),c=Os.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 y_e(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 A_e(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 sz(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}Os.heightmapTerrainQuality=.25;Os.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Os.heightmapTerrainQuality/(t*n)};Os.prototype.requestTileGeometry=pe.throwInstantiationError;Os.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Os.prototype.getTileDataAvailable=pe.throwInstantiationError;Os.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Os;var az=`uniform sampler2D u_texture; -in vec2 v_textureCoordinates; +`;var Zst=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Ks=Zst;function Nh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Ks.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Nh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Ks.LOADED}},hasImage:{get:function(){return this._loadState!==Ks.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Nh.prototype.unload=async function(){this._loadState!==Ks.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Ks.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Nh.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===Ks.LOADING||t.loadState===Ks.LOADED){Nh.clone(s,this);return}l(s)||(s=new Nh(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Ks.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=Ks.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Ks.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Ks.FAILED,s._index=-1,this._id!==e)return;this._loadState=Ks.FAILED,this._index=-1;return}s._index=a,s._loadState=Ks.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Ks.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Nh.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)};Nh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Ks.LOADING,i=await n}catch(r){this._loadState=Ks.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Ks.LOADED,this.setImageSubRegion(i,t))};Nh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Ks.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}};Nh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Nh.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 Oy=Nh;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=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??Wn.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 Oy(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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!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??Ho.NONE,this._positionFromParent=!1}var tye=Mi.SHOW_INDEX=0,dV=Mi.POSITION_INDEX=1,uye=Mi.PIXEL_OFFSET_INDEX=2,Qst=Mi.EYE_OFFSET_INDEX=3,eat=Mi.HORIZONTAL_ORIGIN_INDEX=4,tat=Mi.VERTICAL_ORIGIN_INDEX=5,nat=Mi.SCALE_INDEX=6,nye=Mi.IMAGE_INDEX_INDEX=7,iye=Mi.COLOR_INDEX=8,iat=Mi.ROTATION_INDEX=9,rat=Mi.ALIGNED_AXIS_INDEX=10,oat=Mi.SCALE_BY_DISTANCE_INDEX=11,sat=Mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,aat=Mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,cat=Mi.DISTANCE_DISPLAY_CONDITION=14,lat=Mi.DISABLE_DEPTH_DISTANCE=15;Mi.TEXTURE_COORDINATE_BOUNDS=16;var rye=Mi.SDF_INDEX=17,uat=Mi.SPLIT_DIRECTION_INDEX=18;Mi.NUMBER_OF_PROPERTIES=19;function wo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function fZ(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function gx(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Mi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wo(this,tye))}},position:{get:function(){return this._position},set:function(e){let t=this._position;fZ(t,e)||(gx(e,t),gx(e,this._actualPosition),this._updateClamping(),wo(this,dV))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),wo(this,dV))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),wo(this,uye))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),wo(this,oat))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),wo(this,sat))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),wo(this,aat))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),wo(this,Qst))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wo(this,eat))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,wo(this,tat))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,wo(this,nat))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),wo(this,iye))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,wo(this,iat))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),wo(this,rat))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,wo(this,nye))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,wo(this,nye))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,wo(this,iye))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),wo(this,cat))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,wo(this,lat))}},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=gx(e,this._actualClampedPosition),wo(this,dV)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wo(this,tye))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),wo(this,rye))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wo(this,rye))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wo(this,uat))}}});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 hV=new he,fat=new he,oye=200,sye=30;function aye(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);R_(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}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;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<sye){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+oye){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,fat);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=gx(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<sye,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+oye,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,aye(t,i,A,b)},t._heightReference)}he.clone(a,hV);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(hV.height=y),aye(t,i,a,hV)};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){Oy.clone(e,this._imageTexture)};var cye=512;Mi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=$n();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??$n(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&dat(n)&&(this._imageWidth=Math.min(this._width,cye),this._imageHeight=Math.min(this._height,cye))};function dat(e){return l(e)?Um(e)?e.startsWith("data:image/svg+xml"):v_(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),wo(this,uye))};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),wo(this,dV)};var lye=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,lye),pr.computeActualEllipsoidPosition(n,lye))};var fye=new h;Mi._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=M.multiplyByPoint(e,t,fye),a=pr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var fV=new U(0,0);Mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,fV),U.add(fV,this._translate,fV);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,hV);r=a.cartographicToCartesian(c,fye),i=M.IDENTITY}return Mi._computeScreenSpacePosition(i,r,this._eyeOffset,fV,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===Hi.RIGHT?s-=i:e.horizontalOrigin===Hi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?a-=r:e.verticalOrigin===Wn.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)&&Ht.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 hat={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},ec=Object.freeze(hat);function QD({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 dZ({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new QD({x:n,y:n,width:e-2*n,height:t-2*n})}dZ.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};dZ.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 QD({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new QD({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new QD({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new QD({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 e1=dZ;var dye=16;function Bl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(dye,dye);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=$n(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Bl.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}}});Bl.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};Bl.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};Bl.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 hye({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 e1({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=$n()};Bl.prototype.getImageIndex=function(e){return this._indexById.get(e)};Bl.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 hye({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Bl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new hye({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};Bl.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};Bl.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 e1({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function mat(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}Bl.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 mat(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)};Bl.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};Bl.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}))};Bl.prototype.isDestroyed=function(){return!1};Bl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var vv=Bl;var pat=Fr.SHOW_INDEX,t1=Fr.POSITION_INDEX,pye=Fr.PIXEL_OFFSET_INDEX,gye=Fr.EYE_OFFSET_INDEX,gat=Fr.HORIZONTAL_ORIGIN_INDEX,_at=Fr.VERTICAL_ORIGIN_INDEX,yat=Fr.SCALE_INDEX,_x=Fr.IMAGE_INDEX_INDEX,_ye=Fr.COLOR_INDEX,Aat=Fr.ROTATION_INDEX,bat=Fr.ALIGNED_AXIS_INDEX,yye=Fr.SCALE_BY_DISTANCE_INDEX,Aye=Fr.TRANSLUCENCY_BY_DISTANCE_INDEX,bye=Fr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,xye=Fr.DISTANCE_DISPLAY_CONDITION,xat=Fr.DISABLE_DEPTH_DISTANCE,Tat=Fr.TEXTURE_COORDINATE_BOUNDS,Tye=Fr.SDF_INDEX,Eye=Fr.SPLIT_DIRECTION_INDEX,yZ=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 Cd(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new vv),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(yZ),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??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(Cd.prototype,{length:{get:function(){return AZ(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 Cye(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Cd.prototype.add=function(e){let t=new Fr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Cd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Cd.prototype.removeAll=function(){Cye(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function AZ(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}}Cd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Cd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Cd.prototype.get=function(e){return AZ(this),this._billboards[e]};function mye(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=nt.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 Eat(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=nt.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}Cd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<yZ;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function Cat(e,t,n,i,r){let o=[{index:Br.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[t1]},{index:Br.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[t1]},{index:Br.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[pye]},{index:Br.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Aye]},{index:Br.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[_ye]},{index:Br.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[gye]},{index:Br.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[yye]},{index:Br.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[bye]},{index:Br.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[xye]},{index:Br.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Tat]},{index:Br.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[Eye]},{index:Br.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:Eat(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[Tye]}),new Ry(e,o,t,!0)}var hZ=new Sn;function vye(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function Sye(e,t,n,i){let r=n[Br.positionHighAndScale],o=n[Br.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(vye(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,hZ);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=hZ.high,f=hZ.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var My=new U,Ed=32768,bZ=65536,mZ=4096,yx=256,vat=128,Sat=32,wat=8,mV=4,Iat=1/256,wye=new et;function Iye(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===Wn.BASELINE&&(p=Wn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Hi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Wn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(wye);m=I.x,y=I.y}let A=Math.floor(P.clamp(s,-Ed,Ed)+Ed)*vat;A+=(d+1)*Sat,A+=(p+1)*wat,A+=(g?1:0)*mV;let b=Math.floor(P.clamp(a,-Ed,Ed)+Ed)*yx,x=Math.floor(P.clamp(u*mV,-Ed,Ed)+Ed)*yx,T=(P.clamp(f*mV,-Ed,Ed)+Ed)*Iat,E=Math.floor(T),v=Math.floor((T-E)*yx);b+=E,x+=v,My.x=m,My.y=y;let S=cn.compressTextureCoordinates(My);r(i._index,A,b,x,S)}function Pye(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,bZ),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*yx+a,u=P.clamp(u,0,1),u=u===1?255:u*255|0,g=g*yx+u,r(i._index,p,g,s,c)}function gZ(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)*bZ+z.floatToByte(s.alpha)*yx+(a*2+f),A=d*mV+p;r(i._index,g,m,y,A)}function _Z(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)),My.x=0,My.y=0,i.ready){let c=i.computeTextureCoordinates(wye);My.x=c.width,My.y=c.height}let a=cn.compressTextureCoordinates(My);r(i._index,o.x,o.y,s,a)}function Dye(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 Rye(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 Oye(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=ls(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,mZ)),g=Math.floor(P.clamp(f,0,mZ)),m=p*mZ+g;r(i._index,o,s,c,m)}function Mye(e,t,n,i){if(ls(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 Pat(e,t,n,i){if(!l(e._batchTable))return;let r=n[Br.a_batchId],o=i._batchIndex;r(i._index,o)}function Nye(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/ec.RADIUS,u=z.floatToByte(o.alpha)*bZ+z.floatToByte(c)*yx;r(i._index,a,u)}function Lye(e,t,n,i){let r=n[Br.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function Dat(e,t,n,i){Sye(e,t,n,i),Iye(e,t,n,i),Pye(e,t,n,i),gZ(e,t,n,i),_Z(e,t,n,i),Dye(e,t,n,i),Rye(e,t,n,i),Oye(e,t,n,i),Mye(e,t,n,i),Pat(e,t,n,i),Nye(e,t,n,i),Lye(e,t,n,i)}function pZ(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):vye(s,d))}o&&ue.fromPoints(a,s)}function Rat(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)&&pZ(e,i,i.length,t,o,!0)):n===re.MORPHING?pZ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&pZ(e,r,e._billboardsToUpdateIndex,t,o,!1)}function Oat(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 Mat(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=Ie.OVERLAY,i}var Nat=[];Cd.prototype.update=function(e){if(AZ(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(zt.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,_x),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;Rat(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<yZ;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=Cat(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,Dat(this,e,d,R)}this._vaf.commit(mye(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=Nat;I.length=0,(c[t1]||c[Aat]||c[yat])&&I.push(Sye),(c[_x]||c[pye]||c[gat]||c[_at]||c[pat])&&(I.push(Iye),I.push(_Z)),(c[_x]||c[bat]||c[Aye])&&(I.push(Pye),I.push(gZ)),(c[_x]||c[_ye])&&I.push(gZ),(c[_x]||c[gye])&&I.push(_Z),c[yye]&&I.push(Dye),c[bye]&&I.push(Rye),(c[xye]||c[xat]||c[_x]||c[t1])&&I.push(Oye),(c[_x]||c[t1])&&I.push(Mye),c[Tye]&&I.push(Nye),c[Eye]&&I.push(Lye);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(mye(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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=M.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),Oat(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:nn.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=uV,x=lV,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-ec.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=en.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=en.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=en.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=en.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=Mat(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};Cd.prototype.isDestroyed=function(){return!1};Cd.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(),Cye(this._billboards),le(this)};var vd=Cd;function Lat(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 Sv=Lat;var Fat=new he,Lh=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),wv(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),wv(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,wv(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),wv(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,wv(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,Fat);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&&wv(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 la.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(Lh,"defaultColor",z.WHITE),ut(Lh,"defaultPointOutlineColor",z.BLACK),ut(Lh,"defaultPointOutlineWidth",0),ut(Lh,"defaultPointSize",8);function wv(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??Lh.defaultColor,i=e._pointOutlineColor??Lh.defaultPointOutlineColor,r=e._pointOutlineWidth??Lh.defaultPointOutlineWidth,o=e._pointSize??Lh.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,Sv(f,d,p,r,o))}var Ny=Lh;function Bat(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 Ax;function kat(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(Ax)||(l(f.imageSmoothingEnabled)?Ax="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Ax="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Ax="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Ax="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[Ax]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Bat(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[Ax]=!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 Iv=kat;var Xye=js(Uye(),1);var zye={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(zye);var Io=zye;var Vye={},jye=0,zat=256,Vat=new z(.165,.165,.165,.8),jat=new U(7,5),$s=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 i1(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function r1(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Gye(e){let t=Vye[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(r1(n,"line-height"));isNaN(i)&&(i=void 0),t={family:r1(n,"font-family"),size:r1(n,"font-size").replace("px",""),style:r1(n,"font-style"),weight:r1(n,"font-weight"),lineHeight:i},document.body.removeChild(n),jye<zat&&(Vye[e._font]=t,jye++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Fh(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??Vat),this._backgroundPadding=U.clone(e.backgroundPadding??jat),this._style=e.style??Io.FILL,this._verticalOrigin=e.verticalOrigin??Wn.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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,Gye(this),this._updateClamping()}Object.defineProperties(Fh.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(!fZ(t,e)){gx(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),i1(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Fh.filterUnsupportedCharacters(e);this._renderedText=Fh.enableRightToLeftDetection?Xat(t):t,bx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,bx(this),Gye(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),bx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),bx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,bx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,bx(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),i1(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,bx(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,i1(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),i1(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),i1(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=gx(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}}});Fh.prototype._updateClamping=function(){Fr._updateClamping(this._labelCollection,this)};Fh.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)};Fh.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===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?r-=s:e.verticalOrigin===Wn.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===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?b-=T:e.verticalOrigin===Wn.CENTER&&(b-=T*.5),e._verticalOrigin===Wn.TOP?b+=ec.PADDING*a:(e._verticalOrigin===Wn.BOTTOM||e._verticalOrigin===Wn.BASELINE)&&(b-=ec.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};Fh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Fh.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};Fh.prototype.isDestroyed=function(){return!1};Fh.enableRightToLeftDetection=!1;function Hat(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=$s.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=$s.RTL:n.test(f)?a=$s.LTR:i.test(f)?a=$s.BRACKETS:a=$s.WEAK,u===0&&(s=a),s===a&&a!==$s.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function Gat(e){return e.split("").reverse().join("")}function o1(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Wat(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var qat="\u05D0-\u05EA",Yat="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Hye=new RegExp(`[${qat}${Yat}]`);function Xat(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Hye.test(r.charAt(0)),s=Hat(r,Hye),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===$s.BRACKETS?Wat(f.Word):Gat(f.Word);o?f.Type===$s.RTL?(c=d+c,a=0):f.Type===$s.LTR?(c=o1(c,a,f.Word),a+=f.Word.length):(f.Type===$s.WEAK||f.Type===$s.BRACKETS)&&(f.Type===$s.WEAK&&s[u-1].Type===$s.BRACKETS?c=d+c:s[u-1].Type===$s.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===$s.RTL?(c=d+c,a=0):(c=o1(c,a,f.Word),a+=f.Word.length):c=o1(c,0,d)):f.Type===$s.RTL?c=o1(c,a,d):f.Type===$s.LTR?(c+=f.Word,a=c.length):(f.Type===$s.WEAK||f.Type===$s.BRACKETS)&&(u>0&&s[u-1].Type===$s.RTL?s.length>u+1?s[u+1].Type===$s.RTL?c=o1(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 xx=Fh;var Kye=js(Wye(),1);function $at(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Jat=1.2,qye="ID_WHITE_PIXEL",xZ=new U(4,4),Zat=new et(1,1,1,1);function Qat(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=xZ.x,r.height=xZ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(qye,r),n.addImageSubRegion(qye,Zat)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var dg={};function ect(e,t,n,i,r,o){return dg.font=t,dg.fillColor=n,dg.strokeColor=i,dg.strokeWidth=r,dg.padding=ec.PADDING,dg.fill=o===Io.FILL||o===Io.FILL_AND_OUTLINE,dg.stroke=o===Io.OUTLINE||o===Io.FILL_AND_OUTLINE,dg.backgroundColor=z.BLACK,Iv(e,dg)}function TZ(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 tct=new Kye.default,nct=/\s/;function ict(e,t){let n=t._renderedText,i=tct.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/ec.FONT_SIZE,r<s)for(let p=r;p<s;++p)TZ(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=Qat(c,e),t._backgroundBillboard=a),rct(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 Oy(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${ec.FONT_SIZE}px ${t._fontFamily}`,S=ect(g,v,z.WHITE,z.WHITE,0,Io.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!nct.test(g)){let I=(0,Xye.default)(S,{cutoff:ec.CUTOFF,radius:ec.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 $at,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){TZ(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===Io.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Io.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Io.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function rct(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 Yye(e,t,n){return t===Hi.CENTER?-e/2:t===Hi.RIGHT?-(e+n.x):n.x}var Uo=new U,oct=new U;function sct(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,oct);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=Yye(b,m,d),T=(l(e._lineHeight)?e._lineHeight:Jat*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=Yye(b,m,d),Uo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Wn.TOP?(Uo.y=_.height-a-d.y,Uo.y+=ec.PADDING):y===Wn.CENTER?Uo.y=(E+_.height-a)/2:y===Wn.BASELINE?(Uo.y=E,Uo.y-=ec.PADDING):(Uo.y=E+s+d.y,Uo.y-=ec.PADDING),Uo.y=(Uo.y-_.descent-R)*g,I&&(Uo.x-=ec.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,ls(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===Hi.CENTER?x=-r/2-d.x:m===Hi.RIGHT?x=-(r+d.x*2):x=0,Uo.x=x*g,y===Wn.TOP?Uo.y=p-a-s:y===Wn.CENTER?Uo.y=(p-a)/2-s:y===Wn.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 $ye(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)TZ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function Cp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new vd({scene:this._scene,textureAtlas:new vv({initialSize:xZ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Oy(t),this._glyphBillboardCollection=new vd({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(Cp.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}}});Cp.prototype.add=function(e){let t=new xx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Cp.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),$ye(this,e),!0}return!1};Cp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)$ye(this,e[t]);e.length=0};Cp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Cp.prototype.get=function(e){return this._labels[e]};Cp.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&&(ict(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(sct(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)};Cp.prototype.isDestroyed=function(){return!1};Cp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var hg=Cp;var gV=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 position2DHigh; +in vec3 position2DLow; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 prevPosition2DHigh; +in vec3 prevPosition2DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec3 nextPosition2DHigh; +in vec3 nextPosition2DLow; +in vec4 texCoordExpandAndBatchIndex; +out vec2 v_st; +out float v_width; +out vec4 v_pickColor; +out float v_polylineAngle; void main() { -out_FragColor = texture(u_texture, v_textureCoordinates); +float texCoord = texCoordExpandAndBatchIndex.x; +float expandDir = texCoordExpandAndBatchIndex.y; +bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; +float batchTableIndex = texCoordExpandAndBatchIndex.w; +vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); +float width = widthAndShow.x + 0.5; +float show = widthAndShow.y; +if (width < 1.0) +{ +show = 0.0; } -`;var cz=`in vec4 position; -in float webMercatorT; -uniform vec2 u_textureDimensions; -out vec2 v_textureCoordinates; -void main() +vec4 pickColor = batchTable_getPickColor(batchTableIndex); +vec4 p, prev, next; +if (czm_morphTime == 1.0) { -v_textureCoordinates = vec2(position.x, webMercatorT); -gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); +p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); +prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); +next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); } -`;var b_e={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(b_e);var jn=b_e;function nv(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}nv.createPlaceholder=function(e){let t=new nv(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};nv.prototype.addReference=function(){++this.referenceCount};nv.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(),le(this),0):this.referenceCount};nv.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 DD=nv;function iZ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}iZ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};iZ.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 RD=iZ;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 RD(DD.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=Wo.NONE;Ui.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Ui.DEFAULT_MAGNIFICATION_FILTER=$n.LINEAR;Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ui.fromProviderAsync=function(e,t){let n=new Ui(void 0,t);return Eit(n,Promise.resolve(e)),n};Ui.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Ui.fromProviderAsync(Cy({style:e.style}),e)};Ui.prototype.isBaseLayer=function(){return this._isBaseLayer};Ui.prototype.isDestroyed=function(){return!1};Ui.prototype.destroy=function(){return le(this)};var E_e=new ie,x_e=new ie,rZ=new ie,C_e=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,E_e),a=ie.intersection(e.rectangle,s,x_e);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=x_e,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=xit(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,C_e),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,rZ),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,rZ),!!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,rZ),!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 RD(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,E_e),i=c.rectangleToNativeRectangle(i,C_e)}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 T_e(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===$n.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=T_e(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(ph.NICEST),t.sampler=u}else{let o=T_e(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 Hi)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new _d({persists:!0,owner:this,preExecute:function(c){bit(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=v_e(e,t,n),o=this._imageryCache[r];return l(o)||(o=new DD(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Ui.prototype.removeImageryFromCache=function(e){let t=v_e(e.x,e.y,e.level);delete this._imageryCache[t]};function v_e(e,t,n){return JSON.stringify([e,t,n])}var lz={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},Ait=dn.supportsTypedArrays()?new Float32Array(128):void 0;function bit(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=Xr.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:[cz]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:az,attributeLocations:x}),r.sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:$n.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;lz.textureDimensions.x=o,lz.textureDimensions.y=s,lz.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(ph.NICEST);let p=i.south,g=i.north,m=Ait,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=lz,e.vertexArray=r.vertexArray}function xit(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Hi?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 Tit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Eit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Tit(e._errorEvent,i)}}var Ms=Ui;var oZ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},uz=oZ;var sZ=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}},OD=sZ;var Cit=new ie,S_e=new ie,vit=new ie,Sit=new ie,wit=new ie,Iit=new ie,aZ=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,Cit),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=Sit;a.rectangleToNativeRectangle(t,u);let f=wit;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,vit);if(!l(b))return;let x=Iit;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 OD;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,S_e);return l(i)?i:e._clampRectangle(t,n,S_e)}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 OD);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}},MD=aZ;var cZ=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=La.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}}},iv=cZ;var lZ=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}},fz=lZ;var uZ=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=iv.createCartographicPositions(r,s,d),g=iv.computeCartographicBoundingRectangle(p),m=new fz(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=iv.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 MD.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 MD._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(),le(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}},rv=uZ;var fZ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},dz=fZ;var Pit=!1,Dit=new ie,Rit=new ie,dZ=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=rv._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 uz;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ms.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ms.DEFAULT_CONTRAST,n.hue|=r.hue!==Ms.DEFAULT_HUE,n.saturation|=r.saturation!==Ms.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ms.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));"]),Pit&&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 dz(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,Dit),s=r.rectangleToNativeRectangle(i,Rit);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}},hz=dZ;var mz=`#ifdef USE_IBL_LIGHTING -vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +else if (czm_morphTime == 0.0) { -#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) -vec3 viewDirection = -normalize(position); -vec3 iblColor = textureIBL(viewDirection, normal, material); -return iblColor; -#endif -return vec3(0.0); +p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); +prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); +next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); } -#endif -#ifdef USE_CLEARCOAT -vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) +else { -vec3 viewDirection = -normalize(position); -vec3 halfwayDirection = normalize(viewDirection + lightDirection); -vec3 normal = material.clearcoatNormal; -float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0); -vec3 f0 = vec3(0.04); -vec3 f90 = vec3(1.0); -float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0); -vec3 F = fresnelSchlick2(f0, f90, NdotV); -float roughness = material.clearcoatRoughness; -float alphaRoughness = roughness * roughness; -float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness); -vec3 directReflection = F * directStrength * NdotL; -vec3 color = lightColorHdr * directReflection; -#ifdef SPECULAR_IBL -vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal)); -vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness); -color += iblColor * material.occlusion; -#endif -float clearcoatFactor = material.clearcoatFactor; -vec3 clearcoatColor = color * clearcoatFactor; -return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor; +p = czm_columbusViewMorph( +czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), +czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), +czm_morphTime); +prev = czm_columbusViewMorph( +czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), +czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), +czm_morphTime); +next = czm_columbusViewMorph( +czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), +czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), +czm_morphTime); } -#endif -#if defined(LIGHTING_PBR) && defined(HAS_NORMALS) -vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position) +#ifdef DISTANCE_DISPLAY_CONDITION +vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); +vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); +vec3 centerLow = centerLowAndRadius.xyz; +float radius = centerLowAndRadius.w; +vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) { -#ifdef USE_CUSTOM_LIGHT_COLOR -vec3 lightColorHdr = model_lightColorHdr; -#else -vec3 lightColorHdr = czm_lightColorHdr; -#endif -vec3 viewDirection = -normalize(position); -vec3 normal = material.normalEC; -vec3 lightDirection = normalize(czm_lightDirectionEC); -vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material); -vec3 directColor = lightColorHdr * directLighting; -vec3 color = directColor + material.emissive; -#ifdef USE_IBL_LIGHTING -color += computeIBL(position, normal, lightDirection, lightColorHdr, material); -#endif -#ifdef USE_CLEARCOAT -color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material); -#endif -return color; +lengthSq = czm_eyeHeight2D.y; } -#endif -void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes) +else { -#ifdef LIGHTING_PBR -#ifdef HAS_NORMALS -vec3 color = computePbrLighting(material, attributes.positionEC); -#else -vec3 color = material.diffuse * material.occlusion + material.emissive; -#endif -#ifndef HDR -color = czm_pbrNeutralTonemapping(color); -#endif -#else // unlit -vec3 color = material.diffuse; -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -color = czm_gammaCorrect(color); -#elif !defined(HDR) -color = czm_linearToSrgb(color); +vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); +lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); +} +float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; +float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; +if (lengthSq < nearSq || lengthSq > farSq) +{ +show = 0.0; +} #endif -material.diffuse = color; +float polylineAngle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); +gl_Position = czm_viewportOrthographic * positionWC * show; +v_st.s = texCoord; +v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); +v_width = width; +v_pickColor = pickColor; +v_polylineAngle = polylineAngle; } -`;var w_e={UNLIT:0,PBR:1};Object.freeze(w_e);var cg=w_e;var I_e={name:"LightingPipelineStage"};I_e.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(mz)};var pz=I_e;var gz=`bool isDefaultStyleColor(vec3 color) +`;var kl={};kl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};kl.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 act=new he;kl.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,act).height}return i};var cct=new M,lct=new h,Jye=new h,uct=new sn(h.UNIT_X,0),Zye=new h,fct=new sn(h.UNIT_X,0),dct=new h,hct=new h,CZ=[];function eAe(e,t,n){let i=CZ;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 yV=new he,_V=new he,Ly=new h,vZ=new h,mct=new h,EZ=new k_,s1=new jc;function pct(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,vZ),u=i.scaleToGeodeticSurface(t,mct),f=kl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,yV),p=i.cartesianToCartographic(u,_V),g=eAe(f,r,o);EZ.setEndPoints(d,p);let m=EZ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,Ly);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=EZ.interpolateUsingSurfaceDistance(b*m,_V);x.height=g[b],A=i.cartographicToCartesian(x,Ly),h.pack(A,s,y),y+=3}return y}function gct(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,yV),u=i.cartesianToCartographic(t,_V),f=kl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=eAe(f,r,o);s1.ellipsoid.equals(i)||(s1=new jc(void 0,void 0,i)),s1.setEndPoints(c,u);let p=s1.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,Ly);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=s1.interpolateUsingSurfaceDistance(y*p,_V);A.height=d[y],m=i.cartographicToCartesian(A,Ly),h.pack(m,s,g),g+=3}return g}kl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let r=M.inverseTransformation(t,cct),o=M.multiplyByPoint(r,h.ZERO,lct),s=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_Y,Jye),Jye),a=sn.fromPointNormal(o,s,uct),c=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_X,Zye),Zye),u=sn.fromPointNormal(o,c,fct),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=xi.lineSegmentPlane(d,m,a,dct);if(l(y)){let A=h.multiplyByScalar(s,5e-9,hct);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}};kl.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],vZ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,Ly);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+=kl.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=pct(y,A,s,i,b,x,f,d)}CZ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,yV);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,Ly);return h.pack(m,f,u-3),f};var Qye=new he,_ct=new he;kl.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],vZ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,Ly);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],Qye),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],_ct),a+=kl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,Qye);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=gct(b,x,s,i,T,E,p,g)}CZ.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,yV);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,Ly);return h.pack(A,p,d-3),p};kl.generateCartesianArc=function(e){let t=kl.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};kl.generateCartesianRhumbArc=function(e){let t=kl.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 lr=kl;function yf(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=ir.fromType(ir.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=lr.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(nAe),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 tAe=yf.POSITION_INDEX=0,yct=yf.SHOW_INDEX=1,Act=yf.WIDTH_INDEX=2,bct=yf.MATERIAL_INDEX=3,a1=yf.POSITION_SIZE_INDEX=4,xct=yf.DISTANCE_DISPLAY_CONDITION=5,nAe=yf.NUMBER_OF_PROPERTIES=6;function mg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(yf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,mg(this,yct))}},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)&&mg(this,a1),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),mg(this,tAe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,mg(this,bct))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,mg(this,Act))}},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,mg(this,a1)}}},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),mg(this,xct))}}});yf.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[tAe]>0||this._propertiesChanged[a1]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=lr.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)mg(this,a1);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){mg(this,a1);break}}};yf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};yf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<nAe-1;++t)e[t]=0};yf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Bh=yf;var Tct=Bh.SHOW_INDEX,Ect=Bh.WIDTH_INDEX,wZ=Bh.POSITION_INDEX,Cct=Bh.MATERIAL_INDEX,iAe=Bh.POSITION_SIZE_INDEX,vct=Bh.DISTANCE_DISPLAY_CONDITION,uAe=Bh.NUMBER_OF_PROPERTIES,Ru={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 kh(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(uAe),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(kh.prototype,{length:{get:function(){return IZ(this),this._polylines.length}}});kh.prototype.add=function(e){let t=new Bh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};kh.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};kh.prototype.removeAll=function(){PZ(this),pAe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};kh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};kh.prototype.get=function(e){return IZ(this),this._polylines[e]};function Sct(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 XE(t,n,e._polylines.length)}var fAe=new Sn,dAe=new se,hAe=new U;kh.prototype.update=function(e){if(IZ(this),this._polylines.length===0||!this.show)return;Oct(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(zt.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.");Sct(this,t),this._createBatchTable=!1}if(this._createVertexArray||Ict(this))sAe(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[iAe]||r[Cct])sAe(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[wZ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[Tct]||r[Ect])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[wZ]||r[iAe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,fAe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,dAe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[vct]){let m=hAe;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<uAe;++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:nn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;wct(this,e,c,o)}};var c1=new ue,rAe=new ue;function wct(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=Dct(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=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(c1,_.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=ue.clone(D._boundingVolume2D,rAe),B.center.x=0):l(D._boundingVolumeWC)&&l(D._boundingVolume2D)&&(B=ue.union(D._boundingVolumeWC,D._boundingVolume2D,rAe)),c?(c=!1,ue.clone(B,c1)):ue.union(B,c1,c1)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(c1,_.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}kh.prototype.isDestroyed=function(){return!1};kh.prototype.destroy=function(){return mAe(this),PZ(this),pAe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function Ict(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[wZ]?(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 oAe=[0,0,0];function sAe(e,t,n){e._createVertexArray=!1,PZ(e),mAe(e),Rct(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=nt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=nt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=nt.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=nt.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:Ru.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Ru.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ru.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Ru.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ru.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ru.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ru.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ru.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ru.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ru.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ru.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ru.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ru.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=oAe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=oAe,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 Pct(e,t){return t instanceof Dt?t.id:t}var AV=[];function Dct(e){let t=ir._uniformList[e.type],n=t.length;AV.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];AV[i]=o,AV[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(AV,Pct)}`}function Rct(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 vp(c,t,n)),u.addPolyline(a)}}}function Oct(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 IZ(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 PZ(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 mAe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}kh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function pAe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function SZ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function vp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}vp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};vp.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,eC]}),o=t.getVertexShaderCallback()(gV),s=new Xe({defines:i,sources:[du,o]});this.shaderProgram=en.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Ru})};function gAe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}vp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!gAe(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 pa=new h,Sd=new h,wd=new h,bV=new h,Mct=new se,Nct=new U;vp.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=bV,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Sd),h.clone(x[V],pa),V===E-1?g._loop?R=x[1]:(R=bV,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,wd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(Sd.z=0,pa.z=0,wd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(pa.x)<1&&((pa.x<0&&Sd.x>0||pa.x>0&&Sd.x<0)&&h.clone(pa,Sd),(pa.x<0&&wd.x>0||pa.x>0&&wd.x<0)&&h.clone(pa,wd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(pa,e,n),Sn.writeElements(Sd,e,n+6),Sn.writeElements(wd,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=Mct;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=Nct;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,fAe),w=C.high,D=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,dAe),N=hAe;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 Lct=new h,Fct=new h,Bct=new h,aAe=new h;vp.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=aAe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=M.multiplyByPoint(n,g,Fct);let m=M.multiplyByPoint(n,a[p],Lct),y;p===u-1?s._loop?y=a[1]:(y=aAe,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,Bct);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 kct=new Array(1);vp.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new SZ(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=kct;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 SZ(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 SZ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};vp.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 Pv={positions:void 0,lengths:void 0},cAe=new Array(1),Uct=new h,zct=new he;vp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return cAe[0]=n.length,Pv.positions=n,Pv.lengths=cAe,Pv;gAe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Uct;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,zct)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return Pv.positions=r,Pv.lengths=e._segments.lengths,Pv};var lAe;vp.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=lAe,c=6*s*3;!l(a)||a.length<c?a=lAe=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=bV,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Sd),h.clone(f[A],pa),A===s-1?t._loop?y=f[1]:(y=bV,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,wd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Sd.z=0,pa.z=0,wd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(pa.x)<1&&((pa.x<0&&Sd.x>0||pa.x>0&&Sd.x<0)&&h.clone(pa,Sd),(pa.x<0&&wd.x>0||pa.x>0&&wd.x<0)&&h.clone(pa,wd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(pa,a,p),Sn.writeElements(Sd,a,p+6),Sn.writeElements(wd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Sp=kh;function Fy(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 vd({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new hg({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Sp,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Fy.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 Vct(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 jct=new Jn("createVectorTilePoints",5),Hct=new h;function Gct(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Vct(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=jct.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,Hct),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)})}Fy.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 Ny(e,c,u,f,d)}};Fy.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 Wct(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=Ny.defaultPointSize,s.color=Ny.defaultColor,s.pointOutlineColor=Ny.defaultPointOutlineColor,s.pointOutlineWidth=Ny.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Io.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=Wn.CENTER,s.labelHorizontalOrigin=Hi.RIGHT,s.labelVerticalOrigin=Wn.BASELINE}}var qct=new z,Yct=new z,Xct=new z,Kct=new z,$ct=new z,Jct=new z,l1=new qt,u1=new qt,DZ=new Ht;Fy.prototype.applyStyle=function(e,t){if(!l(e)){Wct(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,qct)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Yct)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Xct)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Kct)),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,$ct)),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)?(l1.near=a.x,l1.nearValue=a.y,l1.far=a.z,l1.farValue=a.w,s.scaleByDistance=l1):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(u1.near=a.x,u1.nearValue=a.y,u1.far=a.z,u1.farValue=a.w,s.translucencyByDistance=u1):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(DZ.near=a.x,DZ.far=a.y,s.distanceDisplayCondition=DZ):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,Jct)),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))}};Fy.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Gct(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)};Fy.prototype.isDestroyed=function(){return!1};Fy.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(),le(this)};var xV=Fy;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=Qn.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 Zct(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 Qct(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=Qt.unpack(t,n),n+=Qt.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 X0({color:c,offset:u,count:f,batchIds:p})}}var elt=new Jn("createVectorTilePolygons",5),tlt=new z;function nlt(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,tlt);s[y]=A.toRgba()}a=e._packedBuffer=Zct(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=elt.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];Qct(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),ilt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function ilt(e){l(e._primitive)||(e._primitive=new xC({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=nlt(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(),le(this)};var TV=pg;var EV=`in vec4 currentPosition; +in vec4 previousPosition; +in vec4 nextPosition; +in vec2 expandAndWidth; +in float a_batchId; +uniform mat4 u_modifiedModelView; +void main() { -return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; +vec4 p = u_modifiedModelView * currentPosition; +vec4 prev = u_modifiedModelView * previousPosition; +vec4 next = u_modifiedModelView * nextPosition; +float angle; +vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; } -vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend) +`;function Uh(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(Uh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function rlt(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 olt=new Jn("createVectorTilePolylines",5),Dv={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function slt(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=rlt(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=olt.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),alt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function alt(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=nt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=nt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=nt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=nt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=nt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=nt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:Dv.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Dv.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Dv.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Dv.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:Dv.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 f1=new M,_Ae=new h;function clt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,f1),M.multiplyByPoint(f1,e._center,_Ae),M.setTranslation(f1,_Ae,f1),f1},u_highlightColor:function(){return e._highlightColor}})}function llt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var ult=`uniform vec4 u_highlightColor; +void main() { -vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend); -vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor; -return color; + out_FragColor = u_highlightColor; } -#ifdef HAS_NORMAL_TEXTURE -vec2 getNormalTexCoords() +`;function flt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(EV),r=n.getFragmentShaderCallback(!1,void 0,!1)(ult),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[du,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=en.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Dv})}function dlt(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)}Uh.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};Uh.prototype.getPositions=function(e){return Uh.getPolylinePositions(this,e)};Uh.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 la(e,o)}};Uh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function hlt(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 mlt=new z,plt=z.WHITE,glt=!0;Uh.prototype.applyStyle=function(e,t){if(!l(e)){hlt(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,mlt):plt,s.show=l(e.show)?e.show.evaluate(s):glt}};Uh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=slt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}clt(this,t),flt(this,t),llt(this);let n=e.passes;(n.render||n.pick)&&dlt(this,e)};Uh.prototype.isDestroyed=function(){return!1};Uh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var Rv=Uh;var CV=`in vec3 startEllipsoidNormal; +in vec3 endEllipsoidNormal; +in vec4 startPositionAndHeight; +in vec4 endPositionAndHeight; +in vec4 startFaceNormalAndVertexCorner; +in vec4 endFaceNormalAndHalfWidth; +in float a_batchId; +uniform mat4 u_modifiedModelView; +uniform vec2 u_minimumMaximumVectorHeights; +out vec4 v_startPlaneEC; +out vec4 v_endPlaneEC; +out vec4 v_rightPlaneEC; +out float v_halfWidth; +out vec3 v_volumeUpEC; +void main() { -vec2 texCoord = TEXCOORD_NORMAL; -#ifdef HAS_NORMAL_TEXTURE_TRANSFORM -texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform); -#endif -return texCoord; +float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); +float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); +vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; +vec3 right = normalize(cross(forward, startEllipsoidNormal)); +vec4 position = vec4(startPositionAndHeight.xyz, 1.0); +position.xyz += forward * isEnd; +v_volumeUpEC = czm_normal * normalize(cross(right, forward)); +float offset; +vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); +offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); +offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; +position.xyz += offset * ellipsoidNormal; +position = u_modifiedModelView * position; +right = czm_normal * right; +vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); +scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); +vec3 miterPushNormal = czm_normal * normalize(scratchNormal); +offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); +offset = offset / dot(miterPushNormal, right); +position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); +gl_Position = czm_depthClamp(czm_projection * position); +position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); +vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; +v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); +v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); +position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); +vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; +v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); +v_halfWidth = endFaceNormalAndHalfWidth.w; } -#endif -#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE) -vec3 computeTangent(in vec3 position, in vec2 normalTexCoords) +`;var vV=`in vec4 v_startPlaneEC; +in vec4 v_endPlaneEC; +in vec4 v_rightPlaneEC; +in float v_halfWidth; +in vec3 v_volumeUpEC; +uniform vec4 u_highlightColor; +void main() { -vec2 tex_dx = dFdx(normalTexCoords); -vec2 tex_dy = dFdy(normalTexCoords); -float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y; -vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position); -return tangent / determinant; +float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); +if (logDepthOrDepth == 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -#endif -#ifdef USE_ANISOTROPY -struct NormalInfo { -vec3 tangent; -vec3 bitangent; -vec3 normal; -vec3 geometryNormal; -}; -NormalInfo getNormalInfo(ProcessedAttributes attributes) -{ -vec3 geometryNormal = attributes.normalEC; -#ifdef HAS_NORMAL_TEXTURE -vec2 normalTexCoords = getNormalTexCoords(); -#endif -#ifdef HAS_BITANGENTS -vec3 tangent = attributes.tangentEC; -vec3 bitangent = attributes.bitangentEC; -#else // Assume HAS_NORMAL_TEXTURE -vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords); -tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent)); -vec3 bitangent = normalize(cross(geometryNormal, tangent)); -#endif -#ifdef HAS_NORMAL_TEXTURE -mat3 tbn = mat3(tangent, bitangent, geometryNormal); -vec3 normalSample; -#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; -#endif -vec3 normal = normalize(tbn * normalSample); -#else -vec3 normal = geometryNormal; -#endif -#ifdef HAS_DOUBLE_SIDED_MATERIAL -if (czm_backFacing()) { -tangent *= -1.0; -bitangent *= -1.0; -normal *= -1.0; -geometryNormal *= -1.0; +vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); +eyeCoordinate /= eyeCoordinate.w; +float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); +halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); +float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); +float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); +float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); +if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { +#ifdef DEBUG_SHOW_VOLUME +out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); +return; +#else // DEBUG_SHOW_VOLUME +discard; +#endif // DEBUG_SHOW_VOLUME } -#endif -NormalInfo normalInfo; -normalInfo.tangent = tangent; -normalInfo.bitangent = bitangent; -normalInfo.normal = normal; -normalInfo.geometryNormal = geometryNormal; -return normalInfo; +out_FragColor = u_highlightColor; +czm_writeDepthClamp(); } -#endif -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) -{ -vec2 normalTexCoords = getNormalTexCoords(); -#ifdef HAS_BITANGENTS -vec3 t = attributes.tangentEC; -vec3 b = attributes.bitangentEC; -#else -vec3 t = computeTangent(attributes.positionEC, normalTexCoords); -t = normalize(t - geometryNormal * dot(geometryNormal, t)); -vec3 b = normalize(cross(geometryNormal, t)); -#endif -mat3 tbn = mat3(t, b, geometryNormal); -vec3 normalSample; -#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 +`;function gg(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=Qt.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(gg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function _lt(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;Qt.fromRectangle(c,r,o,n,a)}function ylt(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 Alt=new Jn("createVectorTileClampedPolylines"),By={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function blt(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=ylt(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=Alt.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),xlt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function xlt(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=nt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=nt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=nt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=nt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=nt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=nt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=nt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=nt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:By.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:By.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:By.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:By.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:By.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:By.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:By.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 d1=new M,yAe=new h;function Tlt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,d1),M.multiplyByPoint(d1,e._center,yAe),M.setTranslation(d1,yAe,d1),d1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function AAe(e){return Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function Elt(e){l(e._rs)||(e._rs=AAe(!1),e._rs3DTiles=AAe(!0))}function Clt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(CV),r=n.getFragmentShaderCallback(!1,void 0,!0)(vV),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[du,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=en.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:By})}function vlt(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===Qn.TERRAIN||i===Qn.BOTH)&&t.commandList.push(n),(i===Qn.CESIUM_3D_TILE||i===Qn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}gg.prototype.getPositions=function(e){return Rv.getPolylinePositions(this,e)};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 la(e,o)}};gg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Slt(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 wlt=new z,Ilt=z.WHITE,Plt=!0;gg.prototype.applyStyle=function(e,t){if(!l(e)){Slt(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,wlt):Ilt,s.show=l(e.show)?e.show.evaluate(s):Plt}};function Dlt(e){return Ni.initialize().then(function(){_lt(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}gg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Dlt(this).then(blt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Tlt(this,t),Clt(this,t),Elt(this);let n=e.passes;(n.render||n.pick)&&vlt(this,e)};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(),le(this)};var SV=gg;var RZ=32767,Rlt=new he,Olt=new h;function Mlt(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/RZ),y=P.lerp(t.south,t.north,p/RZ),A=P.lerp(n,i,g/RZ),b=he.fromRadians(m,y,A,Rlt),x=r.cartographicToCartesian(b,Olt);h.pack(x,u,f*3)}return u}var wV=Mlt;var MZ=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,klt(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)||OZ(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)||OZ(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)||OZ(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(),le(this)}};function Nlt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Llt(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 zh=Uint32Array.BYTES_PER_ELEMENT;function Flt(e){return new Rv(e)}function Blt(e){return new SV(e)}function klt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=zh;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=zh;let s=r.getUint32(n,!0);if(n+=zh,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=zh,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=zh;let u=r.getUint32(n,!0);n+=zh;let f=r.getUint32(n,!0);n+=zh;let d=r.getUint32(n,!0);n+=zh;let p=r.getUint32(n,!0);n+=zh;let g=r.getUint32(n,!0);n+=zh,n+=zh;let m=No(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=No(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 cp(e,v,A,b,Nlt(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=Llt(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 TV({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=wV(new Uint16Array(j),O,L,_,ee.WGS84);Ult(q,F,D.polylines,S,e.url,k)}let G=Flt;l(N.classificationType)&&(G=Blt),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 xV({positions:F,batchIds:D.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:N.heightReference,scene:N.scene})}}function OZ(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 Ult(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 IV=MZ;var{ERR_CAPACITY:hQn}=fa.Error,zlt=new h,PV=class PV extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(zlt)),i}get vertexOffset(){return this._getUint32(PV.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(PV,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+4});var NZ=PV,tl=NZ;var DV=`#ifdef USE_FLOAT64 +in vec3 positionHigh; +in vec3 positionLow; #else -normalSample = texture(u_normalTexture, normalTexCoords).rgb; -#endif -normalSample = 2.0 * normalSample - 1.0; -#ifdef HAS_NORMAL_TEXTURE_SCALE -normalSample.xy *= u_normalTextureScale; -#endif -return normalize(tbn * normalSample); -} +in vec3 position; #endif -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal) +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() { -vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM -normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0)); -#endif -#ifdef HAS_BITANGENTS -vec3 t = attributes.tangentEC; -vec3 b = attributes.bitangentEC; +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 -vec3 t = computeTangent(attributes.positionEC, normalTexCoords); -t = normalize(t - geometryNormal * dot(geometryNormal, t)); -vec3 b = normalize(cross(geometryNormal, t)); -#endif -mat3 tbn = mat3(t, b, geometryNormal); -vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb; -normalSample = 2.0 * normalSample - 1.0; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE -normalSample.xy *= u_clearcoatNormalTextureScale; +vec4 positionEC = czm_modelView * vec4(position, 1.0); #endif -return normalize(tbn * normalSample); +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; } -#endif -#ifdef HAS_NORMALS -vec3 computeNormal(ProcessedAttributes attributes) +`;var RV=`in vec4 v_pickColor; +in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerRadiusFrac; +void main() { -vec3 normal = attributes.normalEC; -#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME) -normal = getNormalFromTexture(attributes, normal); -#endif -#ifdef HAS_DOUBLE_SIDED_MATERIAL -if (czm_backFacing()) { -normal = -normal; +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; } -#endif -return normal; +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); } +`;var h1=class h1 extends Eu{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(h1,"Layout",{...Eu.Layout,SIZE_U8:Eu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Eu.Layout.__BYTE_LENGTH+4}),ut(h1,"DEFAULT_MATERIAL",Object.freeze(new h1));var LZ=h1,wp=LZ;var FZ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},bAe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Tx=new tl,Vh=new wp,m1=new z,xAe=new h,BZ=new Sn;function Vlt(e,t,n){let i=t.context;n=n||{destroy:jlt};let r=e._positionDatatype===Y.DOUBLE,o=r?FZ:bAe;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,Tx),Tx._dirty&&(r&&(Tx.getPosition(xAe),Sn.fromCartesian(xAe,BZ),h.pack(BZ.high,c,y*3),h.pack(BZ.low,u,y*3)),Tx.getMaterial(Vh),z.fromRgba(Tx._pickId,m1),f[y*4]=z.floatToByte(m1.red),f[y*4+1]=z.floatToByte(m1.green),f[y*4+2]=z.floatToByte(m1.blue),f[y*4+3]=z.floatToByte(m1.alpha),d[y*4]=Tx.show?1:0,d[y*4+1]=Vh.size,d[y*4+2]=cn.encodeRGB8(Vh.color),d[y*4+3]=Vh.color.alpha,p[y*3]=Vh.outlineWidth,p[y*3+1]=cn.encodeRGB8(Vh.outlineWidth>0?Vh.outlineColor:Vh.color),p[y*3+2]=Vh.outlineWidth>0?Vh.outlineColor.alpha:Vh.color.alpha,Tx._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:FZ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:FZ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:bAe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=en.fromCache({context:i,vertexShaderSource:new Xe({sources:[DV],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[RV]}),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 jlt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var OV=Vlt;var kZ=class e extends fa{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return tl}_getMaterialClass(){return wp}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new tl){return super.add(t,n),n._setUint32(tl.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=OV(this,t,this._renderContext))}},Af=kZ;var MV=`#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 -#ifdef HAS_BASE_COLOR_TEXTURE -vec4 getBaseColorFromTexture() +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() { -vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR; -#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM -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)); +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 -baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams)); +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 -baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords)); -#endif -#ifdef HAS_BASE_COLOR_FACTOR -baseColorWithAlpha *= u_baseColorFactor; +vec4 positionWC = getPolylineWindowCoordinatesEC(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle); #endif -return baseColorWithAlpha; +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; } -#endif -#ifdef HAS_EMISSIVE_TEXTURE -vec3 getEmissiveFromTexture() +`;var NV=`in vec4 v_pickColor; +in vec4 v_color; +void main() { -vec2 emissiveTexCoords = TEXCOORD_EMISSIVE; -#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM -emissiveTexCoords = czm_computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform); -#endif -vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb); -#ifdef HAS_EMISSIVE_FACTOR -emissive *= u_emissiveFactor; -#endif -return emissive; -} -#endif -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -void setSpecularGlossiness(inout czm_modelMaterial material) +if (v_color.a < 0.005) { -#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE -vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS; -#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM -specularGlossinessTexCoords = czm_computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform); -#endif -vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords)); -vec3 specular = specularGlossiness.rgb; -float glossiness = specularGlossiness.a; -#ifdef HAS_LEGACY_SPECULAR_FACTOR -specular *= u_legacySpecularFactor; -#endif -#ifdef HAS_GLOSSINESS_FACTOR -glossiness *= u_glossinessFactor; -#endif -#else -#ifdef HAS_LEGACY_SPECULAR_FACTOR -vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0)); -#else -vec3 specular = vec3(1.0); -#endif -#ifdef HAS_GLOSSINESS_FACTOR -float glossiness = clamp(u_glossinessFactor, 0.0, 1.0); -#else -float glossiness = 1.0; -#endif -#endif -#ifdef HAS_DIFFUSE_TEXTURE -vec2 diffuseTexCoords = TEXCOORD_DIFFUSE; -#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM -diffuseTexCoords = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform); -#endif -vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords)); -#ifdef HAS_DIFFUSE_FACTOR -diffuse *= u_diffuseFactor; -#endif -#elif defined(HAS_DIFFUSE_FACTOR) -vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0)); -#else -vec4 diffuse = vec4(1.0); -#endif -material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular)); -material.alpha = diffuse.a; -material.specular = specular; -material.roughness = 1.0 - glossiness; +discard; } -#elif defined(LIGHTING_PBR) -float setMetallicRoughness(inout czm_modelMaterial material) +out_FragColor = czm_gammaCorrect(v_color); +czm_writeLogDepth(); +} +`;var Ex={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},LV={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},nl=new Ra,p1=new dd,g1=new z,TAe=new h,EAe=new h,CAe=new h,UZ=new Sn,zZ=new Sn,VZ=new Sn;function Hlt(e,t,n){let i=t.context;n=n||{destroy:qlt};let r=e._positionDatatype===Y.DOUBLE,o=r?Ex:LV;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,nl),!nl._dirty)continue;nl.getMaterial(p1);let L=cn.encodeRGB8(p1.color),_=p1.color.alpha,C=f?-p1.width:p1.width;z.fromRgba(nl._pickId,g1);let w=nl.show,D=nl.vertexOffset*2,N=(nl.vertexOffset-R)*6,F=e._positionView,V=nl.vertexOffset*3;for(let B=0,j=nl.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,TAe),h.fromElements(J,Z,ae,EAe),h.fromElements(Ae,fe,xe,CAe),Sn.fromCartesian(TAe,UZ),Sn.fromCartesian(EAe,zZ),Sn.fromCartesian(CAe,VZ));for(let ge=0;ge<2;ge++)r?(h.pack(UZ.high,x,D*3),h.pack(UZ.low,T,D*3),h.pack(zZ.high,E,D*3),h.pack(zZ.low,v,D*3),h.pack(VZ.high,S,D*3),h.pack(VZ.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(g1.red),p[D*4+1]=z.floatToByte(g1.green),p[D*4+2]=z.floatToByte(g1.blue),p[D*4+3]=z.floatToByte(g1.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++}nl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Wlt(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:nt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:Ex.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Ex.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:Ex.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Ex.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:Ex.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:Ex.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:nt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:LV.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:LV.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:LV.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:nt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:nt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:nt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=en.fromCache({context:i,vertexShaderSource:new Xe({sources:[du,MV],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[NV]}),attributeLocations:o}));let s=Glt(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 Glt(e){return(e.vertexCount-e.primitiveCount)*6}function Wlt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,nl);let i=nl.vertexOffset*2,o=(nl.vertexOffset-t)*6;e.get(t+n-1,nl);let s=(nl.vertexOffset+nl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function qlt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var FV=Hlt;var jZ=class e extends fa{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 Ra}_getMaterialClass(){return dd}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Ra){super.add(t,n);let i=this._positionCount;return n._setUint32(Ra.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ra.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=FV(this,t,this._renderContext))}},Ul=jZ;function Ov(e,t){this._conditionsExpression=Ze(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Xlt(this,t)}Object.defineProperties(Ov.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Ylt(e,t){this.condition=e,this.expression=t}function Xlt(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 Ylt(new Ch(a,t),new Ch(c,t)))}e._runtimeConditions=n}Ov.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)}};Ov.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)}};Ov.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} { -#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE -vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS; -#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM -metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform); -#endif -vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb; -float metalness = clamp(metallicRoughness.b, 0.0, 1.0); -float roughness = clamp(metallicRoughness.g, 0.0, 1.0); -#ifdef HAS_METALLIC_FACTOR -metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0); -#endif -#ifdef HAS_ROUGHNESS_FACTOR -roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0); -#endif -#else -#ifdef HAS_METALLIC_FACTOR -float metalness = clamp(u_metallicFactor, 0.0, 1.0); -#else -float metalness = 1.0; -#endif -#ifdef HAS_ROUGHNESS_FACTOR -float roughness = clamp(u_roughnessFactor, 0.0, 1.0); -#else -float roughness = 1.0; -#endif -#endif -const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); -vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness); -material.specular = f0; -material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness); -material.roughness = roughness; -return metalness; +${o} return ${i}(1.0); +} +`,o};Ov.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];ti(e,r.condition.getVariables()),ti(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var BV=Ov;function ky(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._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,Klt(this,e)}function Klt(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 Ch(r[o],i))}e._meta=n,e._ready=!0}function ho(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Ch(String(t));if(typeof t=="string")return new Ch(t,n);if(l(t.conditions))return new BV(t,n)}else return;return t}function mo(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(ky.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ho(this,e),this._style.show=mo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ho(this,e),this._style.color=mo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ho(this,e),this._style.pointSize=mo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ho(this,e),this._style.pointOutlineColor=mo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ho(this,e),this._style.pointOutlineWidth=mo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ho(this,e),this._style.labelColor=mo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ho(this,e),this._style.labelOutlineColor=mo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ho(this,e),this._style.labelOutlineWidth=mo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ho(this,e),this._style.font=mo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ho(this,e),this._style.labelStyle=mo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ho(this,e),this._style.labelText=mo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ho(this,e),this._style.backgroundColor=mo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ho(this,e),this._style.backgroundPadding=mo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ho(this,e),this._style.backgroundEnabled=mo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ho(this,e),this._style.scaleByDistance=mo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ho(this,e),this._style.translucencyByDistance=mo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ho(this,e),this._style.distanceDisplayCondition=mo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ho(this,e),this._style.heightOffset=mo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ho(this,e),this._style.anchorLineEnabled=mo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ho(this,e),this._style.anchorLineColor=mo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ho(this,e),this._style.image=mo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ho(this,e),this._style.disableDepthTestDistance=mo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ho(this,e),this._style.horizontalOrigin=mo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ho(this,e),this._style.verticalOrigin=mo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ho(this,e),this._style.labelHorizontalOrigin=mo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ho(this,e),this._style.labelVerticalOrigin=mo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=ho(this,e),this._style.lineWidth=mo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});ky.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new ky(n)})};ky.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};ky.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};ky.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};ky.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ti(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ti(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ti(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Uy=ky;var wAe=new ie,vAe=new ie,HZ=new ie,kV=new Map;kV.set(Ul,{packCollectionData:Ds.packPolylineCollectionData,packTilePrimitives:Ds.packPolylineSegments});kV.set(Za,{packCollectionData:Ds.packPolygonCollectionData,packTilePrimitives:Ds.packPolygonRings});var GZ=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 kV.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:$lt(t,r.ellipsoid)};for(let[u,f]of o){if(!SAe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,vAe);if(!!!ie.intersection(t,d,HZ))continue;let g=kV.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&&(Ds.packPolylineGrid(s),Ds.packPolylineTextures(n,s)),c&&(Ds.packPolygonGrid(s),Ds.packPolygonTextures(n,s)),Ds.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ds.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Jlt(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(!SAe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,vAe),f=!!ie.intersection(n,u,HZ),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 SAe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function $lt(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 Jlt(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],HZ))return!0;return!1}var zy=GZ;var IAe=new tl,PAe=new Ra,DAe=new Lo,Zlt=new wp,Qlt=new dd,eut=new fd,WZ=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 la.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(Af,IAe),yield*this._iteratePrimitivesWith(Ul,PAe),yield*this._iteratePrimitivesWith(Za,DAe)}*_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(Af,IAe,Zlt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(Ul,PAe,Qlt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Za,DAe,eut)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},Mv=WZ;var RAe=new h,tut=new tl,nut=new Ra,MAe=new Lo;function iut(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)NAe(e,n[r],M.IDENTITY,i);return i}function UV(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function rut(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?Ma.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:OAe(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=OAe(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 OAe(e){let t=UV(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function out(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?Ma.readAttributeAsRawCompactTypedArray(o):Ma.readAttributeAsTypedArray(o)),a=t.indices?Ma.readIndicesAsTypedArray(t.indices):void 0,c=sut(e,t,r);n instanceof Af?aut(n,i,s,a,c):n instanceof Ul?cut(n,i,s,a,c):n instanceof Za&&(l(t.vector)?lut(n,i,s,a,c,t.vector):uut(n,i,s,c,t.polygon))}function sut(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof vn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??Ma.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new Mv(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function aut(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,RAe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:RAe,pickObject:u,featureId:u?.featureId},tut)}}function cut(e,t,n,i,r){let o=UV(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=LAe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},nut),s=u+1,a=0,c++}}function lut(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},MAe)}}function uut(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=UV(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=LAe(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},MAe)}}function NAe(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=rut(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new Af({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(M.clone(o)),i.collectionFeatureTableIds.set(d,b),out(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)NAe(e,a[c],o,i)}function LAe(e,t,n,i){let r=UV(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 zV=iut;var VV=new tl,jV=new Ra,HV=new Lo,_1=new wp,qZ=new dd,FAe=new fd,BAe=new M,YZ=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 Af).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 Uy({color:i}))}applyStyle(t){let n=o=>o instanceof Af,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,VV);let u=this.getFeature(VV.featureId,s);l(t.show)&&(VV.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,_1.color),l(t.pointSize)&&(_1.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(_1.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,_1.outlineColor),VV.setMaterial(_1)}}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,jV);let u=this.getFeature(jV.featureId,s);l(t.show)&&(jV.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,qZ.color),l(t.lineWidth)&&(qZ.width=t.lineWidth.evaluate(u)),jV.setMaterial(qZ)}}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,HV);let u=this.getFeature(HV.featureId,s);l(t.show)&&(HV.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,FAe.color),HV.setMaterial(FAe)}}}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&&(dut(this),this._ready=!0)}M.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,BAe);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(BAe,this._collectionLocalMatrices[s],a.modelMatrix),!ls(i._heightReference)||!zy.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,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=fut(t,n,o,r),a=await xd.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function fut(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 dut(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=zV(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Cx=YZ;function tc(){}tc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);tc._sorterTaskProcessor=void 0;tc._taskProcessorReady=!1;tc._error=void 0;tc._getSorterTaskProcessor=function(){if(!l(tc._sorterTaskProcessor)){let e=new Jn("gaussianSplatSorter",tc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?tc._taskProcessorReady=!0:tc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{tc._error=t}),tc._sorterTaskProcessor=e}return tc._sorterTaskProcessor};tc.radixSortIndexes=function(e){let t=tc._getSorterTaskProcessor();if(l(tc._error))throw tc._error;if(tc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var Nv=tc;function nc(){}nc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);nc._textureTaskProcessor=void 0;nc._taskProcessorReady=!1;nc._error=void 0;nc._getTextureTaskProcessor=function(){if(!l(nc._textureTaskProcessor)){let e=new Jn("gaussianSplatTextureGenerator",nc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?nc._taskProcessorReady=!0:nc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{nc._error=t}),nc._textureTaskProcessor=e}return nc._textureTaskProcessor};nc.generateFromAttributes=function(e){let t=nc._getTextureTaskProcessor();if(l(nc._error))throw nc._error;if(!nc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var GV=nc;function hut(e){let t=new Iy;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:gc.LESS_OR_EQUAL}})),this.alphaOptions=new Tv,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var WV=hut;var qV=`#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; } -#ifdef USE_SPECULAR -void setSpecular(inout czm_modelMaterial material, in float metalness) -{ -#ifdef HAS_SPECULAR_TEXTURE -vec2 specularTexCoords = TEXCOORD_SPECULAR; -#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM -specularTexCoords = czm_computeTextureTransform(specularTexCoords, u_specularTextureTransform); -#endif -float specularWeight = texture(u_specularTexture, specularTexCoords).a; -#ifdef HAS_SPECULAR_FACTOR -specularWeight *= u_specularFactor; -#endif -#else -#ifdef HAS_SPECULAR_FACTOR -float specularWeight = u_specularFactor; -#else -float specularWeight = 1.0; -#endif -#endif -#ifdef HAS_SPECULAR_COLOR_TEXTURE -vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR; -#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM -specularColorTexCoords = czm_computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform); -#endif -vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb; -vec3 specularColorFactor = czm_srgbToLinear(specularColorSample); -#ifdef HAS_SPECULAR_COLOR_FACTOR -specularColorFactor *= u_specularColorFactor; -#endif -#else -#ifdef HAS_SPECULAR_COLOR_FACTOR -vec3 specularColorFactor = u_specularColorFactor; -#else -vec3 specularColorFactor = vec3(1.0); -#endif -#endif -material.specularWeight = specularWeight; -vec3 f0 = material.specular; -vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0)); -material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness); +} +} +return result; } #endif -#ifdef USE_ANISOTROPY -void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo) -{ -mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x); -float anisotropyStrength = u_anisotropy.z; -vec2 direction = vec2(1.0, 0.0); -#ifdef HAS_ANISOTROPY_TEXTURE -vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY; -#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM -anisotropyTexCoords = czm_computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform); -#endif -vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb; -direction = anisotropySample.rg * 2.0 - vec2(1.0); -anisotropyStrength *= anisotropySample.b; -#endif -direction = rotation * direction; -mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal); -vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0)); -vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT); -material.anisotropicT = anisotropicT; -material.anisotropicB = anisotropicB; -material.anisotropyStrength = anisotropyStrength; +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 -#ifdef USE_CLEARCOAT -void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes) +v_splitDirection = u_splitDirection; +} +`;var YV=`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 vx=new M,HAe=new M,y1=new M,Ci=new $,A1=new Le,mut=new h,put=new Le,gut=new h,_ut=1e-12,XV=1e-5,XZ=1e-7,Ba={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ns={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},yut=2,Aut=30,but=3,xut=.008726646259971648,Tut=1;function Eut(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<but)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Tut?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=xut:!1}function kAe(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 Cut(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 UAe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function KZ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function zAe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function vut(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 Sut(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function wut(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=Sut(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 Iut(e,t){return e.length===t?e:e.subarray(0,t)}function Put(e,t,n){if(!l(t.indexes)||t.state!==Ns.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&&zAe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&zAe(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=Ba.IDLE,e._dirty=!1}async function Dut(e,t,n,i){try{let r=await i,o=zt.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=Ns.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=jAe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=jAe(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=zt.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=Out(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ns.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ns.BUILDING}}async function Rut(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===Ns.SORTING&&(n.snapshot.state=Ns.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ns.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,Put(e,c,t),e._pendingSnapshot=void 0,zl.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ns.SORTING&&(n.snapshot.state=Ns.TEXTURE_READY),e._sorterState=Ba.ERROR,e._sorterError=r}}async function VAe(e,t,n){try{let i=await n,r=UAe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Ba.IDLE);return}e._indexes=i,e._sorterState=Ba.SORTED}catch(i){if(!UAe(e,t))return;e._sorterState=Ba.ERROR,e._sorterError=i}}function Out(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:Gt.NEAREST})}function jAe(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:Gt.NEAREST})}function zl(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=Ho.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(qi.Y,qi.X,new M),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Ba.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(zl.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ns.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});zl.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)};zl.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,KZ(this._pendingSnapshot),KZ(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),le(this)};zl.prototype.isDestroyed=function(){return this._isDestroyed};zl.prototype.onTileLoad=function(e){this._dirty=!0};zl.prototype.onTileVisible=function(e){};zl.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,vx);M.multiplyTransformation(o,e.content.worldTransform,o);let s=M.inverse(r,HAe),a=M.multiplyTransformation(s,o,vx),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&M.equalsEpsilon(a,c,_ut))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)<=XZ&&Math.abs(g-1)<=XZ&&Math.abs(m-1)<=XZ,T=Math.abs(y)<=XV&&Math.abs(A)<=XV&&Math.abs(b)<=XV,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)<=XV;Le.fromRotationMatrix(Ci,A1),Le.normalize(A1,A1);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=mut,L=put,_=gut;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(A1,L,L),Le.normalize(L,L)):(M.fromTranslationQuaternionRotationScale(O,L,_,y1),M.multiplyTransformation(a,y1,y1),M.getTranslation(y1,O),M.getScale(y1,_),Le.multiply(A1,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};zl.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ns.BUILDING)return;n.state=Ns.TEXTURE_PENDING;let i=GV.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=Ns.BUILDING;return}Dut(e,t,n,i)};zl.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new WV(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=nn.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(qV),r.addFragmentLines(YV);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 vn.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};zl.prototype.update=function(e){let t=this._tileset;if(vut(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===Ba.IDLE){let r=t._selectedTiles.length!==0&&Cut(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>=yut,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>=Aut;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=Ba.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&KZ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=M.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,HAe);M.multiplyTransformation(v,E.content.worldTransform??M.IDENTITY,v),M.getRotation(M.inverse(v,v),this._shInverseRotation)}for(let E of u)zl.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=wut(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 Iut(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:Ns.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===Ns.BUILDING){zl.generateSplatTexture(this,e,u);return}if(u.state===Ns.TEXTURE_PENDING||u.state===Ns.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,vx),u.state===Ns.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=Nv.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(vx),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ns.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ns.SORTING;let g=this._pendingSort;Rut(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ns.SORTING&&(u.state=Ns.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,vx),!l(this._sorterPromise)){if(!Eut(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=Nv.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(vx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){kAe(this,e);let g=this._activeSort;this._sorterState=Ba.SORTING,VAe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Ba.WAITING;return}this._sorterState=Ba.SORTING;return}else if(this._sorterState===Ba.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=Nv.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(vx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){kAe(this,e);let c=this._activeSort;this._sorterState=Ba.SORTING,VAe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Ba.WAITING;return}this._sorterState=Ba.SORTING;return}else{if(this._sorterState===Ba.SORTING)return;if(this._sorterState===Ba.SORTED)zl.buildGSplatDrawCommand(this,e),this._sorterState=Ba.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Ba.ERROR)throw this._sorterError}this._dirty=!1}};var KV=zl;var JZ=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 KV({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:qi.Y,forwardAxis:qi.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 md(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}=Nut(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=kut(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),le(this)}};function Mut(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Nut(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 GAe=new ArrayBuffer(4),Lut=new Float32Array(GAe),Fut=new Uint32Array(GAe);function $Z(e){Lut[0]=e;let t=Fut[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 But(e){let t=Mut(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 kut(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}=But(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]=$Z(o[u].typedArray[y])|$Z(o[u].typedArray[y+1])<<16,r[m+1]=$Z(o[u].typedArray[y+2])}}return r}var Sx=JZ;var WAe={b3dm:function(e,t,n,i,r){return Td.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Td.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Td.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return J2.fromTileType(e,t,n,i,r,WAe)},externalTileset:function(e,t,n,i){return cV.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new rk(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new IV(e,t,n,i,r)},subt:function(e,t,n,i,r){return fD.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return fD.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 Sx.tilesetRequiresGaussianSplattingExt(e)?Sx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Cx.fromGltf(e,t,n,c):Td.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Sx.tilesetRequiresGaussianSplattingExt(e)?Sx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Cx.fromGltf(e,t,n,i):Td.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Td.fromGeoJson(e,t,n,i)}},Lv=WAe;var qAe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(qAe);var Mr=qAe;var Id={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"};Id.isBinaryFormat=function(e){switch(e){case Id.BATCHED_3D_MODEL:case Id.INSTANCED_3D_MODEL:case Id.COMPOSITE:case Id.POINT_CLOUD:case Id.VECTOR:case Id.GEOMETRY:case Id.IMPLICIT_SUBTREE:case Id.VOXEL_BINARY:case Id.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Id);var ka=Id;var YAe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(YAe);var jh=YAe;var ga={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},_g=new Array(ga.NUMBER_OF_PASSES);_g[ga.RENDER]=Object.freeze({pass:ga.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});_g[ga.PICK]=Object.freeze({pass:ga.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});_g[ga.SHADOW]=Object.freeze({pass:ga.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});_g[ga.PRELOAD]=Object.freeze({pass:ga.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.PRELOAD_FLIGHT]=Object.freeze({pass:ga.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:ga.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.MOST_DETAILED_PRELOAD]=Object.freeze({pass:ga.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.MOST_DETAILED_PICK]=Object.freeze({pass:ga.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});ga.getPassOptions=function(e){return _g[e]};Object.freeze(ga);var po=ga;var ZZ=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 le(this)}},yg=ZZ;function Ag(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(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 Xn.hasProperty(e,this._properties,this._class)};Ag.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Ag.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Ag.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Ag.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Ag.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Ag.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var $V=Ag;function QZ(e,t){let n=sr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){QZ._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 $V({content:n,class:r})}}QZ._oneTimeWarning=yt;var Fv=QZ;function Uut(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=sr(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 Bv=Uut;function bg(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(bg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};bg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};bg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};bg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};bg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};bg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};bg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var JV=bg;function eQ(e,t){let n=sr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){eQ._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new JV({tile:n,class:r})}}eQ._oneTimeWarning=yt;var ZV=eQ;function zut(e){let t=new Uint8Array(e),n=ap(t);if(n==="glTF"&&(n="glb"),ka.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Vut(t);if(l(i.root))return{contentType:ka.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ka.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ka.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ka.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ka.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Vut(e){let t;try{t=No(e)}catch{throw new oe("Invalid tile content.")}return t}var Vy=zut;var tQ=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(!jut(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;nQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Hut(this,i,n,this._tile._contentState);return Gut(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 le(this)}};function nQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function XAe(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 jut(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 Hut(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:ra.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){XAe(e,i);return}return nQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){XAe(e,i);return}nQ(e,-1),KAe(e,t,f)}})}async function Gut(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>Wut(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 Wut(e,t,n){if(l(t))try{let i=Vy(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===ka.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ka.GEOMETRY||i.contentType===ka.VECTOR;let a,c=Lv[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=Fv(r,u));let f=Bv(r,u);return l(f)&&(a.group=new AC({metadata:f})),a}catch(i){KAe(e,n,i)}}function KAe(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 QV=tQ;var $Ae=Math.cos,JAe=Math.sin,qut=Math.sqrt,iQ={};iQ.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=$Ae(f),p=JAe(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*$Ae(m),A=d*JAe(m),b=a.x*y,x=a.y*A,T=qut(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 Yut=new $i,Pd=new h,Xut=new he,e4=new h,b1=new ji;function ZAe(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;b1._ellipsoid=ee.default,Pd=b1.project(e,Pd),Pd=h.subtract(Pd,e4,Pd);let g=$i.fromRotation(t,Yut);Pd=$i.multiplyByVector(g,Pd,Pd),Pd=h.add(Pd,e4,Pd),e=b1.unproject(Pd,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}}iQ.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,Xut);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=P.TWO_PI),b1._ellipsoid=ee.default,e4=b1.project(E,e4));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 _=ZAe(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=ZAe(_,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 Ua=iQ;var Kut=new ue,$ut=new ue,Jut=new h,Zut=new ie;function QAe(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=Jut;if(o)Ua.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++)Ua.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++)Ua.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--)Ua.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--)Ua.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 Qut(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=QAe(e,t),s=t.height,a=t.width,c=mi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=mi.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 Uv(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"}Uv.packedLength=ie.packedLength+ee.packedLength+5;Uv.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 ebe=new ie,tbe=ee.clone(ee.UNIT_SPHERE),kv={rectangle:ebe,ellipsoid:tbe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};Uv.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,ebe);t+=ie.packedLength;let r=ee.unpack(e,t,tbe);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):(kv.granularity=o,kv.height=s,kv.rotation=a,kv.extrudedHeight=c,kv.offsetAttribute=u===-1?void 0:u,new Uv(kv))};var eft=new he;Uv.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ua.computeOptions(t,e._granularity,e._rotation,0,Zut,eft),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=Qut(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=ue.fromRectangle3D(t,n,s,$ut),d=ue.fromRectangle3D(t,n,a,Kut);o=ue.union(f,d)}else{if(r=QAe(e,i),r.attributes.position.values=mi.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=ue.fromRectangle3D(t,n,s)}return new wt({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var zv=Uv;function jv(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;oft(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(jv.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});jv.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Qt.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var nbe=new h,t4=new h,ibe=new h,tft=new h,nft=new h,ift=new h,rft=new h,Dd=new he,rbe=new sn(h.UNIT_X,0),Vv=new gn;function oft(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),Dd.longitude=t.west,Dd.latitude=(t.south+t.north)*.5,Dd.height=0;let i=n.cartographicToCartesian(Dd,ift),r=h.cross(i,h.UNIT_Z,tft);h.normalize(r,e.westNormal),Dd.longitude=t.east;let o=n.cartographicToCartesian(Dd,rft),s=h.cross(h.UNIT_Z,o,nbe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,nbe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,nft),u=t.south,f;if(u>0){Dd.longitude=(t.west+t.east)*.5,Dd.latitude=u;let y=n.cartographicToCartesian(Dd,Vv.origin);h.clone(c,Vv.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,rbe);xi.rayPlane(Vv,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,t4)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),t4);let d=h.cross(f,a,ibe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Dd.longitude=(t.west+t.east)*.5,Dd.latitude=p;let y=n.cartographicToCartesian(Dd,Vv.origin);h.negate(c,Vv.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,rbe);xi.rayPlane(Vv,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,t4)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),t4);let m=h.cross(a,g,ibe);h.normalize(m,e.northNormal)}var sft=new h,aft=new h,cft=new h(0,-1,0),lft=new h(0,0,-1),obe=new h;function uft(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),sft),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),aft),f.z=f.y,f.y=f.x,f.x=0,d=cft,g=h.UNIT_Y,p=lft,m=h.UNIT_Z);let y=h.subtract(i,u,obe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,obe),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)}jv.prototype.distanceToCamera=function(e){let t=uft(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};jv.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};jv.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new zv({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 Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Rd=jv;var x1={},fft=new h,sbe=new h,abe=new h,cbe=new h,lbe=new Qt;x1.validOutline=function(e){let n=Qt.fromPoints(e,lbe).halfAxes,i=$.getColumn(n,0,sbe),r=$.getColumn(n,1,abe),o=$.getColumn(n,2,cbe),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};x1.computeProjectTo2DArguments=function(e,t,n,i){let r=Qt.fromPoints(e,lbe),o=r.halfAxes,s=$.getColumn(o,0,sbe),a=$.getColumn(o,1,abe),c=$.getColumn(o,2,cbe),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 ube(e,t,n,i,r){let o=h.subtract(e,t,fft),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}x1.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=ube(i[o],e,t,n);return r}};x1.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return ube(i,e,t,n,r)}};var jy=x1;function dft(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 wx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+1}wx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new wx(t)};wx.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var hft={polygonHierarchy:{}};wx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new wx(hft)),n._polygonHierarchy=i,n.packedLength=r,n};wx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Lr(n,h.equalsEpsilon,!0),n.length<3||!jy.validOutline(n))return;let r=ni.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:dft(r[c])});o.push(u)}let s=qn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new wt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Hh=wx;var n4=new he;function T1(e){let t=ny.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=Tft(t,n,i,r);this._boundingPlanes=o;let s=Sft(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=fQ(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]=fQ(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=fQ(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();n4=r.cartesianToCartographic(c,n4),n4.height=(i+n)/2,this.center=r.cartographicToCartesian(n4,c),this._boundingSphere=ue.fromPoints(s)}var mft=new h,pft=new he,gft=new h,_ft=new he,yft=new h,Aft=new h,bft=new h,xft=new h;function Tft(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,mft),a=i.cartesianToCartographic(o,pft);a.height=n;let c=i.cartographicToCartesian(a,gft),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,_ft),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,yft));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,Aft),x=h.subtract(A,g,xft),T=h.cross(x,b,bft);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var Ix=new h,Px=new h,Dx=new h,rQ=new h,oQ=new h,sQ=new h,Eft=new h,Cft=new h,vft=new h,aQ=new h,cQ=new h,lQ=new h,Hy=new h,Ip=new $;function fbe(e,t,n){Ix=e.normal,Px=t.normal,Dx=n.normal,rQ=h.multiplyByScalar(e.normal,-e.distance,rQ),oQ=h.multiplyByScalar(t.normal,-t.distance,oQ),sQ=h.multiplyByScalar(n.normal,-n.distance,sQ),aQ=h.multiplyByScalar(h.cross(Px,Dx,Eft),h.dot(rQ,Ix),aQ),cQ=h.multiplyByScalar(h.cross(Dx,Ix,Cft),h.dot(oQ,Px),cQ),lQ=h.multiplyByScalar(h.cross(Ix,Px,vft),h.dot(sQ,Dx),lQ),Ip[0]=Ix.x,Ip[1]=Px.x,Ip[2]=Dx.x,Ip[3]=Ix.y,Ip[4]=Px.y,Ip[5]=Dx.y,Ip[6]=Ix.z,Ip[7]=Px.z,Ip[8]=Dx.z;let i=$.determinant(Ip);return Hy=h.add(aQ,cQ,Hy),Hy=h.add(Hy,lQ,Hy),new h(Hy.x/i,Hy.y/i,Hy.z/i)}function Sft(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=fbe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=fbe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var uQ=new h,Hv=new h;function fQ(e,t){let n=[];for(let i=0;i<4;i++)uQ=h.subtract(t[(i+1)%4],t[i],uQ),Hv=h.cross(e.normal,uQ,Hv),Hv=h.normalize(Hv,Hv),n[i]=h.clone(Hv);return n}Object.defineProperties(T1.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var dQ=new h;T1.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=hQ(sn.projectPointOntoPlane(c,t,dQ),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=dbe(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=hQ(sn.projectPointOntoPlane(c,t,dQ),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=hQ(sn.projectPointOntoPlane(this._boundingPlanes[1],t,dQ),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 wft=new h,Ift=new h;function dbe(e,t,n){let i=h.subtract(n,t,wft),r=h.subtract(e,t,Ift),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 Pft=new sn(h.UNIT_X,0);function hQ(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],Pft);sn.getPointDistance(u,e)<0||(a=dbe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}T1.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};T1.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Hh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Hh.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new Hh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Hh.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 Hh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Hh.createGeometry(f);c[u]=new Bt({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 An({translucent:!1,flat:!0}),asynchronous:!1})};var i4=T1;var Dft=new h(1,1,1),r4=Math.cos,o4=Math.sin;function Gv(e){e=e??H.EMPTY_OBJECT;let t=e.radii??Dft,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"}Gv.packedLength=2*h.packedLength+8;Gv.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 hbe=new h,mbe=new h,xg={radii:hbe,innerRadii:mbe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};Gv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,hbe);t+=h.packedLength;let r=h.unpack(e,t,mbe);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):(xg.minimumClock=o,xg.maximumClock=s,xg.minimumCone=a,xg.maximumCone=c,xg.stackPartitions=u,xg.slicePartitions=f,xg.subdivisions=d,xg.offsetAttribute=p===-1?void 0:p,new Gv(xg))};Gv.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]=o4(I),L[E]=r4(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=o4(S),C[E]=r4(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]=o4(I),L[E]=r4(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=o4(S),C[E]=r4(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:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Od=Gv;function Wv(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 Od(i),this._workerName="createSphereOutlineGeometry"}Wv.packedLength=Od.packedLength;Wv.pack=function(e,t,n){return Od.pack(e._ellipsoidGeometry,t,n)};var Rft=new Od,Rx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};Wv.unpack=function(e,t,n){let i=Od.unpack(e,t,Rft);return Rx.stackPartitions=i._stackPartitions,Rx.slicePartitions=i._slicePartitions,Rx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Rx.radii),n._ellipsoidGeometry=new Od(Rx),n):(Rx.radius=i._radii.x,new Wv(Rx))};Wv.createGeometry=function(e){return Od.createGeometry(e._ellipsoidGeometry)};var Gy=Wv;function qv(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(qv.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}}});qv.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};qv.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};qv.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};qv.prototype.createDebugVolume=function(e){let t=new Gy({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 Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Wy=qv;var Oft=new h,Mft=new h,Nft=new h,Lft=new h;function Ox(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function mQ(e,t){let n=h.normalize(e,Lft),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Ox(e,i,t)}function pbe(e){let t=$.getColumn(e,0,Oft),n=$.getColumn(e,1,Mft),i=$.getColumn(e,2,Nft),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=Ox(n,i,t):!r&&o&&!s?n=Ox(t,i,n):!r&&!o&&s?i=Ox(n,t,i):r?o?s||(t=mQ(i,t),n=Ox(i,t,n)):(t=mQ(n,t),i=Ox(n,t,i)):(n=mQ(t,n),i=Ox(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function Yv(e,t){t=pbe(t),this._orientedBoundingBox=new Qt(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Yv.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Yv.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};Yv.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Yv.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=pbe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};Yv.prototype.createDebugVolume=function(e){let t=new Gm({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 Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var bf=Yv;function io(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||sr(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=ZV(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,io._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")&&io._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?So.REPLACE:So.ADD):l(i)?p=i.refine:p=So.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(o)y=Mr.UNLOADED,A=De.createIfNeeded(t).clone();else if(l(s)){let v=s.uri;l(s.url)&&(io._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(io._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 yg(e,this),m=!0,y=Mr.READY):(y=Mr.UNLOADED,b=v)}else g=new yg(e,this),m=!0,y=Mr.READY;this._content=g,this._contentResourceValue=A,this._contentBaseResource=l(b)?t:void 0,this._contentUri=b,this._contentState=y,this._expiredContent=void 0,this._serverKeyValue=void 0,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}io._deprecationWarning=Yr;function gbe(e){let t=De.createIfNeeded(e._contentBaseResource).getDerivedResource({url:e._contentUri});e._contentResourceValue=t,e._serverKeyValue=El.getServerKey(t.getUrlComponent()),e._contentBaseResource=void 0,e._contentUri=void 0}Object.defineProperties(io.prototype,{_contentResource:{get:function(){return l(this._contentUri)&&gbe(this),this._contentResourceValue},set:function(e){this._contentResourceValue=e,this._contentBaseResource=void 0,this._contentUri=void 0}},_serverKey:{get:function(){return l(this._contentUri)&&gbe(this),this._serverKeyValue},set:function(e){this._serverKeyValue=e}},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 qy=new h;function Fft(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,qy),c=h.add(s.positionWC,a,qy),u=h.subtract(c,o,qy);if(h.magnitude(u)>r){let E=h.normalize(u,qy),v=h.multiplyByScalar(E,r,qy),S=h.add(o,v,qy),I=h.subtract(S,s.positionWC,qy),R=h.normalize(I,qy);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===So.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===po.PRELOAD_FLIGHT||n._pass===po.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 Tbe=new K;io.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 Bft(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 kft(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}io.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:ca.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!==ca.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=kft(n,this),this._priorityProgressiveResolution=Bft(n,this),this.priorityDeferred=Fft(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};io.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(Tbe);K.lessThan(this.expireDate,e)&&(this._contentState=Mr.EXPIRED,this._expiredContent=this._content)}};function Uft(e){if(!l(e.expireDuration))return;let t=K.now(Tbe);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 zft(e){return function(){return e._priority}}io.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Vft(this):Hft(this)};function Vft(e){let t=e._content,n=e._tileset;if(!l(t)){let r=sr(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new QV(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 jft(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(Ebe(e,a))return i&&(e.expireDate=void 0),e._content=new yg(t,e),_be(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 Gft(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof yg&&_be(e),e._contentState=Mr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Mr.FAILED,a}}function Hft(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:ra.TILES3D,priorityFunction:zft(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 jft(e,r,i,n,o)}function Ebe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function _be(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}io._isEmptyTile=Ebe;async function Gft(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=Vy(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===ka.GEOMETRY||r.contentType===ka.VECTOR,(r.contentType===ka.IMPLICIT_SUBTREE||r.contentType===ka.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===ka.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=Lv[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=Fv(n,a));let c=Bv(n,a);return l(c)&&(o.group=new AC({metadata:c})),o}io.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};io.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)};io.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 Cbe=new ue;function gQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Cbe);e._boundingVolume2D=new Wy(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Wft(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Cbe);e._contentBoundingVolume2D=new Wy(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}io.prototype.visibility=function(e,t){let n=e.cullingVolume,i=gQ(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 ca.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)};io.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===ca.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=Wft(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)};io.prototype.distanceToTile=function(e){return gQ(this,e).distanceToCamera(e)};var qft=new h;io.prototype.distanceToTileCenter=function(e){let n=gQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,qft);return h.dot(e.camera.directionWC,i)};io.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var vbe=new $,Sbe=new h,Yft=new $,_Q=new h,wbe=new ie,Ibe=new Qt,pQ=new M;function Xft(e,t,n){let i=h.fromElements(e[0],e[1],e[2],_Q),r=$.fromArray(e,3,Yft);i=M.multiplyByPoint(t,i,i);let o=M.getMatrix3(t,vbe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new bf(i,r)}function ybe(e,t,n,i){let r=ie.unpack(e,0,wbe),o=e[4],s=e[5],a=Qt.fromRectangle(r,o,s,ee.WGS84,Ibe),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,pQ),pQ),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,vbe);return u=$.multiply(f,u,u),l(i)&&i instanceof bf?(i.update(c,u),i):new bf(c,u)}function Kft(e,t,n,i){if(!M.equalsEpsilon(t,n,P.EPSILON8))return i instanceof bf?ybe(e,t,n,i):ybe(e,t,n,void 0);let r=ie.unpack(e,0,wbe);return i instanceof Rd?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Rd({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function $ft(e,t,n){let i=h.fromElements(e[0],e[1],e[2],_Q),r=e[3];i=M.multiplyByPoint(t,i,i);let o=M.getScale(t,Sbe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new Wy(i,r)}io.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=Zb.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(sr(e,"3DTILES_bounding_volume_S2"))return new i4(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=Xft(o,t,n);return this._verticalExaggeration!==1&&Abe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Kft(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof bf?Abe(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=$ft(a,t,n);if(this._verticalExaggeration!==1){let u=br.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,_Q),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var Jft=h.unpackArray(new Array(24).fill(0));function Abe(e,t,n){let i=e.boundingVolume.computeCorners(Jft).map(o=>br.getPosition(o,ee.WGS84,t,n,o)),r=Qt.fromPoints(i,Ibe);e.update(r.center,r.halfAxes)}io.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,pQ),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()};io.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,Sbe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Zft(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 Qft(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 edt(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 tdt(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)}io.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;edt(this,e),tdt(this,e),Zft(this,e,t,n),Qft(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 bbe=[];io.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Uft(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=bbe;try{this._content.update(e,t)}catch(i){throw this._contentState=Mr.FAILED,i}bbe.length=0,t.commandList=n};function xbe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function s4(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}io.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=s4(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===So.REPLACE?s4(this._priorityHolder._distanceToCamera,n.distance,i.distance):s4(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=xbe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=s4(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=xbe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===po.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};io.prototype.isDestroyed=function(){return!1};io.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(),le(this)};var Gh=io;function Tg(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(Tg.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}}});Tg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var E1=Tg;function Eg(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(Eg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Eg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Eg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Eg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Eg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Eg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var a4=Eg;function Pbe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new a4({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 E1({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 E1({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(Pbe.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 Xv=Pbe;var Dbe={},ndt=new h;Dbe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof bf||i instanceof Rd){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=jh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof bf||a instanceof Rd)){e._optimChildrenWithinParent=jh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,ndt),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 c4=Dbe;function C1(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(C1.prototype,{length:{get:function(){return this._length}}});function idt(e,t,n){this.item=e,this.previous=t,this.next=n}C1.prototype.add=function(e){let t=new idt(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 Rbe(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}C1.prototype.remove=function(e){l(e)&&(Rbe(this,e),--this._length)};C1.prototype.splice=function(e,t){if(e===t)return;Rbe(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 l4=C1;function Yy(){this._list=new l4,this._sentinel=this._list.add(),this._trimTiles=!1}Yy.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Yy.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Yy.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Yy.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Yy.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Yy.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)}};Yy.prototype.trim=function(){this._trimTiles=!0};var u4=Yy;function f4(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 AQ(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}f4.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=AQ(e,n),this._referenceMaximum[n]=AQ(t,n)};function rdt(e,t){let n=e.tilePropertyName;if(l(n)){let i=AQ(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 yQ=[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)];f4.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=rdt(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=yQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=yQ[d],y=yQ[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};f4.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 d4=f4;function Kv(){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}Kv.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};Kv.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])}};Kv.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Td))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])}};Kv.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Td))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])}};Kv.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 Pp=Kv;function v1(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(v1.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});v1.prototype.makeDirty=function(){this._styleDirty=!0};v1.prototype.resetDirty=function(){this._styleDirty=!1};v1.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 h4=v1;function Obe(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}Obe.maximumFrameNumber=15e6;var Mx=Obe;function odt(e,t,n){let i=sr(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)&&!sr(r,"3DTILES_bounding_volume_S2")&&!sr(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=sdt(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=adt(t),this.subdivisionScheme=Xs[i.subdivisionScheme],this.branchingFactor=Xs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function sdt(e){if(sr(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 adt(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 Cg=odt;var S1={};function Mbe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function bQ(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Nbe(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 xQ(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}S1.encode2D=function(e,t){return(Mbe(e)|Mbe(t)<<1)>>>0};S1.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Nbe(e),t[1]=Nbe(e>>1),t};S1.encode3D=function(e,t,n){return bQ(e)|bQ(t)<<1|bQ(n)<<2};S1.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=xQ(e),t[1]=xQ(e>>1),t[2]=xQ(e>>2),t};var Nx=S1;function go(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===Xs.OCTREE&&(this.z=e.z)}Object.defineProperties(go.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Xs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Xs.OCTREE?Nx.encode3D(this.x,this.y,this.z):Nx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Xs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});go.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===Xs.OCTREE){let r=(this.z<<e.level)+e.z;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};go.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===Xs.OCTREE){let o=Math.floor(this.z/t);return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};go.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Xs.OCTREE){let o=e.z%n;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};go.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===Xs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};go.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};go.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};go.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===Xs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};go.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===Xs.OCTREE?this.z===e.z:!0)};go.prototype.isImplicitTilesetRoot=function(){return this.level===0};go.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};go.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};go.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Xs.OCTREE&&(e.z=this.z),e};var Lbe=[0,0,0];go.fromMortonIndex=function(e,t,n,i){let r;return e===Xs.OCTREE?(r=Nx.decode3D(i,Lbe),new go({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Nx.decode2D(i,Lbe),new go({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};go.fromTileIndex=function(e,t,n){let i,r,o;return e===Xs.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),go.fromMortonIndex(e,t,i,o)};var vg=go;function Sg(){}Sg.selectTiles=function(e,t){pe.throwInstantiationError()};Sg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Sg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Sg.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)};Sg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Sg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Sg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!cdt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function cdt(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}Sg.updateTile=function(e,t){Fbe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,fdt(e),e._shouldSelect=!1,e._finalResolution=!0};function Fbe(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];Fbe(o,t),e._visible=o._visible;return}if(ldt(e,t)){e._visible=!1;return}let i=e.refine===So.REPLACE,r=e._optimChildrenWithinParent===jh.USE_OPTIMIZATION;if(i&&r&&n&&!udt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function ldt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==So.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function udt(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 fdt(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 ic=Sg;function Bbe(){}var w1={stack:new _u,stackMaximumLength:0};Bbe.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}=ic,s=w1.stack;for(s.push(i);s.length>0;){w1.stackMaximumLength=Math.max(w1.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===So.ADD,u=a.refine===So.REPLACE,f=ddt(a);f&&hdt(a,s,t),(c||u&&!f)&&(mdt(e,a),r(a,t),pdt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return w1.stack.trim(w1.stackMaximumLength),n};function ddt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function hdt(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 mdt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function pdt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var m4=Bbe;function kbe(){}var I1={stack:new _u,stackMaximumLength:0},P1={stack:new _u,stackMaximumLength:0};kbe.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(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;_dt(n,t),I1.stack.trim(I1.stackMaximumLength),P1.stack.trim(P1.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function TQ(e,t){e.contentAvailable&&ic.selectTile(e,t)}function gdt(e,t,n){let i=e.refine===So.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=ic;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(ic.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=ydt(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 _dt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=ic,a=I1.stack;for(a.push(e);a.length>0;){I1.stackMaximumLength=Math.max(I1.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?gdt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===So.ADD?(TQ(c,t),r(c,t)):c.refine===So.REPLACE&&(r(c,t),d&&TQ(c,t)):(n._emptyTiles.push(c),r(c,t),d&&TQ(c,t)),o(c,t),s(c,t)}}function ydt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=ic,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=P1.stack;for(c.push(e);c.length>0;){P1.stackMaximumLength=Math.max(P1.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 p4=kbe;function Ube(){}var D1={stack:new _u,stackMaximumLength:0},R1={stack:new _u,stackMaximumLength:0},wg={stack:new _u,stackMaximumLength:0,ancestorStack:new _u,ancestorStackMaximumLength:0},Adt=2;Ube.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(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;vdt(n,t),Sdt(n,t),D1.stack.trim(D1.stackMaximumLength),R1.stack.trim(R1.stackMaximumLength),wg.stack.trim(wg.stackMaximumLength),wg.ancestorStack.trim(wg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function bdt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=ic,o=R1.stack;for(o.push(e);o.length>0;){R1.stackMaximumLength=Math.max(R1.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<Adt&&o.push(u))}}}function g4(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:bdt(e,t)}function xdt(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 Tdt(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 Edt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=ic;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(ic.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 Cdt(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 vdt(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}=ic,c=D1.stack;for(c.push(e);c.length>0;){D1.stackMaximumLength=Math.max(D1.stackMaximumLength,c.length);let u=c.pop();xdt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Edt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===So.ADD?(g4(u,t),o(u,t)):u.refine===So.REPLACE&&(Cdt(u,i)?(o(u,t),p&&g4(u,t)):p?(g4(u,t),o(u,t)):Tdt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&g4(u,t)),s(u,t),a(u,t)}}function Sdt(e,t){let{selectTile:n,canTraverse:i}=ic,{stack:r,ancestorStack:o}=wg,s;for(r.push(e);r.length>0||o.length>0;){if(wg.stackMaximumLength=Math.max(wg.stackMaximumLength,r.length),wg.ancestorStackMaximumLength=Math.max(wg.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===So.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 _4=Ube;function _a(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(_a.prototype,{length:{get:function(){return this._layers.length}}});_a.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()})};_a.prototype.addImageryProvider=function(e,t){let n=new Ms(e);return this.add(n,t),n};_a.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};_a.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=[]};_a.prototype.contains=function(e){return this.indexOf(e)!==-1};_a.prototype.indexOf=function(e){return this._layers.indexOf(e)};_a.prototype.get=function(e){return this._layers[e]};function y4(e,t){return e.indexOf(t)}function zbe(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)}_a.prototype.raise=function(e){let t=y4(this._layers,e);zbe(this,t,t+1)};_a.prototype.lower=function(e){let t=y4(this._layers,e);zbe(this,t,t-1)};_a.prototype.raiseToTop=function(e){let t=y4(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))};_a.prototype.lowerToBottom=function(e){let t=y4(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 Vbe=new ie;function jbe(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=Vbe,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)}}_a.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(jbe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var wdt=new ie,Idt=new ie,EQ=new U,CQ=new U,Pdt=new he,Ddt=new he;function Rdt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,wdt),s=1/1024,a=Idt;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;EQ.x=a.west,EQ.y=a.south,CQ.x=a.east,CQ.y=a.north;let u=c.unproject(EQ,Pdt),f=c.unproject(CQ,Ddt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function Odt(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=Rdt(A,d.textureCoordinateRectangle,g,Vbe);ie.contains(b,t)&&n(p)}}}}_a.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)&&jbe(t,r,!0,function(c){a(c)}),l(i)&&Odt(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})};_a.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};_a.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return this.removeAll(!0),le(this)};_a.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 $v=_a;function ro(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 u4,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 _u,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 h4,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Pp,this._statisticsLast=new Pp,this._statisticsPerPass=new Array(po.NUMBER_OF_PASSES);for(let r=0;r<po.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Pp;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 d4(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 $v(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=ff.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new ng(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Ay,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)&&Ps.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Zc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),Ybe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new yC,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new gy(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??Ho.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??Dh.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(ro.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){Ps.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zc.setOwner(e,this,"_clippingPolygons"),Ybe(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=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,Zbe(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}}});ro.fromIonAssetId=async function(e,t){let n=await qo.fromAssetId(e);return ro.fromUrl(n,t)};ro.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 ro.loadJson(n),o=await Mdt(n,r),s=new ro(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,Zbe(s);let c=l(r.asset.gltfUpAxis)?qi.fromName(r.asset.gltfUpAxis):qi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??qi.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};ro.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};ro.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ro.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)&&ro.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=Hbe(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===So.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=Hbe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&c4.checkChildrenWithinParent(c)}return s};function Hbe(e,t,n,i){if(!(l(n.implicitTiling)||sr(n,"3DTILES_implicit_tiling")))return new Gh(e,t,n,i);let o=e.schema,s=new Cg(t,n,o),a=new vg({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 Gh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Mdt(e,t){let n=sr(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 Xv({schema:i.schema,metadataJson:n});return Bi.unload(i),r}var Gbe=new h,Ndt=new he,Ldt=new M,Fdt=new h,Bdt=new h,kdt=new h,Udt=new h;function zdt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Rd)n=h.normalize(a.positionWC,Gbe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=M.inverseTransformation(c.computedTransform,Ldt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=M.multiplyByPoint(y,b.center,Fdt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,Ndt);n=h.normalize(a.positionWC,Gbe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=M.multiplyByPoint(y,a.positionWC,Bdt);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(y,a.directionWC,kdt),i=h.normalize(i,i),r=T.z,u instanceof bf){let E=$.getColumn(b.halfAxes,2,Udt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof Wy){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 Vdt(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=>{Xbe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?$be(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function qbe(e,t){return e._priority-t._priority}ro.prototype.postPassesUpdate=function(e){l(this._root)&&(jdt(this,e),sht(this,e),this._cache.unloadTiles(this,Jbe),rht(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function Ybe(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)}ro.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Kdt(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&&zdt(this,e),e.newFrame&&this._cache.reset()};function jdt(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 Hdt(e){let t=e._requestedTiles;t.sort(qbe);for(let n=0;n<t.length;++n)Vdt(e,t[n])}function Xbe(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 Gdt(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 Wdt=new he,qdt=new he,Ydt=new h;function Xdt(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,Wdt),f=he.fromCartesian(r.center,c,qdt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,Ydt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Kdt(e,t){Gdt(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,Xbe(f,e,u)}}e.totalMemoryUsageInBytes<i?Jdt(e):a&&n.length>0&&$dt(e)}function $dt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(qbe)}function Jdt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var A4=new h,Zdt={maximumFractionDigits:3};function Wbe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Zdt):Math.round(t).toLocaleString()}function vQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,A4);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,A4);o=h.multiplyByScalar(o,.75*n,A4),r=h.add(o,i,A4)}return r}function SQ(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: ${Wbe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${Wbe(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]}`;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 Qdt(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:vQ(e.debugPickedTile),a=SQ(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];SQ(a,e,vQ(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&SQ(a,e,vQ(a))}}e._tileDebugLabels.update(t)}function eht(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 hi({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),Xdt(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 hg),Qdt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Kbe=[],tht=[];function $be(e,t){let n=t,i=Kbe;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&&(oht(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Jbe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function b4(e,t){let n=e-t;return n<0?n+Mx.maximumFrameNumber:n}var nht=64;function iht(e,t,n){let i=tht;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(b4(t,r._visitedFrame),b4(t,r._touchedFrame),b4(t,r._selectedFrame),b4(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 rht(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<nht&&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,!iht(u,i,r)&&($be(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function oht(e,t){e._cache.unloadTile(e,t,Jbe),t.destroy()}ro.prototype.trimLoadedTiles=function(){this._cache.trim()};function sht(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Pp.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 aht(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 cht(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 lht(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,aht(e),cht(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Hdt(e),eht(e,t,i),Pp.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 Zbe(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}ro.prototype.getTraversal=function(e){let{pass:t}=e;return t===po.MOST_DETAILED_PRELOAD||t===po.MOST_DETAILED_PICK?m4:this.isSkippingLevelOfDetail?_4:p4};ro.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ro.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===po.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===po.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===po.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=po.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=lht(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};ro.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ro.prototype.isDestroyed=function(){return!1};ro.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=Kbe;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,le(this)};ro.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};ro.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ro.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var uht=new gn,fht=new h,dht=new h,hht=new he;ro.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=uht,r=n.cartographicToCartesian(e,fht),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,dht,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,hht)?.height};ro.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 mht=new h;ro.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,mht);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};ro.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};ro.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 Jo=ro;var pht=new M;function Xy(e,t){t.collectionChanged.addEventListener(Xy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}Xy.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,pht),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],ght(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};Xy.prototype.isDestroyed=function(){return!1};Xy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Xy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)wQ(this,e[i],t,n);return le(this)};Xy.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?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};Xy.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):(wQ(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],wQ(this,o,a,c),s.remove(o.id)};function wQ(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function ght(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Jo.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 x4=Xy;var _ht=z.WHITE,yht=z.BLACK,Aht=new U(2,2);function Jv(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(Jv.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")});Jv.prototype.getType=function(e){return"Checkerboard"};var bht=new K;Jv.prototype.getValue=function(e,t){return l(e)||(e=K.now(bht)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,_ht,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,yht,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,Aht),t};Jv.prototype.equals=function(e){return this===e||e instanceof Jv&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var O1=Jv;var Qbe={id:void 0};function M1(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 il(e){this._owner=e,this._entities=new kt,this._addedEntities=new kt,this._removedEntities=new kt,this._changedEntities=new kt,this._suspendCount=0,this._collectionChanged=new be,this._id=$n(),this._show=!0,this._firing=!1,this._refire=!1}il.prototype.suspendEvents=function(){this._suspendCount++};il.prototype.resumeEvents=function(){this._suspendCount--,M1(this)};Object.defineProperties(il.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}}});il.prototype.computeAvailability=function(){let e=tt.MAXIMUM_VALUE,t=tt.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(tt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(tt.MAXIMUM_VALUE)&&(t=c)}}return tt.MAXIMUM_VALUE.equals(e)&&(e=tt.MINIMUM_VALUE),tt.MINIMUM_VALUE.equals(t)&&(t=tt.MAXIMUM_VALUE),new Cn({start:e,stop:t})};il.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(il.prototype._onEntityDefinitionChanged,this),M1(this),e};il.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};il.prototype.contains=function(e){return this._entities.get(e.id)===e};il.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(il.prototype._onEntityDefinitionChanged,this),M1(this),!0):!1};il.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(il.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),M1(this)};il.prototype.getById=function(e){return this._entities.get(e)};il.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Qbe.id=e,t=new Qr(Qbe),this.add(t)),t};il.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),M1(this)};var rc=il;var T4={id:void 0},Zv=new Array(2);function IQ(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 exe(e,t,n,i){Zv[0]=n,Zv[1]=i.id,t[JSON.stringify(Zv)]=i.definitionChanged.addEventListener(gs.prototype._onDefinitionChanged,e)}function txe(e,t,n,i){Zv[0]=n,Zv[1]=i.id;let r=JSON.stringify(Zv);t[r](),t[r]=void 0}function Ky(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 rc(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(gs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],txe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(gs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],exe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?IQ(y):(T4.id=s.id,y=new Qr(T4)),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 gs(e,t){this._owner=t,this._composite=new rc(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=$n(),this._eventHash={},Ky(this),this._shouldRecomposite=!1}Object.defineProperties(gs.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}}});gs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),Ky(this)};gs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Ky(this),!0):!1};gs.prototype.removeAllCollections=function(){this._collections.length=0,Ky(this)};gs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};gs.prototype.contains=function(e){return this._composite.contains(e)};gs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};gs.prototype.getCollection=function(e){return this._collections[e]};gs.prototype.getCollectionsLength=function(){return this._collections.length};function E4(e,t){return e.indexOf(t)}function nxe(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,Ky(e)}gs.prototype.raiseCollection=function(e){let t=E4(this._collections,e);nxe(this,t,t+1)};gs.prototype.lowerCollection=function(e){let t=E4(this._collections,e);nxe(this,t,t-1)};gs.prototype.raiseCollectionToTop=function(e){let t=E4(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Ky(this))};gs.prototype.lowerCollectionToBottom=function(e){let t=E4(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Ky(this))};gs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};gs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Ky(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};gs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};gs.prototype.getById=function(e){return this._composite.getById(e)};gs.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];txe(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),IQ(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];exe(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)?IQ(u):(T4.id=y,u=new Qr(T4),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};gs.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 ixe=gs;function PQ(){this._removalFunctions=[]}PQ.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)}};PQ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Zo=PQ;function OQ(e,t){return K.compare(e.start,t.start)}function _s(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(_s.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}}});_s.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof _s))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};_s.prototype.get=function(e){return this._intervals[e]};_s.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};_s.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};_s.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};_s.prototype.contains=function(e){return this.indexOf(e)>=0};var DQ=new Cn;_s.prototype.indexOf=function(e){let t=this._intervals;DQ.start=e,DQ.stop=e;let n=Pr(t,DQ,OQ);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)};_s.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]}};_s.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,OQ);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)};_s.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Pr(t,e,OQ);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};_s.prototype.intersect=function(e,t,n){let i=new _s,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};_s.fromJulianDateArray=function(e,t){l(t)||(t=new _s);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:tt.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:tt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var rl=new Fm,N1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function RQ(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,rl);let i=rl.millisecond+t.millisecond,r=rl.second+t.second,o=rl.minute+t.minute,s=rl.hour+t.hour,a=rl.day+t.day,c=rl.month+t.month,u=rl.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),N1[2]=ru(u)?29:28;a>N1[c]||c>=13;)a>N1[c]&&(a-=N1[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),N1[2]=ru(u)?29:28;return rl.millisecond=i,rl.second=r,rl.minute=o,rl.hour=s,rl.day=a,rl.month=c,rl.year=u,K.fromGregorianDate(rl,n)}var xht=new K,Tht=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function rxe(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(Tht);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,xht),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var L1=new Fm;_s.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!rxe(n[2],L1))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=RQ(s,L1),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return _s.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};_s.fromIso8601DateArray=function(e,t){return _s.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)};_s.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)(rxe(i[u],L1)||u===0)&&(r&&l(a)?s=RQ(a,L1):s=RQ(n,L1),o.push(s),a=s);return _s.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ls=_s;function Eht(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 Lx(){this._eventHelper=new Zo,this._definitionChanged=new be,this._intervals=new Ls,this._intervals.changedEvent.addEventListener(Lx.prototype._intervalsChanged,this)}Object.defineProperties(Lx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Cht=new K;Lx.prototype.getValue=function(e,t){l(e)||(e=K.now(Cht));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Lx.prototype.equals=function(e){return this===e||e instanceof Lx&&this._intervals.equals(e._intervals,X.equals)};Lx.prototype._intervalsChanged=function(){Eht(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Vl=Lx;function $y(){this._definitionChanged=new be,this._composite=new Vl,this._composite.definitionChanged.addEventListener($y.prototype._raiseDefinitionChanged,this)}Object.defineProperties($y.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});$y.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var vht=new K;$y.prototype.getValue=function(e,t){l(e)||(e=K.now(vht));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};$y.prototype.equals=function(e){return this===e||e instanceof $y&&this._composite.equals(e._composite,X.equals)};$y.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var F1=$y;function Jy(e){this._referenceFrame=e??Wi.FIXED,this._definitionChanged=new be,this._composite=new Vl,this._composite.definitionChanged.addEventListener(Jy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Jy.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 Sht=new K;Jy.prototype.getValue=function(e,t){return l(e)||(e=K.now(Sht)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Jy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Jy.prototype.equals=function(e){return this===e||e instanceof Jy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};Jy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var xc=Jy;var oxe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(oxe);var ur=oxe;var oc=[new h,new h],wht=new h,Iht=new h,Pht=new h,Dht=new h,Rht=new h,Oht=new h,Mht=new h,Nht=new h,Lht=new h,Qv=new h,C4=new h,B1={},MQ=new he;function Fht(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];MQ=t.cartesianToCartographic(r,MQ),n[i]=MQ.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function NQ(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 v4=new h,S4=new h;function Bht(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,v4),v4),s=r.projectPointOntoPlane(h.add(n,t,S4),S4),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var kht=new h(-1,0,0),Fx=new M,Uht=new M,LQ=new $,zht=$.IDENTITY.clone(),Vht=new h,jht=new se,sxe=new h;function Ig(e,t,n,i,r,o,s,a){let c=Vht,u=jht;Fx=At.eastNorthUpToFixedFrame(e,r,Fx),c=M.multiplyByPointAsVector(Fx,kht,c),c=h.normalize(c,c);let f=Bht(c,t,e,r);LQ=$.fromRotationZ(f,LQ),sxe.z=o,Fx=M.multiplyTransformation(Fx,M.fromRotationTranslation(LQ,sxe,Uht),Fx);let d=zht;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(Fx,u,u),i.push(u.x,u.y,u.z);return i}var Hht=new h;function FQ(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,Hht);i=Ig(c,t,n,i,r,o[a/3],s,1)}return i}function Ght(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 axe(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 cxe=new Le,lxe=new h,uxe=new $;function fxe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,Qv),h.subtract(n,e,C4)),d=i===ur.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,Qv),f/(d+1),cxe),uxe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),cxe),uxe);let g,m;if(t=h.clone(t,lxe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,Qv),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,C4),s=Ig(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,Qv),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,C4),s=Ig(m,g,a,s,o,c,1,1),n=h.clone(n,lxe),g=h.subtract(n,e,Qv),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,C4),s=Ig(m,g,a,s,o,c,1,1);return s}B1.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};B1.angleIsGreaterThanPi=function(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,v4),v4),s=r.projectPointOntoPlane(h.add(n,t,S4),S4);return s.x*o.y-s.y*o.x>=0};var Wht=new h,qht=new h;B1.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=Fht(e,o),a=i._granularity,c=i._cornerType,u=r?Ght(t,n):axe(t,n),f=r?axe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=wht,b=Iht,x=Pht,T=Dht,E=Rht,v=Oht,S=Mht,I=Nht,R=Lht,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=Ig(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),Wht);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),qht);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,Qv))),Q=B1.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),oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(v,oc[1]),w=NQ(oc,_+d,C+d,a),D=lr.generateArc({positions:oc,granularity:a,ellipsoid:o}),m=FQ(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===ur.ROUNDED||c===ur.BEVELED?fxe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=Ig(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),oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(v,oc[1]),w=NQ(oc,_+d,C+d,a),D=lr.generateArc({positions:oc,granularity:a,ellipsoid:o}),m=FQ(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===ur.ROUNDED||c===ur.BEVELED?fxe(E,v,S,c,Q,o,m,u,C+d,r):m=Ig(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=Ig(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(O,oc[1]),w=NQ(oc,_+d,C+d,a),D=lr.generateArc({positions:oc,granularity:a,ellipsoid:o}),m=FQ(D,I,u,m,o,w,1),r&&(y=Ig(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 Dp=B1;var kQ={},eS=new h,gxe=new h,Yht=new h,dxe=new h,jl=[new h,new h],_xe=new h,yxe=new h,Axe=new h,Xht=new h,Kht=new h,$ht=new h,Jht=new h,Zht=new h,Qht=new h,emt=new h,hxe=new Le,mxe=new $;function w4(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,eS),h.subtract(n,e,gxe)),s=i===ur.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,eS),o/s,hxe),mxe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,hxe),mxe);let f=0;t=h.clone(t,eS);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 tmt(e){let t=_xe,n=yxe,i=Axe,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=w4(t,n,i,ur.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=w4(t,n,i,ur.ROUNDED,!1);return[o,c]}function pxe(e,t,n,i){let r=eS;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 BQ(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,eS),a=h.negate(s,gxe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,Yht),p=h.add(d,a,dxe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,dxe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}kQ.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 nmt=new h,imt=new h;kQ.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=_xe,c=yxe,u=Axe,f=Xht,d=Kht,p=$ht,g=Jht,m=Zht,y=Qht,A=emt,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),nmt);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),imt);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,eS))),N=Dp.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),jl[0]=h.clone(g,jl[0]),jl[1]=h.clone(A,jl[1]),S=lr.generateArc({positions:jl,granularity:t,ellipsoid:i}),b=BQ(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===ur.ROUNDED||o===ur.BEVELED?I.push({leftPositions:w4(m,p,y,o,N)}):I.push({leftPositions:pxe(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),jl[0]=h.clone(g,jl[0]),jl[1]=h.clone(A,jl[1]),S=lr.generateArc({positions:jl,granularity:t,ellipsoid:i}),b=BQ(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===ur.ROUNDED||o===ur.BEVELED?I.push({rightPositions:w4(y,p,m,o,N)}):I.push({rightPositions:pxe(E,d,m,N)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),jl[0]=h.clone(g,jl[0]),jl[1]=h.clone(E,jl[1]),S=lr.generateArc({positions:jl,granularity:t,ellipsoid:i}),b=BQ(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===ur.ROUNDED&&(L=tmt(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var gr=kQ;var Txe=new h,Exe=new h,I4=new h,P4=new h,rmt=new h,Cxe=new h,Zy=new h,tS=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 Wh(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,Zy),Zy);o.normal&&gr.addAttribute(s,t,i,r),o.tangent&&gr.addAttribute(a,u,i,r),o.bitangent&&gr.addAttribute(c,n,i,r)}function Sxe(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=Txe,w=Exe,D,N,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){N=I4,D=P4;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),gr.addAttribute(b,D,S),gr.addAttribute(b,N,void 0,I),Wh(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,Zy),Zy),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,tS),tS),C=h.normalize(h.add(Q,W,C),C),Wh(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,Zy),Zy),W=n.geodeticSurfaceNormal(h.fromArray(q,g,tS),tS),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=Cxe,we=I4,ve=P4;if(C=h.fromArray(a,k,C),l(ae)){for(Wh(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,gr.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),Wh(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),Wh(v,C,w,S,void 0,t),S+=3}else{for(Wh(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,gr.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),Wh(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),Wh(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,Zy),Zy),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,tS),tS),C=h.normalize(h.add(Q,W,C),C),Wh(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),Wh(v,C,w,S,I,t),m){S+=3,I-=3,N=I4,D=P4;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),gr.addAttribute(b,N,void 0,I),gr.addAttribute(b,D,S),Wh(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 omt(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=Txe,m=Exe,y=I4,A=P4,b=rmt,x=Cxe,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&&(gr.addAttribute(f,A,E),gr.addAttribute(f,A,E+3),gr.addAttribute(f,A,T),gr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(gr.addAttribute(p,x,E),gr.addAttribute(p,x,E+3),gr.addAttribute(p,x,T),gr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),gr.addAttribute(d,b,E),gr.addAttribute(d,b,E+3),gr.addAttribute(d,b,T),gr.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 UQ(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 smt(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=gr.computePositions(e),o=Sxe(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=mi.scaleToGeodeticHeight(f,s,i),m=UQ(f,0,m),g=mi.scaleToGeodeticHeight(g,a,i),m=UQ(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=omt(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=UQ(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 bxe=new h,k1=new h,Nd=new he;function xxe(e,t,n,i,r,o){let s=h.subtract(t,e,bxe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,k1),c=h.cross(s,a,bxe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,k1),n.cartesianToCartographic(k1,Nd);let g=Nd.latitude,m=Nd.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,k1),n.cartesianToCartographic(k1,Nd),g=Nd.latitude,m=Nd.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 Md=new h,U1=new h,Ou=new he,Mu=new he;function wxe(e,t,n,i,r){e=vxe(e,t);let o=Lr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;Ou.latitude=Number.POSITIVE_INFINITY,Ou.longitude=Number.POSITIVE_INFINITY,Mu.latitude=Number.NEGATIVE_INFINITY,Mu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===ur.ROUNDED){let p=o[0];h.subtract(p,o[1],Md),h.normalize(Md,Md),h.multiplyByScalar(Md,a,Md),h.add(p,Md,U1),t.cartesianToCartographic(U1,Nd),c=Nd.latitude,u=Nd.longitude,Ou.latitude=Math.min(Ou.latitude,c),Ou.longitude=Math.min(Ou.longitude,u),Mu.latitude=Math.max(Mu.latitude,c),Mu.longitude=Math.max(Mu.longitude,u)}for(let p=0;p<s-1;++p)xxe(o[p],o[p+1],t,a,Ou,Mu);let f=o[s-1];h.subtract(f,o[s-2],Md),h.normalize(Md,Md),h.multiplyByScalar(Md,a,Md),h.add(f,Md,U1),xxe(f,U1,t,a,Ou,Mu),i===ur.ROUNDED&&(t.cartesianToCartographic(U1,Nd),c=Nd.latitude,u=Nd.longitude,Ou.latitude=Math.min(Ou.latitude,c),Ou.longitude=Math.min(Ou.longitude,u),Mu.latitude=Math.max(Mu.latitude,c),Mu.longitude=Math.max(Mu.longitude,u));let d=l(r)?r:new ie;return d.north=Mu.latitude,d.south=Ou.latitude,d.east=Mu.longitude,d.west=Ou.longitude,d}function Dg(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??ur.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}Dg.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 Ixe=ee.clone(ee.UNIT_SPHERE),Pxe=new Be,Pg={positions:void 0,ellipsoid:Ixe,vertexFormat:Pxe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Dg.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,Ixe);t+=ee.packedLength;let s=Be.unpack(e,t,Pxe);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):(Pg.positions=r,Pg.width=a,Pg.height=c,Pg.extrudedHeight=u,Pg.cornerType=f,Pg.granularity=d,Pg.shadowVolume=p,Pg.offsetAttribute=g===-1?void 0:g,new Dg(Pg))};Dg.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??ur.ROUNDED;return wxe(n,r,i,o,t)};Dg.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=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=smt(u,c);else{let g=gr.computePositions(u);if(f=Sxe(g,c,i),f.attributes.position.values=mi.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=ue.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})};Dg.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Dg({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(Dg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=wxe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var nS=Dg;var Dxe=new h,Rxe=new h,amt=new h;function cmt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Oxe(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=Dxe,I=Rxe;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),gr.addAttribute(A,I,b),gr.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=amt;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,gr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===ur.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,gr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===ur.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=Dxe,I=Rxe;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),gr.addAttribute(A,R,void 0,x),gr.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 lmt(e){let t=e.ellipsoid,n=gr.computePositions(e),i=Oxe(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=mi.scaleToGeodeticHeight(u,o,t),d=mi.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 z1(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??ur.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}z1.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 Mxe=ee.clone(ee.UNIT_SPHERE),Qy={positions:void 0,ellipsoid:Mxe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};z1.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,Mxe);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):(Qy.positions=r,Qy.width=s,Qy.height=a,Qy.extrudedHeight=c,Qy.cornerType=u,Qy.granularity=f,Qy.offsetAttribute=d===-1?void 0:d,new z1(Qy))};z1.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=cmt(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=lmt(c);else{let p=gr.computePositions(c);if(u=Oxe(p,c.cornerType),u.attributes.position.values=mi.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=ue.fromVertices(f.position.values,void 0,3);return new wt({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var D4=z1;var umt=new fi(0);function Hl(e){Oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Hl.prototype=Object.create(Oi.prototype),Hl.prototype.constructor=Hl);Object.defineProperties(Hl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Hl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&fu.isSupported(this._scene)};Hl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Hl.prototype._computeCenter=pe.throwInstantiationError;Hl.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??umt,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 np(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new mC(this._scene,a,o,s)}};Hl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Oi.prototype.destroy.call(this)};Hl.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryHeightReference);return}return ls(t)?0:e};Hl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryExtrudedHeightReference);return}return ls(t)?Hl.CLAMP_TO_GROUND:e};Hl.CLAMP_TO_GROUND="clamp";Hl.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=Hl;var Nxe=new z,Lxe=h.ZERO,Fxe=new h,Bxe=new ie;function fmt(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 fmt(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:Kn.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,Nxe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Lxe,Fxe))),new Bt({id:t,geometry:new nS(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,Nxe),r={show:new Pn(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 l(this._options.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Lxe,Fxe))),new Bt({id:t,geometry:new D4(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,tt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,tt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(tt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(tt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,tt.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(nS.computeRectangle(s,Bxe)).minimumTerrainHeight),s.extrudedHeight=r};qh.DynamicGeometryUpdater=iS;function iS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(iS.prototype=Object.create(Ri.prototype),iS.prototype.constructor=iS);iS.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)};iS.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(nS.computeRectangle(i,Bxe)).minimumTerrainHeight),i.extrudedHeight=s};var R4=qh;function O4(){pe.throwInstantiationError()}Object.defineProperties(O4.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}});O4.prototype.update=function(e){pe.throwInstantiationError()};O4.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Fs=O4;function Rp(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Rp.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 kxe=new h;Rp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,kxe);return VQ(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Rp.prototype.isScaledSpacePointVisible=function(e){return VQ(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var dmt=new h;Rp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=dmt,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),VQ(e,r,i)};Rp.prototype.computeHorizonCullingPoint=function(e,t,n){return Vxe(this._ellipsoid,e,t,n)};var Uxe=ee.clone(ee.UNIT_SPHERE);Rp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=zxe(this._ellipsoid,n,Uxe);return Vxe(r,e,t,i)};Rp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return jxe(this._ellipsoid,e,t,n,i,r)};Rp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=zxe(this._ellipsoid,r,Uxe);return jxe(s,e,t,n,i,o)};var hmt=[];Rp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,hmt),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var mmt=new h;function zxe(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,mmt);e=ee.fromCartesian3(i,n)}return e}function Vxe(e,t,n,i){l(i)||(i=new h);let r=Wxe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=Hxe(e,c,r);if(u<0)return;o=Math.max(o,u)}return Gxe(r,o,i)}var M4=new h;function jxe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=Wxe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){M4.x=n[c]+r.x,M4.y=n[c+1]+r.y,M4.z=n[c+2]+r.z;let f=Hxe(e,M4,s);if(f<0)return;a=Math.max(a,f)}return Gxe(s,a,o)}function VQ(e,t,n){let i=t,r=n,o=h.subtract(e,i,kxe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var pmt=new h,gmt=new h;function Hxe(e,t,n){let i=e.transformPositionToScaledSpace(t,pmt),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,gmt);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 Gxe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var zQ=new h;function Wxe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,zQ),h.normalize(zQ,zQ))}var Op=Rp;function Qo(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??Ho.NONE}var qxe=Qo.SHOW_INDEX=0,Kxe=Qo.POSITION_INDEX=1,_mt=Qo.COLOR_INDEX=2,ymt=Qo.OUTLINE_COLOR_INDEX=3,Amt=Qo.OUTLINE_WIDTH_INDEX=4,bmt=Qo.PIXEL_SIZE_INDEX=5,xmt=Qo.SCALE_BY_DISTANCE_INDEX=6,Tmt=Qo.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Emt=Qo.DISTANCE_DISPLAY_CONDITION_INDEX=8,Cmt=Qo.DISABLE_DEPTH_DISTANCE_INDEX=9,vmt=Qo.SPLIT_DIRECTION_INDEX=10;Qo.NUMBER_OF_PROPERTIES=11;function xf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Qo.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,xf(this,qxe))}},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),xf(this,Kxe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),xf(this,xmt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),xf(this,Tmt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,xf(this,bmt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),xf(this,_mt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),xf(this,ymt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,xf(this,Amt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),xf(this,Emt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,xf(this,Cmt))}},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,xf(this,qxe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,xf(this,vmt))}}});Qo.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Qo.prototype._getActualPosition=function(){return this._actualPosition};Qo.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),xf(this,Kxe)};var Yxe=new se;Qo._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(M.multiplyByPoint(n,e,Yxe),pr.computeActualEllipsoidPosition(t,Yxe))};var Xxe=new se;Qo._computeScreenSpacePosition=function(e,t,n,i){let r=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Xxe),Xxe);return pr.worldToWindowCoordinates(n,r,i)};Qo.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=Qo._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};Qo.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};Qo.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};Qo.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var za=Qo;var Bx=`in vec4 v_color; +in vec4 v_outlineColor; +in float v_innerPercent; +in float v_pixelDistance; +in vec4 v_pickColor; +in float v_splitDirection; +void main() { -#ifdef HAS_CLEARCOAT_TEXTURE -vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT; -#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM -clearcoatTexCoords = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform); -#endif -float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r; -#ifdef HAS_CLEARCOAT_FACTOR -clearcoatFactor *= u_clearcoatFactor; -#endif -#else -#ifdef HAS_CLEARCOAT_FACTOR -float clearcoatFactor = u_clearcoatFactor; -#else -float clearcoatFactor = 0.0; -#endif -#endif -#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE -vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS; -#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM -clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform); -#endif -float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g; -#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR -clearcoatRoughness *= u_clearcoatRoughnessFactor; -#endif -#else -#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR -float clearcoatRoughness = u_clearcoatRoughnessFactor; -#else -float clearcoatRoughness = 0.0; -#endif -#endif -material.clearcoatFactor = clearcoatFactor; -material.clearcoatRoughness = clearcoatRoughness; -#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE -material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC); +if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; +if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; +float distanceToCenter = length(gl_PointCoord - vec2(0.5)); +float maxDistance = max(0.0, 0.5 - v_pixelDistance); +float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); +float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); +vec4 color = mix(v_outlineColor, v_color, innerAlpha); +color.a *= wholeAlpha; +#if !defined(OPAQUE) && !defined(TRANSLUCENT) +if (color.a < 0.005) +{ +discard; +} #else -material.clearcoatNormal = attributes.normalEC; -#endif +#ifdef OPAQUE +if (color.a < 0.995) +{ +discard; } -#endif -#endif -void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature) +#else +if (color.a >= 0.995) { -#ifdef USE_ANISOTROPY -NormalInfo normalInfo = getNormalInfo(attributes); -material.normalEC = normalInfo.normal; -#elif defined(HAS_NORMALS) -material.normalEC = computeNormal(attributes); -#endif -vec4 baseColorWithAlpha = vec4(1.0); -#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) -vec4 color = attributes.color_0; -#ifdef HAS_SRGB_COLOR -color = czm_srgbToLinear(color); -#endif -baseColorWithAlpha *= color; -#endif -#ifdef USE_CPU_STYLING -baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend); +discard; +} #endif -material.baseColor = baseColorWithAlpha; -material.diffuse = baseColorWithAlpha.rgb; -material.alpha = baseColorWithAlpha.a; -#ifdef HAS_OCCLUSION_TEXTURE -vec2 occlusionTexCoords = TEXCOORD_OCCLUSION; -#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM -occlusionTexCoords = czm_computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform); #endif -material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r; +out_FragColor = czm_gammaCorrect(color); +czm_writeLogDepth(); +} +`;var N4=`uniform float u_maxTotalPointSize; +in vec4 positionHighAndSize; +in vec4 positionLowAndOutline; +in vec4 compressedAttribute0; +in vec4 compressedAttribute1; +in vec4 scaleByDistance; +in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; +out vec4 v_color; +out vec4 v_outlineColor; +out float v_innerPercent; +out float v_pixelDistance; +out vec4 v_pickColor; +out float v_splitDirection; +const float SHIFT_LEFT8 = 256.0; +const float SHIFT_RIGHT8 = 1.0 / 256.0; +void main() +{ +vec3 positionHigh = positionHighAndSize.xyz; +vec3 positionLow = positionLowAndOutline.xyz; +float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; +float totalSize = positionHighAndSize.w + outlineWidthBothSides; +float outlinePercent = outlineWidthBothSides / totalSize; +totalSize *= czm_pixelRatio; +float temp = compressedAttribute1.x * SHIFT_RIGHT8; +float show = floor(temp); +#ifdef EYE_DISTANCE_TRANSLUCENCY +vec4 translucencyByDistance; +translucencyByDistance.x = compressedAttribute1.z; +translucencyByDistance.z = compressedAttribute1.w; +translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; +temp = compressedAttribute1.y * SHIFT_RIGHT8; +translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif -#ifdef HAS_EMISSIVE_TEXTURE -material.emissive = getEmissiveFromTexture(); -#elif defined(HAS_EMISSIVE_FACTOR) -material.emissive = u_emissiveFactor; +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) +float lengthSq; +if (czm_sceneMode == czm_sceneMode2D) +{ +lengthSq = czm_eyeHeight2D.y; +} +else +{ +lengthSq = dot(positionEC.xyz, positionEC.xyz); +} #endif -#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS) -setSpecularGlossiness(material); -#elif defined(LIGHTING_PBR) -float metalness = setMetallicRoughness(material); -#ifdef USE_SPECULAR -setSpecular(material, metalness); +#ifdef EYE_DISTANCE_SCALING +totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); #endif -#ifdef USE_ANISOTROPY -setAnisotropy(material, normalInfo); +if (totalSize > 0.0) { +totalSize += 3.0; +} +totalSize = min(totalSize, u_maxTotalPointSize); +if (totalSize < 1.0) +{ +positionEC.xyz = vec3(0.0); +totalSize = 1.0; +} +float translucency = 1.0; +#ifdef EYE_DISTANCE_TRANSLUCENCY +translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); +if (translucency < 0.004) +{ +positionEC.xyz = vec3(0.0); +} #endif -#ifdef USE_CLEARCOAT -setClearcoat(material, attributes); +#ifdef DISTANCE_DISPLAY_CONDITION +float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; +float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; +if (lengthSq < nearSq || lengthSq > farSq) { +positionEC.xyz = vec3(0.0, 0.0, 1.0); +} #endif +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); +#ifdef DISABLE_DEPTH_DISTANCE +float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; +if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) +{ +disableDepthTestDistance = czm_minimumDisableDepthTestDistance; +} +if (disableDepthTestDistance != 0.0) +{ +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))) +{ +gl_Position.z = -gl_Position.w; +#ifdef LOG_DEPTH +czm_vertexLogDepth(vec4(czm_currentFrustum.x)); #endif } -`;var _z=`#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 yz=`#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); +v_color = color; +v_color.a *= translucency * show; +v_outlineColor = outlineColor; +v_outlineColor.a *= translucency * show; +v_innerPercent = 1.0 - outlinePercent; +v_pixelDistance = 2.0 / totalSize; +gl_PointSize = totalSize * show; +gl_Position *= show; +v_pickColor = pickColor; +v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -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); +`;var Smt=za.SHOW_INDEX,GQ=za.POSITION_INDEX,$xe=za.COLOR_INDEX,wmt=za.OUTLINE_COLOR_INDEX,Imt=za.OUTLINE_WIDTH_INDEX,Pmt=za.PIXEL_SIZE_INDEX,Jxe=za.SCALE_BY_DISTANCE_INDEX,Zxe=za.TRANSLUCENCY_BY_DISTANCE_INDEX,Qxe=za.DISTANCE_DISPLAY_CONDITION_INDEX,Dmt=za.DISABLE_DEPTH_DISTANCE_INDEX,Rmt=za.SPLIT_DIRECTION_INDEX,WQ=za.NUMBER_OF_PROPERTIES,ol={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Ld(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(WQ),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??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(Ld.prototype,{length:{get:function(){return qQ(this),this._pointPrimitives.length}}});function eTe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Ld.prototype.add=function(e){let t=new za(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Ld.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Ld.prototype.removeAll=function(){eTe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function qQ(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}}Ld.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Ld.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Ld.prototype.get=function(e){return qQ(this),this._pointPrimitives[e]};Ld.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<WQ;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function Omt(e,t,n){return new Ry(e,[{index:ol.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[GQ]},{index:ol.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[GQ]},{index:ol.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[$xe]},{index:ol.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Zxe]},{index:ol.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Jxe]},{index:ol.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Qxe]}],t)}var jQ=new Sn,L4=new z;function tTe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,jQ);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[ol.positionHighAndSize],u=jQ.high;c(r,u.x,u.y,u.z,s);let f=n[ol.positionLowAndOutline],d=jQ.low;f(r,d.x,d.y,d.z,a)}var Mmt=256;function nTe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;L4.red=o.alpha,L4.green=s.alpha,L4.blue=a.alpha;let c=n[ol.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(L4))}function iTe(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)*Mmt+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[ol.compressedAttribute1];g(r,d,p,o,a)}function rTe(e,t,n,i){let r=i._index,o=n[ol.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 oTe(e,t,n,i){let r=i._index,o=n[ol.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 Nmt(e,t,n,i){tTe(e,t,n,i),nTe(e,t,n,i),iTe(e,t,n,i),rTe(e,t,n,i),oTe(e,t,n,i)}function HQ(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):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function Lmt(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)&&HQ(e,i,i.length,t,o,!0)):n===re.MORPHING?HQ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&HQ(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function Fmt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var Bmt=[];Ld.prototype.update=function(e){if(qQ(this),!this.show)return;this._maxTotalPointSize=zt.maximumAliasedPointSize,Lmt(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<WQ;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Omt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,Nmt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=Bmt;v.length=0,(o[GQ]||o[Imt]||o[Pmt])&&v.push(tTe),(o[$xe]||o[wmt])&&v.push(nTe),(o[Smt]||o[Zxe])&&v.push(iTe),o[Jxe]&&v.push(rTe),(o[Qxe]||o[Dmt]||o[Rmt])&&v.push(oTe);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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=M.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),Fmt(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:nn.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:[N4]}),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:[Bx]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol}),y=new Xe({defines:["TRANSLUCENT"],sources:[Bx]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol})),this._blendOption===ki.OPAQUE&&(y=new Xe({sources:[Bx]}),this._sp=en.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol})),this._blendOption===ki.TRANSLUCENT&&(y=new Xe({sources:[Bx]}),this._spTranslucent=en.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol})),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)}}};Ld.prototype.isDestroyed=function(){return!1};Ld.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(),eTe(this._pointPrimitives),le(this)};var V1=Ld;var sTe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],YQ=1,j1=8,es=new Uint32Array(96),G1=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!==YQ)throw new Error(`Got v${r} data when expected v${YQ}.`);let o=sTe[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=sTe.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,j1,t),this.coords=new i(o,j1+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(j1+a+c+u);this.ids=new this.IndexArrayType(f,j1,t),this.coords=new i(f,j1+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(YQ<<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 KQ(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;es[0]=0,es[1]=o.length-1,es[2]=0;let c=3,u=[];for(;c>0;){let f=es[--c],d=es[--c],p=es[--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)&&(es[c++]=p,es[c++]=g-1,es[c++]=1-f),(f===0?i>=m:r>=y)&&(es[c++]=g+1,es[c++]=d,es[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;es[0]=0,es[1]=o.length-1,es[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=es[--c],p=es[--c],g=es[--c];if(p-g<=a){for(let b=g;b<=p;b++)aTe(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];aTe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(es[c++]=g,es[c++]=m-1,es[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(es[c++]=m+1,es[c++]=p,es[c++]=1-d)}return u}};function KQ(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;cTe(e,t,s,i,r,o),KQ(e,t,n,i,s-1,1-o),KQ(e,t,n,s+1,r,1-o)}function cTe(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));cTe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(H1(e,t,i,n),t[2*r+o]>s&&H1(e,t,i,r);a<c;){for(H1(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?H1(e,t,i,c):(c++,H1(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function H1(e,t,n,i){XQ(e,n,i),XQ(t,2*n,2*i),XQ(t,2*n+1,2*i+1)}function XQ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function aTe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function Yh(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 lTe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var kmt=new et;function uTe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=xx.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)),lTe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&dTe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=xx.getScreenSpaceBoundingBox(s,t,kmt);lTe(a,n),r=et.union(r,a,r)}return r}function Umt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&dTe(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 fTe(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 dTe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function $Q(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 zmt=new et,Vmt=new et,jmt=new et;function Hmt(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 hg({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new vd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new V1;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 Op(y,A),x=[];e._clusterLabels&&$Q(i,x,n,b,e),e._clusterBillboards&&$Q(r,x,n,b,e),e._clusterPoints&&$Q(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,D;if(x.length>0){let N=new G1(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(fTe(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=uTe(V,F.coord,u,e,zmt);let B=et.clone(S,Vmt);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=uTe(k,L.coord,u,e,jmt);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(fTe(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 Umt(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}}Yh.prototype._initialize=function(e){this._scene=e;let t=Hmt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Yh.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 ZQ(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 QQ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Yh.prototype.getLabel=ZQ("_labelCollection",hg,"_unusedLabelIndices","labelIndex");Yh.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,QQ(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};Yh.prototype.getBillboard=ZQ("_billboardCollection",vd,"_unusedBillboardIndices","billboardIndex");Yh.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,QQ(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};Yh.prototype.getPoint=ZQ("_pointCollection",V1,"_unusedPointIndices","pointIndex");Yh.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,QQ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function JQ(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Gmt(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,JQ(e._labelCollection),JQ(e._billboardCollection),JQ(e._pointCollection))}Yh.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,Gmt(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)};Yh.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 Fd=Yh;function eee(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 rc(this),this._entityCluster=new Fd}Object.defineProperties(eee.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){Fs.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}}});eee.prototype.update=function(e){return!0};var F4=eee;var hTe={};hTe.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 rS=hTe;var tee=new U,Wmt=new h,qmt=new h,Ymt=new h,Xmt=new h;function Rg(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"}Rg.packedLength=Be.packedLength+5;Rg.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 mTe=new Be,oS={vertexFormat:mTe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Rg.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,mTe);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):(oS.length=r,oS.topRadius=o,oS.bottomRadius=s,oS.slices=a,oS.offsetAttribute=c===-1?void 0:c,new Rg(oS))};Rg.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=rS.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=Wmt;C.z=Math.sin(_);let w=Math.cos(_),D=Ymt,N=qmt;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,Xmt);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})),tee.x=t*.5,tee.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(tee));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 nee;Rg.getUnitCylinder=function(){return l(nee)||(nee=Rg.createGeometry(new Rg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),nee};var B4=Rg;var iee=new U;function sS(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"}sS.packedLength=6;sS.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 kx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};sS.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):(kx.length=i,kx.topRadius=r,kx.bottomRadius=o,kx.slices=s,kx.numberOfVerticalLines=a,kx.offsetAttribute=c===-1?void 0:c,new sS(kx))};sS.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=rS.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}),iee.x=t*.5,iee.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(iee));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 k4=sS;var pTe=h.ZERO,gTe=new h,Kmt=new h,_Te=new z;function $mt(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 Tf(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new $mt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Tf.prototype=Object.create(Oi.prototype),Tf.prototype.constructor=Tf);Object.defineProperties(Tf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Tf.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=Kn.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,_Te)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,pTe,gTe))),new Bt({id:t,geometry:new B4(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Tf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,_Te),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,pTe,gTe))),new Bt({id:t,geometry:new k4(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};Tf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Tf.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)};Tf.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)};Tf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(tt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(tt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(tt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,tt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,tt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};Tf.prototype._onEntityPropertyChanged=G_;Tf.DynamicGeometryUpdater=aS;function aS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(aS.prototype=Object.create(Ri.prototype),aS.prototype.constructor=aS);aS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Kmt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ri.prototype._isHidden.call(this,e,t,n)};aS.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 U4=Tf;var yTe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(yTe);var Bs=yTe;var ATe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(ATe);var Hr=ATe;var bTe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(bTe);var Nu=bTe;var xTe=js(ef(),1);function Jmt(e){let t=new xTe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var eA=Jmt;var Zmt=P.factorial;function ree(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+=ree(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 Qmt=[],oee=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/Zmt(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=ree(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=Qmt,m=ept(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=ree(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 ept(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 z4=oee;var see=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}},V4=see;var aee=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}},Ux=aee;function sl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}sl.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new sl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};sl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new sl(e.clock,e.cone,e.magnitude)};sl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new sl(e.clock,e.cone,1)};sl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};sl.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};sl.prototype.equals=function(e){return sl.equals(this,e)};sl.prototype.clone=function(e){return sl.clone(this,e)};sl.prototype.equalsEpsilon=function(e,t){return sl.equalsEpsilon(this,e,t)};sl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var j4=sl;var tR=js(ef(),1);var cee;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?cee=function(){return performance.now()}:cee=function(){return Date.now()};var xn=cee;function lee(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??Bs.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??Hr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(lee.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Hr.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===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});lee.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Hr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Hr.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===Bs.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===Bs.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 Mp=lee;function zx(){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(zx.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:mu("startTime"),stopTime:mu("stopTime"),currentTime:mu("currentTime"),clockRange:mu("clockRange"),clockStep:mu("clockStep"),multiplier:mu("multiplier")});zx.prototype.clone=function(e){return l(e)||(e=new zx),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};zx.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};zx.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};zx.prototype.getValue=function(e){return l(e)||(e=new Mp),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 Np=zx;var tpt=z.WHITE,npt=.1,ipt=new U(8,8),rpt=new U(0,0),opt=new U(1,1);function cS(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(cS.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")});cS.prototype.getType=function(e){return"Grid"};var spt=new K;cS.prototype.getValue=function(e,t){return l(e)||(e=K.now(spt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,tpt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,npt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,ipt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,opt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,rpt,t.lineOffset),t};cS.prototype.equals=function(e){return this===e||e instanceof cS&&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 W1=cS;var TTe={WHOLE:0,PORTIONS:1};Object.freeze(TTe);var Og=TTe;function lS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(lS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});lS.prototype.getType=function(e){return"PolylineArrow"};var apt=new K;lS.prototype.getValue=function(e,t){return l(e)||(e=K.now(apt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};lS.prototype.equals=function(e){return this===e||e instanceof lS&&X.equals(this._color,e._color)};var q1=lS;var cpt=z.WHITE,lpt=z.TRANSPARENT,upt=16,fpt=255;function uS(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(uS.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")});uS.prototype.getType=function(e){return"PolylineDash"};var dpt=new K;uS.prototype.getValue=function(e,t){return l(e)||(e=K.now(dpt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,cpt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,lpt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,upt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,fpt,t.dashPattern),t};uS.prototype.equals=function(e){return this===e||e instanceof uS&&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 Y1=uS;var hpt=z.WHITE,mpt=.25,ppt=1;function fS(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(fS.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")});fS.prototype.getType=function(e){return"PolylineGlow"};var gpt=new K;fS.prototype.getValue=function(e,t){return l(e)||(e=K.now(gpt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,hpt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,mpt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,ppt,t.taperPower),t};fS.prototype.equals=function(e){return this===e||e instanceof fS&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var X1=fS;var _pt=z.WHITE,ypt=z.BLACK,Apt=1;function dS(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(dS.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")});dS.prototype.getType=function(e){return"PolylineOutline"};var bpt=new K;dS.prototype.getValue=function(e,t){return l(e)||(e=K.now(bpt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,_pt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,ypt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,Apt),t};dS.prototype.equals=function(e){return this===e||e instanceof dS&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var Vx=dS;function Mg(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Zo,this._referenceFrame=t??Wi.FIXED,this.setValue(e)}Object.defineProperties(Mg.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 xpt=new K;Mg.prototype.getValue=function(e,t){return l(e)||(e=K.now(xpt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Mg.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};Mg.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,Mg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Mg.prototype.equals=function(e){return this===e||e instanceof Mg&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};Mg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var tA=Mg;function nA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Zo,this.setValue(e)}Object.defineProperties(nA.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 Tpt=new K;nA.prototype.getValue=function(e,t){l(e)||(e=K.now(Tpt));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};nA.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,nA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};nA.prototype.equals=function(e){return this===e||e instanceof nA&&X.arrayEquals(this._value,e._value)};nA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var K1=nA;function ETe(e,t,n){let i=new WeakRef(t),r=e.addEventListener(function(){let o=i.deref();l(o)?n.apply(o,arguments):r()});return r}function jx(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}e._removeTargetListener=ETe(n.definitionChanged,e,Bd.prototype._onTargetEntityDefinitionChanged),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 Bd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,this._removeTargetListener=void 0,ETe(e.collectionChanged,this,Bd.prototype._onCollectionChanged)}Object.defineProperties(Bd.prototype,{isConstant:{get:function(){return X.isConstant(jx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=jx(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 jx(this)}}});Bd.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 Bd(e,n,i)};var Ept=new K;Bd.prototype.getValue=function(e,t){let n=jx(this);return l(e)||(e=K.now(Ept)),l(n)?n.getValue(e,t):void 0};Bd.prototype.getValueInReferenceFrame=function(e,t,n){let i=jx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Bd.prototype.getType=function(e){let t=jx(this);return l(t)?t.getType(e):void 0};Bd.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};Bd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Bd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=jx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var iA=Bd;var Cpt={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}},Xh=Cpt;var CTe={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 vTe(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 STe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var uee=[],fee=[];function H4(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=STe(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=STe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(uee[p++]=f,o=o+1,s=0;s<r;s++)fee[g++]=i[o],o=o+1;a=f}p>0&&(fee.length=g,vTe(n,u,fee),uee.length=p,vTe(t,c,uee))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function kd(e,t){let n=e;n===Number&&(n=CTe);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=CTe);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=Ux,this._lastInterpolationAlgorithm=Ux,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=Nu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Nu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(kd.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 vpt=new K;kd.prototype.getValue=function(e,t){l(e)||(e=K.now(vpt));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===Nu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===Nu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===Nu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Nu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===Nu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===Nu.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)};kd.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))};kd.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)}H4(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};kd.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)}H4(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};kd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};kd.prototype.addSamplesPackedArray=function(e,t){H4(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};kd.prototype.removeSample=function(e){let t=Pr(this._times,e,K.compare);return t<0?!1:(wTe(this,t,1),!0)};function wTe(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)}kd.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,wTe(this,n,i-n)};kd.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};kd._mergeNewSamples=H4;var Ud=kd;function zd(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 Ud(h,n),this._definitionChanged=new be,this._referenceFrame=e??Wi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(zd.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 Spt=new K;zd.prototype.getValue=function(e,t){return l(e)||(e=K.now(Spt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};zd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Zm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};zd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};zd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};zd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};zd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};zd.prototype.removeSample=function(e){return this._property.removeSample(e)};zd.prototype.removeSamples=function(e){this._property.removeSamples(e)};zd.prototype.equals=function(e){return this===e||e instanceof zd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Tc=zd;var ITe={HORIZONTAL:0,VERTICAL:1};Object.freeze(ITe);var Lp=ITe;var wpt=Lp.HORIZONTAL,Ipt=z.WHITE,Ppt=z.BLACK,Dpt=0,Rpt=1;function hS(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(hS.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")});hS.prototype.getType=function(e){return"Stripe"};var Opt=new K;hS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Opt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,wpt)===Lp.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,Ipt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,Ppt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,Dpt),t.repeat=X.getValueOrDefault(this._repeat,e,Rpt),t};hS.prototype.equals=function(e){return this===e||e instanceof hS&&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 $1=hS;function rA(e){this._definitionChanged=new be,this._intervals=new Ls,this._intervals.changedEvent.addEventListener(rA.prototype._intervalsChanged,this),this._referenceFrame=e??Wi.FIXED}Object.defineProperties(rA.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 Mpt=new K;rA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Mpt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};rA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Zm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};rA.prototype.equals=function(e){return this===e||e instanceof rA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};rA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var oA=rA;function Hx(){this._definitionChanged=new be,this._intervals=new Ls,this._intervals.changedEvent.addEventListener(Hx.prototype._intervalsChanged,this)}Object.defineProperties(Hx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Npt=new K;Hx.prototype.getValue=function(e,t){l(e)||(e=K.now(Npt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};Hx.prototype.equals=function(e){return this===e||e instanceof Hx&&this._intervals.equals(e._intervals,X.equals)};Hx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var sA=Hx;function mS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(mS.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 Lpt=new h,PTe=new h,DTe=new K,Fpt=new K,dee=1/60;mS.prototype.getValue=function(e,t){return this._getValue(e,t)};mS.prototype._getValue=function(e,t,n){l(e)||(e=K.now(Fpt)),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,Lpt),o=i.getValue(K.addSeconds(e,dee,DTe),PTe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-dee,DTe),PTe),!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,dee,t)};mS.prototype.equals=function(e){return this===e||e instanceof mS&&X.equals(this._position,e._position)};var aA=mS;function J1(e,t){this._velocityVectorProperty=new aA(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(J1.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 RTe=new h,Bpt=new h,OTe=new $,kpt=new K;J1.prototype.getValue=function(e,t){l(e)||(e=K.now(kpt));let n=this._velocityVectorProperty._getValue(e,Bpt,RTe);if(l(n))return At.rotationMatrixFromPositionVelocity(RTe,n,this._ellipsoid,OTe),Le.fromRotationMatrix(OTe,t)};J1.prototype.equals=function(e){return this===e||e instanceof J1&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var G4=J1;var Ng={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Ng.validate=function(e){return e===Ng.COMPLETE||e===Ng.BELOW_ELLIPSOID_HORIZON||e===Ng.ABOVE_ELLIPSOID_HORIZON};Ng.toString=function(e){switch(e){case Ng.COMPLETE:return"COMPLETE";case Ng.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Ng.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var Z1=Ng;function cA(){}cA.packedLength=h.packedLength;cA.unpack=h.unpack;cA.pack=h.pack;var hee;function Q1(e,t){return t[0]==="#"&&(t=hee+t),iA.fromString(e,t)}function MTe(e,t,n){if(l(n.reference))return Q1(t,n.reference);if(l(n.velocityReference)){let i=Q1(t,n.velocityReference);switch(e){case h:case cA:return new aA(i,e===cA);case Le:return new G4(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function Upt(e,t){return new np(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var fr=new h,Gl=new j4,al=new he,Gx=new Cn,W4=new Le;function zpt(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 NTe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function Vpt(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 jpt(e){let t=e.length;if(Gl.magnitude=1,t===2)return Gl.clock=e[0],Gl.cone=e[1],h.fromSpherical(Gl,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],Gl.clock=e[i+1],Gl.cone=e[i+2],h.fromSpherical(Gl,fr),n[r+1]=fr.x,n[r+2]=fr.y,n[r+3]=fr.z;return n}function Hpt(e){let t=e.length;if(t===3)return Gl.clock=e[0],Gl.cone=e[1],Gl.magnitude=e[2],h.fromSpherical(Gl,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Gl.clock=e[i+1],Gl.cone=e[i+2],Gl.magnitude=e[i+3],h.fromSpherical(Gl,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function Gpt(e){let t=e.length;if(t===3)return al.longitude=e[0],al.latitude=e[1],al.height=e[2],ee.default.cartographicToCartesian(al,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],al.longitude=e[i+1],al.latitude=e[i+2],al.height=e[i+3],ee.default.cartographicToCartesian(al,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function Wpt(e){let t=e.length;if(t===3)return al.longitude=P.toRadians(e[0]),al.latitude=P.toRadians(e[1]),al.height=e[2],ee.default.cartographicToCartesian(al,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],al.longitude=P.toRadians(e[i+1]),al.latitude=P.toRadians(e[i+2]),al.height=e[i+3],ee.default.cartographicToCartesian(al,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function mee(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 jpt(r);let o=e.spherical;if(l(o))return Hpt(o);let s=e.cartographicRadians;if(l(s))return Gpt(s);let a=e.cartographicDegrees;if(l(a))return Wpt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function LTe(e,t){h.unpack(e,t,fr),h.normalize(fr,fr),h.pack(fr,e,t)}function qpt(e){let t=mee(e);if(t.length===3)return LTe(t,0),t;for(let n=1;n<t.length;n+=4)LTe(t,n);return t}function FTe(e,t){Le.unpack(e,t,W4),Le.normalize(W4,W4),Le.pack(W4,e,t)}function Ypt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return FTe(t,0),t;for(let n=1;n<t.length;n+=5)FTe(t,n)}return t}function BTe(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")?cA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?Qn:e.hasOwnProperty("colorBlendMode")?Rl:e.hasOwnProperty("cornerType")?ur:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?Hi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?Io: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")?Og:e.hasOwnProperty("shadowMode")?Dn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Lp:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?tR.default:e.hasOwnProperty("verticalOrigin")?Wn:Object}function Xpt(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 mee(t);case cA:return qpt(t);case z:return zpt(t);case Qn:return Qn[t.classificationType??t];case Rl:return Rl[t.colorBlendMode??t];case ur:return ur[t.cornerType??t];case We:return We[t.heightReference??t];case Hi:return Hi[t.horizontalOrigin??t];case Image:return NTe(t,n);case K:return K.fromIso8601(t.date??t);case Io:return Io[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 Og:return Og[t.pathMode??t];case Le:return Ypt(t);case Xh:return t.number??t;case Z1:return Z1[t.portionToDisplay??t];case Dn:return Dn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Lp:return Lp[t.stripeOrientation??t];case ie:return Vpt(t);case tR.default:return NTe(t,n);case Wn:return Wn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var Kpt={HERMITE:z4,LAGRANGE:V4,LINEAR:Ux};function q4(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Kpt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Nu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Nu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var kTe={iso8601:void 0};function zo(e){if(l(e))return kTe.iso8601=e,Cn.fromIso8601(kTe)}function pee(e){let t=tt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function UTe(e){let t=new Vl;return t.intervals.addInterval(pee(e)),t}function zTe(e){let t=new xc(e.referenceFrame);return t.intervals.addInterval(pee(e)),t}function Y4(e,t,n,i,r,o,s){let a=zo(i.interval);l(r)&&(l(a)?a=Cn.intersect(a,r,Gx):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(tt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return JTe(t[n],a)}let g=!1;if(d){if(u=Xpt(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!==Xh;if(!g&&!p){d?t[n]=new fi(m?e.unpack(u,0):u):t[n]=MTe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Ud||(t[n]=y=new Ud(e)),y.addSamplesPackedArray(u,A),q4(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=MTe(e,s,i),l(y)||(t[n]=y=d?new sA:new Vl),d&&y instanceof sA?y.intervals.addInterval(a):y instanceof Vl?(d&&(a.data=new fi(a.data)),y.intervals.addInterval(a)):(t[n]=y=UTe(y),d&&(a.data=new fi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Vl),y instanceof Vl||(t[n]=y=UTe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof Ud))&&(x=a.clone(),x.data=new Ud(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),q4(i,x.data)}function JTe(e,t){if(e instanceof Ud){e.removeSamples(t);return}else if(e instanceof sA){e.intervals.removeInterval(t);return}else if(e instanceof Vl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,Gx);r.isEmpty||JTe(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)Y4(e,t,n,i[a],r,o,s);else Y4(e,t,n,i,r,o,s)}function VTe(e,t,n,i,r,o){let s=zo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,Gx):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(tt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return ZTe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Wi[n.referenceFrame]),g=g??Wi.FIXED,u=mee(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new hu(h.unpack(u),g):e[t]=Q1(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof Tc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new Tc(g,a)),y.addSamplesPackedArray(u,A),q4(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=Q1(o,n.reference),l(y)||(d?y=new oA(g):y=new xc(g),e[t]=y),d&&y instanceof oA&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof xc?(d&&(s.data=new hu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=zTe(y),d&&(s.data=new hu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof xc||(e[t]=y=zTe(y)):e[t]=y=new xc(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Tc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new Tc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),q4(n,x.data)}function ZTe(e,t){if(e instanceof Tc){e.removeSamples(t);return}else if(e instanceof oA){e.intervals.removeInterval(t);return}else if(e instanceof xc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,Gx);r.isEmpty||ZTe(r.data,t)}n.removeInterval(t);return}}function QTe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)VTe(e,t,n[s],i,r,o);else VTe(e,t,n,i,r,o)}function jTe(e,t,n,i){l(n.references)?X4(e,t,n.references,n.interval,i,K1,Vl):(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 HTe(e,t,n,i,r,o){let s=zo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,Gx):s=i);let a=e[t],c,u;if(l(s)){a instanceof F1||(a=new F1,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 W1||(c=new W1),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 Nb||(c=new Nb),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 $1||(c=new $1),f=n.stripe,Ee(Lp,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 Vx||(c=new Vx),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 X1||(c=new X1),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 q1||(c=new q1),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof Y1||(c=new Y1),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 O1||(c=new O1),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 Ef(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)HTe(e,t,n[s],i,r,o);else HTe(e,t,n,i,r,o)}function $pt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function Jpt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function Zpt(e,t,n,i){let r=t.position;l(r)&&QTe(e,"position",r,void 0,i,n)}function Qpt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function e0t(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function t0t(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)Y4(BTe(s[a]),e.properties,o,s[a],void 0,i,n);else Y4(BTe(s),e.properties,o,s,void 0,i,n)}}}function X4(e,t,n,i,r,o,s){let a=n.map(function(c){return Q1(r,c)});if(l(i)){i=zo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(pee(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function GTe(e,t,n,i){let r=n.references;l(r)?X4(e,t,r,n.interval,i,K1,Vl):Ee(Array,e,t,n,void 0,void 0,i)}function WTe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)GTe(e,t,n[r],i);else GTe(e,t,n,i)}function qTe(e,t,n,i){let r=n.references;l(r)?X4(e,t,r,n.interval,i,tA,xc):(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 nR(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)qTe(e,t,n[r],i);else qTe(e,t,n,i)}function n0t(e){return h.unpackArray(e)}function i0t(e){return h.fromRadiansArrayHeights(e,ee.default)}function r0t(e){return h.fromDegreesArrayHeights(e,ee.default)}function YTe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return X4(a,"positions",s,n.interval,i,tA,xc),a.positions});e[t]=new tA(o)}else l(n.cartesian)?n.array=n.cartesian.map(n0t):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(i0t):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(r0t)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function o0t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)YTe(e,t,n[r],i);else YTe(e,t,n,i)}function s0t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)jTe(e,t,n[r],i);else jTe(e,t,n,i)}function a0t(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 Ls),o.addInterval(zo(r[s]));else o=new Ls,o.addInterval(zo(r));e.availability=o}function c0t(e,t,n,i,r){l(t)&&Ee(cA,e,"alignedAxis",t,n,i,r)}function l0t(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 bl),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(Wn,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(Xh,s,"rotation",r.rotation,o,i,n),c0t(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 u0t(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 nC),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),Ef(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 f0t(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 rC),Ee(Boolean,s,"show",r.show,o,i,n),nR(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(ur,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),Ef(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(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function d0t(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 oC),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),Ef(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 h0t(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 m0t(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 sC),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(Xh,s,"rotation",r.rotation,o,i,n),Ee(Xh,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),Ef(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(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function p0t(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 aC),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),Ef(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 g0t(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 Qm),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(Io,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(Wn,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 _0t(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 V_),Ee(Boolean,s,"show",r.show,o,i,n),Ee(tR.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(Rl,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)XTe(s,u[a],o,i,n);else XTe(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)KTe(s,f[a],o,i,n);else KTe(s,f,o,i,n)}function XTe(e,t,n,i,r){let o=zo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,Gx):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 cC),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 KTe(e,t,n,i,r){let o=zo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,Gx):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 y0t(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 j_),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),Ef(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(Og,s,"materialMode",r.materialMode,o,i,n)}function A0t(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 uC),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 eR(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(eR.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}}});eR.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 Hc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Hc(n,i)};eR.prototype.equals=function(e){return this===e||e instanceof eR&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function b0t(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),nR(s,"_positions",r.positions,n),o0t(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new eR(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(Xh,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),Ef(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(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function x0t(e){return e?ln.GEODESIC:ln.NONE}function T0t(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 Il),Ee(Boolean,s,"show",r.show,o,i,n),nR(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ef(s,"material",r.material,o,i,n),Ef(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(Qn,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=Upt(a.followSurface,x0t)}}function E0t(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 fC),nR(s,"positions",r.positions,n),s0t(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ur,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Ef(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 C0t(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 tp),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(Xh,s,"rotation",r.rotation,o,i,n),Ee(Xh,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),Ef(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(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function v0t(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 lC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(tR.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function S0t(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 H_),Ee(Boolean,s,"show",r.show,o,i,n),nR(s,"positions",r.positions,n),WTe(s,"minimumHeights",r.minimumHeights,n),WTe(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Ef(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 $Te(e,t,n,i,r){let o=e.id;if(l(o)||(o=$n()),hee=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")h0t(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)}hee=void 0}function w0t(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(tt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Np,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=Bs.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Np,t.startTime=tt.MINIMUM_VALUE.clone(),t.stopTime=tt.MAXIMUM_VALUE.clone(),t.currentTime=tt.MINIMUM_VALUE.clone(),t.clockRange=Bs.LOOP_STOP,t.clockStep=Hr.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=Bs[n.range]??Bs.LOOP_STOP),l(n.step)&&(t.clockStep=Hr[n.step]??Hr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function eEe(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),Fs.setLoading(e,!0),Promise.resolve(r).then(function(a){return I0t(e,a,o,i)}).catch(function(a){return Fs.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function I0t(e,t,n,i){Fs.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new tEe,r.removeAll()),Js._processCzml(t,r,n,void 0,e);let o=w0t(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=eA(n.getUrlComponent()),o=!0),Fs.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function tEe(){this.name=void 0,this.clock=void 0}function Js(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 tEe,this._version=void 0,this._entityCollection=new rc(this),this._entityCluster=new Fd,this._credit=void 0,this._resourceCredits=[]}Js.load=function(e,t){return new Js().load(e,t)};Object.defineProperties(Js.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}}});Js.updaters=[l0t,u0t,f0t,d0t,m0t,p0t,g0t,_0t,$pt,Jpt,y0t,A0t,b0t,T0t,E0t,t0t,C0t,Zpt,v0t,Qpt,S0t,e0t,a0t];Js.registerUpdater=function(e){Js.updaters.includes(e)||Js.updaters.push(e)};Js.unregisterUpdater=function(e){if(Js.updaters.includes(e)){let t=Js.updaters.indexOf(e);Js.updaters.splice(t,1)}};Js.prototype.process=function(e,t){return eEe(this,e,t,!1)};Js.prototype.load=function(e,t){return eEe(this,e,t,!0)};Js.prototype.update=function(e){return!0};Js.processPacketData=Ee;Js.processPositionPacketData=QTe;Js.processMaterialPacketData=Ef;Js._processCzml=function(e,t,n,i,r){if(i=i??Js.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)$Te(e[o],t,i,n,r);else $Te(e,t,i,n,r)};var K4=Js;function Wl(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(Wl.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}}});Wl.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})};Wl.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};Wl.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=[]};Wl.prototype.contains=function(e){return this.indexOf(e)!==-1};Wl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Wl.prototype.get=function(e){return this._dataSources[e]};Wl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function $4(e,t){return e.indexOf(t)}function nEe(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)}Wl.prototype.raise=function(e){let t=$4(this._dataSources,e);nEe(this,t,t+1)};Wl.prototype.lower=function(e){let t=$4(this._dataSources,e);nEe(this,t,t-1)};Wl.prototype.raiseToTop=function(e){let t=$4(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))};Wl.prototype.lowerToBottom=function(e){let t=$4(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Wl.prototype.isDestroyed=function(){return!1};Wl.prototype.destroy=function(){return this.removeAll(!0),le(this)};var J4=Wl;function sc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=$n(),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(sc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});sc.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};sc.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};sc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};sc.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=[]};sc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function Z4(e,t){return e._primitives.indexOf(t)}sc.prototype.raise=function(e){if(l(e)){let t=Z4(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};sc.prototype.raiseToTop=function(e){if(l(e)){let t=Z4(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};sc.prototype.lower=function(e){if(l(e)){let t=Z4(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};sc.prototype.lowerToBottom=function(e){if(l(e)){let t=Z4(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};sc.prototype.get=function(e){return this._primitives[e]};sc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};sc.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)}};sc.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)}};sc.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)}};sc.prototype.isDestroyed=function(){return!1};sc.prototype.destroy=function(){return this.removeAll(),le(this)};var ql=sc;function Fp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Fp.prototype,{length:{get:function(){return this._length}}});Fp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new ql({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};Fp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Fp.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};Fp.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};Fp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Fp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Fp.prototype.isDestroyed=function(){return!1};Fp.prototype.destroy=function(){return this.removeAll(),le(this)};var Q4=Fp;function pS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new kt}pS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};pS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};pS.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};pS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};pS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var gS=pS;var _ee={},e8=new h,iEe=new h,rEe=new Le,oEe=new $;function _S(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),e8),h.multiplyByScalar(n,Math.sin(f),iEe),h.add(e8,iEe,e8);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(e8,m,rEe),$.fromQuaternion(rEe,oEe),$.multiplyByVector(oEe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var sEe=new h,aEe=new h,gee=new h,P0t=new h;_ee.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,sEe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,aEe),y=i.geodeticSurfaceNormal(g,P0t),A=h.multiplyByScalar(y,r,gee);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 D0t=new h,R0t=new h,O0t=new h;_ee.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,D0t),g=h.cross(h.UNIT_Z,s,R0t);g=h.normalize(g,g);let m=h.cross(p,g,O0t),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=sEe,S=aEe,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=_S(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=_S(b,o,m,g,c,f,u,d,p,v),S=_S(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,gee),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=_S(-b,o,m,g,c,f,u,d,p,v),S=_S(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,gee),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=_S(-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 Cf=_ee;var yS=new h,yee=new h,Aee=new h,cEe=new h,ya=new U,lEe=new $,M0t=new $,bee=new Le,uEe=new h,fEe=new h,dEe=new h,i8=new he,hEe=new h,mEe=new U,pEe=new U;function gEe(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=uEe,x=fEe,T=dEe,E=new ji(a),v=E.project(a.cartesianToCartographic(r,i8),hEe),S=a.scaleToGeodeticSurface(r,yS);a.geodeticSurfaceNormal(S,S);let I=lEe,R=M0t;if(c!==0){let N=Le.fromAxisAngle(S,c,bee);I=$.fromQuaternion(N,I),N=Le.fromAxisAngle(S,-c,bee),R=$.fromQuaternion(N,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,mEe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pEe),_=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,yS);if(i.st){let j=$.multiplyByVector(I,B,yee),k=E.project(a.cartesianToCartographic(j,i8),Aee);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[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=Cf.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 _Ee(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 Wx=new h;function N0t(e){let t=e.center;Wx=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Wx),e.height,Wx),Wx=h.add(t,Wx,Wx);let n=new ue(Wx,e.semiMajorAxis),i=Cf.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=gEe(r,e,!1),a=_Ee(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function L0t(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=uEe,E=fEe,v=dEe,S=new ji(s),I=S.project(s.cartesianToCartographic(i,i8),hEe),R=s.scaleToGeodeticSurface(i,yS);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,bee),L=$.fromQuaternion(O,lEe),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,mEe),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pEe),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,yS),k;if(n.st){let q=$.multiplyByVector(L,j,yee),Q=S.project(s.cartesianToCartographic(q,i8),Aee);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+D]=ya.x,p[x+1+D]=ya.y,p[x++]=ya.x,p[x++]=ya.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,yee),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,cEe);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,cEe);h.subtract(q,j,q);let Q=h.subtract(k,j,Aee);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 F0t(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 t8=new ue,n8=new ue;function B0t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,yS),e.height,yS);t8.center=h.add(t,r,t8.center),t8.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),n8.center=h.add(t,r,n8.center),n8.radius=i;let o=Cf.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(t8,n8),f=gEe(s,e,!0),d=_Ee(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=L0t(c,e);d=F0t(c);let b=je.createTypedArray(c.length*2/3,d),x=new wt({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=qn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function yEe(e,t,n,i,r,o,s){let c=Cf.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 kp(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}kp.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;kp.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 AEe=new h,bEe=new ee,xEe=new Be,Bp={center:AEe,ellipsoid:bEe,vertexFormat:xEe,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};kp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,AEe);t+=h.packedLength;let r=ee.unpack(e,t,bEe);t+=ee.packedLength;let o=Be.unpack(e,t,xEe);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):(Bp.height=f,Bp.extrudedHeight=p,Bp.granularity=d,Bp.stRotation=u,Bp.rotation=c,Bp.semiMajorAxis=s,Bp.semiMinorAxis=a,Bp.shadowVolume=g,Bp.offsetAttribute=m===-1?void 0:m,new kp(Bp))};kp.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 yEe(n,r,o,a,s,i,t)};kp.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=B0t(r);else if(o=N0t(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})};kp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new kp({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 k0t(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Cf.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(kp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=yEe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=k0t(this)),this._textureCoordinateRotationPoints}}});var Lu=kp;var TEe=new h,qx=new h;function U0t(e){let t=e.center;qx=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,qx),e.height,qx),qx=h.add(t,qx,qx);let n=new ue(qx,e.semiMajorAxis),i=Cf.computeEllipsePositions(e,!1,!0).outerPositions,r=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Cf.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 r8=new ue,o8=new ue;function z0t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,TEe),e.height,TEe);r8.center=h.add(t,r,r8.center),r8.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),o8.center=h.add(t,r,o8.center),o8.radius=i;let o=Cf.computeEllipsePositions(e,!1,!0).outerPositions,s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Cf.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(r8,o8),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 AS(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"}AS.packedLength=h.packedLength+ee.packedLength+8;AS.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 EEe=new h,CEe=new ee,Lg={center:EEe,ellipsoid:CEe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};AS.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,EEe);t+=h.packedLength;let r=ee.unpack(e,t,CEe);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):(Lg.height=c,Lg.extrudedHeight=f,Lg.granularity=u,Lg.rotation=a,Lg.semiMajorAxis=o,Lg.semiMinorAxis=s,Lg.numberOfVerticalLines=d,Lg.offsetAttribute=p===-1?void 0:p,new AS(Lg))};AS.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=z0t(r);else if(o=U0t(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 Vd=AS;var vEe=new z,SEe=h.ZERO,wEe=new h,IEe=new ie;function V0t(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 Kh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new V0t(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Kh.prototype=Object.create(oi.prototype),Kh.prototype.constructor=Kh);Kh.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:Kn.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,vEe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,SEe,wEe))),new Bt({id:t,geometry:new Lu(this._options),attributes:i})};Kh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,vEe),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,SEe,wEe))),new Bt({id:t,geometry:new Vd(this._options),attributes:o})};Kh.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Kh.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)};Kh.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)};Kh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,tt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(tt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(tt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(tt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,tt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,tt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,tt.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(Lu.computeRectangle(s,IEe)).minimumTerrainHeight),s.extrudedHeight=r};Kh.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.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||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.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(Lu.computeRectangle(i,IEe)).minimumTerrainHeight),i.extrudedHeight=s};var s8=Kh;var j0t=new h,H0t=new h,G0t=new h,W0t=new h,q0t=new h,Y0t=new h(1,1,1),PEe=Math.cos,DEe=Math.sin;function Fg(e){e=e??H.EMPTY_OBJECT;let t=e.radii??Y0t,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"}Fg.packedLength=2*h.packedLength+Be.packedLength+7;Fg.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 REe=new h,OEe=new h,MEe=new Be,lA={radii:REe,innerRadii:OEe,vertexFormat:MEe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Fg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,REe);t+=h.packedLength;let r=h.unpack(e,t,OEe);t+=h.packedLength;let o=Be.unpack(e,t,MEe);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):(lA.minimumClock=s,lA.maximumClock=a,lA.minimumCone=c,lA.maximumCone=u,lA.stackPartitions=f,lA.slicePartitions=d,lA.offsetAttribute=p===-1?void 0:p,new Fg(lA))};Fg.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]=DEe(g[f]),j[f]=PEe(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=PEe(m[d]),k[d]=DEe(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,j0t),Ye=ve.geodeticSurfaceNormal(He,H0t);if(L[f]&&h.negate(Ye,Ye),a.st){let Ke=U.negate(Ye,q0t);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=G0t,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,W0t);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:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var xee;Fg.getUnitEllipsoid=function(){return l(xee)||(xee=Fg.createGeometry(new Fg({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),xee};var ac=Fg;var X0t=new Kt(z.WHITE),Tee=h.ZERO,Eee=new h,K0t=new h,$0t=new h,Cee=new z,J0t=new h(1,1,1);function Z0t(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 vf(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new Z0t(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(vf.prototype=Object.create(Oi.prototype),vf.prototype.constructor=vf);Object.defineProperties(vf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});vf.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=Kn.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,Cee)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Tee,Eee))),new Bt({id:i,geometry:new ac(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};vf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Cee),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:Kn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Tee,Eee))),new Bt({id:i,geometry:new Od(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};vf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};vf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Oi.prototype._isHidden.call(this,e,t)};vf.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)};vf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(tt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,tt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,tt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,tt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,tt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,tt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,tt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,tt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};vf.prototype._onEntityPropertyChanged=G_;vf.DynamicGeometryUpdater=iR;function iR(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)&&(iR.prototype=Object.create(Ri.prototype),iR.prototype.constructor=iR);iR.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,K0t),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,Cee),c=Co.getValue(e,n.material??X0t,this._material),u=X.getValueOrUndefined(n.innerRadii,e,$0t),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,Tee,Eee);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?J0t: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 Cr({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 Mn({geometryInstances:D,appearance:w,asynchronous:!1,shadows:I}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new Mn({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)),Ht.equals(O,this._lastDistanceDisplayCondition)||(D.distanceDisplayCondition=Kn.toValue(O,D.distanceDisplayCondition),N.distanceDisplayCondition=Kn.toValue(O,N.distanceDisplayCondition),Ht.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(D.offset=Er.toValue(L,D.offset),N.offset=Er.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 a8=vf;function xS(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}xS.packedLength=Be.packedLength;xS.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var NEe=new Be,Q0t={vertexFormat:NEe};xS.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,NEe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new xS(Q0t)};var c8=new h(-.5,-.5,0),l8=new h(.5,.5,0);xS.createGeometry=function(e){let t=e._vertexFormat,n=new En,i,r;if(t.position){if(r=new Float64Array(12),r[0]=c8.x,r[1]=c8.y,r[2]=0,r[3]=l8.x,r[4]=c8.y,r[5]=0,r[6]=l8.x,r[7]=l8.y,r[8]=0,r[9]=c8.x,r[10]=l8.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 ue(h.ZERO,Math.sqrt(2))})};var u8=xS;function TS(){this._workerName="createPlaneOutlineGeometry"}TS.packedLength=0;TS.pack=function(e,t){return t};TS.unpack=function(e,t,n){return l(n)?n:new TS};var uA=new h(-.5,-.5,0),f8=new h(.5,.5,0);TS.createGeometry=function(){let e=new En,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=uA.x,n[1]=uA.y,n[2]=uA.z,n[3]=f8.x,n[4]=uA.y,n[5]=uA.z,n[6]=f8.x,n[7]=f8.y,n[8]=uA.z,n[9]=uA.x,n[10]=f8.y,n[11]=uA.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 ue(h.ZERO,Math.sqrt(2))})};var d8=TS;var egt=new h,LEe=new z;function tgt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function jd(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new tgt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(jd.prototype=Object.create(Oi.prototype),jd.prototype.constructor=jd);jd.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=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,LEe)),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=vee(d,p,f,f),new Bt({id:t,geometry:new u8(this._options),modelMatrix:f,attributes:i})};jd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,LEe),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=vee(c,u,a,a),new Bt({id:t,geometry:new d8,modelMatrix:a,attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r)}})};jd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Oi.prototype._isHidden.call(this,e,t)};jd.prototype._getIsClosed=function(e){return!1};jd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};jd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(tt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(tt.MINIMUM_VALUE,i.dimensions)};jd.DynamicGeometryUpdater=ES;function ES(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(ES.prototype=Object.create(Ri.prototype),ES.prototype.constructor=ES);ES.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,egt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ri.prototype._isHidden.call(this,e,t,n)};ES.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 ngt=new h,igt=new h,rgt=new h,ogt=new h,sgt=new $,agt=new $,cgt=new M;function vee(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,rgt),a=h.clone(h.UNIT_Z,igt);P.equalsEpsilon(Math.abs(h.dot(a,r)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,ngt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=sgt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,ogt),d=$.multiplyByScale(u,f,agt),p=M.fromRotationTranslation(d,s,cgt);return M.multiplyTransformation(n,p,i)}jd.createPrimitiveMatrix=vee;var h8=jd;var lgt=new h,ugt=new et,fgt=new U,dgt=new U,hgt=new h,mgt=new h,pgt=new h,rR=new h,ggt=new h,_gt=new h,FEe=new Le,ygt=new $,Agt=new $,bgt=new h;function xgt(e,t,n,i,r,o,s,a,c){let u=e.positions,f=mi.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=ygt;if(i!==0){let _=Le.fromAxisAngle(s,i,FEe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,FEe);let C=$.fromQuaternion(_,Agt);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=dgt;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,lgt),D=o(w,fgt);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 Yx(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=ni.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,U):1)+2}Yx.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 Yx(t)};Yx.pack=function(e,t,n){return n=n??0,n=ni.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=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var Tgt=ee.clone(ee.UNIT_SPHERE),Egt=new Be,Cgt={polygonHierarchy:{}};Yx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,Tgt);t+=ee.packedLength;let o=Be.unpack(e,t,Egt);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new Yx(Cgt)),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};Yx.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=hgt,c=mgt,u=pgt,f=ggt,d=_gt;if(!jy.computeProjectTo2DArguments(s,rR,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(rR,h.ZERO,P.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(rR,bgt);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=jy.createProjectPointsTo2DFunction(rR,f,d),m=jy.createProjectPointTo2DFunction(rR,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ni.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ni.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ni.computeBoundingRectangle(a,m,s,i,ugt),S=[];for(let O=0;O<b.length;O++){let L=new Bt({geometry:xgt(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=qn.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 m8=Yx;var BEe=[],p8=[];function vgt(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,BEe);mi.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+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=ni.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=ni.subdivideLine(t[u],t[(u+1)%f],n,p8):r===ln.RHUMB&&(y=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,p8));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 Sgt(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,BEe);mi.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+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=ni.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=ni.subdivideLine(t[u],t[(u+1)%f],n,p8):r===ln.RHUMB&&(b=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,p8));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 Xx(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=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+8}Xx.pack=function(e,t,n){return n=n??0,n=ni.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 wgt=ee.clone(ee.UNIT_SPHERE),Igt={polygonHierarchy:{}};Xx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,wgt);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 Xx(Igt)),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};Xx.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 Xx(t)};Xx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ni.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=Sgt(t,s[m],u,r,o),a.geometry=ni.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=vgt(t,s[m],u,r,o),a.geometry.attributes.position.values=mi.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=qn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new wt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var g8=Xx;var kEe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",UEe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",zEe=new z,VEe=h.ZERO,jEe=new h,HEe=new ie,Pgt=[],Dgt=new U;function Rgt(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 Sf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Rgt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Sf.prototype=Object.create(oi.prototype),Sf.prototype.constructor=Sf);Sf.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:Kn.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,zEe)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,VEe,jEe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new m8(i):o=new tg(i),new Bt({id:t,geometry:o,attributes:r})};Sf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,zEe),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:Kn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,VEe,jEe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Hh(i):a=new g8(i),new Bt({id:t,geometry:a,attributes:s})};Sf.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,Pgt),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,Dgt);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)};Sf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Oi.prototype._isHidden.call(this,e,t)};Sf.prototype._isOnTerrain=function(e,t){let n=oi.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(tt.MINIMUM_VALUE):!0);return n&&!r};Sf.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)};Sf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(tt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,tt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,tt.MINIMUM_VALUE,!1);o=oi.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,yt(kEe)),s!==We.NONE&&u&&(o=void 0,yt(UEe))):(l(a)&&!l(o)&&(o=0),f=oi.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,tt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,tt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,tt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,tt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,tt.MINIMUM_VALUE),a=oi.getGeometryExtrudedHeight(a,c),a===oi.CLAMP_TO_GROUND){let d=tg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,HEe);a=Ni.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};Sf.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)};Sf.DynamicGeometryUpdater=CS;function CS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(CS.prototype=Object.create(Ri.prototype),CS.prototype.constructor=CS);CS.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ri.prototype._isHidden.call(this,e,t,n)};CS.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(kEe)),o!==We.NONE&&c&&(r=void 0,yt(UEe))):(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=tg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,HEe);a=Ni.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var _8=Sf;function Ogt(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=mi.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:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=qn.computeNormal(E)),i.tangent||i.bitangent){try{E=qn.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 sR(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??ur.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}sR.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 GEe=ee.clone(ee.UNIT_SPHERE),WEe=new Be,oR={polylinePositions:void 0,shapePositions:void 0,ellipsoid:GEe,vertexFormat:WEe,cornerType:void 0,granularity:void 0};sR.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,GEe);t+=ee.packedLength;let c=Be.unpack(e,t,WEe);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):(oR.polylinePositions=o,oR.shapePositions=s,oR.cornerType=u,oR.granularity=f,new sR(oR))};var Mgt=new et;sR.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=Dp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,Mgt),o=Dp.computePositions(n,i,r,e,!0);return Ogt(o,i,r,e._vertexFormat)};var y8=sR;function Ngt(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:ue.fromVertices(e),primitiveType:Oe.LINES})}function cR(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??ur.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}cR.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 qEe=ee.clone(ee.UNIT_SPHERE),aR={polylinePositions:void 0,shapePositions:void 0,ellipsoid:qEe,height:void 0,cornerType:void 0,granularity:void 0};cR.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,qEe);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):(aR.polylinePositions=o,aR.shapePositions=s,aR.cornerType=c,aR.granularity=u,new cR(aR))};var Lgt=new et;cR.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=Dp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,Lgt),o=Dp.computePositions(n,i,r,e,!1);return Ngt(o,i)};var A8=cR;var YEe=new z;function Fgt(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 Up(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new Fgt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Up.prototype=Object.create(Oi.prototype),Up.prototype.constructor=Up);Up.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=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,YEe)),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 y8(this._options),attributes:i})};Up.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,YEe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new A8(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r)}})};Up.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Oi.prototype._isHidden.call(this,e,t)};Up.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Up.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:Cr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(tt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(tt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(tt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(tt.MINIMUM_VALUE):void 0};Up.DynamicGeometryUpdater=vS;function vS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(vS.prototype=Object.create(Ri.prototype),vS.prototype.constructor=vS);vS.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)};vS.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 b8=Up;var See=new h,$Ee=new h,JEe=new h,ZEe=new h,QEe=new ie,Bgt=new U,kgt=new ue,Ugt=new ue;function eCe(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 zgt(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=ZEe,f=JEe,d=$Ee;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,See),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 eCe(t,{positions:e,normals:o,tangents:s,bitangents:a})}var wee=new h,tCe=new h;function Vgt(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=ZEe,p=JEe,g=$Ee;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,See),A=h.fromArray(e,(m+6)%i,wee);if(f){let b=h.fromArray(e,(m+3)%i,tCe);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 eCe(t,{positions:e,normals:r,tangents:o,bitangents:s})}function nCe(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=See,b=Bgt,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)Ua.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&&(Ua.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&&(Ua.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=zgt(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 SS(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 wS(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 Iee=new Be;function jgt(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,Iee);Pe.normal=!0,e._vertexFormat=Pe}let d=nCe(e,t);n&&(e._vertexFormat=r);let p=mi.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=mi.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?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]),J&&(Q[fe++]=1,fe+=1);let we=Vgt(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,wee),qe=h.fromArray(G,Ye*3,tCe);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=qn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var Hgt=[new h,new h,new h,new h],iCe=new he,Ggt=new he;function Pee(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Ua.computeOptions(e,t,n,0,QEe,iCe),s=o.height,a=o.width,c=Hgt;return Ua.computePosition(o,i,!1,0,0,c[0]),Ua.computePosition(o,i,!1,0,a-1,c[1]),Ua.computePosition(o,i,!1,s-1,0,c[2]),Ua.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function zp(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}zp.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;zp.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 rCe=new ie,oCe=ee.clone(ee.UNIT_SPHERE),fA={rectangle:rCe,ellipsoid:oCe,vertexFormat:Iee,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};zp.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,rCe);t+=ie.packedLength;let r=ee.unpack(e,t,oCe);t+=ee.packedLength;let o=Be.unpack(e,t,Iee);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):(fA.granularity=s,fA.height=a,fA.rotation=c,fA.stRotation=u,fA.extrudedHeight=f,fA.shadowVolume=d,fA.offsetAttribute=p===-1?void 0:p,new zp(fA))};zp.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 Pee(n,i,o,r,t)};var Wgt=new $,XEe=new Le,qgt=new he;zp.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=Ua.computeOptions(t,e._granularity,i,r,QEe,iCe,Ggt),a=Wgt;if(r!==0||i!==0){let g=ie.center(t,qgt),m=n.geodeticSurfaceNormalCartographic(g,wee);Le.fromAxisAngle(m,-r,XEe),$.fromQuaternion(XEe,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=jgt(e,s);let g=ue.fromRectangle3D(t,n,c,Ugt),m=ue.fromRectangle3D(t,n,u,kgt);p=ue.union(g,m)}else{if(d=nCe(e,s),d.attributes.position.values=mi.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=ue.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})};zp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new zp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var KEe=new ie,Ygt=[new U,new U,new U],Xgt=new $i,Kgt=new he;function $gt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,KEe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=Pee(t,n,r,i,KEe),s=Ygt;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,Xgt),u=ie.center(a,Kgt);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(zp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=Pee(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=$gt(this)),this._textureCoordinateRotationPoints}}});var IS=zp;var sCe=new z,aCe=h.ZERO,cCe=new h,lCe=new ie,Jgt=new ie,Zgt=new he;function Qgt(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 $h(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Qgt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&($h.prototype=Object.create(oi.prototype),$h.prototype.constructor=$h);$h.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:Kn.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,sCe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,aCe,cCe))),new Bt({id:t,geometry:new IS(this._options),attributes:i})};$h.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,sCe),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:Kn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,aCe,cCe))),new Bt({id:t,geometry:new zv(this._options),attributes:o})};$h.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,Jgt);if(!l(n))return;let i=ie.center(n,Zgt);return he.toCartesian(i,ee.default,t)};$h.prototype._isHidden=function(e,t){return!l(t.coordinates)||Oi.prototype._isHidden.call(this,e,t)};$h.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)};$h.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,tt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,tt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,tt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,tt.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(tt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,tt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,tt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,tt.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(IS.computeRectangle(a,lCe)).minimumTerrainHeight),a.extrudedHeight=o};$h.DynamicGeometryUpdater=PS;function PS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(PS.prototype=Object.create(Ri.prototype),PS.prototype.constructor=PS);PS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ri.prototype._isHidden.call(this,e,t,n)};PS.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(IS.computeRectangle(i,lCe)).minimumTerrainHeight),i.extrudedHeight=s};var x8=$h;var uCe={};function e_t(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var t_t=new he,n_t=new he;function i_t(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,t_t);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,n_t);s&&(x.height=n[A]),m=m&&x.height===0,e_t(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 r_t=new Array(2),o_t=new Array(2),s_t={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};uCe.computePositions=function(e,t,n,i,r,o){let s=i_t(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=s_t;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=lr.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=r_t,A=o_t;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=lr.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(lr.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(lr.generateArc(p)),p.height=i,f=new Float64Array(lr.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var DS=uCe;var Dee=new h,T8=new h,a_t=new h,fCe=new h,c_t=new h,l_t=new h,u_t=new h;function Kx(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}Kx.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 dCe=ee.clone(ee.UNIT_SPHERE),hCe=new Be,lR={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:dCe,vertexFormat:hCe,granularity:void 0};Kx.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,dCe);t+=ee.packedLength;let u=Be.unpack(e,t,hCe);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):(lR.positions=o,lR.minimumHeights=s,lR.maximumHeights=a,lR.granularity=f,new Kx(lR))};Kx.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 Kx(c)};Kx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=DS.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=u_t,R=l_t,O=c_t,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,Dee),k=h.fromArray(c,B,T8);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,fCe),q=h.subtract(j,s.geodeticSurfaceNormal(j,T8),T8);if(_+1<d&&(G=h.fromArray(u,B+3,fCe)),L){let Q=h.subtract(G,j,a_t),W=h.subtract(q,j,Dee);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,Dee),G=h.fromArray(g,j*3,T8);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:ue.fromVertices(g)})};var E8=Kx;var mCe=new h,pCe=new h;function $x(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}$x.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 gCe=ee.clone(ee.UNIT_SPHERE),uR={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:gCe,granularity:void 0};$x.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,gCe);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):(uR.positions=o,uR.minimumHeights=s,uR.maximumHeights=a,uR.granularity=u,new $x(uR))};$x.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 $x(c)};$x.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=DS.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,mCe),E=h.fromArray(a,x,pCe);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,mCe),v=h.fromArray(d,T*3,pCe);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:ue.fromVertices(d)})};var C8=$x;var _Ce=new z;function f_t(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 Jh(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new f_t(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Jh.prototype=Object.create(Oi.prototype),Jh.prototype.constructor=Jh);Jh.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=Kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,_Ce)),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 E8(this._options),attributes:i})};Jh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,_Ce),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new C8(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Kn.fromDistanceDisplayCondition(r)}})};Jh.prototype._isHidden=function(e,t){return!l(t.positions)||Oi.prototype._isHidden.call(this,e,t)};Jh.prototype._getIsClosed=function(e){return!1};Jh.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)};Jh.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:Cr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(tt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(tt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(tt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(tt.MINIMUM_VALUE):void 0};Jh.DynamicGeometryUpdater=RS;function RS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(RS.prototype=Object.create(Ri.prototype),RS.prototype.constructor=RS);RS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ri.prototype._isHidden.call(this,e,t,n)};RS.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 v8=Jh;var Jx=[q2,U4,R4,s8,a8,h8,_8,b8,x8,v8];function Zx(e,t){this.entity=e,this.scene=t;let n=new Array(Jx.length),i=new be,r=new Zo;for(let o=0;o<n.length;o++){let s=new Jx[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(Zx.prototype._onEntityPropertyChanged,this)}Zx.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)};Zx.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};Zx.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};Zx.registerUpdater=function(e){Jx.includes(e)||Jx.push(e)};Zx.unregisterUpdater=function(e){if(Jx.includes(e)){let t=Jx.indexOf(e);Jx.splice(t,1)}};var OS=Zx;var yCe=new z,d_t=new Ht,h_t=new Ht,m_t=h.ZERO,p_t=new h;function Zh(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Zh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Zh.prototype.onMaterialChanged=function(){this.invalidated=!0};Zh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Zh.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)}))}};Zh.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};Zh.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=Co.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=Co.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,yCe);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,yCe);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,h_t,d_t);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,m_t,p_t);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Zh.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()};Zh.prototype.contains=function(e){return this.updaters.contains(e.id)};Zh.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)};Zh.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 MS(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}MS.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 Zh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function ACe(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}MS.prototype.remove=function(e){ACe(this._solidItems,e)||ACe(this._translucentItems,e)};function bCe(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 S8(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}MS.prototype.update=function(e){let t=S8(this,this._solidItems,e,!0);t=S8(this,this._translucentItems,e,t)&&t;let n=bCe(this,this._solidItems,e),i=bCe(this,this._translucentItems,e);return(n||i)&&(t=S8(this,this._solidItems,e,t)&&t,t=S8(this,this._translucentItems,e,t)&&t),t};function xCe(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}MS.prototype.getBoundingSphere=function(e,t){let n=xCe(this._solidItems,e,t);return n===Pt.FAILED?xCe(this._translucentItems,e,t):n};function TCe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}MS.prototype.removeAllPrimitives=function(){TCe(this._solidItems),TCe(this._translucentItems)};var Qh=MS;var g_t=new Ht,__t=new Ht,y_t=h.ZERO,A_t=new h;function em(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 kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(em.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt}em.prototype.onMaterialChanged=function(){this.invalidated=!0};em.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};em.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};em.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 b_t=new z;em.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=Co.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=Co.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=Co.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Co.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,b_t);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,__t,g_t);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,y_t,A_t);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};em.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()};em.prototype.contains=function(e){return this.updaters.contains(e.id)};em.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)};em.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 NS(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}NS.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 em(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};NS.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}}};NS.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};NS.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};NS.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 tm=NS;function w8(e,t,n=0,i=e.length-1,r=x_t){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));w8(e,t,g,m,r)}let o=e[t],s=n,a=i;for(fR(e,n,t),r(e[i],o)>0&&fR(e,n,i);s<a;){for(fR(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?fR(e,n,a):(a++,fR(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function fR(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function x_t(e,t){return e<t?-1:e>t?1:0}var mR=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(!P8(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;P8(t,c)&&(n.leaf?i.push(a):Oee(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!P8(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(P8(t,s)){if(n.leaf||Oee(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=FS([]),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=T_t(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&Oee(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=FS(t.slice(n,i+1)),LS(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=FS([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));ECe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);ECe(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 LS(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=Ree(u),d=v_t(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),hR(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=FS(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,LS(i,this.toBBox),LS(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=FS([t,n]),this.data.height=t.height+1,this.data.leaf=!1,LS(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=dR(t,0,a,this.toBBox),u=dR(t,a,i,this.toBBox),f=S_t(c,u),d=Ree(c)+Ree(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:E_t,o=t.leaf?this.compareMinY:C_t,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=dR(t,0,n,o),a=dR(t,i-n,i,o),c=I8(s)+I8(a);for(let u=n;u<i-n;u++){let f=t.children[u];hR(s,t.leaf?o(f):f),c+=I8(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];hR(a,t.leaf?o(f):f),c+=I8(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)hR(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():LS(t[n],this.toBBox)}};function T_t(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 LS(e,t){dR(e,0,e.children.length,t,e)}function dR(e,t,n,i,r){r||(r=FS(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];hR(r,e.leaf?i(s):s)}return r}function hR(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 E_t(e,t){return e.minX-t.minX}function C_t(e,t){return e.minY-t.minY}function Ree(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function I8(e){return e.maxX-e.minX+(e.maxY-e.minY)}function v_t(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 S_t(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 Oee(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function P8(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function FS(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ECe(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;w8(e,s,t,n,r),o.push(t,s,s,n)}}function D8(){this._tree=new mR}function Qx(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Qx.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};D8.prototype.insert=function(e,t){let n=Qx.fromRectangleAndId(e,t,new Qx);this._tree.insert(n)};function w_t(e,t){return e.id===t.id}var I_t=new Qx;D8.prototype.remove=function(e,t){let n=Qx.fromRectangleAndId(e,t,I_t);this._tree.remove(n,w_t)};var P_t=new Qx;D8.prototype.collides=function(e){let t=Qx.fromRectangleAndId("",e,P_t);return this._tree.collides(t)};var BS=D8;var D_t=new z,R_t=new Ht,O_t=new Ht;function Bg(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new BS}Bg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Bg.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)}))}};Bg.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};Bg.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 fu({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,D_t);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,O_t,R_t);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Bg.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()};Bg.prototype.contains=function(e){return this.updaters.contains(e.id)};Bg.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};Bg.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 kS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}kS.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 Bg(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};kS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};kS.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};kS.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};kS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var pR=kS;var M_t=new Ht,N_t=new Ht;function Vp(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new BS}Vp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Vp.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)};Vp.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};Vp.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};Vp.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=Co.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new fu({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=Co.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,N_t,M_t);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Vp.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()};Vp.prototype.contains=function(e){return this.updaters.contains(e.id)};Vp.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)};Vp.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 US(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}US.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=id.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 Vp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};US.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};US.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};US.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};US.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 R8=US;var L_t=new z,F_t=new Ht,B_t=new Ht,k_t=h.ZERO,U_t=new h;function kg(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 kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.itemsToRemove=[],this.subscriptions=new kt,this.showsUpdated=new kt}kg.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)}))}};kg.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};kg.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 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,L_t);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,B_t,F_t);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,k_t,U_t);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};kg.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()};kg.prototype.contains=function(e){return this.updaters.contains(e.id)};kg.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)};kg.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 zS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new kt,this._translucentBatches=new kt}zS.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 kg(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 kg(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};zS.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};zS.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};zS.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};zS.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 gR=zS;var z_t=[];function Fu(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;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 gR(n,e,s,!1),this._outlineBatches[r+s]=new gR(n,e,s,!0),this._closedColorBatches[s]=new Qh(n,An,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Qh(n,An,void 0,!0,s,!1),this._closedMaterialBatches[s]=new tm(n,Cr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new tm(n,Cr,void 0,!0,s,!1),this._openColorBatches[s]=new Qh(n,An,void 0,!1,s,!0),this._openColorBatches[r+s]=new Qh(n,An,void 0,!1,s,!1),this._openMaterialBatches[s]=new tm(n,Cr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new tm(n,Cr,void 0,!1,s,!1);let a=Qn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new R8(i,s,Cr)),c[s]=new pR(i,s);else for(s=0;s<a;++s)c[s]=new pR(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new gS(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new kt,this._updaterSets=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(Fu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,z_t)}Fu.registerUpdater=function(e){OS.registerUpdater(e)};Fu.unregisterUpdater=function(e){OS.unregisterUpdater(e)};Fu.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 OS(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Fu._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 V_t=[],j_t=new ue;Fu.prototype.getBoundingSphere=function(e,t){let n=V_t,i=j_t,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]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};Fu.prototype.isDestroyed=function(){return!1};Fu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Fu.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(),le(this)};Fu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Fu.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)};Fu._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)};Fu.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 O8=Fu;var H_t=1,G_t="30px sans-serif",W_t=Io.FILL,q_t=z.WHITE,Y_t=z.BLACK,X_t=1,K_t=!1,$_t=new z(.165,.165,.165,.8),J_t=new U(7,5),Z_t=U.ZERO,Q_t=h.ZERO,eyt=We.NONE,tyt=Hi.CENTER,nyt=Wn.CENTER,iyt=new h,ryt=new z,oyt=new z,syt=new z,ayt=new U,cyt=new h,lyt=new U,uyt=new qt,fyt=new qt,dyt=new qt,hyt=new Ht;function CCe(e){this.entity=e,this.label=void 0,this.index=void 0}function dA(e,t){t.collectionChanged.addEventListener(dA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}dA.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,iyt),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){Mee(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,eyt);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,H_t),u.font=X.getValueOrDefault(a._font,e,G_t),u.style=X.getValueOrDefault(a._style,e,W_t),u.fillColor=X.getValueOrDefault(a._fillColor,e,q_t,ryt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,Y_t,oyt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,X_t),u.showBackground=X.getValueOrDefault(a._showBackground,e,K_t),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,$_t,syt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,J_t,ayt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,Z_t,lyt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,Q_t,cyt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,tyt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,nyt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,uyt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,fyt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,dyt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,hyt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};dA.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=jm(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=O_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};dA.prototype.isDestroyed=function(){return!1};dA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(dA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};dA.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 CCe(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 CCe(o)):(Mee(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Mee(s.get(o.id),o,a),s.remove(o.id)};function Mee(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var M8=dA;var myt=1,pyt=!0,gyt=0,_yt=!0,yyt=!0,Ayt=Dn.ENABLED,byt=We.NONE,xyt=z.RED,Tyt=0,Eyt=z.WHITE,Cyt=Rl.HIGHLIGHT,vyt=.5,Syt=new U(1,1),vCe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},wyt=new M,Iyt=new M,SCe=new z,wCe=new Array(4),Pyt=new h;function hA(e,t){t.collectionChanged.addEventListener(hA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}function Dyt(e,t){return e instanceof fi?e.valueOf():X.getValueOrUndefined(e,t)}function Ryt(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function ICe(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function Oyt(e,t){if(!l(t))return M.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function Myt(e,t,n,i,r){let o=e._primitives,s=e._modelHash,a=s[t.id],c=()=>!e.isDestroyed()&&s[t.id]===a;try{let u=await xd.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(!c()){u.destroy();return}u.id=t,o.add(u),a.modelPrimitive=u,u.errorEvent.addEventListener(f=>{c()&&(console.log(f),f.name!=="TextureError"&&u.incrementallyLoadTextures&&(a.loadFailed=!0))})}catch(u){if(!c())return;console.log(u),a.loadFailed=!0}}hA.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,p;if(f&&(d=s.computeModelMatrix(e,wyt),p=Dyt(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!Ryt(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(ICe(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...vCe}},n[s.id]=u,ICe(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,_yt),A=X.getValueOrDefault(a._environmentMapOptions,e,vCe,u.environmentMapOptionsScratch);Myt(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,myt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,pyt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,gyt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=Oyt(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,Ayt),g.heightReference=X.getValueOrDefault(a._heightReference,e,byt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,xyt,SCe),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,Tyt),g.color=X.getValueOrDefault(a._color,e,Eyt,SCe),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,Cyt),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,vyt),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,yyt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,Syt);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,wCe,0),m=h.unpack(wCe,0,Pyt)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:pf.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=M.fromTranslationRotationScale(I,Iyt);R.matrix=M.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};hA.prototype.isDestroyed=function(){return!1};hA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(hA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Nee(this,e[i],t,n);return le(this)};var _R=new h,Nyt=new he;hA.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;_R.x=a[12],_R.y=a[13],_R.z=a[14];let c=o.cartesianToCartographic(_R,Nyt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=jm(r,n,_R,[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):ls(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};hA.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)?(Lyt(o,a),s.set(o.id,o)):(Nee(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Nee(this,o,a,c),s.remove(o.id)};function Nee(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Lyt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var N8=hA;function mA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(mA.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 Fyt=new K;mA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Fyt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};mA.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))};mA.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};mA.prototype.equals=function(e){return this===e||e instanceof mA&&this._value===e._value};mA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ug=mA;var PCe=new $,DCe=new $,RCe=new $,Byt=new h,OCe=new h,kyt=new h,Uyt=new h,L8=new Le,F8=new M,B8=new $;function AR(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,L8)&&(Le.conjugate(L8,L8),$.fromQuaternion(L8,B8),$.multiplyByVector(B8,r,r));else if(l(Bee(e,i.position,F8)))M.inverse(F8,F8),M.getRotation(F8,B8),$.multiplyByVector(B8,r,r);else return;return r}}function Bee(e,t,n){let i=t.getValue(e,Byt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,OCe);if(l(o)&&!h.equalsEpsilon(i,o,P.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,PCe),a=At.computeFixedToIcrfMatrix(r,DCe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,RCe),s=$.transpose(c,PCe),a=At.computeTemeToPseudoFixedMatrix(r,DCe),$.transpose(a,a)):c=$.transpose(s,RCe);let u=kyt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,Uyt);if(!h.equalsEpsilon(f,h.ZERO,P.EPSILON16)){let d=h.cross(f,u,OCe);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 MCe=60,UCe=1,zCe=new Cn,Lee=new Cn,Fee=new Cn;function NCe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var k8=new h;function zyt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Qr&&(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,k8),g=AR(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,k8),l(g)&&l(m)&&(g=AR(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,k8),l(g)&&l(m)&&(g=AR(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,k8),l(g)&&l(m)&&(g=AR(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Vyt(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 jyt(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 Hyt(e,t,n,i,r,o,s,a){Fee.start=t,Fee.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,Fee,zCe).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 Gyt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function Wyt(e,t,n,i,r,o,s,a){Lee.start=t,Lee.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,Lee,zCe).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=VCe(d.data,m,y,i,r,o,c,a)}}return c}function VCe(e,t,n,i,r,o,s,a){for(;e instanceof iA;)e=e.resolvedProperty;if(e instanceof Tc){let c=e._property._times;s=zyt(e,t,n,c,i,r,o,s,a)}else e instanceof Y2?s=Vyt(e,t,n,i,r,o,s,a):e instanceof xc?s=Wyt(e,t,n,i,r,o,s,a):e instanceof oA?s=Hyt(e,t,n,i,r,o,s,a):e instanceof hu||e instanceof Ug&&X.isConstant(e)?s=Gyt(e,t,n,i,r,o,s,a):s=jyt(e,t,n,i,r,o,s,a);return s}function kee(e,t,n,i,r,o,s){l(s)||(s=[]);let a=VCe(e,t,n,i,r,o,0,s);return s.length=a,s}var LCe=new $,FCe=new Le,BCe=new $,yR=new Cn,U8=new Cn,eT=new Cn;function qyt(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 kCe(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=kee(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=Co.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,UCe),d++}return d}function bR(e,t){this._unusedIndexes=[],this._polylineCollection=new Sp,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}bR.prototype.update=function(e){let t=this._referenceFrame;if(t===Wi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,LCe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,LCe)),M.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,FCe))&&($.fromQuaternion(FCe,BCe),M.fromRotationTranslation(BCe,n,this._polylineCollection.modelMatrix)):Bee(e,t.position,this._polylineCollection.modelMatrix)}};bR.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,MCe),d=kee(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=Co.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===Og.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:MCe,y=g.intervals,A=0;if(l(y)){yR.start=o,yR.stop=s,yR.isStartIncluded=!0,yR.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Cn.intersect(x,yR,U8))continue;let T=U8.start,E=U8.stop;if(K.greaterThanOrEquals(T,E))continue;let v=qyt(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(_,U8,eT)&&(K.greaterThan(eT.start,T)&&K.lessThan(eT.start,E)&&S.push(K.clone(eT.start)),K.greaterThan(eT.stop,T)&&K.lessThan(eT.stop,E)&&S.push(K.clone(eT.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=kCe(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=kCe(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,UCe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};bR.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};bR.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function jp(e,t){t.collectionChanged.addEventListener(jp.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}jp.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 bR(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};jp.prototype.isDestroyed=function(){return!1};jp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(jp.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};jp.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 NCe(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 NCe(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))};jp._subSample=kee;jp._computeVvlhTransform=Bee;jp._transformToEntityFrame=AR;var z8=jp;var jCe=z.WHITE,HCe=z.BLACK,GCe=0,WCe=1,qCe=0,YCe=Ho.NONE,XCe=new z,Yyt=new h,KCe=new z,$Ce=new qt,JCe=new qt,ZCe=new Ht;function QCe(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 kt,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,Yyt),d=l(p)),!d){xR(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(xR(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)&&(xR(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,$Ce),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,JCe),c.color=X.getValueOrDefault(a._color,e,jCe,XCe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,HCe,KCe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,GCe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,WCe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,ZCe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,qCe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,YCe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,$Ce),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,JCe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,ZCe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,qCe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,YCe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,jCe,XCe),A=X.getValueOrDefault(a._outlineColor,e,HCe,KCe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,GCe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,WCe)));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,Sv(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=jm(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=O_(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 le(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 QCe(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 QCe(o)):(xR(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],xR(s.get(o.id),o,a),s.remove(o.id)};function xR(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 V8=pA;var rve=[];function Xyt(e,t,n,i,r){let o=rve;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 TR(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}TR.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 ove=ee.clone(ee.UNIT_SPHERE),sve=new Be,tT={positions:void 0,colors:void 0,ellipsoid:ove,vertexFormat:sve,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};TR.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,ove);t+=ee.packedLength;let c=Be.unpack(e,t,sve);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 TR(tT))};var eve=new h,tve=new h,nve=new h,ive=new h;TR.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=lr.numberOfPoints):(N=s,F=lr.numberOfPointsRhumbLine);let V=lr.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=Xyt(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,rve.length=0}o===ln.GEODESIC?p=lr.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:V}):p=lr.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=eve,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,nve),h.clone(p[u],tve),u===g-1?(O=eve,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,ive);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(tve,y,v),h.pack(nve,A,v),h.pack(ive,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:ue.fromPoints(p),geometryType:mh.POLYLINES})};var gA=TR;var Kyt=new fi(0),j8={},ave=new z,$yt=new Kt(z.WHITE),Jyt=new fi(!0),Zyt=new fi(Dn.DISABLED),Qyt=new fi(new Ht),eAt=new fi(Qn.BOTH);function tAt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function nAt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function nm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(nm.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 tAt,this._groundGeometryOptions=new nAt,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(nm.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}}});nm.prototype.isOutlineVisible=function(e){return!1};nm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};nm.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=Kn.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,ave)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new QE(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,ave)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Bt({id:t,geometry:new gA(this._geometryOptions),attributes:s}))};nm.prototype.createOutlineGeometryInstance=function(e){};nm.prototype.isDestroyed=function(){return!1};nm.prototype.destroy=function(){this._entitySubscription(),le(this)};nm.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(tt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??$yt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??Jyt,this._shadowsProperty=r.shadows??Zyt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Qyt,this._classificationTypeProperty=r.classificationType??eAt,this._fillEnabled=!0,this._zIndex=a??Kyt;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(tt.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=Ys.VERTEX_FORMAT:A=_c.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(tt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(tt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(tt.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(tt.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)}};nm.prototype.createDynamicUpdater=function(e,t){return new ER(e,t,this)};var VS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function ER(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 cve(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=j8[n];!l(i)||i.isDestroyed()?(i=new Sp,j8[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}ER.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 Ys;else{let g=Co.getValue(e,d,this._material);p=new _c({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Jm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=cve(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)&&(VS.ellipsoid=f,VS.positions=o,VS.granularity=X.getValueOrUndefined(i._granularity,e),VS.height=lr.extractHeights(o,f),c===ln.GEODESIC?o=lr.generateCartesianArc(VS):o=lr.generateCartesianRhumbArc(VS)),a.show=!0,a.positions=o.slice(),a.material=Co.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};ER.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 ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=cve(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};ER.prototype.isDestroyed=function(){return!1};ER.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=j8[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete j8[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var H8=nm;var iAt=new z,rAt=new Ht,oAt=new Ht;function im(e,t,n,i,r){let o;n instanceof Kt?o=Ys:o=_c,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(im.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt,this.zIndex=i,this._asynchronous=r}im.prototype.onMaterialChanged=function(){this.invalidated=!0};im.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)};im.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};im.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};im.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 Jm({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===_c&&(this.material=Co.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===_c&&(this.material=Co.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,iAt);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,oAt,rAt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Kn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};im.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()};im.prototype.contains=function(e){return this.updaters.contains(e.id)};im.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)};im.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 jS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}jS.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 im(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};jS.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}}};jS.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};jS.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};jS.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 G8=jS;var sAt=[];function lve(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function uve(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 Hp(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 kt,this._removedObjects=new kt,this._changedObjects=new kt;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 Qh(n,Ys,void 0,!1,r),this._materialBatches[r]=new tm(n,_c,void 0,!1,r),this._colorBatches[r+o]=new Qh(n,Ys,Ys,!1,r),this._materialBatches[r+o]=new tm(n,_c,Ys,!1,r),this._colorBatches[r+o*2]=new Qh(n,Ys,_c,!1,r),this._materialBatches[r+o*2]=new tm(n,_c,_c,!1,r);this._dynamicBatch=new gS(n,i);let s=Qn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new G8(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new kt,this._updaters=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(Hp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,sAt)}Hp.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?(lve(this,f),uve(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),lve(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 H8(c,this._scene),this._updaters.set(u,f),uve(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Hp._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 aAt=[],cAt=new ue;Hp.prototype.getBoundingSphere=function(e,t){let n=aAt,i=cAt,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]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};Hp.prototype.isDestroyed=function(){return!1};Hp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hp.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(),le(this)};Hp._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)};Hp.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 W8=Hp;function Bu(e){fu.initializeTerrainHeights(),Jm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Zo,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??Bu.defaultVisualizersCallback;let i=!1,r=new ql,o=new ql;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 F4;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 HS=[];Bu.registerVisualizer=function(e){HS.includes(e)||HS.push(e)};Bu.unregisterVisualizer=function(e){if(HS.includes(e)){let t=HS.indexOf(e);HS.splice(t,1)}};Bu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new XN(t,i),new O8(e,i,n._primitives,n._groundPrimitives),new M8(t,i),new N8(e,i),new x4(e,i),new V8(t,i),new z8(e,i),new W8(e,i,n._primitives,n._groundPrimitives),...HS.map(r=>new r(e,i))]};Object.defineProperties(Bu.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}}});Bu.prototype.isDestroyed=function(){return!1};Bu.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)),le(this)};Bu.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};Bu.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 lAt=[],uAt=new ue;Bu.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=lAt,a=uAt,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]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};Bu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new ql),s=r.add(new Q4);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Bu.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};Bu.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 q8=Bu;function Uee(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}Uee.clone=function(e,t){if(l(e))return l(t)||(t=new Uee),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var rm=Uee;var fve=new $,dve=new $,hve=new $,fAt=new M,Y8=new h,mve=new h,zee=new h,Vee=new h,pve=new h,gve=new h,dAt=new Le,hAt=new h,mAt=new $,GS=new K,pAt=1.25;function gAt(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,GS);let I=r.getValue(GS,Y8);if(l(I)||(K.addSeconds(c,-.001,GS),I=r.getValue(GS,Y8),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,fve),O=At.computeFixedToIcrfMatrix(GS,dve),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,hve),R=$.transpose(L,fve),O=At.computeTemeToPseudoFixedMatrix(GS,dve),$.transpose(O,O)):L=$.transpose(R,hve);let _=$.multiplyByVector(R,d,pve),C=$.multiplyByVector(O,I,gve);h.subtract(_,C,Vee);let w=h.magnitude(Vee)*1e3,D=P.GRAVITATIONALPARAMETER,N=-D/(w*w-2*D/h.magnitude(_));N<0||N>pAt*u.maximumRadius?(m=mve,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,zee),y=h.cross(A,m,Y8),h.magnitude(y)>P.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,zee),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,P.EPSILON7)||(A=mve,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,zee),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,P.EPSILON7)||(m=h.cross(y,A,Y8),$.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,Vee),x=h.clone(t.direction,pve),T=h.clone(t.up,gve));let E=fAt,v;l(s)&&(v=s.getValue(c,dAt));let S=o.getValue(c,hAt);if(a===B_.INERTIAL&&l(v))M.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===B_.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,mAt);M.fromRotationTranslation(I,d,E)}else a===B_.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 CR(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 aA(e.position,!0),this._offset3D=new h}Object.defineProperties(CR,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});CR.defaultOffset3D=new h(-14e3,3500,3500);var X8=new rm,_At=new h;CR.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)){X8.pitch=-P.PI_OVER_FOUR,X8.range=0;let b=a.getValue(e,_At);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);X8.pitch*=x}p.viewBoundingSphere(t,X8),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(CR._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,gAt(this,p,g,m,a,c,u,s,e,i)};var K8=CR;Gp();cc();oT();Sj();VR();var YSe={type:"module"},dte="error",rbt="messageerror",XSe,fte,KSe,hte=!0;try{hte=typeof structuredClone==Po&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}WSe(obt);function obt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Po&&(o=o());let s;try{s=Dj(e.workerURI,n,e)}catch{return lte(e),ute(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await sbt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return lte(e),$Se(e),Pj(e,t);if(a&&a.codecImportFailed){if(e.reader)return $Se(e),Pj(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function sbt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(lT);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}=abt(e.writable),f;try{f=mte({type:USe,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(()=>cbt(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 abt(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 $Se(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function pte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function Dj(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(fte===ke||XSe!==e){let u=typeof e==Po;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===ke&&(i=!1),i&&(c=YSe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return Dj(e,t,n,i,!1);if(i)throw p;return Dj(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=YSe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return Dj(e,t,n,!1,r);throw p}}XSe=e,fte=a,KSe=c}else s=new Worker(fte,KSe);return s.addEventListener(kSe,u=>{n.workerAlive=!0,ZSe(n),lbt(u,n)}),s.addEventListener(dte,u=>JSe(u,n)),s.addEventListener(rbt,u=>JSe(u,n)),s}function cbt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(pte(e),e.worker=null,t){let i=new Error(lT);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function ZSe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function JSe(e,t){e.preventDefault&&e.preventDefault(),ZSe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;pte(t),n||(t.worker=null);let s=e.error||new Error(e.message||dte);n||(s=Object.assign(new Error(s.message||dte),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function mte(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=lj(o),c.push(e.value.buffer)),i&&hte&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{hte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function lbt({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==zSe){let{value:y,done:A}=await a.read();g()||mte({type:ote,value:y,done:A,messageId:r},t)}n==ote&&(await c.ready,await c.write(new Uint8Array(i)),g()||mte({type:VSe,messageId:r},t)),n==jSe&&m(null,o)}}catch(y){g()||(pte(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}Fne();cc();Gp();aT();VR();Nj();Uj();Kee();oT();ew();Hte();SR();var Xne="File already exists",Kne="Zip file comment exceeds 64KB",Zwe="Invalid zip file comment (must be a Uint8Array)",Qwe="File entry comment exceeds 64KB",eIe="Invalid file entry comment (must be a string)",tIe="Invalid date (must be a valid Date instance)",nIe="File entry name exceeds 64KB",$ne="Version exceeds 65535",iIe="The strength must equal 1, 2, or 3",rIe="Encryption is not supported in USDZ files",oIe="Encryption is not supported when the 'passThrough' option is set",sIe="Invalid extra field (must be a Map)",aIe="Invalid extra field type (must be integer 0..65535)",cIe="Invalid extra field data (must be a Uint8Array)",p6="Extra field data exceeds 64KB",Ixt="Compression method not supported",lIe=-2147483648,uIe=2147483647,jwe=BigInt(0),Hwe=BigInt("0x7fffffffffffffff"),g6="Zip64 is not supported (set the 'zip64' option to 'true')",fIe="Undefined uncompressed size",dIe="Undefined compression method";var hIe="Undefined reader",mIe="Zip file not empty",pIe="Invalid uid (must be integer 0..2^32-1)",gIe="Invalid gid (must be integer 0..2^32-1)",_Ie="Invalid UNIX mode (must be integer 0..65535)",yIe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",AIe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",bIe="Invalid msdosAttributesRaw (must be integer 0..255)",xIe="Invalid msdosAttributes (must be an object with boolean flags)",TIe="Invalid level (must be integer 0..9)",EIe="Signature data exceeds 64KB",Gwe=new Uint8Array([7,0,2,0,65,69,3,0,0]),Pxt=4,Dxt=9,Rxt=67,Oxt=1,Hne="infozip",Gne="unix",Mxt=9,Bne=0,Wwe=[],iO=class{constructor(t,n={}){t=new fw(t);let{availableSize:i=nT,maxSize:r=nT}=t,o=i>0&&i!==nT&&r>0&&r!==nT;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[vR]===ke?t.size||t.writable.size||0:n[vR],initialOffset:n[vR]===ke?0:n[vR]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return kne(this,Nxt(this,t))}appendZip(t){return kne(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 Gg(t),await Ec(t),(t.size===ke||!t.readUint8Array)&&(t=new Uu(await Yp(t.readable)),await Ec(t));let{ZipReader:f}=await Promise.resolve().then(()=>(Fne(),kwe)),d=new f(t),p=await d.getEntries();await d.close(),await Ec(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(Xne);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 Qxt(t)||(await Zp(n.writer,vIe()),n.offset+=4));let y=await eTt(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=CIe(L||dr),A.extraFieldAES&&(O=99);let D=Ji(L),N=!!R&&R.uncompressedSize!==ke,F=!!R&&R.compressedSize!==ke,V=DIe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=PIe({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&&Cc(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=Lxt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),kne(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==iT&&(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(Zwe);if(Ji(t)>65535)throw new Error(Kne);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 Xxt(i,t,n),!kj(o)&&Xi(i,n,ij)||await s.getWriter().close(),o.getData?o.getData():s}};var Wne=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function kne(e,t){let n=new Wne((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 Nxt(e,t){if(e.filenames.size)throw new Error(mIe);await e.appendZipEntries(t)}async function Lxt(e,t,n,i){if(i=Object.assign({},i),Xi(e,i,fT)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Xne);e.filenames.add(t),Bne<Vg().maxWorkers?Bne++:await new Promise(r=>Wwe.push(r));try{return await Fxt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=Wwe.shift();r?r():Bne--}}async function Fxt(e,t,n,i){let r=Bxt(e,t,i);({name:t}=r);let o=kxt(e,t,i),{comment:s}=o,a=i[Gj];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 qSe(Vg())&&(p.level=0);let g=await Uxt(e,n,o,i);({reader:n}=g);let m=rO(e.writer),y=Yg(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[Hj],crc32:i.crc32===ke?i[Hj]:i.crc32,offset:e.offset-m,diskNumberStart:y,[qS]:e.options[qS]});let A=Hxt(i),b=Wxt(i),x=Ji(A.localHeaderArray,b.dataDescriptorArray);d=await Vxt(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,[zj]:d.internalFileAttributes,[Vj]:d.externalFileAttributes}),new TA(d)}function Bxt(e,t,n){let i=Xi(e,n,Ote),r=Xi(e,n,Lte,i?20:768),o=Xi(e,n,Bte),s=Tw(e,n,"uid"),a=Tw(e,n,"gid"),c=Tw(e,n,Ute),u=Xi(e,n,Gve),f=Xi(e,n,zte),d=Xi(e,n,Vte),p=Xi(e,n,jte);if(XS(s,4294967295,pIe),XS(a,4294967295,gIe),XS(c,65535,_Ie),u!==ke&&u!==Hne&&u!==Gne)throw new Error(yIe);if(u===Gne&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(AIe);u===ke&&(s!==ke||a!==ke)&&(u=Hne);let g=Tw(e,n,Dte),m=Xi(e,n,Rte),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),XS(g,255,bIe),m&&(typeof m!==_ve||Array.isArray(m)))throw new Error(xIe);if(r>65535)throw new Error($ne);let b=IIe(e,n,Pte,Vj),x=b!==ke;x||(b=0),!n[fT]&&t.endsWith("/")&&(n[fT]=!0);let T=Xi(e,n,fT);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}=Gxt(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 kxt(e,t,n){let i=qne(e,n,Hve)||$S,r=i(t,rj);if(r===ke&&(r=$S(t)),Ji(r)>65535)throw new Error(nIe);let o=n[qR]||"";if(typeof o!=iT)throw new Error(eIe);let s=i(o,oj);if(s===ke&&(s=$S(o)),Ji(s)>65535)throw new Error(Qwe);let a=Xi(e,n,Nte);if(a!==ke&&a>65535)throw new Error($ne);let c=jne(e,n,dw,new Date),u=Xi(e,n,hw),f=jne(e,n,XR),d=jne(e,n,KR),p=IIe(e,n,Ite,zj,0),g=Xi(e,n,Z8),m=Xi(e,n,$8),y=Xi(e,n,J8);cj(m,y);let A=Tw(e,n,Mve,3),b=Xi(e,n,Fte),x=Xi(e,n,Nve,!0),T=Xi(e,n,Lve),E=Xi(e,n,Fve,!0),v=Xi(e,n,ej),S=Xi(e,n,nj),I=Xi(e,n,kve),R=qne(e,n,Uve),O=Xi(e,n,zve,!0),L=aj(Xi(e,n,Q8)),_=Xi(e,n,Vve,!0),C=Xi(e,n,kte),w=g||C===ke?ke:yj(C);if(!g&&C!==ke&&C!==0&&C!==8&&!w)throw new Error(Ixt);let D=Tw(e,n,Bve);if(XS(D,Mxt,TIe),e.options[qS]){if(m!==ke||y!==ke)throw new Error(rIe);D===ke&&C===ke&&(D=0)}g&&(D=ke);let N=Xi(e,n,tj),F=Xi(e,n,Hee);I&&F===ke&&(F=!1),(F===ke||b&&!g)&&(F=!0),D!==ke&&D!=6&&(N=!1);let V=Xi(e,n,jj);if(!b&&(m!==ke||y!==ke)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(iIe);let B=Une(n[Gj]),j=Une(n[Wve]),k=Une(n[qve]);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 Une(e){if(!e)return dr;if(!(e instanceof Map))throw new Error(sIe);let t=0,n=0;e.forEach((o,s)=>{if(qee(s,65535,aIe),!(o instanceof Uint8Array))throw new Error(cIe);if(Ji(o)>65535)throw new Error(p6);t+=4+Ji(o)});let i=new Uint8Array(t),r=li(i);return e.forEach((o,s)=>{Jp(r,n,s),Jp(r,n+2,Ji(o)),aO(i,o,n+4),n+=4+Ji(o)}),i}async function Uxt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Xi(e,i,fT))throw new Error(hIe);let r;return t&&(t=new Gg(t),await Ec(t),{size:r}=t),Object.assign({reader:t},zxt(e,!!t,r,n,i))}function zxt(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[YR],y===ke)throw new Error(fIe);if(g===ke)throw new Error(dIe)}let A=d===!0,b=Xi(e,r,Mte);if(t&&o&&!b&&Ji(a,c))throw new Error(oIe);let x=t&&(!!(a&&Ji(a)||c&&Ji(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?Jwe(y)+T:n):n===ke?(f=!0,(d||d===ke)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(Yne(g,p)?Jwe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!Yne(g,p);E&&!s&&Xi(e,r,Hee)===ke&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(g6);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 Vxt(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[qS],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:nT}),I.size=0,await Ec(s)):(I=s,await R,await O()),await Ec(I);let _=rO(s);e.addSplitZipSignature&&!b&&await Xwe(e,s),y&&!b&&qwe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=Yg(s),D=oO(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await Zp(I,C)),A=await jxt(n,I,A,i,Vg(),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 Xwe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=Yg(s),A.offset=oO(e,s),y){let N=i.metadataSize;qwe(i,e.offset-rO(s)),A.size+=i.metadataSize-N}Yxt(A,d.localHeaderView,r),await Zp(s,d.localHeaderArray),await SIe(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(){Ew(s,Ji(d.localHeaderArray))&&await s.closeDisk()}}async function jxt(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,yi={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:Ai}=t;if(e){let zn=sm(Ate(e)),tn=e.size,Hn={options:{codecType:ow,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 Mj({readable:zn,writable:Ai},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(g6)}catch(Ki){throw Ki.outputSize!==ke&&(t.size+=Ki.outputSize),Ki}}return qxt({crc32:zi,compressedSize:ui,uncompressedSize:Si,headerInfo:a,dataDescriptorInfo:c},s),k&&await Zp(t,O),Object.assign(yi,{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}),yi}function Hxt(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&&Yne(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=If(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=If(Ji(Gwe)+2);xe.writeUint16(39169),xe.writeBytes(Gwe),D=xe.array,D[8]=m}else D=dr;let N,F,V;if(y){let xe=d6(n),ge=wIe(xe);if(ge){let ve=9+(r?4:0)+(o?4:0),Re=If(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(Kwe(d6(r))),o&&Re.writeUint32(Kwe(d6(o))),F=Re.array}else F=dr;if(A===ke?!ge||!!(r||o):A)try{let ve=Vne(n),Re=If(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(ve),Re.writeUint64(r?Vne(r):ve),Re.writeUint64(o?Vne(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==Hne&&(xe!==ke||ge!==ke)){let ve=Ywe(xe===ke?0:xe),Re=Ywe(ge===ke?0:ge),Qe=3+ve.length+Re.length,He=If(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==Gne&&(xe!==ke||ge!==ke)){let ve=If(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[Pxt]=Oxt),Jp(li(D),Dxt,R),R=99);let k=w?Ji(L):0,G=k+Ji(D,F,N,B,p,g),q=e[qS]?Rxt:0;if(G+q>65535)throw new Error(p6);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=PIe({version:I,bitFlag:DIe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<WS?WS:Q>jee?jee:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=If(30+Ji(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||Cc(fe,18,0),T||Cc(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 qwe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+Ji(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=li(s);Jp(a,0,6534),Jp(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(Ji(c)+o),aO(i,c),aO(i,s,Ji(c));let u=li(i);Jp(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function Ywe(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 Gxt(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 Wxt({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,Cc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function qxt({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&&(Cc(u,10,e),c&&Cc(d,p,e)),o?c&&(sO(d,p+4,BigInt(t)),sO(d,p+12,BigInt(n))):(Cc(u,14,t),Cc(u,18,n),c&&(Cc(d,p+4,t),Cc(d,p+8,n)))}function Yxt({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)&&Cc(u,14,r),c||Cc(u,18,o),a||Cc(u,22,s)),n&&i){let p=30+Ji(e)+4;sO(u,p,BigInt(s)),sO(u,p+8,BigInt(o))}}async function Xxt(e,t,n){let i=Kxt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await $xt(e,i,n),a=await Jxt(e,s,n);await Zxt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function Kxt(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=If(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=d6(p);if(f&&wIe(v)){let I=If(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=dr;n.rawExtraFieldExtendedTimestamp=E;let S=Ji(T,r,s,a,E,c,u);if(S>65535)throw new Error(p6);t+=46+Ji(i,o)+S}return t}async function $xt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await Ec(r);let s=0,a=0,c=Yg(r),u=rO(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=Ji(y,A,b,x,T,E,v),k=46+Ji(m,S)+j;Ew(r,s+k-a)&&(await Zp(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=Yg(r),u=rO(r)),L||Cc(O,18,V),_||Cc(O,14,B),(w||C)&&p.version<45&&Jp(O,0,45);let G=If(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(Ji(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),aO(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new TA(p))}catch{}}return await Zp(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:Yg(r),entriesLength:f},directoryArray:o}}async function Jxt(e,t,n){let i=qne(e,n,Jve);if(i){let r=await i(t),o=Ji(r);if(o>65535)throw new Error(EIe);let s=If(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return Ew(a,Ji(s.array))&&await a.closeDisk(),await Zp(a,s.array),6+o}return 0}async function Zxt(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=oO(e,o),p=Ji(t);if(p>65535)throw new Error(Kne);let g=Xi(e,n,jj),m=Yg(r);if(Ew(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(g6);g=!0}let y=If(g?98:22);Ew(r,Ji(y.array)+p)&&await r.closeDisk(),m=Yg(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(oO(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Xi(e,n,jve,!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 Zp(r,y.array),p&&await Zp(r,t)}function If(e){let t=new Uint8Array(e),n=li(t),i=0;return{array:t,writeUint8:r=>{iTt(n,i,r),i+=1},writeUint16:r=>{Jp(n,i,r),i+=2},writeUint32:r=>{Cc(n,i,r),i+=4},writeUint64:r=>{sO(n,i,BigInt(r)),i+=8},writeBytes:r=>{aO(t,r,i),i+=Ji(r)},skip:r=>i+=r}}function Yg(e){let{diskNumber:t=0}=e;return t}function rO(e){let{diskOffset:t=0}=e;return t}function Ew(e,t){let{availableSize:n=nT}=e;return t>n}function oO(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function Qxt(e){let t=await Do(e,0,4);return nTt(li(t),0)==134695760}function CIe(e){let t=li(e),n=0;for(;n+4<=Ji(e);){let i=4+m6(t,n+2);if(m6(t,n)==1)return CIe(Hd(e.subarray(0,n),e.subarray(Math.min(n+i,Ji(e)))));n+=i}return e}async function eTt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>f6(t,c)-f6(t,u)),a=0;for(let c of s){let u=f6(t,c);await zne(e,t,a,u-a),Ew(r,await tTt(t,u))&&await r.closeDisk(),o.set(c,{offset:oO(e,r),diskNumberStart:Yg(r)}),a=u}await zne(e,t,a,i-a)}else{let s=e.offset;await zne(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+f6(t,a),diskNumberStart:0}))}return o}async function zne(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await SIe(Ate(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 tTt(e,t){let n=await Do(e,t,30);if(Ji(n)<30)return 30;let i=li(n);return 30+m6(i,26)+m6(i,28)}function f6(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function vIe(){let e=new Uint8Array(4);return Cc(li(e),0,134695760),e}async function Xwe(e,t){delete e.addSplitZipSignature,await Zp(t,vIe()),e.offset+=4}async function Zp(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Ji(t),await i.write(t)}finally{i.releaseLock()}}async function SIe(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(Ji(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function Vne(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<jwe?jwe:t>Hwe?Hwe:t}}function d6(e){return Math.floor(e.getTime()/1e3)}function wIe(e){return e>=lIe&&e<=uIe}function Kwe(e){return Math.min(uIe,Math.max(lIe,e))}function Xi(e,t,n,i){let r=t[n]===ke?e.options[n]:t[n];return r===ke?i:r}function jne(e,t,n,i){let r=Xi(e,t,n,i);if(r===null)return i;if(r!==ke&&(typeof r.getTime!=Po||Number.isNaN(r.getTime())))throw new Error(tIe);return r}function qne(e,t,n){return YS(Xi(e,t,n))}function IIe(e,t,n,i,r){let o=$we(t,n,i),s=o===ke?$we(e.options,n,i):o;return s===ke?r:s}function $we(e,t,n){return e[t]===ke?e[n]:e[t]}function Tw(e,t,n,i){return rT(Xi(e,t,n,i))}function Jwe(e){return e+5*(Math.floor(e/16383)+1)}function Yne(e,t){return e===ke?t===ke||t>0:e!==0}function m6(e,t){return e.getUint16(t,!0)}function nTt(e,t){return e.getUint32(t,!0)}function iTt(e,t,n){e.setUint8(t,n)}function Jp(e,t,n){e.setUint16(t,n,!0)}function Cc(e,t,n){e.setUint32(t,n,!0)}function sO(e,t,n){e.setBigUint64(t,n,!0)}function aO(e,t,n){e.set(t,n)}function Ji(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function PIe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=If(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);Jp(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),Jp(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(Ji(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function DIe(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}Uj();SR();Gp();aT();cc();Gp();aT();rte();var tMi=1024*1024;ew();var rMi=1024*1024;var sMi=1024*1024;var aMi=512*1024;try{KS({baseURI:import.meta.url})}catch{}Gp();var oTt=[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],sTt=[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],aTt=[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],cTt=[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],lTt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],lO=new Uint8Array(288);lO.fill(8,0,144),lO.fill(9,144,256),lO.fill(7,256,280),lO.fill(8,280,288);var uTt=new Uint8Array(30).fill(5);function cO(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 Pf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function RIe(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+=Pf[a>>18&63]+Pf[a>>12&63]+Pf[a>>6&63]+Pf[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=Pf[a>>18&63]+Pf[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=Pf[a>>18&63]+Pf[a>>12&63]+Pf[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(cO(lO),cO(uTt));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=oTt[T]+f(sTt[T]),v=m(b),S=aTt[v]+f(cTt[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[lTt[I]]=f(3);let E=cO(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[cO(v.subarray(0,A)),cO(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=Pf.indexOf(n[o])<<18|Pf.indexOf(n[o+1])<<12|(63&Pf.indexOf(n[o+2]))<<6|63&Pf.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/ZVOpGx944Oz5h85ubZ4ZPPDw586fGZy9cP6BwenPnNvU6sYHNh/dPrN19rHB5vkHtgenz/Qe2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G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}cc();Gp();VR();Nj();var A6="deflate",_6="deflate-raw",OIe="deflate64-raw",y6="gzip",As,Cw,Xg,uO,MIe;function NIe(e){if(As=e,{malloc:Cw,free:Xg,memory:uO}=As,typeof Cw!="function"||typeof Xg!="function"||!uO)throw As=Cw=Xg=uO=null,new Error("Invalid WASM module")}function LIe(e){MIe=e}function FIe(e,t,n={}){if(!As){let a=new Error("WASM module not loaded");throw a.cause=MIe,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=Cw(r),this.in=Cw(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=As.deflate_process,this._last_consumed=As.deflate_last_consumed,this._end=As.deflate_end,this.streamHandle=As.deflate_new(),t===y6?a=As.deflate_init_gzip(this.streamHandle,i):t===_6?a=As.deflate_init_raw(this.streamHandle,i):a=As.deflate_init(this.streamHandle,i)):t===OIe?(this._process=As.inflate9_process,this._last_consumed=As.inflate9_last_consumed,this._end=As.inflate9_end,this.streamHandle=As.inflate9_new(),a=As.inflate9_init_raw(this.streamHandle)):(this._process=As.inflate_process,this._last_consumed=As.inflate_last_consumed,this._end=As.inflate_end,this.streamHandle=As.inflate_new(),t===_6?a=As.inflate_init_raw(this.streamHandle):t===y6?a=As.inflate_init_gzip(this.streamHandle):a=As.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(uO.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&&Xg&&(Xg(this.in),this.in=0),this.in=Cw(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(uO.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&&Xg&&Xg(a.in),a.in=0,a.out&&Xg&&Xg(a.out),a.out=0,c}}var yT=class{constructor(t=A6,n){return FIe(!0,t,n)}},AT=class{constructor(t=A6,n){return FIe(!1,t,n)}};yT.requiresModule=!0;AT.requiresModule=!0;yT.supportedFormats=[A6,_6,y6];AT.supportedFormats=[A6,_6,y6,OIe];var BIe=!1;async function kIe(e,{baseURI:t}){if(!BIe)try{await fTt(e,t),BIe=!0}catch(n){throw LIe(n),n}}async function fTt(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=dTt(e);else throw o}let r=await WebAssembly.instantiate(n);NIe(r.instance.exports)}function dTt(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 b6;GSe({initModule:e=>{if(!b6){let{wasmURI:t}=e;typeof t==Po&&(t=t()),b6=kIe(t,e).catch(n=>{throw b6=null,n})}return b6}});KS({CompressionStreamFallback:yT,DecompressionStreamFallback:AT});RIe(KS);var Jne=32,hTt="http://www.opengis.net/kml/2.2",lm="http://www.google.com/kml/ext/2.2",mTt="http://www.w3.org/2000/xmlns/";function x6(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var pTt=/^data:image\/([^,;]+)/;x6.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(pTt);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 gTt(e,t){return function(n){e._files[t]=n}}x6.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(gTt(this,o))}return r};Object.defineProperties(x6.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function T6(e){this._time=e}T6.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};T6.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return xT(n)};T6.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Zne(){this._ids={},this._styles={},this._count=0}Zne.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};Zne.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 VIe(){this._ids={}}VIe.prototype.get=function(e){if(!l(e))return this.get($n());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Qne(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Qne._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(mTt,"xmlns:gx",lm);let a=o.createElement("Document");s.appendChild(a),HIe(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?_Tt(f,c.files):{kml:f,externalFiles:c.files}})}async function _Tt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");IR({workerURI:n,wasmURI:i});let r=new uw("application/vnd.google-earth.kmz"),o=new iO(r);await o.add("doc.kml",new GR(e));let s=Object.keys(t);return await jIe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function jIe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new Uu(n[r])),jIe(e,t,n,i+1)}Qne._createState=function(e){let t=e.entities,n=new Zne,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===tt.MINIMUM_VALUE?o.stop===tt.MAXIMUM_VALUE?o=new Cn:K.addSeconds(o.stop,-10*s,o.start):o.stop===tt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new x6(e.modelCallback);return{kmlDoc:document.implementation.createDocument(hTt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new VIe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new T6(r),sampleDuration:s,defaultAvailability:new Ls([o])}};function HIe(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=[],yTt(e,p,u,f),ATt(e,p.polyline,u,f),zIe(e,p.rectangle,u,f,c),zIe(e,p.polygon,u,f,c),ETt(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,tt.MINIMUM_VALUE)||g.appendChild(Tn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,tt.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),HIe(e,b,A)}}}var Vu=new h,Xl=new he,cm=new K;function yTt(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){GIe(e,t,a,n,i);return}s.get(c,void 0,Vu);let u=Tn(r,"coordinates",bT(Vu,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(TT(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof bl?qIe(e,a):WIe(e,a);i.push(p)}function GIe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof xc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof V_,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 Ug?(x=x._value,T.appendChild(TT(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(TT(e,n.heightReference)):T.appendChild(TT(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,Vu);let I=Tn(o,"coordinates",bT(Vu,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof Tc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Wi.FIXED,Vu),v.push(bT(Vu,s));else if(x instanceof Ud){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,Vu),v.push(bT(Vu,s))}else{let I=e.sampleDuration;b.start.clone(cm),b.isStartIncluded||K.addSeconds(cm,I,cm);let R=b.stop;for(;K.lessThan(cm,R);)x.getValue(cm,Vu),E.push(K.toIso8601(cm)),v.push(bT(Vu,s)),K.addSeconds(cm,I,cm);b.isStopIncluded&&K.equals(cm,R)&&(x.getValue(cm,Vu),E.push(K.toIso8601(cm)),v.push(bT(Vu,s)))}let S=o.createElementNS(lm,"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],lm);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(YIe(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(lm,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof bl?qIe(e,n):WIe(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)),eie(e,x,T),r.push(T)}}}function WIe(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/Jne)),r}function qIe(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,lm)),p.appendChild(Tn(n,"y",g.y,lm)),p.appendChild(Tn(n,"w",g.width,lm)),p.appendChild(Tn(n,"h",g.height,lm))),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,Jne),g=i.get(t.height,Jne),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,Wn.CENTER);y===Wn.TOP?u.y+=g:y===Wn.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 ATt(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",bT(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(Tn(r,"drawOrder",m,lm)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(Tn(r,"width",A)),eie(e,t.material,y),i.push(y)}function bTt(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,Xl),c.push(`${P.toDegrees(Xl.longitude)},${P.toDegrees(Xl.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 UIe(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,Xl),s.push(`${P.toDegrees(Xl.longitude)},${P.toDegrees(Xl.latitude)},${i?Xl.height:n}`);let c=Tn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function xTt(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(UIe(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(UIe(e,p[m].positions,o,s)),a.push(y)}}return a}function zIe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof tp;if(a&&s.getMaterialType(t.material)==="Image"){TTt(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?bTt(e,t,u):xTt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(TT(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)),eie(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 TTt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(TT(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",xT(d.color))),n.push(s)}function YIe(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 ETt(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){GIe(e,t,n,i,r);return}let u=YIe(e,n),f=o.createElement("altitudeMode");f.appendChild(TT(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Vu),he.fromCartesian(Vu,s,Xl);let d=o.createElement("Location");d.appendChild(Tn(o,"longitude",P.toDegrees(Xl.longitude))),d.appendChild(Tn(o,"latitude",P.toDegrees(Xl.latitude))),d.appendChild(Tn(o,"altitude",Xl.height)),u.appendChild(d),i.push(u)}function eie(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=xT(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=xT(o.color);break;case"PolylineOutline":s=xT(o.color),c=xT(o.outlineColor),u=o.outlineWidth,n.appendChild(Tn(i,"outerColor",c,lm)),n.appendChild(Tn(i,"outerWidth",u,lm));break;case"Stripe":s=xT(o.oddColor);break}l(s)&&(n.appendChild(Tn(i,"color",s)),n.appendChild(Tn(i,"colorMode","normal")))}function TT(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 bT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Xl),i.push(`${P.toDegrees(Xl.longitude)},${P.toDegrees(Xl.latitude)},${Xl.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 xT(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 XIe=Qne;function dO(){this._cache={}}dO.prototype.fromColor=function(e,t){return E6(void 0,void 0,e,t,this._cache)};dO.prototype.fromUrl=function(e,t,n){return E6(e,void 0,t,n,this._cache)};dO.prototype.fromMakiIconId=function(e,t,n){return E6(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};dO.prototype.fromText=function(e,t,n){return E6(void 0,e,t,n,this._cache)};var CTt=new z;function vTt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,CTt).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 KIe(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 fO=new Array(4);function E6(e,t,n,i,r){fO[0]=e,fO[1]=t,fO[2]=n,fO[3]=i;let o=JSON.stringify(fO),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(vTt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return KIe(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=Iv(t,{font:`bold ${i}px sans-serif`});KIe(c,u,i)}return r[o]=a,a}var vA=dO;function tie(e){return e}function C6(e){if(e==null)return tie;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 $Ie(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function nie(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return JIe(e,n)})}:JIe(e,t)}function JIe(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=iie(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 iie(e,t){var n=C6(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&&$Ie(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 v6(e){return h.fromDegrees(e[0],e[1],e[2])}var rie={"urn:ogc:def:crs:OGC:1.3:CRS84":v6,"EPSG:4326":v6,"urn:ogc:def:crs:EPSG::4326":v6},ZIe={},QIe={},oie=48,sie,aie=z.ROYALBLUE,cie=z.YELLOW,lie=2,uie=z.fromBytes(255,255,0,100),fie=!1,DTt={small:24,medium:48,large:64},RTt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function ePe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||RTt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${ePe(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 OTt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function MTt(e,t){return new np(OTt(ePe,e,t),!0)}function S6(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=$n();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 fi(c):n(o,s))}return r}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 tPe={Feature:iPe,FeatureCollection:NTt,GeometryCollection:rPe,LineString:lPe,MultiLineString:uPe,MultiPoint:aPe,MultiPolygon:hPe,Point:sPe,Polygon:dPe,Topology:mPe},nPe={GeometryCollection:rPe,LineString:lPe,MultiLineString:uPe,MultiPoint:aPe,MultiPolygon:hPe,Point:sPe,Polygon:dPe,Topology:mPe};function iPe(e,t,n,i,r){if(t.geometry===null){S6(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=nPe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function NTt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)iPe(e,o[s],void 0,i,r)}function rPe(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=nPe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function oPe(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=DTt[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 bl;f.verticalOrigin=new fi(Wn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=S6(t,e._entityCollection,r.describe);d.billboard=f,d.position=new hu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new fi(g)}).catch(function(){f.image=new fi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function sPe(e,t,n,i,r){oPe(e,t,i,n.coordinates,r)}function aPe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)oPe(e,t,i,o[s],r)}function cPe(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 fi(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=S6(t,e._entityCollection,r.describe),u=new Il;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new fi(die(i,n)),u.arcType=ln.RHUMB}function lPe(e,t,n,i,r){cPe(e,t,i,n.coordinates,r)}function uPe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)cPe(e,t,i,o[s],r)}function fPe(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 fi(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 fi(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 fi(!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 Hc(die(i[g],n)));let d=i[0];u.hierarchy=new fi(new Hc(die(d,n),f)),d[0].length>2?u.perPositionHeight=new fi(!0):r.clampToGround||(u.height=0);let p=S6(t,e._entityCollection,r.describe);p.polygon=u}function dPe(e,t,n,i,r){fPe(e,t,i,n.coordinates,r)}function hPe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)fPe(e,t,i,o[s],r)}function mPe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=nie(n,n.objects[o]),a=tPe[s.type];a(e,s,s,i,r)}}function SA(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new rc(this),this._promises=[],this._pinBuilder=new vA,this._entityCluster=new Fd,this._credit=void 0,this._resourceCredits=[]}SA.load=function(e,t){return new SA().load(e,t)};Object.defineProperties(SA,{markerSize:{get:function(){return oie},set:function(e){oie=e}},markerSymbol:{get:function(){return sie},set:function(e){sie=e}},markerColor:{get:function(){return aie},set:function(e){aie=e}},stroke:{get:function(){return cie},set:function(e){cie=e}},strokeWidth:{get:function(){return lie},set:function(e){lie=e}},fill:{get:function(){return uie},set:function(e){uie=e}},clampToGround:{get:function(){return fie},set:function(e){fie=e}},crsNames:{get:function(){return rie}},crsLinkHrefs:{get:function(){return ZIe}},crsLinkTypes:{get:function(){return QIe}}});Object.defineProperties(SA.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}}});SA.prototype.load=function(e,t){return pPe(this,e,t,!0)};SA.prototype.process=function(e,t){return pPe(this,e,t,!1)};function pPe(e,t,n,i){Fs.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??MTt,markerSize:n.markerSize??oie,markerSymbol:n.markerSymbol??sie,markerColor:n.markerColor??aie,strokeWidthProperty:new fi(n.strokeWidth??lie),strokeMaterialProperty:new Kt(n.stroke??cie),fillMaterialProperty:new Kt(n.fill??uie),clampToGround:n.clampToGround??fie},Promise.resolve(o).then(function(a){return LTt(e,a,n,s,i)}).catch(function(a){throw Fs.setLoading(e,!1),e._error.raiseEvent(e,a),a})}SA.prototype.update=function(e){return!0};function LTt(e,t,n,i,r){let o;l(i)&&(o=eA(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=tPe[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?v6: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=rie[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=ZIe[u.href];if(l(f)||(f=QIe[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=rie[`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,Fs.setLoading(e,!1),e})})}var ET=SA;function FTt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var kn=FTt;var hie=function(e,t){return hie=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])},hie(e,t)};function Qp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");hie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Zs=function(){return Zs=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},Zs.apply(this,arguments)};function gPe(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 _Pe(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 yPe="4.1.5";var APe=Object.prototype.hasOwnProperty;function Df(e){return typeof e=="boolean"}function bPe(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 wA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function um(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var w6=/\s+/,I6=(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(w6):[],r=t.split(w6),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(w6):[],r=t.split(w6),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)APe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function TPe(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=BTt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=xPe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=xPe(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):mie(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+mie(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+mie(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 BTt(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 xPe(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,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}function EPe(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 CPe(e,t,n){return bPe(e,t,n)}var vPe=(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 I6({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"?TPe(t,i):r==="middle"?EPe(t,i):CPe(t,i)},e})();var e0=(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 SPe(e){return e>=0&&e<=31||e==127}function Kg(e){return e>=65&&e<=90||e>=97&&e<=122}function Qs(e){return e>=48&&e<=57}function P6(e){return e==34||e==39}function IA(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 fm(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 wPe(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 IPe(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 D6(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function PPe(e){return e<91?e==40:e==91||e==123}function pie(e){return e<93?e==41:e==93||e==125}var DPe=/^(?: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 gie=/https?:\/\//i,RPe=new RegExp("^"+gie.source,"i"),kTt=/^(javascript|vbscript):/i,UTt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,zTt=/^(?:\/\/)?([^/#?:]+)/,vw=Kg;function _ie(e){return Kg(e)||Qs(e)||e===43||e===45||e===46}var $g=fm;function R6(e){return e===95||$g(e)}function yie(e){return fm(e)||IPe(e)||D6(e)}function O6(e){return e===47||e===63||e===35}function Aie(e){return DPe.test(e.toLowerCase())}function OPe(e){if(kTt.test(e))return!1;var t=e.match(UTt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function MPe(e){var t=e.match(zTt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!Aie(r)}var VTt=/^(?:(?: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]?)$/,jTt=/[:/?#]/;function NPe(e){var t=e.split(jTt,1)[0];return VTt.test(t)}var HTt=/^(https?:\/\/)?(?:www\.)?/i,GTt=/^\/\//,LPe=(function(e){Qp(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=YTt(n)),this.stripPrefix.scheme&&(n=WTt(n)),this.stripPrefix.www&&(n=qTt(n)),this.stripTrailingSlash&&(n=XTt(n)),this.decodePercentEncoding&&(n=KTt(n)),n},t})(e0);function WTt(e){return e.replace(RPe,"")}function qTt(e){return e.includes("www.")?e.replace(HTt,"$1"):e}function YTt(e){return e.replace(GTt,"")}function XTt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function KTt(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 FPe=/^mailto:/i,bie=fm;function M6(e){return bie(e)||wPe(e)}function BPe(e){var t=e.split(".").pop();return Aie(t)}var kPe=(function(e){Qp(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})(e0);function xie(e){return e===95||fm(e)}function UPe(e){return e.length<=140}var zPe=["twitter","facebook","instagram","tiktok","youtube"];var VPe=(function(e){Qp(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:um(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})(e0);var $Tt={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||Kg(e)||Qs(e)}function jPe(e,t){var n=$Tt[t];return n.test(e)}var HPe=["twitter","instagram","soundcloud","tiktok","youtube"];var GPe=(function(e){Qp(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:um(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})(e0);var JTt=/[-. ()]/,ZTt=/(?:(?:(?:(\+)?\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]+#?)*/,QTt=/(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})/,eEt=new RegExp("^".concat(ZTt.source,"|").concat(QTt.source,"$"));function Eie(e){return e===45||e===46||e===32}function N6(e){return e===44||e===59}function WPe(e){var t=e.charAt(0)==="+"||JTt.test(e);return t&&eEt.test(e)}var qPe=(function(e){Qp(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})(e0);var tEt=(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),XPe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),XPe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function KPe(e,t){for(var n=new tEt(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)L6(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:aEt(n,s,r);break;case 12:cEt(n,s,r);break;case 0:nEt(n,s,r);break;case 1:iEt(n,s,r);break;case 2:rEt(n,s,r);break;case 3:oEt(n,s,r);break;case 4:sEt(n,s,i,r);break;case 5:lEt(n,s,r);break;case 6:uEt(n,s,i,r);break;case 7:fEt(n,s,i,r);break;case 13:dEt(n,s,r);break;case 14:hEt(n,s,r);break;case 8:mEt(n,s,r);break;case 9:pEt(n,s,r);break;case 10:gEt(n,s,r);break;case 15:_Et(n,s,i,r);break;case 16:yEt(n,s,i,r);break;case 17:AEt(n,s,i,r);break;case 18:bEt(n,s,i,r);break;case 19:xEt(n,s,i,r);break;case 20:TEt(n,s,r);break;case 21:EEt(n,s,r);break;case 22:CT(n,s,r);break;case 23:CEt(n,s,r);break;case 24:vEt(n,s,r);break;case 25:SEt(n,s,r);break;case 26:wEt(n,s,r);break;case 27:IEt(n,s,r);break;case 28:PEt(n,s,r);break;case 29:DEt(n,s,r);break;case 30:REt(n,s,r);break;case 31:OEt(n,s,r);break;case 32:NEt(n,s,i,r);break;case 33:LEt(n,s,r);break;case 34:FEt(n,s,r);break;case 35:BEt(n,s,r);break;case 36:kEt(n,s,i,r);break;case 37:MEt(n,s,i,r);break;case 38:UEt(n,s,i,r);break;case 39:zEt(n,s,i,r);break;case 40:VEt(n,s,r);break;case 41:jEt(n,s,r);break;default:um(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&vw(r)){var a=n.text.charCodeAt(n.charIdx-1);vw(a)||n.addMachine(F6(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return bs(n,u)});return n.matches}function L6(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(YEt(i,28));else if(n===64)e.addMachine(XEt(i,30));else if(n===47)e.addMachine(vie(i,11));else if(n===43)e.addMachine(Cie(i,37));else if(n===40)e.addMachine(Cie(i,32));else{if(Qs(n)&&(e.addMachine(Cie(i,38)),e.addMachine(WEt(i,13))),bie(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(qEt(i,r))}vw(n)&&e.addMachine(F6(i,0)),fm(n)&&e.addMachine(vie(i,5))}}function nEt(e,t,n){n===58?t.state=2:n===45?t.state=1:_ie(n)||e.removeMachine(t)}function iEt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(vie(i,11))):_ie(n)?t.state=0:e.removeMachine(t))}function rEt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):$g(n)?(t.state=5,vw(n)&&e.addMachine(F6(i,0))):e.removeMachine(t)}function oEt(e,t,n){n===47?t.state=4:yie(n)?(t.state=10,t.acceptStateReached=!0):bs(e,t)}function sEt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):$g(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function aEt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function cEt(e,t,n){$g(n)?t.state=5:e.removeMachine(t)}function lEt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:O6(n)?t.state=10:R6(n)||bs(e,t)}function uEt(e,t,n,i){i===45||(i===46?bs(e,t):$g(i)?t.state=5:bs(e,t))}function fEt(e,t,n,i){i===46?bs(e,t):$g(i)?(t.state=5,t.acceptStateReached=!0):bs(e,t)}function dEt(e,t,n){n===46?t.state=14:n===58?t.state=8:Qs(n)||(O6(n)?t.state=10:fm(n)?e.removeMachine(t):bs(e,t))}function hEt(e,t,n){Qs(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):bs(e,t)}function mEt(e,t,n){Qs(n)?t.state=9:bs(e,t)}function pEt(e,t,n){Qs(n)||(O6(n)?t.state=10:bs(e,t))}function gEt(e,t,n){yie(n)||bs(e,t)}function _Et(e,t,n,i){n.toLowerCase()==="a"?t.state=16:CT(e,t,i)}function yEt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:CT(e,t,i)}function AEt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:CT(e,t,i)}function bEt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:CT(e,t,i)}function xEt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:CT(e,t,i)}function TEt(e,t,n){n===58?t.state=21:CT(e,t,n)}function EEt(e,t,n){M6(n)?t.state=22:e.removeMachine(t)}function CT(e,t,n){n===46?t.state=23:n===64?t.state=24:M6(n)?t.state=22:e.removeMachine(t)}function CEt(e,t,n){n===46||n===64?e.removeMachine(t):M6(n)?t.state=22:e.removeMachine(t)}function vEt(e,t,n){$g(n)?t.state=25:e.removeMachine(t)}function SEt(e,t,n){n===46?t.state=27:n===45?t.state=26:R6(n)||bs(e,t)}function wEt(e,t,n){n===45||n===46?bs(e,t):R6(n)?t.state=25:bs(e,t)}function IEt(e,t,n){n===46||n===45?bs(e,t):$g(n)?(t.state=25,t.acceptStateReached=!0):bs(e,t)}function PEt(e,t,n){xie(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function DEt(e,t,n){xie(n)||bs(e,t)}function REt(e,t,n){Tie(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function OEt(e,t,n){Tie(n)||(fm(n)?e.removeMachine(t):bs(e,t))}function MEt(e,t,n,i){Qs(i)?t.state=38:(e.removeMachine(t),L6(e,n,i))}function NEt(e,t,n,i){Qs(i)?t.state=33:e.removeMachine(t),L6(e,n,i)}function LEt(e,t,n){Qs(n)?t.state=34:e.removeMachine(t)}function FEt(e,t,n){Qs(n)?t.state=35:e.removeMachine(t)}function BEt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function kEt(e,t,n,i){Qs(i)?t.state=38:Eie(i)?t.state=39:e.removeMachine(t)}function UEt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,N6(i)?t.state=40:i===35?t.state=41:Qs(i)||(i===40?t.state=32:Eie(i)?t.state=39:(bs(e,t),vw(i)&&e.addMachine(F6(r,0))))}function zEt(e,t,n,i){Qs(i)?t.state=38:i===40?t.state=32:(bs(e,t),L6(e,n,i))}function VEt(e,t,n){N6(n)||(n===35?t.state=41:Qs(n)?t.state=38:bs(e,t))}function jEt(e,t,n){N6(n)?t.state=40:Qs(n)?e.removeMachine(t):bs(e,t)}function bs(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=GEt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=gie.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!OPe(p))return;break}case 1:{if(!MPe(p))return;break}case 2:{if(!NPe(p))return;break}default:um(t)}n.push(new LPe({tagBuilder:o,matchedText:p,offset:d,urlMatchType:HEt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{BPe(p)&&n.push(new kPe({tagBuilder:o,matchedText:p,offset:d,email:p.replace(FPe,"")}));break}case 2:{UPe(p)&&n.push(new VPe({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{jPe(p,f)&&n.push(new GPe({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),WPe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new qPe({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:um(t)}}}function HEt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:um(e)}}var YPe={")":"(","}":"{","]":"["};function GEt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);PPe(r)?t[i]++:pie(r)&&t[YPe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if(pie(r)){var s=YPe[i];if(t[s]<0)t[s]++,o--;else break}else if(D6(r))o--;else break}return e.slice(0,o+1)}function F6(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function vie(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function WEt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function qEt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function YEt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function XEt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Cie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function XPe(e){return e.type===0&&e.matchType===0}var t0=(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})(),wie=new t0,KEt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=wie,this.html=t,this.callbacks=n}return e})();function $Pe(e,t){for(var n=new KEt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:$Et(n,r);break;case 1:JEt(n,r,o);break;case 2:QEt(n,r,o);break;case 3:ZEt(n,r,o);break;case 4:eCt(n,r,o);break;case 5:tCt(n,r,o);break;case 6:nCt(n,r,o);break;case 7:iCt(n,r,o);break;case 8:rCt(n,r);break;case 9:oCt(n,r);break;case 10:sCt(n,r,o);break;case 11:aCt(n,r,o);break;case 12:cCt(n,r);break;case 13:lCt(n);break;case 14:uCt(n,r);break;case 15:fCt(n,r);break;case 16:dCt(n,r);break;case 17:hCt(n,r);break;case 18:mCt(n,r);break;case 19:pCt(n,r);break;case 20:gCt(n,r);break;default:um(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&_Ct(n)}function $Et(e,t){t==="<"&&n0(e)}function JEt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new t0(Zs(Zs({},e.currentTag),{isClosing:!0}))):t==="<"?n0(e):Kg(n)?(e.state=3,e.currentTag=new t0(Zs(Zs({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=wie)}function ZEt(e,t,n){IA(n)?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{name:Sie(e)})),e.state=4):t==="<"?n0(e):t==="/"?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{name:Sie(e)})),e.state=12):t===">"?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{name:Sie(e)})),i0(e)):!Kg(n)&&!Qs(n)&&t!==":"&&Yd(e)}function QEt(e,t,n){t===">"?Yd(e):Kg(n)?e.state=3:Yd(e)}function eCt(e,t,n){IA(n)||(t==="/"?e.state=12:t===">"?i0(e):t==="<"?n0(e):t==="="||P6(n)||SPe(n)?Yd(e):e.state=5)}function tCt(e,t,n){IA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?i0(e):t==="<"?n0(e):P6(n)&&Yd(e)}function nCt(e,t,n){IA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?i0(e):t==="<"?n0(e):P6(n)?Yd(e):e.state=5)}function iCt(e,t,n){IA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Yd(e):t==="<"?n0(e):e.state=10)}function rCt(e,t){t==='"'&&(e.state=11)}function oCt(e,t){t==="'"&&(e.state=11)}function sCt(e,t,n){IA(n)?e.state=4:t===">"?i0(e):t==="<"&&n0(e)}function aCt(e,t,n){IA(n)?e.state=4:t==="/"?e.state=12:t===">"?i0(e):t==="<"?n0(e):(e.state=4,yCt(e))}function cCt(e,t){t===">"?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{isClosing:!0})),i0(e)):Yd(e)}function lCt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new t0(Zs(Zs({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new t0(Zs(Zs({},e.currentTag),{type:"doctype"})),e.state=20):Yd(e)}function uCt(e,t){t==="-"?e.state=15:t===">"?Yd(e):e.state=16}function fCt(e,t){t==="-"?e.state=18:t===">"?Yd(e):e.state=16}function dCt(e,t){t==="-"&&(e.state=17)}function hCt(e,t){t==="-"?e.state=18:e.state=16}function mCt(e,t){t===">"?i0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function pCt(e,t){t==="-"?e.state=17:t===">"?i0(e):e.state=16}function gCt(e,t){t===">"?i0(e):t==="<"&&n0(e)}function Yd(e){e.state=0,e.currentTag=wie}function n0(e){e.state=1,e.currentTag=new t0({idx:e.charIdx})}function i0(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)),Yd(e),e.currentDataIdx=e.charIdx+1}function _Ct(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Sie(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function yCt(e){e.charIdx--}var ACt=(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=bCt(t.urls),this.email=Df(t.email)?t.email:this.email,this.phone=Df(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Df(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=xCt(t.stripPrefix),this.stripTrailingSlash=Df(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Df(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&HPe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&zPe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=TCt(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 $Pe(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,_Pe([],gPe(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(ECt);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||wA(t,function(n){return n.getType()==="hashtag"}),this.email||wA(t,function(n){return n.getType()==="email"}),this.phone||wA(t,function(n){return n.getType()==="phone"}),this.mention||wA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||wA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||wA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||wA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=KPe(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 I6)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new vPe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=yPe,e})(),JPe=ACt;function bCt(e){return e==null&&(e=!0),Df(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Df(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Df(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Df(e.ipV4Matches)?e.ipV4Matches:!0}}function xCt(e){return e==null&&(e=!0),Df(e)?{scheme:e,www:e}:{scheme:Df(e.scheme)?e.scheme:!0,www:Df(e.www)?e.www:!0}}function TCt(e){return typeof e=="number"?{length:e,location:"end"}:Zs({length:Number.POSITIVE_INFINITY,location:"end"},e)}function ECt(e,t){return e.getOffset()-t.getOffset()}var B6=JPe;var sDe;typeof DOMParser<"u"&&(sDe=new DOMParser);var CCt=new B6({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),k6=32,ZPe=2414016,QPe=1,eDe=16093e3,tDe=.1,vCt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Kr={gpx:vCt};function SCt(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 Iie(e,t){let n=pO(e,"id");return n=l(n)?n:$n(),t.getOrCreateEntity(n)}function Pie(e){let t=nDe(e,"lon"),n=nDe(e,"lat"),i=hO(e,"ele",Kr.gpx);return h.fromDegrees(t,n,i)}function nDe(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 pO(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function PA(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 Die(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 hO(e,t,n){let i=PA(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function ju(e,t,n){let i=PA(e,t,n);if(l(i))return i.textContent.trim()}function aDe(e){let t=new bl;return t.width=k6,t.height=k6,t.scaleByDistance=new qt(ZPe,QPe,eDe,tDe),t.pixelOffsetScaleByDistance=new qt(ZPe,QPe,eDe,tDe),t.verticalOrigin=new fi(Wn.BOTTOM),t.image=e,t}function wCt(){let e=new Qm;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=Io.FILL_AND_OUTLINE,e}function cDe(e){let t=new Il;return t.width=4,t.material=new Vx,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var iDe={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"}},mO;typeof document<"u"&&(mO=document.createElement("div"));function Rie(e,t){let n,i="",r=Object.keys(iDe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=iDe[f];d.value=ju(e,d.tag,Kr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=CCt.link(i),mO.innerHTML=i;let s=mO.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+=`${mO.innerHTML}</div>`,mO.innerHTML="",u}function lDe(e,t,n,i){let r=Pie(t),o=Iie(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,k6);o.billboard=aDe(s);let a=ju(t,"name",Kr.gpx);o.name=a,o.label=wCt(),o.label.text=a,o.description=Rie(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function ICt(e,t,n,i){let r=Iie(t,n);r.description=Rie(t,r);let o=Die(t,"rtept",Kr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)lDe(e,o[a],n,i),s[a]=Pie(o[a]);r.polyline=cDe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function PCt(e,t,n,i){let r=Iie(t,n);r.description=Rie(t,r);let o=Die(t,"trkseg",Kr.gpx),s=[],a=[],c,u=!0,f=new Tc;for(let d=0;d<o.length;d++)c=DCt(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,k6);r.billboard=aDe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Ls,r.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}r.polyline=cDe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function DCt(e){let t={positions:[],times:[]},n=Die(e,"trkpt",Kr.gpx),i;for(let r=0;r<n.length;r++){let o=Pie(n[r]);t.positions.push(o),i=ju(n[r],"time",Kr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function RCt(e){let t=PA(e,"metadata",Kr.gpx);if(l(t)){let n={name:ju(t,"name",Kr.gpx),desc:ju(t,"desc",Kr.gpx),author:OCt(t),copyright:NCt(t),link:uDe(t),time:ju(t,"time",Kr.gpx),keywords:ju(t,"keywords",Kr.gpx),bounds:LCt(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 OCt(e){let t=PA(e,"author",Kr.gpx);if(l(t)){let n={name:ju(t,"name",Kr.gpx),email:MCt(t),link:uDe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function MCt(e){let t=PA(e,"email",Kr.gpx);if(l(t)){let n=ju(t,"id",Kr.gpx),i=ju(t,"domain",Kr.gpx);return`${n}@${i}`}}function uDe(e){let t=PA(e,"link",Kr.gpx);if(l(t)){let n={href:pO(t,"href"),text:ju(t,"text",Kr.gpx),mimeType:ju(t,"type",Kr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function NCt(e){let t=PA(e,"copyright",Kr.gpx);if(l(t)){let n={author:pO(t,"author"),year:ju(t,"year",Kr.gpx),license:ju(t,"license",Kr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function LCt(e){let t=PA(e,"bounds",Kr.gpx);if(l(t)){let n={minLat:hO(t,"minlat",Kr.gpx),maxLat:hO(t,"maxlat",Kr.gpx),minLon:hO(t,"minlon",Kr.gpx),maxLon:hO(t,"maxlon",Kr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var rDe={wpt:lDe,rte:ICt,trk:PCt};function FCt(e,t,n,i){let r=Object.keys(rDe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=rDe[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 oDe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=pO(r,"version"),s=pO(r,"creator"),a,c=RCt(r);l(c)&&(a=c.name),r.localName==="gpx"?FCt(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,tt.MINIMUM_VALUE),m=K.equals(p,tt.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 Np,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=Bs.LOOP_STOP,u.clockStep=Hr.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),BCt(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),Fs.setLoading(e,!1),e}function BCt(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 kCt(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?SCt(o).then(function(s){let a,c;try{a=sDe.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 oDe(e,a,i)}):oDe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function Sw(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new rc(this),this._entityCluster=new Fd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new vA}Sw.load=function(e,t){return new Sw().load(e,t)};Object.defineProperties(Sw.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}}});Sw.prototype.update=function(e){return!0};Sw.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Fs.setLoading(this,!0);let n=this._name,i=this;return kCt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,tt.MINIMUM_VALUE),u=K.equals(a,tt.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 Np,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=Bs.LOOP_STOP,r.clockStep=Hr.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),Fs.setLoading(i,!1),i}).catch(function(r){return Fs.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var U6=Sw;function UCt(e,t){this.position=e,this.headingPitchRoll=t}var z6=UCt;var _O=js(ef(),1);function zCt(e,t){this.position=e,this.headingPitchRange=t}var V6=zCt;function j6(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=[]}j6.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};j6.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;dDe.call(this,e,t,function(i){n.playlistIndex=0,i||fDe(n._activeEntries),n.tourEnd.raiseEvent(i)})};j6.prototype.stop=function(){fDe(this._activeEntries)};function fDe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function dDe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=VCt.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 VCt(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++,dDe.call(this,e,t,n)}}var H6=j6;var Zi=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-Zi.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?Zi.Bounce.In(e*2)*.5:Zi.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}}}}),gO=function(){return performance.now()},jCt=(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=gO()),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})(),ww={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=ww.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=ww.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=ww.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=ww.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}}},hDe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Oie=new jCt,mDe=(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=Zi.Linear.None,this._interpolationFunction=ww.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=hDe.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=Oie,Oie.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=gO()),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=gO()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=gO()),!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=Zi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=ww.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=gO()),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 C2i=hDe.nextId,r0=Oie,v2i=r0.getAll.bind(r0),S2i=r0.removeAll.bind(r0),w2i=r0.add.bind(r0),I2i=r0.remove.bind(r0),P2i=r0.update.bind(r0);var HCt={LINEAR_NONE:Zi.Linear.None,QUADRATIC_IN:Zi.Quadratic.In,QUADRATIC_OUT:Zi.Quadratic.Out,QUADRATIC_IN_OUT:Zi.Quadratic.InOut,CUBIC_IN:Zi.Cubic.In,CUBIC_OUT:Zi.Cubic.Out,CUBIC_IN_OUT:Zi.Cubic.InOut,QUARTIC_IN:Zi.Quartic.In,QUARTIC_OUT:Zi.Quartic.Out,QUARTIC_IN_OUT:Zi.Quartic.InOut,QUINTIC_IN:Zi.Quintic.In,QUINTIC_OUT:Zi.Quintic.Out,QUINTIC_IN_OUT:Zi.Quintic.InOut,SINUSOIDAL_IN:Zi.Sinusoidal.In,SINUSOIDAL_OUT:Zi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Zi.Sinusoidal.InOut,EXPONENTIAL_IN:Zi.Exponential.In,EXPONENTIAL_OUT:Zi.Exponential.Out,EXPONENTIAL_IN_OUT:Zi.Exponential.InOut,CIRCULAR_IN:Zi.Circular.In,CIRCULAR_OUT:Zi.Circular.Out,CIRCULAR_IN_OUT:Zi.Circular.InOut,ELASTIC_IN:Zi.Elastic.In,ELASTIC_OUT:Zi.Elastic.Out,ELASTIC_IN_OUT:Zi.Elastic.InOut,BACK_IN:Zi.Back.In,BACK_OUT:Zi.Back.Out,BACK_IN_OUT:Zi.Back.InOut,BOUNCE_IN:Zi.Bounce.In,BOUNCE_OUT:Zi.Bounce.Out,BOUNCE_IN_OUT:Zi.Bounce.InOut},ks=Object.freeze(HCt);function G6(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}G6.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 ue(this.view.position);t.flyToBoundingSphere(r,i)}};G6.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};G6.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=ks.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 W6=G6;function Mie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Mie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Mie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var q6=Mie;var CDe={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=v_(t),CDe[t]}},Hie;typeof DOMParser<"u"&&(Hie=new DOMParser);var GCt=new B6({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),DA=32,pDe=2414016,gDe=1,_De=16093e3,yDe=.1,ADe=[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"],bDe=["http://www.google.com/kml/ext/2.2"],WCt=["http://www.w3.org/2005/Atom"],Ve={kml:ADe,gx:bDe,atom:WCt,kmlgx:ADe.concat(bDe)},Gie={Document:NDe,Folder:uvt,Placemark:fvt,NetworkLink:bvt,GroundOverlay:_vt,PhotoOverlay:BDe,ScreenOverlay:gvt,Tour:hvt},kie=class{constructor(t){this._dataSource=t,this._deferred=tf(),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=Jg._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=Jg._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=Gie[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||Jg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function qCt(e){let t=e.slice(0,Math.min(4,e.size)),n=tf(),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 YCt(e){let t=tf(),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 vDe(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 SDe(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 XCt(e,t){let n=await e.getData(new WR);n=vDe(n),n=SDe(n),t.kml=Hie.parseFromString(n,"application/xml")}async function Nie(e,t){let n=CDe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new HR(n));t[e.filename]=i}function Rf(e,t,n,i){let r=i.keys,o=new _O.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 _O.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 Of(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=Wie(a,i);l(c)&&s.setAttribute(n,c.url)}}function wDe(e,t,n){let i=Aa(e,"id");i=l(i)&&i.length!==0?i:$n(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=$n(),l(n)&&(i=n+i)),r=t.add(new Qr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new jie),r}function yO(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function $6(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 Y6(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++]=$6(n[s],t);return r}function RA(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 Aa(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Qi(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 xDe(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 dm(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=Qi(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ln(e,t,n){let i=Qi(e,t,n);if(l(i))return i.textContent.trim()}function hm(e,t,n){let i=Qi(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Wie(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 _O.default(t.getUrlComponent()),s=new _O.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Hu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Uie(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?(Hu.maximumRed=o,Hu.red=void 0):(Hu.maximumRed=void 0,Hu.red=0),r>0?(Hu.maximumGreen=r,Hu.green=void 0):(Hu.maximumGreen=void 0,Hu.green=0),i>0?(Hu.maximumBlue=i,Hu.blue=void 0):(Hu.maximumBlue=void 0,Hu.blue=0),Hu.alpha=n,z.fromRandom(Hu)):new z(o,r,i,n)}function vT(e,t,n){let i=Ln(e,t,n);if(l(i))return Uie(i,Ln(e,"colorMode",n)==="random")}function KCt(e){let t=Qi(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 Ls;return r.addInterval(new Cn({start:i,stop:tt.MAXIMUM_VALUE})),r}function $Ct(e){let t=Qi(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=Qi(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=Qi(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 Ls,n.addInterval(new Cn({start:r,stop:s}))}else l(r)?(n=new Ls,n.addInterval(new Cn({start:r,stop:tt.MAXIMUM_VALUE}))):l(s)&&(n=new Ls,n.addInterval(new Cn({start:tt.MINIMUM_VALUE,stop:s})));return n}function IDe(){let e=new bl;return e.width=DA,e.height=DA,e.scaleByDistance=new qt(pDe,gDe,_De,yDe),e.pixelOffsetScaleByDistance=new qt(pDe,gDe,_De,yDe),e}function qie(){let e=new ep;return e.outline=!0,e.outlineColor=z.WHITE,e}function PDe(){let e=new Qm;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=Io.FILL_AND_OUTLINE,e}function Yie(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=Wie(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(Xf(K6(d))),l(p)&&s.setQueryParameters(Xf(K6(p)));let g=t._ellipsoid;return Kie(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function JCt(e,t,n,i,r){let o=vi(t,"scale",Ve.kml),s=vi(t,"heading",Ve.kml),a=vT(t,"color",Ve.kml),c=Qi(t,"Icon",Ve.kml),u=Yie(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=Qi(t,"hotSpot",Ve.kml),y=RA(m,"x"),A=RA(m,"y"),b=Aa(m,"xunits"),x=Aa(m,"yunits"),T=n.billboard;l(T)||(T=IDe(),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-DA)*o:b==="fraction"&&(E=-y*DA*o),E+=DA*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+DA)*o:x==="fraction"&&(v=A*DA*o),v-=DA*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function X6(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")JCt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=PDe(),n.label=c),c.scale=vi(a,"scale",Ve.kml)??c.scale,c.fillColor=vT(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Il,n.polyline=c),c.width=vi(a,"width",Ve.kml),c.material=vT(a,"color",Ve.kml),l(vT(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(hm(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=qie(),n.polygon=c),c.material=vT(a,"color",Ve.kml)??c.material,c.fill=hm(a,"fill",Ve.kml)??c.fill,c.outline=hm(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Uie(Ln(a,"bgColor",Ve.kml))??z.WHITE,u=Uie(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 ZCt(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")X6(e,d,o,i,r);else{let p=dm(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=Qi(m,"Style",Ve.kml);X6(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 QCt(e,t,n){return t.fetchXML().then(function(i){return DDe(e,i,n,t,!0)})}function DDe(e,t,n,i,r,o){let s,a,c,u,f=xDe(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Aa(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),X6(e,u,c,i,o)))}let d=xDe(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=Aa(A,"id"),l(a)){let b=dm(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=Qi(T,"Style",Ve.kml),X6(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(QCt(e,x,n))}}}return p}function Xie(e,t,n){let i=new iA(e,t.id,["position"]),r=new Ug(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Il,t.polyline.positions=new tA([i,r])}function RDe(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 evt(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 Ug(e))}function tvt(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 J6(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():PDe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():IDe(),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 ODe(e,t){let n=e.path;l(n)||(n=new j_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function nvt(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=hm(n,"extrude",Ve.kml),u=e._ellipsoid,f=$6(o,u);return i.position=f,J6(e,i,r,RDe(s,a)),c&&yO(s,a)&&Xie(t,i,r),!0}function TDe(e,t,n,i,r){let o=Qi(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=hm(n,"extrude",Ve.kml),u=hm(n,"tessellate",Ve.kml),f=yO(s,a),d=vi(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=Y6(o,p),m=r.polyline;if(f&&c){let y=new H_;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 Il;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(tt.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 Il,i.polyline=m,m.positions=tvt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function ivt(e,t,n,i,r){let o=Qi(n,"outerBoundaryIs",Ve.kml),s=Qi(o,"LinearRing",Ve.kml),a=Qi(s,"coordinates",Ve.kml),c=e._ellipsoid,u=Y6(a,c),f=hm(n,"extrude",Ve.kml),d=Ln(n,"altitudeMode",Ve.kml),p=Ln(n,"altitudeMode",Ve.gx),g=yO(d,p),m=l(r.polygon)?r.polygon.clone():qie(),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 Hc(u),b=dm(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=dm(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=Qi(s[T],"coordinates",Ve.kml),u=Y6(a,c),l(u)&&A.holes.push(new Hc(u))}m.hierarchy=A}return!0}function rvt(e,t,n,i,r){let o=Ln(n,"altitudeMode",Ve.kml),s=Ln(n,"altitudeMode",Ve.gx),a=dm(n,"coord",Ve.gx),c=dm(n,"angles",Ve.gx),u=dm(n,"when",Ve.kml),f=hm(n,"extrude",Ve.kml),d=yO(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=$6(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new Tc;return A.addSamples(y,m),i.position=A,J6(e,i,r,RDe(o,s)),ODe(i,r),i.availability=new Ls,u.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),d&&f&&Xie(t,i,r),!0}function EDe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new Tc;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:evt(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 ovt(e,t,n,i,r){let o=hm(n,"interpolate",Ve.gx),s=dm(n,"Track",Ve.gx),a,c,u,f=!1,d=new sA,p=new Ls,g=new xc,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=dm(b,"when",Ve.kml),T=dm(b,"coord",Ve.gx),E=Ln(b,"altitudeMode",Ve.kml),v=Ln(b,"altitudeMode",Ve.gx),S=yO(E,v),I=hm(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=$6(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&EDe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),EDe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,J6(e,i,r),ODe(i,r),f&&(Xie(t,i,r),i.polyline.show=d),!0}var MDe={Point:nvt,LineString:TDe,LinearRing:TDe,Polygon:ivt,Track:rvt,MultiTrack:ovt,MultiGeometry:svt,Model:avt};function svt(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=MDe[f.localName];if(l(d)){let p=wDe(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 avt(e,t,n,i,r){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function cvt(e,t){let n=Qi(e,"ExtendedData",Ve.kml);if(!l(n))return;l(Qi(n,"SchemaData",Ve.kml))&&yt("kml-schemaData","KML - SchemaData is unsupported"),l(Aa(n,"xmlns:prefix"))&&yt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=dm(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Aa(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 lvt(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=GCt.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&&(Rf(kr,"a","href",i),Rf(kr,"link","href",i),Rf(kr,"area","href",i),Rf(kr,"img","src",i),Rf(kr,"iframe","src",i),Rf(kr,"video","src",i),Rf(kr,"audio","src",i),Rf(kr,"source","src",i),Rf(kr,"track","src",i),Rf(kr,"input","src",i),Rf(kr,"embed","src",i),Rf(kr,"script","src",i),Rf(kr,"video","poster",i)),Of(kr,"a","href",r),Of(kr,"link","href",r),Of(kr,"area","href",r),Of(kr,"img","src",r),Of(kr,"iframe","src",r),Of(kr,"video","src",r),Of(kr,"audio","src",r),Of(kr,"source","src",r),Of(kr,"track","src",r),Of(kr,"input","src",r),Of(kr,"embed","src",r),Of(kr,"script","src",r),Of(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 Z6(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=wDe(t,i,n.context),c=a.kml,u=ZCt(e,t,n.styleCollection,o,s),f=Ln(t,"name",Ve.kml);a.name=f,a.parent=r;let d=$Ct(t);l(d)||(d=KCt(t)),a.availability=d,$ie(a);function p(T){return T?T.show&&p(T.parent):!0}let g=hm(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=Qi(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=Qi(t,"link",Ve.atom),b=c.link;b.href=Aa(A,"href"),b.hreflang=Aa(A,"hreflang"),b.rel=Aa(A,"rel"),b.type=Aa(A,"type"),b.title=Aa(A,"title"),b.length=Aa(A,"length"),c.address=Ln(t,"address",Ve.kml),c.phoneNumber=Ln(t,"phoneNumber",Ve.kml),c.snippet=Ln(t,"Snippet",Ve.kml),cvt(t,a),lvt(t,a,u,s,o);let x=e._ellipsoid;return FDe(t,a,x),LDe(t,a,x),l(Qi(t,"Region",Ve.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function NDe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function uvt(e,t,n,i){let r=Z6(e,t,n),o=Ze(n);o.parentEntity=r.entity,NDe(e,t,o,i)}function fvt(e,t,n,i){let r=Z6(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=MDe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),J6(e,o,s))}var dvt={FlyTo:pvt,Wait:mvt,SoundCue:Lie,AnimatedUpdate:Lie,TourControl:Lie};function hvt(e,t,n,i){let r=Ln(t,"name",Ve.kml),o=Aa(t,"id"),s=new H6(r,o),a=Qi(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=dvt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function Lie(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function mvt(e,t){let n=vi(t,"duration",Ve.gx);e.addPlaylistEntry(new q6(n))}function pvt(e,t,n){let i=vi(t,"duration",Ve.gx),r=Ln(t,"flyToMode",Ve.gx),o={kml:{}};FDe(t,o,n),LDe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new W6(i,r,s);e.addPlaylistEntry(a)}function LDe(e,t,n){let i=Qi(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=Bc.fromDegrees(a,c-90,u);t.kml.camera=new z6(f,d)}}function FDe(e,t,n){let i=Qi(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 rm(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new V6(d,f)}}function gvt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=Qi(t,"Icon",Ve.kml),c=Yie(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=Qi(t,"screenXY",Ve.kml),p=Qi(t,"overlayXY",Ve.kml),g=Qi(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=RA(g,"x"),y=RA(g,"y"),A=Aa(g,"xunits"),b=Aa(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=RA(p,"x"),y=RA(p,"y"),A=Aa(p,"xunits"),b=Aa(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=RA(d,"x"),y=RA(d,"y"),A=Aa(d,"xunits"),b=Aa(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 _vt(e,t,n,i){let o=Z6(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=Y6(Qi(t,"LatLonQuad",Ve.gx),c),f=vi(t,"drawOrder",Ve.kml);if(l(u))s=qie(),s.hierarchy=new Hc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new tp,s.zIndex=f,o.rectangle=s;let m=Qi(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=Qi(t,"Icon",Ve.kml),p=Yie(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=vT(t,"color",Ve.kml),s.material.transparent=!0}else s.material=vT(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 BDe(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 OA={INTERVAL:0,EXPIRE:1,STOP:2};function K6(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var yvt=new ie,Iw=new he,Fie=new U,Avt=new h;function Kie(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??yvt,l(n)&&(Fie.x=n.clientWidth*.5,Fie.y=n.clientHeight*.5,u=t.pickEllipsoid(Fie,o,Avt)),l(u)?f=o.cartesianToCartographic(u,Iw):(f=ie.center(r,Iw),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,Iw),c=c.replace("[cameraLon]",P.toDegrees(Iw.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(Iw.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(Iw.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(Xf(c))}function bvt(e,t,n,i){let o=Z6(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Qi(t,"Link",Ve.kml);if(l(c)||(c=Qi(t,"Url",Ve.kml)),l(c)){let u=Ln(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=Wie(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(Xf(K6(b))),l(x)&&u.setQueryParameters(Xf(K6(x)));let T=e._ellipsoid;Kie(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new rc,y=Vie(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,$ie(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=Qi(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:$n(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Xf(Ln(v,"cookie",Ve.kml)??""),O=vi(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=OA.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=OA.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=OA.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 xvt(e,t,n,i){let r=Gie[t.localName];return l(r)?r(e,t,n,i):BDe(e,t,n,i)}function zie(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Qi(a,"Document",Ve.kml),u=Ln(c,"name",Ve.kml);l(u)||(u=eA(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Jg._DeferredLoading(e),d=new rc(e);return Promise.all(DDe(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(Gie[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(),xvt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function Tvt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");IR({workerURI:o,wasmURI:s});let a=new pT(new Uu(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(Nie(d,f)),d=g):u.push(Nie(g,f)))}if(l(d)&&u.push(XCt(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),zie(e,t,f.kml,i,f,r)}function Vie(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?qCt(u).then(function(f){return f?Tvt(e,t,u,r,a):YCt(u).then(function(d){d=vDe(d),d=SDe(d);let p,g;try{p=Hie.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 zie(e,t,p,r,o,a,s)})}):zie(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var Jg=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 rc(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new vA,this._networkLinks=new kt,this._entityCluster=new Fd,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,Fs.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Vie(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,tt.MINIMUM_VALUE),f=K.equals(c,tt.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 Np,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=Bs.LOOP_STOP,o.clockStep=Hr.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),Fs.setLoading(r,!1),r}).catch(function(o){return Fs.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;Bie.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];Bie.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 kt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!Bie.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===OA.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===OA.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===OA.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 rc,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;Kie(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Vie(r,m,y,{context:p.id}).then(Evt(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 $ie(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 Evt(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=Qi(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(Qi(a,"Update",Ve.kml))){yt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Xf(Ln(a,"cookie",Ve.kml)??""),u=vi(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===OA.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===OA.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,$ie(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,tt.MINIMUM_VALUE),S=K.equals(E,tt.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 Bie=new kt,jie=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}};Jg._DeferredLoading=kie;Jg._getTimestamp=xn;var Pw=Jg;function AO(){pe.throwInstantiationError()}AO.prototype.update=pe.throwInstantiationError;AO.prototype.getBoundingSphere=pe.throwInstantiationError;AO.prototype.isDestroyed=pe.throwInstantiationError;AO.prototype.destroy=pe.throwInstantiationError;var kDe=AO;var Dw=`in vec4 position; +in vec2 textureCoordinates; +out vec2 v_textureCoordinates; +void main() +{ +gl_Position = position; +v_textureCoordinates = textureCoordinates; +} +`;function Q6(e){this._context=e}var bO,Cvt=new at({primitiveType:Oe.TRIANGLES}),vvt=new hi({color:new z(0,0,0,0)});function Svt(e,t){return new vs({context:e,colorTextures:[t],destroyAttachments:!1})}function wvt(e,t){return en.fromCache({context:e,vertexShaderSource:Dw,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Ivt(e,t){return(!l(bO)||bO.viewport.width!==e||bO.viewport.height!==t)&&(bO=Ge.fromCache({viewport:new et(0,0,e,t)})),bO}Q6.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:wvt(r,e.fragmentShaderSource),a=Svt(r,t),c=Ivt(n,i),u=e.uniformMap,f=vvt;f.framebuffer=a,f.renderState=c,f.execute(r);let d=Cvt;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)};Q6.prototype.isDestroyed=function(){return!1};Q6.prototype.destroy=function(){return le(this)};var eH=Q6;function Pvt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var vc=Pvt;var 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)}},tH=Jie;function mm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(mm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});mm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function Dvt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}mm.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)?Dvt(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 en({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};mm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){Zie(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};mm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};mm.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 en({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 Zie(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];Zie(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}mm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Zie(this,n),--this._numberOfShaders}this._shadersToRelease={}};mm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};mm.prototype.isDestroyed=function(){return!1};mm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var nH=mm;function ST(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(ST.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});ST.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};ST.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};ST.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={}};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var iH=ST;var Qie={};function Rvt(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var Ovt=32.184,Mvt=2451545;function i1e(e,t){t=K.addSeconds(e,Ovt,t);let n=K.totalDays(t)-Mvt;return t=K.addSeconds(t,Rvt(n),t),t}var rH=new K(2451545,0,ai.TAI),Nvt=1e3,Xd=P.RADIANS_PER_DEGREE,Mf=P.RADIANS_PER_ARCSECOND,Sc=14959787e4,UDe=new $;function r1e(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=Fvt(o-i,t),d=Lvt(t,0);Vvt(c,n,u,UDe);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(UDe,s,s)}function Lvt(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function Fvt(e,t){let n=Uvt(e,t);return zvt(n,t)}var Bvt=50,kvt=P.EPSILON8;function Uvt(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<Bvt&&Math.abs(r-i)>kvt;++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 zvt(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 Vvt(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 jvt=1.0000010178*Sc,Hvt=100.46645683*Xd,Gvt=129597742283429e-5*Mf,zDe=16002,VDe=21863,jDe=32004,HDe=10931,GDe=14529,WDe=16368,qDe=15318,YDe=32794,Wvt=64*1e-7*Sc,qvt=-152*1e-7*Sc,Yvt=62*1e-7*Sc,Xvt=-8*1e-7*Sc,Kvt=32*1e-7*Sc,$vt=-41*1e-7*Sc,Jvt=19*1e-7*Sc,Zvt=-11*1e-7*Sc,Qvt=-150*1e-7*Sc,eSt=-46*1e-7*Sc,tSt=68*1e-7*Sc,nSt=54*1e-7*Sc,iSt=14*1e-7*Sc,rSt=24*1e-7*Sc,oSt=-28*1e-7*Sc,sSt=22*1e-7*Sc,XDe=10,KDe=16002,$De=21863,JDe=10931,ZDe=1473,QDe=32004,e1e=4387,t1e=73,aSt=-325*1e-7,cSt=-322*1e-7,lSt=-79*1e-7,uSt=232*1e-7,fSt=-52*1e-7,dSt=97*1e-7,hSt=55*1e-7,mSt=-41*1e-7,pSt=-105*1e-7,gSt=-137*1e-7,_St=258*1e-7,ySt=35*1e-7,ASt=-116*1e-7,bSt=-88*1e-7,xSt=-112*1e-7,TSt=-80*1e-7,Rw=new K(0,0,ai.TAI);function ESt(e,t){i1e(e,Rw);let i=(Rw.dayNumber-rH.dayNumber+(Rw.secondsOfDay-rH.secondsOfDay)/Un.SECONDS_PER_DAY)/(Un.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=jvt+Wvt*Math.cos(zDe*r)+Qvt*Math.sin(zDe*r)+qvt*Math.cos(VDe*r)+eSt*Math.sin(VDe*r)+Yvt*Math.cos(jDe*r)+tSt*Math.sin(jDe*r)+Xvt*Math.cos(HDe*r)+nSt*Math.sin(HDe*r)+Kvt*Math.cos(GDe*r)+iSt*Math.sin(GDe*r)+$vt*Math.cos(WDe*r)+rSt*Math.sin(WDe*r)+Jvt*Math.cos(qDe*r)+oSt*Math.sin(qDe*r)+Zvt*Math.cos(YDe*r)+sSt*Math.sin(YDe*r),s=Hvt+Gvt*i+aSt*Math.cos(XDe*r)+pSt*Math.sin(XDe*r)+cSt*Math.cos(KDe*r)+gSt*Math.sin(KDe*r)+lSt*Math.cos($De*r)+_St*Math.sin($De*r)+uSt*Math.cos(JDe*r)+ySt*Math.sin(JDe*r)+fSt*Math.cos(ZDe*r)+ASt*Math.sin(ZDe*r)+dSt*Math.cos(QDe*r)+bSt*Math.sin(QDe*r)+hSt*Math.cos(e1e*r)+xSt*Math.sin(e1e*r)+mSt*Math.cos(t1e*r)+TSt*Math.sin(t1e*r),a=.0167086342-.0004203654*i,c=102.93734808*Xd+11612.3529*Mf*i,u=469.97289*Mf*i,f=174.87317577*Xd-8679.27034*Mf*i;return r1e(o,a,u,c,f,s,t)}function o1e(e,t){i1e(e,Rw);let i=(Rw.dayNumber-rH.dayNumber+(Rw.secondsOfDay-rH.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*Xd,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Xd,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Xd,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*Xd,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*Xd+Mf*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*Xd+Mf*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*Xd+Mf*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*Xd+Mf*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*Xd-Mf*(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*=Nvt;let F=u+f*Mf,V=d+p*Mf,B=y+A*Mf,j=g+m*Mf;return r1e(a,c,F,V,j,B,t)}var n1e=.012300034,CSt=n1e/(n1e+1)*-1;function vSt(e,t){return t=o1e(e,t),h.multiplyByScalar(t,CSt,t)}var s1e=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),xO=new h;Qie.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),xO=ESt(e,xO),t=h.negate(xO,t),vSt(e,xO),h.subtract(t,xO,t),$.multiplyByVector(s1e,t,t),t};Qie.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=o1e(e,t),$.multiplyByVector(s1e,t,t),t};var wT=Qie;function SSt(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var MA=SSt;function Ow(){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(Ow.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 l1e(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return l1e(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 tre(this),this._view3D}},viewRotation:{get:function(){return tre(this),this._viewRotation}},viewRotation3D:{get:function(){return tre(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return d1e(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return d1e(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return BSt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return kSt(this),this._modelView}},modelView3D:{get:function(){return USt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return WSt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return zSt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return VSt(this),this._inverseModelView3D}},viewProjection:{get:function(){return jSt(this),this._viewProjection}},inverseViewProjection:{get:function(){return HSt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return GSt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return qSt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return YSt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return XSt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return KSt(this),this._normal}},normal3D:{get:function(){return $St(this),this._normal3D}},inverseNormal:{get:function(){return JSt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return ZSt(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 f1e(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return f1e(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 wSt(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 ISt(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function PSt(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function DSt(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var a1e=new h,RSt=new M,c1e=new $;function OSt(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,a1e)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,a1e)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,RSt);e._enuToModel=M.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu);let s=M.getRotation(o,c1e),a=$.multiply(e._viewRotation,s,c1e);e._eyeToEnu=$.transpose(a,e._eyeToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var ere=new $,MSt=new he;function NSt(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,ere);let n=wT.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(ere,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=wT.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(ere,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,MSt);i.project(o,e._sunPositionColumbusView)}Ow.prototype.updateCamera=function(e){wSt(this,e.viewMatrix),ISt(this,e.inverseViewMatrix),OSt(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};Ow.prototype.updateFrustum=function(e){PSt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&DSt(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};Ow.prototype.updatePass=function(e){this._pass=e};var LSt=[],FSt=new MA;Ow.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),NSt(this,e);let n=e.light??FSt;n instanceof MA?(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??LSt,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 l1e(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 BSt(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 kSt(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function USt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function zSt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function VSt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function jSt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function HSt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function GSt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function WSt(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 qSt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function YSt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function XSt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function KSt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function $St(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function JSt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function ZSt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var u1e=new h;function f1e(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,u1e),Sn.fromCartesian(u1e,e._encodedCameraPositionMC))}var QSt=new h,ewt=new h,twt=new h,nwt=new h,iwt=new he,rwt=new h,owt=new M;function swt(e,t,n,i,r,o,s,a){let c=QSt;c.x=e.y,c.y=e.z,c.z=e.x;let u=ewt;u.x=n.y,u.y=n.z,u.z=n.x;let f=twt;f.x=i.y,f.y=i.z,f.z=i.x;let d=nwt;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,iwt);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,rwt),y=At.eastNorthUpToFixedFrame(m,g,owt);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 tre(e){e._view3DDirty&&(e._mode===re.SCENE3D?M.clone(e._view,e._view3D):swt(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 d1e(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var oH=Ow;function Gu(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):awt(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=$n(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new nH(this),this._textureCache=new iH,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),zt._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),zt._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),zt._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),zt._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),zt._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),zt._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),zt._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),zt._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),zt._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),zt._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),zt._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),zt._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);zt._minimumAliasedLineWidth=d[0],zt._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);zt._minimumAliasedPointSize=p[0],zt._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);zt._maximumViewportWidth=g[0],zt._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);zt._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);zt._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!ts(f,["OES_standard_derivatives"]),this._blendMinmax=!!ts(f,["EXT_blend_minmax"]),this._elementIndexUint=!!ts(f,["OES_element_index_uint"]),this._depthTexture=!!ts(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!ts(f,["EXT_frag_depth"]),this._debugShaders=ts(f,["WEBGL_debug_shaders"]),this._textureFloat=!!ts(f,["OES_texture_float"]),this._textureHalfFloat=!!ts(f,["OES_texture_half_float"]),this._textureFloatLinear=!!ts(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!ts(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!ts(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!ts(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!ts(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!ts(f,["EXT_color_buffer_half_float"]),this._s3tc=!!ts(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!ts(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!ts(f,["WEBGL_compressed_texture_astc"]),this._etc=!!ts(f,["WEBG_compressed_texture_etc"]),this._etc1=!!ts(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!ts(f,["EXT_texture_compression_bptc"]),of.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?ts(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,zt._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=ts(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=ts(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=ts(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,zt._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,zt._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 oH,C=new vc(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<zt._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 awt(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 cwt(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 lwt(e,t,n,i){let r=`${cwt(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function uwt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(lwt(e,t,n,i))}function fwt(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 dwt(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,fwt(e,r,t))}return i}function ts(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var hwt={};Object.defineProperties(Gu.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=dwt(this._originalGLContext,e?uwt: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 us({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 hwt}}});function h1e(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 nre;typeof WebGLRenderingContext<"u"&&(nre=[te.BACK]);function sH(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=nre;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var mwt=new hi;Gu.prototype.clear=function(e,t){e=e??mwt,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;h1e(this,a,t,!0);let c=e.framebuffer??t.framebuffer;sH(this,c),n.clear(i)};function pwt(e,t,n,i,r){sH(e,t),h1e(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function gwt(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()}Gu.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,pwt(this,r,t,n,o),gwt(this,e,n,i)};Gu.prototype.beginFrame=function(){};Gu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=nre;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)};Gu.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=nt.createPixelBuffer({context:this,sizeInBytes:$e.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return sH(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};Gu.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 sH(this,s),t.readPixels(n,i,r,o,$e.RGBA,ze.toWebGLConstant(a,this),u),u};var m1e={position:0,textureCoordinates:1};Gu.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:m1e,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Gu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:en.fromCache({context:this,vertexShaderSource:Dw,fragmentShaderSource:e,attributeLocations:m1e}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Gu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Gu.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 tH(this._pickObjects,t,z.fromRgba(t))};Gu.prototype.isDestroyed=function(){return!1};Gu.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(),le(this)};var Mw=Gu;function _wt(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 us({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var aH=_wt;function cH(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new Mw(this._canvas,Ze(e?.contextOptions)),this._canvases=[]}cH.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)}}})};cH.prototype.destroy=function(){this._context.destroy(),le(this)};cH.prototype.isDestroyed=function(){return!1};var lH=cH;function IT(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}IT.create=function(e){return new IT(e)};IT.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};IT.prototype.isDestroyed=function(){return!1};IT.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};IT.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 uH=IT;function NA(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 Gt}=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??$n(),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,_1e(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");p1e(this,n),this._initialized=!0}else g1e(this);m.bindTexture(this._textureTarget,null)}function p1e(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=ire(y),A=ire(A),b=ire(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}NA.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?(p1e(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),g1e(this)),this._initialized=!0),d||ywt(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function ywt(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 ire(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function g1e(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)}NA.create=function(e){return new NA(e)};Object.defineProperties(NA.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){_1e(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 _1e(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=Zn.NEAREST),$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Zn.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)}NA.prototype.generateMipmap=function(e){e=e??Ah.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)};NA.prototype.isDestroyed=function(){return!1};NA.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var fH=NA;var y1e={NONE:0,LERC:1};Object.freeze(y1e);var pm=y1e;var A1e={NONE:0,BITS12:1};Object.freeze(A1e);var lc=A1e;var TO=new h,Awt=new h,Kd=new U,bwt=new M,xwt=new M,Twt=Math.pow(2,12);function wc(e,t,n,i,r,o,s,a,c,u){let f=lc.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,Awt),A=i-n;Math.max(h.maximumComponent(y),A)<Twt-1?f=lc.BITS12:f=lc.NONE;let x=M.fromScale(y,bwt);x=M.setTranslation(x,g,x);let T=M.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,TO),xwt);T=M.multiplyByTranslation(T,h.negate(g,TO),T),p=M.clone(r,new M);let E=M.getTranslation(r,TO);E=h.subtract(E,e,TO),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()}wc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===lc.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,TO),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,Kd);let p=cn.compressTextureCoordinates(Kd);U.fromElements(n.z,d,Kd);let g=cn.compressTextureCoordinates(Kd);U.fromElements(c,u,Kd);let m=cn.compressTextureCoordinates(Kd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Kd);let y=cn.compressTextureCoordinates(Kd);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 Ewt=new h,b1e=new h;wc.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,Ewt),c=n.geodeticSurfaceNormal(a,b1e),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+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 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]}};wc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===lc.BITS12){let i=cn.decompressTextureCoordinates(e[t],Kd);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Kd);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)};wc.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,b1e),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};wc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===lc.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};wc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===lc.BITS12?cn.decompressTextureCoordinates(e[t+1],Kd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};wc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===lc.BITS12?cn.decompressTextureCoordinates(e[t+3],Kd).x:e[t+6]};wc.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)};wc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.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===lc.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 dH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},hH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};wc.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===lc.NONE){s(dH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(dH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(dH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(hH.compressed0,a?4:3),c&&s(hH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(hH.geodeticSurfaceNormal,3)}return o};wc.prototype.getAttributeLocations=function(){return this.quantization===lc.NONE?dH:hH};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=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 Ro=wc;var o0={};o0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var rre=new h,Cwt=new M,vwt=new h,Swt=new h;o0.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??o0.DEFAULT_STRUCTURE,D=w.heightScale??o0.DEFAULT_STRUCTURE.heightScale,N=w.heightOffset??o0.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??o0.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??o0.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??o0.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??o0.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,Cwt),we,ve;R&&(we=Ti.geodeticLatitudeToMercatorAngle(T),ve=1/(Ti.geodeticLatitudeToMercatorAngle(v)-we));let Re=vwt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=Swt;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,pi;R&&(pi=(Ti.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,ub=$r*Om,ii=new h;ii.x=Es+Mc*Fn,ii.y=Ha+qf*Fn,ii.z=ub+zs*Fn,M.multiplyByPoint(ge,ii,rre),h.minimumByComponent(rre,Re,Re),h.maximumByComponent(rre,Qe,Qe),He=Math.min(He,Fn),qe[Ir]=ii,vt[Ir]=new U(Fi,Ki),st[Ir]=Fn,R&&(jt[Ir]=pi),C&&(lt[Ir]=m.geodeticSurfaceNormal(ii))}}let Li=ue.fromPoints(qe),Yn;l(b)&&(Yn=Qt.fromRectangle(b,Ae,fe,m));let yi;I&&(yi=new Op(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let zi=new td(Re,Qe,S),Si=new Ro(S,zi,He,fe,xe,!1,R,C,O,L),ui=new Float32Array(Pe*Si.stride),Ai=0;for(let zn=0;zn<Pe;++zn)Ai=Si.encode(ui,Ai,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:yi}};var EO=o0;function LA(){pe.throwInstantiationError()}Object.defineProperties(LA.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});LA.prototype.interpolateHeight=pe.throwInstantiationError;LA.prototype.isChildAvailable=pe.throwInstantiationError;LA.prototype.createMesh=pe.throwInstantiationError;LA.prototype.upsample=pe.throwInstantiationError;LA.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;LA.maximumAsynchronousTasks=5;var Nf=LA;var wwt=3,sre=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new are}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&Dwt(this,n);let s=this._inverseTransform,a=Pwt;a.origin=M.multiplyByPoint(s,t.origin,a.origin),a.direction=M.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return T1e(this._rootNode,a,c),Lwt(this,c,t,i,r,o)}},Iwt=new Jn("incrementallyBuildTerrainPicker"),are=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=x1e(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=x1e(n.x,n.y,n.level),this.children[t]=n}},Pwt=new gn,mH=[new h,new h,new h];function Dwt(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 Rwt=new h,Owt=new h;function x1e(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,Rwt),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,Owt);return td.fromCorners(r,o)}function Mwt(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 Nwt=new Gs;function T1e(e,t,n){let i=xi.rayAxisAlignedBoundingBox(t,e.aabb,Nwt);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++)T1e(e.children[o],t,n)}function Lwt(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=Fwt(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 Fwt(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>=wwt)&&!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=ore(a,r,o,t,u,c[3*A],mH[0]),x=ore(a,r,o,t,u,c[3*A+1],mH[1]),T=ore(a,r,o,t,u,c[3*A+2],mH[2]),E=xi.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&Mwt(g,m,mH,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);kwt(e._inverseTransform,n,m,g)}return s}var Bwt=new he;function ore(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,Bwt);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 kwt(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=Iwt.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 pH=sre;function CO(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 pH(t,n,p)}CO.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?Uwt(this,this._transform):qwt(this,t,this._transform))};function Uwt(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=Qt.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return Qt.computeTransformation(s,t),M.getScale(t,cre).z<=P.EPSILON16&&(cre.z=1,M.setScale(t,cre,t)),t}var zwt=new h,Vwt=new h,jwt=new he,Hwt=new he,Gwt=new h,Wwt=new h,cre=new h;function qwt(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,jwt),zwt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,Hwt),Vwt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,Gwt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,Wwt);return M.fromTranslation(d,n),M.setScale(n,f,n),M.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}CO.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};CO.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};CO.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var Ic=CO;function Zg(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??pm.NONE;let t=EO.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===pm.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Zg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var E1e="createVerticesFromHeightmap",Ywt=new Jn(E1e),Xwt=new Jn(E1e,Nf.maximumAsynchronousTasks);Zg.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?Xwt:Ywt).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=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new Ic(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Qt.clone(x.orientedBoundingBox),Ro.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};Zg.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=EO.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=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new Ic(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};Zg.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===pm.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=C1e(A,b,f,d,e,i,r,t,n)}else y=Kwt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};Zg.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)),_=C1e(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,$wt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new Zg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Zg.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};Zg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Kwt(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=gH(e,t,n,i,r,m*s+p),T=gH(e,t,n,i,r,m*s+g),E=gH(e,t,n,i,r,y*s+p),v=gH(e,t,n,i,r,y*s+g);return v1e(A,b,x,T,E,v)}function C1e(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 v1e(y,A,b,x,T,E)}function v1e(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function gH(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 $wt(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 ll=Zg;function Fw(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var PT=new ie;function Jwt(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}Fw.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)Jwt(e,g,p,s)||s.push(new Nw(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,PT);let a=PT.west,c=PT.north;o.tileXYToRectangle(i,r,e,PT);let u=PT.east,f=PT.south,d=new nIt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];lre(g.extent,d)&&iIt(this._maximumLevel,g,d)}};Fw.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Lw(i.extent,e)){t=i;break}}return l(t)?vO(void 0,t,e):-1};var Zwt=[],Qwt=[],eIt=new ie,tIt=new ie;Fw.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Zwt;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,eIt)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,tIt))):t.push(e);let n=Qwt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)SO(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 S1e=new he;Fw.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,PT);return ie.center(i,S1e),this.computeMaximumLevelAtPosition(S1e)>=e};Fw.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 Nw(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(Nw.prototype,{nw:{get:function(){return this._nw||(this._nw=new Nw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Nw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Nw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Nw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function nIt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function lre(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 iIt(e,t,n){for(;t.level<e;)if(_H(t.nw.extent,n))t=t.nw;else if(_H(t.ne.extent,n))t=t.ne;else if(_H(t.sw.extent,n))t=t.sw;else if(_H(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,rIt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function rIt(e,t){return e.level-t}function _H(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Lw(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function vO(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&Lw(t._nw.extent,n),s=t._ne&&Lw(t._ne.extent,n),a=t._sw&&Lw(t._sw.extent,n),c=t._se&&Lw(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,vO(t,t._nw,n))),s&&(i=Math.max(i,vO(t,t._ne,n))),a&&(i=Math.max(i,vO(t,t._sw,n))),c&&(i=Math.max(i,vO(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];Lw(a,n)&&(i=a.level)}t=t.parent}return i}function SO(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||lre(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]=oIt(e[s.level],s)}SO(e,t._nw,n),SO(e,t._ne,n),SO(e,t._sw,n),SO(e,t._se,n)}function oIt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];lre(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 s0=Fw;var sIt=15;function w1e(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}w1e.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 aIt(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 rr(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 Bo(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"?pm.LERC:pm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new s0(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new s0(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.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 cIt(e,t,n){try{let i=await t.fetchJson();aIt(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw no.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function FA(){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(FA.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}}});FA.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 w1e(t);await cIt(r,i);let o=new FA(t);return r.build(o),o._resource=n,o};FA.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(ure(this,n+1,e*2,t*2))){let d=I1e(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 ll({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):sIt,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 ure(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}FA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};FA.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=ure(this,n,e,t);if(l(i))return i;I1e(this,n,e,t)};FA.prototype.loadTileDataAvailability=function(e,t,n){};function lIt(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 uIt(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=lIt(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 I1e(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:ra.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=uIt(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 ure(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 P1e=FA;var D1e="https://dev.virtualearth.net/REST/v1/Locations";function fre(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:D1e,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(fre.prototype,{url:{get:function(){return D1e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});fre.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 R1e=fre;function dre(){}Object.defineProperties(dre.prototype,{credit:{get:function(){}}});dre.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 O1e=dre;var fIt=new se,M1e=new h,Bw=new h;function dIt(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=fIt;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,M1e),h.multiplyByScalar(d,.5,d),p=M.multiplyByVector(sx.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],M1e),h.multiplyByScalar(f,.5,f),p=M.multiplyByVector(sx.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=M.multiplyByVector(BA.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,Bw),h.add(r,Bw,r),h.multiplyByScalar(f,p.z,Bw),h.add(r,Bw,r),h.multiplyByScalar(d,p.w,Bw),h.add(r,Bw,r)}}var hIt=new h,mIt=new h;function BA(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=hIt,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=mIt,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=dIt(this),this._lastTimeIndex=0}Object.defineProperties(BA.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}}});BA.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);BA.prototype.findTimeInterval=Or.prototype.findTimeInterval;BA.prototype.wrapTime=Or.prototype.wrapTime;BA.prototype.clampTime=Or.prototype.clampTime;BA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var N1e=BA;var hre={},pIt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},gIt=new he,_It=new h,yIt=new M,AIt=new M,bIt=new M,xIt=new h,TIt=new h,EIt=new h,CIt=new h,vIt=new he,SIt=new U,wO=new h,wIt=new U,IIt=new h,PIt=new h,yH=function(e,t){return e-t};hre.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=ue.clone(e.boundingSphere,new ue),p=Qt.clone(e.orientedBoundingBox,new Qt),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?iy.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,gIt);I.height=.5*(s+a);let R=he.toCartesian(I,m,_It),O=At.eastNorthUpToFixedFrame(R,m,yIt),L=M.inverseTransformation(O,AIt),_=M.unpack(o.nodes[0].matrix,0,bIt);_=M.multiply(qi.Y_UP_TO_Z_UP,_,_);let C=cPt(o,i,pIt),w=Xr.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=Xr.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=Ti.geodeticLatitudeToMercatorAngle(T),ve=1/(Ti.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,xIt),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,TIt),He=new Ro(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,EIt),jt=M.multiplyByPoint(_,vt,CIt),lt=he.fromCartesian(jt,m,vIt),{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,yH)>=0?rt=0:Pr(fe,st,yH)>=0&&(rt=1),Pr(Ae,st,yH)>=0?ht=0:Pr(xe,st,yH)>=0&&(ht=1);let Li=U.fromElements(rt,ht,SIt),Yn;if(i){let ui=h.unpack(N,st*3,wO);ui=M.multiplyByPointAsVector(_,ui,wO),ui=h.normalize(ui,wO),Yn=cn.octEncode(ui,wIt)}let yi;r&&(yi=(Ti.geodeticLatitudeToMercatorAngle(ft)-ge)*ve);let zi;f&&(zi=m.geodeticSurfaceNormal(jt,IIt)),Pe=He.encode(Ke,Pe,jt,Li,Yt,Yn,yi,zi);let Si=M.multiplyByPoint(L,jt,PIt);Re=h.minimumByComponent(Si,Re,Re),Qe=h.maximumByComponent(Si,Qe,Qe)}let qe=new Ic(h.clone(He.center,new h),Ke,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Ye,Qt.clone(p,new Qt),He,Q,W,J,Z);return V1e(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var DIt=new U,RIt=new U,OIt=new Array(6),MIt=new U,NIt=new U,LIt=new U,FIt=new h,BIt=new h,kIt=new h,UIt=new he,zIt=new h,VIt=new he,jIt=new he,L1e=new h,HIt=new h,GIt=new h,WIt=new h,qIt=new h,YIt=new h,XIt=new h,KIt=new h,$It=new M,JIt=new M,F1e=new U,ZIt=new U,QIt=new h,ePt=new ue,tPt=new Qt,nPt=new td,B1e=new h,k1e=new U,iPt=new U,U1e=new h,rPt=new h;function oPt(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);iy.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 sPt(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);iy.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=wO;y.x=p,y.y=g,y.z=m,y=h.normalize(y,wO),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function aPt(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 iy.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function AH(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 iy.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function cPt(e,t,n){return n.positions=oPt(e),n.normals=t?sPt(e):void 0,n.indices=aPt(e),n.edgeIndicesWest=AH(e,"left"),n.edgeIndicesSouth=AH(e,"bottom"),n.edgeIndicesEast=AH(e,"right"),n.edgeIndicesNorth=AH(e,"top"),n}hre.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=Ro.clone(e.parentEncoding,new Ro),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=[];xPt(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,UIt);_.height=.5*(i+r);let C=he.toCartesian(_,x,zIt),w=T.length,D=new Ro(C,void 0,void 0,void 0,void 0,d,p,A,g,m),N=D.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.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,$It),xe=M.inverseTransformation(fe,JIt),ge=b.west,we=b.east,ve=b.south,Re=b.north,Qe=Ti.geodeticLatitudeToMercatorAngle(ve),Ye=1/(Ti.geodeticLatitudeToMercatorAngle(Re)-Qe),Ke=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,XIt),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,KIt);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],yi=ZIt;yi.x=E[Yt*2+0],yi.y=E[Yt*2+1];let zi=yi.x,Si=yi.y,ui=v[Yt*2+0],Ai=v[Yt*2+1],zn=1-ui-Ai,tn=f.decodeHeight(u,ht),Hn=f.decodeHeight(u,Li),Ki=f.decodeHeight(u,Yn),wr=tn*ui+Hn*Ai+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,jIt),$r=he.toCartesian(zs,x,HIt),pi=M.multiplyByPoint(xe,$r,WIt);qe=h.minimumByComponent(pi,qe,qe),st=h.maximumByComponent(pi,st,st);let ao;if(d){let Fn=f.decodeNormal(u,ht,FIt),Vi=f.decodeNormal(u,Li,BIt),Fi=f.decodeNormal(u,Yn,kIt),Ir=h.fromElements(Fn.x*ui+Vi.x*Ai+Fi.x*zn,Fn.y*ui+Vi.y*Ai+Fi.y*zn,Fn.z*ui+Vi.z*Ai+Fi.z*zn,B1e);Ir=h.normalize(Ir,B1e),ao=cn.octEncode(Ir,iPt)}let nr;p&&(nr=(Ti.geodeticLatitudeToMercatorAngle(Ts)-Qe)*Ye);let jo;A&&(jo=x.geodeticSurfaceNormal($r,rPt)),Ae=D.encode(ae,Ae,$r,yi,wr,ao,nr,jo)}let vt=Qt.fromRectangle(b,Ke,Pe,x,tPt),jt=ue.fromVertices(ae,D.center,N,ePt),mt=new Op(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(D.center,ae,N,D.center,Ke,QIt),ft=new Ic(h.clone(D.center,new h),ae,q,B,w,Ke,Pe,b,ue.clone(jt),h.clone(mt),N,Qt.clone(vt),D,Q,W,J,Z);return V1e(ft,b,x,qe,st,fe,xe,o),ft};function V1e(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;Xr.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,qIt),k=h.clone(r,YIt),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,F1e),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,VIt),Ye=he.toCartesian(He,n,L1e),Ke;d&&(Ke=c.getOctEncodedNormal(f,ae,k1e));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Ye,U1e)),x=c.encode(f,x,Ye,Ae,Qe,Ke,Pe,qe);let st=M.multiplyByPoint(s,Ye,GIt);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=td.fromCorners(j,k,nPt),W=new Ro(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,L1e),c.decodeTextureCoordinates(f,fe,F1e),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,k1e):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,U1e):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var mre=0,lPt=1,pre=2,gre=3,uPt=4,fPt=new h,dPt=[new h,new h,new h,new h,new h,new h],hPt=[new U,new U,new U,new U,new U,new U],mPt=[new h,new h,new h,new h,new h,new h],pPt=[new U,new U,new U,new U,new U,new U];function z1e(e,t,n,i){switch(n){case mre:return P.sign(i.x-e.x);case pre:return P.sign(t.x-i.x);case gre:return P.sign(i.y-e.y);default:return P.sign(t.y-i.y)}}function gPt(e,t,n,i,r,o){let s,a,c;switch(n){case mre:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case pre:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case gre: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 _Pt={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 yPt(e,t,n,i,r,o,s,a){let c,u=hPt,f=dPt,d=3,p=pPt;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=mPt;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)%uPt,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=z1e(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=z1e(n,i,y,I);if(v*O===-1){let L=gPt(n,i,y,T,I,fPt),{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 APt(e,t,n,i,r,o,s,a){return yPt(e?t?gre:mre:t?pre:lPt,2,n,i,r,o,s,a)}var bPt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function xPt(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=DIt;E.x=A,E.y=x;let v=RIt;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,MIt),C=s.decodeTextureCoordinates(o,O,NIt),w=s.decodeTextureCoordinates(o,L,LIt),D=APt(e,t,E,v,_,C,w,_Pt),N=D.length;if(N<3)continue;let F=OIt;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=bPt[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 IO=hre;var bH={};bH.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};bH.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)};bH.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 a0=bH;function e_(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=Qt.clone(e.orientedBoundingBox,new Qt),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(e_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});e_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:H1e(i,e,t,n)};e_.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 j1e="createVerticesFromCesium3DTilesTerrain",TPt=new Jn(j1e),EPt=new Jn(j1e,Nf.maximumAsynchronousTasks);e_.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?EPt:TPt,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=Ro.clone(g.encoding,new Ro),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=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),D=Qt.clone(d._orientedBoundingBox,new Qt),N=new Ic(_,y,T,R,b,O,L,c,C,w,m.stride,D,m,E,S,v,I);return d._mesh=N,Promise.resolve(N)})};e_.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=IO.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)})};e_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:xH(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};e_.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:xH(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};e_.prototype.wasCreatedByUpsampling=function(){return!1};function Qg(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}Qg.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};Qg.prototype.upsample=function(e,t,n,i,r,o,s){return xH(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};Qg.prototype._upsampleSync=function(e,t,n,i,r,o,s){return xH(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};Qg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return H1e(i,e,t,n)};Qg.prototype.wasCreatedByUpsampling=function(){return!0};Qg.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(Qg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var CPt=new Jn("upsampleVerticesFromCesium3DTilesTerrain",Nf.maximumAsynchronousTasks);function xH(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=IO.upsampleMesh(b),E=new Qg({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=CPt.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Ro.clone(T.encoding,new Ro),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=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=Qt.clone(T.orientedBoundingBox,new Qt),q=new Ic(B,S,L,N,R,F,V,y,j,k,v,G,E,_,w,C,D),Q=new Qg({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var vPt=new U,SPt=new U,wPt=new U,IPt=new h;function H1e(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,vPt),m=a.decodeTextureCoordinates(s,d,SPt),y=a.decodeTextureCoordinates(s,p,wPt),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=a0.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,IPt);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 TH=e_;function gm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(gm.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}}});gm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new gm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};gm.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};gm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)G1e(this,t)};gm.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++,G1e(this,i),t};gm.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],W1e(this,0)),this._array[e-1]=void 0,t};gm.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=_re(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&W1e(this,n)}return this._array[e-1]=void 0,t};gm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};gm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[_re(this,1,2)?1:2]};function EH(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function PO(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function _re(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function G1e(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=PO(e,t,i);for(r!==n&&(EH(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(PO(e,t,o)!==r)break;EH(e,t,o),t=o}}function W1e(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){PO(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;PO(e,f,o)===i&&(o=f)}}if(PO(e,o,t)===i&&(EH(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);_re(e,o,a)===i&&EH(e,o,a)}t=o}}var kA=gm;function c0(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 rr({ellipsoid:this._ellipsoid}),this._subtreeCache=new DT({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}c0.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 c0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=xu.fromJson(c);return r._tileset0=new Cg(n,s,u),r._tileset1=new Cg(n,a,u),r};c0.fromIonAssetId=async function(e,t){let n=await qo.fromAssetId(e);return c0.fromUrl(n,t)};var PPt=new Array(3);c0.prototype.requestTileGeometry=async function(e,t,n,i){let r=Y1e(n,e),o=r===0?this._tileset0:this._tileset1,s=X1e(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 ly.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=>vC(new Uint8Array(x))),b=PPt;b[0]=p,b[1]=A,b[2]=f?A.then(x=>DPt(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(Ih.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(Ih.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(Ih.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(Ih.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),D=d._ellipsoid,N=Qt.fromRectangle(w,I,R,D,new Qt),F=d.getLevelMaximumGeometricError(n)*5,V=CH(o,T,s,0,0),B=CH(o,T,s,1,0),j=CH(o,T,s,0,1),k=CH(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new TH({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}};c0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=Y1e(n,e),o=r===0?this._tileset0:this._tileset1,s=X1e(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 Y1e(e,t){let n=1<<e;return t/n|0}function X1e(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new vg({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function DPt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new Jb({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 oy({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function CH(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=yre(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function yre(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new vg({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}c0.prototype.loadTileDataAvailability=function(e,t,n){};c0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(c0.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 RPt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function DT(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new kA({comparator:DT.comparator}),this._provider=e.provider}DT.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};DT.prototype.addSubtree=function(e,t){let n=new RPt(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()};DT.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}};DT.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=yre(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=q1e(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=q1e(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function q1e(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=yre(e,r,s,a);return t.getDescendantCoordinates(c)}DT.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var K1e=c0;function UA(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=SH(e.westIndices,r,t),this._southIndices=SH(e.southIndices,o,t),this._eastIndices=SH(e.eastIndices,r,t),this._northIndices=SH(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(UA.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 vH=[];function SH(e,t,n){vH.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)vH[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(vH.sort(t),je.createTypedArray(n,vH)):e}var $1e="createVerticesFromQuantizedTerrainMesh",OPt=new Jn($1e),MPt=new Jn($1e,Nf.maximumAsynchronousTasks);UA.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?MPt:OPt).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=Ro.clone(g.encoding);return p._mesh=new Ic(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 NPt=new Jn("upsampleQuantizedTerrainMesh",Nf.maximumAsynchronousTasks);UA.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=NPt.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 UA({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.clone(T.boundingSphere),orientedBoundingBox:Qt.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 Are=32767,J1e=new h;UA.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=Are;let r=P.clamp((n-e.south)/e.height,0,1);return r*=Are,l(this._mesh)?kPt(this,i,r):UPt(this,i,r)};function Z1e(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 LPt=new U,FPt=new U,BPt=new U;function kPt(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,LPt),g=o.decodeTextureCoordinates(r,f,FPt),m=o.decodeTextureCoordinates(r,d,BPt);if(Z1e(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=a0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,J1e);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 UPt(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(Z1e(t,n,p,y,g,A,m,b)){let x=a0.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,J1e);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/Are)}}}}UA.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};UA.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var kw=UA;function zPt(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 eRe(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=[]}eRe.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 tRe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=no.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=no.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=no.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 rr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Bo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Xr.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=no.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 s0(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 s0(e.tilingScheme,u),g=new s0(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 zPt({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 Tre(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function VPt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Tre(e,n);throw new oe(i)}async function jPt(e,t,n){await tRe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new s0(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 Tre(e,t){try{let n=await e.layerJsonResource.fetchJson();return jPt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await tRe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):VPt(e,n,t)}}function _m(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 bre={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Q1e(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 HPt(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new ll({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 GPt(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 ue(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===bre.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===bre.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===bre.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let ve=No(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=Qt.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new kw({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})}_m.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=Ere(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)})):nRe(this,e,t,n,o,i)};function nRe(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=Q1e(void 0)):u=Q1e(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)?HPt(e,m,i,t,n):GPt(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(_m.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}}});_m.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};_m.fromIonAssetId=async function(e,t){let n=await qo.fromAssetId(e);return _m.fromUrl(n,t)};_m.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 eRe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Tre(i);let r=new _m(t);return i.build(r),r};_m.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(Ere(this,e,t,n,i[o],o===0).result)return;return!1};_m.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=Ere(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function xre(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 Ere(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=xre(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:ra.TERRAIN});d=nRe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=xre(r,f.x,f.y,f.level)}return{result:!1}}_m._getAvailabilityTile=xre;var Uw=_m;function t_(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 Lu(n),this._workerName="createCircleGeometry"}t_.packedLength=Lu.packedLength;t_.pack=function(e,t,n){return Lu.pack(e._ellipseGeometry,t,n)};var iRe=new Lu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Pc={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};t_.unpack=function(e,t,n){let i=Lu.unpack(e,t,iRe);return Pc.center=h.clone(i._center,Pc.center),Pc.ellipsoid=ee.clone(i._ellipsoid,Pc.ellipsoid),Pc.ellipsoid=ee.clone(i._ellipsoid,iRe._ellipsoid),Pc.height=i._height,Pc.extrudedHeight=i._extrudedHeight,Pc.granularity=i._granularity,Pc.vertexFormat=Be.clone(i._vertexFormat,Pc.vertexFormat),Pc.stRotation=i._stRotation,Pc.shadowVolume=i._shadowVolume,l(n)?(Pc.semiMajorAxis=i._semiMajorAxis,Pc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Lu(Pc),n):(Pc.radius=i._semiMajorAxis,new t_(Pc))};t_.createGeometry=function(e){return Lu.createGeometry(e._ellipseGeometry)};t_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new t_({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(t_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var rRe=t_;function zw(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 Vd(n),this._workerName="createCircleOutlineGeometry"}zw.packedLength=Vd.packedLength;zw.pack=function(e,t,n){return Vd.pack(e._ellipseGeometry,t,n)};var WPt=new Vd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Lf={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};zw.unpack=function(e,t,n){let i=Vd.unpack(e,t,WPt);return Lf.center=h.clone(i._center,Lf.center),Lf.ellipsoid=ee.clone(i._ellipsoid,Lf.ellipsoid),Lf.height=i._height,Lf.extrudedHeight=i._extrudedHeight,Lf.granularity=i._granularity,Lf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Lf.semiMajorAxis=i._semiMajorAxis,Lf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Vd(Lf),n):(Lf.radius=i._semiMajorAxis,new zw(Lf))};zw.createGeometry=function(e){return Vd.createGeometry(e._ellipseGeometry)};var oRe=zw;function qPt(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 wH=qPt;function YPt(e){return e=e??H.EMPTY_OBJECT,Uw.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var IH=YPt;function XPt(e){return e=e??H.EMPTY_OBJECT,Uw.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var Vw=XPt;function jw(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new rr({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xr.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(jw.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}}});jw.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 ll({buffer:c,width:o,height:s})})};jw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jw.prototype.getTileDataAvailable=function(e,t,n){};jw.prototype.loadTileDataAvailability=function(e,t,n){};var sRe=jw;var KPt=1953029805,$Pt=2917034100;function Cre(e,t){if(Cre.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===KPt||r===$Pt)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++}Cre.passThroughDataForTesting=!1;var PH=Cre;function aRe(e){this.proxy=e}aRe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var cRe=aRe;function Hw(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new rr({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(Hw.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(){}}});Hw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new ll({buffer:new Uint8Array(256),width:16,height:16}))};Hw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Hw.prototype.getTileDataAvailable=function(e,t,n){};Hw.prototype.loadTileDataAvailability=function(e,t,n){};var n_=Hw;function l0(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 ca,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function vre(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(l0.prototype,{projectionMatrix:{get:function(){return vre(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return vre(this),this._infinitePerspective}}});var JPt=new h,ZPt=new h,QPt=new h,eDt=new h;l0.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,JPt),d=ZPt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=QPt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=eDt;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};l0.prototype.getPixelDimensions=function(e,t,n,i,r){vre(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};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&&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 Wu=l0;function qu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Wu,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}qu.packedLength=6;qu.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};qu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new qu),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 ym(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(qu.prototype,{projectionMatrix:{get:function(){return ym(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ym(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ym(this),this._fovy}},sseDenominator:{get:function(){return ym(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ym(this),this._offCenterFrustum}}});qu.prototype.computeCullingVolume=function(e,t,n){return ym(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};qu.prototype.getPixelDimensions=function(e,t,n,i,r){return ym(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};qu.prototype.clone=function(e){return l(e)||(e=new qu),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};qu.prototype.equals=function(e){return!l(e)||!(e instanceof qu)?!1:(ym(this),ym(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};qu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof qu)?!1:(ym(this),ym(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 er=qu;var DH=0,tDt=1;function RT(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof er?(s=DH,a=er.packedLength):t instanceof _n&&(s=tDt,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}RT.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===DH?(er.pack(r,t,n),n+=er.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 nDt=new er,iDt=new _n,rDt=new Le,oDt=new h,sDt=new Be;RT.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===DH?(r=er.unpack(e,t,nDt),t+=er.packedLength):(r=_n.unpack(e,t,iDt),t+=_n.packedLength);let o=h.unpack(e,t,oDt);t+=h.packedLength;let s=Le.unpack(e,t,rDt);t+=Le.packedLength;let a=Be.unpack(e,t,sDt);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new RT({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 Gw(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 aDt=new $,cDt=new M,Sre=new M,lRe=new h,uRe=new h,fRe=new h,lDt=new h,uDt=new h,fDt=new h,zA=new Array(3),DO=new Array(4);DO[0]=new se(-1,-1,1,1);DO[1]=new se(1,-1,1,1);DO[2]=new se(1,1,1,1);DO[3]=new se(-1,1,1,1);var dRe=new Array(4);for(let e=0;e<4;++e)dRe[e]=new se;RT._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,aDt),u=o??lRe,f=s??uRe,d=a??fRe;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,cDt),g,m,y=i.projectionMatrix;if(n===DH){let A=M.multiply(y,p,Sre);m=M.inverse(A,Sre)}else g=M.inverseTransformation(p,Sre);l(m)?(zA[0]=i.near,zA[1]=i.far):(zA[0]=0,zA[1]=i.near,zA[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(DO[b],dRe[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,zA[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=zA[A],v=zA[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}};RT.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);RT._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=lRe,b=uRe,x=fRe,T=h.negate(A,lDt),E=h.negate(b,uDt),v=h.negate(x,fDt);u=0,o&&(Gw(u,p,g,m,y,v,A,b),u+=12),Gw(u,p,g,m,y,x,T,b),u+=12,Gw(u,p,g,m,y,T,v,b),u+=12,Gw(u,p,g,m,y,E,v,T),u+=12,Gw(u,p,g,m,y,A,x,b),u+=12,Gw(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:ue.fromVertices(c)})};var Ww=RT;var wre=0,dDt=1;function RO(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof er?(o=wre,s=er.packedLength):t instanceof _n&&(o=dDt,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}RO.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===wre?(er.pack(r,t,n),n+=er.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 hDt=new er,mDt=new _n,pDt=new Le,gDt=new h;RO.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===wre?(r=er.unpack(e,t,hDt),t+=er.packedLength):(r=_n.unpack(e,t,mDt),t+=_n.packedLength);let o=h.unpack(e,t,gDt);t+=h.packedLength;let s=Le.unpack(e,t,pDt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new RO({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};RO.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);Ww._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:ue.fromVertices(s)})};var RH=RO;function OH(){pe.throwInstantiationError()}Object.defineProperties(OH.prototype,{credit:{get:pe.throwInstantiationError}});OH.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};OH.prototype.geocode=pe.throwInstantiationError;var OO=OH;var hRe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(hRe);var OT=hRe;function mRe(){pe.throwInstantiationError()}mRe.createGeometry=function(e){pe.throwInstantiationError()};var pRe=mRe;function _Dt(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 MH=_Dt;var EDt=js(Ire(),1);function yDt(e,t){return(e&t)!==0}var Kl=yDt;var ADt=[1,2,4,8],gRe=15,bDt=16,xDt=64,TDt=128;function u0(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}u0.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 u0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};u0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};u0.prototype.hasSubtree=function(){return Kl(this._bits,bDt)};u0.prototype.hasImagery=function(){return Kl(this._bits,xDt)};u0.prototype.hasTerrain=function(){return Kl(this._bits,TDt)};u0.prototype.hasChildren=function(){return Kl(this._bits,gRe)};u0.prototype.hasChild=function(e){return Kl(this._bits,ADt[e])};u0.prototype.getChildBitmask=function(){return this._bits&gRe};var NH=u0;function CDt(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 vDt=CDt(`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\x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\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\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 Ff(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(Ff.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Ff.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 Ff;i._resource=n;try{await SDt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${yRe(i,"",1).url}: ${r}`;throw new oe(o)}return i};Ff.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Kl(t,o)?Kl(e,o)&&(s|=1):(s|=2,Kl(e,o)||(s|=1)),i+=s}return i};Ff.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];Kl(s,2)?Kl(s,1)||(t|=o):(n|=o,Kl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Ff.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 _Re=new Jn("decodeGoogleEarthEnterprisePacket");Ff.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=yRe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return _Re.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=NH.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}})})};Ff.prototype.populateSubtree=function(e,t,n,i){let r=Ff.tileXYToQuadKey(e,t,n);return Rre(this,r,i)};function Rre(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}),Rre(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}),Rre(e,t,s)}).finally(function(){delete a[r]})}Ff.prototype.getTileInformation=function(e,t,n){let i=Ff.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Ff.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function yRe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Pre,Dre;function SDt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Dre)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Dre=EE(n).then(function(){Pre=window.cesiumGoogleEarthDbRootParser(EDt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Dre.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Pre.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 _Re.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Pre.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=vDt})}var VA=Ff;function MT(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(MT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var xRe="createVerticesFromGoogleEarthEnterpriseBuffer",wDt=new Jn(xRe),IDt=new Jn(xRe,Nf.maximumAsynchronousTasks),ARe=new ie,LH=new ie;MT.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,ARe),t.tileXYToRectangle(n,i,r,LH);let u=c.cartographicToCartesian(ie.center(LH)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?IDt:wDt).scheduleTask({buffer:this._buffer,nativeRectangle:ARe,rectangle:LH,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 Ic(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,LH,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Qt.clone(y.orientedBoundingBox),Ro.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})};MT.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)?MDt(this,i,r):FDt(this,i,r,e)};var PDt=new Jn("upsampleQuantizedTerrainMesh",Nf.maximumAsynchronousTasks);MT.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=PDt.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 kw({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.clone(m.boundingSphere),orientedBoundingBox:Qt.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})})};MT.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};MT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var DDt=new U,RDt=new U,ODt=new U,TRe=new h;function MDt(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,DDt),g=o.decodeTextureCoordinates(r,f,RDt),m=o.decodeTextureCoordinates(r,d,ODt),y=a0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,TRe);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 NDt=Uint16Array.BYTES_PER_ELEMENT,bRe=Uint32Array.BYTES_PER_ELEMENT,Ore=Int32Array.BYTES_PER_ELEMENT,LDt=Float32Array.BYTES_PER_ELEMENT,Mre=Float64Array.BYTES_PER_ELEMENT;function FDt(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+=bRe;u+=bRe,u+=2*Mre;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=Mre;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=Mre;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Ore;let y=c.getInt32(u,!0)*3;u+=Ore,u+=Ore;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+=LDt;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=NDt;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=a0.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,TRe);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 NO=MT;var $d={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},FH=new K;function BH(){this._terrainCache={},this._lastTidy=K.now()}BH.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};BH.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};BH.prototype.tidy=function(){if(K.now(FH),K.secondsDifference(FH,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(FH,o.timestamp)>10&&delete e[r]}K.clone(FH,this._lastTidy)}};function jA(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new rr({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 BH,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(jA.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(){}}});jA.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new jA(t);return n._metadata=e,n};var BDt=new Jn("decodeGoogleEarthEnterprisePacket");function ERe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===$d.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}jA.prototype.requestTileGeometry=function(e,t,n,i){let r=VA.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=$d.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new NO({buffer:u,childTileMask:ERe(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===$d.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new ll({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case $d.SELF:p=a.terrainVersion;break;case $d.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case $d.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=kDt(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?BDt.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=$d.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=$d.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 NO({buffer:b,childTileMask:ERe(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=$d.NONE,Promise.reject(b))})};jA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jA.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=VA.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===$d.NONE)return!1;if((!l(s)||s===$d.UNKNOWN)&&(o.terrainState=$d.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:ra.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};jA.prototype.loadTileDataAvailability=function(e,t,n){};function kDt(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 CRe=jA;var UDt="https://maps.googleapis.com/maps/api/geocode/json",vRe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function Nre(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:UDt,queryParameters:{key:t}}),this._credit=new It(vRe,!0)}Object.defineProperties(Nre.prototype,{credit:{get:function(){return this._credit}}});Nre.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:vRe,collapsible:!1}}})};var SRe=Nre;function zDt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var kH=zDt;var zRe={},VDt=32.184,jDt=2451545,wRe=-.0529921,IRe=-.1059842,PRe=13.0120009,DRe=13.3407154,RRe=.9856003,ORe=26.4057084,MRe=13.064993,NRe=.3287146,LRe=1.7484877,FRe=-.1589763,BRe=.0036096,kRe=.1643573,URe=12.9590088,Lre=new K;zRe.ComputeMoon=function(e,t){l(e)||(e=K.now()),Lre=K.addSeconds(e,VDt,Lre);let n=K.totalDays(Lre)-jDt,i=n/Un.DAYS_PER_JULIAN_CENTURY,r=(125.045+wRe*n)*P.RADIANS_PER_DEGREE,o=(250.089+IRe*n)*P.RADIANS_PER_DEGREE,s=(260.008+PRe*n)*P.RADIANS_PER_DEGREE,a=(176.625+DRe*n)*P.RADIANS_PER_DEGREE,c=(357.529+RRe*n)*P.RADIANS_PER_DEGREE,u=(311.589+ORe*n)*P.RADIANS_PER_DEGREE,f=(134.963+MRe*n)*P.RADIANS_PER_DEGREE,d=(276.617+NRe*n)*P.RADIANS_PER_DEGREE,p=(34.226+LRe*n)*P.RADIANS_PER_DEGREE,g=(15.134+FRe*n)*P.RADIANS_PER_DEGREE,m=(119.743+BRe*n)*P.RADIANS_PER_DEGREE,y=(239.961+kRe*n)*P.RADIANS_PER_DEGREE,A=(25.053+URe*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*wRe+.1208*N*IRe-.0642*F*PRe+.0158*V*DRe+.0252*B*RRe-.0066*j*ORe-.0047*k*MRe-.0046*G*NRe+.0028*q*LRe+.0052*Q*FRe+.004*W*BRe+.0019*J*kRe-.0044*Z*URe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new kH),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var UH=zRe;function VRe(e){(!l(e)||typeof e!="function")&&(e=UH.ComputeMoon),this._computeFunction=e}var HDt=new h,GDt=new h,WDt=new h;function qDt(e,t,n){let i=HDt;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=WDt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,GDt);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 YDt=new $,XDt=new Le;VRe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=qDt(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,XDt),s=$.fromQuaternion(Le.conjugate(o,o),YDt);return $.multiply(s,i,i)};var zH=VRe;var Fre=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()}},jRe=Fre;var HRe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(HRe);var HA=HRe;function Bre(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Bre.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Bre.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===OT.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 VH=Bre;function KDt(e){if(!Object.values(HA).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var GRe=Object.freeze({[HA.GOOGLE]:"google",[HA.BING]:"bing",[HA.DEFAULT]:void 0});function $Dt(e){return GRe[e]}function JDt(e){return Object.entries(GRe).find(t=>t[1]===e)[0]}function kre(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??HA.DEFAULT,n=e.accessToken??lf.defaultAccessToken,i=De.createIfNeeded(e.server??lf.defaultServer);i.appendForwardSlash();let r=lf.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 VH(o),this.geocodeProviderType=t}Object.defineProperties(kre.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return JDt(this._pelias.url.queryParameters.geocoder)},set:function(e){KDt(e);let t={...this._pelias.url.queryParameters,geocoder:$Dt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});kre.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var qw=kre;var WRe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(WRe);var qRe=WRe;var YRe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(YRe);var XRe=YRe;var KRe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(KRe);var jH=KRe;var $Re={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze($Re);var JRe=$Re;function ZRe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function QRe(e){let t=he.fromCartesian(e);return{longitude:P.toDegrees(t.longitude),latitude:P.toDegrees(t.latitude),height:t.height}}function ZDt(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 QDt(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 e1t=new M,t1t=new M,HH=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??lf.defaultAccessToken,r=De.createIfNeeded(n.server??lf.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:qo._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=QDt(n,i,e1t);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,t1t),i={testPoint:QRe(t.testPoint),closePoint:QRe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??jH.NEAREST,worldToView:ZDt(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=ZRe(r.snapPoint),o.hitPoint=ZRe(r.hitPoint),o}};HH.DEFAULT_SNAP_APERTURE=12;var eOe=HH;var ea={};ea.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ea.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ea.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ea.defaultAccessToken=void 0;ea.defaultShareKey=void 0;ea._getAuthorizationHeader=function(){return l(ea.defaultShareKey)?`Basic ${ea.defaultShareKey}`:`Bearer ${ea.defaultAccessToken}`};ea.apiEndpoint=new De({url:"https://api.bentley.com"});ea.getExports=async function(e,t){let n=new De({url:`${ea.apiEndpoint}mesh-export`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ea.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}`)}};ea.getRealityDataMetadata=async function(e,t){let n=new De({url:`${ea.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ea._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}`)}};ea.getRealityDataURL=async function(e,t,n){let i=new De({url:`${ea.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ea._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 ba=ea;var tOe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(tOe);var oo=tOe;var Ure=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},nOe=Ure;var zre=[],Vre=[];function n1t(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=zre,u=Vre,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 jre(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);jre(e,t,n,i,o),jre(e,t,n,o+1,r),n1t(e,t,n,i,o,r)}function i1t(e,t,n){let i=e.length,r=Math.ceil(i*.5);zre.length=r,Vre.length=r,jre(e,t,n,0,i-1),zre.length=0,Vre.length=0}var i_=i1t;function Yw(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(Yw.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});Yw.prototype.findTimeInterval=Or.prototype.findTimeInterval;Yw.prototype.wrapTime=Or.prototype.wrapTime;Yw.prototype.clampTime=Or.prototype.clampTime;Yw.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 iOe=Yw;var rOe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(rOe);var ns=rOe;function ul(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 GH=new h;Object.defineProperties(ul.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,GH),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,GH);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,GH),GH)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});ul.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new ul(e,t)};var sOe=new h;ul.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,sOe),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 r1t=new h;ul.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,r1t),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,sOe),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 o1t=new h;ul.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return ns.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,o1t),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?ns.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?ns.FULL:ns.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?ns.PARTIAL:ns.FULL))}}return ns.NONE};var WH=new h;ul.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,WH),WH),c=-h.dot(a,r),u=ul._anyRotationVector(r,a,c),f=ul._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=ul._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,WH),WH)};var s1t=[];ul.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,s1t),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return ul.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var a1t=new h;ul._anyRotationVector=function(e,t,n){let i=h.abs(t,a1t),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 c1t=new h;ul._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,c1t);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 Hre=new h,l1t=new h,qH=new h,oOe=new h;ul._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,Hre),s=h.clone(e.center,l1t),a=e.radius,c=h.subtract(s,o,qH),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,oOe),oOe),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,Hre);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,Hre);T=h.normalize(h.subtract(h.add(b,v,qH),s,qH),qH);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 YH=ul;function Gre(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(Gre.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Gre.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 aOe=Gre;var u1t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},cOe=u1t;var f1t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},lOe=f1t;var d1t=new h;function h1t(e,t,n,i){let r=UE(e,t,n,i,d1t);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var uOe=h1t;function fOe(){pe.throwInstantiationError()}fOe.prototype.getURL=pe.throwInstantiationError;var dOe=fOe;async function m1t(e,t,n,i){return l(i)||(i=!1),_1t(e,t,n,i)}function p1t(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(mOe(i)):o=r.then(mOe(i)).catch(y1t(i)),e.shift(),t.push(o),!0}function g1t(e){return new Promise(function(t){setTimeout(t,e)})}function Wre(e,t,n){return e.length?p1t(e,t,n)?Wre(e,t,n):g1t(100).then(()=>Wre(e,t,n)):Promise.resolve()}function _1t(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 Wre(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function hOe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function mOe(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(!hOe(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];hOe(s,i,n)}}):Promise.resolve()}}function y1t(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var XH=m1t;var qre=new U;async function pOe(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,qre);let p=e.loadTileDataAvailability(qre.x,qre.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 XH(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 pOe(e,a,n),t}var Xw=pOe;var gOe={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(gOe);var fn=gOe;function GA(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 Zre(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function NT(e){let t=[];if(e.shiftKey&&t.push(oo.SHIFT),e.ctrlKey&&t.push(oo.CTRL),e.altKey&&t.push(oo.ALT),t.length)return t}var xs={LEFT:0,MIDDLE:1,RIGHT:2};function Bf(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 A1t(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(Bf(e,"pointerdown",t,v1t),Bf(e,"pointerup",t,SOe),Bf(e,"pointermove",t,S1t),Bf(e,"pointercancel",t,SOe)):(Bf(e,"mousedown",t,wOe),Bf(e,"mouseup",n,IOe),Bf(e,"mousemove",n,POe),Bf(e,"touchstart",t,E1t),Bf(e,"touchend",n,xOe),Bf(e,"touchmove",n,C1t),Bf(e,"touchcancel",n,xOe)),Bf(e,"dblclick",t,x1t);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Bf(e,i,t,T1t)}function b1t(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var _Oe={position:new U};function Qre(e){e._lastSeenTouchEvent=xn()}function eoe(e){return xn()-e._lastSeenTouchEvent>Am.mouseEmulationIgnoreMilliseconds}function Jre(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function wOe(e,t){if(!eoe(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===xs.LEFT)i=fn.LEFT_DOWN;else if(n===xs.MIDDLE)i=fn.MIDDLE_DOWN;else if(n===xs.RIGHT)i=fn.RIGHT_DOWN;else return;let r=GA(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=NT(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,_Oe.position),s(_Oe),t.preventDefault())}var yOe={position:new U},AOe={position:new U};function Yre(e,t,n,i){let r=NT(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=GA(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,yOe.position),o(yOe)),l(s)){let c=e._primaryStartPosition;Jre(c,a,e._clickPixelTolerance)&&(U.clone(a,AOe.position),s(AOe))}}}function IOe(e,t){if(!eoe(e))return;let n=t.button;n!==xs.LEFT&&n!==xs.MIDDLE&&n!==xs.RIGHT||(e._buttonDown[xs.LEFT]&&(Yre(e,fn.LEFT_UP,fn.LEFT_CLICK,t),e._buttonDown[xs.LEFT]=!1),e._buttonDown[xs.MIDDLE]&&(Yre(e,fn.MIDDLE_UP,fn.MIDDLE_CLICK,t),e._buttonDown[xs.MIDDLE]=!1),e._buttonDown[xs.RIGHT]&&(Yre(e,fn.RIGHT_UP,fn.RIGHT_CLICK,t),e._buttonDown[xs.RIGHT]=!1))}var Xre={startPosition:new U,endPosition:new U};function POe(e,t){if(!eoe(e))return;let n=NT(t),i=GA(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(fn.MOUSE_MOVE,n);l(o)&&(U.clone(r,Xre.startPosition),U.clone(i,Xre.endPosition),o(Xre)),U.clone(i,r),(e._buttonDown[xs.LEFT]||e._buttonDown[xs.MIDDLE]||e._buttonDown[xs.RIGHT])&&t.preventDefault()}var bOe={position:new U};function x1t(e,t){let n=t.button,i;if(n===xs.LEFT)i=fn.LEFT_DOUBLE_CLICK;else return;let r=NT(t),o=e.getInputAction(i,r);l(o)&&(GA(e,t,bOe.position),o(bOe))}function T1t(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=NT(t),r=e.getInputAction(fn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function E1t(e,t){Qre(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,GA(e,o,new U));KH(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 xOe(e,t){Qre(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);KH(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var TOe={position:new U},Kre={position1:new U,position2:new U},EOe={position:new U},COe={position:new U},vOe={position:new U};function KH(e,t){let n=NT(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[xs.LEFT]){if(e._buttonDown[xs.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,EOe.position),o(EOe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(fn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];Jre(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,COe.position),s(COe))}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[xs.LEFT]=!0,o=e.getInputAction(fn.LEFT_DOWN,n),l(o)&&(U.clone(c,TOe.position),o(TOe)),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];Jre(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,vOe.position),s(vOe))}},Am.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(fn.PINCH_START,n),l(o)&&(U.clone(i.values[0],Kre.position1),U.clone(i.values[1],Kre.position2),o(Kre),t.preventDefault()))}function C1t(e,t){Qre(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)&&GA(e,o,u)}DOe(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 $re={startPosition:new U,endPosition:new U},LO={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function DOe(e,t){let n=NT(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[xs.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,$re.startPosition),U.clone(a,$re.endPosition),s($re)),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,LO.distance.startPosition),U.fromElements(0,g,LO.distance.endPosition),U.fromElements(E,x,LO.angleAndHeight.startPosition),U.fromElements(T,b,LO.angleAndHeight.endPosition),s(LO)}}function v1t(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,GA(e,t,new U)),KH(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else wOe(e,t)}function SOe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),KH(e,t),e._previousPositions.remove(i)}else IOe(e,t)}function S1t(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;GA(e,t,r),DOe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else POe(e,t)}function Am(e){this._inputEvents={},this._buttonDown={[xs.LEFT]:!1,[xs.MIDDLE]:!1,[xs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Am.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new kt,this._previousPositions=new kt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,A1t(this)}Am.prototype.setInputAction=function(e,t,n){let i=Zre(t,n);this._inputEvents[i]=e};Am.prototype.getInputAction=function(e,t){let n=Zre(e,t);return this._inputEvents[n]};Am.prototype.removeInputAction=function(e,t){let n=Zre(e,t);delete this._inputEvents[n]};Am.prototype.isDestroyed=function(){return!1};Am.prototype.destroy=function(){return b1t(this),le(this)};Am.mouseEmulationIgnoreMilliseconds=800;Am.touchHoldDelayMilliseconds=1500;var xa=Am;function w1t(e,t,n,i,r,o,s){let a=lr.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 FO(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}FO.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};FO.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 FO({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var $H=new Array(2),JH=new Array(2),I1t={positions:$H,height:JH,ellipsoid:void 0,minDistance:void 0,granularity:void 0};FO.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=lr.numberOfPoints,S=lr.generateArc):(E=o,v=lr.numberOfPointsRhumbLine,S=lr.generateRhumbArc);let I=lr.extractHeights(t,s),R=I1t;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=$H,R.height=JH;let L=0;for(u=0;u<f-1;++u){$H[0]=t[u],$H[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=w1t(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:ue.fromPoints(t)})};var ROe=FO;var ZH=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};ZH.DEFAULT_SNAP_APERTURE=void 0;var OOe=ZH;function Kw(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 ac(i),this._workerName="createSphereGeometry"}Kw.packedLength=ac.packedLength;Kw.pack=function(e,t,n){return ac.pack(e._ellipsoidGeometry,t,n)};var P1t=new ac,WA={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};Kw.unpack=function(e,t,n){let i=ac.unpack(e,t,P1t);return WA.vertexFormat=Be.clone(i._vertexFormat,WA.vertexFormat),WA.stackPartitions=i._stackPartitions,WA.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,WA.radii),n._ellipsoidGeometry=new ac(WA),n):(WA.radius=i._radii.x,new Kw(WA))};Kw.createGeometry=function(e){return ac.createGeometry(e._ellipsoidGeometry)};var QH=Kw;function D1t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var $w=D1t;var R1t={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=R1t;var toe=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()}},MOe=toe;function LT(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??tt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(LT.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(LT.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=O1t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});LT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};LT.prototype.isDestroyed=function(){return!1};LT.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};LT.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??tt.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 O1t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var NOe=LT;function M1t(e,t){this.rectangle=e,this.maxLevel=t}function LOe(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=[]}LOe.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 N1t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new rr({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=Xr.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 M1t(new ie(a,c,u,f),d))}}function L1t(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function F1t(e,t,n){try{let i=await t.fetchXML();N1t(e,i)}catch(i){L1t(t,i,n)}}function qA(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(qA.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(){}}});qA.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new LOe(t),i=De.createIfNeeded(e);await F1t(n,i);let r=new qA(t);return n.build(r),r._resource=i,r};qA.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 ll({buffer:Bm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:B1t(a,e,t,n),structure:a._terrainDataStructure})})};qA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var FOe=new ie;function B1t(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,FOe);l(d)&&(eG(r,f,t*2,n*2,i+1)&&(a|=4),eG(r,f,t*2+1,n*2,i+1)&&(a|=8),eG(r,f,t*2,n*2+1,i+1)&&(a|=1),eG(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function eG(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,FOe))}qA.prototype.getTileDataAvailable=function(e,t,n){};qA.prototype.loadTileDataAvailability=function(e,t,n){};var BOe=qA;var kOe={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(kOe);var UOe=kOe;function k1t(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 zOe=k1t;function U1t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var tG=U1t;function FT(){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(FT.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 VOe(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 z1t(e,t){VOe(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 jOe(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 V1t(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 j1t(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 H1t(e,t){jOe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(j1t(o,i),{framebuffer:n[o].framebuffer,uniformMap:V1t(e,o)});e._commands=r}FT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new hi({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)};FT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,z1t(this,e),H1t(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};FT.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)};FT.prototype.isDestroyed=function(){return!1};FT.prototype.destroy=function(){return VOe(this),jOe(this),le(this)};var nG=FT;var G1t=new h(1,1,1);function noe(e){e=e??G1t,this._dimensions=h.clone(e)}Object.defineProperties(noe.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var W1t=new h;noe.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,W1t),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 HOe=noe;var iG=`in vec2 v_textureCoordinates; +const float M_PI = 3.141592653589793; +float vdcRadicalInverse(int i) +{ +float r; +float base = 2.0; +float value = 0.0; +float invBase = 1.0 / base; +float invBi = invBase; +for (int x = 0; x < 100; x++) +{ +if (i <= 0) +{ +break; +} +r = mod(float(i), base); +value += r * invBi; +invBi *= invBase; +i = int(float(i) * invBase); +} +return value; +} +vec2 hammersley2D(int i, int N) +{ +return vec2(float(i) / float(N), vdcRadicalInverse(i)); +} +vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N) +{ +float alphaRoughnessSquared = alphaRoughness * alphaRoughness; +float phi = 2.0 * M_PI * xi.x; +float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y)); +float sinTheta = sqrt(1.0 - cosTheta * cosTheta); +vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); +vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); +vec3 tangentX = normalize(cross(upVector, N)); +vec3 tangentY = cross(N, tangentX); +return tangentX * H.x + tangentY * H.y + N * H.z; +} +float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV) +{ +float alphaRoughnessSq = alphaRoughness * alphaRoughness; +float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); +float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq); +float GGX = GGXV + GGXL; +if (GGX > 0.0) +{ +return 0.5 / GGX; +} +return 0.0; +} +vec2 integrateBrdf(float roughness, float NdotV) +{ +vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); +float A = 0.0; +float B = 0.0; +const int NumSamples = 1024; +float alphaRoughness = roughness * roughness; +for (int i = 0; i < NumSamples; i++) +{ +vec2 xi = hammersley2D(i, NumSamples); +vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0)); +vec3 L = 2.0 * dot(V, H) * H - V; +float NdotL = clamp(L.z, 0.0, 1.0); +float NdotH = clamp(H.z, 0.0, 1.0); +float VdotH = clamp(dot(V, H), 0.0, 1.0); +if (NdotL > 0.0) +{ +float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV); +float G_Vis = 4.0 * G * VdotH * NdotL / NdotH; +float Fc = pow(1.0 - VdotH, 5.0); +A += (1.0 - Fc) * G_Vis; +B += Fc * G_Vis; } -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); +return vec2(A, B) / float(NumSamples); } -#endif -`;var{Material:Oit,MetallicRoughness:hZ,SpecularGlossiness:mZ,Specular:P_e,Clearcoat:D_e}=En,R_e={name:"MaterialPipelineStage",_processTexture:wu,_processTextureTransform:O_e};R_e.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;Bit(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?kit(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&Uit(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&Vit(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&jit(i.clearcoat,o,s,u,c),Hit(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Mit(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===P0.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===P0.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)&&Lit(i.lineStyle,t,n,o,s),s.addFragmentLines(gz),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function Mit(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 Nit(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(yz);let u=_z.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 Lit(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) +void main() { - float cumDist = attributes.${u}; -#ifdef LINE_CUM_DIST_NORMALIZED - cumDist *= u_cumulativeDistanceMax; -#endif - const float textureCoordinateBase = 8192.0; - v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld; +out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } -#endif -`)}else l(s)&&r.addVertexLines(` -#ifdef HAS_LINE_PATTERN -void lineStyleStageVS(in ProcessedAttributes attributes) +`;function BO(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(BO.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function q1t(e,t,n){let i=t.createViewportQuadCommand(iG,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}BO.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:Gt.NEAREST});this._colorTexture=n;let i=new vs({context:t,colorTextures:[n],destroyAttachments:!1});q1t(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};BO.prototype.isDestroyed=function(){return!1};BO.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var rG=BO;var ioe=0,GOe=new h,oG=new h,Y1t=new Bo;function X1t(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=Y1t.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)?$1t(He,s,g)??d:K1t(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)roe(Pe,i,r,o,j,ioe,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)roe(st,i,r,o,j,ioe,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=J1t(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)),roe(Yn,i,r,o,j,ioe,u,jt),mt++}if(vt.length<3)continue;let ft=mi.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=tRt(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}),eRt(V,D)}function K1t(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function $1t(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 J1t(e){let t=[];for(let n of e){let i=Q1t(n);if(i.length<3)continue;Z1t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function Z1t(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 Q1t(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 roe(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,GOe),h.subtract(GOe,s,oG),a.push(oG.x,oG.y,oG.z)}function eRt(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 tRt(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var sG=X1t;var WOe={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(WOe);var r_=WOe;function Jw(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}Jw.prototype.getTexture=function(e){return this._textures[e]};function nRt(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})}Jw.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):nRt(this,e,t)};function iRt(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?aG(r,o,n):rRt(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function aG(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?YOe(e,n):new Dt({context:n,source:t,sampler:r});return qOe(r)&&o.generateMipmap(),o}function rRt(e,t,n){let{typedArray:i,sampler:r}=e,o=qOe(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=MH(i,a,c),p=$b(d);return aG({sampler:r},p,n)}}else{let d=$b(t);return aG(e,d,n)}else return aG(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."),YOe(e,n)}function qOe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function YOe(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})}Jw.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];iRt(this,r,t)}n.length=0};Jw.prototype.isDestroyed=function(){return!1};Jw.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 le(this)};var cG=Jw;function kO(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Cy.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??ux.INHERIT,this._textureManager=new cG,this._defaultTexture=void 0,this.uniformMap=oRt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},cRt(this),lRt(this)}function oRt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===r_.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=sRt(e,i)):n[i]=aRt(e,i)}return n}function sRt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function aRt(e,t){return function(){return e.uniforms[t].value}}function BT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function cRt(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,BT(o,t,r),r=e.usedVariablesVertex.featureIdSet,BT(o,n,r),r=e.usedVariablesVertex.metadataSet,BT(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,BT(s,t,r),r=e.usedVariablesFragment.featureIdSet,BT(s,n,r),r=e.usedVariablesFragment.metadataSet,BT(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;BT(s,a,c)}}function XOe(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 fl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${XOe(t)} is not available in the ${i} shader. Did you mean ${XOe(n)} instead?`;throw new pe(r)}}function lRt(e){let t=e.usedVariablesVertex.attributeSet;fl(t,"position","positionMC","vertex"),fl(t,"normal","normalMC","vertex"),fl(t,"tangent","tangentMC","vertex"),fl(t,"bitangent","bitangentMC","vertex"),fl(t,"positionWC","positionMC","vertex"),fl(t,"positionEC","positionMC","vertex"),fl(t,"normalEC","normalMC","vertex"),fl(t,"tangentEC","tangentMC","vertex"),fl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;fl(n,"position","positionEC","fragment"),fl(n,"normal","normalEC","fragment"),fl(n,"tangent","tangentEC","fragment"),fl(n,"bitangent","bitangentEC","fragment"),fl(n,"normalMC","normalEC","fragment"),fl(n,"tangentMC","tangentEC","fragment"),fl(n,"bitangentMC","bitangentEC","fragment")}kO.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===r_.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};kO.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};kO.prototype.isDestroyed=function(){return!1};kO.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var o_=kO;function uRt(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 Gt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var lG=uRt;function fRt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!dRt(r?.[s],o?.[s]))continue;let a=hRt(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function dRt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function hRt(e,t,n,i,r){if(t===bt.VEC4&&n===Ft.FLOAT32)return mRt(e,i,r);if(t===bt.SCALAR&&n===Ft.FLOAT32)return pRt(e,i,r)}function mRt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new o_({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { - vec4 posClip = gl_Position; - vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw; + material.diffuse = fsInput.metadata.${e}.rgb; + material.alpha = fsInput.metadata.${e}.a; +}`})}function pRt(e,t,n){let r=wH([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 lG({typedArray:r,width:128,height:1});return new o_({uniforms:{u_colorMap:{type:r_.SAMPLER_2D,value:o},u_minimumValue:{type:r_.FLOAT,value:t[0]},u_maximumValue:{type:r_.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; - const float textureCoordinateBase = 8192.0; - if (czm_viewport.z > czm_viewport.w) { - v_lineCoord = textureCoordinateBase + screenPos.x; - } else { - v_lineCoord = textureCoordinateBase + screenPos.y; - } + 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 UO=fRt;function gRt(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=uG(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=uG(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=uG(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=uG(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=yRt(D,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${KOe(B)};`,`${p}.${w}.max${V} = ${KOe(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=_Rt(w,D);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${N};`])}n.addFunctionLines(_,[`return ${L};`])}}function uG(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 _Rt(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 KOe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function yRt(e,t){return e===bt.SCALAR?"":`[${t}]`}var fG=gRt;function bm(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?$Oe:JOe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function $Oe(e){return e===$t.OUTSIDE}function JOe(e){return e===$t.INSIDE}Object.defineProperties(bm.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:JOe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});bm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};bm.prototype.get=function(e){return this._planes[e]};function ZOe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}bm.prototype.contains=function(e){return ZOe(this._planes,e)!==-1};bm.prototype.remove=function(e){let t=this._planes,n=ZOe(t,e);if(n===-1)return!1;e instanceof ua&&(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 ua&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};bm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ua&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var ARt=new sn(h.fromElements(1,0,0),0);function bRt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=TRt(i[o],t,ARt);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var ooe=new se,xRt=new h;function TRt(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,ooe),s=M.multiplyByVector(t,o,ooe),a=h.fromCartesian4(s,xRt);return s=se.divideByScalar(s,h.magnitude(a),ooe),sn.fromCartesian4(s,n)}function QOe(e,t){return t.x=Math.min(e,zt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var ERt=new U;bm.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=QOe(i,ERt);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Gt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;bRt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};bm.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=QOe(r,n);return o.y*=2,o};bm.prototype.isDestroyed=function(){return!1};bm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var YA=bm;var dG=`struct Ray { +vec3 pos; +vec3 dir; +}; +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); +} +`;var hG=`#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 -`)}function O_e(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 Fit(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 wu(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)&&O_e(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Fit(e,t,n,i,r),Nit(e,t,n,i,r,s)}function Bit(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Oit.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&&wu(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),wu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&wu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function kit(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&&wu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,mZ.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&&wu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,mZ.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!==mZ.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 Uit(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&&wu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==P_e.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&&wu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,P_e.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 zit=new h;function Vit(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&wu(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,zit)}}function jit(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!==D_e.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&&wu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==D_e.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&&wu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&wu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Hit(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&wu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,hZ.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&&wu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==hZ.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!==hZ.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 Az=R_e;var Ml={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"};Ml.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Ml.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(Ml.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(Ml.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",[`${Ml.METADATA_PICKING_VALUE_TYPE} value = ${Ml.METADATA_PICKING_VALUE_TYPE}(${Ml.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Ml.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Ml.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Ml.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Ml.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var bd=Ml;var bz=`void morphTargetsStage(inout ProcessedAttributes attributes) -{ -vec3 positionMC = attributes.positionMC; -attributes.positionMC = getMorphedPosition(positionMC); -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = getMorphedNormal(normalMC); -#endif -#ifdef HAS_TANGENTS -vec3 tangentMC = attributes.tangentMC; -attributes.tangentMC = getMorphedTangent(tangentMC); +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); } -`;var Ac={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)"};Ac.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Kit(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||(Wit(e,d,e.attributeIndex,a),e.attributeIndex++)}}$it(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(bz);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var Git={attributeString:void 0,functionId:void 0};function Wit(e,t,n,i){let r=e.shaderBuilder;qit(e,t,n);let o=Yit(t,Git);Xit(r,o,i)}function qit(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 Yit(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Ac.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Ac.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Ac.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Xit(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 Kit(e){e.addFunction(Ac.FUNCTION_ID_GET_MORPHED_POSITION,Ac.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ac.FUNCTION_ID_GET_MORPHED_NORMAL,Ac.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ac.FUNCTION_ID_GET_MORPHED_TANGENT,Ac.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function $it(e){e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ac.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var xz=Ac;var M_e={name:"PickingPipelineStage"};function pZ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}M_e.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)Jit(e,t,a,i);else if(l(a))Zit(e,i);else{let c=N_e(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=pZ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function N_e(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(Ko.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 Jit(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=pZ(e.pickId)}function Zit(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=N_e(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=pZ(e.pickId)}var Tz=M_e;var L_e={ADD:0,REPLACE:1};Object.freeze(L_e);var vo=L_e;var Ez=`float getPointSizeFromAttenuation(vec3 positionEC) { -float pointSize = model_pointCloudParameters.x; -float geometricError = model_pointCloudParameters.y; -float depthMultiplier = model_pointCloudParameters.z; -float depth = -positionEC.z; -return min((geometricError / depth) * depthMultiplier, pointSize); +#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); } -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time)); +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; } -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return getColorFromStyle(attributes, metadata, tiles3d_tileset_time); +float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift); +return vec4(entry.xyz, stepSize); } -#endif -#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -float tiles3d_tileset_time = model_pointCloudParameters.w; -return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time)); +vec2 packIntToVec2(int value) { +float shifted = float(value) / 255.0; +float lowBits = fract(shifted); +float highBits = floor(shifted) / 255.0; +return vec2(highBits, lowBits); } -#elif defined(HAS_POINT_CLOUD_ATTENUATION) -float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) { -return getPointSizeFromAttenuation(v_positionEC); +vec2 packFloatToVec2(float value) { +float lowBits = fract(value); +float highBits = floor(value) / 255.0; +return vec2(highBits, lowBits); +} +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); +} +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() +{ +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; } +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 -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -float pointCloudBackFaceCullingStage() { -#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL) -return step(-v_normalEC.z, 0.0); +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 -return 1.0; -#endif +shapeIntersection = nextIntersection(ix); +if (shapeIntersection.entry.w == NO_HIT) { +break; +} else { +currentT = shapeIntersection.entry.w; +endT = shapeIntersection.exit.w; } #endif -`;var Qit=new se,B_e={name:"PointCloudStylingPipelineStage"};B_e.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=irt(a),A=rrt(o,y);ort(i,A);let x=srt(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;Ko.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===vo.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(Ez);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Qit,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=ert(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 pn?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var F_e=new h;function ert(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,F_e);a=M.multiplyByPointAsVector(s,a,F_e);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var trt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},nrt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function irt(e){let t=Ze(nrt);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 gZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function rrt(e,t){let n=trt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${gZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${gZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${gZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function ort(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 _Z(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 srt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&_Z(t,r),l(n)&&_Z(n,r),l(i)&&_Z(i,r),r}var Cz=B_e;var vz=`void primitiveOutlineStage() { -v_outlineCoordinates = a_outlineCoordinates; } -`;var Sz=`void primitiveOutlineStage(inout czm_modelMaterial material) { -if (!model_showOutline) { -return; +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); } -float outlineX = -texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r; -float outlineY = -texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r; -float outlineZ = -texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; -float outlineness = max(outlineX, max(outlineY, outlineZ)); -material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); +colorAccum.a /= ALPHA_ACCUM_MAX; +#if defined(PICKING) +if (colorAccum.a == 0.0) { +discard; } -`;var k_e={name:"PrimitiveOutlinePipelineStage"};k_e.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=BC.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(vz),i.addFragmentLines(Sz)};var wz=k_e;var U_e={name:"PrimitiveStatisticsPipelineStage",_countGeometry:z_e,_count2DPositions:V_e,_countMorphTargetAttributes:j_e,_countMaterialTextures:H_e,_countFeatureIdTextures:G_e,_countBinaryMetadata:W_e};U_e.process=function(e,t,n){let i=e.model,r=i.statistics;z_e(r,t),V_e(r,e.runtimePrimitive),j_e(r,t),H_e(r,t.material),G_e(r,t.featureIds),W_e(r,i)};function z_e(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+=art(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 art(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 V_e(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function j_e(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 H_e(e,t){let n=crt(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 crt(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 G_e(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 W_e(e,t){let n=t.structuralMetadata;l(n)&&(lrt(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 lrt(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 Iz=U_e;var urt=new M,frt=new M,q_e={name:"SceneMode2DPipelineStage"};q_e.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,urt),u=mrt(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=_rt(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,frt)}};e.uniformMap=Ot(m,e.uniformMap)};var drt=new h,hrt=new h;function mrt(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,drt),r=pr.computeActualEllipsoidPosition(n,i,i),o=M.multiplyByPoint(t,e.positionMax,hrt),s=pr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var Y_e=new h;function prt(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,Y_e),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 grt(e,t,n,i){let r;l(e.quantization)?r=prt(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,Y_e);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),d=pr.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 _rt(e,t,n,i){let r=Ze(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=grt(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var Pz=q_e;var Dz=`void skinningStage(inout ProcessedAttributes attributes) -{ -mat4 skinningMatrix = getSkinningMatrix(); -mat3 skinningMatrixMat3 = mat3(skinningMatrix); -vec4 positionMC = vec4(attributes.positionMC, 1.0); -attributes.positionMC = vec3(skinningMatrix * positionMC); -#ifdef HAS_NORMALS -vec3 normalMC = attributes.normalMC; -attributes.normalMC = skinningMatrixMat3 * normalMC; -#endif -#ifdef HAS_TANGENTS -vec3 tangentMC = attributes.tangentMC; -attributes.tangentMC = skinningMatrixMat3 * tangentMC; -#endif +out_FragColor = u_pickColor; +#elif defined(PICKING_VOXEL) +if (colorAccum.a == 0.0) { +discard; } -`;var mx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};mx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),Art(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(Dz);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function yrt(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 Art(e,t){e.addFunction(mx.FUNCTION_ID_GET_SKINNING_MATRIX,mx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(mx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=yrt(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(mx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(mx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var Rz=mx;var Oz=`void verticalExaggerationStage( -inout ProcessedAttributes attributes -) { -vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); -vec2 vertexAzimuth = normalize(vertexPositionENU.xy); -float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature); -float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight; -vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz; -vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC; -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, vertexEllipsoidNormalEC); -float smallAngleVersine = 0.5 * sinTheta * sinTheta; -float versine = isSmallAngle ? smallAngleVersine : exactVersine; -float dHeight = dot(vertexPositionEC, vertexEllipsoidNormalEC) - eyeToCenter * versine; -float vertexHeight = czm_eyeHeight + dHeight; -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 * exaggerationDirectionScaledMC; +vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex); +vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0])); +out_FragColor = vec4(megatextureId, sampleIndex); +#else +out_FragColor = colorAccum; +#endif } -`;var X_e={name:"VerticalExaggerationPipelineStage"},brt=new U;X_e.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(Oz),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,brt)}};var Mz=X_e;var yZ={};function xrt(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 Trt(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 Ert(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 Crt(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 vrt(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 Srt(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}yZ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?Trt(t,n):xrt(t);if(e===Oe.TRIANGLE_STRIP)return i?Crt(t,n):Ert(t);if(e===Oe.TRIANGLE_FAN)return i?Srt(t,n):vrt(t)};yZ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var ND=yZ;var K_e={name:"WireframePipelineStage"};K_e.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=wrt(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=ND.getWireframeIndicesCount(a,c)};function wrt(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=ND.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 Nz=K_e;function $_e(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=[]}$_e.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!==W_.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=Irt(r,i,n),L=l(r.classificationType);u&&t.push(Pz),t.push(ZU),x&&t.push(Nz),L&&t.push(MU),d&&t.push(xz),p&&t.push(Rz),S&&t.push(Cz),b&&t.push(GU),g&&(I?yt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(hz)),A&&t.push(Az),t.push(ux),t.push(Bh),t.push(bd),O.hasPropertyTable&&(t.push(fx),t.push(OU),t.push(FU)),f&&t.push(Mz),m&&t.push(HU),t.push(pz),r.allowPicking&&t.push(Tz),I&&t.push(wz),R&&(e.edgeVisibilityRequested=!0,t.push(KU),t.push(qU)),t.push(RU),t.push(Iz)};function Irt(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 Lz=$_e;function AZ(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=[],Prt(this)}Object.defineProperties(AZ.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 Prt(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=J_e(f,d,new M);a.push(p)}}function J_e(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}AZ.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]=J_e(i,r,e[n])}};var Fz=AZ;function Drt(){this.pass=void 0,this.alphaCutoff=void 0}var ov=Drt;function Rrt(e){this.shaderBuilder=new X_,this.model=e,this.uniformMap={},this.alphaOptions=new ov,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:_c.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var Bz=Rrt;var kz=`void silhouetteStage(inout vec4 color) { -if(model_silhouettePass) { -color = czm_gammaCorrect(model_silhouetteColor); +`;var mG=`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 pG=`#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 Uz=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { -#ifdef HAS_NORMALS -if(model_silhouettePass) { -vec3 normal = normalize(czm_normal3D * attributes.normalMC); -normal.x *= czm_projection[0][0]; -normal.y *= czm_projection[1][1]; -positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z; +return (intersect0.w <= intersect1.w) ? intersect0 : intersect1; } -#endif +vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1) +{ +return (intersect0.w >= intersect1.w) ? intersect0 : intersect1; } -`;var zz={name:"ModelSilhouettePipelineStage"};zz.silhouettesLength=0;zz.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++zz.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(Uz),i.addFragmentLines(kz),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 Vz=zz;var jz=`void modelSplitterStage() +RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1) { -#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 +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); } -`;var Hz={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Hz.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(jz);let r={};i.addUniform("float",Hz.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[Hz.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var Gz=Hz;function Ort(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 Wz=Ort;function Mrt(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??cg.UNLIT}var qz=Mrt;function Nrt(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=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new qz,this.pickId=void 0,this.snapId=void 0}var Yz=Nrt;function xZ(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!==ei.CESIUM_3D_TILE,this._classifies3DTiles=r!==ei.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],krt(this)}function Lrt(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:_c.LESS_OR_EQUAL},depthMask:!1}}var Frt={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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:nn.PRE_MULTIPLIED_ALPHA_BLEND},Brt={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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},eye=[];function krt(e){let t=e._command,n=eye;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=LD(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=bZ(t,o),a=Z_e(t,o);n.length=0,n.push(s,a),e._commandListTerrain=LD(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=Q_e(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=bZ(t,o),a=Z_e(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=LD(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=Q_e(e,n,e._commandList3DTilesPicking))}}function LD(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 bZ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?Zn.ALWAYS:Zn.EQUAL,r=Lrt(i);return n.renderState=Ge.fromCache(r),n}function Z_e(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Frt),n}var Urt=[];function Q_e(e,t,n){let i=Ge.fromCache(Brt),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=Urt;return c.length=0,c.push(s,a),LD(e,c,n)}Object.defineProperties(xZ.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}}});xZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Qn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Qn(t,this._commandListTerrain),this._classifies3DTiles&&Qn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=bZ(this._command,r),s=eye;s.length=0,s.push(o),this._commandListIgnoreShow=LD(this,s,this._commandListIgnoreShow)}Qn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Qn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Qn(t,this._commandList3DTilesPicking)),t};var Xz=xZ;function sv(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=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=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,zrt(this)}function xd(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}xd.clone=function(e){return new xd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function zrt(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 xd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new xd({command:Yrt(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new xd({command:eot(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new xd({command:tot(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new xd({command:Xrt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new xd({command:Krt(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 xd({command:tye(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new xd({command:tye(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new xd({command:$rt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(sv.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,jrt(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Hrt(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Grt(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Wrt(this))}}});function Vrt(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=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function jrt(e){let t=e.shadows,n=Pn.castShadows(t),i=Pn.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 Hrt(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 Grt(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 Wrt(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}}}sv.prototype.pushCommands=function(e,t){let n=Kz(this,e);n&&!this._has2DCommands&&(qrt(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Vrt(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==hp.ALL_OPAQUE&&gp(t,this._translucentCommand,n),i===hp.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||gp(r._backfaceCommands,this._skipLodBackfaceCommand,n),Jrt(this,o,n),gp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){gp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Lh.EDGES_ONLY&&this._needsEdgeCommands||gp(t,this._originalCommand,n),t}};sv.prototype.pushSilhouetteCommands=function(e,t){let n=Kz(this,e);return gp(t,this._silhouetteColorCommand,n),t};sv.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=Kz(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),gp(t,s,r),t}if(i.pick){if(n!==Lh.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),gp(t,s,r),t}if(n===Lh.SURFACES_ONLY)return t;let o=n===Lh.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),gp(t,this._edgeCommand,r),t};sv.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=Kz(this,e);return gp(t,this._planarFillIdCommand,n),t};function gp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Kz(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 lg(e,t){if(!l(t))return;let n=xd.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 qrt(e){lg(e,e._originalCommand),lg(e,e._translucentCommand),lg(e,e._skipLodBackfaceCommand),lg(e,e._skipLodStencilCommand),lg(e,e._silhouetteModelCommand),lg(e,e._silhouetteColorCommand),lg(e,e._edgeCommand),lg(e,e._edgeSnapCommand),lg(e,e._planarFillIdCommand)}function Yrt(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=nn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function Xrt(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 Krt(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=nn.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 tye(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 $rt(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 Jrt(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=Zrt(r);if(o!==s){let a=Qrt(o),c=Ze(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Zrt(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function Qrt(e){return Xt.CESIUM_3D_TILE_MASK|e<<Xt.SKIP_LOD_BIT_SHIFT}function eot(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0);n.cull.enabled=!0,n.cull.face=ji.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 tot(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=Zn.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=Zn.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 $z=sv;var Jz=`precision highp float; -czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { -czm_modelVertexOutput vsOutput; -vsOutput.positionMC = positionMC; -vsOutput.pointSize = 1.0; -return vsOutput; +vec4 entry = intersectionMax(intersect0.entry, intersect1.entry); +vec4 exit = intersectionMin(intersect0.exit, intersect1.exit); +return RayShapeIntersection(entry, exit); } -void main() -{ -ProcessedAttributes attributes; -initializeAttributes(attributes); -#ifdef HAS_IMAGERY -initializeImageryAttributes(); -#endif -#ifdef USE_DEQUANTIZATION -dequantizationStage(attributes); -#endif -#ifdef HAS_MORPH_TARGETS -morphTargetsStage(attributes); -#endif -#ifdef HAS_SKINNING -skinningStage(attributes); -#endif -#ifdef HAS_PRIMITIVE_OUTLINE -primitiveOutlineStage(); -#endif -#ifdef HAS_BITANGENTS -attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC); -#endif -FeatureIds featureIds; -featureIdStage(featureIds, attributes); -#ifdef HAS_SELECTED_FEATURE_ID -SelectedFeature feature; -selectedFeatureIdStage(feature, featureIds); -cpuStylingStage(attributes.positionMC, feature); -#endif -#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING) -mat4 modelView = czm_modelView3D; -mat3 normal = czm_normal3D; -#else -mat4 modelView = czm_modelView; -mat3 normal = czm_normal; -#endif -#ifdef HAS_INSTANCING -#ifdef USE_LEGACY_INSTANCING -mat4 instanceModelView; -mat3 instanceModelViewInverseTranspose; -legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose); -modelView = instanceModelView; -normal = instanceModelViewInverseTranspose; -#else -instancingStage(attributes); -#endif -#ifdef USE_PICKING -v_pickColor = a_pickColor; -#endif -#endif -Metadata metadata; -MetadataClass metadataClass; -MetadataStatistics metadataStatistics; -metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); -#ifdef HAS_VERTICAL_EXAGGERATION -verticalExaggerationStage(attributes); -#endif -#ifdef HAS_CUSTOM_VERTEX_SHADER -czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC); -customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics); -#endif -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 HAS_VECTOR_LOOKUP -modelVectorLookupStage(attributes); -#endif -#ifdef HAS_SILHOUETTE -silhouetteStage(attributes, positionClip); -#endif -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -float show = pointCloudShowStylingStage(attributes, metadata); -#else -float show = 1.0; -#endif -#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING -show *= pointCloudBackFaceCullingStage(); -#endif -#ifdef HAS_POINT_CLOUD_COLOR_STYLE -v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata); -#endif -#ifdef PRIMITIVE_TYPE_POINTS -#ifdef HAS_CUSTOM_VERTEX_SHADER -gl_PointSize = vsOutput.pointSize; -#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION) -gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata); -#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; +struct Intersections { +vec4 intersections[INTERSECTION_COUNT * 2]; +float distanceToDepthBuffer; +#if (INTERSECTION_COUNT > 1) +int index; +int surroundCount; +bool surroundIsPositive; #endif -} -`;var Zz=`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() +}; +RayShapeIntersection getFirstIntersection(in Intersections ix) { -czm_modelMaterial material; -material.diffuse = vec3(0.0); -material.specular = vec3(1.0); -material.roughness = 1.0; -material.occlusion = 1.0; -material.normalEC = vec3(0.0, 0.0, 1.0); -material.emissive = vec3(0.0); -material.alpha = 1.0; -return material; +return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); } -vec4 handleAlpha(vec3 color, float alpha) +vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) { -#ifdef ALPHA_MODE_MASK -if (alpha < u_alphaCutoff) { -discard; +float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; +return vec4(intersection.xyz * scale, intersection.w); } -#endif -return vec4(color, alpha); +#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; } -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; +} +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; } -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; +for (int i = 0; i < passCount; ++i) { +if (i < ix.index) { +continue; } -#endif -#ifdef HAS_POINT_CLOUD_SHOW_STYLE -if (v_pointCloudShow == 0.0) -{ -discard; +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; } -#endif -#ifdef HAS_MODEL_SPLITTER -modelSplitterStage(); -#endif -czm_modelMaterial material = defaultModelMaterial(); -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; +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; } -#endif -Metadata metadata; -MetadataClass metadataClass; -MetadataStatistics metadataStatistics; -metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes); -#ifndef METADATA_PICKING_ENABLED -#ifdef HAS_SELECTED_FEATURE_ID -selectedFeatureIdStage(selectedFeature, featureIds); -#endif -#ifndef CUSTOM_SHADER_REPLACE_MATERIAL -materialStage(material, attributes, selectedFeature); -#endif -#ifdef HAS_CUSTOM_FRAGMENT_SHADER -customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics); -#endif -lightingStage(material, attributes); -#ifdef HAS_SELECTED_FEATURE_ID -cpuStylingStage(material, selectedFeature); -#endif -#ifdef HAS_MODEL_COLOR -modelColorStage(material); -#endif -#ifdef HAS_PRIMITIVE_OUTLINE -primitiveOutlineStage(material); -#endif -vec4 color = handleAlpha(material.diffuse, material.alpha); -#else -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); -#endif -#ifdef HAS_ATMOSPHERE -atmosphereStage(color, attributes); -#endif -#ifdef HAS_EDGE_VISIBILITY -edgeVisibilityStage(color, featureIds); -edgeDetectionStage(color, featureIds); -if (u_isEdgePass) { -isEdge = true; +break; } -#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; } +return shapeIntersection; } #endif +`;var gG=`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; } -`;function nye(){}nye.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=not(e,n,t),r=iot(e,i,t),o=e.model;return l(o.classificationType)?new Xz({primitiveRenderResources:e,command:r}):new $z({primitiveRenderResources:e,command:r})};function not(e,t,n){t.addVertexLines(Jz),t.addFragmentLines(Zz);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function iot(e,t,n){let i=rot(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=ue.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:Pn.castShadows(o.shadows),m=p?!1:Pn.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 rot(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var Qz=nye;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={},oot(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 oot(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;iye(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 dU({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=rye(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 Fz({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 iye(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 sot=new h;function aot(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,sot);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=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function rye(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=rye(e,d,p);i.push(g)}let s=new DU({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 Lz({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 TU(f,s);f._nodesByName[u]=d}return c}var cot=new h,lot=new h,uot=new h,fot=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 Bz(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 Wz(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 Yz(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,cot),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,lot);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=ue.clone(f.boundingSphere,new ue);let d=M.multiplyByPoint(a,f.positionMin,uot),p=M.multiplyByPoint(a,f.positionMax,fot);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=ue.fromCornerPoints(n,i,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};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=Qz.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(cx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(lU),n.isClippingEnabled()&&t.push(pU);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(yU),n.hasDrapedVectors()&&t.push(xU),n.hasSilhouette(e)&&t.push(Vz),l(n.splitDirection)&&n.splitDirection!==Wo.NONE&&t.push(Gz),Ko.is3DTiles(n.type)&&t.push(rU),i&&t.push(aU)};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){iye(this,e),t.mode!==re.SCENE3D&&aot(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 oye(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);oye(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 eV(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];oye(e,c,t,n,i)}}var dot={backFaceCulling:void 0};ol.prototype.updateBackFaceCulling=function(e){let t=dot;t.backFaceCulling=e,eV(this,!1,hot,t)};function hot(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var mot={shadowMode:void 0};ol.prototype.updateShadows=function(e){let t=mot;t.shadowMode=e,eV(this,!1,pot,t)};function pot(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var got={debugShowBoundingVolume:void 0};ol.prototype.updateShowBoundingVolume=function(e){let t=got;t.debugShowBoundingVolume=e,eV(this,!1,_ot,t)};function _ot(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var sye=[],aye=[],cye=[],yot={frameState:void 0,hasSilhouette:void 0};ol.prototype.pushDrawCommands=function(e){let t=sye;t.length=0;let n=aye;n.length=0;let i=cye;i.length=0;let r=yot;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,eV(this,!0,Aot,r),Qn(e.commandList,t),Qn(e.commandList,n),Qn(e.commandList,i)};function Aot(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=sye,s=aye,a=cye,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 tV=ol;function vy(){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(vy.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}}});vy.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()};vy.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};vy.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};vy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};vy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};vy.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var nV=vy;var dye=js(rN(),1);var lye={},px=Uint32Array.BYTES_PER_ELEMENT;lye.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=px;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+=px,t+=px;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=px;let s=i.getUint32(t,!0);t+=px;let a=i.getUint32(t,!0);t+=px;let c=i.getUint32(t,!0);t+=px;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 fp(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=xot(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=Tot(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=Cot(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=Eot(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=vot(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),bot(A),A};function bot(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 xot(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 Tot(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 Eot(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 Cot(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 vot(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 av=lye;var Sot=En.Components,wot=En.Scene,Iot=En.Node,Pot=En.Primitive,Dot=En.Attribute,uye=En.Quantization,Rot=En.FeatureIdAttribute,Oot=En.Material,Mot=En.MetallicRoughness,TZ=class extends rr{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=av.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=Not(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 Not(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=sy.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Lot(e,i,o),qot(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 Lot(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:Fot(u.componentsPerAttribute),componentType:Bot(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Fot(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Bot(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 FD(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new uye,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new uye;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 Dot;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 fye,iV;function kot(e){if(!l(iV)){fye=new dye.default(0),iV=new Array(e);for(let t=0;t<e;++t)iV[t]=fye.random()}return iV}var Uot=new h,zot=new h,Vot=new h;function jot(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=kot(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Uot),u=h.fromElements(a,a,a,zot),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,Vot),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Hot={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Got(e,t,n){let i=[],r,o=t.positions;return l(o)&&(jot(o),r=FD(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=FD(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=FD(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=FD(e,Hot,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=FD(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Wot(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?by({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new ec({schema:{},propertyTables:[]})}function qot(e,t){let n=e._parsedContent,i=new Mot;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Oot;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=P0.BLEND);let s=!l(n.normals);r.unlit=s;let a=new Pot;if(a.attributes=Got(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new Rot;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Iot;c.index=0,c.primitives=[a];let u=new wot;u.nodes=[c],u.upAxis=Gi.Z,u.forwardAxis=Gi.X;let f=new Sot;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Wot(n,d),d.length>0&&Yot(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 Yot(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 rV=TZ;var oV={};oV.getHeight=function(e,t,n){return(e-n)*t+n};var Xot=new he;oV.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,Xot);if(!l(o))return h.clone(e,r);let s=oV.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var br=oV;var sV=new h,hye=new h,mye=new h,BD=new h,Kot=new h,$ot=new h,Jot=new he,Zot=new ue;function aV(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 Qot=32,EZ=new Map,CZ=[];function est(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 kD(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(La.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,Zot),E=Ti.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=EZ.get(f);l(A)||(A={},l(y)&&(A.vertices=La.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=La.readIndicesAsTypedArray(f.indices)),EZ.set(f,A),CZ.push(f),CZ.length>Qot&&EZ.delete(CZ.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++)aV(g,O,m,sV),M.multiplyByPoint(T,sV,BD),R[O*3]=BD.x,R[O*3+1]=BD.y,R[O*3+2]=BD.z;A.world=R,A.worldTransform=M.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=est(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];aV(g,E,m,sV),aV(g,v,m,hye),aV(g,S,m,mye);for(let I of d){let R=M.multiplyByPoint(I.transform,sV,BD),O=M.multiplyByPoint(I.transform,hye,Kot),L=M.multiplyByPoint(I.transform,mye,$ot);i!==1&&(br.getPosition(R,o,i,r,R),br.getPosition(O,o,i,r,O),br.getPosition(L,o,i,r,L));let _=Ti.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,Jot);f.cartographicToCartesian(d,s)}return s}}var vZ=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}},cV=vZ;var SZ=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 rv(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 cV(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},lV=SZ;function xr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Ko.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 tU(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??Dl.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 ue,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 ig(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?il.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,_ye(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new lV(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new zC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new gy(e.environmentMapOptions);gy.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Pn.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??Lh.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Ko.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??Wo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new nV,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 wZ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function tst(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 iU({model:e,propertyTable:s});n.push(a)}return n}function nst(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 DZ(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){DZ(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=DZ(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 Aye(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===Ko.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&&(Is.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(il.setOwner(e,this,"_clippingPolygons"),_ye(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&&(gy.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 ist=new M,rst=new $,ost=new M;xr.prototype.update=function(e){let t=!1;try{t=sst(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")wZ(this,i);else{let r=xt.getError("model",this._resource,i);wZ(this,r)}}if(ast(this,e),cst(this,e),lst(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."));wZ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&tst(this,r);let o=new tV({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(ust(this),fst(this),dst(this,e),hst(this),mst(this,e),pst(this,e),gst(this,e),_st(this,e),bst(this,e),xst(this,e),Tst(this,e),Est(this,e),this._defaultTexture=e.context.defaultTexture,Cst(this,e),Sst(this,e),Pst(this),Dst(this,e),Nst(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)),Ost(this),Lst(this,e),Fst(this),kst(this,e)}};function sst(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function ast(e,t){l(e._customShader)&&e._customShader.update(t)}function cst(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 lst(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function ust(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=nst(t,e),e._styleDirty=!0,e.resetDrawCommands())}function fst(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function dst(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&&gye(e)}function gye(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=hp.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function hst(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 mst(e,t){e._silhouetteDirty&&(xye(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function pst(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function gst(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 _ye(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 _st(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 yst=new ie;function yye(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function Ast(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function bst(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,yst);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 yye(e);let r=Ast(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function xst(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Tst(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Est(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 Cst(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function vst(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function RZ(e,t){if(!l(e)||!l(t))return M.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function Sst(e,t){vst(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=RZ(e.modelMatrix,e._modelMatrix))}var Sy=new h,IZ=new he,wst=new he,Ist=200,pye=30;function Pst(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=pye;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;Sy.x=r[12],Sy.y=r[13],Sy.z=r[14];let o=i.cartesianToCartographic(Sy,wst);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(r,new M));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<pye,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+Ist,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Gst(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,IZ),IZ.height=m,bye(e,i,o,IZ)):RZ(r,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;Aye(e,n),Rst(e,n,t)}function Aye(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=ue.transform(e._boundingSphere,t,e._boundingSphere)}function Rst(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,Sy),e._sceneMode!==re.SCENE3D&&pr.computeActualEllipsoidPosition(n,Sy,Sy);let s=e._boundingSphere.radius,a=Ust(Sy,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 Ost(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 Mst=new $(1,0,0,0,0,1,0,-1,0);function Nst(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=rst,s=ist;if(s=M.multiply(r.uniformState.view3D,i,s),o=M.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(Mst,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=M.multiply(i,e._clippingPlanes.modelMatrix,ost);e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function Lst(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 Fst(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 Bst(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function kst(e,t){let n=qst(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!Bst(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Yst(e,t),e._sceneGraph.pushDrawCommands(t))}var PZ=new ue;function Ust(e,t,n){return PZ.center=e,PZ.radius=t,n.camera.getPixelSize(PZ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var uV=new h,zst=new h,fV=new h,Vst=new h,jst=new M;function Hst(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,Vst),a=M.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,jst),c=e.scale,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,zst);h.multiplyByScalar(p,c,p),M.multiplyByPoint(a,p,fV),M.multiplyByPointAsVector(u,fV,fV);let g=h.dot(fV,s);g<f&&(f=g)}return-f}function bye(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Hst(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else k_(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,uV);let r=e._clampedModelMatrix;RZ(e.modelMatrix,r),r[12]=uV.x,r[13]=uV.y,r[14]=uV.z,e._heightDirty=!0}function Gst(e,t,n){return function(i){bye(e,t,n,i)}}var Wst=new h;function qst(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,Wst);pr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Yst(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 xye(e){return e.context.stencilBuffer}xr.prototype.hasSilhouette=function(e){return xye(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};xr.prototype.hasSkipLevelOfDetail=function(e){if(!Ko.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 kD(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(),yye(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,le(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 yd(n),a=l(e.content)?Ko.TILE_GLTF:Ko.GLTF,c=n.gltfResource,u=UD(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 V3(t);try{await n.load();let i=UD(n,Ko.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 rV(t);try{await n.load();let i=UD(n,Ko.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 X3(t);try{await n.load();let i=UD(n,Ko.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 H3(t),i=UD(n,Ko.TILE_GEOJSON,e);return new xr(i)};var Xst=new z;xr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,Xst),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,DZ(t,this._color)&&this.resetDrawCommands()};xr.prototype.applyStyle=function(e){let t=this.type===Ko.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),gye(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function UD(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 Td=xr;var OZ=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:gf.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=zD(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await Td.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=zD(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Td.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=zD(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Td.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=zD(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Td.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=zD(t,n,o,{geoJson:r,resource:i}),c=await Td.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 zD(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 Ed=OZ;var MZ=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 le(this)}},dV=MZ;function Kst(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 cv=Kst;var $st=new he,Uh=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),lv(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),lv(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,lv(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),lv(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,lv(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,$st);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&&lv(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(Uh,"defaultColor",z.WHITE),ut(Uh,"defaultPointOutlineColor",z.BLACK),ut(Uh,"defaultPointOutlineWidth",0),ut(Uh,"defaultPointSize",8);function lv(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??Uh.defaultColor,i=e._pointOutlineColor??Uh.defaultPointOutlineColor,r=e._pointOutlineWidth??Uh.defaultPointOutlineWidth,o=e._pointSize??Uh.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,cv(f,d,p,r,o))}var wy=Uh;function Jst(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 gx;function Zst(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(gx)||(l(f.imageSmoothingEnabled)?gx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?gx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?gx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(gx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[gx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Jst(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[gx]=!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 uv=Zst;var Nye=js(vye(),1);var Sye={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Sye);var So=Sye;var wye={},Iye=0,eat=256,tat=new z(.165,.165,.165,.8),nat=new U(7,5),Ks=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function _x(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function jD(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function HD(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Dye(e){let t=wye[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(HD(n,"line-height"));isNaN(i)&&(i=void 0),t={family:HD(n,"font-family"),size:HD(n,"font-size").replace("px",""),style:HD(n,"font-style"),weight:HD(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Iye<eat&&(wye[e._font]=t,Iye++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function zh(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??tat),this._backgroundPadding=U.clone(e.backgroundPadding??nat),this._style=e.style??So.FILL,this._verticalOrigin=e.verticalOrigin??Wn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Wi.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._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,Dye(this),this._updateClamping()}Object.defineProperties(zh.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(!PY(t,e)){vb(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),jD(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=zh.filterUnsupportedCharacters(e);this._renderedText=zh.enableRightToLeftDetection?cat(t):t,_x(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,_x(this),Dye(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),_x(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),_x(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,_x(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,_x(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),jD(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,_x(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,jD(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),jD(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),jD(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=vb(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}}});zh.prototype._updateClamping=function(){Lr._updateClamping(this._labelCollection,this)};zh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Lr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};zh.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===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?r-=s:e.verticalOrigin===Wn.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===Wn.BOTTOM||e.verticalOrigin===Wn.BASELINE?b-=T:e.verticalOrigin===Wn.CENTER&&(b-=T*.5),e._verticalOrigin===Wn.TOP?b+=Ka.PADDING*a:(e._verticalOrigin===Wn.BOTTOM||e._verticalOrigin===Wn.BASELINE)&&(b-=Ka.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};zh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};zh.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};zh.prototype.isDestroyed=function(){return!1};zh.enableRightToLeftDetection=!1;function iat(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=Ks.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=Ks.RTL:n.test(f)?a=Ks.LTR:i.test(f)?a=Ks.BRACKETS:a=Ks.WEAK,u===0&&(s=a),s===a&&a!==Ks.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function rat(e){return e.split("").reverse().join("")}function GD(e,t,n){return e.slice(0,t)+n+e.slice(t)}function oat(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var sat="\u05D0-\u05EA",aat="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Pye=new RegExp(`[${sat}${aat}]`);function cat(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Pye.test(r.charAt(0)),s=iat(r,Pye),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===Ks.BRACKETS?oat(f.Word):rat(f.Word);o?f.Type===Ks.RTL?(c=d+c,a=0):f.Type===Ks.LTR?(c=GD(c,a,f.Word),a+=f.Word.length):(f.Type===Ks.WEAK||f.Type===Ks.BRACKETS)&&(f.Type===Ks.WEAK&&s[u-1].Type===Ks.BRACKETS?c=d+c:s[u-1].Type===Ks.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===Ks.RTL?(c=d+c,a=0):(c=GD(c,a,f.Word),a+=f.Word.length):c=GD(c,0,d)):f.Type===Ks.RTL?c=GD(c,a,d):f.Type===Ks.LTR?(c+=f.Word,a=c.length):(f.Type===Ks.WEAK||f.Type===Ks.BRACKETS)&&(u>0&&s[u-1].Type===Ks.RTL?s.length>u+1?s[u+1].Type===Ks.RTL?c=GD(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 yx=zh;var Lye=js(Rye(),1);function uat(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var fat=1.2,Oye="ID_WHITE_PIXEL",NZ=new U(4,4),dat=new et(1,1,1,1);function hat(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=NZ.x,r.height=NZ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(Oye,r),n.addImageSubRegion(Oye,dat)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var ug={};function mat(e,t,n,i,r,o){return ug.font=t,ug.fillColor=n,ug.strokeColor=i,ug.strokeWidth=r,ug.padding=Ka.PADDING,ug.fill=o===So.FILL||o===So.FILL_AND_OUTLINE,ug.stroke=o===So.OUTLINE||o===So.FILL_AND_OUTLINE,ug.backgroundColor=z.BLACK,uv(e,ug)}function LZ(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 pat=new Lye.default,gat=/\s/;function _at(e,t){let n=t._renderedText,i=pat.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/Ka.FONT_SIZE,r<s)for(let p=r;p<s;++p)LZ(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=hat(c,e),t._backgroundBillboard=a),yat(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 F_(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${Ka.FONT_SIZE}px ${t._fontFamily}`,S=mat(g,v,z.WHITE,z.WHITE,0,So.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!gat.test(g)){let I=(0,Nye.default)(S,{cutoff:Ka.CUTOFF,radius:Ka.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 uat,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){LZ(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=Wi.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===So.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===So.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===So.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function yat(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=Wi.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 Mye(e,t,n){return t===Wi.CENTER?-e/2:t===Wi.RIGHT?-(e+n.x):n.x}var Uo=new U,Aat=new U;function bat(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,Aat);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=Mye(b,m,d),T=(l(e._lineHeight)?e._lineHeight:fat*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=Mye(b,m,d),Uo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Wn.TOP?(Uo.y=_.height-a-d.y,Uo.y+=Ka.PADDING):y===Wn.CENTER?Uo.y=(E+_.height-a)/2:y===Wn.BASELINE?(Uo.y=E,Uo.y-=Ka.PADDING):(Uo.y=E+s+d.y,Uo.y-=Ka.PADDING),Uo.y=(Uo.y-_.descent-R)*g,I&&(Uo.x-=Ka.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,ls(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===Wi.CENTER?x=-r/2-d.x:m===Wi.RIGHT?x=-(r+d.x*2):x=0,Uo.x=x*g,y===Wn.TOP?Uo.y=p-a-s:y===Wn.CENTER?Uo.y=(p-a)/2-s:y===Wn.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 Fye(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)LZ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function _p(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new od({scene:this._scene,textureAtlas:new ZE({initialSize:NZ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new F_(t),this._glyphBillboardCollection=new od({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??Bi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(_p.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}}});_p.prototype.add=function(e){let t=new yx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};_p.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),Fye(this,e),!0}return!1};_p.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Fye(this,e[t]);e.length=0};_p.prototype.contains=function(e){return l(e)&&e._labelCollection===this};_p.prototype.get=function(e){return this._labels[e]};_p.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&&(_at(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(bat(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?Bi.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)};_p.prototype.isDestroyed=function(){return!1};_p.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var fg=_p;var fv=`#ifdef VECTOR_TILE -uniform vec4 u_highlightColor; -#endif -in vec2 v_st; -void main() -{ -czm_materialInput materialInput; -vec2 st = v_st; -st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); -materialInput.s = st.s; -materialInput.st = st; -materialInput.str = vec3(st, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#ifdef VECTOR_TILE -out_FragColor *= u_highlightColor; +ix.distanceToDepthBuffer = entry; +#if defined(DEPTH_TEST) +setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); #endif -czm_writeLogDepth(); } -`;var mV=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 position2DHigh; -in vec3 position2DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 prevPosition2DHigh; -in vec3 prevPosition2DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec3 nextPosition2DHigh; -in vec3 nextPosition2DLow; -in vec4 texCoordExpandAndBatchIndex; -out vec2 v_st; -out float v_width; -out vec4 v_pickColor; -out float v_polylineAngle; -void main() -{ -float texCoord = texCoordExpandAndBatchIndex.x; -float expandDir = texCoordExpandAndBatchIndex.y; -bool usePrev = texCoordExpandAndBatchIndex.z < 0.0; -float batchTableIndex = texCoordExpandAndBatchIndex.w; -vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex); -float width = widthAndShow.x + 0.5; -float show = widthAndShow.y; -if (width < 1.0) -{ -show = 0.0; -} -vec4 pickColor = batchTable_getPickColor(batchTableIndex); -vec4 p, prev, next; -if (czm_morphTime == 1.0) -{ -p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz); -prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz); -next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz); +`;var _G=`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); } -else if (czm_morphTime == 0.0) -{ -p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy); -next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy); +#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; } -else -{ -p = czm_columbusViewMorph( -czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy), -czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz), -czm_morphTime); -prev = czm_columbusViewMorph( -czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy), -czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz), -czm_morphTime); -next = czm_columbusViewMorph( -czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy), -czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz), -czm_morphTime); } -#ifdef DISTANCE_DISPLAY_CONDITION -vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex); -vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex); -vec3 centerLow = centerLowAndRadius.xyz; -float radius = centerLowAndRadius.w; -vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex); -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; +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; } -else -{ -vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz); -lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius); } -float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; -float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; -if (lengthSq < nearSq || lengthSq > farSq) -{ -show = 0.0; +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 -float polylineAngle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); -gl_Position = czm_viewportOrthographic * positionWC * show; -v_st.s = texCoord; -v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); -v_width = width; -v_pickColor = pickColor; -v_polylineAngle = polylineAngle; } -`;var pV=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; +#endif +`;var zO=`vec4 transformNormalToEC(in vec4 intersection) { +return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } -`;var gV=`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; +RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { +return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit)); } -`;var _V=`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; +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 yV=`uniform vec4 lightColor; -uniform vec4 darkColor; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) +RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal) { -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; +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); } -`;var AV=`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 } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2]) { -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; +intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false)); +intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true)); } -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; +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; } -int idxMid = (idxBelow + idxAbove) / 2; -float heightTex = getHeight(idxMid, invTexSize); -if (height > heightTex) { -idxBelow = idxMid; -heightBelow = heightTex; +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 { -idxAbove = idxMid; -heightAbove = heightTex; +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; } } -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) +RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle) { -color.rgb /= color.a; +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)); } -color.rgb = czm_gammaCorrect(color.rgb); -material.diffuse = color.rgb; -material.alpha = color.a; -return material; } -`;var bV=`uniform vec4 color; -uniform float spacing; -uniform float width; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float distanceToContour = mod(materialInput.height, spacing); -#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) -float dxc = abs(dFdx(materialInput.height)); -float dyc = abs(dFdy(materialInput.height)); -float dF = max(dxc, dyc) * czm_pixelRatio * width; -float alpha = (distanceToContour < dF) ? 1.0 : 0.0; -#else -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 yG=`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 xV=`uniform sampler2D image; -uniform float minimumHeight; -uniform float maximumHeight; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); -vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; } -`;var TV=`uniform vec4 fadeInColor; -uniform vec4 fadeOutColor; -uniform float maximumDistance; -uniform bool repeat; -uniform vec2 fadeDirection; -uniform vec2 time; -float getTime(float t, float coord) -{ -float scalar = 1.0 / maximumDistance; -float q = distance(t, coord) * scalar; -if (repeat) -{ -float r = distance(t, coord + 1.0) * scalar; -float s = distance(t, coord - 1.0) * scalar; -q = min(min(r, s), q); +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -return clamp(q, 0.0, 1.0); } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) { -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; +RayShapeIntersection intersection = intersectBoundPlanes(rayEC); +setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var EV=`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)); +`;var AG=`uniform vec2 u_cylinderRenderRadiusMinMax; +#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) +uniform vec2 u_cylinderRenderAngleMinMax; #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; +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 CV=`uniform sampler2D image; -uniform float strength; -uniform vec2 repeat; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 textureValue = texture(image, fract(repeat * materialInput.st)); -vec3 normalTangentSpace = textureValue.channels; -normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; -normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); -normalTangentSpace = normalize(normalTangentSpace); -vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; -material.normal = normalEC; -return material; } -`;var vV=`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; +if (lastEntry.w < firstExit.w) { +return RayShapeIntersection(lastEntry, firstExit); +} else { +return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT)); } -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 -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); } -else -{ -float d1 = czm_infinity; -if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) +RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex) { -d1 = abs(st.s - base); -} -float d2 = abs(st.t - ptOnUpperLine); -float d3 = abs(st.t - ptOnLowerLine); -dist = min(min(d1, d2), d3); +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); } -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; +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); } -`;var SV=`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 -); +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); } -czm_material czm_getMaterial(czm_materialInput materialInput) +void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { -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; +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 bG=`#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); } -fragColor = czm_gammaCorrect(fragColor); -material.emission = fragColor.rgb; -material.alpha = fragColor.a; -return material; } -`;var wV=`uniform vec4 color; -uniform float glowPower; -uniform float taperPower; -czm_material czm_getMaterial(czm_materialInput materialInput) +RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex) { -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 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); } -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; +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)); } -`;var IV=`uniform vec4 color; -uniform vec4 outlineColor; -uniform float outlineWidth; -in float v_width; -czm_material czm_getMaterial(czm_materialInput materialInput) +vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle) { -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; +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 PV=`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; +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 DV=`uniform sampler2D image; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); -rampColor = czm_gammaCorrect(rampColor); -material.diffuse = rampColor.rgb; -material.alpha = rampColor.a; -return material; +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); } -`;var RV=`uniform vec4 evenColor; -uniform vec4 oddColor; -uniform float offset; -uniform float repeat; -uniform bool horizontal; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -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; +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; } -`;var OV=`uniform vec4 waterColor; -uniform vec4 landColor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -vec4 outColor = mix(landColor, waterColor, materialInput.waterMask); -outColor = czm_gammaCorrect(outColor); -material.diffuse = outColor.rgb; -material.alpha = outColor.a; -return material; +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; } -`;var MV=`uniform sampler2D specularMap; -uniform sampler2D normalMap; -uniform vec4 baseWaterColor; -uniform vec4 blendColor; -uniform float frequency; -uniform float animationSpeed; -uniform float amplitude; -uniform float specularIntensity; -uniform float fadeFactor; -czm_material czm_getMaterial(czm_materialInput materialInput) -{ -czm_material material = czm_getDefaultMaterial(materialInput); -float time = czm_frameNumber * animationSpeed; -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; +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; } -`;function nt(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??$n.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,xat(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(nt._uniformList[this.type])||(nt._uniformList[this.type]=Object.keys(this._uniforms))}nt._uniformList={};nt.fromType=function(e,t){let n=new nt({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};nt.fromTypeAsync=async function(e,t){let n=[],i=new nt({fabric:{type:e,uniforms:t}});if(Uye(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Uye(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];Uye(r,t)}}nt.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};nt.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 ms({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)};nt.prototype.isDestroyed=function(){return!1};nt.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 le(this)};function xat(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:Jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=nt._materialCache.getMaterial(t.type);if(l(i)){let o=Ze(i.fabric,!0);t._template=Ot(t._template,o,!0),n=i.translucent}vat(t),wat(t),Rat(t),Mat(t),l(i)||nt._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 FZ(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 Bye(e,t){}function Tat(e,t){}var Eat=["type","materials","uniforms","components","source"],Cat=["diffuse","specular","shininess","normal","emission","alpha"];function vat(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;FZ(t,Eat,Bye,!0),FZ(r,Cat,Bye,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);FZ(n,o,Tat,!1)}function Sat(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 wat(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} -`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) -{ -`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&Sat(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 kye={mat2:$i,mat3:$,mat4:M},Iat=/\.ktx2$/i;function Pat(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===nt.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}zye(n,e)}}}function zye(e,t){let i=e.uniforms[t];if(i===nt.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 Iat.test(r.url)?a=of(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 Dat(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ms){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),Vye(t,e)}}function Vye(e,t){let i=e.uniforms[t];if(i===nt.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 Rat(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&jye(e,n)}function jye(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=Oat(r),s;if(o==="channels")s=WD(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;Nat(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},jye(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=WD(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Pat(t)),e._initializationPromises.push(zye(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(Dat(t)),e._initializationPromises.push(Vye(e,t));else if(o.indexOf("mat")!==-1){let u=new kye[o];e._uniforms[c]=function(){return kye[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function Oat(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===nt.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 Mat(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new nt({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++}`;WD(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=WD(e,i,a)}}function WD(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 Nat(e,t,n){return WD(e,t,t,n)}nt._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};nt.DefaultImageId="czm_defaultImage";nt.DefaultCubeMapId="czm_defaultCubeMap";nt.ColorType="Color";nt._materialCache.addMaterial(nt.ColorType,{fabric:{type:nt.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}});nt.ImageType="Image";nt._materialCache.addMaterial(nt.ImageType,{fabric:{type:nt.ImageType,uniforms:{image:nt.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}});nt.DiffuseMapType="DiffuseMap";nt._materialCache.addMaterial(nt.DiffuseMapType,{fabric:{type:nt.DiffuseMapType,uniforms:{image:nt.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});nt.AlphaMapType="AlphaMap";nt._materialCache.addMaterial(nt.AlphaMapType,{fabric:{type:nt.AlphaMapType,uniforms:{image:nt.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});nt.SpecularMapType="SpecularMap";nt._materialCache.addMaterial(nt.SpecularMapType,{fabric:{type:nt.SpecularMapType,uniforms:{image:nt.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});nt.EmissionMapType="EmissionMap";nt._materialCache.addMaterial(nt.EmissionMapType,{fabric:{type:nt.EmissionMapType,uniforms:{image:nt.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});nt.BumpMapType="BumpMap";nt._materialCache.addMaterial(nt.BumpMapType,{fabric:{type:nt.BumpMapType,uniforms:{image:nt.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:gV},translucent:!1});nt.NormalMapType="NormalMap";nt._materialCache.addMaterial(nt.NormalMapType,{fabric:{type:nt.NormalMapType,uniforms:{image:nt.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:CV},translucent:!1});nt.GridType="Grid";nt._materialCache.addMaterial(nt.GridType,{fabric:{type:nt.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:EV},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});nt.StripeType="Stripe";nt._materialCache.addMaterial(nt.StripeType,{fabric:{type:nt.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:RV},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});nt.CheckerboardType="Checkerboard";nt._materialCache.addMaterial(nt.CheckerboardType,{fabric:{type:nt.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:_V},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});nt.DotType="Dot";nt._materialCache.addMaterial(nt.DotType,{fabric:{type:nt.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:yV},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});nt.WaterType="Water";nt._materialCache.addMaterial(nt.WaterType,{fabric:{type:nt.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:nt.DefaultImageId,normalMap:nt.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:MV},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});nt.RimLightingType="RimLighting";nt._materialCache.addMaterial(nt.RimLightingType,{fabric:{type:nt.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:PV},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});nt.FadeType="Fade";nt._materialCache.addMaterial(nt.FadeType,{fabric:{type:nt.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:TV},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});nt.PolylineArrowType="PolylineArrow";nt._materialCache.addMaterial(nt.PolylineArrowType,{fabric:{type:nt.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:vV},translucent:!0});nt.PolylineDashType="PolylineDash";nt._materialCache.addMaterial(nt.PolylineDashType,{fabric:{type:nt.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:SV},translucent:!0});nt.PolylineGlowType="PolylineGlow";nt._materialCache.addMaterial(nt.PolylineGlowType,{fabric:{type:nt.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:wV},translucent:!0});nt.PolylineOutlineType="PolylineOutline";nt._materialCache.addMaterial(nt.PolylineOutlineType,{fabric:{type:nt.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:IV},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});nt.ElevationContourType="ElevationContour";nt._materialCache.addMaterial(nt.ElevationContourType,{fabric:{type:nt.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:bV},translucent:!1});nt.ElevationRampType="ElevationRamp";nt._materialCache.addMaterial(nt.ElevationRampType,{fabric:{type:nt.ElevationRampType,uniforms:{image:nt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:xV},translucent:!1});nt.SlopeRampMaterialType="SlopeRamp";nt._materialCache.addMaterial(nt.SlopeRampMaterialType,{fabric:{type:nt.SlopeRampMaterialType,uniforms:{image:nt.DefaultImageId},source:DV},translucent:!1});nt.AspectRampMaterialType="AspectRamp";nt._materialCache.addMaterial(nt.AspectRampMaterialType,{fabric:{type:nt.AspectRampMaterialType,uniforms:{image:nt.DefaultImageId},source:pV},translucent:!1});nt.ElevationBandType="ElevationBand";nt._materialCache.addMaterial(nt.ElevationBandType,{fabric:{type:nt.ElevationBandType,uniforms:{heights:nt.DefaultImageId,colors:nt.DefaultImageId},source:AV},translucent:!0});nt.WaterMaskType="WaterMask";nt._materialCache.addMaterial(nt.WaterMaskType,{fabric:{type:nt.WaterMaskType,source:OV,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var lr=nt;var Nl={};Nl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Nl.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 Lat=new he;Nl.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,Lat).height}return i};var Fat=new M,Bat=new h,Hye=new h,kat=new sn(h.UNIT_X,0),Gye=new h,Uat=new sn(h.UNIT_X,0),zat=new h,Vat=new h,kZ=[];function qye(e,t,n){let i=kZ;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 LV=new he,NV=new he,Iy=new h,UZ=new h,jat=new h,BZ=new K_,qD=new Yc;function Hat(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,UZ),u=i.scaleToGeodeticSurface(t,jat),f=Nl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,LV),p=i.cartesianToCartographic(u,NV),g=qye(f,r,o);BZ.setEndPoints(d,p);let m=BZ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,Iy);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=BZ.interpolateUsingSurfaceDistance(b*m,NV);x.height=g[b],A=i.cartographicToCartesian(x,Iy),h.pack(A,s,y),y+=3}return y}function Gat(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,LV),u=i.cartesianToCartographic(t,NV),f=Nl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=qye(f,r,o);qD.ellipsoid.equals(i)||(qD=new Yc(void 0,void 0,i)),qD.setEndPoints(c,u);let p=qD.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,Iy);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=qD.interpolateUsingSurfaceDistance(y*p,NV);A.height=d[y],m=i.cartographicToCartesian(A,Iy),h.pack(m,s,g),g+=3}return g}Nl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let r=M.inverseTransformation(t,Fat),o=M.multiplyByPoint(r,h.ZERO,Bat),s=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_Y,Hye),Hye),a=sn.fromPointNormal(o,s,kat),c=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_X,Gye),Gye),u=sn.fromPointNormal(o,c,Uat),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=Ti.lineSegmentPlane(d,m,a,zat);if(l(y)){let A=h.multiplyByScalar(s,5e-9,Vat);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}};Nl.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],UZ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,Iy);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+=Nl.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=Hat(y,A,s,i,b,x,f,d)}kZ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,LV);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,Iy);return h.pack(m,f,u-3),f};var Wye=new he,Wat=new he;Nl.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],UZ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,Iy);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],Wye),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],Wat),a+=Nl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,Wye);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=Gat(b,x,s,i,T,E,p,g)}kZ.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,LV);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,Iy);return h.pack(A,p,d-3),p};Nl.generateCartesianArc=function(e){let t=Nl.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};Nl.generateCartesianRhumbArc=function(e){let t=Nl.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 ur=Nl;function Af(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=Br(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=ur.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Xye),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 Yye=Af.POSITION_INDEX=0,qat=Af.SHOW_INDEX=1,Yat=Af.WIDTH_INDEX=2,Xat=Af.MATERIAL_INDEX=3,YD=Af.POSITION_SIZE_INDEX=4,Kat=Af.DISTANCE_DISPLAY_CONDITION=5,Xye=Af.NUMBER_OF_PROPERTIES=6;function dg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Af.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,dg(this,qat))}},positions:{get:function(){return this._positions},set:function(e){let t=Br(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)&&dg(this,YD),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),dg(this,Yye),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,dg(this,Xat))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,dg(this,Yat))}},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,dg(this,YD)}}},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),dg(this,Kat))}}});Af.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[Yye]>0||this._propertiesChanged[YD]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=ur.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)dg(this,YD);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){dg(this,YD);break}}};Af.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Af.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Xye-1;++t)e[t]=0};Af.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Vh=Af;var $at=Vh.SHOW_INDEX,Jat=Vh.WIDTH_INDEX,VZ=Vh.POSITION_INDEX,Zat=Vh.MATERIAL_INDEX,Kye=Vh.POSITION_SIZE_INDEX,Qat=Vh.DISTANCE_DISPLAY_CONDITION,nAe=Vh.NUMBER_OF_PROPERTIES,Iu={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 jh(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(nAe),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(jh.prototype,{length:{get:function(){return jZ(this),this._polylines.length}}});jh.prototype.add=function(e){let t=new Vh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};jh.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};jh.prototype.removeAll=function(){HZ(this),aAe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};jh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};jh.prototype.get=function(e){return jZ(this),this._polylines[e]};function ect(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 KE(t,n,e._polylines.length)}var iAe=new Sn,rAe=new se,oAe=new U;jh.prototype.update=function(e){if(jZ(this),this._polylines.length===0||!this.show)return;sct(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.");ect(this,t),this._createBatchTable=!1}if(this._createVertexArray||nct(this))Zye(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[Kye]||r[Zat])Zye(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[VZ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[$at]||r[Jat])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[VZ]||r[Kye]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,iAe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,rAe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[Qat]){let m=oAe;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<nAe;++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:nn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;tct(this,e,c,o)}};var XD=new ue,$ye=new ue;function tct(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=rct(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=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(XD,_.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=ue.clone(D._boundingVolume2D,$ye),B.center.x=0):l(D._boundingVolumeWC)&&l(D._boundingVolume2D)&&(B=ue.union(D._boundingVolumeWC,D._boundingVolume2D,$ye)),c?(c=!1,ue.clone(B,XD)):ue.union(B,XD,XD)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(XD,_.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}jh.prototype.isDestroyed=function(){return!1};jh.prototype.destroy=function(){return sAe(this),HZ(this),aAe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function nct(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[VZ]?(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 Jye=[0,0,0];function Zye(e,t,n){e._createVertexArray=!1,HZ(e),sAe(e),oct(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:Iu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Iu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Iu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Iu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Iu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Iu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Iu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Iu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Iu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Iu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Iu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Iu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Iu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=Jye,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=Jye,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 ict(e,t){return t instanceof Dt?t.id:t}var FV=[];function rct(e){let t=lr._uniformList[e.type],n=t.length;FV.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];FV[i]=o,FV[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(FV,ict)}`}function oct(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 yp(c,t,n)),u.addPolyline(a)}}}function sct(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 jZ(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 HZ(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 sAe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}jh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function aAe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function zZ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function yp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}yp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};yp.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,fv]}),o=t.getVertexShaderCallback()(mV),s=new Xe({defines:i,sources:[hu,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Iu})};function cAe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}yp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!cAe(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 ga=new h,Cd=new h,vd=new h,BV=new h,act=new se,cct=new U;yp.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=BV,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Cd),h.clone(x[V],ga),V===E-1?g._loop?R=x[1]:(R=BV,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,vd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(Cd.z=0,ga.z=0,vd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(ga.x)<1&&((ga.x<0&&Cd.x>0||ga.x>0&&Cd.x<0)&&h.clone(ga,Cd),(ga.x<0&&vd.x>0||ga.x>0&&vd.x<0)&&h.clone(ga,vd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(ga,e,n),Sn.writeElements(Cd,e,n+6),Sn.writeElements(vd,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=act;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=cct;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,iAe),w=C.high,D=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,rAe),N=oAe;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 lct=new h,uct=new h,fct=new h,Qye=new h;yp.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=Qye,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=M.multiplyByPoint(n,g,uct);let m=M.multiplyByPoint(n,a[p],lct),y;p===u-1?s._loop?y=a[1]:(y=Qye,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,fct);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 dct=new Array(1);yp.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new zZ(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=dct;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 zZ(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 zZ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};yp.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 dv={positions:void 0,lengths:void 0},eAe=new Array(1),hct=new h,mct=new he;yp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return eAe[0]=n.length,dv.positions=n,dv.lengths=eAe,dv;cAe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=hct;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,mct)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return dv.positions=r,dv.lengths=e._segments.lengths,dv};var tAe;yp.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=tAe,c=6*s*3;!l(a)||a.length<c?a=tAe=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=BV,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Cd),h.clone(f[A],ga),A===s-1?t._loop?y=f[1]:(y=BV,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,vd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Cd.z=0,ga.z=0,vd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(ga.x)<1&&((ga.x<0&&Cd.x>0||ga.x>0&&Cd.x<0)&&h.clone(ga,Cd),(ga.x<0&&vd.x>0||ga.x>0&&vd.x<0)&&h.clone(ga,vd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(ga,a,p),Sn.writeElements(Cd,a,p+6),Sn.writeElements(vd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Ap=jh;function Py(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 od({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new fg({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Ap,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Py.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 pct(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 gct=new Kn("createVectorTilePoints",5),_ct=new h;function yct(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=pct(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=gct.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,_ct),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)})}Py.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 wy(e,c,u,f,d)}};Py.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 Act(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=wy.defaultPointSize,s.color=wy.defaultColor,s.pointOutlineColor=wy.defaultPointOutlineColor,s.pointOutlineWidth=wy.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=So.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=Wi.CENTER,s.verticalOrigin=Wn.CENTER,s.labelHorizontalOrigin=Wi.RIGHT,s.labelVerticalOrigin=Wn.BASELINE}}var bct=new z,xct=new z,Tct=new z,Ect=new z,Cct=new z,vct=new z,KD=new qt,$D=new qt,GZ=new Gt;Py.prototype.applyStyle=function(e,t){if(!l(e)){Act(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,bct)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,xct)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Tct)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Ect)),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,Cct)),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)?(KD.near=a.x,KD.nearValue=a.y,KD.far=a.z,KD.farValue=a.w,s.scaleByDistance=KD):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?($D.near=a.x,$D.nearValue=a.y,$D.far=a.z,$D.farValue=a.w,s.translucencyByDistance=$D):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(GZ.near=a.x,GZ.far=a.y,s.distanceDisplayCondition=GZ):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))}};Py.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=yct(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)};Py.prototype.isDestroyed=function(){return!1};Py.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(),le(this)};var kV=Py;function hg(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=ei.BOTH}Object.defineProperties(hg.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 Sct(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 wct(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 J0({color:c,offset:u,count:f,batchIds:p})}}var Ict=new Kn("createVectorTilePolygons",5),Pct=new z;function Dct(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,Pct);s[y]=A.toRgba()}a=e._packedBuffer=Sct(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=Ict.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];wct(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),Rct(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function Rct(e){l(e._primitive)||(e._primitive=new hC({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)}hg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};hg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};hg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};hg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};hg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Dct(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)};hg.prototype.isDestroyed=function(){return!1};hg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var UV=hg;var zV=`in vec4 currentPosition; -in vec4 previousPosition; -in vec4 nextPosition; -in vec2 expandAndWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; -void main() -{ -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = u_modifiedModelView * currentPosition; -vec4 prev = u_modifiedModelView * previousPosition; -vec4 next = u_modifiedModelView * nextPosition; -float angle; -vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; +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); +} +float tmin = intersect.x; +float tmax = intersect.y; +vec3 p0 = ray.pos + tmin * ray.dir; +vec3 p1 = ray.pos + tmax * ray.dir; +vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin); +vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax); +bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle); +bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle); +if (p0InShadowCone && p1InShadowCone) { +return RayShapeIntersection(miss, miss); +} else if (p0InShadowCone) { +return RayShapeIntersection(intersect1, farSide); +} else if (p1InShadowCone) { +return RayShapeIntersection(-1.0 * farSide, intersect0); +} else { +return RayShapeIntersection(intersect0, intersect1); +} +} +void intersectShape(in Ray ray, 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; } -`;function Hh(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(Hh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Oct(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 Mct=new Kn("createVectorTilePolylines",5),hv={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Nct(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=Oct(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=Mct.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),Lct(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Lct(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:hv.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:hv.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:hv.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:hv.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:hv.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 JD=new M,lAe=new h;function Fct(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,JD),M.multiplyByPoint(JD,e._center,lAe),M.setTranslation(JD,lAe,JD),JD},u_highlightColor:function(){return e._highlightColor}})}function Bct(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var kct=`uniform vec4 u_highlightColor; -void main() -{ - out_FragColor = u_highlightColor; +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); } -`;function Uct(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(zV),r=n.getFragmentShaderCallback(!1,void 0,!1)(kct),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[hu,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:hv})}function zct(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)}Hh.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};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 r=0;r<i;++r){let o=n[r];t[o]=new pa(e,o)}};Hh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Vct(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 jct=new z,Hct=z.WHITE,Gct=!0;Hh.prototype.applyStyle=function(e,t){if(!l(e)){Vct(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,jct):Hct,s.show=l(e.show)?e.show.evaluate(s):Gct}};Hh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Nct(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Fct(this,t),Uct(this,t),Bct(this);let n=e.passes;(n.render||n.pick)&&zct(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(),le(this)};var mv=Hh;var uAe=new h,fAe=new h,dAe=new he,WZ=new h,Wct=new h,hAe=new ue,qct=new ir,ZD=[new he,new he,new he,new he],QD=new U,Ns={};Ns.initialize=function(){let e=Ns._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){Ns._terrainHeights=t}),Ns._initPromise=e),e};Ns.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=mAe(e),i=Ns._defaultMinTerrainHeight,r=Ns._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Ns._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,dAe),uAe),t.cartographicToCartesian(ie.southwest(e,dAe),fAe),h.midpoint(fAe,uAe,WZ);let a=t.scaleToGeodeticSurface(WZ,Wct);if(l(a)){let c=h.distance(WZ,a);i=Math.min(i,-c)}else i=Ns._defaultMinTerrainHeight}return i=Math.max(Ns._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Ns.getBoundingSphere=function(e,t){t=t??ee.default;let n=mAe(e),i=Ns._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Ns._terrainHeights[o];l(s)&&(i=s[1])}let r=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,hAe),ue.union(r,hAe,r)};function mAe(e){he.fromRadians(e.east,e.north,0,ZD[0]),he.fromRadians(e.west,e.north,0,ZD[1]),he.fromRadians(e.east,e.south,0,ZD[2]),he.fromRadians(e.west,e.south,0,ZD[3]);let t=0,n=0,i=0,r=0,o=Ns._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=ZD[c];if(qct.positionToTileXY(u,s,QD),c===0)i=QD.x,r=QD.y;else if(i!==QD.x||r!==QD.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}}Ns._terrainHeightsMaxLevel=6;Ns._defaultMaxTerrainHeight=9e3;Ns._defaultMinTerrainHeight=-1e5;Ns._terrainHeights=void 0;Ns._initPromise=void 0;Object.defineProperties(Ns,{initialized:{get:function(){return l(Ns._terrainHeights)}}});var Ni=Ns;var VV=`in vec3 startEllipsoidNormal; -in vec3 endEllipsoidNormal; -in vec4 startPositionAndHeight; -in vec4 endPositionAndHeight; -in vec4 startFaceNormalAndVertexCorner; -in vec4 endFaceNormalAndHalfWidth; -in float a_batchId; -uniform mat4 u_modifiedModelView; -uniform vec2 u_minimumMaximumVectorHeights; -out vec4 v_startPlaneEC; -out vec4 v_endPlaneEC; -out vec4 v_rightPlaneEC; -out float v_halfWidth; -out vec3 v_volumeUpEC; -void main() -{ -float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); -float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); -vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz; -vec3 right = normalize(cross(forward, startEllipsoidNormal)); -vec4 position = vec4(startPositionAndHeight.xyz, 1.0); -position.xyz += forward * isEnd; -v_volumeUpEC = czm_normal * normalize(cross(right, forward)); -float offset; -vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd); -offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd); -offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset; -position.xyz += offset * ellipsoidNormal; -position = u_modifiedModelView * position; -right = czm_normal * right; -vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); -scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); -vec3 miterPushNormal = czm_normal * normalize(scratchNormal); -offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); -offset = offset / dot(miterPushNormal, right); -position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); -gl_Position = czm_depthClamp(czm_projection * position); -position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); -vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; -v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); -v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); -position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); -vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; -v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); -v_halfWidth = endFaceNormalAndHalfWidth.w; +#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 jV=`in vec4 v_startPlaneEC; -in vec4 v_endPlaneEC; -in vec4 v_rightPlaneEC; -in float v_halfWidth; -in vec3 v_volumeUpEC; -uniform vec4 u_highlightColor; -void main() -{ -float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME +`;var Zw=`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; } -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -eyeCoordinate /= eyeCoordinate.w; -float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); -halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); -float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); -float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); -float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); -if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME +#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; } -out_FragColor = u_highlightColor; -czm_writeDepthClamp(); } -`;function mg(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(mg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Yct(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 Xct(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 Kct=new Kn("createVectorTileClampedPolylines"),Dy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function $ct(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=Xct(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=Kct.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),Jct(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Jct(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:Dy.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Dy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Dy.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Dy.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Dy.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Dy.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Dy.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 e1=new M,pAe=new h;function Zct(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,e1),M.multiplyByPoint(e1,e._center,pAe),M.setTranslation(e1,pAe,e1),e1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function gAe(e){return Ge.fromCache({cull:{enabled:!0,face:ji.FRONT},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function Qct(e){l(e._rs)||(e._rs=gAe(!1),e._rs3DTiles=gAe(!0))}function elt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(VV),r=n.getFragmentShaderCallback(!1,void 0,!0)(jV),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[hu,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Dy})}function tlt(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===ei.TERRAIN||i===ei.BOTH)&&t.commandList.push(n),(i===ei.CESIUM_3D_TILE||i===ei.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}mg.prototype.getPositions=function(e){return mv.getPolylinePositions(this,e)};mg.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)}};mg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function nlt(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 ilt=new z,rlt=z.WHITE,olt=!0;mg.prototype.applyStyle=function(e,t){if(!l(e)){nlt(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,ilt):rlt,s.show=l(e.show)?e.show.evaluate(s):olt}};function slt(e){return Ni.initialize().then(function(){Yct(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}mg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=slt(this).then($ct(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Zct(this,t),elt(this,t),Qct(this);let n=e.passes;(n.render||n.pick)&&tlt(this,e)};mg.prototype.isDestroyed=function(){return!1};mg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var HV=mg;var qZ=32767,alt=new he,clt=new h;function llt(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/qZ),y=P.lerp(t.south,t.north,p/qZ),A=P.lerp(n,i,g/qZ),b=he.fromRadians(m,y,A,alt),x=r.cartographicToCartesian(b,clt);h.pack(x,u,f*3)}return u}var GV=llt;var XZ=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,mlt(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)||YZ(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)||YZ(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)||YZ(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(),le(this)}};function ult(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function flt(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 Gh=Uint32Array.BYTES_PER_ELEMENT;function dlt(e){return new mv(e)}function hlt(e){return new HV(e)}function mlt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Gh;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Gh;let s=r.getUint32(n,!0);if(n+=Gh,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Gh,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Gh;let u=r.getUint32(n,!0);n+=Gh;let f=r.getUint32(n,!0);n+=Gh;let d=r.getUint32(n,!0);n+=Gh;let p=r.getUint32(n,!0);n+=Gh;let g=r.getUint32(n,!0);n+=Gh,n+=Gh;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 Xm(e,v,A,b,ult(e));if(e._batchTable=S,v===0)return;let I=new fp(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=flt(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 UV({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=GV(new Uint16Array(j),O,L,_,ee.WGS84);plt(q,F,D.polylines,S,e.url,k)}let G=dlt;l(N.classificationType)&&(G=hlt),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 kV({positions:F,batchIds:D.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:N.heightReference,scene:N.scene})}}function YZ(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 plt(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 WV=XZ;function pv(e,t){this._conditionsExpression=Ze(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,_lt(this,t)}Object.defineProperties(pv.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function glt(e,t){this.condition=e,this.expression=t}function _lt(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 glt(new Ih(a,t),new Ih(c,t)))}e._runtimeConditions=n}pv.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)}};pv.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)}};pv.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); +#else +intersection.entry.w = max(intersection.entry.w, 0.0); +#endif +return intersection; } -`,o};pv.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];Qn(e,r.condition.getVariables()),Qn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var qV=pv;function Ry(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,ylt(this,e)}function ylt(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 Ih(r[o],i))}e._meta=n,e._ready=!0}function fo(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Ih(String(t));if(typeof t=="string")return new Ih(t,n);if(l(t.conditions))return new qV(t,n)}else return;return t}function ho(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(Ry.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=fo(this,e),this._style.show=ho(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=fo(this,e),this._style.color=ho(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=fo(this,e),this._style.pointSize=ho(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=fo(this,e),this._style.pointOutlineColor=ho(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=fo(this,e),this._style.pointOutlineWidth=ho(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=fo(this,e),this._style.labelColor=ho(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=fo(this,e),this._style.labelOutlineColor=ho(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=fo(this,e),this._style.labelOutlineWidth=ho(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=fo(this,e),this._style.font=ho(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=fo(this,e),this._style.labelStyle=ho(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=fo(this,e),this._style.labelText=ho(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=fo(this,e),this._style.backgroundColor=ho(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=fo(this,e),this._style.backgroundPadding=ho(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=fo(this,e),this._style.backgroundEnabled=ho(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=fo(this,e),this._style.scaleByDistance=ho(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=fo(this,e),this._style.translucencyByDistance=ho(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=fo(this,e),this._style.distanceDisplayCondition=ho(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=fo(this,e),this._style.heightOffset=ho(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=fo(this,e),this._style.anchorLineEnabled=ho(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=fo(this,e),this._style.anchorLineColor=ho(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=fo(this,e),this._style.image=ho(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=fo(this,e),this._style.disableDepthTestDistance=ho(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=fo(this,e),this._style.horizontalOrigin=ho(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=fo(this,e),this._style.verticalOrigin=ho(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=fo(this,e),this._style.labelHorizontalOrigin=ho(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=fo(this,e),this._style.labelVerticalOrigin=ho(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=fo(this,e),this._style.lineWidth=ho(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Ry.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new Ry(n)})};Ry.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)};Ry.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)};Ry.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)};Ry.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Qn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Qn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Qn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Oy=Ry;var AAe=new ie,_Ae=new ie,KZ=new ie,YV=new Map;YV.set(Sl,{packCollectionData:Rs.packPolylineCollectionData,packTilePrimitives:Rs.packPolylineSegments});YV.set($a,{packCollectionData:Rs.packPolygonCollectionData,packTilePrimitives:Rs.packPolygonRings});var $Z=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 YV.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,AAe);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:Alt(t,r.ellipsoid)};for(let[u,f]of o){if(!yAe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,_Ae);if(!!!ie.intersection(t,d,KZ))continue;let g=YV.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&&(Rs.packPolylineGrid(s),Rs.packPolylineTextures(n,s)),c&&(Rs.packPolygonGrid(s),Rs.packPolygonTextures(n,s)),Rs.packPrimitiveTextures(n,s),s)}releaseTileData(t){Rs.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return blt(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(!yAe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,_Ae),f=!!ie.intersection(n,u,KZ),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 yAe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function Alt(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 blt(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,AAe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],KZ))return!0;return!1}var My=$Z;var bAe=new Wc,xAe=new Pa,TAe=new Fo,xlt=new Zm,Tlt=new cd,Elt=new ad,JZ=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(ff,bAe),yield*this._iteratePrimitivesWith(Sl,xAe),yield*this._iteratePrimitivesWith($a,TAe)}*_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(ff,bAe,xlt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(Sl,xAe,Tlt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith($a,TAe,Elt)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},gv=JZ;var EAe=new h,Clt=new Wc,vlt=new Pa,vAe=new Fo;function Slt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)SAe(e,n[r],M.IDENTITY,i);return i}function XV(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,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?La.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:CAe(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=CAe(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 CAe(e){let t=XV(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Ilt(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?La.readAttributeAsRawCompactTypedArray(o):La.readAttributeAsTypedArray(o)),a=t.indices?La.readIndicesAsTypedArray(t.indices):void 0,c=Plt(e,t,r);n instanceof ff?Dlt(n,i,s,a,c):n instanceof Sl?Rlt(n,i,s,a,c):n instanceof $a&&(l(t.vector)?Olt(n,i,s,a,c,t.vector):Mlt(n,i,s,c,t.polygon))}function Plt(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??La.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new gv(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function Dlt(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,EAe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:EAe,pickObject:u,featureId:u?.featureId},Clt)}}function Rlt(e,t,n,i,r){let o=XV(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=wAe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},vlt),s=u+1,a=0,c++}}function Olt(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},vAe)}}function Mlt(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=XV(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=wAe(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},vAe)}}function SAe(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=wlt(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new ff({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new Sl({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new $a({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),Ilt(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)SAe(e,a[c],o,i)}function wAe(e,t,n,i){let r=XV(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 KV=Slt;var $V=new Wc,JV=new Pa,ZV=new Fo,t1=new Zm,ZZ=new cd,IAe=new ad,PAe=new M,QZ=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 ff).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof $a?t+n.triangleCount:n instanceof Sl?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 Oy({color:i}))}applyStyle(t){let n=o=>o instanceof ff,i=o=>o instanceof Sl,r=o=>o instanceof $a;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,$V);let u=this.getFeature($V.featureId,s);l(t.show)&&($V.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,t1.color),l(t.pointSize)&&(t1.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(t1.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,t1.outlineColor),$V.setMaterial(t1)}}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,JV);let u=this.getFeature(JV.featureId,s);l(t.show)&&(JV.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,ZZ.color),l(t.lineWidth)&&(ZZ.width=t.lineWidth.evaluate(u)),JV.setMaterial(ZZ)}}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,ZV);let u=this.getFeature(ZV.featureId,s);l(t.show)&&(ZV.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,IAe.color),ZV.setMaterial(IAe)}}}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&&(Llt(this),this._ready=!0)}M.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,PAe);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(PAe,this._collectionLocalMatrices[s],a.modelMatrix),!ls(i._heightReference)||!My.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,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=Nlt(t,n,o,r),a=await Td.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function Nlt(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 Llt(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=KV(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Ax=QZ;function tc(){}tc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);tc._sorterTaskProcessor=void 0;tc._taskProcessorReady=!1;tc._error=void 0;tc._getSorterTaskProcessor=function(){if(!l(tc._sorterTaskProcessor)){let e=new Kn("gaussianSplatSorter",tc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?tc._taskProcessorReady=!0:tc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{tc._error=t}),tc._sorterTaskProcessor=e}return tc._sorterTaskProcessor};tc.radixSortIndexes=function(e){let t=tc._getSorterTaskProcessor();if(l(tc._error))throw tc._error;if(tc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var _v=tc;function nc(){}nc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);nc._textureTaskProcessor=void 0;nc._taskProcessorReady=!1;nc._error=void 0;nc._getTextureTaskProcessor=function(){if(!l(nc._textureTaskProcessor)){let e=new Kn("gaussianSplatTextureGenerator",nc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?nc._taskProcessorReady=!0:nc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{nc._error=t}),nc._textureTaskProcessor=e}return nc._textureTaskProcessor};nc.generateFromAttributes=function(e){let t=nc._getTextureTaskProcessor();if(l(nc._error))throw nc._error;if(!nc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var QV=nc;function Flt(e){let t=new X_;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:_c.LESS_OR_EQUAL}})),this.alphaOptions=new ov,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var e4=Flt;var t4=`#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; +`;var xG=`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); } -vec3 halfToVec3(uvec2 packed) { -return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +return shapeUv / u_boxLocalToShapeUvScale; } -vec3 loadAndExpandSHCoeff(uint splatID, int index) { -uvec2 coeff = loadSHCoeff(splatID, index); -return halfToVec3(coeff); +vec3 convertEcToDeltaTile(in vec3 positionEC) { +vec3 dPosition = u_boxEcToXyz * positionEC; +return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w); } -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; +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 TG=`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); } +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); } -return result; +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 -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) -); +dy *= u_cylinderLocalToShapeUvScale.y; +float dz = u_cylinderLocalToShapeUvScale.z * deltaShape.z; +return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w); } -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; +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); } -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; +#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); } -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; +`;var EG=`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 -v_splitDirection = u_splitDirection; +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 n4=`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; +return vec3(v * sign(pos), length(v - evolute)); } -float B = exp(A * 4.) * v_splatColor.a ; -out_FragColor = vec4(v_splatColor.rgb * B , B); +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); } -`;var bx=new M,LAe=new M,n1=new M,Ci=new $,i1=new Le,Blt=new h,klt=new Le,Ult=new h,zlt=1e-12,i4=1e-5,eQ=1e-7,ka={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ls={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Vlt=2,jlt=30,Hlt=3,Glt=.008726646259971648,Wlt=1;function qlt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Hlt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Wlt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Glt:!1}function DAe(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 Ylt(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 RAe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function tQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function OAe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Xlt(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 Klt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function $lt(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=Klt(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 Jlt(e,t){return e.length===t?e:e.subarray(0,t)}function Zlt(e,t,n){if(!l(t.indexes)||t.state!==Ls.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&&OAe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&OAe(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 Qlt(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=Ls.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=NAe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=NAe(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=tut(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ls.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ls.BUILDING}}async function eut(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===Ls.SORTING&&(n.snapshot.state=Ls.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ls.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,Zlt(e,c,t),e._pendingSnapshot=void 0,Ll.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ls.SORTING&&(n.snapshot.state=Ls.TEXTURE_READY),e._sorterState=ka.ERROR,e._sorterError=r}}async function MAe(e,t,n){try{let i=await n,r=RAe(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(!RAe(e,t))return;e._sorterState=ka.ERROR,e._sorterError=i}}function tut(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 NAe(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 Ll(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=Wo.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(Gi.Y,Gi.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(Ll.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ls.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});Ll.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)};Ll.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,tQ(this._pendingSnapshot),tQ(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),le(this)};Ll.prototype.isDestroyed=function(){return this._isDestroyed};Ll.prototype.onTileLoad=function(e){this._dirty=!0};Ll.prototype.onTileVisible=function(e){};Ll.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,bx);M.multiplyTransformation(o,e.content.worldTransform,o);let s=M.inverse(r,LAe),a=M.multiplyTransformation(s,o,bx),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&M.equalsEpsilon(a,c,zlt))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)<=eQ&&Math.abs(g-1)<=eQ&&Math.abs(m-1)<=eQ,T=Math.abs(y)<=i4&&Math.abs(A)<=i4&&Math.abs(b)<=i4,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)<=i4;Le.fromRotationMatrix(Ci,i1),Le.normalize(i1,i1);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=Blt,L=klt,_=Ult;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(i1,L,L),Le.normalize(L,L)):(M.fromTranslationQuaternionRotationScale(O,L,_,n1),M.multiplyTransformation(a,n1,n1),M.getTranslation(n1,O),M.getScale(n1,_),Le.multiply(i1,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};Ll.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ls.BUILDING)return;n.state=Ls.TEXTURE_PENDING;let i=QV.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=Ls.BUILDING;return}Qlt(e,t,n,i)};Ll.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new e4(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=nn.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(t4),r.addFragmentLines(n4);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 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 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};Ll.prototype.update=function(e){let t=this._tileset;if(Xlt(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&&Ylt(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>=Vlt,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>=jlt;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)&&tQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=M.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,LAe);M.multiplyTransformation(v,E.content.worldTransform??M.IDENTITY,v),M.getRotation(M.inverse(v,v),this._shInverseRotation)}for(let E of u)Ll.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=$lt(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 Jlt(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:Ls.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===Ls.BUILDING){Ll.generateSplatTexture(this,e,u);return}if(u.state===Ls.TEXTURE_PENDING||u.state===Ls.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,bx),u.state===Ls.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=_v.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(bx),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ls.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ls.SORTING;let g=this._pendingSort;eut(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ls.SORTING&&(u.state=Ls.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,bx),!l(this._sorterPromise)){if(!qlt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=_v.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(bx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){DAe(this,e);let g=this._activeSort;this._sorterState=ka.SORTING,MAe(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=_v.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(bx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){DAe(this,e);let c=this._activeSort;this._sorterState=ka.SORTING,MAe(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)Ll.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 r4=Ll;var iQ=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 r4({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:Gi.Y,forwardAxis:Gi.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 yd(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}=iut(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=aut(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),le(this)}};function nut(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function iut(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 FAe=new ArrayBuffer(4),rut=new Float32Array(FAe),out=new Uint32Array(FAe);function nQ(e){rut[0]=e;let t=out[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 sut(e){let t=nut(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 aut(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}=sut(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]=nQ(o[u].typedArray[y])|nQ(o[u].typedArray[y+1])<<16,r[m+1]=nQ(o[u].typedArray[y+2])}}return r}var xx=iQ;var BAe={b3dm:function(e,t,n,i,r){return Ed.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Ed.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Ed.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return hk.fromTileType(e,t,n,i,r,BAe)},externalTileset:function(e,t,n,i){return dV.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new bk(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new WV(e,t,n,i,r)},subt:function(e,t,n,i,r){return lD.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return lD.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 xx.tilesetRequiresGaussianSplattingExt(e)?xx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ax.fromGltf(e,t,n,c):Ed.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return xx.tilesetRequiresGaussianSplattingExt(e)?xx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ax.fromGltf(e,t,n,i):Ed.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Ed.fromGeoJson(e,t,n,i)}},yv=BAe;var kAe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(kAe);var Nr=kAe;var Sd={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"};Sd.isBinaryFormat=function(e){switch(e){case Sd.BATCHED_3D_MODEL:case Sd.INSTANCED_3D_MODEL:case Sd.COMPOSITE:case Sd.POINT_CLOUD:case Sd.VECTOR:case Sd.GEOMETRY:case Sd.IMPLICIT_SUBTREE:case Sd.VOXEL_BINARY:case Sd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Sd);var Ua=Sd;var UAe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(UAe);var Wh=UAe;var _a={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},pg=new Array(_a.NUMBER_OF_PASSES);pg[_a.RENDER]=Object.freeze({pass:_a.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});pg[_a.PICK]=Object.freeze({pass:_a.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});pg[_a.SHADOW]=Object.freeze({pass:_a.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});pg[_a.PRELOAD]=Object.freeze({pass:_a.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});pg[_a.PRELOAD_FLIGHT]=Object.freeze({pass:_a.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});pg[_a.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:_a.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});pg[_a.MOST_DETAILED_PRELOAD]=Object.freeze({pass:_a.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});pg[_a.MOST_DETAILED_PICK]=Object.freeze({pass:_a.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});_a.getPassOptions=function(e){return pg[e]};Object.freeze(_a);var mo=_a;var rQ=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 le(this)}},gg=rQ;function _g(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(_g.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});_g.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};_g.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};_g.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};_g.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};_g.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};_g.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};_g.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var o4=_g;function oQ(e,t){let n=ar(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){oQ._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 o4({content:n,class:r})}}oQ._oneTimeWarning=yt;var Av=oQ;function cut(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=ar(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 bv=cut;function yg(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(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 Xn.hasProperty(e,this._properties,this._class)};yg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};yg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};yg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};yg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};yg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};yg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var s4=yg;function sQ(e,t){let n=ar(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){sQ._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 s4({tile:n,class:r})}}sQ._oneTimeWarning=yt;var a4=sQ;function lut(e){let t=new Uint8Array(e),n=np(t);if(n==="glTF"&&(n="glb"),Ua.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=uut(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 uut(e){let t;try{t=Lo(e)}catch{throw new oe("Invalid tile content.")}return t}var Ny=lut;var aQ=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=Tl.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(!fut(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;cQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=dut(this,i,n,this._tile._contentState);return hut(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 le(this)}};function cQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function zAe(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 fut(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)&&!Tl.serverHasOpenSlots(n,t[n]))return!1;return Tl.heapHasOpenSlots(e.length)}function dut(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){zAe(e,i);return}return cQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){zAe(e,i);return}cQ(e,-1),VAe(e,t,f)}})}async function hut(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>mut(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 mut(e,t,n){if(l(t))try{let i=Ny(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=yv[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=Av(r,u));let f=bv(r,u);return l(f)&&(a.group=new fC({metadata:f})),a}catch(i){VAe(e,n,i)}}function VAe(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 c4=aQ;var jAe=Math.cos,HAe=Math.sin,put=Math.sqrt,lQ={};lQ.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=jAe(f),p=HAe(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*jAe(m),A=d*HAe(m),b=a.x*y,x=a.y*A,T=put(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 gut=new $i,wd=new h,_ut=new he,l4=new h,r1=new Hi;function GAe(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;r1._ellipsoid=ee.default,wd=r1.project(e,wd),wd=h.subtract(wd,l4,wd);let g=$i.fromRotation(t,gut);wd=$i.multiplyByVector(g,wd,wd),wd=h.add(wd,l4,wd),e=r1.unproject(wd,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}}lQ.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,_ut);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=P.TWO_PI),r1._ellipsoid=ee.default,l4=r1.project(E,l4));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 _=GAe(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=GAe(_,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 za=lQ;var yut=new ue,Aut=new ue,but=new h,xut=new ie;function WAe(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=but;if(o)za.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++)za.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++)za.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--)za.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--)za.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 Cn,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function Tut(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=WAe(e,t),s=t.height,a=t.width,c=hi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=hi.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 qAe=new ie,YAe=ee.clone(ee.UNIT_SPHERE),xv={rectangle:qAe,ellipsoid:YAe,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,qAe);t+=ie.packedLength;let r=ee.unpack(e,t,YAe);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):(xv.granularity=o,xv.height=s,xv.rotation=a,xv.extrudedHeight=c,xv.offsetAttribute=u===-1?void 0:u,new Tv(xv))};var Eut=new he;Tv.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=za.computeOptions(t,e._granularity,e._rotation,0,xut,Eut),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=Tut(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===_n.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===_n.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ue.fromRectangle3D(t,n,s,Aut),d=ue.fromRectangle3D(t,n,a,yut);o=ue.union(f,d)}else{if(r=WAe(e,i),r.attributes.position.values=hi.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===_n.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=ue.fromRectangle3D(t,n,s)}return new wt({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var Ev=Tv;var u4=`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); +vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) { +float longitude = shapeUv.x * czm_twoPi; +#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) +longitude /= u_ellipsoidLocalToShapeUvScale.x; #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); +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 f4=`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; +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); } -`;var Cv=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); +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); } -`;var d4=`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; +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); } -`;function Ag(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?d4:f4,o=i?Cv:u4,s=i?Ag.FLAT_VERTEX_FORMAT:Ag.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Pr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Ag.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}}});Ag.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;Ag.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;Ag.prototype.getFragmentShaderSource=Pr.prototype.getFragmentShaderSource;Ag.prototype.isTranslucent=Pr.prototype.isTranslucent;Ag.prototype.getRenderState=Pr.prototype.getRenderState;var An=Ag;function Cut(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 h4=Cut;function o1(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(o1.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});o1.fromCartesian3=function(e){return new o1(e.x,e.y,e.z)};o1.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=o1;function vut(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)&&qn.transformToWorldCoordinates(e[o]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function uQ(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 Sut(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?uQ(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(uQ(i.westHemisphereGeometry,n),uQ(i.eastHemisphereGeometry,n))}}function wut(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(vut(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&qn.splitLongitude(t[c]);if(Sut(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(qn.reorderForPostVertexCache(g.geometry),qn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(qn.reorderForPostVertexCache(g.westHemisphereGeometry),qn.reorderForPreVertexCache(g.westHemisphereGeometry),qn.reorderForPostVertexCache(g.eastHemisphereGeometry),qn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=qn.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&&qn.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`;qn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),qn.encodeAttribute(u,y,`${y}High`,`${y}Low`),qn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&qn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(qn.fitToUnsignedShortIndices(u));p=g}return p}function fQ(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 Iut(e,t){let n=[];return fQ(e,"geometry",t,n),fQ(e,"westHemisphereGeometry",t,n),fQ(e,"eastHemisphereGeometry",t,n),n}var bg={};bg.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=wut(e),t.length>0&&(n=qn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=Iut(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]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function Put(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 Dut(e,t){let n=e.length;for(let i=0;i<n;++i)Put(e[i],t)}function Rut(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*ue.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}bg.packCreateGeometryResults=function(e,t){let n=new Float64Array(Rut(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&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.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}};bg.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=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let y,A,b,x=new Cn,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 Out(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 Mut(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}bg.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:Out(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Hi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};bg.unpackCombineGeometryParameters=function(e){let t=Mut(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=bg.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 Hi(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 XAe(e){let t=e.length,n=1+(ue.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,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function KAe(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}bg.packCombineGeometryResults=function(e,t){l(e.geometries)&&Dut(e.geometries,t);let n=XAe(e.boundingSpheres),i=XAe(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}};bg.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:KAe(e.boundingSpheres),boundingSpheresCV:KAe(e.boundingSpheresCV)}};var vv=bg;var $Ae={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze($Ae);var gs=$Ae;function $o(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??Pn.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($o.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 Nut(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 Lut=new U,Fut=new h,obe=new se;function sbe(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,Lut);if(t===3)return h.unpack(e,0,Fut);if(t===4)return se.unpack(e,0,obe)}function But(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=Nut(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 KE(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=sbe(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=obe;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 kut(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 Uut(e){let t=e.attributes,n=new Cn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=kut(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:ue.clone(e.boundingSphere)})}function zut(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var Vut=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;$o._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=Vut.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; +#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); } - -`,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); +`;var CG=`#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 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); } - -`:(o+=`in vec3 ${a}2DHigh; -in vec3 ${a}2DLow; -`,s+=`${c} -{ - vec4 p; - if (czm_morphTime == 1.0) - { - p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow); - } - else if (czm_morphTime == 0.0) - { - p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy); - } - else - { - p = czm_columbusViewMorph( - czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy), - czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow), - czm_morphTime); - } - return p; +int normU8x2_toInt(in vec2 value) { +return int(value.x * 255.0) + 256 * int(value.y * 255.0); } - -`)}return[r,o,t,s].join(` -`)};$o._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};$o._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 JAe(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 ZAe(e){return`in vec4 v_pickColor; -${e}`}$o._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};$o._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};$o._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?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) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow); - } - else if (czm_morphTime == 0.0) - { - centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy); - } - else - { - centerRTE = czm_columbusViewMorph( - czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy), - czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow), - czm_morphTime); - } -`,r+=` float radiusSq = boundingSphereRadius * boundingSphereRadius; - float distanceSq; - if (czm_sceneMode == czm_sceneMode2D) - { - distanceSq = czm_eyeHeight2D.y - radiusSq; - } - else - { - distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; - } - distanceSq = max(distanceSq, 0.0); - float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; - float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; - float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; - gl_Position *= show; -}`,`${i} -${r}`};function QAe(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; -`,d+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent); -`):(n&&(f+=`vec3 normal; -`,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() -{ -${d} czm_non_compressed_main(); -}`;return[u,f,p,g].join(` -`)}function jut(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 Hut(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(); - #else - czm_writeDepthClamp(); - #endif +float normU8x2_toFloat(in vec2 value) { +return float(normU8x2_toInt(value)) / 65535.0; } -`,t}function ebe(e,t){let n=e.vertexAttributes}function Gut(e,t){return function(){return e[t]}}var dQ=Math.max(dn.hardwareConcurrency-1,1),m4,Wut=new Kn("combineGeometry");function qut(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(m4))for(m4=new Array(dQ),r=0;r<dQ;r++)m4[r]=new Kn("createGeometry");let f;for(u=h4(u,dQ),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(m4[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){a1(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=Wut.scheduleTask(vv.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=vv.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):a1(e,t,gs.FAILED,void 0)}).catch(function(d){a1(e,t,gs.FAILED,d)})}}function Yut(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=Uut(p):g=p.constructor.createGeometry(p),r[c++]=zut(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=vv.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):a1(e,t,gs.FAILED,void 0)}function Xut(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 ue;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),ube(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.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=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.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]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}$o._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var tbe=new Sn,abe=new he,cbe=new h,lbe=new ue;function Kut(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=ue.transform(y,A,lbe));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,abe),v=u.project(E,cbe);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 hQ=new h,$ut=new h;function nbe(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=ue.transform(f,p,lbe));let g=f.center;g=o.scaleToGeodeticSurface(g,$ut);let m=o.cartesianToCartographic(g,abe),y=r.project(m,cbe),A=h.add(d,g,hQ);m=o.cartesianToCartographic(A,m);let b=r.project(m,hQ),x=h.subtract(b,y,hQ),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function Jut(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(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!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(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,a1(e,t,gs.COMPLETE,void 0)}function Zut(e,t,n,i){let r=n.getRenderState(),o;i?(o=Ze(r,!1),o.cull={enabled:!0,face:ji.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=ji.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=_c.GREATER,i?(o.cull={enabled:!0,face:ji.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=ji.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function Qut(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=$o._appendOffsetToShader(e,o),o=$o._appendShowToShader(e,o),o=$o._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=JAe(o),o=$o._updateColorAttribute(e,o,!1),o=QAe(e,o),o=$o._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=ZAe(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),ebe(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=$o._appendShowToShader(e,o),o=$o._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=JAe(o),o=$o._updateColorAttribute(e,o,!0),o=QAe(e,o),o=$o._modifyShaderPosition(e,o,t.scene3DOnly),o=jut(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=ZAe(s),s=Hut(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),ebe(e._spDepthFail,r))}var s1=new M,ibe=new h;function rbe(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]=Gut(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 M.multiply(c,e._modelMatrix,s1),M.multiplyByPoint(s1,e.rtcCenter,ibe),M.setTranslation(s1,ibe,s1),s1}),a}function eft(e,t,n,i,r,o,s,a){let c=rbe(e,t,n,a),u;l(e._depthFailAppearance)&&(u=rbe(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}}$o._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]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.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 tft(e,t,n,i,r,o,s,a){$o._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=Pn.castShadows(e.shadows),g=Pn.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)}}}$o.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)||But(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?qut(this,e):Yut(this,e)),this._state===gs.COMBINED&&(Kut(this,e),nbe(this,e),Jut(this,e)),!this.show||this._state!==gs.COMPLETE)return;this._batchTableOffsetsUpdated||nbe(this,e),this._recomputeBoundingSpheres&&Xut(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??Zut)(this,t,n,u),o&&(this._createShaderProgramFunction??Qut)(this,e,n),(r||o)&&(this._createCommandsFunction??eft)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??tft)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var nft=new ue,ift=new ue;function ube(e,t,n){if(n===_n.TOP){let i=ue.clone(e,nft),r=ue.clone(e,ift);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===_n.ALL&&(e.center=h.add(e.center,t,e.center));return e}function rft(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 oft(e,t,n,i,r){return function(o){let s=sbe(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var sft=new h;function aft(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)&&ube(i,h.fromArray(o.get(),0,sft),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function cft(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}$o.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:rft(s,n,f),set:oft(s,n,f,this,u)}}return aft(this,c,n),cft(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};$o.prototype.isDestroyed=function(){return!1};$o.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,le(this)};function a1(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=$o;function wv(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;hft(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(wv.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});wv.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var fbe=new h,p4=new h,dbe=new h,lft=new h,uft=new h,fft=new h,dft=new h,Id=new he,hbe=new sn(h.UNIT_X,0),Sv=new gn;function hft(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),Id.longitude=t.west,Id.latitude=(t.south+t.north)*.5,Id.height=0;let i=n.cartographicToCartesian(Id,fft),r=h.cross(i,h.UNIT_Z,lft);h.normalize(r,e.westNormal),Id.longitude=t.east;let o=n.cartographicToCartesian(Id,dft),s=h.cross(h.UNIT_Z,o,fbe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,fbe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,uft),u=t.south,f;if(u>0){Id.longitude=(t.west+t.east)*.5,Id.latitude=u;let y=n.cartographicToCartesian(Id,Sv.origin);h.clone(c,Sv.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,hbe);Ti.rayPlane(Sv,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,p4)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),p4);let d=h.cross(f,a,dbe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Id.longitude=(t.west+t.east)*.5,Id.latitude=p;let y=n.cartographicToCartesian(Id,Sv.origin);h.negate(c,Sv.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,hbe);Ti.rayPlane(Sv,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,p4)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),p4);let m=h.cross(a,g,dbe);h.normalize(m,e.northNormal)}var mft=new h,pft=new h,gft=new h(0,-1,0),_ft=new h(0,0,-1),mbe=new h;function yft(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),mft),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),pft),f.z=f.y,f.y=f.x,f.x=0,d=gft,g=h.UNIT_Y,p=_ft,m=h.UNIT_Z);let y=h.subtract(i,u,mbe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,mbe),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)}wv.prototype.distanceToCamera=function(e){let t=yft(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};wv.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};wv.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Ev({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 Pd=wv;var c1={},Aft=new h,pbe=new h,gbe=new h,_be=new h,ybe=new en;c1.validOutline=function(e){let n=en.fromPoints(e,ybe).halfAxes,i=$.getColumn(n,0,pbe),r=$.getColumn(n,1,gbe),o=$.getColumn(n,2,_be),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};c1.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,ybe),o=r.halfAxes,s=$.getColumn(o,0,pbe),a=$.getColumn(o,1,gbe),c=$.getColumn(o,2,_be),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 Abe(e,t,n,i,r){let o=h.subtract(e,t,Aft),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}c1.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Abe(i[o],e,t,n);return r}};c1.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Abe(i,e,t,n,r)}};var Ly=c1;function bft(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 Cn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new wt({attributes:s,indices:i,primitiveType:Oe.LINES})}function Tx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ti.computeHierarchyPackedLength(t,h)+1}Tx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new Tx(t)};Tx.pack=function(e,t,n){return n=n??0,n=ti.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var xft={polygonHierarchy:{}};Tx.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new Tx(xft)),n._polygonHierarchy=i,n.packedLength=r,n};Tx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Br(n,h.equalsEpsilon,!0),n.length<3||!Ly.validOutline(n))return;let r=ti.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:bft(r[c])});o.push(u)}let s=qn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new wt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var qh=Tx;var g4=new he;function l1(e){let t=ry.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=Dft(t,n,i,r);this._boundingPlanes=o;let s=Nft(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=xQ(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]=xQ(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=xQ(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();g4=r.cartesianToCartographic(c,g4),g4.height=(i+n)/2,this.center=r.cartographicToCartesian(g4,c),this._boundingSphere=ue.fromPoints(s)}var Tft=new h,Eft=new he,Cft=new h,vft=new he,Sft=new h,wft=new h,Ift=new h,Pft=new h;function Dft(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,Tft),a=i.cartesianToCartographic(o,Eft);a.height=n;let c=i.cartographicToCartesian(a,Cft),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,vft),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,Sft));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,wft),x=h.subtract(A,g,Pft),T=h.cross(x,b,Ift);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var Ex=new h,Cx=new h,vx=new h,mQ=new h,pQ=new h,gQ=new h,Rft=new h,Oft=new h,Mft=new h,_Q=new h,yQ=new h,AQ=new h,Fy=new h,bp=new $;function bbe(e,t,n){Ex=e.normal,Cx=t.normal,vx=n.normal,mQ=h.multiplyByScalar(e.normal,-e.distance,mQ),pQ=h.multiplyByScalar(t.normal,-t.distance,pQ),gQ=h.multiplyByScalar(n.normal,-n.distance,gQ),_Q=h.multiplyByScalar(h.cross(Cx,vx,Rft),h.dot(mQ,Ex),_Q),yQ=h.multiplyByScalar(h.cross(vx,Ex,Oft),h.dot(pQ,Cx),yQ),AQ=h.multiplyByScalar(h.cross(Ex,Cx,Mft),h.dot(gQ,vx),AQ),bp[0]=Ex.x,bp[1]=Cx.x,bp[2]=vx.x,bp[3]=Ex.y,bp[4]=Cx.y,bp[5]=vx.y,bp[6]=Ex.z,bp[7]=Cx.z,bp[8]=vx.z;let i=$.determinant(bp);return Fy=h.add(_Q,yQ,Fy),Fy=h.add(Fy,AQ,Fy),new h(Fy.x/i,Fy.y/i,Fy.z/i)}function Nft(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=bbe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=bbe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var bQ=new h,Iv=new h;function xQ(e,t){let n=[];for(let i=0;i<4;i++)bQ=h.subtract(t[(i+1)%4],t[i],bQ),Iv=h.cross(e.normal,bQ,Iv),Iv=h.normalize(Iv,Iv),n[i]=h.clone(Iv);return n}Object.defineProperties(l1.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var TQ=new h;l1.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=EQ(sn.projectPointOntoPlane(c,t,TQ),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=xbe(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=EQ(sn.projectPointOntoPlane(c,t,TQ),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=EQ(sn.projectPointOntoPlane(this._boundingPlanes[1],t,TQ),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 Lft=new h,Fft=new h;function xbe(e,t,n){let i=h.subtract(n,t,Lft),r=h.subtract(e,t,Fft),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 Bft=new sn(h.UNIT_X,0);function EQ(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],Bft);sn.getPointDistance(u,e)<0||(a=xbe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}l1.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};l1.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new qh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=qh.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new qh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=qh.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 qh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=qh.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 _4=l1;var kft=new h(1,1,1),y4=Math.cos,A4=Math.sin;function Pv(e){e=e??H.EMPTY_OBJECT;let t=e.radii??kft,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"}Pv.packedLength=2*h.packedLength+8;Pv.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 Tbe=new h,Ebe=new h,xg={radii:Tbe,innerRadii:Ebe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};Pv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Tbe);t+=h.packedLength;let r=h.unpack(e,t,Ebe);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):(xg.minimumClock=o,xg.maximumClock=s,xg.minimumCone=a,xg.maximumCone=c,xg.stackPartitions=u,xg.slicePartitions=f,xg.subdivisions=d,xg.offsetAttribute=p===-1?void 0:p,new Pv(xg))};Pv.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]=A4(I),L[E]=y4(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=A4(S),C[E]=y4(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]=A4(I),L[E]=y4(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=A4(S),C[E]=y4(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 Cn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let N=b.length,F=e._offsetAttribute===_n.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:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Dd=Pv;function Dv(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"}Dv.packedLength=Dd.packedLength;Dv.pack=function(e,t,n){return Dd.pack(e._ellipsoidGeometry,t,n)};var Uft=new Dd,Sx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};Dv.unpack=function(e,t,n){let i=Dd.unpack(e,t,Uft);return Sx.stackPartitions=i._stackPartitions,Sx.slicePartitions=i._slicePartitions,Sx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Sx.radii),n._ellipsoidGeometry=new Dd(Sx),n):(Sx.radius=i._radii.x,new Dv(Sx))};Dv.createGeometry=function(e){return Dd.createGeometry(e._ellipsoidGeometry)};var By=Dv;function Rv(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(Rv.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}}});Rv.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};Rv.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};Rv.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};Rv.prototype.createDebugVolume=function(e){let t=new By({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 ky=Rv;var zft=new h;function xp(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"}xp.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new xp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};xp.fromAxisAlignedBoundingBox=function(e){return new xp({minimum:e.minimum,maximum:e.maximum})};xp.packedLength=2*h.packedLength+1;xp.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 vbe=new h,Sbe=new h,Cbe={minimum:vbe,maximum:Sbe,offsetAttribute:void 0};xp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,vbe),r=h.unpack(e,t+h.packedLength,Sbe),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):(Cbe.offsetAttribute=o===-1?void 0:o,new xp(Cbe))};xp.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new Cn,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,zft),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===_n.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 ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Tp=xp;var Vft=new h,jft=new h,Hft=new h,Gft=new h;function wx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function CQ(e,t){let n=h.normalize(e,Gft),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return wx(e,i,t)}function wbe(e){let t=$.getColumn(e,0,Vft),n=$.getColumn(e,1,jft),i=$.getColumn(e,2,Hft),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=wx(n,i,t):!r&&o&&!s?n=wx(t,i,n):!r&&!o&&s?i=wx(n,t,i):r?o?s||(t=CQ(i,t),n=wx(i,t,n)):(t=CQ(n,t),i=wx(n,t,i)):(n=CQ(t,n),i=wx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function Ov(e,t){t=wbe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Ov.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Ov.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};Ov.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Ov.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=wbe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};Ov.prototype.createDebugVolume=function(e){let t=new Tp({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 bf=Ov;function io(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||ar(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=a4(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,io._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")&&io._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?vo.REPLACE:vo.ADD):l(i)?p=i.refine:p=vo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Nr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(io._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(io._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 gg(e,this),m=!0,y=Nr.READY):(y=Nr.UNLOADED,A=t.getDerivedResource({url:v}),b=Tl.getServerKey(A.getUrlComponent()))}else g=new gg(e,this),m=!0,y=Nr.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=Wh.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}io._deprecationWarning=Yr;Object.defineProperties(io.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===Nr.READY}},contentUnloaded:{get:function(){return this._contentState===Nr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Nr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Nr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Uy=new h;function Wft(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Uy),c=h.add(s.positionWC,a,Uy),u=h.subtract(c,o,Uy);if(h.magnitude(u)>r){let E=h.normalize(u,Uy),v=h.multiplyByScalar(E,r,Uy),S=h.add(o,v,Uy),I=h.subtract(S,s.positionWC,Uy),R=h.normalize(I,Uy);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===vo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===mo.PRELOAD_FLIGHT||n._pass===mo.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 Mbe=new K;io.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 pn){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 qft(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 Yft(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}io.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:ca.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!==ca.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Yft(n,this),this._priorityProgressiveResolution=qft(n,this),this.priorityDeferred=Wft(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};io.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(Mbe);K.lessThan(this.expireDate,e)&&(this._contentState=Nr.EXPIRED,this._expiredContent=this._content)}};function Xft(e){if(!l(e.expireDuration))return;let t=K.now(Mbe);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 Kft(e){return function(){return e._priority}}io.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?$ft(this):Zft(this)};function $ft(e){let t=e._content,n=e._tileset;if(!l(t)){let r=ar(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new c4(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Nr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Nr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Nr.FAILED,r})}async function Jft(e,t,n,i,r){let o=e._contentState;e._contentState=Nr.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(Nbe(e,a))return i&&(e.expireDate=void 0),e._content=new gg(t,e),Ibe(e),e._contentState=Nr.PROCESSING,e._content;throw e._contentState=Nr.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 Qft(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof gg&&Ibe(e),e._contentState=Nr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Nr.FAILED,a}}function Zft(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:Kft(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 Jft(e,r,i,n,o)}function Nbe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function Ibe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}io._isEmptyTile=Nbe;async function Qft(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=Ny(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=yv[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=Av(n,a));let c=bv(n,a);return l(c)&&(o.group=new fC({metadata:c})),o}io.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};io.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Nr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};io.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Nr.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 Lbe=new ue;function SQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Lbe);e._boundingVolume2D=new ky(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function edt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Lbe);e._contentBoundingVolume2D=new ky(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}io.prototype.visibility=function(e,t){let n=e.cullingVolume,i=SQ(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 ca.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)};io.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===ca.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=edt(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)};io.prototype.distanceToTile=function(e){return SQ(this,e).distanceToCamera(e)};var tdt=new h;io.prototype.distanceToTileCenter=function(e){let n=SQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,tdt);return h.dot(e.camera.directionWC,i)};io.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Fbe=new $,Bbe=new h,ndt=new $,wQ=new h,kbe=new ie,Ube=new en,vQ=new M;function idt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],wQ),r=$.fromArray(e,3,ndt);i=M.multiplyByPoint(t,i,i);let o=M.getMatrix3(t,Fbe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new bf(i,r)}function Pbe(e,t,n,i){let r=ie.unpack(e,0,kbe),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,Ube),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,vQ),vQ),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,Fbe);return u=$.multiply(f,u,u),l(i)&&i instanceof bf?(i.update(c,u),i):new bf(c,u)}function rdt(e,t,n,i){if(!M.equalsEpsilon(t,n,P.EPSILON8))return i instanceof bf?Pbe(e,t,n,i):Pbe(e,t,n,void 0);let r=ie.unpack(e,0,kbe);return i instanceof Pd?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Pd({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function odt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],wQ),r=e[3];i=M.multiplyByPoint(t,i,i);let o=M.getScale(t,Bbe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new ky(i,r)}io.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=Pb.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(ar(e,"3DTILES_bounding_volume_S2"))return new _4(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=idt(o,t,n);return this._verticalExaggeration!==1&&Dbe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=rdt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof bf?Dbe(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=odt(a,t,n);if(this._verticalExaggeration!==1){let u=br.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,wQ),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var sdt=h.unpackArray(new Array(24).fill(0));function Dbe(e,t,n){let i=e.boundingVolume.computeCorners(sdt).map(o=>br.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,Ube);e.update(r.center,r.halfAxes)}io.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,vQ),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()};io.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,Bbe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function adt(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 cdt(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=Nr.FAILED,r}}function ldt(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 udt(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)}io.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;ldt(this,e),udt(this,e),adt(this,e,t,n),cdt(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 Rbe=[];io.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Xft(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Nr.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=Rbe;try{this._content.update(e,t)}catch(i){throw this._contentState=Nr.FAILED,i}Rbe.length=0,t.commandList=n};function Obe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function b4(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}io.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=b4(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===vo.REPLACE?b4(this._priorityHolder._distanceToCamera,n.distance,i.distance):b4(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Obe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=b4(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Obe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===mo.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};io.prototype.isDestroyed=function(){return!1};io.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(),le(this)};var Yh=io;var IQ=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()}},zbe=IQ;var Vbe={},fdt=new h;Vbe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof bf||i instanceof Pd){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=Wh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof bf||a instanceof Pd)){e._optimChildrenWithinParent=Wh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,fdt),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=Wh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Wh.USE_OPTIMIZATION};var x4=Vbe;function ddt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Xh=ddt;function Ep(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Ep.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}}});Ep.prototype.get=function(e){return this._array[e]};Ep.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Ep.prototype.peek=function(){return this._array[this._length-1]};Ep.prototype.push=function(e){let t=this.length++;this._array[t]=e};Ep.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Ep.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Ep.prototype.resize=function(e){this.length=e};Ep.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Pu=Ep;function Tg(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(Tg.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}}});Tg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var u1=Tg;function Eg(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(Eg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Eg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Eg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Eg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Eg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Eg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var T4=Eg;function jbe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new T4({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 u1({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 u1({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(jbe.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 Mv=jbe;function f1(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(f1.prototype,{length:{get:function(){return this._length}}});function hdt(e,t,n){this.item=e,this.previous=t,this.next=n}f1.prototype.add=function(e){let t=new hdt(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 Hbe(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}f1.prototype.remove=function(e){l(e)&&(Hbe(this,e),--this._length)};f1.prototype.splice=function(e,t){if(e===t)return;Hbe(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 E4=f1;function zy(){this._list=new E4,this._sentinel=this._list.add(),this._trimTiles=!1}zy.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};zy.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};zy.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};zy.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};zy.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};zy.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)}};zy.prototype.trim=function(){this._trimTiles=!0};var C4=zy;function v4(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 DQ(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}v4.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=DQ(e,n),this._referenceMaximum[n]=DQ(t,n)};function mdt(e,t){let n=e.tilePropertyName;if(l(n)){let i=DQ(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 PQ=[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)];v4.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=mdt(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=PQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=PQ[d],y=PQ[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};v4.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 S4=v4;function Nv(){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}Nv.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};Nv.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])}};Nv.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Ed))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])}};Nv.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Ed))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])}};Nv.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 Cp=Nv;function d1(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(d1.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});d1.prototype.makeDirty=function(){this._styleDirty=!0};d1.prototype.resetDirty=function(){this._styleDirty=!1};d1.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 w4=d1;function Gbe(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}Gbe.maximumFrameNumber=15e6;var Ix=Gbe;function pdt(e,t,n){let i=ar(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)&&!ar(r,"3DTILES_bounding_volume_S2")&&!ar(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=gdt(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=_dt(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 gdt(e){if(ar(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 _dt(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 Cg=pdt;var h1={};function Wbe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function RQ(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function qbe(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 OQ(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}h1.encode2D=function(e,t){return(Wbe(e)|Wbe(t)<<1)>>>0};h1.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=qbe(e),t[1]=qbe(e>>1),t};h1.encode3D=function(e,t,n){return RQ(e)|RQ(t)<<1|RQ(n)<<2};h1.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=OQ(e),t[1]=OQ(e>>1),t[2]=OQ(e>>2),t};var Px=h1;function po(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(po.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?Px.encode3D(this.x,this.y,this.z):Px.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}}});po.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 po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};po.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 po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};po.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 po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};po.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 po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new po({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};po.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};po.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};po.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};po.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)};po.prototype.isImplicitTilesetRoot=function(){return this.level===0};po.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};po.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};po.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 Ybe=[0,0,0];po.fromMortonIndex=function(e,t,n,i){let r;return e===Ys.OCTREE?(r=Px.decode3D(i,Ybe),new po({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Px.decode2D(i,Ybe),new po({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};po.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),po.fromMortonIndex(e,t,i,o)};var vg=po;function Sg(){}Sg.selectTiles=function(e,t){pe.throwInstantiationError()};Sg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Sg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Sg.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)};Sg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Sg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Sg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!ydt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function ydt(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}Sg.updateTile=function(e,t){Xbe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,xdt(e),e._shouldSelect=!1,e._finalResolution=!0};function Xbe(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];Xbe(o,t),e._visible=o._visible;return}if(Adt(e,t)){e._visible=!1;return}let i=e.refine===vo.REPLACE,r=e._optimChildrenWithinParent===Wh.USE_OPTIMIZATION;if(i&&r&&n&&!bdt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Adt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==vo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function bdt(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 xdt(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 ic=Sg;function Kbe(){}var m1={stack:new Pu,stackMaximumLength:0};Kbe.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}=ic,s=m1.stack;for(s.push(i);s.length>0;){m1.stackMaximumLength=Math.max(m1.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===vo.ADD,u=a.refine===vo.REPLACE,f=Tdt(a);f&&Edt(a,s,t),(c||u&&!f)&&(Cdt(e,a),r(a,t),vdt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return m1.stack.trim(m1.stackMaximumLength),n};function Tdt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Edt(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 Cdt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function vdt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var I4=Kbe;function $be(){}var p1={stack:new Pu,stackMaximumLength:0},g1={stack:new Pu,stackMaximumLength:0};$be.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(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;wdt(n,t),p1.stack.trim(p1.stackMaximumLength),g1.stack.trim(g1.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function MQ(e,t){e.contentAvailable&&ic.selectTile(e,t)}function Sdt(e,t,n){let i=e.refine===vo.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=ic;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(ic.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=Idt(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 wdt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=ic,a=p1.stack;for(a.push(e);a.length>0;){p1.stackMaximumLength=Math.max(p1.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Sdt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===vo.ADD?(MQ(c,t),r(c,t)):c.refine===vo.REPLACE&&(r(c,t),d&&MQ(c,t)):(n._emptyTiles.push(c),r(c,t),d&&MQ(c,t)),o(c,t),s(c,t)}}function Idt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=ic,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=g1.stack;for(c.push(e);c.length>0;){g1.stackMaximumLength=Math.max(g1.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 P4=$be;function Jbe(){}var _1={stack:new Pu,stackMaximumLength:0},y1={stack:new Pu,stackMaximumLength:0},wg={stack:new Pu,stackMaximumLength:0,ancestorStack:new Pu,ancestorStackMaximumLength:0},Pdt=2;Jbe.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(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Ldt(n,t),Fdt(n,t),_1.stack.trim(_1.stackMaximumLength),y1.stack.trim(y1.stackMaximumLength),wg.stack.trim(wg.stackMaximumLength),wg.ancestorStack.trim(wg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Ddt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=ic,o=y1.stack;for(o.push(e);o.length>0;){y1.stackMaximumLength=Math.max(y1.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<Pdt&&o.push(u))}}}function D4(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Ddt(e,t)}function Rdt(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 Odt(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 Mdt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=ic;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(ic.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 Ndt(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 Ldt(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}=ic,c=_1.stack;for(c.push(e);c.length>0;){_1.stackMaximumLength=Math.max(_1.stackMaximumLength,c.length);let u=c.pop();Rdt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Mdt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===vo.ADD?(D4(u,t),o(u,t)):u.refine===vo.REPLACE&&(Ndt(u,i)?(o(u,t),p&&D4(u,t)):p?(D4(u,t),o(u,t)):Odt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&D4(u,t)),s(u,t),a(u,t)}}function Fdt(e,t){let{selectTile:n,canTraverse:i}=ic,{stack:r,ancestorStack:o}=wg,s;for(r.push(e);r.length>0||o.length>0;){if(wg.stackMaximumLength=Math.max(wg.stackMaximumLength,r.length),wg.ancestorStackMaximumLength=Math.max(wg.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===vo.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 R4=Jbe;function ya(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(ya.prototype,{length:{get:function(){return this._layers.length}}});ya.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()})};ya.prototype.addImageryProvider=function(e,t){let n=new Ms(e);return this.add(n,t),n};ya.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};ya.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=[]};ya.prototype.contains=function(e){return this.indexOf(e)!==-1};ya.prototype.indexOf=function(e){return this._layers.indexOf(e)};ya.prototype.get=function(e){return this._layers[e]};function O4(e,t){return e.indexOf(t)}function Zbe(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)}ya.prototype.raise=function(e){let t=O4(this._layers,e);Zbe(this,t,t+1)};ya.prototype.lower=function(e){let t=O4(this._layers,e);Zbe(this,t,t-1)};ya.prototype.raiseToTop=function(e){let t=O4(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))};ya.prototype.lowerToBottom=function(e){let t=O4(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 Qbe=new ie;function exe(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=Qbe,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)}}ya.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(exe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var Bdt=new ie,kdt=new ie,NQ=new U,LQ=new U,Udt=new he,zdt=new he;function Vdt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,Bdt),s=1/1024,a=kdt;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 Hi)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;NQ.x=a.west,NQ.y=a.south,LQ.x=a.east,LQ.y=a.north;let u=c.unproject(NQ,Udt),f=c.unproject(LQ,zdt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function jdt(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=Vdt(A,d.textureCoordinateRectangle,g,Qbe);ie.contains(b,t)&&n(p)}}}}ya.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)&&exe(t,r,!0,function(c){a(c)}),l(i)&&jdt(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})};ya.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ya.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ya.prototype.isDestroyed=function(){return!1};ya.prototype.destroy=function(){return this.removeAll(!0),le(this)};ya.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 Lv=ya;function ro(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 C4,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 Pu,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 w4,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Cp,this._statisticsLast=new Cp,this._statisticsPerPass=new Array(mo.NUMBER_OF_PASSES);for(let r=0;r<mo.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Cp;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 S4(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 Lv(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??Pn.ENABLED,this.show=e.show??!0,this.colorBlendMode=lf.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new ig(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Ay,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)&&(il.setOwner(e.clippingPolygons,this,"_clippingPolygons"),oxe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new zC,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new gy(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??Wo.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??Lh.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(ro.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){il.setOwner(e,this,"_clippingPolygons"),oxe(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=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,uxe(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}}});ro.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return ro.fromUrl(n,t)};ro.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 ro.loadJson(n),o=await Hdt(n,r),s=new ro(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,uxe(s);let c=l(r.asset.gltfUpAxis)?Gi.fromName(r.asset.gltfUpAxis):Gi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Gi.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};ro.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};ro.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ro.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)&&ro.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=txe(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===vo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=txe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&x4.checkChildrenWithinParent(c)}return s};function txe(e,t,n,i){if(!(l(n.implicitTiling)||ar(n,"3DTILES_implicit_tiling")))return new Yh(e,t,n,i);let o=e.schema,s=new Cg(t,n,o),a=new vg({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 Yh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Hdt(e,t){let n=ar(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=ki.getSchemaLoader({resource:e});else if(l(n.schema))i=ki.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new Mv({schema:i.schema,metadataJson:n});return ki.unload(i),r}var nxe=new h,Gdt=new he,Wdt=new M,qdt=new h,Ydt=new h,Xdt=new h,Kdt=new h;function $dt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Pd)n=h.normalize(a.positionWC,nxe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=M.inverseTransformation(c.computedTransform,Wdt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=M.multiplyByPoint(y,b.center,qdt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,Gdt);n=h.normalize(a.positionWC,nxe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=M.multiplyByPoint(y,a.positionWC,Ydt);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(y,a.directionWC,Xdt),i=h.normalize(i,i),r=T.z,u instanceof bf){let E=$.getColumn(b.halfAxes,2,Kdt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof ky){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 Jdt(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=>{sxe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?cxe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function rxe(e,t){return e._priority-t._priority}ro.prototype.postPassesUpdate=function(e){l(this._root)&&(Zdt(this,e),ght(this,e),this._cache.unloadTiles(this,lxe),mht(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function oxe(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)}ro.prototype.prePassesUpdate=function(e){if(!l(this._root))return;oht(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&&$dt(this,e),e.newFrame&&this._cache.reset()};function Zdt(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!==Nr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function Qdt(e){let t=e._requestedTiles;t.sort(rxe);for(let n=0;n<t.length;++n)Jdt(e,t[n])}function sxe(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 eht(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Nr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var tht=new he,nht=new he,iht=new h;function rht(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,tht),f=he.fromCartesian(r.center,c,nht);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,iht);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function oht(e,t){eht(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,sxe(f,e,u)}}e.totalMemoryUsageInBytes<i?aht(e):a&&n.length>0&&sht(e)}function sht(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(rxe)}function aht(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var M4=new h,cht={maximumFractionDigits:3};function ixe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,cht):Math.round(t).toLocaleString()}function FQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,M4);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,M4);o=h.multiplyByScalar(o,.75*n,M4),r=h.add(o,i,M4)}return r}function BQ(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: ${ixe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${ixe(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]}`;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 lht(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:FQ(e.debugPickedTile),a=BQ(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];BQ(a,e,FQ(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&BQ(a,e,FQ(a))}}e._tileDebugLabels.update(t)}function uht(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 di({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),rht(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 fg),lht(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var axe=[],fht=[];function cxe(e,t){let n=t,i=axe;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&&(pht(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function lxe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function N4(e,t){let n=e-t;return n<0?n+Ix.maximumFrameNumber:n}var dht=64;function hht(e,t,n){let i=fht;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Nr.LOADING||o===Nr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Nr.UNLOADED&&o!==Nr.FAILED||l(r.cacheNode)||Math.min(N4(t,r._visitedFrame),N4(t,r._touchedFrame),N4(t,r._selectedFrame),N4(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 mht(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<dht&&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,!hht(u,i,r)&&(cxe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function pht(e,t){e._cache.unloadTile(e,t,lxe),t.destroy()}ro.prototype.trimLoadedTiles=function(){this._cache.trim()};function ght(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Cp.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 _ht(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 yht(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 Aht(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,_ht(e),yht(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Qdt(e),uht(e,t,i),Cp.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 uxe(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}ro.prototype.getTraversal=function(e){let{pass:t}=e;return t===mo.MOST_DETAILED_PRELOAD||t===mo.MOST_DETAILED_PICK?I4:this.isSkippingLevelOfDetail?R4:P4};ro.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ro.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===mo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===mo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===mo.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=mo.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=Aht(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};ro.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ro.prototype.isDestroyed=function(){return!1};ro.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=axe;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,le(this)};ro.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};ro.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ro.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var bht=new gn,xht=new h,Tht=new h,Eht=new he;ro.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=bht,r=n.cartographicToCartesian(e,xht),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,Tht,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,Eht)?.height};ro.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 Cht=new h;ro.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,Cht);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};ro.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};ro.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 Jo=ro;function Kh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Kh.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}}});Kh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Kh({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Kh.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};Kh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)fxe(this,t)};Kh.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++,fxe(this,i),t};Kh.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],dxe(this,0)),this._array[e-1]=void 0,t};Kh.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=kQ(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&dxe(this,n)}return this._array[e-1]=void 0,t};Kh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Kh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[kQ(this,1,2)?1:2]};function L4(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function A1(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function kQ(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function fxe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=A1(e,t,i);for(r!==n&&(L4(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(A1(e,t,o)!==r)break;L4(e,t,o),t=o}}function dxe(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){A1(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;A1(e,f,o)===i&&(o=f)}}if(A1(e,o,t)===i&&(L4(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);kQ(e,o,a)===i&&L4(e,o,a)}t=o}}var Vy=Kh;function b1(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new Vy({comparator:b1.comparator})}b1.prototype.addSubtree=function(e){let t=new vht(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()};b1.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}};b1.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 vht(e,t){this.subtree=e,this.stamp=t}var F4=b1;function Ig(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(Ig.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});Ig.fromMetadataArray=function(e){return new Ig({metadata:e})};Ig.fromGltf=async function(e){let t=new yd({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new Ig({loader:t})};Ig.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=Sht(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function Sht(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}Ig.prototype.isDestroyed=function(){return!1};Ig.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var Fv=Ig;function sl(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=sl.DefaultMinBounds.clone(),this._maxBounds=sl.DefaultMaxBounds.clone(),this._renderMinBounds=sl.DefaultMinBounds.clone(),this._renderMaxBounds=sl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=sl,n=[new ha(h.negate(h.UNIT_X,new h),e.x),new ha(h.negate(h.UNIT_Y,new h),e.y),new ha(h.negate(h.UNIT_Z,new h),e.z),new ha(h.UNIT_X,-t.x),new ha(h.UNIT_Y,-t.y),new ha(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Y_({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(sl.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 wht=new h,Iht=new h,Pht=new $,Dht=new h,Rht=new h;sl.prototype.update=function(e,t,n,i,r){i=i??t.clone(Dht),r=r??n.clone(Rht),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,Iht);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=VQ(o,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 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(UQ(p.x,g.x),UQ(p.y,g.y),UQ(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function UQ(e,t){return P.equalsEpsilon(e,t,P.EPSILON7)?1:1/(t-e)}var Oht=new M;sl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,Oht),i=M.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};sl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var B4=new h,zQ=new h;sl.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),B4),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)),zQ);return VQ(c,u,this._shapeTransform,r)};var hxe=new h;sl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,hxe),s=h.multiplyByScalar(o,r,hxe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,B4),r,B4),c=h.add(a,s,zQ),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),B4),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),zQ);return VQ(d,p,this._shapeTransform,i)};sl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));sl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var mxe=new h;function VQ(e,t,n,i){let r=sl.DefaultMinBounds,o=sl.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,mxe),c=h.midpoint(e,t,wht);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),mxe);let u=M.getRotation(n,Pht);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var Bv=sl;function xf(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=xf.DefaultMinBounds.clone(),this._maxBounds=xf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=xf,n=[new ha(h.negate(h.UNIT_Z,new h),e.z),new ha(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Y_({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(xf.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 Mht=new h,Nht=new h,Lht=new h,Fht=new h,Bht=new h,kht=new M,Uht=new h,pxe=new U;xf.prototype.update=function(e,t,n,i,r){i=i??t.clone(Nht),r=r??n.clone(Lht),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=xf,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,Fht),p=h.minimumByComponent(n,r,Bht),g=M.getScale(e,Mht);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=GQ(d,p,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 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 zht=new $,Vht=new $,jht=new M;xf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,kht),i=M.multiplyByPoint(n,e.camera.positionWC,Uht);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,pxe),pxe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],zht),s=e.context.uniformState.inverseView,a=M.multiplyTransformation(n,s,jht),c=M.getMatrix3(a,Vht);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};xf.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 k4=new h,HQ=new h;xf.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),k4),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),HQ);return GQ(c,u,this._shapeTransform,r)};var gxe=new h;xf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,gxe),s=h.multiplyByScalar(o,r,gxe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,k4),r,k4),c=h.add(a,s,HQ),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),k4),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),HQ);return GQ(d,p,this._shapeTransform,i)};xf.DefaultMinBounds=Object.freeze(new h(0,-P.PI,-1));xf.DefaultMaxBounds=Object.freeze(new h(1,+P.PI,1));var Hht=5,Ght=new Array(Hht),Wht=new h,qht=new $,Yht=new M,Xht=new M,Kht=new M,jQ=new M,$ht=new h,Jht=new h,Zht=new h,yxe=new Array(8);for(let e=0;e<8;e++)yxe[e]=new h;function _xe(e,t,n){return Math.abs(se.dot(e,t))<n}function Qht(e){let t=M.getColumn(e,0,$ht),n=M.getColumn(e,1,Jht),i=M.getColumn(e,2,Zht),r=P.EPSILON4;return _xe(t,n,r)&&_xe(n,i,r)}function emt(e,t){let n=yxe;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 tmt=new h;function GQ(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=Ght,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,Wht),O=$.fromRotationZ(d,qht),L=h.fromElements(x,T,E,tmt),_=M.fromScale(L,Kht),C=M.fromRotation(O,Xht),w=M.fromTranslation(R,Yht),D=M.multiplyTransformation(C,M.multiplyTransformation(w,_,jQ),jQ),N=M.multiplyTransformation(n,D,jQ);return Qht(N)?en.fromTransformation(N,i):emt(N,i)}var kv=xf;function Rd(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ie,this._minimumHeight=Rd.DefaultMinBounds.z,this._maximumHeight=Rd.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(Rd.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 nmt=new h,imt=new h,rmt=new h,omt=new h,smt=new h,amt=new h,cmt=new h,lmt=new h,Axe=new h,bxe=new h,umt=new ie;Rd.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Rd;i=i??o,r=r??s;let a=P.EPSILON10,c=P.EPSILON10,u=P.EPSILON10,f=P.EPSILON3,d=M.getScale(e,lmt),p=h.clone(o,nmt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,imt),m=h.clamp(n,p,s,rmt),y=h.clamp(i,p,s,omt),A=h.clamp(r,p,s,smt),b=h.maximumByComponent(g,y,amt),x=h.minimumByComponent(m,A,cmt),T=h.add(d,h.fromElements(m.z,m.z,m.z,Axe),Axe),E=h.add(d,h.fromElements(x.z,x.z,x.z,bxe),bxe);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,umt);this._orientedBoundingBox=WQ(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=ue.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,yi=(m.x-o.x)/S,zi=1-N/S,Si=(yi+.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 fmt=new he,dmt=new h,hmt=new M,xxe=new $;Rd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,fmt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,dmt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,hmt),a=M.getRotation(s,xxe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,xxe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var Ixe=new ie;Rd.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,Ixe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return WQ(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var mmt=new U,pmt=new U,x1=new U,Txe=new U,Exe=new U,T1=new U;function gmt(e,t,n,i){let r=U.abs(e,mmt),o=U.fromElements(1/t.x,1/t.y,pmt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,x1),a=U.multiplyComponents(t,s,Txe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,Exe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,T1)),d=U.normalize(U.subtract(r,c,T1),T1),p=U.multiplyByScalar(d,f,T1);s=U.multiplyComponents(U.add(p,c,x1),o,x1),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,x1),x1),a=U.multiplyComponents(t,s,Txe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,Exe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,T1)),i)}var _mt=new U,Cxe=new U,ymt=new h,vxe=new U;Rd.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,Cxe),d=gmt(f,U.fromElements(i.x,i.z,_mt),r,ymt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,vxe),vxe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,Cxe),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 Sxe=new h,wxe=new h,Amt=new h;Rd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,Sxe),s=h.multiplyByScalar(o,r,Sxe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,wxe),r,wxe),c=h.add(a,s,Amt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,Ixe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return WQ(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function WQ(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}Rd.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Rd.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var Uv=Rd;var Du={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Du.getMinBounds=function(e){switch(e){case Du.BOX:return Bv.DefaultMinBounds;case Du.ELLIPSOID:return Uv.DefaultMinBounds;case Du.CYLINDER:return kv.DefaultMinBounds}};Du.getMaxBounds=function(e){switch(e){case Du.BOX:return Bv.DefaultMaxBounds;case Du.ELLIPSOID:return Uv.DefaultMaxBounds;case Du.CYLINDER:return kv.DefaultMaxBounds}};Du.getShapeConstructor=function(e){switch(e){case Du.BOX:return Bv;case Du.ELLIPSOID:return Uv;case Du.CYLINDER:return kv}};Object.freeze(Du);var bc=Du;function E1(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===bc.ELLIPSOID?$0.Z_UP:$0.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new F4}Object.defineProperties(E1.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}}});E1.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();xmt(n);let i=Imt(n,t);await i.load();let{root:r}=n,o=ar(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new Mv({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=Pmt(s,c);Object.assign(u,Tmt(r)),l(r.transform)?u.globalTransform=M.unpack(r.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=bmt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new E1(u),d=new Cg(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,ki.unload(i),f};function bmt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Oh.TILESET_TILE_COUNT)}function xmt(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!ar(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!ar(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ar(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function Tmt(e){let t=e.boundingVolume;if(l(t.box))return Smt(t.box);if(l(t.region))return Emt(t.region);if(ar(t,"3DTILES_bounding_volume_cylinder"))return wmt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Emt(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:bc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var Cmt=new h,vmt=new $;function Smt(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,Cmt),i=$.getRotation(t.halfAxes,vmt);return{shape:bc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function wmt(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:bc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function Imt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?ki.getSchemaLoader({resource:t.getDerivedResource({url:n})}):ki.getSchemaLoader({schema:i})}function Pmt(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=Pxe(b,T),v=Pxe(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 Pxe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function Dmt(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=Ny(a);return r=await fy.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}E1.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 vg({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 Dmt(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 Fv.fromGltf(b)};var Dxe=E1;function qQ(e){e=e??1,this._radius=e??1}Object.defineProperties(qQ.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});qQ.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 U4=qQ;var z4=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -#ifdef EXTRUDED_GEOMETRY -in vec3 extrudeDirection; -uniform float u_globeMinimumAltitude; -#endif // EXTRUDED_GEOMETRY -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; -#endif // PER_INSTANCE_COLOR -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -out vec4 v_sphericalExtents; -#else // SPHERICAL -out vec2 v_inversePlaneExtents; -out vec4 v_westPlane; -out vec4 v_southPlane; -#endif // SPHERICAL -out vec3 v_uvMinAndSphericalLongitudeRotation; -out vec3 v_uMaxAndInverseDistance; -out vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -void main() -{ -vec4 position = czm_computePosition(); -#ifdef EXTRUDED_GEOMETRY -float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); -delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; -position = position + vec4(extrudeDirection * delta, 0.0); -#endif -#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); -v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); -#else // SPHERICAL -#ifdef COLUMBUS_VIEW_2D -vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); -vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); -vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); -bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; -planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); -planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); -idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; -idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); -planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); -planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; -vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; -vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; -#else // COLUMBUS_VIEW_2D -vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; -vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; -vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; -#endif // COLUMBUS_VIEW_2D -vec3 eastWard = southEastCorner - southWestCorner; -float eastExtent = length(eastWard); -eastWard /= eastExtent; -vec3 northWard = northWestCorner - southWestCorner; -float northExtent = length(northWard); -northWard /= northExtent; -v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); -v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); -v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); -#endif // SPHERICAL -vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); -vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); -v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); -v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); -v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif -gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); +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; } -`;function Rmt(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Fl=Rmt;var C1=`#ifdef TEXTURE_COORDINATES -#ifdef SPHERICAL -in vec4 v_sphericalExtents; -#else // SPHERICAL -in vec2 v_inversePlaneExtents; -in vec4 v_westPlane; -in vec4 v_southPlane; -#endif // SPHERICAL -in vec3 v_uvMinAndSphericalLongitudeRotation; -in vec3 v_uMaxAndInverseDistance; -in vec3 v_vMaxAndInverseDistance; -#endif // TEXTURE_COORDINATES -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; -#endif -#ifdef NORMAL_EC -vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { -vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); -return eyeCoordinate.xyz / eyeCoordinate.w; +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); } -vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { -vec2 glFragCoordXY = gl_FragCoord.xy; -float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); -float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); -bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); -float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); -float useDownOrLeft = float(useUpOrRight == 0.0); -vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); -vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); -return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; +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; } -#endif // NORMAL_EC -void main(void) -{ -#ifdef REQUIRES_EC -float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -#endif -#ifdef REQUIRES_WC -vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; -vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; +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 -#ifdef TEXTURE_COORDINATES -vec2 uv; -#ifdef SPHERICAL -vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); -sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; -sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); -uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; -uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; -#else // SPHERICAL -uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; -uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; -#endif // SPHERICAL -#endif // TEXTURE_COORDINATES -#ifdef CULL_FRAGMENTS -if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { -discard; +#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 -#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)); -vec3 normalEC = normalize(cross(leftRight, downUp)); +inputCoordinate.y = height; +inputCoordinate.z = angle; #endif -#ifdef PER_INSTANCE_COLOR -vec4 color = czm_gammaCorrect(v_color); -#ifdef FLAT -out_FragColor = color; -#else // FLAT -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = -eyeCoordinate.xyz; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#else // PER_INSTANCE_COLOR -czm_materialInput materialInput; -#ifdef USES_NORMAL_EC -materialInput.normalEC = normalEC; #endif -#ifdef USES_POSITION_TO_EYE_EC -materialInput.positionToEyeEC = -eyeCoordinate.xyz; +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); +} #endif -#ifdef USES_TANGENT_TO_EYE -materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); +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; +} +return childData; +} +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 +getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); +addSampleCoordinates(tileAndUv, sampleDatas[0]); +addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif -#ifdef USES_ST -materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; -materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; +} +bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) { +int levelDifference = tileCoordinate.w - octreeCoords.w; +if (levelDifference < 0) { +return false; +} +ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference; +return coordinateAtLevel == octreeCoords.xyz; +} +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]); +} +return; +} +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); +} +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 +} +`;var vG=`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); +} +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 -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else // FLAT -out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); -#endif // FLAT -out_FragColor.rgb *= out_FragColor.a; -#endif // PER_INSTANCE_COLOR -czm_writeDepthClamp(); -#endif // PICK } -`;function Od(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new YQ;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new YQ;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}Od.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,C1]})};Od.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:[C1],pickColorQualifier:"in"})};Od.prototype.createVertexShader=function(e,t,n,i){return kxe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Od.prototype.createPickVertexShader=function(e,t,n,i){return kxe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Rxe=new h,Oxe=new he,Mxe={high:0,low:0};function kxe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Oxe;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,Rxe),d=Sn.encode(f.x,Mxe);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=Oxe;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,Rxe);d=Sn.encode(g.x,Mxe),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 YQ(){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(YQ.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 Nxe(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 Omt=[new U,new U,new U,new U];function Uxe(e,t){let n=Omt,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Nxe(i,r,o),a=1/Nxe(i,o,r);e.uvMinAndExtents=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var zxe=new he,Vxe=new h,Mmt=new h,Nmt=new h,V4={high:0,low:0};function jxe(e,t,n){let i=zxe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,Vxe);i.latitude=e.north;let o=t.project(i,Mmt);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Nmt),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,V4);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,V4),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,V4),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,V4),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var Lmt=new M,Fmt=new M,Lxe=new h,Bmt=new he,kmt=[new he,new he,new he,new he,new he,new he,new he,new he];function Umt(e,t,n,i,r,o){let s=ie.center(e,Bmt);s.height=n;let a=he.toCartesian(s,t,Lxe),c=At.eastNorthUpToFixedFrame(a,t,Lmt),u=M.inverse(c,Fmt),f=e.west,d=e.east,p=e.north,g=e.south,m=kmt;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,Lxe);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 zmt=new h,Vmt=new h,jmt=new Sn;Od.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=Vxe,s=zmt,a=Vmt;Umt(e,n,r??0,o,s,a);let c={};Uxe(c,t);let u=Sn.fromCartesian(o,jmt);return c.southWest_HIGH=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),jxe(e,i,c),c};var Hmt=new h;function Fxe(e,t,n,i){let r=zxe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,Hmt),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 Bxe=new U;Od.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Fxe(e.south,e.west,n,Bxe),o=r.x,s=r.y,a=Fxe(e.north,e.east,n,Bxe),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 Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Fl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Uxe(g,t),jxe(e,i,g),g};Od.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)};Od.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 Gmt(e){return Math.max(e.width,e.height)>Od.MAX_WIDTH_FOR_PLANAR_EXTENTS}Od.shouldUseSphericalCoordinates=function(e){return Gmt(e)};Od.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var Md=Od;function Dx(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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(Dx.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}}});Dx.isSupported=function(e){return e.context.stencilBuffer};function zv(e,t){let n=t?Zn.EQUAL:Zn.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:_c.LESS_OR_EQUAL},depthMask:!1}}function KQ(e){return{stencilTest:{enabled:e,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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:nn.PRE_MULTIPLIED_ALPHA_BLEND}}var Wmt={stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:Zn.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 qmt(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(zv(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(zv(r,!0)),e._rsColorPass=Ge.fromCache(KQ(r,!1)),e._rsPickPass=Ge.fromCache(Wmt)}function Ymt(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() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function Xmt(e,t){let n=t.context,i=e._primitive,r=z4;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=Ymt(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Xe({defines:[a],sources:[r]}),u=new Xe({sources:[kb]}),f=e._primitive._attributeLocations,d=new Md(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 Kmt(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 $mt(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 Jmt(e,t,n,i,r,o,s){Kmt(e,o),$mt(e,s)}function Hxe(e,t){return Math.floor(e%t/2)}function XQ(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Gxe(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function Zmt(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!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[Hxe(m,b)],d&&(A=n[m],XQ(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,XQ(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],XQ(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[Hxe(m,b)];y=u[T.index],d&&(A=i[m],Gxe(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,Gxe(A,t,r,o,y))}}}Dx.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=Md.hasAttributesForSphericalExtents(c),g=Md.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){qmt(n,A)},i._createShaderProgramFunction=function(y,A,b){Xmt(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){Jmt(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){Zmt(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(zv(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(zv(!1,!0)),this._rsColorPass=Ge.fromCache(KQ(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(zv(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(zv(!0,!0)),this._rsColorPass=Ge.fromCache(KQ(!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))})};Dx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Dx.prototype.isDestroyed=function(){return!1};Dx.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,le(this)};var v1=Dx;var j4={CUMULUS:0};j4.validate=function(e){return e===j4.CUMULUS};Object.freeze(j4);var S1=j4;var H4=`uniform sampler2D u_noiseTexture; +`;var eMe={Z_UP:0,Y_UP:1};Object.freeze(eMe);var s_=eMe;function CRt(e){let t=new Iy;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([mG]),e.provider.metadataOrder===s_.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",CG,dG,vG,pG,_G,gG]),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([xG,yG,Zw]):u==="CYLINDER"?t.addFragmentLines([TG,zO,AG,Zw]):u==="ELLIPSOID"&&t.addFragmentLines([EG,zO,bG,Zw]),t.addFragmentLines([hG]);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 SG=CRt;var tMe=new U;function vRt(e,t){let n=new SG(e);fG(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=Ps.getTextureResolution(r,t,tMe),S=nMe(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=YA.getTextureResolution(s,t,tMe),S=nMe(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:nn.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 nMe(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 wG=vRt;var sMe={};function SRt(e,t,n){let i,r,o;if(e instanceof er){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 Wu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var wRt=new h,iMe=new h;function aMe(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 aoe(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,wRt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),iMe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),iMe));o=Math.min(SRt(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 VO(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 cMe=new h;function IRt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,cMe),f=c.pitch,d=VO(c.heading,i),p=VO(c.roll,o),g=aoe(c,n,u.z,n.z,s),m=aMe(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 PRt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function DRt(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 RRt=new he,ORt=new he;function MRt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,RRt),m=f.pitch,y=VO(f.heading,i),A=VO(f.roll,o),b=p.cartesianToCartographic(n,ORt);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?PRt(g,b):DRt(g,b);let T=aoe(f,n,g.height,b.height,s),E=aMe(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 NRt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,cMe),u=VO(a.heading,i),f=a.frustum.right-a.frustum.left,d=aoe(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 rMe=new he,LRt=new h;function soe(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function oMe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}sMe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return soe();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,rMe),n=o.project(rMe,LRt));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=oMe(x,t.complete),E=oMe(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 soe(T,E);let I=new Array(4);if(I[re.SCENE2D]=NRt,I[re.SCENE3D]=MRt,I[re.COLUMBUS_VIEW]=IRt,m<=0)return soe(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=ks.CUBIC_OUT:d=ks.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var IG=sMe;var lMe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(lMe);var Yu=lMe;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 er,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,bMe(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,OMe(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 rm(0,-P.PI_OVER_FOUR,0);function bMe(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 FRt(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(FRt(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 BRt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var kRt=new he,URt=new h,PG=new h,zRt=new se,VRt=new se,jRt=new se,HRt=new se,GRt=new se;function WRt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,zRt),r=n.cartesianToCartographic(i,kRt),o=t.project(r,URt),s=VRt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,GRt),c=se.add(M.getColumn(e._transform,0,PG),i,PG);n.cartesianToCartographic(c,r),t.project(r,o);let u=jRt;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=HRt;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=se.add(M.getColumn(e._transform,1,PG),i,PG);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 coe=new h;function hl(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?BRt(e):WRt(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=coe;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,coe));if(Math.abs(1-m)>P.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,coe);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)&&bMe(e)}function xMe(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 TMe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function EMe(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 OG=new M,MG=new M;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return hl(this),this._invTransform}},viewMatrix:{get:function(){return hl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return hl(this),this._invViewMatrix}},positionCartographic:{get:function(){return hl(this),this._positionCartographic}},positionWC:{get:function(){return hl(this),this._positionWC}},directionWC:{get:function(){return hl(this),this._directionWC}},upWC:{get:function(){return hl(this),this._upWC}},rightWC:{get:function(){return hl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,OG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,MG);this._setTransform(n);let i=xMe(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,OG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,MG);this._setTransform(n);let i=TMe(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,OG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,MG);this._setTransform(n);let i=EMe(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&&wMe(this,this.position)};var qRt=new h,YRt=new h,XRt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,qRt),n=h.clone(this.upWC,YRt),i=h.clone(this.directionWC,XRt);M.clone(e,this._transform),this._transformChanged=!0,hl(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),hl(this)};var KRt=new U,$Rt=new gn,JRt=new h,ZRt=new h;function CMe(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=KRt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,$Rt);r=n.pickWorldCoordinates(a,t,!0,JRt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,ZRt));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=CMe(this)))};var NG=new h,hoe=new M,QRt=new M,moe=new Le,poe=new $,vMe=new he;function eOt(e,t,n){let i=M.clone(e.transform,hoe),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,QRt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,moe),s=$.fromQuaternion(o,poe);$.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 tOt(e,t,n,i){let r=M.clone(e.transform,hoe);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,vMe);t=a.project(c,NG)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,moe),s=$.fromQuaternion(o,poe);$.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 nOt(e,t,n,i){let r=M.clone(e.transform,hoe);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,vMe);t=c.project(u,NG)}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-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,moe),s=$.fromQuaternion(o,poe);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var iOt=new h,rOt=new h,oOt=new h;function SMe(e,t,n,i){let r=h.clone(n.direction,iOt),o=h.clone(n.up,rOt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,OG),u=M.inverseTransformation(c,MG);M.multiplyByPointAsVector(u,r,r),M.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,oOt);return i.heading=xMe(r,o),i.pitch=TMe(r),i.roll=EMe(r,o,s),i}var doe={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 Bc;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,NG);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,NG),i=!1),l(t.direction)&&(t=SMe(this,r,t,doe.orientation)),Qw.heading=t.heading??0,Qw.pitch=t.pitch??-P.PI_OVER_TWO,Qw.roll=t.roll??0,n===re.SCENE3D?eOt(this,r,Qw):n===re.SCENE2D?nOt(this,r,Qw,i):tOt(this,r,Qw,i)};var sOt=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,sOt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),hl(this),M.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),hl(this),M.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),hl(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),hl(this),M.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),hl(this),M.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),hl(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function wMe(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 uMe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,uMe),h.add(n,uMe,n),this._mode===re.SCENE2D&&wMe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?LG(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?LG(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 aOt=new Le,cOt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,aOt),r=$.fromQuaternion(i,cOt),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 lOt=new Le,uOt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,lOt),r=$.fromQuaternion(i,uOt);$.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,IMe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,IMe(this,-e)};var fOt=new h,dOt=new h,hOt=new h,fMe=new h;function IMe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,fOt),r=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,fMe),P.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,dOt),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,fMe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,hOt);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,PMe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,PMe(this,e)};function PMe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function LG(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 DMe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?LG(this,e):DMe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?LG(this,-e):DMe(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 mOt=new M;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,mOt);this.lookAtTransform(r,t)};var pOt=new h,gOt=new Le,_Ot=new Le,yOt=new $;function RMe(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,gOt),o=Le.fromAxisAngle(h.UNIT_Z,-e,_Ot),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,yOt),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=RMe(t.heading,t.pitch,t.range,pOt):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 AOt=new M,dMe=new h,bOt=new h,hMe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=M.clone(this._transform,AOt);this._setTransform(M.IDENTITY);let i=h.subtract(e,this.positionWC,dMe);h.magnitudeSquared(i)<P.EPSILON8&&(i=h.clone(this.directionWC,dMe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,bOt),o=h.cross(i,r,hMe);h.magnitudeSquared(o)<P.EPSILON8&&(o=h.clone(this.rightWC,hMe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var jO=new he,xOt=new he,TOt=new h,EOt=new h,COt=new h,vOt=new h,SOt=new h,wOt=new h,IOt=new h,loe=new h,POt={direction:new h,right:new h,up:new h},mMe;function dl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function OMe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:POt,{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=jO;O.longitude=f,O.latitude=s,O.height=0;let L=xOt;L.longitude=f,L.latitude=a,L.height=0;let _=mMe;(!l(_)||_.ellipsoid!==r)&&(mMe=_=new k_(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,jO).latitude}let p=jO;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,IOt),m=jO;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,TOt);m.longitude=c;let A=r.cartographicToCartesian(m,COt);m.longitude=f;let b=r.cartographicToCartesian(m,SOt);m.latitude=a;let x=r.cartographicToCartesian(m,wOt);m.longitude=u;let T=r.cartographicToCartesian(m,vOt);m.longitude=c;let E=r.cartographicToCartesian(m,EOt);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(dl(v,I,A,O),dl(v,I,T,O),dl(v,I,y,O),dl(v,I,E,O),dl(v,I,b,O),dl(v,I,x,O),dl(v,S,A,L),dl(v,S,T,L),dl(v,S,y,L),dl(v,S,E,L),dl(v,S,b,L),dl(v,S,x,L)),a<0&&s>0){let _=jO;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,loe);h.subtract(C,g,C),R=Math.max(R,dl(v,I,C,O),dl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,loe),h.subtract(C,g,C),R=Math.max(R,dl(v,I,C,O),dl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,loe),n)}var DOt=new he,ROt=new h,OOt=new h;function MOt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=DOt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,ROt);M.multiplyByPoint(r,a,a),M.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,OOt);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 NOt=new he,LOt=new h,FOt=new h;function BOt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Yu.INFINITE_SCROLL?r+=P.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=NOt;o.longitude=r,o.latitude=t.north;let s=i.project(o,LOt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,FOt),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 OMe(this,e,t);if(n===re.COLUMBUS_VIEW)return MOt(this,e,t);if(n===re.SCENE2D)return BOt(this,e,t)};var kOt=new gn;function UOt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,kOt),o=xi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return gn.getPoint(r,s,i)}var zOt=new gn;function VOt(e,t,n,i){let o=e.getPickRay(t,zOt).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 jOt=new gn;function HOt(e,t,n,i){let r=e.getPickRay(t,jOt),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=UOt(this,e,t,n);else if(this._mode===re.SCENE2D)n=VOt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=HOt(this,e,this._projection,n);else return;return n}};var GOt=new h,WOt=new h,qOt=new h;function YOt(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,GOt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,WOt),m=h.multiplyByScalar(e.upWC,f*c*s,qOt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var DG=new h;function XOt(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,DG),h.add(DG,f,f),h.multiplyByScalar(e.upWC,u,DG),h.add(DG,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=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)?YOt(this,e,t):XOt(this,e,t)};var KOt=new h,$Ot=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,KOt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),$Ot);return Math.max(0,h.magnitude(n)-e.radius)};var JOt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,JOt);return Math.max(r.x,r.y)};function ZOt(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:ks.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var QOt=new h,pMe=new h,eMt=new h,tMt=new h;function nMt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,QOt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,pMe),pMe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,eMt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,tMt)),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 ZOt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return nMt(this,e)};var iMt=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,iMt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=SMe(this,t,r,doe.orientation)),l(e.duration)&&e.duration<=0){let f=doe;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=IG.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 sMt=100;function MMe(e,t,n){n=rm.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=sMt: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=MMe(this,e,t),this.lookAt(e.center,t)};var aMt=new M,gMe=new h,cMt=new h,lMt=new h,uMt=new h,fMt=new se,dMt=new Le,hMt=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=MMe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,gMe):r=RMe(i.heading,i.pitch,i.range,gMe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,aMt);M.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,cMt),h.normalize(c,c),u=M.multiplyByPointAsVector(a,h.UNIT_Z,lMt),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,dMt),p=$.fromQuaternion(d,hMt);h.fromCartesian4(M.getColumn(a,1,fMt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,uMt);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 _Me=new h,yMe=new h,uoe=new h,AMe=new h,HO=[new h,new h,new h,new h];function mMt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,_Me),o=h.magnitude(r),s=h.normalize(r,yMe),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,uoe),uoe),c=h.normalize(h.cross(s,a,AMe),AMe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,_Me),d=u/o,p=h.multiplyByScalar(a,d,yMe),g=h.multiplyByScalar(c,d,uoe),m=h.add(f,g,HO[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,HO[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,HO[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,HO[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),HO}var foe=new U,pMt=new h,XA=[new he,new he,new he,new he];function RG(e,t,n,i,r,o){foe.x=e,foe.y=t;let s=i.pickEllipsoid(foe,r,pMt);return l(s)?(XA[n]=r.cartesianToCartographic(s,XA[n]),1):(XA[n]=r.cartesianToCartographic(o[n],XA[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 ue(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=mMt(this,e);if(c+=RG(0,0,0,this,e,u),c+=RG(0,a,1,this,e,u),c+=RG(s,a,2,this,e,u),c+=RG(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(XA,t);let f=0,d=XA[3].longitude;for(let p=0;p<4;++p){let g=XA[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,XA[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 er)return;let e=this._scene;this.frustum=new er,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=CMe(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;var NMe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(NMe);var mr=NMe;var UMe=[oo.SHIFT,oo.CTRL,oo.ALT,[oo.SHIFT,oo.CTRL],[oo.SHIFT,oo.ALT],[oo.CTRL,oo.ALT],[oo.SHIFT,oo.CTRL,oo.ALT]];function ja(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function gMt(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 LMe(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]?(gMt(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 FMe(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 eI(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(){goe(ja(n,void 0),e);for(let f of UMe){let d=ja(n,f);goe(d,e)}},u,t)}function goe(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 BMe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function _Mt(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,goe(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 kMe(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);_Mt(c,t,e),o[u]&&(n[u]?(BMe(i[u],r[u]),r[u].valid=!0,BMe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},fn.MOUSE_MOVE,t)}function Jd(e){this._eventHandler=new xa(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,FMe(this,void 0),LMe(this,void 0,e),eI(this,void 0,mr.LEFT_DRAG),eI(this,void 0,mr.RIGHT_DRAG),eI(this,void 0,mr.MIDDLE_DRAG),kMe(this,void 0);for(let t of UMe)FMe(this,t),LMe(this,t,e),eI(this,t,mr.LEFT_DRAG),eI(this,t,mr.RIGHT_DRAG),eI(this,t,mr.MIDDLE_DRAG),kMe(this,t)}Object.defineProperties(Jd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ja(mr.WHEEL)]||!this._update[ja(mr.WHEEL,oo.SHIFT)]||!this._update[ja(mr.WHEEL,oo.CTRL)]||!this._update[ja(mr.WHEEL,oo.ALT)];return this._buttonsDown>0||e}}});Jd.prototype.isMoving=function(e,t){let n=ja(e,t);return!this._update[n]};Jd.prototype.getMovement=function(e,t){let n=ja(e,t);return this._movement[n]};Jd.prototype.getLastMovement=function(e,t){let n=ja(e,t),i=this._lastMovement[n];if(i.valid)return i};Jd.prototype.isButtonDown=function(e,t){let n=ja(e,t);return this._isDown[n]};Jd.prototype.getStartMousePosition=function(e,t){if(e===mr.WHEEL)return this._currentMousePosition;let n=ja(e,t);return this._eventStartPosition[n]};Jd.prototype.getButtonPressTime=function(e,t){let n=ja(e,t);return this._pressTime[n]};Jd.prototype.getButtonReleaseTime=function(e,t){let n=ja(e,t);return this._releaseTime[n]};Jd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Jd.prototype.isDestroyed=function(){return!1};Jd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var FG=Jd;var _oe=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()}},zMe=_oe;function yMt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var xm=yMt;function GO(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new kA({comparator:GO.comparator})}GO.prototype.addSubtree=function(e){let t=new AMt(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()};GO.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}};GO.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 AMt(e,t){this.subtree=e,this.stamp=t}var BG=GO;function a_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(a_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});a_.fromMetadataArray=function(e){return new a_({metadata:e})};a_.fromGltf=async function(e){let t=new md({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new a_({loader:t})};a_.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=bMt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function bMt(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=Ft.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}a_.prototype.isDestroyed=function(){return!1};a_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var tI=a_;function ml(){this._orientedBoundingBox=new Qt,this._boundingSphere=new ue,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 ua(h.negate(h.UNIT_X,new h),e.x),new ua(h.negate(h.UNIT_Y,new h),e.y),new ua(h.negate(h.UNIT_Z,new h),e.z),new ua(h.UNIT_X,-t.x),new ua(h.UNIT_Y,-t.y),new ua(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new YA({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 xMt=new h,TMt=new h,EMt=new $,CMt=new h,vMt=new h;ml.prototype.update=function(e,t,n,i,r){i=i??t.clone(CMt),r=r??n.clone(vMt),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,TMt);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=boe(o,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 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(yoe(p.x,g.x),yoe(p.y,g.y),yoe(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function yoe(e,t){return P.equalsEpsilon(e,t,P.EPSILON7)?1:1/(t-e)}var SMt=new M;ml.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,SMt),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 kG=new h,Aoe=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),kG),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)),Aoe);return boe(c,u,this._shapeTransform,r)};var VMe=new h;ml.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,VMe),s=h.multiplyByScalar(o,r,VMe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,kG),r,kG),c=h.add(a,s,Aoe),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),kG),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),Aoe);return boe(d,p,this._shapeTransform,i)};ml.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));ml.DefaultMaxBounds=Object.freeze(new h(1,1,1));var jMe=new h;function boe(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,jMe),c=h.midpoint(e,t,xMt);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),jMe);let u=M.getRotation(n,EMt);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var nI=ml;function kf(){this._orientedBoundingBox=new Qt,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=kf.DefaultMinBounds.clone(),this._maxBounds=kf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=kf,n=[new ua(h.negate(h.UNIT_Z,new h),e.z),new ua(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new YA({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(kf.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 wMt=new h,IMt=new h,PMt=new h,DMt=new h,RMt=new h,OMt=new M,MMt=new h,HMe=new U;kf.prototype.update=function(e,t,n,i,r){i=i??t.clone(IMt),r=r??n.clone(PMt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=kf,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,DMt),p=h.minimumByComponent(n,r,RMt),g=M.getScale(e,wMt);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=Eoe(d,p,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 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 NMt=new $,LMt=new $,FMt=new M;kf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,OMt),i=M.multiplyByPoint(n,e.camera.positionWC,MMt);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,HMe),HMe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],NMt),s=e.context.uniformState.inverseView,a=M.multiplyTransformation(n,s,FMt),c=M.getMatrix3(a,LMt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};kf.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 UG=new h,Toe=new h;kf.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),UG),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),Toe);return Eoe(c,u,this._shapeTransform,r)};var GMe=new h;kf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,GMe),s=h.multiplyByScalar(o,r,GMe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,UG),r,UG),c=h.add(a,s,Toe),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),UG),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),Toe);return Eoe(d,p,this._shapeTransform,i)};kf.DefaultMinBounds=Object.freeze(new h(0,-P.PI,-1));kf.DefaultMaxBounds=Object.freeze(new h(1,+P.PI,1));var BMt=5,kMt=new Array(BMt),UMt=new h,zMt=new $,VMt=new M,jMt=new M,HMt=new M,xoe=new M,GMt=new h,WMt=new h,qMt=new h,qMe=new Array(8);for(let e=0;e<8;e++)qMe[e]=new h;function WMe(e,t,n){return Math.abs(se.dot(e,t))<n}function YMt(e){let t=M.getColumn(e,0,GMt),n=M.getColumn(e,1,WMt),i=M.getColumn(e,2,qMt),r=P.EPSILON4;return WMe(t,n,r)&&WMe(n,i,r)}function XMt(e,t){let n=qMe;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 Qt.fromPoints(n,t)}var KMt=new h;function Eoe(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=kMt,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,UMt),O=$.fromRotationZ(d,zMt),L=h.fromElements(x,T,E,KMt),_=M.fromScale(L,HMt),C=M.fromRotation(O,jMt),w=M.fromTranslation(R,VMt),D=M.multiplyTransformation(C,M.multiplyTransformation(w,_,xoe),xoe),N=M.multiplyTransformation(n,D,xoe);return YMt(N)?Qt.fromTransformation(N,i):XMt(N,i)}var iI=kf;function Zd(){this._orientedBoundingBox=new Qt,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ie,this._minimumHeight=Zd.DefaultMinBounds.z,this._maximumHeight=Zd.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(Zd.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 $Mt=new h,JMt=new h,ZMt=new h,QMt=new h,eNt=new h,tNt=new h,nNt=new h,iNt=new h,YMe=new h,XMe=new h,rNt=new ie;Zd.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Zd;i=i??o,r=r??s;let a=P.EPSILON10,c=P.EPSILON10,u=P.EPSILON10,f=P.EPSILON3,d=M.getScale(e,iNt),p=h.clone(o,$Mt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,JMt),m=h.clamp(n,p,s,ZMt),y=h.clamp(i,p,s,QMt),A=h.clamp(r,p,s,eNt),b=h.maximumByComponent(g,y,tNt),x=h.minimumByComponent(m,A,nNt),T=h.add(d,h.fromElements(m.z,m.z,m.z,YMe),YMe),E=h.add(d,h.fromElements(x.z,x.z,x.z,XMe),XMe);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,rNt);this._orientedBoundingBox=Coe(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=ue.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,yi=(m.x-o.x)/S,zi=1-N/S,Si=(yi+.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 oNt=new he,sNt=new h,aNt=new M,KMe=new $;Zd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,oNt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,sNt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,aNt),a=M.getRotation(s,KMe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,KMe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var nNe=new ie;Zd.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,nNe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return Coe(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var cNt=new U,lNt=new U,WO=new U,$Me=new U,JMe=new U,qO=new U;function uNt(e,t,n,i){let r=U.abs(e,cNt),o=U.fromElements(1/t.x,1/t.y,lNt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,WO),a=U.multiplyComponents(t,s,$Me),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,JMe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,qO)),d=U.normalize(U.subtract(r,c,qO),qO),p=U.multiplyByScalar(d,f,qO);s=U.multiplyComponents(U.add(p,c,WO),o,WO),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,WO),WO),a=U.multiplyComponents(t,s,$Me),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,JMe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,qO)),i)}var fNt=new U,ZMe=new U,dNt=new h,QMe=new U;Zd.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,ZMe),d=uNt(f,U.fromElements(i.x,i.z,fNt),r,dNt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,QMe),QMe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,ZMe),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 eNe=new h,tNe=new h,hNt=new h;Zd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,eNe),s=h.multiplyByScalar(o,r,eNe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,tNe),r,tNe),c=h.add(a,s,hNt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,nNe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return Coe(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Coe(e,t,n,i,r,o,s){return s=Qt.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Zd.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Zd.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var rI=Zd;var Xu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Xu.getMinBounds=function(e){switch(e){case Xu.BOX:return nI.DefaultMinBounds;case Xu.ELLIPSOID:return rI.DefaultMinBounds;case Xu.CYLINDER:return iI.DefaultMinBounds}};Xu.getMaxBounds=function(e){switch(e){case Xu.BOX:return nI.DefaultMaxBounds;case Xu.ELLIPSOID:return rI.DefaultMaxBounds;case Xu.CYLINDER:return iI.DefaultMaxBounds}};Xu.getShapeConstructor=function(e){switch(e){case Xu.BOX:return nI;case Xu.ELLIPSOID:return rI;case Xu.CYLINDER:return iI}};Object.freeze(Xu);var Dc=Xu;function YO(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===Dc.ELLIPSOID?s_.Z_UP:s_.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new BG}Object.defineProperties(YO.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}}});YO.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();pNt(n);let i=TNt(n,t);await i.load();let{root:r}=n,o=sr(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new Xv({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=ENt(s,c);Object.assign(u,gNt(r)),l(r.transform)?u.globalTransform=M.unpack(r.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=mNt(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new YO(u),d=new Cg(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Bi.unload(i),f};function mNt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Ih.TILESET_TILE_COUNT)}function pNt(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!sr(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!sr(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!sr(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function gNt(e){let t=e.boundingVolume;if(l(t.box))return bNt(t.box);if(l(t.region))return _Nt(t.region);if(sr(t,"3DTILES_bounding_volume_cylinder"))return xNt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function _Nt(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:Dc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var yNt=new h,ANt=new $;function bNt(e){let t=Qt.unpack(e),n=$.getScale(t.halfAxes,yNt),i=$.getRotation(t.halfAxes,ANt);return{shape:Dc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function xNt(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:Dc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function TNt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Bi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Bi.getSchemaLoader({schema:i})}function ENt(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=iNe(b,T),v=iNe(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 iNe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function CNt(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=Vy(a);return r=await ly.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}YO.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 vg({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 CNt(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 tI.fromGltf(b)};var rNe=YO;function voe(e){e=e??1,this._radius=e??1}Object.defineProperties(voe.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});voe.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 zG=voe;var VG={CUMULUS:0};VG.validate=function(e){return e===VG.CUMULUS};Object.freeze(VG);var XO=VG;var jG=`uniform sampler2D u_noiseTexture; uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; in vec2 v_offset; @@ -8898,7 +9548,7 @@ out_FragColor = cloud; #endif #endif } -`;var G4=`#ifdef INSTANCED +`;var HG=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScaleX; @@ -8938,7 +9588,7 @@ v_color = color; v_slice = slice; v_brightness = brightness; } -`;var W4=`uniform vec3 u_noiseTextureDimensions; +`;var GG=`uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; uniform vec3 u_noiseOffset; in vec2 v_position; @@ -9015,7 +9665,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 q4=`uniform vec3 u_noiseTextureDimensions; +`;var WG=`uniform vec3 u_noiseTextureDimensions; in vec2 position; out vec2 v_position; void main() @@ -9030,7 +9680,7 @@ transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; transformedPos.y *= noiseTextureRows; v_position = transformedPos; } -`;function $h(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 Qmt=$h.SHOW_INDEX=0,ept=$h.POSITION_INDEX=1,tpt=$h.SCALE_INDEX=2,npt=$h.MAXIMUM_SIZE_INDEX=3,ipt=$h.SLICE_INDEX=4,rpt=$h.BRIGHTNESS_INDEX=5,opt=$h.COLOR_INDEX=6;$h.NUMBER_OF_PROPERTIES=7;function Rx(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties($h.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Rx(this,Qmt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),Rx(this,ept))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),Rx(this,tpt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),Rx(this,npt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Rx(this,opt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,Rx(this,ipt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,Rx(this,rpt))}}});$h.prototype._destroy=function(){this._cloudCollection=void 0};var Nd=$h;var Tf,Y4=new h,spt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},apt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},cpt=Nd.SHOW_INDEX,lpt=Nd.POSITION_INDEX,upt=Nd.SCALE_INDEX,fpt=Nd.MAXIMUM_SIZE_INDEX,dpt=Nd.SLICE_INDEX,hpt=Nd.BRIGHTNESS_INDEX,mpt=Nd.NUMBER_OF_PROPERTIES,ppt=Nd.COLOR_INDEX;function Jh(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(mpt),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:Wxe(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 Wxe(e){return function(){return Y4.x=e._textureSliceWidth,Y4.y=e._noiseTextureRows,Y4.z=1/e._noiseTextureRows,Y4}}Object.defineProperties(Jh.prototype,{length:{get:function(){return JQ(this),this._clouds.length}}});function qxe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Jh.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??S1.CUMULUS,n;return t===S1.CUMULUS&&(n=new Nd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Jh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Jh.prototype.removeAll=function(){qxe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function JQ(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}}Jh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Jh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Jh.prototype.get=function(e){return JQ(this),this._clouds[e]};var gpt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),_pt=new Uint16Array([0,1,2,0,2,3]);function ypt(e){let t=tt.createVertexBuffer({context:e,typedArray:gpt,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:_pt,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 ZQ;function Apt(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 bpt(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 xpt(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 Tpt(e,t,n){let i=[{index:Tf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Tf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Tf.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Tf.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Tf.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:Tf.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:xpt(e)});let r=n?t:4*t;return new V_(e,i,r,n)}var $Q=new Sn;function Yxe(e,t,n,i){let r,o=n[Tf.positionHighAndScaleX],s=n[Tf.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,$Q);let c=i.scale,u=$Q.high,f=$Q.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 Xxe(e,t,n,i){let r,o=n[Tf.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 Kxe(e,t,n,i){let r,o=n[Tf.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 $xe(e,t,n,i){let r,o=n[Tf.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 Ept(e,t,n,i){Yxe(e,t,n,i),Xxe(e,t,n,i),Kxe(e,t,n,i),$xe(e,t,n,i)}function Cpt(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=ypt(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:$n.NEAREST})});let f=new _d({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:Wxe(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 vpt(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=Tpt(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];Ept(e,t,s,c)}n._vaf.commit(ZQ(i))}}var Spt=[];function wpt(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=Spt;u.length=0,(c[lpt]||c[upt])&&u.push(Yxe),(c[cpt]||c[hpt])&&u.push(Xxe),(c[fpt]||c[dpt])&&u.push(Kxe),c[ppt]&&u.push($xe);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(ZQ(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 Ipt(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:Tf}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:nn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function Ppt(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)}}}Jh.prototype.update=function(e){if(JQ(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&Cpt(this,e,q4,W4),this._instanced=e.context.instancedArrays,Tf=this._instanced?apt:spt,ZQ=this._instanced?bpt:Apt;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?vpt(this,e):o>0&&wpt(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)&&Ipt(this,e,G4,H4),Ppt(this,e))};Jh.prototype.isDestroyed=function(){return!1};Jh.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(),qxe(this._clouds),le(this)};var Jxe=Jh;async function Dpt(e,t,n,i){return l(i)||(i=!1),Mpt(e,t,n,i)}function Rpt(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(Qxe(i)):o=r.then(Qxe(i)).catch(Npt(i)),e.shift(),t.push(o),!0}function Opt(e){return new Promise(function(t){setTimeout(t,e)})}function QQ(e,t,n){return e.length?Rpt(e,t,n)?QQ(e,t,n):Opt(100).then(()=>QQ(e,t,n)):Promise.resolve()}function Mpt(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 QQ(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Zxe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Qxe(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(!Zxe(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];Zxe(s,i,n)}}):Promise.resolve()}}function Npt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var X4=Dpt;var eee=new U;async function eTe(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,eee);let p=e.loadTileDataAvailability(eee.x,eee.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 X4(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 eTe(e,a,n),t}var Vv=eTe;async function tee(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 tee._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}tee._sampleTerrainMostDetailed=Vv;var jv=tee;var Lpt=P.toRadians(30);function nee(e){this._angle=e??Lpt}Object.defineProperties(nee.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});nee.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 tTe=nee;var iee=[],ree=[];function Fpt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=iee,u=ree,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 oee(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);oee(e,t,n,i,o),oee(e,t,n,o+1,r),Fpt(e,t,n,i,o,r)}function Bpt(e,t,n){let i=e.length,r=Math.ceil(i*.5);iee.length=r,ree.length=r,oee(e,t,n,0,i-1),iee.length=0,ree.length=0}var Pg=Bpt;var kpt=new z,Upt=new z,zpt=new z,Vpt=new z,nTe=new se,w1=new Uint8Array(4);function iTe(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 K4(e,t){return{height:e,color:z.clone(t)}}function rTe(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 jpt(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,Ru._minimumHeight,Ru._maximumHeight),y=z.clone(g.color,kpt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(K4(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||Pg(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,K4(Ru._minimumHeight,c[0].color)),p&&c.splice(c.length,0,K4(Ru._maximumHeight,c[c.length-1].color)),c=rTe(c),i.push(c)}return i}function Hpt(e){let t=jpt(e),n=[],i,r;function o(u,f){n.push(K4(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,Vpt);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=iTe(m.height,x,b,zpt);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=iTe(b.height,y,m,Upt);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,Ru._emptyColor),o(b.height,Ru._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,Ru._emptyColor),o(m.height,Ru._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return rTe(n)}function Ru(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=Hpt(n),o=r.length,s,a,c;if(!Ru._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,nTe),se.pack(nTe,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:$n.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(w1),d[g*4+0]=w1[0],d[g*4+1]=w1[1],d[g*4+2]=w1[2],d[g*4+3]=w1[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:$n.LINEAR})});return lr.fromType("ElevationBand",{heights:f,colors:p})}Ru._useFloatTexture=function(e){return e.floatingPointTexture};Ru._maximumHeight=5906376425472;Ru._minimumHeight=-5906376425472;Ru._emptyColor=new z(0,0,0,0);var oTe=Ru;async function Gpt(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??Ba.defaultApiKey;if(!l(n))return Wpt(t);let i,r=Ba.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Ba.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Jo.fromUrl(o,t)}var sTe={};async function Wpt(e){let i=sTe[2275207];l(i)||(i=Ho.fromAssetId(2275207),sTe[2275207]=i);let r=await i;return Jo.fromUrl(r,e)}var aTe=Gpt;async function qpt(e){let t=await Jo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new Oy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var cTe=qpt;function Ypt(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:qn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:qn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:qn.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 lTe=Ypt;var pTe=js(nf(),1),uTe=576,Xpt=100,I1="#ffffff",P1="#48b";function gTe(e,t){this.credit=e,this.count=t??1}function Kpt(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 $pt(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 _Te="cesium-credit-delimiter";function fTe(e){let t=document.createElement("span");return t.textContent=e,t.className=_Te,t}function dTe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function hTe(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(fTe(n));else{let f=r[u];f.className!==_Te&&e.replaceChild(fTe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(dTe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(dTe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function Jpt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<uTe?(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>=uTe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function mTe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function Zpt(e){let t=` +`;function Tm(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 vNt=Tm.SHOW_INDEX=0,SNt=Tm.POSITION_INDEX=1,wNt=Tm.SCALE_INDEX=2,INt=Tm.MAXIMUM_SIZE_INDEX=3,PNt=Tm.SLICE_INDEX=4,DNt=Tm.BRIGHTNESS_INDEX=5,RNt=Tm.COLOR_INDEX=6;Tm.NUMBER_OF_PROPERTIES=7;function kT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Tm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,kT(this,vNt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),kT(this,SNt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),kT(this,wNt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),kT(this,INt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),kT(this,RNt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,kT(this,PNt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,kT(this,DNt))}}});Tm.prototype._destroy=function(){this._cloudCollection=void 0};var Qd=Tm;var Uf,qG=new h,ONt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},MNt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},NNt=Qd.SHOW_INDEX,LNt=Qd.POSITION_INDEX,FNt=Qd.SCALE_INDEX,BNt=Qd.MAXIMUM_SIZE_INDEX,kNt=Qd.SLICE_INDEX,UNt=Qd.BRIGHTNESS_INDEX,zNt=Qd.NUMBER_OF_PROPERTIES,VNt=Qd.COLOR_INDEX;function Em(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(zNt),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:oNe(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 oNe(e){return function(){return qG.x=e._textureSliceWidth,qG.y=e._noiseTextureRows,qG.z=1/e._noiseTextureRows,qG}}Object.defineProperties(Em.prototype,{length:{get:function(){return woe(this),this._clouds.length}}});function sNe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Em.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??XO.CUMULUS,n;return t===XO.CUMULUS&&(n=new Qd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Em.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Em.prototype.removeAll=function(){sNe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function woe(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}}Em.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Em.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Em.prototype.get=function(e){return woe(this),this._clouds[e]};var jNt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),HNt=new Uint16Array([0,1,2,0,2,3]);function GNt(e){let t=nt.createVertexBuffer({context:e,typedArray:jNt,usage:Me.STATIC_DRAW}),n=nt.createIndexBuffer({context:e,typedArray:HNt,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 Ioe;function WNt(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=nt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function qNt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=nt.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 YNt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=nt.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 XNt(e,t,n){let i=[{index:Uf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Uf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Uf.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Uf.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Uf.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:Uf.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:YNt(e)});let r=n?t:4*t;return new Ry(e,i,r,n)}var Soe=new Sn;function aNe(e,t,n,i){let r,o=n[Uf.positionHighAndScaleX],s=n[Uf.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,Soe);let c=i.scale,u=Soe.high,f=Soe.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 cNe(e,t,n,i){let r,o=n[Uf.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 lNe(e,t,n,i){let r,o=n[Uf.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 uNe(e,t,n,i){let r,o=n[Uf.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 KNt(e,t,n,i){aNe(e,t,n,i),cNe(e,t,n,i),lNe(e,t,n,i),uNe(e,t,n,i)}function $Nt(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=GNt(a),r._spNoise=en.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 Gt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST})});let f=new hd({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:oNe(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 JNt(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=XNt(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];KNt(e,t,s,c)}n._vaf.commit(Ioe(i))}}var ZNt=[];function QNt(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=ZNt;u.length=0,(c[LNt]||c[FNt])&&u.push(aNe),(c[NNt]||c[UNt])&&u.push(cNe),(c[BNt]||c[kNt])&&u.push(lNe),c[VNt]&&u.push(uNe);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(Ioe(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 eLt(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=en.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Uf}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:nn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function tLt(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)}}}Em.prototype.update=function(e){if(woe(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&$Nt(this,e,WG,GG),this._instanced=e.context.instancedArrays,Uf=this._instanced?MNt:ONt,Ioe=this._instanced?qNt:WNt;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?JNt(this,e):o>0&&QNt(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)&&eLt(this,e,HG,jG),tLt(this,e))};Em.prototype.isDestroyed=function(){return!1};Em.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(),sNe(this._clouds),le(this)};var fNe=Em;async function Poe(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 Poe._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}Poe._sampleTerrainMostDetailed=Xw;var oI=Poe;var nLt=P.toRadians(30);function Doe(e){this._angle=e??nLt}Object.defineProperties(Doe.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Doe.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 dNe=Doe;var iLt=new z,rLt=new z,oLt=new z,sLt=new z,hNe=new se,KO=new Uint8Array(4);function mNe(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 YG(e,t){return{height:e,color:z.clone(t)}}function pNe(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 aLt(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,Ku._minimumHeight,Ku._maximumHeight),y=z.clone(g.color,iLt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(YG(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||i_(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,YG(Ku._minimumHeight,c[0].color)),p&&c.splice(c.length,0,YG(Ku._maximumHeight,c[c.length-1].color)),c=pNe(c),i.push(c)}return i}function cLt(e){let t=aLt(e),n=[],i,r;function o(u,f){n.push(YG(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,sLt);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=mNe(m.height,x,b,oLt);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=mNe(b.height,y,m,rLt);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,Ku._emptyColor),o(b.height,Ku._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,Ku._emptyColor),o(m.height,Ku._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return pNe(n)}function Ku(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=cLt(n),o=r.length,s,a,c;if(!Ku._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,hNe),se.pack(hNe,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 Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(KO),d[g*4+0]=KO[0],d[g*4+1]=KO[1],d[g*4+2]=KO[2],d[g*4+3]=KO[3];let p=Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR})});return ir.fromType("ElevationBand",{heights:f,colors:p})}Ku._useFloatTexture=function(e){return e.floatingPointTexture};Ku._maximumHeight=5906376425472;Ku._minimumHeight=-5906376425472;Ku._emptyColor=new z(0,0,0,0);var gNe=Ku;async function lLt(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??La.defaultApiKey;if(!l(n))return uLt(t);let i,r=La.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${La.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Jo.fromUrl(o,t)}var _Ne={};async function uLt(e){let i=_Ne[2275207];l(i)||(i=qo.fromAssetId(2275207),_Ne[2275207]=i);let r=await i;return Jo.fromUrl(r,e)}var yNe=lLt;async function fLt(e){let t=await Jo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new Uy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var ANe=fLt;function dLt(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:qn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:qn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:qn.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 An({flat:!0,translucent:!1})})}var bNe=dLt;var SNe=js(ef(),1),xNe=576,hLt=100,$O="#ffffff",JO="#48b";function wNe(e,t){this.credit=e,this.count=t??1}function mLt(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 pLt(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 INe="cesium-credit-delimiter";function TNe(e){let t=document.createElement("span");return t.textContent=e,t.className=INe,t}function ENe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function CNe(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(TNe(n));else{let f=r[u];f.className!==INe&&e.replaceChild(TNe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(ENe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(ENe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function gLt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<xNe?(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>=xNe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function vNe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function _Lt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -9044,19 +9694,19 @@ v_position = transformedPos; .cesium-credit-lightbox { background-color: #303336; - color: ${I1}; + color: ${$O}; position: relative; - min-height: ${Xpt}px; + min-height: ${hLt}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: ${I1}; + color: ${$O}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${P1}; + color: ${JO}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -9076,10 +9726,10 @@ v_position = transformedPos; position: absolute; top: 0; right: 6px; - color: ${I1}; + color: ${$O}; } .cesium-credit-lightbox-close:hover { - color: ${P1}; + color: ${JO}; } .cesium-credit-lightbox > ul { margin: 0; @@ -9098,20 +9748,20 @@ v_position = transformedPos; padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${I1}; + color: ${$O}; } .cesium-credit-expand-link:hover { - color: ${P1}; + color: ${JO}; } .cesium-credit-expand-link:focus-visible, .cesium-credit-lightbox-close:focus-visible { - outline: 2px solid ${P1}; + outline: 2px solid ${JO}; outline-offset: 2px; } .cesium-credit-text { - color: ${I1}; + color: ${$O}; } .cesium-credit-delimiter { @@ -9122,1648 +9772,1156 @@ v_position = transformedPos; .cesium-credit-logoContainer * { display: inline; } - -.cesium-credit-textContainer a:hover { - color: ${P1} -} - -.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 zo(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=mTe(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=mTe(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),Zpt(e);let m=It.clone(zo.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 yTe(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 gTe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}zo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(ATe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,yTe(this,t,e)};zo.prototype.addStaticCredit=function(e){let t=this._staticCredits;Kpt(t,e)||t.push(e)};zo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};zo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};zo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};zo.prototype.update=function(){this._expanded&&Jpt(this)};zo.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(zo.cesiumCredit,this._cesiumCredit)||yTe(this,s,o,Number.MAX_VALUE)}It.equals(zo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(zo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};zo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;hTe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",hTe(this._creditList,t,void 0,"li"),$pt(this)};zo.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),le(this)};zo.prototype.isDestroyed=function(){return!1};zo._cesiumCredit=void 0;zo._cesiumCreditInitialized=!1;var $4;function ATe(){if(!l($4)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new pTe.default(e).path()),$4=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return zo._cesiumCreditInitialized||(zo._cesiumCredit=$4,zo._cesiumCreditInitialized=!0),$4}Object.defineProperties(zo,{cesiumCredit:{get:function(){return ATe(),zo._cesiumCredit},set:function(e){zo._cesiumCredit=e,zo._cesiumCreditInitialized=!0}}});zo.CreditDisplayElement=gTe;var J4=zo;function Qpt(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 ms({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var Z4=Qpt;var Q4=`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 e8=`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; -} -`;var t8=`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; -} -`;function D1(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(D1.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});D1.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"?Z4(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 ms({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=rl.createGeometry(rl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=qn.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:nn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Xe({defines:[t?"HDR":""],sources:[Q4]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?t8:e8,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)}};D1.prototype.isDestroyed=function(){return!1};D1.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(),le(this)};var Hv=D1;function R1(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} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,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=Pr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(R1.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}}});R1.prototype.getFragmentShaderSource=Pr.prototype.getFragmentShaderSource;R1.prototype.isTranslucent=Pr.prototype.isTranslucent;R1.prototype.getRenderState=Pr.prototype.getRenderState;var bTe=R1;var n8=0,e0t=1;function Ox(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=n8,a=Zi.packedLength):t instanceof pn&&(s=e0t,a=pn.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}Ox.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===n8?(Zi.pack(r,t,n),n+=Zi.packedLength):(pn.pack(r,t,n),n+=pn.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 t0t=new Zi,n0t=new pn,i0t=new Le,r0t=new h,o0t=new Be;Ox.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===n8?(r=Zi.unpack(e,t,t0t),t+=Zi.packedLength):(r=pn.unpack(e,t,n0t),t+=pn.packedLength);let o=h.unpack(e,t,r0t);t+=h.packedLength;let s=Le.unpack(e,t,i0t);t+=Le.packedLength;let a=Be.unpack(e,t,o0t);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new Ox({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 Gv(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 s0t=new $,a0t=new M,see=new M,xTe=new h,TTe=new h,ETe=new h,c0t=new h,l0t=new h,u0t=new h,jy=new Array(3),O1=new Array(4);O1[0]=new se(-1,-1,1,1);O1[1]=new se(1,-1,1,1);O1[2]=new se(1,1,1,1);O1[3]=new se(-1,1,1,1);var CTe=new Array(4);for(let e=0;e<4;++e)CTe[e]=new se;Ox._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,s0t),u=o??xTe,f=s??TTe,d=a??ETe;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,a0t),g,m,y=i.projectionMatrix;if(n===n8){let A=M.multiply(y,p,see);m=M.inverse(A,see)}else g=M.inverseTransformation(p,see);l(m)?(jy[0]=i.near,jy[1]=i.far):(jy[0]=0,jy[1]=i.near,jy[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(O1[b],CTe[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,jy[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=jy[A],v=jy[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}};Ox.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);Ox._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 Cn({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=xTe,b=TTe,x=ETe,T=h.negate(A,c0t),E=h.negate(b,l0t),v=h.negate(x,u0t);u=0,o&&(Gv(u,p,g,m,y,v,A,b),u+=12),Gv(u,p,g,m,y,x,T,b),u+=12,Gv(u,p,g,m,y,T,v,b),u+=12,Gv(u,p,g,m,y,E,v,T),u+=12,Gv(u,p,g,m,y,A,x,b),u+=12,Gv(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:ue.fromVertices(c)})};var Wv=Ox;var aee=0,f0t=1;function M1(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Zi?(o=aee,s=Zi.packedLength):t instanceof pn&&(o=f0t,s=pn.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}M1.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===aee?(Zi.pack(r,t,n),n+=Zi.packedLength):(pn.pack(r,t,n),n+=pn.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 d0t=new Zi,h0t=new pn,m0t=new Le,p0t=new h;M1.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===aee?(r=Zi.unpack(e,t,d0t),t+=Zi.packedLength):(r=pn.unpack(e,t,h0t),t+=pn.packedLength);let o=h.unpack(e,t,p0t);t+=h.packedLength;let s=Le.unpack(e,t,m0t);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new M1({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};M1.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);Wv._computeNearFarPlanes(i,r,t,n,s);let a=new Cn({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:ue.fromVertices(s)})};var i8=M1;function r8(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 g0t=new h,_0t=new $,y0t=new Le,A0t=new Zi,b0t=new pu,x0t=new pn,T0t=new ws,E0t=new z,C0t=[1,1e5];r8.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=A0t:s instanceof pu?a=b0t:s instanceof pn?a=x0t:a=T0t,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=C0t,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,g0t);let m=_0t;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,y0t);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 Wv({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,E0t))},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Nn({geometryInstances:new Bt({geometry:new i8({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)};r8.prototype.isDestroyed=function(){return!1};r8.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 le(this)};var Dg=r8;function vTe(){this._cachedShowFrustumsShaders={}}function v0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function S0t(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 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+="}",r.sources.push(a);let u=v0t(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var N1=new z;function w0t(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?(N1.red=t.debugOverlappingFrustums&1?1:0,N1.green=t.debugOverlappingFrustums&2?1:0,N1.blue=t.debugOverlappingFrustums&4?1:0,N1.alpha=1,N1):z.WHITE}),n}var I0t=new at;vTe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=S0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,I0t);o.shaderProgram=r,o.uniformMap=w0t(e,t),o.execute(e.context,n)};var o8=vTe;var DTe=[];function P0t(e,t,n,i,r){let o=DTe;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 L1(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??fn.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}L1.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 RTe=ee.clone(ee.UNIT_SPHERE),OTe=new Be,Mx={positions:void 0,colors:void 0,ellipsoid:RTe,vertexFormat:OTe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};L1.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,RTe);t+=ee.packedLength;let c=Be.unpack(e,t,OTe);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):(Mx.positions=o,Mx.colors=s,Mx.width=u,Mx.colorsPerVertex=f,Mx.arcType=d,Mx.granularity=p,new L1(Mx))};var STe=new h,wTe=new h,ITe=new h,PTe=new h;L1.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=Br(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===fn.GEODESIC||o===fn.RHUMB){let N,F;o===fn.GEODESIC?(N=P.chordLength(s,a.maximumRadius),F=ur.numberOfPoints):(N=s,F=ur.numberOfPointsRhumbLine);let V=ur.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=P0t(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,DTe.length=0}o===fn.GEODESIC?p=ur.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:V}):p=ur.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=STe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,ITe),h.clone(p[u],wTe),u===g-1?(O=STe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,PTe);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(wTe,y,v),h.pack(ITe,A,v),h.pack(PTe,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 Cn;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:ue.fromPoints(p),geometryType:yh.POLYLINES})};var Hy=L1;var s8=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_color = color; -} -`;var D0t=`#define CLIP_POLYLINE -${hu} -${s8}`,R0t=Cv;function Nx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Nx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??D0t,this._fragmentShaderSource=e.fragmentShaderSource??R0t,this._renderState=Pr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Nx.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}}});Nx.VERTEX_FORMAT=Be.POSITION_ONLY;Nx.prototype.getFragmentShaderSource=Pr.prototype.getFragmentShaderSource;Nx.prototype.isTranslucent=Pr.prototype.isTranslucent;Nx.prototype.getRenderState=Pr.prototype.getRenderState;var $s=Nx;function a8(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}a8.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 Hy({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:$s.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:fn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new Hy({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:$s.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:fn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new Hy({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:$s.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:fn.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 $s,asynchronous:!1})}this._primitive.update(e)}};a8.prototype.isDestroyed=function(){return!1};a8.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var c8=a8;var O0t=new TextDecoder,l8={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},M0t={LAYERS:3},F1={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},cee={TAGS:2,TYPE:3,GEOMETRY:4},Lx={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},N0t=["Unknown","Point","LineString","Polygon"];function L0t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=u8(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===M0t.LAYERS&&s===2){let a=Rg(t,i,t.length);i=a.newPos;let c=Ou(i,a.value,t.length,"layer");n.push(F0t(t,i,c)),i=c}else i=f8(t,i,s,t.length)}return{layers:n}}function F0t(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=u8(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===F1.NAME&&p===2){let g=Rg(e,i,n);i=g.newPos;let m=Ou(i,g.value,n,"layer name");r=uee(e,i,g.value),i=m}else if(d===F1.FEATURES&&p===2){let g=Rg(e,i,n);i=g.newPos;let m=Ou(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===F1.KEYS&&p===2){let g=Rg(e,i,n);i=g.newPos;let m=Ou(i,g.value,n,"key");s.push(uee(e,i,g.value)),i=m}else if(d===F1.VALUES&&p===2){let g=Rg(e,i,n);i=g.newPos;let m=Ou(i,g.value,n,"value"),y=U0t(e,i,m);a.push(y),i=m}else if(d===F1.EXTENT&&p===0){let g=qv(e,i,n);o=g.value,i=g.newPos}else i=f8(e,i,p,n)}let u=c.map(({start:f,end:d})=>B0t(e,f,d,s,a));return{name:r,extent:o,features:u}}function B0t(e,t,n,i,r){let o=t,s=l8.UNKNOWN,a=[],c=[];for(;o<n;){let d=u8(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===cee.TYPE&&g===0){let m=qv(e,o,n);s=m.value,o=m.newPos}else if(p===cee.TAGS&&g===2){let m=Rg(e,o,n);o=m.newPos;let y=Ou(o,m.value,n,"feature tags");for(;o<y;){let A=qv(e,o,y);a.push(A.value),o=A.newPos}}else if(p===cee.GEOMETRY&&g===2){let m=Rg(e,o,n);o=m.newPos;let y=Ou(o,m.value,n,"feature geometry");for(;o<y;){let A=qv(e,o,y);c.push(A.value),o=A.newPos}}else o=f8(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=k0t(s,c);return{type:N0t[s]??"Unknown",geometry:f,properties:u}}function k0t(e,t){let n=0,i=0,r=0;if(e===l8.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+=vp(t[n++]),r+=vp(t[n++]),o.push({x:i,y:r})}return o}if(e===l8.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+=vp(t[n++]),r+=vp(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=vp(t[n++]),r+=vp(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===l8.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+=vp(t[n++]),r+=vp(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=vp(t[n++]),r+=vp(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 U0t(e,t,n){let i=t;for(;i<n;){let r=u8(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===Lx.STRING&&s===2){let a=Rg(e,i,n);i=a.newPos;let c=Ou(i,a.value,n,"string value");return uee(e,i,c-i)}else{if(o===Lx.FLOAT&&s===5)return Ou(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===Lx.DOUBLE&&s===1)return Ou(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===Lx.INT64&&s===0){let a=Yv(e,i,n);return lee(a.value)}else if(o===Lx.UINT64&&s===0){let a=Yv(e,i,n);return lee(a.value)}else if(o===Lx.SINT64&&s===0){let a=Yv(e,i,n);return lee(z0t(a.value))}else if(o===Lx.BOOL&&s===0)return qv(e,i,n).value!==0}i=f8(e,i,s,n)}}function u8(e,t,n){let i=qv(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function qv(e,t,n){let i=Yv(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function Rg(e,t,n){let i=Yv(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 Yv(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 uee(e,t,n){let i=Ou(t,n,e.length,"string");return O0t.decode(e.subarray(t,i))}function Ou(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 f8(e,t,n,i){if(n===0)return Yv(e,t,i).newPos;if(n===1)return Ou(t,8,i,"fixed64 field");if(n===2){let r=Rg(e,t,i);return Ou(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return Ou(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function vp(e){return e>>>1^-(e&1)}function z0t(e){return e>>1n^-(e&1n)}function lee(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var d8=L0t;var h8=`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); -} -else -{ -position = vec3(0.0); -direction = normalize(positionEC.xyz); -} -czm_ray ray = czm_ray(position, direction); -vec3 ellipsoid_center = czm_view[3].xyz; -czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); -if (!czm_isEmpty(intersection)) -{ -out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); -} -else -{ -discard; -} -czm_writeLogDepth(); -} -`;var m8=`in vec4 position; -out vec4 positionEC; -void main() -{ -positionEC = czm_modelView * position; -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -} -`;function k1(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 B1=dn.supportsTypedArrays()?new Float32Array(12):[],MTe=new h,NTe=new h,fee=new h,LTe=new h,p8=new h;function V0t(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof pn)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,MTe),g=h.normalize(p,NTe),m=h.normalize(h.cross(h.UNIT_Z,p,fee),fee),y=h.normalize(h.cross(g,m,LTe),LTe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,MTe);let x=b/A;o=h.multiplyByScalar(m,x,NTe),s=h.multiplyByScalar(y,x,fee)}let a=h.add(r,s,p8);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,B1,0);let c=h.subtract(r,s,p8);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,B1,3);let u=h.add(r,s,p8);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,B1,6);let f=h.subtract(r,s,p8);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,B1,9),B1}k1.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 ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Xe({sources:[m8]}),a=new Xe({sources:[h8]});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=V0t(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}};k1.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};k1.prototype.isDestroyed=function(){return!1};k1.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var g8=k1;function Fx(){}var j0t=/\bgl_FragDepth\b/,H0t=/\bdiscard\b/;function G0t(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(j0t.test(o[a])||H0t.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() -{ - out_FragColor = vec4(1.0); -} -`;i=new Xe({sources:[a]})}else if(!r&&s){let a=`void main() -{ - out_FragColor = vec4(1.0); - czm_writeLogDepth(); -} -`;i=new Xe({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function W0t(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}Fx.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=G0t(n,t.shaderProgram),i.depthOnlyCommand.renderState=W0t(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var q0t=/\s+czm_writeLogDepth\(/,Y0t=/\s+czm_vertexLogDepth\(/;function X0t(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(Y0t.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() -{ - czm_log_depth_main(); - czm_vertexLogDepth(); -} -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)q0t.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(); -} -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}Fx.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=X0t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function K0t(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 () -{ - 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 dee(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}Fx.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=K0t(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=dee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var $0t=`uint rgba8UnormToUint32(vec4 c) -{ - uvec4 b = uvec4(c * 255.0 + 0.5); - return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); -} -`;function J0t(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=`${$0t} -void main () -{ - 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})}Fx.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=J0t(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=dee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function Xv(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 Z0t(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function FTe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function BTe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function Q0t(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=FTe(n,i,r)}return e.normalized||(n=BTe(n,e.componentType)),n}function egt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=FTe(r,o,s)}return e.normalized||(r=BTe(r,e.componentType)),r}function tgt(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=Z0t(u);if(p===1)d[0]=Q0t(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=egt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(bd.METADATA_PICKING_ENABLED),Xv(g,bd.METADATA_PICKING_VALUE_TYPE,f),Xv(g,bd.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),Xv(g,bd.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),Xv(g,bd.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),Xv(g,bd.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),Xv(g,bd.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})}Fx.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=tgt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=dee(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function ngt(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})}Fx.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=ngt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Sp=Fx;function _8(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 igt=new Le,kTe=new Le,rgt=new $;function ogt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,kTe),c=Le.fromAxisAngle(o,i,igt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,kTe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,rgt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}_8.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;ogt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};_8.prototype.isDestroyed=function(){return!1};_8.prototype.destroy=function(){return this._removeListener(),le(this)};var y8=_8;function sgt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var UTe=sgt;function Gy(){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 di({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(Gy.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}}});Gy.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};Gy.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};Gy.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};Gy.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};Gy.prototype.isDestroyed=function(){return!1};Gy.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var A8=Gy;var U1=`uniform vec3 u_radii; -uniform vec3 u_oneOverEllipsoidRadiiSquared; -in vec3 v_positionEC; -vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) -{ -vec3 positionEC = czm_pointAlongRay(ray, intersection); -vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; -vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); -vec3 sphericalNormal = normalize(positionMC / u_radii); -vec3 normalMC = geodeticNormal * side; -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 -} -void main() -{ -float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; -vec3 direction = normalize(v_positionEC); -vec3 ellipsoidCenter = czm_modelView[3].xyz; -float t1 = -1.0; -float t2 = -1.0; -float b = -2.0 * dot(direction, ellipsoidCenter); -float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; -float discriminant = b * b - 4.0 * c; -if (discriminant >= 0.0) { -t1 = (-b - sqrt(discriminant)) * 0.5; -t2 = (-b + sqrt(discriminant)) * 0.5; -} -if (t1 < 0.0 && t2 < 0.0) { -discard; -} -float t = min(t1, t2); -if (t < 0.0) { -t = 0.0; -} -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; -} -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 -#endif -} -`;var z1=`in vec3 position; -uniform vec3 u_radii; -out vec3 v_positionEC; -void main() -{ -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(); -} -`;var hee={position:0};function b8(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 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??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 agt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=rl.createGeometry(rl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:hee,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}b8.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:ji.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?nn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=agt(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),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 c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Xe({sources:[z1]}),p=new Xe({sources:[this.material.shaderSource,U1]}),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:hee}),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 Xe({sources:[z1]}),p=new Xe({sources:[this.material.shaderSource,U1],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:hee}),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)}};b8.prototype.isDestroyed=function(){return!1};b8.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(),le(this)};var x8=b8;var T8=`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 + +.cesium-credit-textContainer a:hover { + color: ${JO} } -`;var E8=`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; + +.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { + padding-left: 5px; } -`;function Bx(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??E8,this._fragmentShaderSource=e.fragmentShaderSource??T8,this._renderState=Pr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(Bx.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 Bx.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});Bx.VERTEX_FORMAT=Be.POSITION_AND_ST;Bx.prototype.getFragmentShaderSource=Pr.prototype.getFragmentShaderSource;Bx.prototype.isTranslucent=Pr.prototype.isTranslucent;Bx.prototype.getRenderState=Pr.prototype.getRenderState;var zTe=Bx;var cgt=new h,lgt=new h,ugt=new h,fgt=new h,dgt=new h,hgt=new h(1,1,1),VTe=Math.cos,jTe=Math.sin;function Og(e){e=e??H.EMPTY_OBJECT;let t=e.radii??hgt,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"}Og.packedLength=2*h.packedLength+Be.packedLength+7;Og.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 HTe=new h,GTe=new h,WTe=new Be,Wy={radii:HTe,innerRadii:GTe,vertexFormat:WTe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Og.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,HTe);t+=h.packedLength;let r=h.unpack(e,t,GTe);t+=h.packedLength;let o=Be.unpack(e,t,WTe);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):(Wy.minimumClock=s,Wy.maximumClock=a,Wy.minimumCone=c,Wy.maximumCone=u,Wy.stackPartitions=f,Wy.slicePartitions=d,Wy.offsetAttribute=p===-1?void 0:p,new Og(Wy))};Og.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]=jTe(g[f]),j[f]=VTe(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=VTe(m[d]),k[d]=jTe(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 Cn;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,cgt),Ye=ve.geodeticSurfaceNormal(He,lgt);if(L[f]&&h.negate(Ye,Ye),a.st){let Ke=U.negate(Ye,dgt);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=ugt,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,fgt);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===_n.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:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var mee;Og.getUnitEllipsoid=function(){return l(mee)||(mee=Og.createGeometry(new Og({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),mee};var rc=Og;function Kv(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 rc(i),this._workerName="createSphereGeometry"}Kv.packedLength=rc.packedLength;Kv.pack=function(e,t,n){return rc.pack(e._ellipsoidGeometry,t,n)};var mgt=new rc,qy={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};Kv.unpack=function(e,t,n){let i=rc.unpack(e,t,mgt);return qy.vertexFormat=Be.clone(i._vertexFormat,qy.vertexFormat),qy.stackPartitions=i._stackPartitions,qy.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,qy.radii),n._ellipsoidGeometry=new rc(qy),n):(qy.radius=i._radii.x,new Kv(qy))};Kv.createGeometry=function(e){return rc.createGeometry(e._ellipsoidGeometry)};var C8=Kv;var v8=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; +`;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=vNe(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=vNe(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),_Lt(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 kt,lightboxCredits:new kt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function PNe(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 wNe(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(DNe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,PNe(this,t,e)};Vo.prototype.addStaticCredit=function(e){let t=this._staticCredits;mLt(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&&gLt(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)||PNe(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;CNe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",CNe(this._creditList,t,void 0,"li"),pLt(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),le(this)};Vo.prototype.isDestroyed=function(){return!1};Vo._cesiumCredit=void 0;Vo._cesiumCreditInitialized=!1;var XG;function DNe(){if(!l(XG)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new SNe.default(e).path()),XG=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=XG,Vo._cesiumCreditInitialized=!0),XG}Object.defineProperties(Vo,{cesiumCredit:{get:function(){return DNe(),Vo._cesiumCredit},set:function(e){Vo._cesiumCredit=e,Vo._cesiumCreditInitialized=!0}}});Vo.CreditDisplayElement=wNe;var KG=Vo;var $G=`uniform samplerCube u_cubeMap; +in vec3 v_texCoord; void main() { -vec3 positionToEyeEC = -v_positionEC; -mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = tangentToEyeMatrix; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); +out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); } -`;var S8=`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; +`;var JG=`in vec3 position; +out vec3 v_texCoord; void main() { -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; +vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -`;var w8=`in vec3 v_positionEC; -in vec3 v_normalEC; +`;var ZG=`uniform mat3 u_cubeMapPanoramaTransform; +in vec3 position; +out vec3 v_texCoord; void main() { -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position)); +gl_Position = czm_projection * vec4(p, 1.0); +v_texCoord = position.xyz; } -`;var I8=`in vec3 position3DHigh; +`;function ZO(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(ZO.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});ZO.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"?aH(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 us({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=kc.createGeometry(kc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=qn.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:nn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Xe({defines:[t?"HDR":""],sources:[$G]});a.shaderProgram=en.fromCache({context:o,vertexShaderSource:l(this._transform)?ZG:JG,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)}};ZO.prototype.isDestroyed=function(){return!1};ZO.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(),le(this)};var sI=ZO;function QO(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 vec3 normal; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +${n?"":`in ${i} ${t}; +`}out ${i} ${r}; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var P8=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${r}; +${o} void main() { -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var D8=`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; +out_FragColor = getColor(); +}`;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(QO.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}}});QO.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;QO.prototype.isTranslucent=Dr.prototype.isTranslucent;QO.prototype.getRenderState=Dr.prototype.getRenderState;var RNe=QO;function QG(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 yLt=new h,ALt=new $,bLt=new Le,xLt=new er,TLt=new Wu,ELt=new _n,CLt=new ws,vLt=new z,SLt=[1,1e5];QG.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 er?a=xLt:s instanceof Wu?a=TLt:s instanceof _n?a=ELt:a=CLt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=SLt,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,yLt);let m=ALt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,bLt);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 Bt({geometry:new Ww({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,vLt))},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Mn({geometryInstances:new Bt({geometry:new RH({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)};QG.prototype.isDestroyed=function(){return!1};QG.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 le(this)};var c_=QG;function ONe(){this._cachedShowFrustumsShaders={}}function wLt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function ILt(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 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+="}",r.sources.push(a);let u=wLt(i);return en.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var eM=new z;function PLt(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?(eM.red=t.debugOverlappingFrustums&1?1:0,eM.green=t.debugOverlappingFrustums&2?1:0,eM.blue=t.debugOverlappingFrustums&4?1:0,eM.alpha=1,eM):z.WHITE}),n}var DLt=new at;ONe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=ILt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,DLt);o.shaderProgram=r,o.uniformMap=PLt(e,t),o.execute(e.context,n)};var e5=ONe;function t5(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}t5.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 gA({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ys.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 gA({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ys.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 gA({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ys.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 Mn({geometryInstances:[t,n,i],appearance:new Ys,asynchronous:!1})}this._primitive.update(e)}};t5.prototype.isDestroyed=function(){return!1};t5.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var n5=t5;var RLt=new TextDecoder,i5={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},OLt={LAYERS:3},tM={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Roe={TAGS:2,TYPE:3,GEOMETRY:4},UT={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},MLt=["Unknown","Point","LineString","Polygon"];function NLt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=r5(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===OLt.LAYERS&&s===2){let a=l_(t,i,t.length);i=a.newPos;let c=$u(i,a.value,t.length,"layer");n.push(LLt(t,i,c)),i=c}else i=o5(t,i,s,t.length)}return{layers:n}}function LLt(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=r5(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===tM.NAME&&p===2){let g=l_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"layer name");r=Moe(e,i,g.value),i=m}else if(d===tM.FEATURES&&p===2){let g=l_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===tM.KEYS&&p===2){let g=l_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"key");s.push(Moe(e,i,g.value)),i=m}else if(d===tM.VALUES&&p===2){let g=l_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"value"),y=kLt(e,i,m);a.push(y),i=m}else if(d===tM.EXTENT&&p===0){let g=aI(e,i,n);o=g.value,i=g.newPos}else i=o5(e,i,p,n)}let u=c.map(({start:f,end:d})=>FLt(e,f,d,s,a));return{name:r,extent:o,features:u}}function FLt(e,t,n,i,r){let o=t,s=i5.UNKNOWN,a=[],c=[];for(;o<n;){let d=r5(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===Roe.TYPE&&g===0){let m=aI(e,o,n);s=m.value,o=m.newPos}else if(p===Roe.TAGS&&g===2){let m=l_(e,o,n);o=m.newPos;let y=$u(o,m.value,n,"feature tags");for(;o<y;){let A=aI(e,o,y);a.push(A.value),o=A.newPos}}else if(p===Roe.GEOMETRY&&g===2){let m=l_(e,o,n);o=m.newPos;let y=$u(o,m.value,n,"feature geometry");for(;o<y;){let A=aI(e,o,y);c.push(A.value),o=A.newPos}}else o=o5(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=BLt(s,c);return{type:MLt[s]??"Unknown",geometry:f,properties:u}}function BLt(e,t){let n=0,i=0,r=0;if(e===i5.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+=f0(t[n++]),r+=f0(t[n++]),o.push({x:i,y:r})}return o}if(e===i5.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+=f0(t[n++]),r+=f0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=f0(t[n++]),r+=f0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===i5.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+=f0(t[n++]),r+=f0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=f0(t[n++]),r+=f0(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 kLt(e,t,n){let i=t;for(;i<n;){let r=r5(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===UT.STRING&&s===2){let a=l_(e,i,n);i=a.newPos;let c=$u(i,a.value,n,"string value");return Moe(e,i,c-i)}else{if(o===UT.FLOAT&&s===5)return $u(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===UT.DOUBLE&&s===1)return $u(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===UT.INT64&&s===0){let a=cI(e,i,n);return Ooe(a.value)}else if(o===UT.UINT64&&s===0){let a=cI(e,i,n);return Ooe(a.value)}else if(o===UT.SINT64&&s===0){let a=cI(e,i,n);return Ooe(ULt(a.value))}else if(o===UT.BOOL&&s===0)return aI(e,i,n).value!==0}i=o5(e,i,s,n)}}function r5(e,t,n){let i=aI(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function aI(e,t,n){let i=cI(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function l_(e,t,n){let i=cI(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 cI(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 Moe(e,t,n){let i=$u(t,n,e.length,"string");return RLt.decode(e.subarray(t,i))}function $u(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 o5(e,t,n,i){if(n===0)return cI(e,t,i).newPos;if(n===1)return $u(t,8,i,"fixed64 field");if(n===2){let r=l_(e,t,i);return $u(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return $u(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function f0(e){return e>>>1^-(e&1)}function ULt(e){return e>>1n^-(e&1n)}function Ooe(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var s5=NLt;var a5=`in vec4 positionEC; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function kx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??kx.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=Pr.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(kx.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}}});kx.prototype.getFragmentShaderSource=Pr.prototype.getFragmentShaderSource;kx.prototype.isTranslucent=Pr.prototype.isTranslucent;kx.prototype.getRenderState=Pr.prototype.getRenderState;kx.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:I8,fragmentShaderSource:w8}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:D8,fragmentShaderSource:P8}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:S8,fragmentShaderSource:v8})};var Sr=kx;var pgt=1e5;function V1(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:pgt,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 C8({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(V1.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)}}});V1.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};V1.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};V1.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var qTe=V1;function pee(){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(pee.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var ggt=new h;pee.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,ggt),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 R8=pee;function Mu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Mu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Mu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Mu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Mu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Mu.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){_gt(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(){ygt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Mu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Mu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Mu({scene:e})),e._frameRateMonitor};Object.defineProperties(Mu.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}}});Mu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Mu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Mu.prototype.isDestroyed=function(){return!1};Mu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function _gt(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 ygt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var O8=Mu;function Agt(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 M8=Agt;var _ee=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=bgt(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 ff({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new Sl({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new $a({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:ZTe(m.points[b],r,u),pickObject:i?gee(this,x,this._points,Wc,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:YTe(m.polylines[b],r,s),pickObject:i?gee(this,x,this._polylines,Pa,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:YTe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?gee(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=ls(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=ls(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),le(this)}isDestroyed(){return!1}};function gee(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 bgt(e){let t=xgt(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(XTe(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(Ogt(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 xgt(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(Dgt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function XTe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":KTe(e.coordinates,t.points);return;case"MultiPoint":Egt(e.coordinates,t.points);return;case"LineString":$Te(e.coordinates,t.polylines);return;case"MultiLineString":Cgt(e.coordinates,t.polylines);return;case"Polygon":JTe(e.coordinates,t.polygons);return;case"MultiPolygon":vgt(e.coordinates,t.polygons);return;case"GeometryCollection":Tgt(e.geometries,t);return;default:return}}function Tgt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)XTe(e[n],t)}function KTe(e,t){let n=yee(e);l(n)&&t.push(n)}function Egt(e,t){for(let n=0;n<e.length;n++)KTe(e[n],t)}function $Te(e,t){let n=Sgt(e);l(n)&&n.length>=2&&t.push(n)}function Cgt(e,t){for(let n=0;n<e.length;n++)$Te(e[n],t)}function JTe(e,t){let n=wgt(e);l(n)&&t.push(n)}function vgt(e,t){for(let n=0;n<e.length;n++)JTe(e[n],t)}function Sgt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=yee(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function wgt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=Igt(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=hi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function Igt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=yee(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&Pgt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function yee(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 Pgt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Dgt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function ZTe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var Rgt=new h;function YTe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=ZTe(e[o],t,Rgt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function Ogt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var QTe=_ee;function Mgt(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 N8=Mgt;var Ngt=new U;function Lgt(e,t){let n=e.unionClippingRegions,i=e.length,r=Is.useFloatTexture(t),o=Is.getTextureResolution(e,t,Ngt),s=o.x,a=o.y,c=r?kgt(s,a):Ugt(s,a);return c+=` -`,c+=n?Fgt(i):Bgt(i),c}function Fgt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +vec3 position; +vec3 direction; +if (czm_orthographicIn3D == 1.0) { - 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; +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); } -`}function Bgt(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 kgt(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) +else { - 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); +position = vec3(0.0); +direction = normalize(positionEC.xyz); } -`}function Ugt(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) +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)) { - 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); +out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); +} +else +{ +discard; } -`}var $v=Lgt;function zgt(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 L8=zgt;function Vgt(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 F8=Vgt;var eEe={NONE:0,LERC:1};Object.freeze(eEe);var Zh=eEe;function wp(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(wp.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 tEe=new h;wp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,tEe);return bee(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};wp.prototype.isScaledSpacePointVisible=function(e){return bee(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var jgt=new h;wp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=jgt,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),bee(e,r,i)};wp.prototype.computeHorizonCullingPoint=function(e,t,n){return rEe(this._ellipsoid,e,t,n)};var nEe=ee.clone(ee.UNIT_SPHERE);wp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=iEe(this._ellipsoid,n,nEe);return rEe(r,e,t,i)};wp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return oEe(this._ellipsoid,e,t,n,i,r)};wp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=iEe(this._ellipsoid,r,nEe);return oEe(s,e,t,n,i,o)};var Hgt=[];wp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,Hgt),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var Ggt=new h;function iEe(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,Ggt);e=ee.fromCartesian3(i,n)}return e}function rEe(e,t,n,i){l(i)||(i=new h);let r=cEe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=sEe(e,c,r);if(u<0)return;o=Math.max(o,u)}return aEe(r,o,i)}var B8=new h;function oEe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=cEe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){B8.x=n[c]+r.x,B8.y=n[c+1]+r.y,B8.z=n[c+2]+r.z;let f=sEe(e,B8,s);if(f<0)return;a=Math.max(a,f)}return aEe(s,a,o)}function bee(e,t,n){let i=t,r=n,o=h.subtract(e,i,tEe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var Wgt=new h,qgt=new h;function sEe(e,t,n){let i=e.transformPositionToScaledSpace(t,Wgt),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,qgt);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 aEe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var Aee=new h;function cEe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,Aee),h.normalize(Aee,Aee))}var Ip=wp;var lEe={NONE:0,BITS12:1};Object.freeze(lEe);var oc=lEe;var j1=new h,Ygt=new h,Ld=new U,Xgt=new M,Kgt=new M,$gt=Math.pow(2,12);function xc(e,t,n,i,r,o,s,a,c,u){let f=oc.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,Ygt),A=i-n;Math.max(h.maximumComponent(y),A)<$gt-1?f=oc.BITS12:f=oc.NONE;let x=M.fromScale(y,Xgt);x=M.setTranslation(x,g,x);let T=M.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,j1),Kgt);T=M.multiplyByTranslation(T,h.negate(g,j1),T),p=M.clone(r,new M);let E=M.getTranslation(r,j1);E=h.subtract(E,e,j1),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()}xc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===oc.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,j1),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,Ld);let p=cn.compressTextureCoordinates(Ld);U.fromElements(n.z,d,Ld);let g=cn.compressTextureCoordinates(Ld);U.fromElements(c,u,Ld);let m=cn.compressTextureCoordinates(Ld);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Ld);let y=cn.compressTextureCoordinates(Ld);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 Jgt=new h,uEe=new h;xc.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,Jgt),c=n.geodeticSurfaceNormal(a,uEe),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};xc.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]}};xc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===oc.BITS12){let i=cn.decompressTextureCoordinates(e[t],Ld);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Ld);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)};xc.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,uEe),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};xc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===oc.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};xc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===oc.BITS12?cn.decompressTextureCoordinates(e[t+1],Ld).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};xc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===oc.BITS12?cn.decompressTextureCoordinates(e[t+3],Ld).x:e[t+6]};xc.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)};xc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};xc.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};xc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===oc.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 k8={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},U8={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};xc.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===oc.NONE){s(k8.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(k8.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(k8.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(U8.compressed0,a?4:3),c&&s(U8.compressed1,1),this.hasGeodeticSurfaceNormals&&s(U8.geodeticSurfaceNormal,3)}return o};xc.prototype.getAttributeLocations=function(){return this.quantization===oc.NONE?k8:U8};xc.clone=function(e,t){if(l(e))return l(t)||(t=new xc),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 wo=xc;var Pp={};Pp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var xee=new h,Zgt=new M,Qgt=new h,e_t=new h;Pp.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??Pp.DEFAULT_STRUCTURE,D=w.heightScale??Pp.DEFAULT_STRUCTURE.heightScale,N=w.heightOffset??Pp.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??Pp.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??Pp.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??Pp.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??Pp.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,Zgt),we,ve;R&&(we=xi.geodeticLatitudeToMercatorAngle(T),ve=1/(xi.geodeticLatitudeToMercatorAngle(v)-we));let Re=Qgt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=e_t;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,pi;R&&(pi=(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,ub=$r*Om,ii=new h;ii.x=Es+Mc*Fn,ii.y=Ha+qf*Fn,ii.z=ub+zs*Fn,M.multiplyByPoint(ge,ii,xee),h.minimumByComponent(xee,Re,Re),h.maximumByComponent(xee,Qe,Qe),He=Math.min(He,Fn),qe[Ir]=ii,vt[Ir]=new U(Fi,Ki),st[Ir]=Fn,R&&(jt[Ir]=pi),C&&(lt[Ir]=m.geodeticSurfaceNormal(ii))}}let Li=ue.fromPoints(qe),Yn;l(b)&&(Yn=en.fromRectangle(b,Ae,fe,m));let yi;I&&(yi=new Ip(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let zi=new ud(Re,Qe,S),Si=new wo(S,zi,He,fe,xe,!1,R,C,O,L),ui=new Float32Array(Pe*Si.stride),Ai=0;for(let zn=0;zn<Pe;++zn)Ai=Si.encode(ui,Ai,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:yi}};var H1=Pp;function Yy(){pe.throwInstantiationError()}Object.defineProperties(Yy.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});Yy.prototype.interpolateHeight=pe.throwInstantiationError;Yy.prototype.isChildAvailable=pe.throwInstantiationError;Yy.prototype.createMesh=pe.throwInstantiationError;Yy.prototype.upsample=pe.throwInstantiationError;Yy.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;Yy.maximumAsynchronousTasks=5;var Ef=Yy;var t_t=3,Eee=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new Cee}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&r_t(this,n);let s=this._inverseTransform,a=i_t;a.origin=M.multiplyByPoint(s,t.origin,a.origin),a.direction=M.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return dEe(this._rootNode,a,c),l_t(this,c,t,i,r,o)}},n_t=new Kn("incrementallyBuildTerrainPicker"),Cee=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=fEe(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=fEe(n.x,n.y,n.level),this.children[t]=n}},i_t=new gn,z8=[new h,new h,new h];function r_t(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 o_t=new h,s_t=new h;function fEe(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,o_t),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,s_t);return ud.fromCorners(r,o)}function a_t(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 c_t=new Ws;function dEe(e,t,n){let i=Ti.rayAxisAlignedBoundingBox(t,e.aabb,c_t);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Ws(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)dEe(e.children[o],t,n)}function l_t(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=u_t(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 u_t(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>=t_t)&&!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=Tee(a,r,o,t,u,c[3*A],z8[0]),x=Tee(a,r,o,t,u,c[3*A+1],z8[1]),T=Tee(a,r,o,t,u,c[3*A+2],z8[2]),E=Ti.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&a_t(g,m,z8,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);d_t(e._inverseTransform,n,m,g)}return s}var f_t=new he;function Tee(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,f_t);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 d_t(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=n_t.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 V8=Eee;function G1(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 V8(t,n,p)}G1.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?h_t(this,this._transform):b_t(this,t,this._transform))};function h_t(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,vee).z<=P.EPSILON16&&(vee.z=1,M.setScale(t,vee,t)),t}var m_t=new h,p_t=new h,g_t=new he,__t=new he,y_t=new h,A_t=new h,vee=new h;function b_t(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,g_t),m_t),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,__t),p_t),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,y_t),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,A_t);return M.fromTranslation(d,n),M.setScale(n,f,n),M.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}G1.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};G1.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};G1.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var Tc=G1;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??Zh.NONE;let t=H1.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===Zh.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 hEe="createVerticesFromHeightmap",x_t=new Kn(hEe),T_t=new Kn(hEe,Ef.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?T_t:x_t).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 Hi,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=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new Tc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),wo.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=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=H1.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 Hi,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new Tc(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===Zh.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=mEe(A,b,f,d,e,i,r,t,n)}else y=E_t(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=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)),_=mEe(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,C_t(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 E_t(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=j8(e,t,n,i,r,m*s+p),T=j8(e,t,n,i,r,m*s+g),E=j8(e,t,n,i,r,y*s+p),v=j8(e,t,n,i,r,y*s+g);return pEe(A,b,x,T,E,v)}function mEe(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 pEe(y,A,b,x,T,E)}function pEe(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function j8(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 C_t(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 al=Mg;function Jv(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ir({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(Jv.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(){}}});Jv.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new al({buffer:new Uint8Array(256),width:16,height:16}))};Jv.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Jv.prototype.getTileDataAvailable=function(e,t,n){};Jv.prototype.loadTileDataAvailability=function(e,t,n){};var Ng=Jv;var H8=`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 -#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) +czm_writeLogDepth(); +} +`;var c5=`in vec4 position; +out vec4 positionEC; +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); +positionEC = czm_modelView * position; +gl_Position = czm_projection * positionEC; +czm_vertexLogDepth(); } -#endif -#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) -vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) +`;function iM(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 nM=dn.supportsTypedArrays()?new Float32Array(12):[],MNe=new h,NNe=new h,Noe=new h,LNe=new h,l5=new h;function zLt(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,MNe),g=h.normalize(p,NNe),m=h.normalize(h.cross(h.UNIT_Z,p,Noe),Noe),y=h.normalize(h.cross(g,m,LNe),LNe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,MNe);let x=b/A;o=h.multiplyByScalar(m,x,NNe),s=h.multiplyByScalar(y,x,Noe)}let a=h.add(r,s,l5);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,nM,0);let c=h.subtract(r,s,l5);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,nM,3);let u=h.add(r,s,l5);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,nM,6);let f=h.subtract(r,s,l5);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,nM,9),nM}iM.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 ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Xe({sources:[c5]}),a=new Xe({sources:[a5]});r&&(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 o=zLt(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}};iM.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};iM.prototype.isDestroyed=function(){return!1};iM.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var u5=iM;function zT(){}var VLt=/\bgl_FragDepth\b/,jLt=/\bdiscard\b/;function HLt(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(VLt.test(o[a])||jLt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() { -return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); + out_FragColor = vec4(1.0); } -#endif -#ifdef TRANSLUCENT -bool inTranslucencyRectangle() +`;i=new Xe({sources:[a]})}else if(!r&&s){let a=`void main() { -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; + out_FragColor = vec4(1.0); + czm_writeLogDepth(); } -#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) +`;i=new Xe({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function GLt(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}zT.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=HLt(n,t.shaderProgram),i.depthOnlyCommand.renderState=GLt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var WLt=/\s+czm_writeLogDepth\(/,qLt=/\s+czm_vertexLogDepth\(/;function YLt(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(qLt.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() { -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; + czm_log_depth_main(); + czm_vertexLogDepth(); } -else if (split > 0.0 && gl_FragCoord.x < splitPosition) { -alpha = 0.0; +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)WLt.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(); } -#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)); +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}zT.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=YLt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function XLt(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 () +{ + 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 Loe(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}zT.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=XLt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Loe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var KLt=`uint rgba8UnormToUint32(vec4 c) +{ + uvec4 b = uvec4(c * 255.0 + 0.5); + return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -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() +`;function $Lt(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=`${KLt} +void main () { -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) + 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})}zT.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=$Lt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Loe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function lI(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 JLt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function FNe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function BNe(e,t){let n=Ft.getMaximum(t);return`(${e}) / float(${n})`}function ZLt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=FNe(n,i,r)}return e.normalized||(n=BNe(n,e.componentType)),n}function QLt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=FNe(r,o,s)}return e.normalized||(r=BNe(r,e.componentType)),r}function eFt(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=JLt(u);if(p===1)d[0]=ZLt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=QLt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Ad.METADATA_PICKING_ENABLED),lI(g,Ad.METADATA_PICKING_VALUE_TYPE,f),lI(g,Ad.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),lI(g,Ad.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),lI(g,Ad.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),lI(g,Ad.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),lI(g,Ad.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})}zT.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=eFt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Loe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function tFt(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})}zT.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=tFt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var d0=zT;function f5(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 nFt=new Le,kNe=new Le,iFt=new $;function rFt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,kNe),c=Le.fromAxisAngle(o,i,nFt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,kNe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,iFt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}f5.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;rFt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};f5.prototype.isDestroyed=function(){return!1};f5.prototype.destroy=function(){return this._removeListener(),le(this)};var d5=f5;function oFt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var UNe=oFt;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 hi({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,le(this)};var h5=KA;var rM=`uniform vec3 u_radii; +uniform vec3 u_oneOverEllipsoidRadiiSquared; +in vec3 v_positionEC; +vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) { -direction = vec3(0.0, 0.0, -1.0); +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 } -else +void main() { -direction = normalize(vec3(xy, -czm_currentFrustum.x)); +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; } -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; +if (t1 < 0.0 && t2 < 0.0) { +discard; } -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) +float t = min(t1, t2); +if (t < 0.0) { +t = 0.0; +} +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; } +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 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; +} +`;var oM=`in vec3 position; +uniform vec3 u_radii; +out vec3 v_positionEC; +void main() +{ +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(); +} +`;var Foe={position:0};function m5(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 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??ir.fromType(ir.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 sFt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=kc.createGeometry(kc.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}m5.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?nn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=sFt(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),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 c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Xe({sources:[oM]}),p=new Xe({sources:[this.material.shaderSource,rM]}),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=en.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=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 Xe({sources:[oM]}),p=new Xe({sources:[this.material.shaderSource,rM],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=en.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=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)}};m5.prototype.isDestroyed=function(){return!1};m5.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(),le(this)};var p5=m5;var g5=`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 -#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); +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 -float nightBlend = 0.0; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #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 _5=`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() { -cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; +vec4 p = czm_computePosition(); +v_positionMC = position3DHigh + position3DLow; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -else if (czm_sceneMode == czm_sceneModeColumbusView) +`;function VT(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??_5,this._fragmentShaderSource=e.fragmentShaderSource??g5,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(VT.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 VT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});VT.VERTEX_FORMAT=Be.POSITION_AND_ST;VT.prototype.getFragmentShaderSource=Dr.prototype.getFragmentShaderSource;VT.prototype.isTranslucent=Dr.prototype.isTranslucent;VT.prototype.getRenderState=Dr.prototype.getRenderState;var zNe=VT;var aFt=1e5;function sM(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:aFt,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 QH({radius:this._radius,vertexFormat:Be.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),r=new ir({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Mn({geometryInstances:i,appearance:new Cr({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(sM.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)}}});sM.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};sM.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};sM.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var VNe=sM;function Boe(){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(Boe.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var cFt=new h;Boe.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,cFt),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 y5=Boe;function Ju(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Ju.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Ju.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Ju.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Ju.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Ju.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){lFt(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(){uFt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Ju.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Ju.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Ju({scene:e})),e._frameRateMonitor};Object.defineProperties(Ju.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}}});Ju.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Ju.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Ju.prototype.isDestroyed=function(){return!1};Ju.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function lFt(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 uFt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var A5=Ju;function fFt(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 b5=fFt;var Uoe=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=dFt(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 Af({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:YNe(m.points[b],r,u),pickObject:i?koe(this,x,this._points,tl,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:jNe(m.polylines[b],r,s),pickObject:i?koe(this,x,this._polylines,Ra,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:jNe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?koe(this,T,this._polygons,Lo,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=ls(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=ls(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),le(this)}isDestroyed(){return!1}};function koe(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 dFt(e){let t=hFt(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(HNe(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(CFt(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 hFt(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(TFt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function HNe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":GNe(e.coordinates,t.points);return;case"MultiPoint":pFt(e.coordinates,t.points);return;case"LineString":WNe(e.coordinates,t.polylines);return;case"MultiLineString":gFt(e.coordinates,t.polylines);return;case"Polygon":qNe(e.coordinates,t.polygons);return;case"MultiPolygon":_Ft(e.coordinates,t.polygons);return;case"GeometryCollection":mFt(e.geometries,t);return;default:return}}function mFt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)HNe(e[n],t)}function GNe(e,t){let n=zoe(e);l(n)&&t.push(n)}function pFt(e,t){for(let n=0;n<e.length;n++)GNe(e[n],t)}function WNe(e,t){let n=yFt(e);l(n)&&n.length>=2&&t.push(n)}function gFt(e,t){for(let n=0;n<e.length;n++)WNe(e[n],t)}function qNe(e,t){let n=AFt(e);l(n)&&t.push(n)}function _Ft(e,t){for(let n=0;n<e.length;n++)qNe(e[n],t)}function yFt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=zoe(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function AFt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=bFt(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=mi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function bFt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=zoe(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&xFt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function zoe(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 xFt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function TFt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function YNe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var EFt=new h;function jNe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=YNe(e[o],t,EFt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function CFt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var XNe=Uoe;function vFt(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 x5=vFt;var SFt=new U;function wFt(e,t){let n=e.unionClippingRegions,i=e.length,r=Ps.useFloatTexture(t),o=Ps.getTextureResolution(e,t,SFt),s=o.x,a=o.y,c=r?DFt(s,a):RFt(s,a);return c+=` +`,c+=n?IFt(i):PFt(i),c}function IFt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -cameraDist = -czm_view[3].z; + 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; } -else +`}function PFt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { -cameraDist = length(czm_view[3]); -} -float fadeOutDist = u_lightingFadeDistance.x; -float fadeInDist = u_lightingFadeDistance.y; -if (czm_sceneMode != czm_sceneMode3D) { -vec3 radii = czm_ellipsoidRadii; -float maxRadii = max(radii.x, max(radii.y, radii.z)); -fadeOutDist -= maxRadii; -fadeInDist -= maxRadii; + 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 DFt(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); } -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) +`}function RFt(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) { -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); + 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); } +`}var uI=wFt;function OFt(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 T5=OFt;function MFt(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 E5=MFt;var C5=`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_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; +#ifdef APPLY_SPLIT +uniform float u_dayTextureSplit[TEXTURE_UNITS]; #endif -czm_material material = czm_getMaterial(materialInput); -vec4 materialColor = vec4(material.diffuse, material.alpha); -color = alphaBlend(materialColor, color); +#ifdef APPLY_BRIGHTNESS +uniform float u_dayTextureBrightness[TEXTURE_UNITS]; #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; +#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 ENABLE_CLIPPING_PLANES -vec4 clippingPlanesEdgeColor = vec4(1.0); -clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; -float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; -if (clipDistance < clippingPlanesEdgeWidth) -{ -finalColor = clippingPlanesEdgeColor; -} +#ifdef APPLY_GAMMA +uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; #endif -#ifdef ENABLE_CLIPPING_POLYGONS -bool insideAny = vectorClip(v_textureCoordinates.xy); -#ifdef CLIPPING_INVERSE -if (!insideAny) { -discard; -} -#else -if (insideAny) { -discard; -} +#ifdef APPLY_IMAGERY_CUTOUT +uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; #endif +#ifdef APPLY_COLOR_TO_ALPHA +uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; #endif -#ifdef HIGHLIGHT_FILL_TILE -finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); +uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; #endif -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) -vec3 atmosphereLightDirection = czm_sunDirectionWC; -#else -vec3 atmosphereLightDirection = czm_lightDirectionWC; +#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 -#if defined(GROUND_ATMOSPHERE) || defined(FOG) -if (!czm_backFacing()) -{ -bool dynamicLighting = false; -#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) -dynamicLighting = true; +#ifdef SHOW_OCEAN_WAVES +uniform sampler2D u_oceanNormalMap; #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; +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +uniform vec2 u_lightingFadeDistance; #endif -#ifdef COLOR_CORRECT -const bool ignoreBlackPixels = true; -rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels); -mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels); +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_cartographicLimitRectangle; #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; +#ifdef GROUND_ATMOSPHERE +uniform vec2 u_nightFadeDistance; #endif -#ifndef HDR -fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb); -fogColor.rgb = czm_inverseGamma(fogColor.rgb); +#ifdef ENABLE_CLIPPING_PLANES +uniform highp sampler2D u_clippingPlanes; +uniform mat4 u_clippingPlanesMatrix; +uniform vec4 u_clippingPlanesEdgeStyle; #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); +#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) +uniform float u_minimumBrightness; #endif -#ifndef HDR -finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); -#else -finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); +#ifdef COLOR_CORRECT +uniform vec3 u_hsbShift; #endif -finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); +#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 -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); -} +uniform vec4 u_undergroundColor; +uniform vec4 u_undergroundColorAlphaByDistance; #endif -#ifdef HAS_VECTOR_LAYER -finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); -finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); +#ifdef ENABLE_VERTEX_LIGHTING +uniform float u_lambertDiffuseMultiplier; +uniform float u_vertexShadowDarkness; #endif -#ifdef TRANSLUCENT -if (inTranslucencyRectangle()) +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) { -vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; -finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); +float startDistance = nearFarScalar.x; +float startValue = nearFarScalar.y; +float endDistance = nearFarScalar.z; +float endValue = nearFarScalar.w; +float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); +return mix(startValue, endValue, t); } #endif -out_FragColor = finalColor; -} -#ifdef SHOW_REFLECTIVE_OCEAN -float waveFade(float edge0, float edge1, float x) +#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) +vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { -float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); -return pow(1.0 - y, 5.0); +return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } -float linearFade(float edge0, float edge1, float x) +#endif +#ifdef TRANSLUCENT +bool inTranslucencyRectangle() { -return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.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; } -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); +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) +{ +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 -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; +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 -return vec4(color, imageryColor.a); -} -#endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var G8=`#ifdef QUANTIZATION_BITS12 -in vec4 compressed0; -in float compressed1; +#if !defined(APPLY_GAMMA) +vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); +color = tempColor.rgb; +alpha = tempColor.a; #else -in vec4 position3DAndHeight; -in vec4 textureCoordAndEncodedNormals; +color = pow(color, vec3(textureOneOverGamma)); #endif -#ifdef GEODETIC_SURFACE_NORMALS -in vec3 geodeticSurfaceNormal; +#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 EXAGGERATION -uniform vec2 u_verticalExaggerationAndRelativeHeight; +#ifdef APPLY_BRIGHTNESS +color = mix(vec3(0.0), color, textureBrightness); #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; +#ifdef APPLY_CONTRAST +color = mix(vec3(0.5), color, textureContrast); #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) -out float v_distance; +#ifdef APPLY_HUE +color = czm_hue(color, textureHue); #endif -#if defined(FOG) || defined(GROUND_ATMOSPHERE) -out vec3 v_atmosphereRayleighColor; -out vec3 v_atmosphereMieColor; -out float v_atmosphereOpacity; +#ifdef APPLY_SATURATION +color = czm_saturation(color, textureSaturation); #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); +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)); } -float get2DMercatorYPositionFraction(vec2 textureCoordinates) +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() { -const float maxTileWidth = 0.003068; -float positionFraction = textureCoordinates.y; -float southLatitude = u_southAndNorthLatitude.x; -float northLatitude = u_southAndNorthLatitude.y; -if (northLatitude - southLatitude > maxTileWidth) +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 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); +direction = vec3(0.0, 0.0, -1.0); } -return positionFraction; +else +{ +direction = normalize(vec3(xy, -czm_currentFrustum.x)); } -float get2DGeographicYPositionFraction(vec2 textureCoordinates) +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() { -return textureCoordinates.y; +#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; } -vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +#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)) { -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; +color = vec4(1.0, 0.0, 0.0, 1.0); } -vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +#endif +#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) +float cameraDist; +if (czm_sceneMode == czm_sceneMode2D) { -return getPositionPlanarEarth(position, 0.0, textureCoordinates); +cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; } -vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +else if (czm_sceneMode == czm_sceneModeColumbusView) { -return getPositionPlanarEarth(position, height, textureCoordinates); +cameraDist = -czm_view[3].z; } -vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +else { -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; +cameraDist = length(czm_view[3]); } -#ifdef QUANTIZATION_BITS12 -uniform vec2 u_minMaxHeight; -uniform mat4 u_scaleAndBias; +float fadeOutDist = u_lightingFadeDistance.x; +float fadeInDist = u_lightingFadeDistance.y; +if (czm_sceneMode != czm_sceneMode3D) { +vec3 radii = czm_ellipsoidRadii; +float maxRadii = max(radii.x, max(radii.y, radii.z)); +fadeOutDist -= maxRadii; +fadeInDist -= maxRadii; +} +float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); +#else +float fade = 0.0; #endif -void main() +#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) { -#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; +mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); +vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC); +vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx); +vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); +color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); +} #endif -#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 +#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 -vec3 position3DWC = position + u_center3D; -#ifdef GEODETIC_SURFACE_NORMALS -vec3 ellipsoidNormal = geodeticSurfaceNormal; +#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 -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; +vec4 finalColor = color; #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); +#ifdef ENABLE_CLIPPING_PLANES +vec4 clippingPlanesEdgeColor = vec4(1.0); +clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; +float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; +if (clipDistance < clippingPlanesEdgeWidth) +{ +finalColor = clippingPlanesEdgeColor; +} #endif -v_normalMC = normalMC; -v_normalEC = czm_normal3D * v_normalMC; +#ifdef ENABLE_CLIPPING_POLYGONS +bool insideAny = vectorClip(v_textureCoordinates.xy); +#ifdef CLIPPING_INVERSE +if (!insideAny) { +discard; +} +#else +if (insideAny) { +discard; +} #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 +#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 -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; +#if defined(GROUND_ATMOSPHERE) || defined(FOG) +if (!czm_backFacing()) +{ +bool dynamicLighting = false; +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) +dynamicLighting = true; #endif -} -`;var W1=`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), +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, -atmosphereInnerRadius, rayleighColor, mieColor, opacity ); -} -`;var See=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}},wee=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===oc.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($v(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(Ty);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(v_t(Ye)),jt.sources.push(S_t(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:jt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[Ke]=new See(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 le(this)}};function v_t(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 S_t(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var W8=wee;var gEe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(gEe);var Zo=gEe;var _Ee={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(_Ee);var sc=_Ee;var yEe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(yEe);var kr=yEe;var Dp=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 ue,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!==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)&&(Rs.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(il.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===sc.START&&(w_t(t,n,i,r),t.state=sc.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===sc.LOADING&&I_t(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=sc.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){AEe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){AEe(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 AEe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=wo.clone(s);c.hasGeodeticSurfaceNormals=t,c=wo.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?(Dp._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Dp._createVertexArrayForMesh(i.context,r)):(Dp._freeVertexArray(e.vertexArray),e.vertexArray=Dp._createVertexArrayForMesh(i.context,r)),Dp._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function w_t(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 I_t(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||Dp.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&P_t(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&D_t(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&O_t(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(M_t(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)L_t(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 P_t(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=sc.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 D_t(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===wi.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=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=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 R_t={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function O_t(e,t,n,i,r,o){let s=n.tilingScheme,a=R_t;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 M_t(e,t,n,i,r,o,s){e.vertexArray=Dp._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function N_t(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:$n.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function L_t(e,t){let n=t.terrainData.waterMask,i=N_t(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 Qh=Dp;var F_t={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=F_t;var bEe={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>=bEe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=bEe;function Qv(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}Qv.prototype.update=function(e,t,n){this.changedThisFrame&&(wEe(e,t,this.tile,n),this.changedThisFrame=!1)};Qv.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};Qv.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Qh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var B_t=new Qb;Qv.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=B_t;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);Aa(e,n,c,u,s,In.EAST,!1,a,i),Aa(e,n,c,f,s,In.NORTH,!1,a,i),Aa(e,n,c,d,s,In.WEST,!1,a,i),Aa(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);Aa(e,n,c,g,s,In.SOUTHEAST,!1,a,i),Aa(e,n,c,y,s,In.SOUTHWEST,!1,a,i),Aa(e,n,c,m,s,In.NORTHEAST,!1,a,i),Aa(e,n,c,A,s,In.NORTHWEST,!1,a,i),c=a.dequeue()}};function Aa(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||gi.wasKicked(u._lastSelectionResult)||gi.originalResult(u._lastSelectionResult)===gi.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===gi.RENDERED){if(l(u.data.vertexArray))return;k_t(e,t,n,u,o,r,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.CULLED)switch(o){case In.WEST:Aa(e,t,n,i.northwestChild,r,o,!0,a,c),Aa(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.EAST:Aa(e,t,n,i.southeastChild,r,o,!0,a,c),Aa(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTH:Aa(e,t,n,i.southwestChild,r,o,!0,a,c),Aa(e,t,n,i.southeastChild,r,o,!0,a,c);break;case In.NORTH:Aa(e,t,n,i.northeastChild,r,o,!0,a,c),Aa(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHWEST:Aa(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHEAST:Aa(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTHWEST:Aa(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.SOUTHEAST:Aa(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function k_t(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new Qv(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),U_t(e,t,n,i,r,a)}function U_t(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(wEe(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 Ux=new he,z_t=new he,Zv=new h,Ree=new h,Iee=new U,Pee=new U,Cf=new U;function Z8(){this.height=0,this.encodedNormal=new U}function q8(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 IEe(e,t,n,i,u,c),c}var V_t={minimumHeight:0,maximumHeight:0},j_t=new h,xEe=new Z8,TEe=new Z8,EEe=new Z8,CEe=new Z8,H_t=typeof Uint8Array<"u"?new Uint8Array(81):void 0,G_t={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function wEe(e,t,n,i){Qh.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=X8(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,EEe),p=X8(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,xEe),g=X8(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,TEe),m=X8(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,CEe);d=q8(o,f,0,1,d,p,m,g,EEe),p=q8(o,f,0,0,p,d,g,m,xEe),g=q8(o,f,1,1,g,p,m,d,TEe),m=q8(o,f,1,1,m,g,d,p,CEe);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 al({width:9,height:9,buffer:H_t,structure:{heightOffset:E}}),D=G_t;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,z_t);D.height=v;let N=f.cartographicToCartesian(D,j_t),F=new wo(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=V_t;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=Y8(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=$8(o,f,F,G,q,o.westTiles,o.westMeshes,In.EAST,j);let W=q;q=Y8(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=$8(o,f,F,G,q,o.southTiles,o.southMeshes,In.NORTH,j);let J=q;q=Y8(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=$8(o,f,F,G,q,o.eastTiles,o.eastMeshes,In.WEST,j);let Z=q;q=Y8(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=$8(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(Ux,Ree),we=cn.octEncode(ge,Iee),ve=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,Cf),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 Tc(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),J_t(e,ae.center,s,T,E),F.stride,ae,F,st,vt,jt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Qh._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 Y8(e,t,n,i,r,o,s,a,c,u,f){let d=Ux;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,Zv),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,Ree));let m=Pee;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 J8=new ie;function q1(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,J8),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,J8),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 W_t=new U;function Dee(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 q_t=new U,Y_t=new h;function X_t(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=q1(t,n,f.decodeTextureCoordinates(d,r,Cf),Cf),g=q1(t,n,f.decodeTextureCoordinates(d,o,Pee),Pee),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;Ux.longitude=P.lerp(b.west,b.east,s),Ux.latitude=P.lerp(b.south,b.north,a),u.height=Ux.height=P.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,W_t),E=f.getOctEncodedNormal(d,o,q_t),v=cn.octDecode(T.x,T.y,Zv),S=cn.octDecode(E.x,E.y,Y_t);x=h.lerp(v,S,m,Zv),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(Ux,Zv),cn.octEncode(x,u.encodedNormal)}function IEe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(Ux,Zv);cn.octEncode(s,o.encodedNormal)}function X8(e,t,n,i,r,o,s,a,c,u,f){if(SEe(e,t,a,s,!1,n,i,f)||SEe(e,t,u,c,!0,n,i,f))return f;let p;if(Oee(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],Dee(o,p,n,i,f),f;let g;if(n===0?i===0?g=K8(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=K8(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=K8(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=K8(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return IEe(e,t,n,i,g,f),f}function K8(e,t,n,i,r,o,s,a){let c=vEe(e,t,!1,n,s,a),u=vEe(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function $8(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=K_t(e,t,n,i,r,o[u],s[u],a,c);return r}function K_t(e,t,n,i,r,o,s,a,c){let u;a===In.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,J8),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===In.WEST&&o.x===0&&(u=ie.clone(o.rectangle,J8),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,Cf),d=Cf.x,p=Cf.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,Cf);q1(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,Zv),N=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,Iee):(F=Iee,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,Ree)),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 vEe(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(!Oee(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 Oee(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function SEe(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(Oee(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,Cf);let y=q1(g,e.tile,Cf,Cf);if(y.x===o&&y.y===s)return Dee(m,p,o,s,a),!0;if(d=Dr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,Cf);let x=q1(g,e.tile,Cf,Cf);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 X_t(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return Dee(m,c[d],o,s,a),!0}return!1}var $_t=[new h,new h,new h,new h];function J_t(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=$_t;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 Y1=Qv;var Mee=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=Pn.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||(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(eyt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=Q_t(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(),ryt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)Qh._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:_c.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:_c.LESS_OR_EQUAL},blending:nn.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&&Y1.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&&tyt(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;nyt(this,g,m,t);let y=m.tileBoundingRegion;Iyt(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),MEe(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===gi.CULLED_BUT_NEEDED,o=i.terrainState),Qh.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)!==Zo.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,Qh.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=LEe(this,n);if(n.fog.enabled&&!o&&P.fog(r,n.fog.density)>=1)return Zo.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Zo.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=ej(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,NEe);if(!l(d))return Zo.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=oyt,ue.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=ue.union(a.boundingSphere,u,u))),!l(u))return Zo.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 Zo.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=Zo.NONE:y===$t.INTERSECTING?m=Zo.PARTIAL:y===$t.INSIDE&&(m=Zo.FULL),m===Zo.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof pn;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:Zo.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=cyt;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===jn.FAILED||p.state===jn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=lyt;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:gi.NONE;if(p===gi.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===jn.FAILED||A.state===jn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===gi.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,uyt),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){yyt(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(),le(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]=Ayt(p,t,i),a.state=sc.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=sc.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==gi.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)}},Z_t=new ie;function Q_t(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,Z_t).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function eyt(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 tyt(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 nyt(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 iyt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function ryt(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 MEe(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 oyt=new ue,NEe=new ie,syt=new ie,ayt=new he;function ej(e,t){if(t.west<t.east)return t;let n=ie.clone(t,syt);return ie.center(e,ayt).longitude>0?n.east=P.PI:n.west=-P.PI,n}function LEe(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 cyt=[],lyt=[],uyt=new h,PEe=new M,Q8=new M,fyt=new se,dyt=new se,hyt=new se,myt=new h,DEe=new h,pyt=new h,gyt=new h,_yt=[new h,new h,new h,new h];function REe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=_yt;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 yyt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Qh);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Pd({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=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=REe(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=REe(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 Ayt(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 byt=new M,xyt=new M;function OEe(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,DEe);return M.setTranslation(i,r,PEe),PEe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=M.multiplyByPoint(i,this.properties.rtc,DEe);return M.setTranslation(i,o,Q8),M.multiply(r,Q8,Q8),Q8},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,byt):M.IDENTITY;return M.inverseTranspose(r,xyt)},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)?Ot(n,t.materialUniformMap):n}function Tyt(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=Eyt(e,r,i),n.wireframeVertexArray.mesh=i}}function Eyt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};qn.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 FEe,BEe,tj;(function(){let e=new Bt({geometry:Tp.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new By({radius:1})}),n=new M,i,r;function o(s){return new Nn({geometryInstances:s,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}FEe=function(s,a){return s===i||(tj(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},BEe=function(s,a){return s===i||(tj(),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},tj=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Cyt=new se(0,0,0,0),vyt={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},Syt=z.TRANSPARENT,wyt=new qt;function Iyt(e,t,n){let i=t.data;if(iyt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new Y1(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??Syt,A=e.undergroundColorAlphaByDistance??wyt,b=LEe(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=Pn.castShadows(e.shadows)&&!d,w=Pn.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=fyt,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),pyt),Yt=mt.project(ie.northeast(t.rectangle),gyt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Yt.x,ae.w=Yt.y,n.mode!==re.MORPHING&&(k=myt,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===oc.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=vyt;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)||tj(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=OEe(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 ue,ft.orientedBoundingBox=void 0,Yt=OEe(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)?FEe(Es,z.RED).update(n):l(Ha)&&BEe(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 yi=dyt,zi=ej(t.rectangle,e.cartographicLimitRectangle),Si=hyt,ui=ej(t.rectangle,m);h.fromElements(D,N,F,rt.hsbShift);let Ai=t.rectangle,zn=1/Ai.width,tn=1/Ai.height;yi.x=(zi.west-Ai.west)*zn,yi.y=(zi.south-Ai.south)*tn,yi.z=(zi.east-Ai.west)*zn,yi.w=(zi.north-Ai.south)*tn,se.clone(yi,rt.localizedCartographicLimitRectangle),Si.x=(ui.west-Ai.west)*zn,Si.y=(ui.south-Ai.south)*tn,Si.z=(ui.east-Ai.west)*zn,Si.w=(ui.north-Ai.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,pi=!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 ub=Es.useWebMercatorT?Ha.textureWebMercator:Ha.texture,ii=Ha.imageryLayer;l(Es.textureTranslationAndScale)||(Es.textureTranslationAndScale=ii._calculateTextureTranslationAndScale(t,Es)),rt.dayTextures[mt]=ub,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,pi=pi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ii.dayAlpha,pi=pi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ii.brightness,Ki=Ki||rt.dayTextureBrightness[mt]!==Ms.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ii.contrast,wr=wr||rt.dayTextureContrast[mt]!==Ms.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ii.hue,so=so||rt.dayTextureHue[mt]!==Ms.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ii.saturation,Ts=Ts||rt.dayTextureSaturation[mt]!==Ms.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ii.gamma,zs=zs||rt.dayTextureOneOverGamma[mt]!==1/Ms.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=ej(Ai,ii.cutoutRectangle),Mm=ie.simpleIntersection(Ca,Ai,NEe);nr=l(Mm)||nr,Wr.x=(Ca.west-Ai.west)*zn,Wr.y=(Ca.south-Ai.south)*tn,Wr.z=(Ca.east-Ai.west)*zn,Wr.w=(Ca.north-Ai.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,b_=Ca.length;Mm<b_;++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=pi,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&&(Tyt(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?(ue.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&&ue.union(q.boundingSphere,na,na)):(ft.boundingVolume=ue.clone(q.boundingSphere,na),ft.orientedBoundingBox=en.clone(q.boundingVolume,Om)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),MEe(ft,n),st=qe,vt=Cyt}while(Qe<He)}var nj=Mee;function kEe(){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(kEe.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 ij=kEe;var Nee=class{constructor(t){this._ellipsoid=new Ip(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},rj=Nee;var Lee=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()}},Pyt=1e3,Fee=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=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new Lee(Pyt),this.state=sc.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 Ryt(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];if(!l(o))continue;i.add(o);let s=UEe(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=UEe(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._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<sc.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=sc.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),oj(this._southwestChild),this._southwestChild=void 0,oj(this._southeastChild),this._southeastChild=void 0,oj(this._northwestChild),this._northwestChild=void 0,oj(this._northeastChild),this._northeastChild=void 0}},Dyt=256;function Ryt(e,t,n,i){let r=n.width/Dyt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var Oyt=new he;function UEe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,Oyt),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 oj(e){l(e)&&e.freeResources()}var sj=Fee;function aj(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}aj.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};aj.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(),zEe(this,t)),t=i}};function zEe(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}aj.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))&&zEe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var cj=aj;function Fd(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 cj,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 rj({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Fd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Fd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Myt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,jEe(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()}Fd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==sc.START&&e(t),t=t.replacementNext};Fd.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Fd.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};Fd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function jEe(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}Fd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Myt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),jEe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Fd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Byt(this,e),Yyt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Nyt(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))}Fd.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(Hyt(this,e),qyt(this,e),Nyt(this,e))};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var K1,VEe=new he;function Lyt(e,t){let n=ie.center(e.rectangle,VEe),i=n.longitude-K1.longitude,r=n.latitude-K1.latitude;n=ie.center(t.rectangle,VEe);let o=n.longitude-K1.longitude,s=n.latitude-K1.latitude;return i*i+r*r-(o*o+s*s)}var Fyt=new h,X1=[];function Byt(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=sj.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(X1.length<g){X1=new Array(g);for(let m=0;m<g;++m)X1[m]===void 0&&(X1[m]=new $1)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;K1=t.camera.positionCartographic,o.sort(Lyt);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,Fyt);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?Ec(e,p,r,t,s,!1,X1[d]):(Lg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function Lg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function $1(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function HEe(){this.southwest=new $1,this.southeast=new $1,this.northwest=new $1,this.northeast=new $1}HEe.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 kee=new Array(31);for(let e=0;e<kee.length;++e)kee[e]=new HEe;function kyt(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=Vyt(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:gi.NONE,g=e.tileProvider;if(s||i){let m=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,A=n.state===sc.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&Lg(e,e._tileLoadQueueMedium,n,t),lj(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&Lg(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){lj(e,n),Lg(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===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(Uyt(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!==gi.KICKED&&_!==n;)_._lastSelectionResult=gi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,lj(e,n),n._lastSelectionResult=gi.RENDERED;let O=p===gi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,Lg(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&&Lg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,lj(e,n),Lg(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function Uyt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=kee[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ec(e,t,u,o,f,s,p),Ec(e,n,u,o,f,s,g),Ec(e,i,u,o,f,s,m),Ec(e,r,u,o,f,s,y)):(Ec(e,i,u,o,f,s,m),Ec(e,t,u,o,f,s,p),Ec(e,r,u,o,f,s,y),Ec(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Ec(e,n,u,o,f,s,g),Ec(e,t,u,o,f,s,p),Ec(e,r,u,o,f,s,y),Ec(e,i,u,o,f,s,m)):(Ec(e,r,u,o,f,s,y),Ec(e,i,u,o,f,s,m),Ec(e,n,u,o,f,s,g),Ec(e,t,u,o,f,s,p)),d.combine(a)}function zyt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ec(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==Zo.NONE)return kyt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,zyt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&Lg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(Lg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Vyt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof pn||t.camera.frustum instanceof ws)return jyt(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 jyt(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 lj(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function Hyt(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=Bee(e,t,s,o,n,!1);a=Bee(e,t,s,o,i,a),Bee(e,t,s,o,r,a)}function Gyt(e,t){return e._loadPriority-t._loadPriority}function Bee(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(Gyt);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 eS=new gn,uj=new he,Xy=new h,Wyt=[];function qyt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Wyt;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:gi.NONE;(A===gi.RENDERED||A===gi.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,eS.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,eS.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,Xy);h.subtract(A.positionOnEllipsoidSurface,O,eS.origin)}}else he.clone(A.positionCartographic,uj),uj.height=-11500,c.project(uj,Xy),h.fromElements(Xy.z,Xy.x,Xy.y,Xy),h.clone(Xy,eS.origin),h.clone(h.UNIT_X,eS.direction);T=d.data.pick(eS,a,c,!1,Xy),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,uj);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 Yyt(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 fj=Fd;function em(e){e=e??ee.default;let t=new Ng({ellipsoid:e}),n=new Lv,i=new My({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new W8,this._material=void 0,this._surface=new fj({tileProvider:new nj({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 ij,zee(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=Pn.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(em.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)&&zee(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,zee(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 zee(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[cp,W1];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(H8),e._surfaceShaderSet.baseVertexShaderSource=new Xe({sources:[cp,W1,G8],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Xe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Xyt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var Kyt=[],$yt={start:0,stop:0};em.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=Kyt;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=ue.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))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=Ti.raySphere(e,d,$yt);l(p)&&s.push(f)}s.sort(Xyt(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 Jyt=new he;em.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,Jyt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Zyt=new h,GEe=new h,Qyt=new he,eAt=new gn;function Uee(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}em.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=Uee(n._southwestChild,e)||Uee(n._southeastChild,e)||Uee(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,Zyt),u=eAt,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,GEe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,GEe);if(l(p))return a.cartesianToCartographic(p,Qyt).height};em.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};em.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))};em.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};em.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};em.prototype.isDestroyed=function(){return!1};em.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(),le(this)};var dj=em;var vf=`uniform sampler2D colorTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = texture(colorTexture, v_textureCoordinates); -} -`;var zx=`uniform highp sampler2D u_depthTexture; -in vec2 v_textureCoordinates; -void main() -{ -out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); -} -`;function Rp(){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(Rp.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 WEe(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:nn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.NEVER,reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(zx,{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(vf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(zx,{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(vf,{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 di({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Rp.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),WEe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};Rp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Rp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Rp.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),WEe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Rp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Rp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Rp.prototype.isDestroyed=function(){return!1};Rp.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()),le(this)};var hj=Rp;function Vx(){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(Vx.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 tAt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function nAt(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 iAt(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(zx,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new di({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}Vx.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;nAt(this,n,r,o,e),iAt(this,n,r,o,i),this._useHdr=e};Vx.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};Vx.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};Vx.prototype.isDestroyed=function(){return!1};Vx.prototype.destroy=function(){return tAt(this),le(this)};var mj=Vx;var ac={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},jx=ac.DERIVED_COMMANDS_MAXIMUM_LENGTH,tCe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function Hx(){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(jx),this._derivedBlendCommandTypes=new Array(jx),this._derivedPickCommandTypes=new Array(jx),this._derivedCommandTypesToUpdate=new Array(jx),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(Hx.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}}});Hx.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=qEe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=qEe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=YEe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=YEe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=aAt(this,e,t),this._sunVisibleThroughGlobe=rAt(this,e),this._environmentVisible=oAt(this,e),this._useDepthPlane=sAt(this,e),this._numberOfTextureUniforms=cAt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),lAt(this,e)};function qEe(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 YEe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function rAt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function oAt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function sAt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function aAt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function cAt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function lAt(e,t){e._derivedCommandsLength=Vee(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Vee(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Vee(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<jx;++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=CAt())}function Vee(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?ac.PICK_FRONT_FACE:u?ac.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ac.TRANSLUCENT_FRONT_FACE,d=i?ac.PICK_BACK_FACE:u?ac.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ac.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=ac.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=ac.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=ac.DEPTH_ONLY_BACK_FACE),r[o++]=ac.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=ac.DEPTH_ONLY_FRONT_FACE),r[o++]=ac.OPAQUE_BACK_FACE,r[o++]=f),o)}function Bd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function XEe(e,t){return e.indexOf(t)>-1}function uAt(e,t){Bd(e.defines,"TRANSLUCENT"),Bd(t.defines,"TRANSLUCENT")}function fAt(e,t){Bd(e.defines,"GROUND_ATMOSPHERE"),Bd(t.defines,"GROUND_ATMOSPHERE"),Bd(e.defines,"FOG"),Bd(t.defines,"FOG"),Bd(e.defines,"TRANSLUCENT"),Bd(t.defines,"TRANSLUCENT")}function jee(e,t){if(XEe(t.defines,"TILE_LIMIT_RECTANGLE")||XEe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() -{ - out_FragColor = vec4(1.0); -} -`;t.sources=[n]}function Hee(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 nCe(e,t){Hee(e,t),Bd(e.defines,"GROUND_ATMOSPHERE"),Bd(t.defines,"GROUND_ATMOSPHERE"),Bd(e.defines,"FOG"),Bd(t.defines,"FOG")}function dAt(e,t){Hee(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function hAt(e,t){nCe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function KEe(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 mAt(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 pAt(e){e.cull.face=ji.BACK,e.cull.enabled=!0}function gAt(e){e.cull.face=ji.FRONT,e.cull.enabled=!0}function _At(e){e.cull.face=ji.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function yAt(e){e.cull.face=ji.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function AAt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function $Ee(e){e.cull.face=ji.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function JEe(e){e.cull.face=ji.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function bAt(e){e.cull.face=ji.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function xAt(e){e.cull.face=ji.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function TAt(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 tS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function EAt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function tm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function CAt(){return[new tm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:uAt,getRenderStateFunction:pAt,getUniformMapFunction:void 0}),new tm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:fAt,getRenderStateFunction:gAt,getUniformMapFunction:void 0}),new tm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jee,getRenderStateFunction:_At,getUniformMapFunction:void 0}),new tm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jee,getRenderStateFunction:yAt,getUniformMapFunction:void 0}),new tm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:jee,getRenderStateFunction:AAt,getUniformMapFunction:void 0}),new tm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Hee,getRenderStateFunction:$Ee,getUniformMapFunction:tS}),new tm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:nCe,getRenderStateFunction:JEe,getUniformMapFunction:tS}),new tm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:dAt,getRenderStateFunction:$Ee,getUniformMapFunction:tS}),new tm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hAt,getRenderStateFunction:JEe,getUniformMapFunction:tS}),new tm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:KEe,getRenderStateFunction:bAt,getUniformMapFunction:tS}),new tm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:KEe,getRenderStateFunction:xAt,getUniformMapFunction:tS})]}var ZEe=new Array(jx),QEe=new Array(jx);Hx.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)QEe[r]=this._derivedCommandPacks[n[r]],ZEe[r]=tCe[n[r]];vAt(this,e,i,n,ZEe,QEe,t)}};function vAt(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=EAt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=mAt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=TAt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}Hx.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=tCe[r[a]];n.commandList.push(s[c])}};function iCe(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 eCe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var SAt=[ac.OPAQUE_FRONT_FACE,ac.OPAQUE_BACK_FACE],wAt=[ac.DEPTH_ONLY_FRONT_FACE,ac.DEPTH_ONLY_BACK_FACE,ac.DEPTH_ONLY_FRONT_AND_BACK_FACE];Hx.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),iCe(s,a,t,i,r,SAt))};Hx.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)&&eCe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,iCe(a,c,t,i,r,wAt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}eCe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var pj=Hx;var IAt=1953029805,PAt=2917034100;function Gee(e,t){if(Gee.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===IAt||r===PAt)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++}Gee.passThroughDataForTesting=!1;var gj=Gee;var LAt=js(Wee(),1);function DAt(e,t){return(e&t)!==0}var Bl=DAt;var RAt=[1,2,4,8],rCe=15,OAt=16,MAt=64,NAt=128;function Op(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}Op.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 Op(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Op.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Op.prototype.hasSubtree=function(){return Bl(this._bits,OAt)};Op.prototype.hasImagery=function(){return Bl(this._bits,MAt)};Op.prototype.hasTerrain=function(){return Bl(this._bits,NAt)};Op.prototype.hasChildren=function(){return Bl(this._bits,rCe)};Op.prototype.hasChild=function(e){return Bl(this._bits,RAt[e])};Op.prototype.getChildBitmask=function(){return this._bits&rCe};var _j=Op;function FAt(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 BAt=FAt(`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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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 Sf(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(Sf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Sf.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 Sf;i._resource=n;try{await kAt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${sCe(i,"",1).url}: ${r}`;throw new oe(o)}return i};Sf.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Bl(t,o)?Bl(e,o)&&(s|=1):(s|=2,Bl(e,o)||(s|=1)),i+=s}return i};Sf.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];Bl(s,2)?Bl(s,1)||(t|=o):(n|=o,Bl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Sf.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 oCe=new Kn("decodeGoogleEarthEnterprisePacket");Sf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=sCe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return oCe.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=_j.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}})})};Sf.prototype.populateSubtree=function(e,t,n,i){let r=Sf.tileXYToQuadKey(e,t,n);return Xee(this,r,i)};function Xee(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}),Xee(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}),Xee(e,t,s)}).finally(function(){delete a[r]})}Sf.prototype.getTileInformation=function(e,t,n){let i=Sf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Sf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function sCe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var qee,Yee;function kAt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Yee)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Yee=SE(n).then(function(){qee=window.cesiumGoogleEarthDbRootParser(LAt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Yee.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=qee.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 oCe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=qee.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=BAt})}var Ky=Sf;var aCe=js(Wee(),1);function Kee(){this._image=new Image}Kee.prototype.isReady=function(){return!0};Kee.prototype.shouldDiscardImage=function(e){return e===this._image};function Gx(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 Kee),this._errorEvent=new be}Object.defineProperties(Gx.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}}});Gx.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new Gx(t);return n._metadata=e,n};Gx.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]}};Gx.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=Ky.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=UAt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){gj(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=zAt(f)),!l(d)&&(!l(p)||p)){let g=VAt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:ay({uint8Array:f,format:d,flipY:!0})})};Gx.prototype.pickFeatures=function(e,t,n,i,r){};function UAt(e,t,n,i,r,o){let s=Ky.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 zAt(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 VAt(e){let t=aCe.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 cCe=Gx;var jAt=600;function Mp(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ba.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ba.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??jAt}Object.defineProperties(Mp.prototype,{});Mp.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=Ba.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 Hv({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};Mp.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}};Mp.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};Mp.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}`)}};Mp.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};Mp.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ba.defaultStreetViewStaticApiKey??Ba.defaultApiKey,!l(e.key)&&!l(Ba.defaultStreetViewStaticApiKey)&&!l(Ba.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new Mp({...e})};Mp._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var lCe=Mp;var HAt=new z(1,1,1,.4),GAt=new z(0,1,0,.05),WAt=new z(0,.5,0,.2);function Wx(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??HAt,this._glowColor=e.glowColor??GAt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??WAt,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(Wx.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}}});Wx.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()};Wx.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};Wx.prototype.getTileCredits=function(e,t,n){};Wx.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};Wx.prototype.pickFeatures=function(e,t,n,i,r){};var uCe=Wx;var ite=[Hi,xi],qAt=ite.length,DCe=Math.cos(P.toRadians(30)),fCe=Math.cos(P.toRadians(150)),RCe=0,OCe=1e3;function Jy(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??fn.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Jy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});Jy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<qAt;i++)if(t instanceof ite[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var YAt=new h,dCe=new h,hCe=new h;function nte(e,t,n,i,r){let o=kl(i,e,0,YAt),s=kl(i,e,n,dCe),a=kl(i,t,0,hCe),c=Fg(s,o,dCe),u=Fg(a,o,hCe);return h.cross(u,c,r),h.normalize(r,r)}var XAt=new he,KAt=new h,$At=new h,JAt=new h;function $ee(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===fn.GEODESIC?d=new K_(e,t,s):o===fn.RHUMB&&(d=new Yc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=nte(e,t,i,s,JAt),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,XAt),v=kl(s,E,n,KAt),S=kl(s,E,i,$At);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 Jee=new he;function kl(e,t,n,i){return he.clone(t,Jee),Jee.height=n,he.toCartesian(Jee,e,i)}Jy.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};Jy.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 Jy({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 Fg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function mCe(e,t,n,i){return i=Fg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var ZAt=new h,QAt=new h,ebt=new h,MCe=new h,tbt=0,nbt=-1;function Zee(e,t,n,i,r){let o=Fg(n,t,MCe),s=mCe(e,t,o,ZAt),a=mCe(i,t,o,QAt);if(P.equalsEpsilon(h.dot(s,a),nbt,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,ebt);return h.dot(a,c)<tbt&&(r=h.negate(r,r)),r}var xj=sn.fromPointNormal(h.ZERO,h.UNIT_Y),ibt=new h,rbt=new h,obt=new h,sbt=new h,abt=new h,yj=new h,Aj=new he,pCe=new he,gCe=new he;Jy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new ite[e._projectionIndex](i),a=RCe,c=OCe,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=Ti.lineSegmentPlane(g,m,xj,yj),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===fn.GEODESIC?v.push(h.clone(x)):e.arcType===fn.RHUMB&&(E=i.cartesianToCartographic(x,Aj).longitude,y=i.cartesianToCartographic(g,Aj),A=i.cartesianToCartographic(m,pCe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,gCe),x=i.cartographicToCartesian(T,yj),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=Ti.lineSegmentPlane(g,m,xj,yj),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===fn.GEODESIC?v.push(h.clone(x)):e.arcType===fn.RHUMB&&(E=i.cartesianToCartographic(x,Aj).longitude,y=i.cartesianToCartographic(g,Aj),A=i.cartesianToCartographic(m,pCe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,gCe),x=i.cartographicToCartesian(T,yj),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=Br(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=ibt,w=rbt,D=obt,N=sbt,F=abt,V=I[0],B=I[1],j=I[S-1];for(C=kl(i,j,a,C),N=kl(i,B,a,N),w=kl(i,V,a,w),D=kl(i,V,c,D),n?F=Zee(C,w,D,N,F):F=nte(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),$ee(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];kl(i,q,c,D),kl(i,I[f+1],a,N),Zee(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),$ee(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=kl(i,k,a,w),D=kl(i,k,c,D),n){let q=I[0];C=kl(i,G,a,C),N=kl(i,q,a,N),F=Zee(C,w,D,N,F)}else F=nte(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($ee(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 Mbt(n,s,L,_,O,R,t)};var cbt=new h,lbt=new $,ubt=new Le;function _Ce(e,t,n,i){let r=Fg(n,t,cbt),o=h.dot(r,e);if(o>DCe||o<fCe){let s=Fg(i,n,MCe),a=o<fCe?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,ubt),u=$.fromQuaternion(c,lbt);return $.multiplyByVector(u,e,e),!0}return!1}var yCe=new he,fbt=new h,ACe=new h;function Z1(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,fbt),s=h.add(o,n,ACe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,yCe);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,ACe),u=c.cartesianToCartographic(s,yCe)),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 dbt=new h,bCe=new h;function xCe(e,t,n,i,r,o){let s=h.subtract(t,e,dbt);h.normalize(s,s);let a=n-RCe,c=h.multiplyByScalar(s,a,bCe);h.add(e,c,r);let u=i-OCe;c=h.multiplyByScalar(s,u,bCe),h.add(t,c,o)}var hbt=new h;function bj(e,t){let n=sn.getPointDistance(xj,e),i=sn.getPointDistance(xj,t),r=hbt;P.equalsEpsilon(n,0,P.EPSILON2)?(r=Fg(t,e,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=Fg(e,t,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(t,r,t))}function mbt(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 NCe=new he,LCe=new he,TCe=new h,Qee=new h,ECe=new h,CCe=new h,pbt=new h,vCe=new h,gbt=[NCe,LCe],_bt=new ie,ybt=new h,Abt=new h,bbt=new h,xbt=new h,Tbt=new h,Ebt=new h,ete=new h,tte=new h,Cbt=new h,vbt=new h,Sbt=new h,SCe=new h,wbt=new h,Ibt=new h,Pbt=new Sn,Dbt=new Sn,wCe=new h,Rbt=new h,ICe=new h,Obt=[new ue,new ue],FCe=[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],PCe=FCe.length;function Mbt(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,_=NCe;_.height=0;let C=LCe;C.height=0;let w=TCe,D=Qee;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,CCe),W=h.unpack(i,0,Qee),J=h.unpack(r,0,vCe);if(e){let ve=h.unpack(n,n.length-6,ECe);_Ce(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,ECe),Re=h.clone(W,TCe),Qe=h.clone(J,pbt);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,CCe),W=h.unpack(i,c,Qee),J=h.unpack(r,c,vCe),q=_Ce(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 pi=mbt(_,C);He=t.project(_,Tbt),Ye=t.project(C,Ebt);let ao=Fg(Ye,He,wCe);ao.y=Math.abs(ao.y),Ke=ete,Pe=tte,pi===0||h.dot(ao,h.UNIT_Y)>DCe?(Ke=Z1(t,_,Qe,He,ete),Pe=Z1(t,C,J,Ye,tte)):pi===1?(Pe=Z1(t,C,J,Ye,tte),Ke.x=0,Ke.y=P.sign(_.longitude-Math.abs(C.longitude)),Ke.z=0):(Ke=Z1(t,_,Qe,He,ete),Pe.x=0,Pe.y=P.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(ve,Pbt),vt=h.subtract(Q,ve,Cbt),jt=h.normalize(vt,SCe),lt=h.subtract(Re,ve,vbt);lt=h.normalize(lt,lt);let mt=h.cross(jt,lt,SCe);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,wbt);ft=h.normalize(ft,ft);let Yt=h.subtract(W,Q,Sbt);Yt=h.normalize(Yt,Yt);let rt=h.cross(J,Yt,Ibt);rt=h.normalize(rt,rt);let ht=qe/F,Li=Z/F,Yn=0,yi,zi,Si,ui=0,Ai=0;if(s){Yn=h.distance(He,Ye),yi=Sn.fromCartesian(He,Dbt),zi=h.subtract(Ye,He,wCe),Si=h.normalize(zi,Rbt);let pi=Si.x;Si.x=Si.y,Si.y=-pi,ui=Yn/L,Ai=ae/L}for(V=0;V<8;V++){let pi=G+V*4,ao=j+V*2,nr=pi+3,jo=V<4?1:-1,Fn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,pi),A[nr]=vt.x,h.pack(st.low,b,pi),b[nr]=vt.y,h.pack(ft,x,pi),x[nr]=vt.z,h.pack(rt,T,pi),T[nr]=ht*jo,h.pack(mt,E,pi);let Vi=Li*Fn;Vi===0&&Fn<0&&(Vi=9),E[nr]=Vi,s&&(v[pi]=yi.high.x,v[pi+1]=yi.high.y,v[pi+2]=yi.low.x,v[pi+3]=yi.low.y,I[pi]=-Ke.y,I[pi+1]=Ke.x,I[pi+2]=Pe.y,I[pi+3]=-Pe.x,S[pi]=zi.x,S[pi+1]=zi.y,S[pi+2]=Si.x,S[pi+3]=Si.y,R[ao]=ui*jo,Vi=Ai*Fn,Vi===0&&Fn<0&&(Vi=9),R[ao+1]=Vi)}let zn=bbt,tn=xbt,Hn=ybt,Ki=Abt,wr=ie.fromCartographicArray(gbt,_bt),so=Ni.getMinimumMaximumHeights(wr,u),Ts=so.minimumTerrainHeight,zs=so.maximumTerrainHeight;Ae+=Math.abs(Ts),Ae+=Math.abs(zs),xCe(ve,Re,Ts,zs,zn,Hn),xCe(Q,W,Ts,zs,tn,Ki);let $r=h.multiplyByScalar(mt,P.EPSILON5,ICe);h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),bj(zn,tn),bj(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,ICe),h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),bj(zn,tn),bj(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<PCe;V++)m[c+V]=FCe[V]+fe;fe+=8,c+=PCe}let xe=Obt;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:$y(A),startLoAndForwardOffsetY:$y(b),startNormalAndForwardOffsetZ:$y(x),endNormalAndTextureCoordinateNormalizationX:$y(T),rightNormalAndTextureCoordinateNormalizationY:$y(E)};return s&&(we.startHiLo2D=$y(v),we.offsetAndRight2D=$y(S),we.startEndNormals2D=$y(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new wt({attributes:we,indices:m,boundingSphere:ge})}function $y(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Jy._projectNormal=Z1;var nS=Jy;var Tj=`in vec4 v_startPlaneNormalEcAndHalfWidth; -in vec4 v_endPlaneNormalEcAndBatchId; -in vec4 v_rightPlaneEC; -in vec4 v_endEcAndStartEcX; -in vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +#else +positionWC = v_positionMC; +lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); +rayleighColor = v_atmosphereRayleighColor; +mieColor = v_atmosphereMieColor; +opacity = v_atmosphereOpacity; #endif -void main(void) -{ -float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); -vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw); -if (logDepthOrDepth == 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); -eyeCoordinate /= eyeCoordinate.w; -float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate); -float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); -float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz); -float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz); -if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { -#ifdef DEBUG_SHOW_VOLUME -out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); -return; -#else // DEBUG_SHOW_VOLUME -discard; -#endif // DEBUG_SHOW_VOLUME -} -vec3 alignedPlaneNormal; -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); -alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); -alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); -distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); -s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; -float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, t); -materialInput.str = vec3(s, t, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR -out_FragColor.rgb *= out_FragColor.a; -czm_writeDepthClamp(); -} -`;var Ej=`in vec3 v_forwardDirectionEC; -in vec3 v_texcoordNormalizationAndHalfWidth; -in float v_batchId; -#ifdef PER_INSTANCE_COLOR -in vec4 v_color; +#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 -in vec2 v_alignedPlaneDistances; -in float v_texcoordT; +finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); +#endif +finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); #endif -float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { -return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } -void main(void) +#endif +#ifdef UNDERGROUND_COLOR +if (czm_backFacing()) { -vec4 eyeCoordinate = gl_FragCoord; -eyeCoordinate /= eyeCoordinate.w; -#ifdef PER_INSTANCE_COLOR -out_FragColor = czm_gammaCorrect(v_color); -#else // PER_INSTANCE_COLOR -float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); -float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); -distanceFromStart = max(0.0, distanceFromStart); -distanceFromEnd = max(0.0, distanceFromEnd); -float s = distanceFromStart / (distanceFromStart + distanceFromEnd); -s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; -czm_materialInput materialInput; -materialInput.s = s; -materialInput.st = vec2(s, v_texcoordT); -materialInput.str = vec3(s, v_texcoordT, 0.0); -czm_material material = czm_getMaterial(materialInput); -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#endif // PER_INSTANCE_COLOR +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 Cj=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; -in float batchId; -out vec3 v_forwardDirectionEC; -out vec3 v_texcoordNormalizationAndHalfWidth; -out float v_batchId; -#ifdef WIDTH_VARYING -out float v_width; #endif -#ifdef ANGLE_VARYING -out float v_polylineAngle; +#ifdef HAS_VECTOR_LAYER +finalColor = vectorPolygonRender(v_textureCoordinates.xy, finalColor); +finalColor = vectorPolylineRender(v_textureCoordinates.xy, finalColor); #endif -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; +#ifdef TRANSLUCENT +if (inTranslucencyRectangle()) +{ +vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; +finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); +} +#endif +out_FragColor = finalColor; +} +#ifdef SHOW_REFLECTIVE_OCEAN +float waveFade(float edge0, float edge1, float x) +{ +float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +return pow(1.0 - y, 5.0); +} +float linearFade(float edge0, float edge1, float x) +{ +return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); +} +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 -out vec2 v_alignedPlaneDistances; -out float v_texcoordT; +vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); #endif -void main() +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); +} +#endif // #ifdef SHOW_REFLECTIVE_OCEAN +`;var v5=`#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) { -v_batchId = batchId; -vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); -vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); -vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec4 startPlane2D; -vec4 startPlane3D; -startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); -startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); -vec4 rightPlane2D; -vec4 rightPlane3D; -rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); -rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); -posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); -posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); -posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); -posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; -posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; -vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; -vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); -vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); -vec4 endPlane2D; -vec4 endPlane3D; -endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); -endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); -v_forwardDirectionEC = normalize(endEC - startEC); -vec2 cleanTexcoordNormalization2D; -cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); -cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); -vec2 cleanTexcoordNormalization3D; -cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; -cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); -v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#else // PER_INSTANCE_COLOR -v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); -v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); -#endif // PER_INSTANCE_COLOR -#ifdef WIDTH_VARYING -float width = czm_batchTable_width(batchId); -float halfWidth = width * 0.5; -v_width = width; -v_texcoordNormalizationAndHalfWidth.z = halfWidth; +return u_modifiedModelViewProjection * vec4(position, 1.0); +} +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); +} +return positionFraction; +} +float get2DGeographicYPositionFraction(vec2 textureCoordinates) +{ +return textureCoordinates.y; +} +vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) +{ +float yPositionFraction = get2DYPositionFraction(textureCoordinates); +vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); +return u_modifiedModelViewProjection * rtcPosition2D; +} +vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, 0.0, textureCoordinates); +} +vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) +{ +return getPositionPlanarEarth(position, height, textureCoordinates); +} +vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) +{ +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; +} +#ifdef QUANTIZATION_BITS12 +uniform vec2 u_minMaxHeight; +uniform mat4 u_scaleAndBias; +#endif +void main() +{ +#ifdef QUANTIZATION_BITS12 +vec2 xy = czm_decompressTextureCoordinates(compressed0.x); +vec2 zh = czm_decompressTextureCoordinates(compressed0.y); +vec3 position = vec3(xy, zh.x); +float height = zh.y; +vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); +height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; +position = (u_scaleAndBias * vec4(position, 1.0)).xyz; +#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL) +float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; +float encodedNormal = compressed1; +#elif defined(INCLUDE_WEB_MERCATOR_Y) +float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; +float encodedNormal = 0.0; +#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) +float webMercatorT = textureCoordinates.y; +float encodedNormal = compressed0.w; #else -float halfWidth = 0.5 * czm_batchTable_width(batchId); -v_texcoordNormalizationAndHalfWidth.z = halfWidth; +float webMercatorT = textureCoordinates.y; +float encodedNormal = 0.0; #endif -vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); -float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); -vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); -geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc3D.xyz += geodeticSurfaceNormal; -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); -positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; -vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); -absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); -absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); -planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); -upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); -normalEC = normalize(cross(planeDirection, upOrDown)); -geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); -geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); -geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; -positionEc2D.xyz += geodeticSurfaceNormal; -normalEC *= sign(texcoordNormalization2D.x); -#ifndef PER_INSTANCE_COLOR -v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.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 -positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; -gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif -} -`;var vj=`in vec3 position3DHigh; -in vec3 position3DLow; -#ifndef COLUMBUS_VIEW_2D -in vec4 startHiAndForwardOffsetX; -in vec4 startLoAndForwardOffsetY; -in vec4 startNormalAndForwardOffsetZ; -in vec4 endNormalAndTextureCoordinateNormalizationX; -in vec4 rightNormalAndTextureCoordinateNormalizationY; +vec3 position3DWC = position + u_center3D; +#ifdef GEODETIC_SURFACE_NORMALS +vec3 ellipsoidNormal = geodeticSurfaceNormal; #else -in vec4 startHiLo2D; -in vec4 offsetAndRight2D; -in vec4 startEndNormals2D; -in vec2 texcoordNormalization2D; +vec3 ellipsoidNormal = normalize(position3DWC); #endif -in float batchId; -out vec4 v_startPlaneNormalEcAndHalfWidth; -out vec4 v_endPlaneNormalEcAndBatchId; -out vec4 v_rightPlaneEC; -out vec4 v_endEcAndStartEcX; -out vec4 v_texcoordNormalizationAndStartEcYZ; -#ifdef WIDTH_VARYING -out float v_width; +#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 -#ifdef ANGLE_VARYING -out float v_polylineAngle; +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 -#ifdef PER_INSTANCE_COLOR -out vec4 v_color; +v_normalMC = normalMC; +v_normalEC = czm_normal3D * v_normalMC; #endif -void main() -{ -#ifdef COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; -vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); -vec3 ecEnd = forwardDirectionEC + ecStart; -forwardDirectionEC = normalize(forwardDirectionEC); -v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); -v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; -#else // COLUMBUS_VIEW_2D -vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; -vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); -vec3 ecEnd = ecStart + offset; -vec3 forwardDirectionEC = normalize(offset); -vec4 startPlaneEC; -startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; -startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); -vec4 endPlaneEC; -endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; -endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); -v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; -v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); -v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); -v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; -#endif // COLUMBUS_VIEW_2D -v_endEcAndStartEcX.xyz = ecEnd; -v_endEcAndStartEcX.w = ecStart.x; -v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; -#ifdef PER_INSTANCE_COLOR -v_color = czm_batchTable_color(batchId); -#endif // PER_INSTANCE_COLOR -vec4 positionRelativeToEye = czm_computePosition(); -vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; -float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); -float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); -vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); -vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); -vec3 normalEC = normalize(cross(planeDirection, upOrDown)); -upOrDown = cross(forwardDirectionEC, normalEC); -upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; -upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; -upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; -positionEC.xyz += upOrDown; -v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); -float width = czm_batchTable_width(batchId); -#ifdef WIDTH_VARYING -v_width = width; +#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 -v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; -v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; -v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; -v_endPlaneNormalEcAndBatchId.w = batchId; -width = width * max(0.0, czm_metersPerPixel(positionEC)); -width = width / dot(normalEC, v_rightPlaneEC.xyz); -#ifdef COLUMBUS_VIEW_2D -normalEC *= sign(texcoordNormalization2D.x); +#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) +vec3 atmosphereLightDirection = czm_sunDirectionWC; #else -normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); +vec3 atmosphereLightDirection = czm_lightDirectionWC; #endif -positionEC.xyz += width * normalEC; -gl_Position = czm_depthClamp(czm_projection * positionEC); -#ifdef ANGLE_VARYING -vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); -approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); -v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); +vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); +computeAtmosphereScattering( +position3DWC, +lightDirection, +v_atmosphereRayleighColor, +v_atmosphereMieColor, +v_atmosphereOpacity +); +#endif +#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) +v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); +#endif +#ifdef APPLY_MATERIAL +float northPoleZ = czm_ellipsoidRadii.z; +vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); +vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); +float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); +v_slope = acos(dotProd); +vec3 normalRejected = ellipsoidNormal * dotProd; +vec3 normalProjected = v_normalMC - normalRejected; +vec3 aspectVector = normalize(normalProjected); +v_aspect = acos(dot(aspectVector, vectorEastMC)); +float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); +v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); +v_height = height; #endif } -`;var Sj=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; -in float batchId; -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +`;var aM=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; +vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); +czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); +float atmosphereInnerRadius = length(positionWC); +computeScattering( +primaryRay, +length(cameraToPositionWC), +lightDirection, +atmosphereInnerRadius, +rayleighColor, +mieColor, +opacity +); +} +`;var Voe=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}},joe=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===lc.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(uI(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(Ey);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(NFt(Ye)),jt.sources.push(LFt(S));let ft=en.fromCache({context:n.context,vertexShaderSource:jt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[Ke]=new Voe(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 le(this)}};function NFt(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 LFt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var S5=joe;var KNe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(KNe);var uc=KNe;var $Ne={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze($Ne);var Ur=$Ne;var h0=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 ue,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)&&(Ds.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Zc.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&&(FFt(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&&BFt(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){JNe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){JNe(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=nt.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=nt.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 JNe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Ro.clone(s);c.hasGeodeticSurfaceNormals=t,c=Ro.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?(h0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=h0._createVertexArrayForMesh(i.context,r)):(h0._freeVertexArray(e.vertexArray),e.vertexArray=h0._createVertexArrayForMesh(i.context,r)),h0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function FFt(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 BFt(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||h0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===Ur.FAILED&&kFt(a,e,t,n,e.x,e.y,e.level),a.terrainState===Ur.UNLOADED&&UFt(a,n,e.x,e.y,e.level),a.terrainState===Ur.RECEIVED&&VFt(a,t,n,e.x,e.y,e.level),a.terrainState===Ur.TRANSFORMED&&(jFt(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)GFt(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 kFt(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 UFt(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=no.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:ra.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 zFt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function VFt(e,t,n,i,r,o){let s=n.tilingScheme,a=zFt;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 jFt(e,t,n,i,r,o,s){e.vertexArray=h0._createVertexArrayForMesh(t,e.mesh),e.terrainState=Ur.READY,e.fill=e.fill&&e.fill.destroy(s)}function HFt(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 Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function GFt(e,t){let n=t.terrainData.waterMask,i=HFt(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 Cm=h0;var ZNe={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>=ZNe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=ZNe;function dI(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}dI.prototype.update=function(e,t,n){this.changedThisFrame&&(oLe(e,t,this.tile,n),this.changedThisFrame=!1)};dI.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};dI.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Cm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var WFt=new ex;dI.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=WFt;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||gi.wasKicked(u._lastSelectionResult)||gi.originalResult(u._lastSelectionResult)===gi.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===gi.RENDERED){if(l(u.data.vertexArray))return;qFt(e,t,n,u,o,r,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.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 qFt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new dI(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),YFt(e,t,n,i,r,a)}function YFt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(oLe(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 jT=new he,XFt=new he,fI=new h,qoe=new h,Hoe=new U,Goe=new U,zf=new U;function M5(){this.height=0,this.encodedNormal=new U}function w5(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 sLe(e,t,n,i,u,c),c}var KFt={minimumHeight:0,maximumHeight:0},$Ft=new h,QNe=new M5,eLe=new M5,tLe=new M5,nLe=new M5,JFt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,ZFt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function oLe(e,t,n,i){Cm.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=P5(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,tLe),p=P5(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,QNe),g=P5(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,eLe),m=P5(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,nLe);d=w5(o,f,0,1,d,p,m,g,tLe),p=w5(o,f,0,0,p,d,g,m,QNe),g=w5(o,f,1,1,g,p,m,d,eLe),m=w5(o,f,1,1,m,g,d,p,nLe);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 ll({width:9,height:9,buffer:JFt,structure:{heightOffset:E}}),D=ZFt;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,XFt);D.height=v;let N=f.cartographicToCartesian(D,$Ft),F=new Ro(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=KFt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=I5(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=R5(o,f,F,G,q,o.westTiles,o.westMeshes,In.EAST,j);let W=q;q=I5(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=R5(o,f,F,G,q,o.southTiles,o.southMeshes,In.NORTH,j);let J=q;q=I5(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=R5(o,f,F,G,q,o.eastTiles,o.eastMeshes,In.WEST,j);let Z=q;q=I5(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=R5(o,f,F,G,q,o.northTiles,o.northMeshes,In.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=Qt.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=Ti.geodeticLatitudeToMercatorAngle(s.south),fe=1/(Ti.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(Ti.geodeticLatitudeToMercatorAngle(D.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(jT,qoe),we=cn.octEncode(ge,Hoe),ve=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,zf),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 Ic(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),oBt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,jt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Cm._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 I5(e,t,n,i,r,o,s,a,c,u,f){let d=jT;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,fI),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,qoe));let m=Goe;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 O5=new ie;function cM(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,O5),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,O5),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 QFt=new U;function Woe(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 eBt=new U,tBt=new h;function nBt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=cM(t,n,f.decodeTextureCoordinates(d,r,zf),zf),g=cM(t,n,f.decodeTextureCoordinates(d,o,Goe),Goe),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;jT.longitude=P.lerp(b.west,b.east,s),jT.latitude=P.lerp(b.south,b.north,a),u.height=jT.height=P.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,QFt),E=f.getOctEncodedNormal(d,o,eBt),v=cn.octDecode(T.x,T.y,fI),S=cn.octDecode(E.x,E.y,tBt);x=h.lerp(v,S,m,fI),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(jT,fI),cn.octEncode(x,u.encodedNormal)}function sLe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(jT,fI);cn.octEncode(s,o.encodedNormal)}function P5(e,t,n,i,r,o,s,a,c,u,f){if(rLe(e,t,a,s,!1,n,i,f)||rLe(e,t,u,c,!0,n,i,f))return f;let p;if(Yoe(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],Woe(o,p,n,i,f),f;let g;if(n===0?i===0?g=D5(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=D5(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=D5(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=D5(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return sLe(e,t,n,i,g,f),f}function D5(e,t,n,i,r,o,s,a){let c=iLe(e,t,!1,n,s,a),u=iLe(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function R5(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=iBt(e,t,n,i,r,o[u],s[u],a,c);return r}function iBt(e,t,n,i,r,o,s,a,c){let u;a===In.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,O5),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===In.WEST&&o.x===0&&(u=ie.clone(o.rectangle,O5),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,zf),d=zf.x,p=zf.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=Ti.geodeticLatitudeToMercatorAngle(f.south),v=1/(Ti.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,zf);cM(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,fI),N=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,Hoe):(F=Hoe,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=P.lerp(f.south,f.north,L);V=(Ti.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(D,qoe)),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 iLe(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(!Yoe(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 Yoe(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function rLe(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(Yoe(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,zf);let y=cM(g,e.tile,zf,zf);if(y.x===o&&y.y===s)return Woe(m,p,o,s,a),!0;if(d=Pr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,zf);let x=cM(g,e.tile,zf,zf);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 nBt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return Woe(m,c[d],o,s,a),!0}return!1}var rBt=[new h,new h,new h,new h];function oBt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=rBt;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 lM=dI;var Xoe=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){Ps.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Zc.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(cBt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=aBt(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(),dBt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)Cm._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:gc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:gc.LESS_OR_EQUAL},blending:nn.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&&lM.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&&lBt(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;uBt(this,g,m,t);let y=m.tileBoundingRegion;FBt(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),fLe(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===gi.CULLED_BUT_NEEDED,o=i.terrainState),Cm.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)!==ns.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,Cm.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=hLe(this,n);if(n.fog.enabled&&!o&&P.fog(r,n.fog.density)>=1)return ns.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return ns.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=L5(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,dLe);if(!l(d))return ns.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=hBt,ue.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=ue.union(a.boundingSphere,u,u))),!l(u))return ns.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 ns.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=ns.NONE:y===$t.INTERSECTING?m=ns.PARTIAL:y===$t.INSIDE&&(m=ns.FULL),m===ns.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:ns.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=gBt;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=_Bt;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:gi.NONE;if(p===gi.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===gi.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,yBt),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){SBt(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(),le(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]=wBt(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!==gi.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)}},sBt=new ie;function aBt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,sBt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function cBt(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 lBt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Zc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function uBt(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 fBt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function dBt(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 fLe(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 hBt=new ue,dLe=new ie,mBt=new ie,pBt=new he;function L5(e,t){if(t.west<t.east)return t;let n=ie.clone(t,mBt);return ie.center(e,pBt).longitude>0?n.east=P.PI:n.west=-P.PI,n}function hLe(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 gBt=[],_Bt=[],yBt=new h,aLe=new M,N5=new M,ABt=new se,bBt=new se,xBt=new se,TBt=new h,cLe=new h,EBt=new h,CBt=new h,vBt=[new h,new h,new h,new h];function lLe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=vBt;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 SBt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Cm);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Rd({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=Qt.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=lLe(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=lLe(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 wBt(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 IBt=new M,PBt=new M;function uLe(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,cLe);return M.setTranslation(i,r,aLe),aLe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=M.multiplyByPoint(i,this.properties.rtc,cLe);return M.setTranslation(i,o,N5),M.multiply(r,N5,N5),N5},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,IBt):M.IDENTITY;return M.inverseTranspose(r,PBt)},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)?Ot(n,t.materialUniformMap):n}function DBt(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=RBt(e,r,i),n.wireframeVertexArray.mesh=i}}function RBt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};qn.toWireframe(r);let o=r.indices,s=nt.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 mLe,pLe,F5;(function(){let e=new Bt({geometry:Gm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new Gy({radius:1})}),n=new M,i,r;function o(s){return new Mn({geometryInstances:s,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}mLe=function(s,a){return s===i||(F5(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},pLe=function(s,a){return s===i||(F5(),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},F5=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var OBt=new se(0,0,0,0),MBt={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},NBt=z.TRANSPARENT,LBt=new qt;function FBt(e,t,n){let i=t.data;if(fBt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new lM(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=zt.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??NBt,A=e.undergroundColorAlphaByDistance??LBt,b=hLe(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=ABt,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),EBt),Yt=mt.project(ie.northeast(t.rectangle),CBt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Yt.x,ae.w=Yt.y,n.mode!==re.MORPHING&&(k=TBt,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===lc.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 Ti&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=Ti.geodeticLatitudeToMercatorAngle(Ae),ge=1/(Ti.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let ve=MBt;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)||F5(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=uLe(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 ue,ft.orientedBoundingBox=void 0,Yt=uLe(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)?mLe(Es,z.RED).update(n):l(Ha)&&pLe(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 yi=bBt,zi=L5(t.rectangle,e.cartographicLimitRectangle),Si=xBt,ui=L5(t.rectangle,m);h.fromElements(D,N,F,rt.hsbShift);let Ai=t.rectangle,zn=1/Ai.width,tn=1/Ai.height;yi.x=(zi.west-Ai.west)*zn,yi.y=(zi.south-Ai.south)*tn,yi.z=(zi.east-Ai.west)*zn,yi.w=(zi.north-Ai.south)*tn,se.clone(yi,rt.localizedCartographicLimitRectangle),Si.x=(ui.west-Ai.west)*zn,Si.y=(ui.south-Ai.south)*tn,Si.z=(ui.east-Ai.west)*zn,Si.w=(ui.north-Ai.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,pi=!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 ub=Es.useWebMercatorT?Ha.textureWebMercator:Ha.texture,ii=Ha.imageryLayer;l(Es.textureTranslationAndScale)||(Es.textureTranslationAndScale=ii._calculateTextureTranslationAndScale(t,Es)),rt.dayTextures[mt]=ub,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,pi=pi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ii.dayAlpha,pi=pi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ii.brightness,Ki=Ki||rt.dayTextureBrightness[mt]!==Ms.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ii.contrast,wr=wr||rt.dayTextureContrast[mt]!==Ms.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ii.hue,so=so||rt.dayTextureHue[mt]!==Ms.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ii.saturation,Ts=Ts||rt.dayTextureSaturation[mt]!==Ms.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ii.gamma,zs=zs||rt.dayTextureOneOverGamma[mt]!==1/Ms.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=L5(Ai,ii.cutoutRectangle),Mm=ie.simpleIntersection(Ca,Ai,dLe);nr=l(Mm)||nr,Wr.x=(Ca.west-Ai.west)*zn,Wr.y=(Ca.south-Ai.south)*tn,Wr.z=(Ca.east-Ai.west)*zn,Wr.w=(Ca.north-Ai.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,b_=Ca.length;Mm<b_;++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=pi,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&&(DBt(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?(ue.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&&ue.union(q.boundingSphere,na,na)):(ft.boundingVolume=ue.clone(q.boundingSphere,na),ft.orientedBoundingBox=Qt.clone(q.boundingVolume,Om)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),fLe(ft,n),st=qe,vt=OBt}while(Qe<He)}var B5=Xoe;function gLe(){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(gLe.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 k5=gLe;var Koe=class{constructor(t){this._ellipsoid=new Op(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},U5=Koe;var $oe=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()}},BBt=1e3,Joe=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=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new $oe(BBt),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 UBt(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];if(!l(o))continue;i.add(o);let s=_Le(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=_Le(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._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(),z5(this._southwestChild),this._southwestChild=void 0,z5(this._southeastChild),this._southeastChild=void 0,z5(this._northwestChild),this._northwestChild=void 0,z5(this._northeastChild),this._northeastChild=void 0}},kBt=256;function UBt(e,t,n,i){let r=n.width/kBt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var zBt=new he;function _Le(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,zBt),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 z5(e){l(e)&&e.freeResources()}var V5=Joe;function j5(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}j5.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};j5.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(),yLe(this,t)),t=i}};function yLe(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}j5.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))&&yLe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var H5=j5;function eh(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 H5,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 U5({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(eh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});eh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function VBt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,bLe(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()}eh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==uc.START&&e(t),t=t.replacementNext};eh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};eh.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};eh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function bLe(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}eh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(VBt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),bLe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};eh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),WBt(this,e),t2t(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function jBt(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))}eh.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(JBt(this,e),e2t(this,e),jBt(this,e))};eh.prototype.isDestroyed=function(){return!1};eh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var fM,ALe=new he;function HBt(e,t){let n=ie.center(e.rectangle,ALe),i=n.longitude-fM.longitude,r=n.latitude-fM.latitude;n=ie.center(t.rectangle,ALe);let o=n.longitude-fM.longitude,s=n.latitude-fM.latitude;return i*i+r*r-(o*o+s*s)}var GBt=new h,uM=[];function WBt(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=V5.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(uM.length<g){uM=new Array(g);for(let m=0;m<g;++m)uM[m]===void 0&&(uM[m]=new dM)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;fM=t.camera.positionCartographic,o.sort(HBt);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,GBt);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?Rc(e,p,r,t,s,!1,uM[d]):(u_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function u_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function dM(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function xLe(){this.southwest=new dM,this.southeast=new dM,this.northwest=new dM,this.northeast=new dM}xLe.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 Qoe=new Array(31);for(let e=0;e<Qoe.length;++e)Qoe[e]=new xLe;function qBt(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=KBt(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:gi.NONE,g=e.tileProvider;if(s||i){let m=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,A=n.state===uc.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&u_(e,e._tileLoadQueueMedium,n,t),G5(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&u_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){G5(e,n),u_(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===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(YBt(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!==gi.KICKED&&_!==n;)_._lastSelectionResult=gi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,G5(e,n),n._lastSelectionResult=gi.RENDERED;let O=p===gi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,u_(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&&u_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,G5(e,n),u_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function YBt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Qoe[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Rc(e,t,u,o,f,s,p),Rc(e,n,u,o,f,s,g),Rc(e,i,u,o,f,s,m),Rc(e,r,u,o,f,s,y)):(Rc(e,i,u,o,f,s,m),Rc(e,t,u,o,f,s,p),Rc(e,r,u,o,f,s,y),Rc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Rc(e,n,u,o,f,s,g),Rc(e,t,u,o,f,s,p),Rc(e,r,u,o,f,s,y),Rc(e,i,u,o,f,s,m)):(Rc(e,r,u,o,f,s,y),Rc(e,i,u,o,f,s,m),Rc(e,n,u,o,f,s,g),Rc(e,t,u,o,f,s,p)),d.combine(a)}function XBt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Rc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==ns.NONE)return qBt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,XBt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&u_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(u_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function KBt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof _n||t.camera.frustum instanceof ws)return $Bt(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 $Bt(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 G5(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function JBt(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=Zoe(e,t,s,o,n,!1);a=Zoe(e,t,s,o,i,a),Zoe(e,t,s,o,r,a)}function ZBt(e,t){return e._loadPriority-t._loadPriority}function Zoe(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(ZBt);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 hI=new gn,W5=new he,$A=new h,QBt=[];function e2t(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=QBt;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:gi.NONE;(A===gi.RENDERED||A===gi.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,hI.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,hI.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,$A);h.subtract(A.positionOnEllipsoidSurface,O,hI.origin)}}else he.clone(A.positionCartographic,W5),W5.height=-11500,c.project(W5,$A),h.fromElements($A.z,$A.x,$A.y,$A),h.clone($A,hI.origin),h.clone(h.UNIT_X,hI.direction);T=d.data.pick(hI,a,c,!1,$A),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,W5);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 t2t(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 q5=eh;function vm(e){e=e??ee.default;let t=new n_({ellipsoid:e}),n=new $v,i=new zy({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new S5,this._material=void 0,this._surface=new q5({tileProvider:new B5({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 k5,tse(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(vm.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)&&tse(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,tse(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 tse(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[hp,aM];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(C5),e._surfaceShaderSet.baseVertexShaderSource=new Xe({sources:[hp,aM,v5],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Xe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function n2t(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var i2t=[],r2t={start:0,stop:0};vm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=i2t;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=ue.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))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=xi.raySphere(e,d,r2t);l(p)&&s.push(f)}s.sort(n2t(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 o2t=new he;vm.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,o2t);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var s2t=new h,TLe=new h,a2t=new he,c2t=new gn;function ese(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}vm.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=ese(n._southwestChild,e)||ese(n._southeastChild,e)||ese(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,s2t),u=c2t,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,TLe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,TLe);if(l(p))return a.cartesianToCartographic(p,a2t).height};vm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};vm.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))};vm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};vm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};vm.prototype.isDestroyed=function(){return!1};vm.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(),le(this)};var Y5=vm;var Vf=`uniform sampler2D colorTexture; +in vec2 v_textureCoordinates; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; -vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_width = width; -v_st.s = st.s; -v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); -v_polylineAngle = angle; +out_FragColor = texture(colorTexture, v_textureCoordinates); +} +`;var HT=`uniform highp sampler2D u_depthTexture; +in vec2 v_textureCoordinates; +void main() +{ +out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;var Nbt=`#define CLIP_POLYLINE -${hu} -${Sj}`,Lbt=fv;function qx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=qx.VERTEX_FORMAT;this.material=l(e.material)?e.material:lr.fromType(lr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??Nbt,this._fragmentShaderSource=e.fragmentShaderSource??Lbt,this._renderState=Pr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(qx.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}}});qx.VERTEX_FORMAT=Be.POSITION_AND_ST;qx.prototype.getFragmentShaderSource=Pr.prototype.getFragmentShaderSource;qx.prototype.isTranslucent=Pr.prototype.isTranslucent;qx.prototype.getRenderState=Pr.prototype.getRenderState;var Cc=qx;function Bg(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Cc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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=BCe(!1),this._renderState3DTiles=BCe(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:ji.FRONT},depthTest:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Bg.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}}});Bg.initializeTerrainHeights=function(){return Ni.initialize()};function Fbt(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(vj);s=Nn._appendShowToShader(r,s),s=Nn._appendDistanceDisplayConditionToShader(r,s),s=Nn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(Cj);a=Nn._appendShowToShader(r,a),a=Nn._appendDistanceDisplayConditionToShader(r,a),a=Nn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(Tj),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()(Ej);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 BCe(e){return Ge.fromCache({cull:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function Bbt(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof $s?{}: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 kCe(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 kbt(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!==ei.CESIUM_3D_TILE,p=f!==ei.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],kCe(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,kCe(e,g,t,r,o,b,s))}}}Bg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){Bg.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 Fl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,nS.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){Fbt(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){Bbt(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){kbt(n,u,f,d,p,g,m)},this._primitive=new Nn(i)}if(this.appearance instanceof $s&&!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))})};Bg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Bg.isSupported=function(e){return e.frameState.context.depthTexture};Bg.prototype.isDestroyed=function(){return!1};Bg.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,le(this)};var Np=Bg;var Ubt={u_globeMinimumAltitude:function(){return 55e3}};function Nu(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??ei.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:Ubt}}Object.defineProperties(Nu.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}}});Nu.isSupported=v1.isSupported;function UCe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function zCe(e){return function(t,n){return e._minHeight}}var zbt=new h,Vbt=new h,jbt=new h,Hbt=new he,Gbt=new ie;function wj(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,zbt),g=h.unpack(r,d,Vbt),m=h.add(p,g,jbt),y=n.cartesianToCartographic(m,Hbt),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=Gbt;return f.north=c,f.south=s,f.east=u,f.west=a,f}function Wbt(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function qbt(e,t,n){let i=t.mapProjection.ellipsoid,r=wj(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.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 rte(e,t){return Math.floor(e%t/2)}function ote(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 VCe(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 Ybt(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!==ei.CESIUM_3D_TILE,d=u!==ei.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[rte(m,b)],f&&(A=n[m],ote(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,ote(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],ote(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[rte(m,b)],!e._useFragmentCulling){let T=x[rte(m,b)];y=c[T.index]}f&&(A=i[m],VCe(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,VCe(e,A,t,r,o,y))}}}Nu.initializeTerrainHeights=function(){return Ni.initialize()};Nu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){Nu.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=wj(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)}Wbt(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=Nu._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=wj(e,o),Md.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=wj(e,o),x=o.textureCoordinateRotationPoints;A?y=Md.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Md.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,zCe(this),UCe(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,zCe(this),UCe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){qbt(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){Ybt(t,A,b,x,T,E,v,S)},this._primitive=new v1(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))})};Nu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Nu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};Nu._supportsMaterials=function(e){return e.depthTexture};Nu.supportsMaterials=function(e){return Nu._supportsMaterials(e.frameState.context)};var Lu=Nu;function nm(){}nm._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);nm._decodeTaskProcessor=new Kn("decodeI3S",nm._maxDecodingConcurrency);nm._promise=void 0;async function Xbt(){if(await nm._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return nm._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}nm.decode=async function(e,t,n,i,r){return l(nm._promise)||(nm._promise=Xbt()),nm._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 Ij=nm;function ste(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(ste.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});ste.prototype.load=async function(){return this._data=await Lp.loadJson(this._resource),this._data};var Pj=ste;function kg(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(kg.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 Dj(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 Kbt(e){return e==="String"?1:Dj(e)}async function $bt(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)}kg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=$bt(this).catch(function(e){console.error(e)}),this._loadPromise)};kg.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}};kg.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};kg.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)}}}};kg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=Dj(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=Dj(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};kg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Kbt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};kg.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=Dj(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 Rj=kg;function Jbt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var iS=Jbt;function Q1(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(Q1.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});Q1.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Zbt=new h,Qbt=new h,ext=new h,txt=new h,nxt=new h;function ate(e,t,n,i){let r=h.subtract(i,n,Zbt),o=h.cross(r,h.subtract(e,n,Qbt),txt),s=h.cross(r,h.subtract(t,n,ext),nxt);return h.dot(o,s)>=0}var ixt=new h,rxt=new h,oxt=new h,sxt=new h,axt=new h,cxt=new h,lxt=new h,uxt=new h,fxt=new h,dxt=new h;Q1.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],ixt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],rxt),x=new h(u[y*3],u[y*3+1],u[y*3+2],oxt);if(!ate(i,A,b,x)||!ate(i,b,A,x)||!ate(i,x,A,b))continue;let T=h.subtract(b,A,sxt),E=h.subtract(x,A,axt),v=h.cross(T,E,cxt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,lxt),I=h.subtract(i,A,uxt),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,fxt)),_=h.magnitudeSquared(h.subtract(i,x,dxt));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 jCe(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}Q1.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=jCe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=jCe(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 eR=Q1;function cl(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(cl.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}}});cl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Yh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await Lp.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 HCe(e,t){let n=new Rj(e,t);return e._fields[t.name]=n,n.load()}cl.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(HCe(this,i))}return Promise.all(t)};cl.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 HCe(this,r)}return Promise.resolve()};cl.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)};cl.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};cl.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 cl(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};cl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new eR(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 eR(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};cl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new Pj(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};cl.prototype._clearGeometryData=function(){this._geometryData=[]};cl.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+=gxt(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 Uc(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}};cl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};cl.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 Ij.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 hxt(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 mxt(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 GCe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await hxt(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(!mxt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}cl.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=GCe(this,t);e.push(n)}return Promise.all(e)};Yh.prototype._hookedRequestContent=Yh.prototype.requestContent;Yh.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(()=>{GCe(e._i3sNode,n)})),e._isLoading=!1,t})}};function pxt(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 Oj(e,t,n,i){let r=e+t*n;return i[r]}function gxt(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=Oj(s,a,n.width,n.buffer),d=Oj(c,a,n.width,n.buffer),p=Oj(s,u,n.width,n.buffer),g=Oj(c,u,n.width,n.buffer),m=pxt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Yh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var tR=cl;function Mj(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(Mj.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function cte(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(iS(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function rS(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=cte(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=cte(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=cte(a.color,a.transparency)))}break}}return n}function _xt(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=rS(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]=rS(r.symbol,t)}return n}}function yxt(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(rS(o.symbol,t)))}return i.symbols.push(void 0),i}}Mj.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=rS(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=rS(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=_xt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=rS(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=yxt(i,n))}};function WCe(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?WCe(s,t,n,i):s}}function Axt(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 bxt(e,t,n){let i=t[n],r=Axt(e.ranges,i);return e.symbols[r]}Mj.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=>WCe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>bxt(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 Nj=Mj;function Fu(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(Fu.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}}});Fu.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 Nj(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()};Fu.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)}};Fu.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]}}};Fu.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 tR(this,t,!0)}else this._rootNode=new tR(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Fu.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]})};Fu._fetchJson=function(e){return e.fetchJson()};Fu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Fu._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]};Fu.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]))};Fu.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 Jo.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()})};Fu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Fu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ze(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var oS=Fu;function Lj(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(Lj.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}}});Lj.prototype.load=async function(){return this._data=await Lp.loadJson(this._resource),this._data};Lj.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 Fj=Lj;function nR(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(nR.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}}});nR._fromData=async function(e,t,n,i){let r=new nR(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=nR._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 Lp.loadJson(r._resource),c=new oS(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 Bj=nR;var XCe=js(qCe(),1);function Js(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(Js.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}}});Js.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return le(this)};Js.prototype.isDestroyed=function(){return!1};Js.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Js.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Js.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Js.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 xxt(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 YCe(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=xxt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=Bj._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 Fj(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 oS(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.`)}Js.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Js.loadJson(n),r=new Js(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=YCe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await YCe(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};Js._fetchJson=function(e){return e.fetchJson()};Js.loadJson=async function(e){let t=await Js._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};Js.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};Js.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 Txt=new U;function Ext(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,Txt),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===Zh.LERC){let x=XCe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function Cxt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await Ext(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Js.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Cxt(this),this._geoidDataPromise)};Js.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};Js.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Js.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[]};Js.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=Js;function Fp(){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 di({color:new z(0,0,0,0),owner:this}),this._clearCommand=new di({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(Fp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Fp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var vxt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Zn.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},Sxt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Zn.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:Zn.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},wxt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK,blending:nn.ALPHA_BLEND},Ixt=`uniform sampler2D colorTexture; +`;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 ELe(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:nn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(HT,{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(Vf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(HT,{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(Vf,{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 hi({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),ELe(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),ELe(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()),le(this)};var X5=m0;function GT(){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(GT.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 l2t(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function u2t(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 f2t(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(HT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new hi({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}GT.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;u2t(this,n,r,o,e),f2t(this,n,r,o,i),this._useHdr=e};GT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};GT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};GT.prototype.isDestroyed=function(){return!1};GT.prototype.destroy=function(){return l2t(this),le(this)};var K5=GT;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},WT=fc.DERIVED_COMMANDS_MAXIMUM_LENGTH,MLe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function qT(){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(WT),this._derivedBlendCommandTypes=new Array(WT),this._derivedPickCommandTypes=new Array(WT),this._derivedCommandTypesToUpdate=new Array(WT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(qT.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}}});qT.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=CLe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=CLe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=vLe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=vLe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=p2t(this,e,t),this._sunVisibleThroughGlobe=d2t(this,e),this._environmentVisible=h2t(this,e),this._useDepthPlane=m2t(this,e),this._numberOfTextureUniforms=g2t(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),_2t(this,e)};function CLe(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 vLe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function d2t(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function h2t(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function m2t(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function p2t(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function g2t(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function _2t(e,t){e._derivedCommandsLength=nse(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=nse(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=nse(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<WT;++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=O2t())}function nse(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 th(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function SLe(e,t){return e.indexOf(t)>-1}function y2t(e,t){th(e.defines,"TRANSLUCENT"),th(t.defines,"TRANSLUCENT")}function A2t(e,t){th(e.defines,"GROUND_ATMOSPHERE"),th(t.defines,"GROUND_ATMOSPHERE"),th(e.defines,"FOG"),th(t.defines,"FOG"),th(e.defines,"TRANSLUCENT"),th(t.defines,"TRANSLUCENT")}function ise(e,t){if(SLe(t.defines,"TILE_LIMIT_RECTANGLE")||SLe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +{ + out_FragColor = vec4(1.0); +} +`;t.sources=[n]}function rse(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 NLe(e,t){rse(e,t),th(e.defines,"GROUND_ATMOSPHERE"),th(t.defines,"GROUND_ATMOSPHERE"),th(e.defines,"FOG"),th(t.defines,"FOG")}function b2t(e,t){rse(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function x2t(e,t){NLe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function wLe(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 T2t(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 E2t(e){e.cull.face=Gi.BACK,e.cull.enabled=!0}function C2t(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0}function v2t(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function S2t(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function w2t(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ILe(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function PLe(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function I2t(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function P2t(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function D2t(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 mI(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function R2t(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function Sm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function O2t(){return[new Sm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:y2t,getRenderStateFunction:E2t,getUniformMapFunction:void 0}),new Sm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:A2t,getRenderStateFunction:C2t,getUniformMapFunction:void 0}),new Sm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:ise,getRenderStateFunction:v2t,getUniformMapFunction:void 0}),new Sm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:ise,getRenderStateFunction:S2t,getUniformMapFunction:void 0}),new Sm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:ise,getRenderStateFunction:w2t,getUniformMapFunction:void 0}),new Sm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:rse,getRenderStateFunction:ILe,getUniformMapFunction:mI}),new Sm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:NLe,getRenderStateFunction:PLe,getUniformMapFunction:mI}),new Sm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:b2t,getRenderStateFunction:ILe,getUniformMapFunction:mI}),new Sm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:x2t,getRenderStateFunction:PLe,getUniformMapFunction:mI}),new Sm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:wLe,getRenderStateFunction:I2t,getUniformMapFunction:mI}),new Sm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:wLe,getRenderStateFunction:P2t,getUniformMapFunction:mI})]}var DLe=new Array(WT),RLe=new Array(WT);qT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)RLe[r]=this._derivedCommandPacks[n[r]],DLe[r]=MLe[n[r]];M2t(this,e,i,n,DLe,RLe,t)}};function M2t(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=R2t(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=T2t(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=D2t(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}qT.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=MLe[r[a]];n.commandList.push(s[c])}};function LLe(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 OLe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var N2t=[fc.OPAQUE_FRONT_FACE,fc.OPAQUE_BACK_FACE],L2t=[fc.DEPTH_ONLY_FRONT_FACE,fc.DEPTH_ONLY_BACK_FACE,fc.DEPTH_ONLY_FRONT_AND_BACK_FACE];qT.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),LLe(s,a,t,i,r,N2t))};qT.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)&&OLe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,LLe(a,c,t,i,r,L2t),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}OLe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var $5=qT;var FLe=js(Ire(),1);function ose(){this._image=new Image}ose.prototype.isReady=function(){return!0};ose.prototype.shouldDiscardImage=function(e){return e===this._image};function YT(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 rr({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 ose),this._errorEvent=new be}Object.defineProperties(YT.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}}});YT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new YT(t);return n._metadata=e,n};YT.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]}};YT.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=VA.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=F2t(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){PH(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=B2t(f)),!l(d)&&(!l(p)||p)){let g=k2t(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:oy({uint8Array:f,format:d,flipY:!0})})};YT.prototype.pickFeatures=function(e,t,n,i,r){};function F2t(e,t,n,i,r,o){let s=VA.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 B2t(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 k2t(e){let t=FLe.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 BLe=YT;var U2t=600;function p0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:La.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??La.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??U2t}Object.defineProperties(p0.prototype,{});p0.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=La.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 sI({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};p0.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}};p0.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};p0.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}`)}};p0.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};p0.fromUrl=async function(e){if(e=e??{},e.key=e.key??La.defaultStreetViewStaticApiKey??La.defaultApiKey,!l(e.key)&&!l(La.defaultStreetViewStaticApiKey)&&!l(La.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new p0({...e})};p0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var kLe=p0;var z2t=new z(1,1,1,.4),V2t=new z(0,1,0,.05),j2t=new z(0,.5,0,.2);function XT(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 rr({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??z2t,this._glowColor=e.glowColor??V2t,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??j2t,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(XT.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}}});XT.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()};XT.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};XT.prototype.getTileCredits=function(e,t,n){};XT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};XT.prototype.pickFeatures=function(e,t,n,i,r){};var ULe=XT;function wm(){}wm._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);wm._decodeTaskProcessor=new Jn("decodeI3S",wm._maxDecodingConcurrency);wm._promise=void 0;async function H2t(){if(await wm._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return wm._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}wm.decode=async function(e,t,n,i,r){return l(wm._promise)||(wm._promise=H2t()),wm._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 J5=wm;function sse(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(sse.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});sse.prototype.load=async function(){return this._data=await g0.loadJson(this._resource),this._data};var Z5=sse;function f_(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(f_.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 Q5(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 G2t(e){return e==="String"?1:Q5(e)}async function W2t(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)}f_.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=W2t(this).catch(function(e){console.error(e)}),this._loadPromise)};f_.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}};f_.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};f_.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)}}}};f_.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=Q5(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=Q5(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};f_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=G2t(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};f_.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=Q5(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 e9=f_;function hM(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(hM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});hM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var q2t=new h,Y2t=new h,X2t=new h,K2t=new h,$2t=new h;function ase(e,t,n,i){let r=h.subtract(i,n,q2t),o=h.cross(r,h.subtract(e,n,Y2t),K2t),s=h.cross(r,h.subtract(t,n,X2t),$2t);return h.dot(o,s)>=0}var J2t=new h,Z2t=new h,Q2t=new h,ekt=new h,tkt=new h,nkt=new h,ikt=new h,rkt=new h,okt=new h,skt=new h;hM.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],J2t),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],Z2t),x=new h(u[y*3],u[y*3+1],u[y*3+2],Q2t);if(!ase(i,A,b,x)||!ase(i,b,A,x)||!ase(i,x,A,b))continue;let T=h.subtract(b,A,ekt),E=h.subtract(x,A,tkt),v=h.cross(T,E,nkt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,ikt),I=h.subtract(i,A,rkt),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,okt)),_=h.magnitudeSquared(h.subtract(i,x,skt));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 zLe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push($w(e[i])):t.push(e[i]);return t}hM.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=zLe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=zLe(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 mM=hM;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 Gh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await g0.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 VLe(e,t){let n=new e9(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(VLe(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 VLe(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 mM(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 mM(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 Z5(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+=ukt(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 Bc(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 J5.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 akt(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 ckt(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 jLe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await akt(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(!ckt(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=jLe(this,t);e.push(n)}return Promise.all(e)};Gh.prototype._hookedRequestContent=Gh.prototype.requestContent;Gh.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(()=>{jLe(e._i3sNode,n)})),e._isLoading=!1,t})}};function lkt(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 t9(e,t,n,i){let r=e+t*n;return i[r]}function ukt(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=t9(s,a,n.width,n.buffer),d=t9(c,a,n.width,n.buffer),p=t9(s,u,n.width,n.buffer),g=t9(c,u,n.width,n.buffer),m=lkt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Gh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var pM=pl;function n9(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(n9.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function cse(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push($w(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function pI(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=cse(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=cse(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=cse(a.color,a.transparency)))}break}}return n}function fkt(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=pI(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]=pI(r.symbol,t)}return n}}function dkt(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(pI(o.symbol,t)))}return i.symbols.push(void 0),i}}n9.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=pI(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=pI(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=fkt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=pI(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=dkt(i,n))}};function HLe(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?HLe(s,t,n,i):s}}function hkt(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 mkt(e,t,n){let i=t[n],r=hkt(e.ranges,i);return e.symbols[r]}n9.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=>HLe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>mkt(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 i9=n9;function Zu(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(Zu.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}}});Zu.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 i9(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()};Zu.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)}};Zu.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]}}};Zu.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 pM(this,t,!0)}else this._rootNode=new pM(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Zu.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]})};Zu._fetchJson=function(e){return e.fetchJson()};Zu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Zu._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]};Zu.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]))};Zu.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 Jo.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()})};Zu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Zu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ze(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var gI=Zu;function r9(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(r9.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}}});r9.prototype.load=async function(){return this._data=await g0.loadJson(this._resource),this._data};r9.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 o9=r9;function gM(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(gM.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}}});gM._fromData=async function(e,t,n,i){let r=new gM(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=gM._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 g0.loadJson(r._resource),c=new gI(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 s9=gM;var qLe=js(GLe(),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 le(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 pkt(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 WLe(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=pkt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=s9._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 o9(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 gI(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=WLe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await WLe(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 gkt=new U;function _kt(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,gkt),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 Ti&&(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===pm.LERC){let x=qLe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function ykt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await _kt(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=ykt(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 g0=ta;function _0(){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 hi({color:new z(0,0,0,0),owner:this}),this._clearCommand=new hi({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(_0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});_0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Akt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},bkt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},xkt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK,blending:nn.ALPHA_BLEND},Tkt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -10791,7 +10949,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,Pxt=`uniform sampler2D colorTexture; +`,Ekt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -10806,156 +10964,7 @@ void main() out_FragColor = color; #endif } -`;Fp.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 Qf({context:e,width:s,height:a,format:lu.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(vxt),this._rsClassified=Ge.fromCache(Sxt),this._rsDefault=Ge.fromCache(wxt)),!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)?Pxt:Ixt,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(vf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Fp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Fp.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))};Fp.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)};Fp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Fp.prototype.isDestroyed=function(){return!1};Fp.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()),le(this)};var iR=Fp;var Zs={};Zs.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Zs.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Zs.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Zs.defaultAccessToken=void 0;Zs.defaultShareKey=void 0;Zs._getAuthorizationHeader=function(){return l(Zs.defaultShareKey)?`Basic ${Zs.defaultShareKey}`:`Bearer ${Zs.defaultAccessToken}`};Zs.apiEndpoint=new De({url:"https://api.bentley.com"});Zs.getExports=async function(e,t){let n=new De({url:`${Zs.apiEndpoint}mesh-export`,headers:{Authorization:Zs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Zs.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}`)}};Zs.getRealityDataMetadata=async function(e,t){let n=new De({url:`${Zs.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Zs._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}`)}};Zs.getRealityDataURL=async function(e,t,n){let i=new De({url:`${Zs.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Zs._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 ba=Zs;var KCe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(KCe);var Fs=KCe;var $Ce={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze($Ce);var Hr=$Ce;var JCe=js(nf(),1);function Dxt(e){let t=new JCe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Zy=Dxt;function Io(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(Io.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var sS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Io.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):(sS.start=i,sS.stop=r,sS.isStartIncluded=o,sS.isStopIncluded=s,sS.data=a,new Io(sS))};Io.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Io.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 Io(e)};Io.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)))};Io.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)))};Io.intersect=function(e,t,n,i){if(!l(t))return Io.clone(Io.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 Io.clone(Io.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 Io),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};Io.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};Io.prototype.clone=function(e){return Io.clone(this,e)};Io.prototype.equals=function(e,t){return Io.equals(this,e,t)};Io.prototype.equalsEpsilon=function(e,t,n){return Io.equalsEpsilon(this,e,t,n)};Io.prototype.toString=function(){return Io.toIso8601(this)};Io.EMPTY=Object.freeze(new Io({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var vn=Io;var ZCe=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),QCe=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),Rxt=Object.freeze(new vn({start:ZCe,stop:QCe})),Oxt={MINIMUM_VALUE:ZCe,MAXIMUM_VALUE:QCe,MAXIMUM_INTERVAL:Rxt},it=Oxt;function oR(){this._cache={}}oR.prototype.fromColor=function(e,t){return Uj(void 0,void 0,e,t,this._cache)};oR.prototype.fromUrl=function(e,t,n){return Uj(e,void 0,t,n,this._cache)};oR.prototype.fromMakiIconId=function(e,t,n){return Uj(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};oR.prototype.fromText=function(e,t,n){return Uj(void 0,e,t,n,this._cache)};var Mxt=new z;function Nxt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Mxt).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 eve(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 rR=new Array(4);function Uj(e,t,n,i,r){rR[0]=e,rR[1]=t,rR[2]=n,rR[3]=i;let o=JSON.stringify(rR),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(Nxt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return eve(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=uv(t,{font:`bold ${i}px sans-serif`});eve(c,u,i)}return r[o]=a,a}var Qy=oR;function fte(e,t){return K.compare(e.start,t.start)}function _s(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(_s.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}}});_s.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof _s))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};_s.prototype.get=function(e){return this._intervals[e]};_s.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};_s.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};_s.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};_s.prototype.contains=function(e){return this.indexOf(e)>=0};var lte=new vn;_s.prototype.indexOf=function(e){let t=this._intervals;lte.start=e,lte.stop=e;let n=Dr(t,lte,fte);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)};_s.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]}};_s.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=Dr(n,e,fte);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)};_s.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Dr(t,e,fte);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};_s.prototype.intersect=function(e,t,n){let i=new _s,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};_s.fromJulianDateArray=function(e,t){l(t)||(t=new _s);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:it.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:it.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var ll=new Bm,sR=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ute(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,ll);let i=ll.millisecond+t.millisecond,r=ll.second+t.second,o=ll.minute+t.minute,s=ll.hour+t.hour,a=ll.day+t.day,c=ll.month+t.month,u=ll.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),sR[2]=ou(u)?29:28;a>sR[c]||c>=13;)a>sR[c]&&(a-=sR[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),sR[2]=ou(u)?29:28;return ll.millisecond=i,ll.second=r,ll.minute=o,ll.hour=s,ll.day=a,ll.month=c,ll.year=u,K.fromGregorianDate(ll,n)}var Lxt=new K,Fxt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function tve(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(Fxt);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,Lxt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var aR=new Bm;_s.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!tve(n[2],aR))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=ute(s,aR),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return _s.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};_s.fromIso8601DateArray=function(e,t){return _s.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)};_s.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)(tve(i[u],aR)||u===0)&&(r&&l(a)?s=ute(a,aR):s=ute(n,aR),o.push(s),a=s);return _s.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Bs=_s;var dte=function(e,t){return dte=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])},dte(e,t)};function Bp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dte(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 nve(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 ive(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 rve="4.1.5";var ove=Object.prototype.hasOwnProperty;function wf(e){return typeof e=="boolean"}function sve(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 eA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function im(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var zj=/\s+/,Vj=(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(zj):[],r=t.split(zj),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(zj):[],r=t.split(zj),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)ove.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function cve(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=Bxt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=ave(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=ave(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):hte(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+hte(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+hte(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 Bxt(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 ave(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 hte(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 lve(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 uve(e,t,n){return sve(e,t,n)}var fve=(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 Vj({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"?cve(t,i):r==="middle"?lve(t,i):uve(t,i)},e})();var kp=(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 dve(e){return e>=0&&e<=31||e==127}function Ug(e){return e>=65&&e<=90||e>=97&&e<=122}function ea(e){return e>=48&&e<=57}function jj(e){return e==34||e==39}function tA(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 rm(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 hve(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 mve(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 Hj(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function pve(e){return e<91?e==40:e==91||e==123}function mte(e){return e<93?e==41:e==93||e==125}var gve=/^(?: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 pte=/https?:\/\//i,_ve=new RegExp("^"+pte.source,"i"),kxt=/^(javascript|vbscript):/i,Uxt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,zxt=/^(?:\/\/)?([^/#?:]+)/,aS=Ug;function gte(e){return Ug(e)||ea(e)||e===43||e===45||e===46}var zg=rm;function Gj(e){return e===95||zg(e)}function _te(e){return rm(e)||mve(e)||Hj(e)}function Wj(e){return e===47||e===63||e===35}function yte(e){return gve.test(e.toLowerCase())}function yve(e){if(kxt.test(e))return!1;var t=e.match(Uxt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function Ave(e){var t=e.match(zxt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!yte(r)}var Vxt=/^(?:(?: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]?)$/,jxt=/[:/?#]/;function bve(e){var t=e.split(jxt,1)[0];return Vxt.test(t)}var Hxt=/^(https?:\/\/)?(?:www\.)?/i,Gxt=/^\/\//,xve=(function(e){Bp(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=Yxt(n)),this.stripPrefix.scheme&&(n=Wxt(n)),this.stripPrefix.www&&(n=qxt(n)),this.stripTrailingSlash&&(n=Xxt(n)),this.decodePercentEncoding&&(n=Kxt(n)),n},t})(kp);function Wxt(e){return e.replace(_ve,"")}function qxt(e){return e.includes("www.")?e.replace(Hxt,"$1"):e}function Yxt(e){return e.replace(Gxt,"")}function Xxt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Kxt(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 Tve=/^mailto:/i,Ate=rm;function qj(e){return Ate(e)||hve(e)}function Eve(e){var t=e.split(".").pop();return yte(t)}var Cve=(function(e){Bp(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})(kp);function bte(e){return e===95||rm(e)}function vve(e){return e.length<=140}var Sve=["twitter","facebook","instagram","tiktok","youtube"];var wve=(function(e){Bp(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:im(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})(kp);var $xt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function xte(e){return e===45||e===46||e===95||Ug(e)||ea(e)}function Ive(e,t){var n=$xt[t];return n.test(e)}var Pve=["twitter","instagram","soundcloud","tiktok","youtube"];var Dve=(function(e){Bp(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:im(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})(kp);var Jxt=/[-. ()]/,Zxt=/(?:(?:(?:(\+)?\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]+#?)*/,Qxt=/(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})/,eTt=new RegExp("^".concat(Zxt.source,"|").concat(Qxt.source,"$"));function Tte(e){return e===45||e===46||e===32}function Yj(e){return e===44||e===59}function Rve(e){var t=e.charAt(0)==="+"||Jxt.test(e);return t&&eTt.test(e)}var Ove=(function(e){Bp(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})(kp);var tTt=(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),Nve(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),Nve(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function Lve(e,t){for(var n=new tTt(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)Xj(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:aTt(n,s,r);break;case 12:cTt(n,s,r);break;case 0:nTt(n,s,r);break;case 1:iTt(n,s,r);break;case 2:rTt(n,s,r);break;case 3:oTt(n,s,r);break;case 4:sTt(n,s,i,r);break;case 5:lTt(n,s,r);break;case 6:uTt(n,s,i,r);break;case 7:fTt(n,s,i,r);break;case 13:dTt(n,s,r);break;case 14:hTt(n,s,r);break;case 8:mTt(n,s,r);break;case 9:pTt(n,s,r);break;case 10:gTt(n,s,r);break;case 15:_Tt(n,s,i,r);break;case 16:yTt(n,s,i,r);break;case 17:ATt(n,s,i,r);break;case 18:bTt(n,s,i,r);break;case 19:xTt(n,s,i,r);break;case 20:TTt(n,s,r);break;case 21:ETt(n,s,r);break;case 22:Yx(n,s,r);break;case 23:CTt(n,s,r);break;case 24:vTt(n,s,r);break;case 25:STt(n,s,r);break;case 26:wTt(n,s,r);break;case 27:ITt(n,s,r);break;case 28:PTt(n,s,r);break;case 29:DTt(n,s,r);break;case 30:RTt(n,s,r);break;case 31:OTt(n,s,r);break;case 32:NTt(n,s,i,r);break;case 33:LTt(n,s,r);break;case 34:FTt(n,s,r);break;case 35:BTt(n,s,r);break;case 36:kTt(n,s,i,r);break;case 37:MTt(n,s,i,r);break;case 38:UTt(n,s,i,r);break;case 39:zTt(n,s,i,r);break;case 40:VTt(n,s,r);break;case 41:jTt(n,s,r);break;default:im(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&aS(r)){var a=n.text.charCodeAt(n.charIdx-1);aS(a)||n.addMachine(Kj(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return ys(n,u)});return n.matches}function Xj(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(YTt(i,28));else if(n===64)e.addMachine(XTt(i,30));else if(n===47)e.addMachine(Cte(i,11));else if(n===43)e.addMachine(Ete(i,37));else if(n===40)e.addMachine(Ete(i,32));else{if(ea(n)&&(e.addMachine(Ete(i,38)),e.addMachine(WTt(i,13))),Ate(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(qTt(i,r))}aS(n)&&e.addMachine(Kj(i,0)),rm(n)&&e.addMachine(Cte(i,5))}}function nTt(e,t,n){n===58?t.state=2:n===45?t.state=1:gte(n)||e.removeMachine(t)}function iTt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Cte(i,11))):gte(n)?t.state=0:e.removeMachine(t))}function rTt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):zg(n)?(t.state=5,aS(n)&&e.addMachine(Kj(i,0))):e.removeMachine(t)}function oTt(e,t,n){n===47?t.state=4:_te(n)?(t.state=10,t.acceptStateReached=!0):ys(e,t)}function sTt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):zg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function aTt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function cTt(e,t,n){zg(n)?t.state=5:e.removeMachine(t)}function lTt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:Wj(n)?t.state=10:Gj(n)||ys(e,t)}function uTt(e,t,n,i){i===45||(i===46?ys(e,t):zg(i)?t.state=5:ys(e,t))}function fTt(e,t,n,i){i===46?ys(e,t):zg(i)?(t.state=5,t.acceptStateReached=!0):ys(e,t)}function dTt(e,t,n){n===46?t.state=14:n===58?t.state=8:ea(n)||(Wj(n)?t.state=10:rm(n)?e.removeMachine(t):ys(e,t))}function hTt(e,t,n){ea(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):ys(e,t)}function mTt(e,t,n){ea(n)?t.state=9:ys(e,t)}function pTt(e,t,n){ea(n)||(Wj(n)?t.state=10:ys(e,t))}function gTt(e,t,n){_te(n)||ys(e,t)}function _Tt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:Yx(e,t,i)}function yTt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:Yx(e,t,i)}function ATt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:Yx(e,t,i)}function bTt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:Yx(e,t,i)}function xTt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:Yx(e,t,i)}function TTt(e,t,n){n===58?t.state=21:Yx(e,t,n)}function ETt(e,t,n){qj(n)?t.state=22:e.removeMachine(t)}function Yx(e,t,n){n===46?t.state=23:n===64?t.state=24:qj(n)?t.state=22:e.removeMachine(t)}function CTt(e,t,n){n===46||n===64?e.removeMachine(t):qj(n)?t.state=22:e.removeMachine(t)}function vTt(e,t,n){zg(n)?t.state=25:e.removeMachine(t)}function STt(e,t,n){n===46?t.state=27:n===45?t.state=26:Gj(n)||ys(e,t)}function wTt(e,t,n){n===45||n===46?ys(e,t):Gj(n)?t.state=25:ys(e,t)}function ITt(e,t,n){n===46||n===45?ys(e,t):zg(n)?(t.state=25,t.acceptStateReached=!0):ys(e,t)}function PTt(e,t,n){bte(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function DTt(e,t,n){bte(n)||ys(e,t)}function RTt(e,t,n){xte(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function OTt(e,t,n){xte(n)||(rm(n)?e.removeMachine(t):ys(e,t))}function MTt(e,t,n,i){ea(i)?t.state=38:(e.removeMachine(t),Xj(e,n,i))}function NTt(e,t,n,i){ea(i)?t.state=33:e.removeMachine(t),Xj(e,n,i)}function LTt(e,t,n){ea(n)?t.state=34:e.removeMachine(t)}function FTt(e,t,n){ea(n)?t.state=35:e.removeMachine(t)}function BTt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function kTt(e,t,n,i){ea(i)?t.state=38:Tte(i)?t.state=39:e.removeMachine(t)}function UTt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,Yj(i)?t.state=40:i===35?t.state=41:ea(i)||(i===40?t.state=32:Tte(i)?t.state=39:(ys(e,t),aS(i)&&e.addMachine(Kj(r,0))))}function zTt(e,t,n,i){ea(i)?t.state=38:i===40?t.state=32:(ys(e,t),Xj(e,n,i))}function VTt(e,t,n){Yj(n)||(n===35?t.state=41:ea(n)?t.state=38:ys(e,t))}function jTt(e,t,n){Yj(n)?t.state=40:ea(n)?e.removeMachine(t):ys(e,t)}function ys(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=GTt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=pte.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!yve(p))return;break}case 1:{if(!Ave(p))return;break}case 2:{if(!bve(p))return;break}default:im(t)}n.push(new xve({tagBuilder:o,matchedText:p,offset:d,urlMatchType:HTt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{Eve(p)&&n.push(new Cve({tagBuilder:o,matchedText:p,offset:d,email:p.replace(Tve,"")}));break}case 2:{vve(p)&&n.push(new wve({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{Ive(p,f)&&n.push(new Dve({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),Rve(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new Ove({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:im(t)}}}function HTt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:im(e)}}var Mve={")":"(","}":"{","]":"["};function GTt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);pve(r)?t[i]++:mte(r)&&t[Mve[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if(mte(r)){var s=Mve[i];if(t[s]<0)t[s]++,o--;else break}else if(Hj(r))o--;else break}return e.slice(0,o+1)}function Kj(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Cte(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function WTt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function qTt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function YTt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function XTt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Ete(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function Nve(e){return e.type===0&&e.matchType===0}var Up=(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})(),Ste=new Up,KTt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Ste,this.html=t,this.callbacks=n}return e})();function Fve(e,t){for(var n=new KTt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:$Tt(n,r);break;case 1:JTt(n,r,o);break;case 2:QTt(n,r,o);break;case 3:ZTt(n,r,o);break;case 4:eEt(n,r,o);break;case 5:tEt(n,r,o);break;case 6:nEt(n,r,o);break;case 7:iEt(n,r,o);break;case 8:rEt(n,r);break;case 9:oEt(n,r);break;case 10:sEt(n,r,o);break;case 11:aEt(n,r,o);break;case 12:cEt(n,r);break;case 13:lEt(n);break;case 14:uEt(n,r);break;case 15:fEt(n,r);break;case 16:dEt(n,r);break;case 17:hEt(n,r);break;case 18:mEt(n,r);break;case 19:pEt(n,r);break;case 20:gEt(n,r);break;default:im(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&_Et(n)}function $Tt(e,t){t==="<"&&zp(e)}function JTt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Up(Qs(Qs({},e.currentTag),{isClosing:!0}))):t==="<"?zp(e):Ug(n)?(e.state=3,e.currentTag=new Up(Qs(Qs({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Ste)}function ZTt(e,t,n){tA(n)?(e.currentTag=new Up(Qs(Qs({},e.currentTag),{name:vte(e)})),e.state=4):t==="<"?zp(e):t==="/"?(e.currentTag=new Up(Qs(Qs({},e.currentTag),{name:vte(e)})),e.state=12):t===">"?(e.currentTag=new Up(Qs(Qs({},e.currentTag),{name:vte(e)})),Vp(e)):!Ug(n)&&!ea(n)&&t!==":"&&kd(e)}function QTt(e,t,n){t===">"?kd(e):Ug(n)?e.state=3:kd(e)}function eEt(e,t,n){tA(n)||(t==="/"?e.state=12:t===">"?Vp(e):t==="<"?zp(e):t==="="||jj(n)||dve(n)?kd(e):e.state=5)}function tEt(e,t,n){tA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?Vp(e):t==="<"?zp(e):jj(n)&&kd(e)}function nEt(e,t,n){tA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?Vp(e):t==="<"?zp(e):jj(n)?kd(e):e.state=5)}function iEt(e,t,n){tA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?kd(e):t==="<"?zp(e):e.state=10)}function rEt(e,t){t==='"'&&(e.state=11)}function oEt(e,t){t==="'"&&(e.state=11)}function sEt(e,t,n){tA(n)?e.state=4:t===">"?Vp(e):t==="<"&&zp(e)}function aEt(e,t,n){tA(n)?e.state=4:t==="/"?e.state=12:t===">"?Vp(e):t==="<"?zp(e):(e.state=4,yEt(e))}function cEt(e,t){t===">"?(e.currentTag=new Up(Qs(Qs({},e.currentTag),{isClosing:!0})),Vp(e)):kd(e)}function lEt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Up(Qs(Qs({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Up(Qs(Qs({},e.currentTag),{type:"doctype"})),e.state=20):kd(e)}function uEt(e,t){t==="-"?e.state=15:t===">"?kd(e):e.state=16}function fEt(e,t){t==="-"?e.state=18:t===">"?kd(e):e.state=16}function dEt(e,t){t==="-"&&(e.state=17)}function hEt(e,t){t==="-"?e.state=18:e.state=16}function mEt(e,t){t===">"?Vp(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function pEt(e,t){t==="-"?e.state=17:t===">"?Vp(e):e.state=16}function gEt(e,t){t===">"?Vp(e):t==="<"&&zp(e)}function kd(e){e.state=0,e.currentTag=Ste}function zp(e){e.state=1,e.currentTag=new Up({idx:e.charIdx})}function Vp(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)),kd(e),e.currentDataIdx=e.charIdx+1}function _Et(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function vte(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function yEt(e){e.charIdx--}var AEt=(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=bEt(t.urls),this.email=wf(t.email)?t.email:this.email,this.phone=wf(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=wf(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=xEt(t.stripPrefix),this.stripTrailingSlash=wf(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=wf(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Pve.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Sve.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=TEt(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 Fve(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,ive([],nve(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(EEt);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||eA(t,function(n){return n.getType()==="hashtag"}),this.email||eA(t,function(n){return n.getType()==="email"}),this.phone||eA(t,function(n){return n.getType()==="phone"}),this.mention||eA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||eA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||eA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||eA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=Lve(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 Vj)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new fve({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=rve,e})(),Bve=AEt;function bEt(e){return e==null&&(e=!0),wf(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:wf(e.schemeMatches)?e.schemeMatches:!0,tldMatches:wf(e.tldMatches)?e.tldMatches:!0,ipV4Matches:wf(e.ipV4Matches)?e.ipV4Matches:!0}}function xEt(e){return e==null&&(e=!0),wf(e)?{scheme:e,www:e}:{scheme:wf(e.scheme)?e.scheme:!0,www:wf(e.www)?e.www:!0}}function TEt(e){return typeof e=="number"?{length:e,location:"end"}:Qs({length:Number.POSITIVE_INFINITY,location:"end"},e)}function EEt(e,t){return e.getOffset()-t.getOffset()}var $j=Bve;var _O=js(nf(),1);jp();cc();Jx();w6();CR();var mwe={type:"module"},Jte="error",uCt="messageerror",pwe,$te,gwe,Zte=!0;try{Zte=typeof structuredClone==Po&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}dwe(fCt);function fCt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Po&&(o=o());let s;try{s=R6(e.workerURI,n,e)}catch{return Xte(e),Kte(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await dCt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return Xte(e),_we(e),D6(e,t);if(a&&a.codecImportFailed){if(e.reader)return _we(e),D6(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function dCt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(tT);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}=hCt(e.writable),f;try{f=Qte({type:swe,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(()=>mCt(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 hCt(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 _we(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function ene(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function R6(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if($te===ke||pwe!==e){let u=typeof e==Po;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===ke&&(i=!1),i&&(c=mwe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return R6(e,t,n,i,!1);if(i)throw p;return R6(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=mwe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return R6(e,t,n,!1,r);throw p}}pwe=e,$te=a,gwe=c}else s=new Worker($te,gwe);return s.addEventListener(owe,u=>{n.workerAlive=!0,Awe(n),pCt(u,n)}),s.addEventListener(Jte,u=>ywe(u,n)),s.addEventListener(uCt,u=>ywe(u,n)),s}function mCt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(ene(e),e.worker=null,t){let i=new Error(tT);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function Awe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function ywe(e,t){e.preventDefault&&e.preventDefault(),Awe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;ene(t),n||(t.worker=null);let s=e.error||new Error(e.message||Jte);n||(s=Object.assign(new Error(s.message||Jte),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function Qte(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=u6(o),c.push(e.value.buffer)),i&&Zte&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Zte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function pCt({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==awe){let{value:y,done:A}=await a.read();g()||Qte({type:Gte,value:y,done:A,messageId:r},t)}n==Gte&&(await c.ready,await c.write(new Uint8Array(i)),g()||Qte({type:cwe,messageId:r},t)),n==lwe&&m(null,o)}}catch(y){g()||(ene(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}xie();cc();jp();Qx();CR();L6();z6();Nte();Jx();_S();Ine();lR();var Mie="File already exists",Nie="Zip file comment exceeds 64KB",AIe="Invalid zip file comment (must be a Uint8Array)",bIe="File entry comment exceeds 64KB",xIe="Invalid file entry comment (must be a string)",TIe="Invalid date (must be a valid Date instance)",EIe="File entry name exceeds 64KB",Lie="Version exceeds 65535",CIe="The strength must equal 1, 2, or 3",vIe="Encryption is not supported in USDZ files",SIe="Encryption is not supported when the 'passThrough' option is set",wIe="Invalid extra field (must be a Map)",IIe="Invalid extra field type (must be integer 0..65535)",PIe="Invalid extra field data (must be a Uint8Array)",gH="Extra field data exceeds 64KB",Nvt="Compression method not supported",DIe=-2147483648,RIe=2147483647,lIe=BigInt(0),uIe=BigInt("0x7fffffffffffffff"),_H="Zip64 is not supported (set the 'zip64' option to 'true')",OIe="Undefined uncompressed size",MIe="Undefined compression method";var NIe="Undefined reader",LIe="Zip file not empty",FIe="Invalid uid (must be integer 0..2^32-1)",BIe="Invalid gid (must be integer 0..2^32-1)",kIe="Invalid UNIX mode (must be integer 0..65535)",UIe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",zIe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",VIe="Invalid msdosAttributesRaw (must be integer 0..255)",jIe="Invalid msdosAttributes (must be an object with boolean flags)",HIe="Invalid level (must be integer 0..9)",GIe="Signature data exceeds 64KB",fIe=new Uint8Array([7,0,2,0,65,69,3,0,0]),Lvt=4,Fvt=9,Bvt=67,kvt=1,Iie="infozip",Pie="unix",Uvt=9,Tie=0,dIe=[],zR=class{constructor(t,n={}){t=new IS(t);let{availableSize:i=Xx,maxSize:r=Xx}=t,o=i>0&&i!==Xx&&r>0&&r!==Xx;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[cR]===ke?t.size||t.writable.size||0:n[cR],initialOffset:n[cR]===ke?0:n[cR]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Eie(this,zvt(this,t))}appendZip(t){return Eie(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 Wg(t),await vc(t),(t.size===ke||!t.readUint8Array)&&(t=new ku(await Wp(t.readable)),await vc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(xie(),oIe)),d=new f(t),p=await d.getEntries();await d.close(),await vc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(Mie);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 oSt(t)||(await $p(n.writer,qIe()),n.offset+=4));let y=await sSt(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=WIe(L||fr),A.extraFieldAES&&(O=99);let D=Qi(L),N=!!R&&R.uncompressedSize!==ke,F=!!R&&R.compressedSize!==ke,V=JIe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=$Ie({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&&Sc(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:fr,rawExtraFieldAES:fr,rawExtraFieldExtendedTimestamp:fr,rawExtraFieldNTFS:fr,rawExtraFieldUnix:fr,rawExtraField:L,rawCentralExtraField:fr,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=Vvt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),Eie(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==Kx&&(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=fr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(AIe);if(Qi(t)>65535)throw new Error(Nie);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 eSt(i,t,n),!U6(o)&&Yi(i,n,r6)||await s.getWriter().close(),o.getData?o.getData():s}};var Die=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Eie(e,t){let n=new Die((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 zvt(e,t){if(e.filenames.size)throw new Error(LIe);await e.appendZipEntries(t)}async function Vvt(e,t,n,i){if(i=Object.assign({},i),Yi(e,i,iT)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Mie);e.filenames.add(t),Tie<jg().maxWorkers?Tie++:await new Promise(r=>dIe.push(r));try{return await jvt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=dIe.shift();r?r():Tie--}}async function jvt(e,t,n,i){let r=Hvt(e,t,i);({name:t}=r);let o=Gvt(e,t,i),{comment:s}=o,a=i[W6];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 hwe(jg())&&(p.level=0);let g=await Wvt(e,n,o,i);({reader:n}=g);let m=VR(e.writer),y=Xg(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[G6],crc32:i.crc32===ke?i[G6]:i.crc32,offset:e.offset-m,diskNumberStart:y,[lS]:e.options[lS]});let A=Kvt(i),b=Jvt(i),x=Qi(A.localHeaderArray,b.dataDescriptorArray);d=await Yvt(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,[V6]:d.internalFileAttributes,[j6]:d.externalFileAttributes}),new aA(d)}function Hvt(e,t,n){let i=Yi(e,n,_ne),r=Yi(e,n,bne,i?20:768),o=Yi(e,n,Tne),s=US(e,n,"uid"),a=US(e,n,"gid"),c=US(e,n,Cne),u=Yi(e,n,fSe),f=Yi(e,n,vne),d=Yi(e,n,Sne),p=Yi(e,n,wne);if(fS(s,4294967295,FIe),fS(a,4294967295,BIe),fS(c,65535,kIe),u!==ke&&u!==Iie&&u!==Pie)throw new Error(UIe);if(u===Pie&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(zIe);u===ke&&(s!==ke||a!==ke)&&(u=Iie);let g=US(e,n,pne),m=Yi(e,n,gne),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),fS(g,255,VIe),m&&(typeof m!==kve||Array.isArray(m)))throw new Error(jIe);if(r>65535)throw new Error(Lie);let b=KIe(e,n,mne,j6),x=b!==ke;x||(b=0),!n[iT]&&t.endsWith("/")&&(n[iT]=!0);let T=Yi(e,n,iT);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}=$vt(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 Gvt(e,t,n){let i=Rie(e,n,uSe)||hS,r=i(t,o6);if(r===ke&&(r=hS(t)),Qi(r)>65535)throw new Error(EIe);let o=n[PR]||"";if(typeof o!=Kx)throw new Error(xIe);let s=i(o,s6);if(s===ke&&(s=hS(o)),Qi(s)>65535)throw new Error(bIe);let a=Yi(e,n,Ane);if(a!==ke&&a>65535)throw new Error(Lie);let c=wie(e,n,PS,new Date),u=Yi(e,n,DS),f=wie(e,n,RR),d=wie(e,n,OR),p=KIe(e,n,hne,V6,0),g=Yi(e,n,Qj),m=Yi(e,n,Jj),y=Yi(e,n,Zj);l6(m,y);let A=US(e,n,eSe,3),b=Yi(e,n,xne),x=Yi(e,n,tSe,!0),T=Yi(e,n,nSe),E=Yi(e,n,iSe,!0),v=Yi(e,n,t6),S=Yi(e,n,i6),I=Yi(e,n,oSe),R=Rie(e,n,sSe),O=Yi(e,n,aSe,!0),L=c6(Yi(e,n,e6)),_=Yi(e,n,cSe,!0),C=Yi(e,n,Ene),w=g||C===ke?ke:A6(C);if(!g&&C!==ke&&C!==0&&C!==8&&!w)throw new Error(Nvt);let D=US(e,n,rSe);if(fS(D,Uvt,HIe),e.options[lS]){if(m!==ke||y!==ke)throw new Error(vIe);D===ke&&C===ke&&(D=0)}g&&(D=ke);let N=Yi(e,n,n6),F=Yi(e,n,Ite);I&&F===ke&&(F=!1),(F===ke||b&&!g)&&(F=!0),D!==ke&&D!=6&&(N=!1);let V=Yi(e,n,H6);if(!b&&(m!==ke||y!==ke)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(CIe);let B=Cie(n[W6]),j=Cie(n[dSe]),k=Cie(n[hSe]);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 Cie(e){if(!e)return fr;if(!(e instanceof Map))throw new Error(wIe);let t=0,n=0;e.forEach((o,s)=>{if(Rte(s,65535,IIe),!(o instanceof Uint8Array))throw new Error(PIe);if(Qi(o)>65535)throw new Error(gH);t+=4+Qi(o)});let i=new Uint8Array(t),r=li(i);return e.forEach((o,s)=>{Kp(r,n,s),Kp(r,n+2,Qi(o)),GR(i,o,n+4),n+=4+Qi(o)}),i}async function Wvt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Yi(e,i,iT))throw new Error(NIe);let r;return t&&(t=new Wg(t),await vc(t),{size:r}=t),Object.assign({reader:t},qvt(e,!!t,r,n,i))}function qvt(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[DR],y===ke)throw new Error(OIe);if(g===ke)throw new Error(MIe)}let A=d===!0,b=Yi(e,r,yne);if(t&&o&&!b&&Qi(a,c))throw new Error(SIe);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?yIe(y)+T:n):n===ke?(f=!0,(d||d===ke)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(Oie(g,p)?yIe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!Oie(g,p);E&&!s&&Yi(e,r,Ite)===ke&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(_H);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 Yvt(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[lS],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:Xx}),I.size=0,await vc(s)):(I=s,await R,await O()),await vc(I);let _=VR(s);e.addSplitZipSignature&&!b&&await pIe(e,s),y&&!b&&hIe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=Xg(s),D=jR(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await $p(I,C)),A=await Xvt(n,I,A,i,jg(),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 pIe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=Xg(s),A.offset=jR(e,s),y){let N=i.metadataSize;hIe(i,e.offset-VR(s)),A.size+=i.metadataSize-N}Qvt(A,d.localHeaderView,r),await $p(s,d.localHeaderArray),await YIe(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(){zS(s,Qi(d.localHeaderArray))&&await s.closeDisk()}}async function Xvt(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,yi={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:Ai}=t;if(e){let zn=sm(rne(e)),tn=e.size,Hn={options:{codecType:TS,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 N6({readable:zn,writable:Ai},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(_H)}catch(Ki){throw Ki.outputSize!==ke&&(t.size+=Ki.outputSize),Ki}}return Zvt({crc32:zi,compressedSize:ui,uncompressedSize:Si,headerInfo:a,dataDescriptorInfo:c},s),k&&await $p(t,O),Object.assign(yi,{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}),yi}function Kvt(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&&Oie(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=Pf(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=fr;let D;if(x&&!c){let xe=Pf(Qi(fIe)+2);xe.writeUint16(39169),xe.writeBytes(fIe),D=xe.array,D[8]=m}else D=fr;let N,F,V;if(y){let xe=hH(n),ge=XIe(xe);if(ge){let ve=9+(r?4:0)+(o?4:0),Re=Pf(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(gIe(hH(r))),o&&Re.writeUint32(gIe(hH(o))),F=Re.array}else F=fr;if(A===ke?!ge||!!(r||o):A)try{let ve=Sie(n),Re=Pf(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(ve),Re.writeUint64(r?Sie(r):ve),Re.writeUint64(o?Sie(o):ve),N=Re.array}catch{N=fr}else N=fr}else N=F=fr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==Iie&&(xe!==ke||ge!==ke)){let ve=mIe(xe===ke?0:xe),Re=mIe(ge===ke?0:ge),Qe=3+ve.length+Re.length,He=Pf(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==Pie&&(xe!==ke||ge!==ke)){let ve=Pf(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=fr}catch{B=fr}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[Lvt]=kvt),Kp(li(D),Fvt,R),R=99);let k=w?Qi(L):0,G=k+Qi(D,F,N,B,p,g),q=e[lS]?Bvt:0;if(G+q>65535)throw new Error(gH);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=$Ie({version:I,bitFlag:JIe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<cS?cS:Q>wte?wte:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=Pf(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||Sc(fe,18,0),T||Sc(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:fr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:N,rawExtraFieldUnix:B,rawExtraFieldAES:D,extraFieldLength:G}}function hIe(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);Kp(a,0,6534),Kp(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(Qi(c)+o),GR(i,c),GR(i,s,Qi(c));let u=li(i);Kp(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function mIe(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 $vt(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 Jvt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=fr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=li(i),n&&(o=4,Sc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function Zvt({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&&(Sc(u,10,e),c&&Sc(d,p,e)),o?c&&(HR(d,p+4,BigInt(t)),HR(d,p+12,BigInt(n))):(Sc(u,14,t),Sc(u,18,n),c&&(Sc(d,p+4,t),Sc(d,p+8,n)))}function Qvt({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)&&Sc(u,14,r),c||Sc(u,18,o),a||Sc(u,22,s)),n&&i){let p=30+Qi(e)+4;HR(u,p,BigInt(s)),HR(u,p+8,BigInt(o))}}async function eSt(e,t,n){let i=tSt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await nSt(e,i,n),a=await iSt(e,s,n);await rSt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function tSt(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=Pf(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=fr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=hH(p);if(f&&XIe(v)){let I=Pf(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=fr;n.rawExtraFieldExtendedTimestamp=E;let S=Qi(T,r,s,a,E,c,u);if(S>65535)throw new Error(gH);t+=46+Qi(i,o)+S}return t}async function nSt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await vc(r);let s=0,a=0,c=Xg(r),u=VR(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;zS(r,s+k-a)&&(await $p(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=Xg(r),u=VR(r)),L||Sc(O,18,V),_||Sc(O,14,B),(w||C)&&p.version<45&&Kp(O,0,45);let G=Pf(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),GR(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new aA(p))}catch{}}return await $p(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:Xg(r),entriesLength:f},directoryArray:o}}async function iSt(e,t,n){let i=Rie(e,n,ySe);if(i){let r=await i(t),o=Qi(r);if(o>65535)throw new Error(GIe);let s=Pf(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return zS(a,Qi(s.array))&&await a.closeDisk(),await $p(a,s.array),6+o}return 0}async function rSt(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=jR(e,o),p=Qi(t);if(p>65535)throw new Error(Nie);let g=Yi(e,n,H6),m=Xg(r);if(zS(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(_H);g=!0}let y=Pf(g?98:22);zS(r,Qi(y.array)+p)&&await r.closeDisk(),m=Xg(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(jR(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Yi(e,n,lSe,!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 $p(r,y.array),p&&await $p(r,t)}function Pf(e){let t=new Uint8Array(e),n=li(t),i=0;return{array:t,writeUint8:r=>{lSt(n,i,r),i+=1},writeUint16:r=>{Kp(n,i,r),i+=2},writeUint32:r=>{Sc(n,i,r),i+=4},writeUint64:r=>{HR(n,i,BigInt(r)),i+=8},writeBytes:r=>{GR(t,r,i),i+=Qi(r)},skip:r=>i+=r}}function Xg(e){let{diskNumber:t=0}=e;return t}function VR(e){let{diskOffset:t=0}=e;return t}function zS(e,t){let{availableSize:n=Xx}=e;return t>n}function jR(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function oSt(e){let t=await Do(e,0,4);return cSt(li(t),0)==134695760}function WIe(e){let t=li(e),n=0;for(;n+4<=Qi(e);){let i=4+pH(t,n+2);if(pH(t,n)==1)return WIe(Ud(e.subarray(0,n),e.subarray(Math.min(n+i,Qi(e)))));n+=i}return e}async function sSt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>dH(t,c)-dH(t,u)),a=0;for(let c of s){let u=dH(t,c);await vie(e,t,a,u-a),zS(r,await aSt(t,u))&&await r.closeDisk(),o.set(c,{offset:jR(e,r),diskNumberStart:Xg(r)}),a=u}await vie(e,t,a,i-a)}else{let s=e.offset;await vie(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+dH(t,a),diskNumberStart:0}))}return o}async function vie(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await YIe(rne(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 aSt(e,t){let n=await Do(e,t,30);if(Qi(n)<30)return 30;let i=li(n);return 30+pH(i,26)+pH(i,28)}function dH(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function qIe(){let e=new Uint8Array(4);return Sc(li(e),0,134695760),e}async function pIe(e,t){delete e.addSplitZipSignature,await $p(t,qIe()),e.offset+=4}async function $p(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 YIe(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 Sie(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<lIe?lIe:t>uIe?uIe:t}}function hH(e){return Math.floor(e.getTime()/1e3)}function XIe(e){return e>=DIe&&e<=RIe}function gIe(e){return Math.min(RIe,Math.max(DIe,e))}function Yi(e,t,n,i){let r=t[n]===ke?e.options[n]:t[n];return r===ke?i:r}function wie(e,t,n,i){let r=Yi(e,t,n,i);if(r===null)return i;if(r!==ke&&(typeof r.getTime!=Po||Number.isNaN(r.getTime())))throw new Error(TIe);return r}function Rie(e,t,n){return uS(Yi(e,t,n))}function KIe(e,t,n,i,r){let o=_Ie(t,n,i),s=o===ke?_Ie(e.options,n,i):o;return s===ke?r:s}function _Ie(e,t,n){return e[t]===ke?e[n]:e[t]}function US(e,t,n,i){return $x(Yi(e,t,n,i))}function yIe(e){return e+5*(Math.floor(e/16383)+1)}function Oie(e,t){return e===ke?t===ke||t>0:e!==0}function pH(e,t){return e.getUint16(t,!0)}function cSt(e,t){return e.getUint32(t,!0)}function lSt(e,t,n){e.setUint8(t,n)}function Kp(e,t,n){e.setUint16(t,n,!0)}function Sc(e,t,n){e.setUint32(t,n,!0)}function HR(e,t,n){e.setBigUint64(t,n,!0)}function GR(e,t,n){e.set(t,n)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function $Ie({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=Pf(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);Kp(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),Kp(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 JIe(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}z6();lR();jp();Qx();cc();jp();Qx();Hte();var SIi=1024*1024;_S();var PIi=1024*1024;var RIi=1024*1024;var OIi=512*1024;try{dS({baseURI:import.meta.url})}catch{}jp();var fSt=[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],dSt=[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],hSt=[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],mSt=[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],pSt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],qR=new Uint8Array(288);qR.fill(8,0,144),qR.fill(9,144,256),qR.fill(7,256,280),qR.fill(8,280,288);var gSt=new Uint8Array(30).fill(5);function WR(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 Df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ZIe(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+=Df[a>>18&63]+Df[a>>12&63]+Df[a>>6&63]+Df[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=Df[a>>18&63]+Df[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=Df[a>>18&63]+Df[a>>12&63]+Df[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(WR(qR),WR(gSt));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=fSt[T]+f(dSt[T]),v=m(b),S=hSt[v]+f(mSt[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[pSt[I]]=f(3);let E=WR(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[WR(v.subarray(0,A)),WR(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=Df.indexOf(n[o])<<18|Df.indexOf(n[o+1])<<12|(63&Df.indexOf(n[o+2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Cc/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)})}cc();jp();CR();L6();var bH="deflate",yH="deflate-raw",QIe="deflate64-raw",AH="gzip",bs,VS,Kg,YR,ePe;function tPe(e){if(bs=e,{malloc:VS,free:Kg,memory:YR}=bs,typeof VS!="function"||typeof Kg!="function"||!YR)throw bs=VS=Kg=YR=null,new Error("Invalid WASM module")}function nPe(e){ePe=e}function iPe(e,t,n={}){if(!bs){let a=new Error("WASM module not loaded");throw a.cause=ePe,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=VS(r),this.in=VS(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===AH?a=bs.deflate_init_gzip(this.streamHandle,i):t===yH?a=bs.deflate_init_raw(this.streamHandle,i):a=bs.deflate_init(this.streamHandle,i)):t===QIe?(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===yH?a=bs.inflate_init_raw(this.streamHandle):t===AH?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(YR.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&&Kg&&(Kg(this.in),this.in=0),this.in=VS(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(YR.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&&Kg&&Kg(a.in),a.in=0,a.out&&Kg&&Kg(a.out),a.out=0,c}}var uT=class{constructor(t=bH,n){return iPe(!0,t,n)}},fT=class{constructor(t=bH,n){return iPe(!1,t,n)}};uT.requiresModule=!0;fT.requiresModule=!0;uT.supportedFormats=[bH,yH,AH];fT.supportedFormats=[bH,yH,AH,QIe];var rPe=!1;async function oPe(e,{baseURI:t}){if(!rPe)try{await _St(e,t),rPe=!0}catch(n){throw nPe(n),n}}async function _St(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=ySt(e);else throw o}let r=await WebAssembly.instantiate(n);tPe(r.instance.exports)}function ySt(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 xH;fwe({initModule:e=>{if(!xH){let{wasmURI:t}=e;typeof t==Po&&(t=t()),xH=oPe(t,e).catch(n=>{throw xH=null,n})}return xH}});dS({CompressionStreamFallback:uT,DecompressionStreamFallback:fT});ZIe(dS);function ASt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var kn=ASt;function uA(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(uA.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});uA.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};uA.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))}};uA.prototype.equals=function(e){return this===e||e instanceof uA&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};uA.prototype.valueOf=function(){return this._value};uA.prototype.toString=function(){return String(this._value)};var mi=uA;function bSt(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 xSt(e){return new mi(e)}function TSt(e,t,n){return bSt(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??xSt)}var me=TSt;function XR(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(XR.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")});XR.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 XR(this)};XR.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 zl=XR;var sPe={FIXED:0,INERTIAL:1};Object.freeze(sPe);var Xi=sPe;function Fie(){this._removalFunctions=[]}Fie.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)}};Fie.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Qo=Fie;function cm(){pe.throwInstantiationError()}Object.defineProperties(cm.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});cm.prototype.getValue=pe.throwInstantiationError;cm.prototype.equals=pe.throwInstantiationError;cm.equals=function(e,t){return e===t||l(e)&&e.equals(t)};cm.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(!cm.equals(e[i],t[i]))return!1;return!0};cm.isConstant=function(e){return!l(e)||e.isConstant};cm.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};cm.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};cm.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=cm;function ESt(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 dT(){this._eventHelper=new Qo,this._definitionChanged=new be,this._intervals=new Bs,this._intervals.changedEvent.addEventListener(dT.prototype._intervalsChanged,this)}Object.defineProperties(dT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var CSt=new K;dT.prototype.getValue=function(e,t){l(e)||(e=K.now(CSt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};dT.prototype.equals=function(e){return this===e||e instanceof dT&&this._intervals.equals(e._intervals,X.equals)};dT.prototype._intervalsChanged=function(){ESt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Vl=dT;function fA(e){this._referenceFrame=e??Xi.FIXED,this._definitionChanged=new be,this._composite=new Vl,this._composite.definitionChanged.addEventListener(fA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(fA.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 vSt=new K;fA.prototype.getValue=function(e,t){return l(e)||(e=K.now(vSt)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};fA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};fA.prototype.equals=function(e){return this===e||e instanceof fA&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};fA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var wc=fA;function TH(){pe.throwInstantiationError()}Object.defineProperties(TH.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}});TH.prototype.update=function(e){pe.throwInstantiationError()};TH.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var ks=TH;function Bie(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??Fs.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??Hr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(Bie.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Hr.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===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Bie.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Hr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Hr.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===Fs.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===Fs.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 Jp=Bie;function SSt(e){return e}function wSt(e,t){return me(e,t,SSt)}var zu=wSt;function hT(){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(hT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:zu("startTime"),stopTime:zu("stopTime"),currentTime:zu("currentTime"),clockRange:zu("clockRange"),clockStep:zu("clockStep"),multiplier:zu("multiplier")});hT.prototype.clone=function(e){return l(e)||(e=new hT),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};hT.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};hT.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};hT.prototype.getValue=function(e){return l(e)||(e=new Jp),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 Zp=hT;var aPe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(aPe);var dA=aPe;function jS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(jS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});jS.prototype.getType=function(e){return"Color"};var ISt=new K;jS.prototype.getValue=function(e,t){return l(e)||(e=K.now(ISt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};jS.prototype.equals=function(e){return this===e||e instanceof jS&&X.equals(this._color,e._color)};var Kt=jS;var PSt=new U(1,1),DSt=!1,RSt=z.WHITE;function HS(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(HS.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")});HS.prototype.getType=function(e){return"Image"};var OSt=new K;HS.prototype.getValue=function(e,t){return l(e)||(e=K.now(OSt)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,PSt,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,RSt,t.color),X.getValueOrDefault(this._transparent,e,DSt)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};HS.prototype.equals=function(e){return this===e||e instanceof HS&&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 mT=HS;function MSt(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 mT;return t.image=e,t}}function NSt(e,t){return me(e,t,MSt)}var _o=NSt;function KR(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(KR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});KR.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 KR(this)};KR.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 GS=KR;function WS(){pe.throwInstantiationError()}Object.defineProperties(WS.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});WS.prototype.getValue=pe.throwInstantiationError;WS.prototype.getValueInReferenceFrame=pe.throwInstantiationError;WS.prototype.equals=pe.throwInstantiationError;var cPe=new $;WS.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,cPe);if(n===Xi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Xi.FIXED)return $.multiplyByVector($.transpose(o,cPe),t,r)};var Qp=WS;function pT(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Xi.FIXED}Object.defineProperties(pT.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Xi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var LSt=new K;pT.prototype.getValue=function(e,t){return l(e)||(e=K.now(LSt)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};pT.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)};pT.prototype.getValueInReferenceFrame=function(e,t,n){return Qp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};pT.prototype.equals=function(e){return this===e||e instanceof pT&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Vu=pT;function $R(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($R.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:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});$R.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 $R(this)};$R.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 qS=$R;function JR(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(JR.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:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});JR.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 JR(this)};JR.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 YS=JR;function ZR(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(ZR.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:_o("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")});ZR.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 ZR(this)};ZR.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 XS=ZR;function QR(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(QR.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:_o("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")});QR.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 QR(this)};QR.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 KS=QR;function eO(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(eO.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")});eO.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 eO(this)};eO.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 e0=eO;var kie=new lx;function tO(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(tO.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 FSt=new K;tO.prototype.getValue=function(e,t){return l(e)||(e=K.now(FSt)),l(t)||(t=new lx),t.translation=X.getValueOrClonedDefault(this._translation,e,kie.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,kie.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,kie.scale,t.scale),t};tO.prototype.equals=function(e){return this===e||e instanceof tO&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var $S=tO;function $g(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties($g.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}}});$g.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function BSt(e){return new mi(e)}$g.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??BSt)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};$g.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var kSt=new K;$g.prototype.getValue=function(e,t){l(e)||(e=K.now(kSt)),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};$g.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 USt(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}$g.prototype.equals=function(e){return this===e||e instanceof $g&&USt(this,e)};var ju=$g;function lPe(e){return new $S(e)}function zSt(e){return new ju(e,lPe)}function VSt(e){return new ju(e)}function jSt(e){return new ju(e)}function nO(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(nO.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,jSt),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,zSt),articulations:me("articulations",void 0,VSt),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});nO.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 nO(this)};nO.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 ju(t,lPe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new ju(n)}};var hA=nO;function iO(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(iO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});iO.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new iO(this)};iO.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var JS=iO;function rO(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(rO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:_o("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});rO.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 rO(this)};rO.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 mA=rO;function oO(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(oO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});oO.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 oO(this)};oO.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 EH=oO;function sO(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(sO.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")});sO.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 sO(this)};sO.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 ZS=sO;function HSt(e){return Array.isArray(e)&&(e=new tl(e)),new mi(e)}function aO(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(aO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,HSt),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:_o("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")});aO.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 aO(this)};aO.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 t0=aO;function cO(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(cO.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:_o("material"),depthFailMaterial:_o("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});cO.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 cO(this)};cO.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 jl=cO;function lO(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(lO.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:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});lO.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 lO(this)};lO.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 QS=lO;function uO(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(uO.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:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});uO.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 uO(this)};uO.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 n0=uO;function fO(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(fO.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:_o("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});fO.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 fO(this)};fO.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 pA=fO;var GSt=new he,Uie=[];function WSt(e){return new Vu(e)}function qSt(e){return me(e,void 0,WSt)}function Va(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Hd(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Jn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??dA.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",...Uie],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 zie(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)&&zie(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Hd.prototype,{availability:zu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:zu("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&&zie(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:zu("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&&zie(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Va("billboard",zl),box:Va("box",GS),corridor:Va("corridor",qS),cylinder:Va("cylinder",YS),description:me("description"),ellipse:Va("ellipse",XS),ellipsoid:Va("ellipsoid",KS),label:Va("label",e0),model:Va("model",hA),tileset:Va("tileset",JS),orientation:me("orientation"),path:Va("path",mA),plane:Va("plane",EH),point:Va("point",ZS),polygon:Va("polygon",t0),polyline:Va("polyline",jl),polylineVolume:Va("polylineVolume",QS),properties:Va("properties",ju),position:qSt("position"),rectangle:Va("rectangle",n0),viewFrom:me("viewFrom"),wall:Va("wall",pA)});Hd.registerEntityType=function(e,t){Object.defineProperties(Hd.prototype,{[e]:Va(e,t)}),Uie.includes(e)||Uie.push(e)};Hd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Hd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,zu(e,!0))};Hd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Hd.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 uPe=new $,fPe=new h,dPe=new Le;Hd.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,fPe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,dPe);return l(i)?t=M.fromRotationTranslation($.fromQuaternion(i,uPe),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};Hd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,fPe);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,GSt);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):ls(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,dPe);return l(c)?r=M.fromRotationTranslation($.fromQuaternion(c,uPe),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};Hd.supportsMaterialsforEntitiesOnTerrain=function(e){return Lu.supportsMaterials(e)};Hd.supportsPolylinesOnTerrain=function(e){return Np.isSupported(e)};var oo=Hd;function es(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??Wo.NONE}var hPe=es.SHOW_INDEX=0,gPe=es.POSITION_INDEX=1,YSt=es.COLOR_INDEX=2,XSt=es.OUTLINE_COLOR_INDEX=3,KSt=es.OUTLINE_WIDTH_INDEX=4,$St=es.PIXEL_SIZE_INDEX=5,JSt=es.SCALE_BY_DISTANCE_INDEX=6,ZSt=es.TRANSLUCENCY_BY_DISTANCE_INDEX=7,QSt=es.DISTANCE_DISPLAY_CONDITION_INDEX=8,ewt=es.DISABLE_DEPTH_DISTANCE_INDEX=9,twt=es.SPLIT_DIRECTION_INDEX=10;es.NUMBER_OF_PROPERTIES=11;function Rf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(es.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Rf(this,hPe))}},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),Rf(this,gPe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Rf(this,JSt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Rf(this,ZSt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Rf(this,$St))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Rf(this,YSt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Rf(this,XSt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Rf(this,KSt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Rf(this,QSt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Rf(this,ewt))}},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,Rf(this,hPe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Rf(this,twt))}}});es.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};es.prototype._getActualPosition=function(){return this._actualPosition};es.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Rf(this,gPe)};var mPe=new se;es._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(M.multiplyByPoint(n,e,mPe),pr.computeActualEllipsoidPosition(t,mPe))};var pPe=new se;es._computeScreenSpacePosition=function(e,t,n,i){let r=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,pPe),pPe);return pr.worldToWindowCoordinates(n,r,i)};es.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=es._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};es.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};es.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};es.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var ja=es;var gT=`in vec4 v_color; -in vec4 v_outlineColor; -in float v_innerPercent; -in float v_pixelDistance; -in vec4 v_pickColor; -in float v_splitDirection; -void main() -{ -if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; -if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; -float distanceToCenter = length(gl_PointCoord - vec2(0.5)); -float maxDistance = max(0.0, 0.5 - v_pixelDistance); -float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); -float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); -vec4 color = mix(v_outlineColor, v_color, innerAlpha); -color.a *= wholeAlpha; -#if !defined(OPAQUE) && !defined(TRANSLUCENT) -if (color.a < 0.005) -{ -discard; -} -#else -#ifdef OPAQUE -if (color.a < 0.995) -{ -discard; -} -#else -if (color.a >= 0.995) -{ -discard; -} -#endif -#endif -out_FragColor = czm_gammaCorrect(color); -czm_writeLogDepth(); -} -`;var CH=`uniform float u_maxTotalPointSize; -in vec4 positionHighAndSize; -in vec4 positionLowAndOutline; -in vec4 compressedAttribute0; -in vec4 compressedAttribute1; -in vec4 scaleByDistance; -in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; -out vec4 v_color; -out vec4 v_outlineColor; -out float v_innerPercent; -out float v_pixelDistance; -out vec4 v_pickColor; -out float v_splitDirection; -const float SHIFT_LEFT8 = 256.0; -const float SHIFT_RIGHT8 = 1.0 / 256.0; -void main() -{ -vec3 positionHigh = positionHighAndSize.xyz; -vec3 positionLow = positionLowAndOutline.xyz; -float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; -float totalSize = positionHighAndSize.w + outlineWidthBothSides; -float outlinePercent = outlineWidthBothSides / totalSize; -totalSize *= czm_pixelRatio; -float temp = compressedAttribute1.x * SHIFT_RIGHT8; -float show = floor(temp); -#ifdef EYE_DISTANCE_TRANSLUCENCY -vec4 translucencyByDistance; -translucencyByDistance.x = compressedAttribute1.z; -translucencyByDistance.z = compressedAttribute1.w; -translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -temp = compressedAttribute1.y * SHIFT_RIGHT8; -translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; -#endif -vec4 color = 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) -float lengthSq; -if (czm_sceneMode == czm_sceneMode2D) -{ -lengthSq = czm_eyeHeight2D.y; -} -else -{ -lengthSq = dot(positionEC.xyz, positionEC.xyz); -} -#endif -#ifdef EYE_DISTANCE_SCALING -totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); -#endif -if (totalSize > 0.0) { -totalSize += 3.0; -} -totalSize = min(totalSize, u_maxTotalPointSize); -if (totalSize < 1.0) -{ -positionEC.xyz = vec3(0.0); -totalSize = 1.0; -} -float translucency = 1.0; -#ifdef EYE_DISTANCE_TRANSLUCENCY -translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); -if (translucency < 0.004) -{ -positionEC.xyz = vec3(0.0); -} -#endif -#ifdef DISTANCE_DISPLAY_CONDITION -float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x; -float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y; -if (lengthSq < nearSq || lengthSq > farSq) { -positionEC.xyz = vec3(0.0, 0.0, 1.0); -} -#endif -gl_Position = czm_projection * positionEC; -czm_vertexLogDepth(); -#ifdef DISABLE_DEPTH_DISTANCE -float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z; -if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) -{ -disableDepthTestDistance = czm_minimumDisableDepthTestDistance; -} -if (disableDepthTestDistance != 0.0) -{ -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))) -{ -gl_Position.z = -gl_Position.w; -#ifdef LOG_DEPTH -czm_vertexLogDepth(vec4(czm_currentFrustum.x)); -#endif -} -} -#endif -v_color = color; -v_color.a *= translucency * show; -v_outlineColor = outlineColor; -v_outlineColor.a *= translucency * show; -v_innerPercent = 1.0 - outlinePercent; -v_pixelDistance = 2.0 / totalSize; -gl_PointSize = totalSize * show; -gl_Position *= show; -v_pickColor = pickColor; -v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; -} -`;var nwt=ja.SHOW_INDEX,Hie=ja.POSITION_INDEX,_Pe=ja.COLOR_INDEX,iwt=ja.OUTLINE_COLOR_INDEX,rwt=ja.OUTLINE_WIDTH_INDEX,owt=ja.PIXEL_SIZE_INDEX,yPe=ja.SCALE_BY_DISTANCE_INDEX,APe=ja.TRANSLUCENCY_BY_DISTANCE_INDEX,bPe=ja.DISTANCE_DISPLAY_CONDITION_INDEX,swt=ja.DISABLE_DEPTH_DISTANCE_INDEX,awt=ja.SPLIT_DIRECTION_INDEX,Gie=ja.NUMBER_OF_PROPERTIES,fl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Gd(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(Gie),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??Bi.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(Gd.prototype,{length:{get:function(){return Wie(this),this._pointPrimitives.length}}});function xPe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Gd.prototype.add=function(e){let t=new ja(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Gd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Gd.prototype.removeAll=function(){xPe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Wie(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}}Gd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Gd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Gd.prototype.get=function(e){return Wie(this),this._pointPrimitives[e]};Gd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Gie;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function cwt(e,t,n){return new V_(e,[{index:fl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Hie]},{index:fl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Hie]},{index:fl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[_Pe]},{index:fl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[APe]},{index:fl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[yPe]},{index:fl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[bPe]}],t)}var Vie=new Sn,vH=new z;function TPe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,Vie);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[fl.positionHighAndSize],u=Vie.high;c(r,u.x,u.y,u.z,s);let f=n[fl.positionLowAndOutline],d=Vie.low;f(r,d.x,d.y,d.z,a)}var lwt=256;function EPe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;vH.red=o.alpha,vH.green=s.alpha,vH.blue=a.alpha;let c=n[fl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(vH))}function CPe(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)*lwt+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[fl.compressedAttribute1];g(r,d,p,o,a)}function vPe(e,t,n,i){let r=i._index,o=n[fl.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 SPe(e,t,n,i){let r=i._index,o=n[fl.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 uwt(e,t,n,i){TPe(e,t,n,i),EPe(e,t,n,i),CPe(e,t,n,i),vPe(e,t,n,i),SPe(e,t,n,i)}function jie(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=ja._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function fwt(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)&&jie(e,i,i.length,t,o,!0)):n===re.MORPHING?jie(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&jie(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function dwt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var hwt=[];Gd.prototype.update=function(e){if(Wie(this),!this.show)return;this._maxTotalPointSize=Ut.maximumAliasedPointSize,fwt(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<Gie;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=cwt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,uwt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=hwt;v.length=0,(o[Hie]||o[rwt]||o[owt])&&v.push(TPe),(o[_Pe]||o[iwt])&&v.push(EPe),(o[nwt]||o[APe])&&v.push(CPe),o[yPe]&&v.push(vPe),(o[bPe]||o[swt]||o[awt])&&v.push(SPe);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,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=M.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),dwt(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Bi.OPAQUE||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Bi.TRANSLUCENT||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:nn.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:[CH]}),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===Bi.OPAQUE_AND_TRANSLUCENT&&(y=new Xe({defines:["OPAQUE"],sources:[gT]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:fl}),y=new Xe({defines:["TRANSLUCENT"],sources:[gT]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:fl})),this._blendOption===Bi.OPAQUE&&(y=new Xe({sources:[gT]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:fl})),this._blendOption===Bi.TRANSLUCENT&&(y=new Xe({sources:[gT]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:fl})),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===Bi.OPAQUE,I=this._blendOption===Bi.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)}}};Gd.prototype.isDestroyed=function(){return!1};Gd.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(),xPe(this._pointPrimitives),le(this)};var dO=Gd;var wPe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],qie=1,hO=8,ts=new Uint32Array(96),pO=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!==qie)throw new Error(`Got v${r} data when expected v${qie}.`);let o=wPe[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=wPe.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,hO,t),this.coords=new i(o,hO+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(hO+a+c+u);this.ids=new this.IndexArrayType(f,hO,t),this.coords=new i(f,hO+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(qie<<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 Xie(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;ts[0]=0,ts[1]=o.length-1,ts[2]=0;let c=3,u=[];for(;c>0;){let f=ts[--c],d=ts[--c],p=ts[--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)&&(ts[c++]=p,ts[c++]=g-1,ts[c++]=1-f),(f===0?i>=m:r>=y)&&(ts[c++]=g+1,ts[c++]=d,ts[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;ts[0]=0,ts[1]=o.length-1,ts[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=ts[--c],p=ts[--c],g=ts[--c];if(p-g<=a){for(let b=g;b<=p;b++)IPe(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];IPe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(ts[c++]=g,ts[c++]=m-1,ts[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(ts[c++]=m+1,ts[c++]=p,ts[c++]=1-d)}return u}};function Xie(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;PPe(e,t,s,i,r,o),Xie(e,t,n,i,s-1,1-o),Xie(e,t,n,s+1,r,1-o)}function PPe(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));PPe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(mO(e,t,i,n),t[2*r+o]>s&&mO(e,t,i,r);a<c;){for(mO(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?mO(e,t,i,c):(c++,mO(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function mO(e,t,n,i){Yie(e,n,i),Yie(t,2*n,2*i),Yie(t,2*n+1,2*i+1)}function Yie(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function IPe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function lm(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 DPe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var mwt=new et;function RPe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=yx.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Lr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=ja.getScreenSpaceBoundingBox(e,t,r)),DPe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&MPe(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=yx.getScreenSpaceBoundingBox(s,t,mwt);DPe(a,n),r=et.union(r,a,r)}return r}function pwt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&MPe(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 OPe(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 MPe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Kie(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 gwt=new et,_wt=new et,ywt=new et;function Awt(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 fg({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new od({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new dO;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 Ip(y,A),x=[];e._clusterLabels&&Kie(i,x,n,b,e),e._clusterBillboards&&Kie(r,x,n,b,e),e._clusterPoints&&Kie(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,D;if(x.length>0){let N=new pO(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=Lr._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(OPe(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=RPe(V,F.coord,u,e,gwt);let B=et.clone(S,_wt);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=RPe(k,L.coord,u,e,ywt);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(OPe(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 pwt(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}}lm.prototype._initialize=function(e){this._scene=e;let t=Awt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(lm.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 Jie(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 Zie(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}lm.prototype.getLabel=Jie("_labelCollection",fg,"_unusedLabelIndices","labelIndex");lm.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,Zie(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};lm.prototype.getBillboard=Jie("_billboardCollection",od,"_unusedBillboardIndices","billboardIndex");lm.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,Zie(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};lm.prototype.getPoint=Jie("_pointCollection",dO,"_unusedPointIndices","pointIndex");lm.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,Zie(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function $ie(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function bwt(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,$ie(e._labelCollection),$ie(e._billboardCollection),$ie(e._pointCollection))}lm.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,bwt(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)};lm.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 Wd=lm;var NPe={id:void 0};function gO(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 dl(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=Jn(),this._show=!0,this._firing=!1,this._refire=!1}dl.prototype.suspendEvents=function(){this._suspendCount++};dl.prototype.resumeEvents=function(){this._suspendCount--,gO(this)};Object.defineProperties(dl.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}}});dl.prototype.computeAvailability=function(){let e=it.MAXIMUM_VALUE,t=it.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(it.MINIMUM_VALUE)&&(e=a),K.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 vn({start:e,stop:t})};dl.prototype.add=function(e){e instanceof oo||(e=new oo(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(dl.prototype._onEntityDefinitionChanged,this),gO(this),e};dl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};dl.prototype.contains=function(e){return this._entities.get(e.id)===e};dl.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(dl.prototype._onEntityDefinitionChanged,this),gO(this),!0):!1};dl.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(dl.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),gO(this)};dl.prototype.getById=function(e){return this._entities.get(e)};dl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(NPe.id=e,t=new oo(NPe),this.add(t)),t};dl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),gO(this)};var lc=dl;function xwt(e,t){this.position=e,this.headingPitchRoll=t}var SH=xwt;function Twt(e,t){this.position=e,this.headingPitchRange=t}var wH=Twt;function IH(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=[]}IH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};IH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;FPe.call(this,e,t,function(i){n.playlistIndex=0,i||LPe(n._activeEntries),n.tourEnd.raiseEvent(i)})};IH.prototype.stop=function(){LPe(this._activeEntries)};function LPe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function FPe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=Ewt.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 Ewt(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++,FPe.call(this,e,t,n)}}var PH=IH;function DH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}DH.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 ue(this.view.position);t.flyToBoundingSphere(r,i)}};DH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};DH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ps.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 RH=DH;function Qie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Qie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Qie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var OH=Qie;function Jg(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Qo,this._referenceFrame=t??Xi.FIXED,this.setValue(e)}Object.defineProperties(Jg.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 Cwt=new K;Jg.prototype.getValue=function(e,t){return l(e)||(e=K.now(Cwt)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};Jg.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};Jg.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,Jg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Jg.prototype.equals=function(e){return this===e||e instanceof Jg&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};Jg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var gA=Jg;function BPe(e,t,n){let i=new WeakRef(t),r=e.addEventListener(function(){let o=i.deref();l(o)?n.apply(o,arguments):r()});return r}function _T(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}e._removeTargetListener=BPe(n.definitionChanged,e,qd.prototype._onTargetEntityDefinitionChanged),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 qd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,this._removeTargetListener=void 0,BPe(e.collectionChanged,this,qd.prototype._onCollectionChanged)}Object.defineProperties(qd.prototype,{isConstant:{get:function(){return X.isConstant(_T(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=_T(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 _T(this)}}});qd.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 qd(e,n,i)};var vwt=new K;qd.prototype.getValue=function(e,t){let n=_T(this);return l(e)||(e=K.now(vwt)),l(n)?n.getValue(e,t):void 0};qd.prototype.getValueInReferenceFrame=function(e,t,n){let i=_T(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};qd.prototype.getType=function(e){let t=_T(this);return l(t)?t.getType(e):void 0};qd.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};qd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};qd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=_T(this),l(i)&&this._definitionChanged.raiseEvent(this))};var _A=qd;var kPe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(kPe);var Hu=kPe;var ere=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}},yT=ere;var UPe={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 zPe(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 VPe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var tre=[],nre=[];function MH(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=VPe(i[o],e),c=Dr(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=VPe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(tre[p++]=f,o=o+1,s=0;s<r;s++)nre[g++]=i[o],o=o+1;a=f}p>0&&(nre.length=g,zPe(n,u,nre),tre.length=p,zPe(t,c,tre))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function Yd(e,t){let n=e;n===Number&&(n=UPe);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=UPe);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=yT,this._lastInterpolationAlgorithm=yT,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=Hu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Hu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Yd.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 Swt=new K;Yd.prototype.getValue=function(e,t){l(e)||(e=K.now(Swt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Dr(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===Hu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===Hu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===Hu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Hu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===Hu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===Hu.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)};Yd.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))};Yd.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)}MH(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Yd.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)}MH(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Yd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Yd.prototype.addSamplesPackedArray=function(e,t){MH(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Yd.prototype.removeSample=function(e){let t=Dr(this._times,e,K.compare);return t<0?!1:(jPe(this,t,1),!0)};function jPe(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)}Yd.prototype.removeSamples=function(e){let t=this._times,n=Dr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Dr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,jPe(this,n,i-n)};Yd.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};Yd._mergeNewSamples=MH;var Xd=Yd;function Kd(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 Xd(h,n),this._definitionChanged=new be,this._referenceFrame=e??Xi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Kd.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 wwt=new K;Kd.prototype.getValue=function(e,t){return l(e)||(e=K.now(wwt)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};Kd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Qp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Kd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Kd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Kd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Kd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Kd.prototype.removeSample=function(e){return this._property.removeSample(e)};Kd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Kd.prototype.equals=function(e){return this===e||e instanceof Kd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ic=Kd;function yA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(yA.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:Xi.FIXED}}});var Iwt=new K;yA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Iwt)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};yA.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))};yA.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};yA.prototype.equals=function(e){return this===e||e instanceof yA&&this._value===e._value};yA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Zg=yA;function AT(){this._definitionChanged=new be,this._intervals=new Bs,this._intervals.changedEvent.addEventListener(AT.prototype._intervalsChanged,this)}Object.defineProperties(AT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Pwt=new K;AT.prototype.getValue=function(e,t){l(e)||(e=K.now(Pwt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};AT.prototype.equals=function(e){return this===e||e instanceof AT&&this._intervals.equals(e._intervals,X.equals)};AT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var AA=AT;var ZPe={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=v_(t),ZPe[t]}},dre;typeof DOMParser<"u"&&(dre=new DOMParser);var Dwt=new $j({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),bA=32,HPe=2414016,GPe=1,WPe=16093e3,qPe=.1,YPe=[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"],XPe=["http://www.google.com/kml/ext/2.2"],Rwt=["http://www.w3.org/2005/Atom"],Ve={kml:YPe,gx:XPe,atom:Rwt,kmlgx:YPe.concat(XPe)},hre={Document:cDe,Folder:$wt,Placemark:Jwt,NetworkLink:sIt,GroundOverlay:iIt,PhotoOverlay:fDe,ScreenOverlay:nIt,Tour:Qwt},are=class{constructor(t){this._dataSource=t,this._deferred=rf(),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=Qg._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=Qg._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=hre[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||Qg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function Owt(e){let t=e.slice(0,Math.min(4,e.size)),n=rf(),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 Mwt(e){let t=rf(),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 QPe(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 eDe(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 Nwt(e,t){let n=await e.getData(new IR);n=QPe(n),n=eDe(n),t.kml=dre.parseFromString(n,"application/xml")}async function ire(e,t){let n=ZPe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new SR(n));t[e.filename]=i}function Of(e,t,n,i){let r=i.keys,o=new _O.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 _O.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 Mf(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=mre(a,i);l(c)&&s.setAttribute(n,c.url)}}function tDe(e,t,n){let i=xa(e,"id");i=l(i)&&i.length!==0?i:Jn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Jn(),l(n)&&(i=n+i)),r=t.add(new oo({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new fre),r}function yO(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function BH(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 NH(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++]=BH(n[s],t);return r}function xA(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 KPe(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 um(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 fm(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 mre(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 _O.default(t.getUrlComponent()),s=new _O.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Gu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function cre(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?(Gu.maximumRed=o,Gu.red=void 0):(Gu.maximumRed=void 0,Gu.red=0),r>0?(Gu.maximumGreen=r,Gu.green=void 0):(Gu.maximumGreen=void 0,Gu.green=0),i>0?(Gu.maximumBlue=i,Gu.blue=void 0):(Gu.maximumBlue=void 0,Gu.blue=0),Gu.alpha=n,z.fromRandom(Gu)):new z(o,r,i,n)}function bT(e,t,n){let i=Ln(e,t,n);if(l(i))return cre(i,Ln(e,"colorMode",n)==="random")}function Lwt(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 Bs;return r.addInterval(new vn({start:i,stop:it.MAXIMUM_VALUE})),r}function Fwt(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 Bs,n.addInterval(new vn({start:r,stop:s}))}else l(r)?(n=new Bs,n.addInterval(new vn({start:r,stop:it.MAXIMUM_VALUE}))):l(s)&&(n=new Bs,n.addInterval(new vn({start:it.MINIMUM_VALUE,stop:s})));return n}function nDe(){let e=new zl;return e.width=bA,e.height=bA,e.scaleByDistance=new qt(HPe,GPe,WPe,qPe),e.pixelOffsetScaleByDistance=new qt(HPe,GPe,WPe,qPe),e}function pre(){let e=new t0;return e.outline=!0,e.outlineColor=z.WHITE,e}function iDe(){let e=new e0;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Wi.LEFT,e.font="16px sans-serif",e.style=So.FILL_AND_OUTLINE,e}function gre(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=mre(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(Xf(FH(d))),l(p)&&s.setQueryParameters(Xf(FH(p)));let g=t._ellipsoid;return yre(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function Bwt(e,t,n,i,r){let o=vi(t,"scale",Ve.kml),s=vi(t,"heading",Ve.kml),a=bT(t,"color",Ve.kml),c=er(t,"Icon",Ve.kml),u=gre(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=xA(m,"x"),A=xA(m,"y"),b=xa(m,"xunits"),x=xa(m,"yunits"),T=n.billboard;l(T)||(T=nDe(),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-bA)*o:b==="fraction"&&(E=-y*bA*o),E+=bA*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+bA)*o:x==="fraction"&&(v=A*bA*o),v-=bA*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function LH(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")Bwt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=iDe(),n.label=c),c.scale=vi(a,"scale",Ve.kml)??c.scale,c.fillColor=bT(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new jl,n.polyline=c),c.width=vi(a,"width",Ve.kml),c.material=bT(a,"color",Ve.kml),l(bT(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(fm(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=pre(),n.polygon=c),c.material=bT(a,"color",Ve.kml)??c.material,c.fill=fm(a,"fill",Ve.kml)??c.fill,c.outline=fm(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=cre(Ln(a,"bgColor",Ve.kml))??z.WHITE,u=cre(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 kwt(e,t,n,i,r){let o=new oo,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")LH(e,d,o,i,r);else{let p=um(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);LH(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 Uwt(e,t,n){return t.fetchXML().then(function(i){return rDe(e,i,n,t,!0)})}function rDe(e,t,n,i,r,o){let s,a,c,u,f=KPe(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 oo({id:a}),n.add(c),LH(e,u,c,i,o)))}let d=KPe(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=um(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),LH(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(Uwt(e,x,n))}}}return p}function _re(e,t,n){let i=new _A(e,t.id,["position"]),r=new Zg(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new jl,t.polyline.positions=new gA([i,r])}function oDe(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 zwt(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 Zg(e))}function Vwt(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 kH(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():iDe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():nDe(),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 sDe(e,t){let n=e.path;l(n)||(n=new mA,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function jwt(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=fm(n,"extrude",Ve.kml),u=e._ellipsoid,f=BH(o,u);return i.position=f,kH(e,i,r,oDe(s,a)),c&&yO(s,a)&&_re(t,i,r),!0}function $Pe(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=fm(n,"extrude",Ve.kml),u=fm(n,"tessellate",Ve.kml),f=yO(s,a),d=vi(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=NH(o,p),m=r.polyline;if(f&&c){let y=new pA;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 jl;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(it.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 jl,i.polyline=m,m.positions=Vwt(g,s,a,p),(!u||f)&&(m.arcType=fn.NONE);return!0}function Hwt(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=NH(a,c),f=fm(n,"extrude",Ve.kml),d=Ln(n,"altitudeMode",Ve.kml),p=Ln(n,"altitudeMode",Ve.gx),g=yO(d,p),m=l(r.polygon)?r.polygon.clone():pre(),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 tl(u),b=um(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=um(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=er(s[T],"coordinates",Ve.kml),u=NH(a,c),l(u)&&A.holes.push(new tl(u))}m.hierarchy=A}return!0}function Gwt(e,t,n,i,r){let o=Ln(n,"altitudeMode",Ve.kml),s=Ln(n,"altitudeMode",Ve.gx),a=um(n,"coord",Ve.gx),c=um(n,"angles",Ve.gx),u=um(n,"when",Ve.kml),f=fm(n,"extrude",Ve.kml),d=yO(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=BH(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new Ic;return A.addSamples(y,m),i.position=A,kH(e,i,r,oDe(o,s)),sDe(i,r),i.availability=new Bs,u.length>0&&i.availability.addInterval(new vn({start:y[0],stop:y[y.length-1]})),d&&f&&_re(t,i,r),!0}function JPe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new Ic;d.addSamples(e,t),n.intervals.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:zwt(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 Wwt(e,t,n,i,r){let o=fm(n,"interpolate",Ve.gx),s=um(n,"Track",Ve.gx),a,c,u,f=!1,d=new AA,p=new Bs,g=new wc,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=um(b,"when",Ve.kml),T=um(b,"coord",Ve.gx),E=Ln(b,"altitudeMode",Ve.kml),v=Ln(b,"altitudeMode",Ve.gx),S=yO(E,v),I=fm(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=BH(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&JPe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),JPe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,kH(e,i,r),sDe(i,r),f&&(_re(t,i,r),i.polyline.show=d),!0}var aDe={Point:jwt,LineString:$Pe,LinearRing:$Pe,Polygon:Hwt,Track:Gwt,MultiTrack:Wwt,MultiGeometry:qwt,Model:Ywt};function qwt(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=aDe[f.localName];if(l(d)){let p=tDe(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 Ywt(e,t,n,i,r){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Xwt(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=um(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 Ur;typeof document<"u"&&(Ur=document.createElement("div"));function Kwt(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=Dwt.link(m),Ur.innerHTML=m;let A=Ur.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Of(Ur,"a","href",i),Of(Ur,"link","href",i),Of(Ur,"area","href",i),Of(Ur,"img","src",i),Of(Ur,"iframe","src",i),Of(Ur,"video","src",i),Of(Ur,"audio","src",i),Of(Ur,"source","src",i),Of(Ur,"track","src",i),Of(Ur,"input","src",i),Of(Ur,"embed","src",i),Of(Ur,"script","src",i),Of(Ur,"video","poster",i)),Mf(Ur,"a","href",r),Mf(Ur,"link","href",r),Mf(Ur,"area","href",r),Mf(Ur,"img","src",r),Mf(Ur,"iframe","src",r),Mf(Ur,"video","src",r),Mf(Ur,"audio","src",r),Mf(Ur,"source","src",r),Mf(Ur,"track","src",r),Mf(Ur,"input","src",r),Mf(Ur,"embed","src",r),Mf(Ur,"script","src",r),Mf(Ur,"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+=`${Ur.innerHTML}</div>`,Ur.innerHTML="",t.description=b}function UH(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=tDe(t,i,n.context),c=a.kml,u=kwt(e,t,n.styleCollection,o,s),f=Ln(t,"name",Ve.kml);a.name=f,a.parent=r;let d=Fwt(t);l(d)||(d=Lwt(t)),a.availability=d,Are(a);function p(T){return T?T.show&&p(T.parent):!0}let g=fm(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),Xwt(t,a),Kwt(t,a,u,s,o);let x=e._ellipsoid;return uDe(t,a,x),lDe(t,a,x),l(er(t,"Region",Ve.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function cDe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function $wt(e,t,n,i){let r=UH(e,t,n),o=Ze(n);o.parentEntity=r.entity,cDe(e,t,o,i)}function Jwt(e,t,n,i){let r=UH(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=aDe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),kH(e,o,s))}var Zwt={FlyTo:tIt,Wait:eIt,SoundCue:rre,AnimatedUpdate:rre,TourControl:rre};function Qwt(e,t,n,i){let r=Ln(t,"name",Ve.kml),o=xa(t,"id"),s=new PH(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=Zwt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function rre(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function eIt(e,t){let n=vi(t,"duration",Ve.gx);e.addPlaylistEntry(new OH(n))}function tIt(e,t,n){let i=vi(t,"duration",Ve.gx),r=Ln(t,"flyToMode",Ve.gx),o={kml:{}};uDe(t,o,n),lDe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new RH(i,r,s);e.addPlaylistEntry(a)}function lDe(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=Uc.fromDegrees(a,c-90,u);t.kml.camera=new SH(f,d)}}function uDe(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 Eh(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new wH(d,f)}}function nIt(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=gre(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=xA(g,"x"),y=xA(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=xA(p,"x"),y=xA(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=xA(d,"x"),y=xA(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 iIt(e,t,n,i){let o=UH(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=NH(er(t,"LatLonQuad",Ve.gx),c),f=vi(t,"drawOrder",Ve.kml);if(l(u))s=pre(),s.hierarchy=new tl(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new n0,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=gre(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=bT(t,"color",Ve.kml),s.material.transparent=!0}else s.material=bT(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 fDe(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 TA={INTERVAL:0,EXPIRE:1,STOP:2};function FH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var rIt=new ie,ew=new he,ore=new U,oIt=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=wE(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??rIt,l(n)&&(ore.x=n.clientWidth*.5,ore.y=n.clientHeight*.5,u=t.pickEllipsoid(ore,o,oIt)),l(u)?f=o.cartesianToCartographic(u,ew):(f=ie.center(r,ew),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,ew),c=c.replace("[cameraLon]",P.toDegrees(ew.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(ew.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(ew.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(Xf(c))}function sIt(e,t,n,i){let o=UH(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=mre(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(Xf(FH(b))),l(x)&&u.setQueryParameters(Xf(FH(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 lc,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,Are(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:Jn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Xf(Ln(v,"cookie",Ve.kml)??""),O=vi(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=TA.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=TA.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=TA.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 aIt(e,t,n,i){let r=hre[t.localName];return l(r)?r(e,t,n,i):fDe(e,t,n,i)}function lre(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=Zy(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Qg._DeferredLoading(e),d=new lc(e);return Promise.all(rDe(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(hre[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(),aIt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function cIt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");fR({workerURI:o,wasmURI:s});let a=new aT(new ku(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(ire(d,f)),d=g):u.push(ire(g,f)))}if(l(d)&&u.push(Nwt(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),lre(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?Owt(u).then(function(f){return f?cIt(e,t,u,r,a):Mwt(u).then(function(d){d=QPe(d),d=eDe(d);let p,g;try{p=dre.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 lre(e,t,p,r,o,a,s)})}):lre(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var Qg=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 lc(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Qy,this._networkLinks=new zt,this._entityCluster=new Wd,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,it.MINIMUM_VALUE),f=K.equals(c,it.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 Zp,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=Fs.LOOP_STOP,o.clockStep=Hr.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;sre.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];sre.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(!sre.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===TA.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===TA.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===TA.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 lc,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(lIt(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 Are(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 lIt(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=Xf(Ln(a,"cookie",Ve.kml)??""),u=vi(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===TA.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===TA.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,Are(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,it.MINIMUM_VALUE),S=K.equals(E,it.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 sre=new zt,fre=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}};Qg._DeferredLoading=are;Qg._getTimestamp=xn;var tw=Qg;function bre(e){return e}function zH(e){if(e==null)return bre;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 dDe(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function xre(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return hDe(e,n)})}:hDe(e,t)}function hDe(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=Tre(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 Tre(e,t){var n=zH(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&&dDe(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 nw(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(nw.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var mIt=new K;nw.prototype.getValue=function(e,t){return l(e)||(e=K.now(mIt)),this._callback(e,t)};nw.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};nw.prototype.equals=function(e){return this===e||e instanceof nw&&this._callback===e._callback&&this._isConstant===e._isConstant};var i0=nw;function VH(e){return h.fromDegrees(e[0],e[1],e[2])}var Ere={"urn:ogc:def:crs:OGC:1.3:CRS84":VH,"EPSG:4326":VH,"urn:ogc:def:crs:EPSG::4326":VH},mDe={},pDe={},Cre=48,vre,Sre=z.ROYALBLUE,wre=z.YELLOW,Ire=2,Pre=z.fromBytes(255,255,0,100),Dre=!1,pIt={small:24,medium:48,large:64},gIt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function gDe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||gIt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${gDe(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 _It(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function yIt(e,t){return new i0(_It(gDe,e,t),!0)}function jH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Jn();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 mi(c):n(o,s))}return r}function Rre(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var _De={Feature:ADe,FeatureCollection:AIt,GeometryCollection:bDe,LineString:vDe,MultiLineString:SDe,MultiPoint:EDe,MultiPolygon:PDe,Point:TDe,Polygon:IDe,Topology:DDe},yDe={GeometryCollection:bDe,LineString:vDe,MultiLineString:SDe,MultiPoint:EDe,MultiPolygon:PDe,Point:TDe,Polygon:IDe,Topology:DDe};function ADe(e,t,n,i,r){if(t.geometry===null){jH(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=yDe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function AIt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)ADe(e,o[s],void 0,i,r)}function bDe(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=yDe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function xDe(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=pIt[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 zl;f.verticalOrigin=new mi(Wn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=jH(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Vu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new mi(g)}).catch(function(){f.image=new mi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function TDe(e,t,n,i,r){xDe(e,t,i,n.coordinates,r)}function EDe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)xDe(e,t,i,o[s],r)}function CDe(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 mi(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=jH(t,e._entityCollection,r.describe),u=new jl;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new mi(Rre(i,n)),u.arcType=fn.RHUMB}function vDe(e,t,n,i,r){CDe(e,t,i,n.coordinates,r)}function SDe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)CDe(e,t,i,o[s],r)}function wDe(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 mi(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 mi(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 t0;u.outline=new mi(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=fn.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new tl(Rre(i[g],n)));let d=i[0];u.hierarchy=new mi(new tl(Rre(d,n),f)),d[0].length>2?u.perPositionHeight=new mi(!0):r.clampToGround||(u.height=0);let p=jH(t,e._entityCollection,r.describe);p.polygon=u}function IDe(e,t,n,i,r){wDe(e,t,i,n.coordinates,r)}function PDe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)wDe(e,t,i,o[s],r)}function DDe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=xre(n,n.objects[o]),a=_De[s.type];a(e,s,s,i,r)}}function EA(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new lc(this),this._promises=[],this._pinBuilder=new Qy,this._entityCluster=new Wd,this._credit=void 0,this._resourceCredits=[]}EA.load=function(e,t){return new EA().load(e,t)};Object.defineProperties(EA,{markerSize:{get:function(){return Cre},set:function(e){Cre=e}},markerSymbol:{get:function(){return vre},set:function(e){vre=e}},markerColor:{get:function(){return Sre},set:function(e){Sre=e}},stroke:{get:function(){return wre},set:function(e){wre=e}},strokeWidth:{get:function(){return Ire},set:function(e){Ire=e}},fill:{get:function(){return Pre},set:function(e){Pre=e}},clampToGround:{get:function(){return Dre},set:function(e){Dre=e}},crsNames:{get:function(){return Ere}},crsLinkHrefs:{get:function(){return mDe}},crsLinkTypes:{get:function(){return pDe}}});Object.defineProperties(EA.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}}});EA.prototype.load=function(e,t){return RDe(this,e,t,!0)};EA.prototype.process=function(e,t){return RDe(this,e,t,!1)};function RDe(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??yIt,markerSize:n.markerSize??Cre,markerSymbol:n.markerSymbol??vre,markerColor:n.markerColor??Sre,strokeWidthProperty:new mi(n.strokeWidth??Ire),strokeMaterialProperty:new Kt(n.stroke??wre),fillMaterialProperty:new Kt(n.fill??Pre),clampToGround:n.clampToGround??Dre},Promise.resolve(o).then(function(a){return bIt(e,a,n,s,i)}).catch(function(a){throw ks.setLoading(e,!1),e._error.raiseEvent(e,a),a})}EA.prototype.update=function(e){return!0};function bIt(e,t,n,i,r){let o;l(i)&&(o=Zy(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=_De[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?VH: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=Ere[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=mDe[u.href];if(l(f)||(f=pDe[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=Ere[`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 xT=EA;var AO={};AO.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ba.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ba.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===ba.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 Jo.fromUrl(a,n)};AO.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await ba.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ba.RealityDataType.Cesium3DTiles,ba.RealityDataType.PNTS,ba.RealityDataType.RealityMesh3DTiles,ba.RealityDataType.Terrain3DTiles,ba.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await ba.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Jo.fromUrl(s,a)};AO.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ba.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ba.RealityDataType.KML,ba.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await ba.getRealityDataURL(e,t,i);return n===ba.RealityDataType.GeoJSON?xT.load(o):tw.load(o)};AO.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${ba.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:ba._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return xT.load(o)};var ODe=AO;function HH(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(HH.prototype,{total:{get:function(){return this._total}}});function CA(e){let t=new Array(Qc.NUMBER_OF_JOB_TYPES);t[Qc.TEXTURE]=new HH(l(e)?e[Qc.TEXTURE]:10),t[Qc.PROGRAM]=new HH(l(e)?e[Qc.PROGRAM]:10),t[Qc.BUFFER]=new HH(l(e)?e[Qc.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}CA.getTimestamp=xn;Object.defineProperties(CA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});CA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};CA.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};CA.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=CA.getTimestamp();e.execute();let a=CA.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var GH=CA;var Ore=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function bO(e,t){this.spatialNode=e,this.keyframe=t,this.state=Ore.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}bO.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Ore.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};bO.priorityComparator=function(e,t){return e.priority-t.priority};bO.searchComparator=function(e,t){return e.keyframe-t.keyframe};bO.LoadState=Ore;var Gr=bO;function MDe(){}Object.defineProperties(MDe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var NDe=MDe;var xIt=/\/$/,LDe=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 iw(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();xIt.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=LDe,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(iw.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}}});iw.prototype.getTileCredits=function(e,t,n){};iw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};iw.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};iw._defaultCredit=LDe;var FDe=iw;function vA(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??Jn(),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,UDe(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");BDe(this,n),this._initialized=!0}else kDe(this);m.bindTexture(this._textureTarget,null)}function BDe(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=Mre(y),A=Mre(A),b=Mre(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}vA.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?(BDe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),kDe(this)),this._initialized=!0),d||TIt(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function TIt(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 Mre(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function kDe(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)}vA.create=function(e){return new vA(e)};Object.defineProperties(vA.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){UDe(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 UDe(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=$n.NEAREST),$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=$n.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)}vA.prototype.generateMipmap=function(e){e=e??ph.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)};vA.prototype.isDestroyed=function(){return!1};vA.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var WH=vA;function r0(e,t,n,i,r=134217728,o){let s=EIt(i),a=CIt(n),c=n*Lt.getSizeInBytes(i),u=r0.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 WH({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:$n.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new vIt(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(r0.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:$n.LINEAR}),this._nearestSampling=e)}}});function EIt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function CIt(e){switch(e){case 1:return $e.RED;case 2:return $e.RG;case 3:return $e.RGB;case 4:return $e.RGBA}}function vIt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}r0.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};r0.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--};r0.prototype.isFull=function(){return this.emptyList===void 0};r0.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=zDe(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}zDe(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 zDe(e){return e.reduce((t,n)=>t*n)}r0.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)};r0.prototype.isDestroyed=function(){return!1};r0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var qH=r0;var uc={};uc.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}`)};uc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=uc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};uc.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=uc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return uc.decodeRawMetadataValueComponent(e,t,c)};uc.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=uc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return uc.decodeRawMetadataValueElement(e,n,0)};uc.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}`)};uc.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}`)};uc.decodeMetadataValues=function(e,t,n){let i=uc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=uc.convertFromObjectType(e.type,t.offset),s=uc.convertFromObjectType(e.type,t.scale);i=tg.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=uc.convertToObjectType(e.type,c);s[a]=u}return s}return uc.convertToObjectType(e.type,i)};var YH=Object.freeze(uc);function SIt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var XH=SIt;var e1e={},wIt=32.184,IIt=2451545,VDe=-.0529921,jDe=-.1059842,HDe=13.0120009,GDe=13.3407154,WDe=.9856003,qDe=26.4057084,YDe=13.064993,XDe=.3287146,KDe=1.7484877,$De=-.1589763,JDe=.0036096,ZDe=.1643573,QDe=12.9590088,Nre=new K;e1e.ComputeMoon=function(e,t){l(e)||(e=K.now()),Nre=K.addSeconds(e,wIt,Nre);let n=K.totalDays(Nre)-IIt,i=n/Un.DAYS_PER_JULIAN_CENTURY,r=(125.045+VDe*n)*P.RADIANS_PER_DEGREE,o=(250.089+jDe*n)*P.RADIANS_PER_DEGREE,s=(260.008+HDe*n)*P.RADIANS_PER_DEGREE,a=(176.625+GDe*n)*P.RADIANS_PER_DEGREE,c=(357.529+WDe*n)*P.RADIANS_PER_DEGREE,u=(311.589+qDe*n)*P.RADIANS_PER_DEGREE,f=(134.963+YDe*n)*P.RADIANS_PER_DEGREE,d=(276.617+XDe*n)*P.RADIANS_PER_DEGREE,p=(34.226+KDe*n)*P.RADIANS_PER_DEGREE,g=(15.134+$De*n)*P.RADIANS_PER_DEGREE,m=(119.743+JDe*n)*P.RADIANS_PER_DEGREE,y=(239.961+ZDe*n)*P.RADIANS_PER_DEGREE,A=(25.053+QDe*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*VDe+.1208*N*jDe-.0642*F*HDe+.0158*V*GDe+.0252*B*WDe-.0066*j*qDe-.0047*k*YDe-.0046*G*XDe+.0028*q*KDe+.0052*Q*$De+.004*W*JDe+.0019*J*ZDe-.0044*Z*QDe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new XH),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var KH=e1e;function t1e(e){(!l(e)||typeof e!="function")&&(e=KH.ComputeMoon),this._computeFunction=e}var PIt=new h,DIt=new h,RIt=new h;function OIt(e,t,n){let i=PIt;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=RIt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,DIt);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 MIt=new $,NIt=new Le;t1e.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=OIt(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,NIt),s=$.fromQuaternion(Le.conjugate(o,o),MIt);return $.multiply(s,i,i)};var $H=t1e;var Lre={};function LIt(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var FIt=32.184,BIt=2451545;function b1e(e,t){t=K.addSeconds(e,FIt,t);let n=K.totalDays(t)-BIt;return t=K.addSeconds(t,LIt(n),t),t}var JH=new K(2451545,0,ai.TAI),kIt=1e3,$d=P.RADIANS_PER_DEGREE,Nf=P.RADIANS_PER_ARCSECOND,Pc=14959787e4,n1e=new $;function x1e(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=zIt(o-i,t),d=UIt(t,0);WIt(c,n,u,n1e);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(n1e,s,s)}function UIt(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function zIt(e,t){let n=HIt(e,t);return GIt(n,t)}var VIt=50,jIt=P.EPSILON8;function HIt(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<VIt&&Math.abs(r-i)>jIt;++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 GIt(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 WIt(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 qIt=1.0000010178*Pc,YIt=100.46645683*$d,XIt=129597742283429e-5*Nf,i1e=16002,r1e=21863,o1e=32004,s1e=10931,a1e=14529,c1e=16368,l1e=15318,u1e=32794,KIt=64*1e-7*Pc,$It=-152*1e-7*Pc,JIt=62*1e-7*Pc,ZIt=-8*1e-7*Pc,QIt=32*1e-7*Pc,ePt=-41*1e-7*Pc,tPt=19*1e-7*Pc,nPt=-11*1e-7*Pc,iPt=-150*1e-7*Pc,rPt=-46*1e-7*Pc,oPt=68*1e-7*Pc,sPt=54*1e-7*Pc,aPt=14*1e-7*Pc,cPt=24*1e-7*Pc,lPt=-28*1e-7*Pc,uPt=22*1e-7*Pc,f1e=10,d1e=16002,h1e=21863,m1e=10931,p1e=1473,g1e=32004,_1e=4387,y1e=73,fPt=-325*1e-7,dPt=-322*1e-7,hPt=-79*1e-7,mPt=232*1e-7,pPt=-52*1e-7,gPt=97*1e-7,_Pt=55*1e-7,yPt=-41*1e-7,APt=-105*1e-7,bPt=-137*1e-7,xPt=258*1e-7,TPt=35*1e-7,EPt=-116*1e-7,CPt=-88*1e-7,vPt=-112*1e-7,SPt=-80*1e-7,rw=new K(0,0,ai.TAI);function wPt(e,t){b1e(e,rw);let i=(rw.dayNumber-JH.dayNumber+(rw.secondsOfDay-JH.secondsOfDay)/Un.SECONDS_PER_DAY)/(Un.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=qIt+KIt*Math.cos(i1e*r)+iPt*Math.sin(i1e*r)+$It*Math.cos(r1e*r)+rPt*Math.sin(r1e*r)+JIt*Math.cos(o1e*r)+oPt*Math.sin(o1e*r)+ZIt*Math.cos(s1e*r)+sPt*Math.sin(s1e*r)+QIt*Math.cos(a1e*r)+aPt*Math.sin(a1e*r)+ePt*Math.cos(c1e*r)+cPt*Math.sin(c1e*r)+tPt*Math.cos(l1e*r)+lPt*Math.sin(l1e*r)+nPt*Math.cos(u1e*r)+uPt*Math.sin(u1e*r),s=YIt+XIt*i+fPt*Math.cos(f1e*r)+APt*Math.sin(f1e*r)+dPt*Math.cos(d1e*r)+bPt*Math.sin(d1e*r)+hPt*Math.cos(h1e*r)+xPt*Math.sin(h1e*r)+mPt*Math.cos(m1e*r)+TPt*Math.sin(m1e*r)+pPt*Math.cos(p1e*r)+EPt*Math.sin(p1e*r)+gPt*Math.cos(g1e*r)+CPt*Math.sin(g1e*r)+_Pt*Math.cos(_1e*r)+vPt*Math.sin(_1e*r)+yPt*Math.cos(y1e*r)+SPt*Math.sin(y1e*r),a=.0167086342-.0004203654*i,c=102.93734808*$d+11612.3529*Nf*i,u=469.97289*Nf*i,f=174.87317577*$d-8679.27034*Nf*i;return x1e(o,a,u,c,f,s,t)}function T1e(e,t){b1e(e,rw);let i=(rw.dayNumber-JH.dayNumber+(rw.secondsOfDay-JH.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*$d,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*$d,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*$d,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*$d,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*$d+Nf*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*$d+Nf*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*$d+Nf*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*$d+Nf*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*$d-Nf*(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*=kIt;let F=u+f*Nf,V=d+p*Nf,B=y+A*Nf,j=g+m*Nf;return x1e(a,c,F,V,j,B,t)}var A1e=.012300034,IPt=A1e/(A1e+1)*-1;function PPt(e,t){return t=T1e(e,t),h.multiplyByScalar(t,IPt,t)}var E1e=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),xO=new h;Lre.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),xO=wPt(e,xO),t=h.negate(xO,t),PPt(e,xO),h.subtract(t,xO,t),$.multiplyByVector(E1e,t,t),t};Lre.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=T1e(e,t),$.multiplyByVector(E1e,t,t),t};var TT=Lre;function TO(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 x8({radii:this.ellipsoid.radii,material:lr.fromType(lr.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new $H}Object.defineProperties(TO.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var ZH=new $,DPt=new $,RPt=new h,QH=[];TO.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,ZH))||At.computeTemeToPseudoFixedMatrix(n,ZH);let i=this._axes.evaluate(n,DPt);$.transpose(i,i),$.multiply(ZH,i,i);let r=TT.computeMoonPositionInEarthInertialFrame(n,RPt);$.multiplyByVector(ZH,r,r),M.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=QH,QH.length=0,t.update(e),e.commandList=o,QH.length===1?QH[0]:void 0};TO.prototype.isDestroyed=function(){return!1};TO.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var eG=TO;var OPt=0,MPt=14,NPt=-1e3,LPt=1e4,FPt=2*Math.PI*ee.WGS84.maximumRadius,BPt=256,kPt=new ie,UPt=new ie,Fre=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??OPt,this._maxZoom=n.maxZoom??MPt,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=zPt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Jo.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,le(this)}};function zPt(e,t){let n=new Mo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=jPt(n,i,t.minZoom),o={boundingVolume:{region:S1e(i)},geometricError:v1e(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=C1e(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 C1e(e,t,n,i,r,o,s){if(!HPt(e,i,o,s,n,kPt,UPt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:S1e(a)},geometricError:i<r?v1e(i):0,refine:"REPLACE",content:{uri:VPt(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=C1e(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function VPt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return dh(o)}function v1e(e){return FPt/((1<<e)*BPt)}function S1e(e){return[e.west,e.south,e.east,e.north,NPt,LPt]}function jPt(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 HPt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var tG=Fre;var nG=class extends tG{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=Gi.Z,t._modelForwardAxis=Gi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=d8(o),a=w1e(r.getUrlComponent(!0)),c=w2(s,a,{featureIdProperty:t});if(!l(c)){if(!GPt(s))return new gg(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return Ax.fromGltf(n,i,r,c)}}}};function w1e(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 GPt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}nG._parseTileCoordinates=w1e;var I1e=nG;function Bre(e){}Bre.prototype.isReady=function(){return!0};Bre.prototype.shouldDiscardImage=function(e){return!1};var P1e=Bre;var EO=`#ifdef MRT +`;_0.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 pd({context:e,width:s,height:a,format:Su.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(Akt),this._rsClassified=Ge.fromCache(bkt),this._rsDefault=Ge.fromCache(xkt)),!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)?Ekt:Tkt,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(Vf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};_0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};_0.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))};_0.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)};_0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};_0.prototype.isDestroyed=function(){return!1};_0.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()),le(this)};var _M=_0;var yM={};yM.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ba.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ba.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===ba.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 Jo.fromUrl(a,n)};yM.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await ba.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ba.RealityDataType.Cesium3DTiles,ba.RealityDataType.PNTS,ba.RealityDataType.RealityMesh3DTiles,ba.RealityDataType.Terrain3DTiles,ba.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await ba.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Jo.fromUrl(s,a)};yM.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ba.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ba.RealityDataType.KML,ba.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await ba.getRealityDataURL(e,t,i);return n===ba.RealityDataType.GeoJSON?ET.load(o):Pw.load(o)};yM.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${ba.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:ba._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return ET.load(o)};var YLe=yM;function c9(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(c9.prototype,{total:{get:function(){return this._total}}});function JA(e){let t=new Array(Xc.NUMBER_OF_JOB_TYPES);t[Xc.TEXTURE]=new c9(l(e)?e[Xc.TEXTURE]:10),t[Xc.PROGRAM]=new c9(l(e)?e[Xc.PROGRAM]:10),t[Xc.BUFFER]=new c9(l(e)?e[Xc.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}JA.getTimestamp=xn;Object.defineProperties(JA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});JA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};JA.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};JA.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=JA.getTimestamp();e.execute();let a=JA.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var l9=JA;var lse=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function AM(e,t){this.spatialNode=e,this.keyframe=t,this.state=lse.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}AM.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=lse.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};AM.priorityComparator=function(e,t){return e.priority-t.priority};AM.searchComparator=function(e,t){return e.keyframe-t.keyframe};AM.LoadState=lse;var Gr=AM;function XLe(){}Object.defineProperties(XLe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var KLe=XLe;var Ckt=/\/$/,$Le=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 _I(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();Ckt.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=$Le,this._resource=i,this._imageryProvider=new Rs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(_I.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}}});_I.prototype.getTileCredits=function(e,t,n){};_I.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};_I.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};_I._defaultCredit=$Le;var JLe=_I;function y0(e,t,n,i,r=134217728,o){let s=vkt(i),a=Skt(n),c=n*Ft.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 fH({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new Gt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new wkt(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=Gt.NEAREST:this.texture.sampler=new Gt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Zn.LINEAR}),this._nearestSampling=e)}}});function vkt(e){if(e===Ft.FLOAT32||e===Ft.FLOAT64)return ze.FLOAT;if(e===Ft.UINT8)return ze.UNSIGNED_BYTE}function Skt(e){switch(e){case 1:return $e.RED;case 2:return $e.RG;case 3:return $e.RGB;case 4:return $e.RGBA}}function wkt(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}=zt;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=ZLe(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}ZLe(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 ZLe(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(),le(this)};var u9=y0;var dc={};dc.decodeRawMetadataValue=function(e,t,n){switch(e){case Ft.INT8:return t.getInt8(n);case Ft.UINT8:return t.getUint8(n);case Ft.INT16:return t.getInt16(n,!0);case Ft.UINT16:return t.getUint16(n,!0);case Ft.INT32:return t.getInt32(n,!0);case Ft.UINT32:return t.getUint32(n,!0);case Ft.INT64:return t.getBigInt64(n,!0);case Ft.UINT64:return t.getBigUint64(n,!0);case Ft.FLOAT32:return t.getFloat32(n,!0);case Ft.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};dc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=dc.decodeRawMetadataValue(i,t,n);return e.normalized?Ft.normalize(r,i):r};dc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Ft.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=Z0.valueTransformInPlace(i,o,s,Ft.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 f9=Object.freeze(dc);function bM(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 p5({radii:this.ellipsoid.radii,material:ir.fromType(ir.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new zH}Object.defineProperties(bM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var d9=new $,Ikt=new $,Pkt=new h,h9=[];bM.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,d9))||At.computeTemeToPseudoFixedMatrix(n,d9);let i=this._axes.evaluate(n,Ikt);$.transpose(i,i),$.multiply(d9,i,i);let r=wT.computeMoonPositionInEarthInertialFrame(n,Pkt);$.multiplyByVector(d9,r,r),M.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=h9,h9.length=0,t.update(e),e.commandList=o,h9.length===1?h9[0]:void 0};bM.prototype.isDestroyed=function(){return!1};bM.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var m9=bM;var Dkt=0,Rkt=14,Okt=-1e3,Mkt=1e4,Nkt=2*Math.PI*ee.WGS84.maximumRadius,Lkt=256,Fkt=new ie,Bkt=new ie,use=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??Dkt,this._maxZoom=n.maxZoom??Rkt,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=kkt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Jo.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,le(this)}};function kkt(e,t){let n=new Bo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=zkt(n,i,t.minZoom),o={boundingVolume:{region:tFe(i)},geometricError:eFe(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=QLe(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 QLe(e,t,n,i,r,o,s){if(!Vkt(e,i,o,s,n,Fkt,Bkt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:tFe(a)},geometricError:i<r?eFe(i):0,refine:"REPLACE",content:{uri:Ukt(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=QLe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function Ukt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return fh(o)}function eFe(e){return Nkt/((1<<e)*Lkt)}function tFe(e){return[e.west,e.south,e.east,e.north,Okt,Mkt]}function zkt(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 Vkt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var p9=use;var g9=class extends p9{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=qi.Z,t._modelForwardAxis=qi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=s5(o),a=nFe(r.getUrlComponent(!0)),c=sG(s,a,{featureIdProperty:t});if(!l(c)){if(!jkt(s))return new yg(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return Cx.fromGltf(n,i,r,c)}}}};function nFe(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 jkt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}g9._parseTileCoordinates=nFe;var iFe=g9;function fse(e){}fse.prototype.isReady=function(){return!0};fse.prototype.shouldDiscardImage=function(e){return!1};var rFe=fse;var xM=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -10978,7 +10987,7 @@ return; } discard; } -`;var iG=`uniform sampler2D u_opaque; +`;var _9=`uniform sampler2D u_opaque; uniform sampler2D u_accumulation; uniform sampler2D u_revealage; in vec2 v_textureCoordinates; @@ -10998,18 +11007,18 @@ if (opaque != czm_backgroundColor) out_FragColor.a = 1.0; } } -`;function e_(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 di({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new di({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new di({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new di({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 D1e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function kre(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function R1e(e){D1e(e),kre(e)}function WPt(e,t,n,i){D1e(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 qPt(e,t){kre(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)&&(kre(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)&&(R1e(e),e._translucentMultipassSupport=!1,i=!1)}return i}e_.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,WPt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!qPt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Xe({sources:[iG]}),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:[EO]}),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:[EO]}),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 YPt={enabled:!0,color:new z(0,0,0,0),equationRgb:Nc.ADD,equationAlpha:Nc.ADD,functionSourceRgb:Jr.ONE,functionDestinationRgb:Jr.ONE,functionSourceAlpha:Jr.ZERO,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA},XPt={enabled:!0,color:new z(0,0,0,0),equationRgb:Nc.ADD,equationAlpha:Nc.ADD,functionSourceRgb:Jr.ONE,functionDestinationRgb:Jr.ONE,functionSourceAlpha:Jr.ONE,functionDestinationAlpha:Jr.ONE},KPt={enabled:!0,color:new z(0,0,0,0),equationRgb:Nc.ADD,equationAlpha:Nc.ADD,functionSourceRgb:Jr.ZERO,functionDestinationRgb:Jr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Jr.ZERO,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA};function Ure(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 $Pt(e,t,n){return Ure(t,YPt,e._translucentRenderStateCache,n)}function JPt(e,t,n){return Ure(t,XPt,e._translucentRenderStateCache,n)}function ZPt(e,t,n){return Ure(t,KPt,e._alphaRenderStateCache,n)}var QPt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function d_(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 hi({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new hi({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new hi({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new hi({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 oFe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function dse(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function sFe(e){oFe(e),dse(e)}function Hkt(e,t,n,i){oFe(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 Gkt(e,t){dse(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)&&(dse(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)&&(sFe(e),e._translucentMultipassSupport=!1,i=!1)}return i}d_.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,Hkt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Gkt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Xe({sources:[_9]}),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:[xM]}),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:[xM]}),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 Wkt={enabled:!0,color:new z(0,0,0,0),equationRgb:Uc.ADD,equationAlpha:Uc.ADD,functionSourceRgb:Jr.ONE,functionDestinationRgb:Jr.ONE,functionSourceAlpha:Jr.ZERO,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA},qkt={enabled:!0,color:new z(0,0,0,0),equationRgb:Uc.ADD,equationAlpha:Uc.ADD,functionSourceRgb:Jr.ONE,functionDestinationRgb:Jr.ONE,functionSourceAlpha:Jr.ONE,functionDestinationAlpha:Jr.ONE},Ykt={enabled:!0,color:new z(0,0,0,0),equationRgb:Uc.ADD,equationAlpha:Uc.ADD,functionSourceRgb:Jr.ZERO,functionDestinationRgb:Jr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Jr.ZERO,functionDestinationAlpha:Jr.ONE_MINUS_SOURCE_ALPHA};function hse(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 Xkt(e,t,n){return hse(t,Wkt,e._translucentRenderStateCache,n)}function Kkt(e,t,n){return hse(t,qkt,e._translucentRenderStateCache,n)}function $kt(e,t,n){return hse(t,Ykt,e._alphaRenderStateCache,n)}var Jkt=` 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); -`,eDt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,Zkt=` 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; -`,tDt=` float ai = czm_out_FragColor.a; +`,Qkt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function zre(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 +`;function mse(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]}; @@ -11021,7 +11030,7 @@ ${u}`}return a.sources.push(u),a.sources.push(`void main() discard; } ${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function nDt(e,t){return zre(e,t,"translucentMRT",QPt)}function iDt(e,t){return zre(e,t,"translucentMultipass",eDt)}function rDt(e,t){return zre(e,t,"alphaMultipass",tDt)}e_.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=nDt(t,e.shaderProgram),n.translucentCommand.renderState=$Pt(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=iDt(t,e.shaderProgram),n.translucentCommand.renderState=JPt(this,t,e.renderState),n.alphaCommand.shaderProgram=rDt(t,e.shaderProgram),n.alphaCommand.renderState=ZPt(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 oDt(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 sDt(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}e_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){sDt(this,e,t,n,i,r);return}oDt(this,e,t,n,i,r)};e_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};e_.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};e_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};e_.prototype.isDestroyed=function(){return!1};e_.prototype.destroy=function(){return R1e(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()),le(this)};var rG=e_;var aDt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function oG(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 Mo({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??aDt;typeof d=="string"&&(d=new It(d)),Ss.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(oG.prototype=Object.create(Ss.prototype),oG.prototype.constructor=oG);var SA=oG;function fc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Jn(),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(fc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});fc.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};fc.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};fc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};fc.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=[]};fc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function sG(e,t){return e._primitives.indexOf(t)}fc.prototype.raise=function(e){if(l(e)){let t=sG(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};fc.prototype.raiseToTop=function(e){if(l(e)){let t=sG(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};fc.prototype.lower=function(e){if(l(e)){let t=sG(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};fc.prototype.lowerToBottom=function(e){if(l(e)){let t=sG(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};fc.prototype.get=function(e){return this._primitives[e]};fc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};fc.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)}};fc.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)}};fc.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)}};fc.prototype.isDestroyed=function(){return!1};fc.prototype.destroy=function(){return this.removeAll(),le(this)};var Hl=fc;function o0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(o0.prototype,{length:{get:function(){return this._length}}});o0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Hl({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};o0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};o0.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};o0.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};o0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};o0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){return this.removeAll(),le(this)};var aG=o0;function O1e(){pe.throwInstantiationError()}Object.defineProperties(O1e.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var M1e=O1e;function cG(){pe.throwInstantiationError()}Object.defineProperties(cG.prototype,{});cG.fromUrl=function(e){pe.throwInstantiationError()};cG.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var N1e=cG;var cDt=new U(1,1);function Vre(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??cDt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Vre.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var L1e=new h;Vre.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,L1e),h.add(this.position,L1e,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 CO=Vre;function F1e(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(F1e.prototype,{complete:{get:function(){return this._complete}}});var B1e=F1e;function k1e(e){}k1e.prototype.emit=function(e){pe.throwInstantiationError()};var U1e=k1e;var z1e=new U(1,1);function vO(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 U4(.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??z1e),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??z1e),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(vO.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 lDt(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 CO;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function uDt(e){let t=e._particlePool.pop();return l(t)||(t=new CO),t}function fDt(e,t){e._particlePool.push(t)}function dDt(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 hDt(e){l(e._billboard)&&(e._billboard.show=!1)}function V1e(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 mDt(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 pDt(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 lG=new h;vO.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new od),this._updateParticlePool&&(lDt(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)?V1e(this,s):(hDt(s),fDt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=pDt(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=uDt(this),this._emitter.emit(s),h.add(s.position,s.velocity,lG),M.multiplyByPoint(u,lG,lG),s.position=M.multiplyByPoint(u,s.position,s.position),h.subtract(lG,s.position,s.velocity),h.normalize(s.velocity,s.velocity),mDt(this,s),V1e(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&&dDt(this)};vO.prototype.isDestroyed=function(){return!1};vO.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var j1e=vO;function uG(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(uG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});uG.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}};uG.prototype.destroy=function(){return le(this)};var wA=uG;function ET(){this._framebuffer=new ci,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(ET.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function gDt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function _Dt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function e3t(e,t){return mse(e,t,"translucentMRT",Jkt)}function t3t(e,t){return mse(e,t,"translucentMultipass",Zkt)}function n3t(e,t){return mse(e,t,"alphaMultipass",Qkt)}d_.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=e3t(t,e.shaderProgram),n.translucentCommand.renderState=Xkt(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=t3t(t,e.shaderProgram),n.translucentCommand.renderState=Kkt(this,t,e.renderState),n.alphaCommand.shaderProgram=n3t(t,e.shaderProgram),n.alphaCommand.renderState=$kt(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 i3t(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 r3t(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}d_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){r3t(this,e,t,n,i,r);return}i3t(this,e,t,n,i,r)};d_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};d_.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};d_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};d_.prototype.isDestroyed=function(){return!1};d_.prototype.destroy=function(){return sFe(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()),le(this)};var y9=d_;var o3t=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function A9(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 Bo({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??o3t;typeof d=="string"&&(d=new It(d)),Rs.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(A9.prototype=Object.create(Rs.prototype),A9.prototype.constructor=A9);var ZA=A9;function aFe(){pe.throwInstantiationError()}Object.defineProperties(aFe.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var cFe=aFe;function b9(){pe.throwInstantiationError()}Object.defineProperties(b9.prototype,{});b9.fromUrl=function(e){pe.throwInstantiationError()};b9.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var lFe=b9;var s3t=new U(1,1);function pse(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??s3t),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(pse.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var uFe=new h;pse.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,uFe),h.add(this.position,uFe,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 TM=pse;function fFe(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(fFe.prototype,{complete:{get:function(){return this._complete}}});var dFe=fFe;function hFe(e){}hFe.prototype.emit=function(e){pe.throwInstantiationError()};var mFe=hFe;var pFe=new U(1,1);function EM(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 zG(.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??pFe),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??pFe),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(EM.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 a3t(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 TM;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function c3t(e){let t=e._particlePool.pop();return l(t)||(t=new TM),t}function l3t(e,t){e._particlePool.push(t)}function u3t(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 f3t(e){l(e._billboard)&&(e._billboard.show=!1)}function gFe(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 d3t(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 h3t(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 x9=new h;EM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new vd),this._updateParticlePool&&(a3t(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)?gFe(this,s):(f3t(s),l3t(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=h3t(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=c3t(this),this._emitter.emit(s),h.add(s.position,s.velocity,x9),M.multiplyByPoint(u,x9,x9),s.position=M.multiplyByPoint(u,s.position,s.position),h.subtract(x9,s.position,s.velocity),h.normalize(s.velocity,s.velocity),d3t(this,s),gFe(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&&u3t(this)};EM.prototype.isDestroyed=function(){return!1};EM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var _Fe=EM;function T9(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(T9.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});T9.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}};T9.prototype.destroy=function(){return le(this)};var QA=T9;function KT(){this._framebuffer=new ci,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(KT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function m3t(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function p3t(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -11033,12 +11042,12 @@ void main() 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}ET.prototype.update=function(e,t){gDt(this,e,t),_Dt(this,e,t)};var yDt=new se,ADt=new se(1,1/255,1/65025,1/16581375);ET.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,yDt);return se.divideByScalar(r,255,r),se.dot(r,ADt)};ET.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};ET.prototype.isDestroyed=function(){return!1};ET.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var fG=ET;function bDt(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Dc=bDt;function SO(){this._framebuffer=new ci({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(SO.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function xDt(e){e._framebuffer.destroy()}function TDt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new Dc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}SO.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&TDt(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};SO.prototype.isDestroyed=function(){return!1};SO.prototype.destroy=function(){return xDt(this),le(this)};var dG=SO;function EDt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var hG=EDt;function CT(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}CT.create=function(e){return new CT(e)};CT.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};CT.prototype.isDestroyed=function(){return!1};CT.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};CT.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 mG=CT;function vT(e){let t=new Dc(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 H1e(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=mG.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=$e.createTypedArray(c,a,i,r);return u.getBufferData(d),H1e(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 H1e(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(),le(this)};var pG=vT;function gG(e){e=e??!0,this.value=gG.toValue(e)}Object.defineProperties(gG.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});gG.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Dn=gG;function ST(){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 di({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(ST.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});ST.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};ST.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};ST.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var _G=ST;function t_(){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 di({color:new z(0,0,0,0),depth:1,owner:this})}function CDt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(t_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});t_.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)};t_.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)};t_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};t_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};t_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};t_.prototype.isDestroyed=function(){return!1};t_.prototype.destroy=function(){return CDt(this),le(this)};var ow=t_;function IA(){}var vDt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};IA.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return vDt[n]===!0})};IA.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};IA.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; +`,{renderState:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}KT.prototype.update=function(e,t){m3t(this,e,t),p3t(this,e,t)};var g3t=new se,_3t=new se(1,1/255,1/65025,1/16581375);KT.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,g3t);return se.divideByScalar(r,255,r),se.dot(r,_3t)};KT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};KT.prototype.isDestroyed=function(){return!1};KT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var E9=KT;function CM(){this._framebuffer=new ci({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(CM.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function y3t(e){e._framebuffer.destroy()}function A3t(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new vc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}CM.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&A3t(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};CM.prototype.isDestroyed=function(){return!1};CM.prototype.destroy=function(){return y3t(this),le(this)};var C9=CM;function b3t(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var v9=b3t;function $T(e){let t=new vc(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 yFe(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]}$T.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};$T.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=uH.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=$e.createTypedArray(c,a,i,r);return u.getBufferData(d),yFe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};$T.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 yFe(r,o,n,i,t)};$T.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)};$T.prototype.isDestroyed=function(){return!1};$T.prototype.destroy=function(){return this._fb.destroy(),le(this)};var S9=$T;function JT(){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 hi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(JT.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});JT.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};JT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};JT.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var w9=JT;function h_(){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 hi({color:new z(0,0,0,0),depth:1,owner:this})}function x3t(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(h_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});h_.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)};h_.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)};h_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};h_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};h_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};h_.prototype.isDestroyed=function(){return!1};h_.prototype.destroy=function(){return x3t(this),le(this)};var yI=h_;function eb(){}var T3t={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};eb.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return T3t[n]===!0})};eb.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};eb.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_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Xe({defines:i,sources:r})};IA.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; +}`)}return new Xe({defines:i,sources:r})};eb.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() { @@ -11062,7 +11071,7 @@ void main() `: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})};IA.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}`};IA.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})};IA.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; +`,s.push(f),new Xe({defines:o,sources:s})};eb.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}`};eb.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})};eb.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 @@ -11173,7 +11182,7 @@ ${m?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,E+=` out_FragColor.rgb *= visibility; } -`,x.push(E),new Xe({defines:b,sources:x})};var s0=IA;function a0(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 yG,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 U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ws: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 SDt(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,Hre(this),this._clearCommand=new di({depth:1,color:new z}),this._clearPassState=new Dc(t),this._size=e.size??2048,this.size=this._size}a0.MAXIMUM_DISTANCE=2e4;function SDt(e){this.camera=new yG,this.passState=new Dc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function jre(e,t){return Ge.fromCache({cull:{enabled:!0,face:ji.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 Hre(e){let t=!e._usesDepthTexture;e._primitiveRenderState=jre(t,e._primitiveBias),e._terrainRenderState=jre(t,e._terrainBias),e._pointRenderState=jre(t,e._pointBias)}a0.prototype.debugCreateRenderStates=function(){Hre(this)};Object.defineProperties(a0.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){ODt(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 Gre(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 wDt(e,t){let n=new Qf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:lu.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 IDt(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 PDt(e,t){let n=new Qf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:lu.DEPTH_COMPONENT16}),i=new ms({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 q1e(e,t){e._isPointLight?PDt(e,t):e._usesDepthTexture?IDt(e,t):wDt(e,t)}function DDt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Hre(e),Gre(e),q1e(e,t))}function RDt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Gre(e),q1e(e,t),DDt(e,t),Y1e(e,t))}function Y1e(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ODt(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 MDt=new et;function NDt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,x.push(E),new Xe({defines:b,sources:x})};var A0=eb;function b0(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 I9,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 U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ws: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 E3t(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,_se(this),this._clearCommand=new hi({depth:1,color:new z}),this._clearPassState=new vc(t),this._size=e.size??2048,this.size=this._size}b0.MAXIMUM_DISTANCE=2e4;function E3t(e){this.camera=new I9,this.passState=new vc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function gse(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 _se(e){let t=!e._usesDepthTexture;e._primitiveRenderState=gse(t,e._primitiveBias),e._terrainRenderState=gse(t,e._terrainBias),e._pointRenderState=gse(t,e._pointBias)}b0.prototype.debugCreateRenderStates=function(){_se(this)};Object.defineProperties(b0.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){P3t(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 yse(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 C3t(e,t){let n=new pd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Su.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Gt.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 v3t(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:Gt.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 S3t(e,t){let n=new pd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Su.DEPTH_COMPONENT16}),i=new us({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Gt.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 xFe(e,t){e._isPointLight?S3t(e,t):e._usesDepthTexture?v3t(e,t):C3t(e,t)}function w3t(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,_se(e),yse(e),xFe(e,t))}function I3t(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(yse(e),xFe(e,t),w3t(e,t),TFe(e,t))}function TFe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function P3t(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=zt.maximumCubeMapSize>=t?t:zt.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=zt.maximumTextureSize>=t?t:zt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=zt.maximumTextureSize>=t*2?t:zt.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 D3t=new et;function R3t(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -11234,7 +11243,7 @@ ${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=Ie.OVERLAY,i}function LDt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=MDt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=NDt(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 c0=new Array(8);c0[0]=new se(-1,-1,-1,1);c0[1]=new se(1,-1,-1,1);c0[2]=new se(1,1,-1,1);c0[3]=new se(-1,1,-1,1);c0[4]=new se(-1,-1,1,1);c0[5]=new se(1,-1,1,1);c0[6]=new se(1,1,1,1);c0[7]=new se(-1,1,1,1);var PA=new M,Wre=new Array(8);for(let e=0;e<8;++e)Wre[e]=new se;function FDt(e,t){let n=new Bt({geometry:new Tp({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Bt({geometry:new By({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 BDt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],kDt=new h;function UDt(e,t){LDt(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 Dg({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 Dg({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 Dg({camera:e._passes[i].camera,color:BDt[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,kDt),a=M.fromTranslationQuaternionRotationScale(i,r,s,PA);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=FDt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Dg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function yG(){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}yG.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 zDt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);yG.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(zDt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var VDt=new Array(5),jDt=new Zi,HDt=new Array(4),X1e=new h,K1e=new h;function GDt(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=HDt,g=VDt;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(jDt),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,PA),_=M.inverse(L,PA),C=M.multiply(O,_,PA),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,X1e),D=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,K1e);for(let j=0;j<8;++j){let k=se.clone(c0[j],Wre[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 WDt=new M,qDt=new h,YDt=new h,G1e=new h;function XDt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,PA),o=M.inverse(r,PA),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,qDt);a=h.cross(c,s,YDt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,G1e),f=M.computeView(u,s,a,c,WDt),d=M.multiply(f,o,PA),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,X1e),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,K1e);for(let E=0;E<8;++E){let v=se.clone(c0[E],Wre[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=G1e;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=M.fromTranslation(m,PA);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 KDt=[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)],$Dt=[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)],JDt=[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 ZDt(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=KDt[i],r.upWC=$Dt[i],r.rightWC=JDt[i],M.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),M.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var QDt=new h,e1t=new h,$1e=new ue,W1e=$1e.center;function t1t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=$1e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,QDt),s=h.negate(i.directionWC,e1t),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),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,W1e),W1e);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function n1t(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=Or.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,t1t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}a0.prototype.update=function(e){if(n1t(this,e),this._needsUpdate)if(RDt(this,e.context),this._isPointLight&&ZDt(this,e),this._cascadesEnabled&&(XDt(this,e),this._numberOfCascades>1&&GDt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ca.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&&UDt(this,e)};a0.prototype.updatePass=function(e,t){Y1e(this,e,t)};var i1t=new U;function J1e(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=i1t;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 r1t(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&&s0.hasClippingForShadowCast(y),b=s0.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=s0.createShadowCastVertexShader(m,p,f),E=s0.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=J1e(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}a0.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=s0.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=s0.createShadowReceiveVertexShader(a,u,f),b=s0.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=J1e(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};a0.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]=r1t(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){Gre(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 le(this)};var DA=a0;var AG=`uniform sampler2D u_opaqueDepthTexture; +`;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 O3t(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=D3t;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=R3t(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 x0=new Array(8);x0[0]=new se(-1,-1,-1,1);x0[1]=new se(1,-1,-1,1);x0[2]=new se(1,1,-1,1);x0[3]=new se(-1,1,-1,1);x0[4]=new se(-1,-1,1,1);x0[5]=new se(1,-1,1,1);x0[6]=new se(1,1,1,1);x0[7]=new se(-1,1,1,1);var tb=new M,Ase=new Array(8);for(let e=0;e<8;++e)Ase[e]=new se;function M3t(e,t){let n=new Bt({geometry:new Gm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Bt({geometry:new Gy({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Mn({geometryInstances:[n,i],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var N3t=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],L3t=new h;function F3t(e,t){O3t(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 c_({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 c_({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 c_({camera:e._passes[i].camera,color:N3t[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,L3t),a=M.fromTranslationQuaternionRotationScale(i,r,s,tb);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=M3t(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new c_({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function I9(){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}I9.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 B3t=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);I9.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(B3t,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var k3t=new Array(5),U3t=new er,z3t=new Array(4),EFe=new h,CFe=new h;function V3t(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=z3t,g=k3t;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(U3t),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,tb),_=M.inverse(L,tb),C=M.multiply(O,_,tb),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,EFe),D=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,CFe);for(let j=0;j<8;++j){let k=se.clone(x0[j],Ase[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 j3t=new M,H3t=new h,G3t=new h,AFe=new h;function W3t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,tb),o=M.inverse(r,tb),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,H3t);a=h.cross(c,s,G3t),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,AFe),f=M.computeView(u,s,a,c,j3t),d=M.multiply(f,o,tb),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,EFe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,CFe);for(let E=0;E<8;++E){let v=se.clone(x0[E],Ase[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=AFe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=M.fromTranslation(m,tb);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 q3t=[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)],Y3t=[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)],X3t=[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 K3t(e,t){let n=new er;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=q3t[i],r.upWC=Y3t[i],r.rightWC=X3t[i],M.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),M.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var $3t=new h,J3t=new h,vFe=new ue,bFe=vFe.center;function Z3t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=vFe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,$3t),s=h.negate(i.directionWC,J3t),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),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,bFe),bFe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function Q3t(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,Z3t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}b0.prototype.update=function(e){if(Q3t(this,e),this._needsUpdate)if(I3t(this,e.context),this._isPointLight&&K3t(this,e),this._cascadesEnabled&&(W3t(this,e),this._numberOfCascades>1&&V3t(this,e)),this._isPointLight)this._shadowMapCullingVolume=ca.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&&F3t(this,e)};b0.prototype.updatePass=function(e,t){TFe(this,e,t)};var eUt=new U;function SFe(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=eUt;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 tUt(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&&A0.hasClippingForShadowCast(y),b=A0.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=A0.createShadowCastVertexShader(m,p,f),E=A0.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=SFe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}b0.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=A0.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=A0.createShadowReceiveVertexShader(a,u,f),b=A0.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=SFe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};b0.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]=tUt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};b0.prototype.isDestroyed=function(){return!1};b0.prototype.destroy=function(){yse(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 le(this)};var nb=b0;var P9=`uniform sampler2D u_opaqueDepthTexture; uniform sampler2D u_translucentDepthTexture; in vec2 v_textureCoordinates; void main() @@ -11244,7 +11253,7 @@ float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); out_FragColor = czm_packDepth(translucentDepth); } -`;var sw=`uniform sampler2D colorTexture; +`;var AI=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -11270,7 +11279,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var o1t=!1;function RA(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 di({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new di({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(RA.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Z1e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Q1e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function s1t(e,t,n,i){Z1e(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 a1t(e,t,n,i){Q1e(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 c1t(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)&&(s1t(e,t,r,o),a1t(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Xe({sources:[AG]}),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:[sw]}),a={colorTexture:function(){return e._textureToComposite}},o1t&&(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:[sw]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Xe({sources:[sw]}),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:Zn.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:nn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}RA.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){c1t(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}};RA.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)};RA.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),l1t(this,e,t)};function l1t(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}RA.prototype.isSupported=function(){return this._supported};RA.prototype.isDestroyed=function(){return!1};RA.prototype.destroy=function(){return Z1e(this),Q1e(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()),le(this)};var bG=RA;function u1t(){this.command=void 0,this.near=void 0,this.far=void 0}function xG(e,t,n){let i=e.context,r;i.depthTexture&&(r=new hj);let o;e._useOIT&&i.depthTexture&&(o=new rG(i));let s=new Dc(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 pG(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new dG,this.sceneFramebuffer=new ow,this.edgeFramebuffer=new A8,this.planarFillIdFramebuffer=new _G,this.globeDepth=r,this.globeTranslucencyFramebuffer=new mj,this.oit=o,this.translucentTileClassification=new bG(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var qre=new h,Yre=new h;function f1t(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,qre)),h.maximumComponent(h.abs(t.position,Yre))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,qre),h.multiplyByScalar(t.position,r,Yre),h.equalsEpsilon(qre,Yre,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)}xG.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return f1t(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(),Or.clone(t,n),!0)};function d1t(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 M8(g,m)}}function h1t(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 eRe=new ca,m1t=new Ws;xG.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=eRe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=eRe;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,m1t);if(w=F.start,D=F.stop,m=Math.min(m,w),y=Math.max(y,D),A&&L.receiveShadows&&w<DA.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 di?(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 u1t),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),d1t(this,e,m,y);for(let O=0;O<g;O++)h1t(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}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let D=_[C];D<w.length&&l(w[D]);++D)w[D]=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)};xG.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 aw=xG;var nRe=.1,p1t=new Xh({pass:mo.MOST_DETAILED_PRELOAD}),g1t=new Xh({pass:mo.MOST_DETAILED_PICK}),wO=new Xh({pass:mo.PICK});function Ta(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 pn({width:nRe,aspectRatio:1,near:.1}),this._pickOffscreenView=new aw(e,n,t)}Ta.prototype.update=function(){this._pickPositionCacheDirty=!0};Ta.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new fG,n[t]=i),i};var _1t=new ws,y1t=new h,TG=new h,A1t=new U,b1t=new M;function x1t(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,b1t);o._setTransform(M.IDENTITY);let d=h.clone(o.position,y1t);h.multiplyByScalar(o.right,c,TG),h.add(TG,d,d),h.multiplyByScalar(o.up,u,TG),h.add(TG,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,A1t),g=_1t;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 T1t=new pu,E1t=new U;function C1t(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,E1t),y=m.x*n*.5,A=m.y*i*.5,b=T1t;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 EG(e,t,n,i,r){let o=e.camera.frustum;return o instanceof pn||o instanceof ws?x1t(e,t,n,i,r):C1t(e,t,n,i,r)}var IO=new et(0,0,3,3),CG=new U,PO=new z(0,0,0,0);function Xre(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 DO(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=pr.transformWindowToDrawingBuffer(e,t,CG);Xre(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=EG(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=wO,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,PO),e.resolveFramebuffers(p)}function RO(e){let{context:t}=e;t.endFrame()}Ta.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=IO;DO(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.")),RO(e),f};Ta.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=IO;DO(e,t,a,n,i);let c=s.end(a,r);return RO(e),c};Ta.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=pr.transformWindowToDrawingBuffer(e,t,CG),d=Xre(r.drawingBufferHeight,f,n,i,IO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=EG(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=wO,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,PO),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Ta.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=pr.transformWindowToDrawingBuffer(e,t,CG),f=Xre(i.drawingBufferHeight,u,1,1,IO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=EG(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=wO,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,PO);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,YH.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function v1t(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=EG(e,t,1,1,s),r.tilesetPassState=wO,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,PO),e.resolveFramebuffers(c),i.endFrame()}var S1t=new Zi,w1t=new pu,I1t=new pn,P1t=new ws;Ta.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=pr.transformWindowToDrawingBuffer(e,t,CG);e.pickTranslucentDepth?v1t(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(S1t):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(w1t):l(s.frustum.width)?f=s.frustum.clone(I1t):f=s.frustum.clone(P1t);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=pr.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 D1t=new he;Ta.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,D1t);r.cartographicToCartesian(o,n)}return n};function R1t(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=Dn.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 iRe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!R1t(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=Dn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}Ta.prototype.drillPick=function(e,t,n,i,r){return iRe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var tRe=new h,O1t=new h;function M1t(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 rRe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,tRe),s=h.cross(r,o,tRe),a=h.cross(r,s,O1t);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??nRe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function N1t(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=rRe(e,r,o,a),u=p1t;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}Ta.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)N1t(this,e,t[n])&&t.splice(n--,1)};function oRe(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 Hl&&oRe(r,t,n))}}function vG(e,t,n,i,r,o){let s=[];if(oRe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new M1t(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function L1t(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 F1t(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,rRe(e,n,r,f.camera);let d=et.clone(f.viewport,IO),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=g1t:c.tilesetPassState=wO,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,PO),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||L1t(m,i)}}function Kre(e,t,n,i,r,o,s,a){return iRe(function(){let u=F1t(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function cw(e,t,n,i,r,o,s){let a=Kre(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function SG(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)})})}Ta.prototype.pickFromRay=function(e,t,n,i){return cw(this,e,t,n,i,!1,!1)};Ta.prototype.drillPickFromRay=function(e,t,n,i,r){return Kre(this,e,t,n,i,r,!1,!1)};Ta.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=gn.clone(t),n=l(n)?n.slice():n,SG(e,vG(r,e,t,n,i,function(){return cw(r,e,t,n,i,!1,!0)}))};Ta.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=gn.clone(t),i=l(i)?i.slice():i,SG(e,vG(o,e,t,i,r,function(){return Kre(o,e,t,n,i,r,!1,!0)}))};var B1t=new h,k1t=new h,U1t=new gn,sRe=new he;function $re(e,t){let n=e.ellipsoid,i=Ni._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,k1t),o=he.toCartesian(t,n,B1t),s=U1t;s.origin=o,s.direction=r;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function aRe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,sRe);return $re(e,i)}function cRe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,sRe).height}function z1t(e,t,n,i,r){let o=$re(t,n);return vG(e,t,o,i,r,function(){let s=cw(e,t,o,i,r,!0,!0);if(l(s))return cRe(t,s.position)})}function V1t(e,t,n,i,r,o){let s=aRe(t,n);return vG(e,t,s,i,r,function(){let a=cw(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}Ta.prototype.sampleHeight=function(e,t,n,i){let r=$re(e,t),o=cw(this,e,r,n,i,!0,!1);if(l(o))return cRe(e,o.position)};Ta.prototype.clampToHeight=function(e,t,n,i,r){let o=aRe(e,t),s=cw(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};Ta.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]=z1t(this,e,t[s],n,i);return SG(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}))};Ta.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]=V1t(this,e,t[s],n,i,t[s]);return SG(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ta.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var wG=Ta;var fRe=js(rN(),1);var j1t={modifyFragmentShader:function(t){return t=Xe.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`;var nUt=!1;function ib(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 hi({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new hi({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(ib.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function wFe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function IFe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function iUt(e,t,n,i){wFe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Gt.NEAREST})}function rUt(e,t,n,i){IFe(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 oUt(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)&&(iUt(e,t,r,o),rUt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Xe({sources:[P9]}),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:[AI]}),a={colorTexture:function(){return e._textureToComposite}},nUt&&(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:[AI]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Xe({sources:[AI]}),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:ei.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:nn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}ib.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){oUt(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}};ib.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)};ib.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),sUt(this,e,t)};function sUt(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}ib.prototype.isSupported=function(){return this._supported};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){return wFe(this),IFe(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()),le(this)};var D9=ib;function aUt(){this.command=void 0,this.near=void 0,this.far=void 0}function R9(e,t,n){let i=e.context,r;i.depthTexture&&(r=new X5);let o;e._useOIT&&i.depthTexture&&(o=new y9(i));let s=new vc(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 S9(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new C9,this.sceneFramebuffer=new yI,this.edgeFramebuffer=new h5,this.planarFillIdFramebuffer=new w9,this.globeDepth=r,this.globeTranslucencyFramebuffer=new K5,this.oit=o,this.translucentTileClassification=new D9(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var bse=new h,xse=new h;function cUt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,bse)),h.maximumComponent(h.abs(t.position,xse))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,bse),h.multiplyByScalar(t.position,r,xse),h.equalsEpsilon(bse,xse,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)}R9.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return cUt(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 lUt(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 b5(g,m)}}function uUt(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 PFe=new ca,fUt=new Gs;R9.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=PFe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=PFe;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,fUt);if(w=F.start,D=F.stop,m=Math.min(m,w),y=Math.max(y,D),A&&L.receiveShadows&&w<nb.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 hi?(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 aUt),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),lUt(this,e,m,y);for(let O=0;O<g;O++)uUt(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}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let D=_[C];D<w.length&&l(w[D]);++D)w[D]=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)};R9.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 bI=R9;var RFe=.1,dUt=new xm({pass:po.MOST_DETAILED_PRELOAD}),hUt=new xm({pass:po.MOST_DETAILED_PICK}),vM=new xm({pass:po.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:RFe,aspectRatio:1,near:.1}),this._pickOffscreenView=new bI(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 E9,n[t]=i),i};var mUt=new ws,pUt=new h,O9=new h,gUt=new U,_Ut=new M;function yUt(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,_Ut);o._setTransform(M.IDENTITY);let d=h.clone(o.position,pUt);h.multiplyByScalar(o.right,c,O9),h.add(O9,d,d),h.multiplyByScalar(o.up,u,O9),h.add(O9,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,gUt),g=mUt;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 AUt=new Wu,bUt=new U;function xUt(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,bUt),y=m.x*n*.5,A=m.y*i*.5,b=AUt;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 M9(e,t,n,i,r){let o=e.camera.frustum;return o instanceof _n||o instanceof ws?yUt(e,t,n,i,r):xUt(e,t,n,i,r)}var SM=new et(0,0,3,3),N9=new U,wM=new z(0,0,0,0);function Tse(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=pr.transformWindowToDrawingBuffer(e,t,N9);Tse(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=M9(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=vM,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,wM),e.resolveFramebuffers(p)}function PM(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=SM;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.")),PM(e),f};Ea.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=SM;IM(e,t,a,n,i);let c=s.end(a,r);return PM(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=pr.transformWindowToDrawingBuffer(e,t,N9),d=Tse(r.drawingBufferHeight,f,n,i,SM);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=M9(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=vM,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,wM),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=pr.transformWindowToDrawingBuffer(e,t,N9),f=Tse(i.drawingBufferHeight,u,1,1,SM);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=M9(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=vM,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,wM);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,f9.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function TUt(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=M9(e,t,1,1,s),r.tilesetPassState=vM,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,wM),e.resolveFramebuffers(c),i.endFrame()}var EUt=new er,CUt=new Wu,vUt=new _n,SUt=new ws;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=pr.transformWindowToDrawingBuffer(e,t,N9);e.pickTranslucentDepth?TUt(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(EUt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(CUt):l(s.frustum.width)?f=s.frustum.clone(vUt):f=s.frustum.clone(SUt);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=pr.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 wUt=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,wUt);r.cartographicToCartesian(o,n)}return n};function IUt(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 la&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function OFe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!IUt(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 OFe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var DFe=new h,PUt=new h;function DUt(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 MFe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,DFe),s=h.cross(r,o,DFe),a=h.cross(r,s,PUt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??RFe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function RUt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=MFe(e,r,o,a),u=dUt;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)RUt(this,e,t[n])&&t.splice(n--,1)};function NFe(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 ql&&NFe(r,t,n))}}function L9(e,t,n,i,r,o){let s=[];if(NFe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new DUt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function OUt(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 MUt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,MFe(e,n,r,f.camera);let d=et.clone(f.viewport,SM),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=hUt:c.tilesetPassState=vM,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,wM),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||OUt(m,i)}}function Ese(e,t,n,i,r,o,s,a){return OFe(function(){let u=MUt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function xI(e,t,n,i,r,o,s){let a=Ese(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function F9(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 xI(this,e,t,n,i,!1,!1)};Ea.prototype.drillPickFromRay=function(e,t,n,i,r){return Ese(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,F9(e,L9(r,e,t,n,i,function(){return xI(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,F9(e,L9(o,e,t,i,r,function(){return Ese(o,e,t,n,i,r,!1,!0)}))};var NUt=new h,LUt=new h,FUt=new gn,LFe=new he;function Cse(e,t){let n=e.ellipsoid,i=Ni._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,LUt),o=he.toCartesian(t,n,NUt),s=FUt;s.origin=o,s.direction=r;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function FFe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,LFe);return Cse(e,i)}function BFe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,LFe).height}function BUt(e,t,n,i,r){let o=Cse(t,n);return L9(e,t,o,i,r,function(){let s=xI(e,t,o,i,r,!0,!0);if(l(s))return BFe(t,s.position)})}function kUt(e,t,n,i,r,o){let s=FFe(t,n);return L9(e,t,s,i,r,function(){let a=xI(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=Cse(e,t),o=xI(this,e,r,n,i,!0,!1);if(l(o))return BFe(e,o.position)};Ea.prototype.clampToHeight=function(e,t,n,i,r){let o=FFe(e,t),s=xI(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]=BUt(this,e,t[s],n,i);return F9(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]=kUt(this,e,t[s],n,i,t[s]);return F9(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 B9=Ea;var zFe=js(sN(),1);var UUt={modifyFragmentShader:function(t){return t=Xe.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -11279,9 +11288,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},OO=j1t;var wT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function MO(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=wT.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=Pn.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??Wo.NONE,this._splittingEnabled=!1,this._error=void 0,H1t(this,e)}Object.defineProperties(MO.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=ue.clone(e,this._boundingSphere)}}});function H1t(e,t){let n=av.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=Xm.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=wT.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 G1t=new h,W1t=new h,q1t=new h,lRe,IG;function Y1t(e){if(!l(IG)){lRe=new fRe.default(0),IG=new Array(e);for(let t=0;t<e;++t)IG[t]=lRe.random()}return IG}function X1t(e){let n=e.length/3,i=Math.min(n,20),r=Y1t(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,G1t),c=h.fromElements(s,s,s,W1t);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,q1t);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function uRe(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 K1t=new se,$1t=new se,J1t=new z,dRe=0,PG=1,toe=2,hRe=3,Z1t=4,Jre=new M,Q1t=new M;function eRt(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=Z1t;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=uRe(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=uRe(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:dRe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=X1t(o.typedArray)),T)if(b)D.push({index:PG,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;D.push({index:PG,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:toe,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:hRe,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:nn.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 ue,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 tRt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=K1t;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 pn?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,J1t);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,Jre);let u=M.multiply(Jre,a.modelMatrix,Jre);return M.inverseTranspose(u,Q1t)}};OO.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=$1t;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 Zre(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 Qre(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 eoe(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 nRt={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 iRt(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(nRt),_={},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&&(Zre(S,V),Qre(S,B)),D&&(Zre(I,V),Qre(I,B)),N&&(Zre(R,V),Qre(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=eoe(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=eoe(T,PG);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=eoe(T,toe);fe.enabled=q}let Q={a_position:dRe};G&&(Q.a_color=PG),q&&(Q.a_normal=toe),A&&(Q.a_batchId=hRe);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}tRt(e,t);let Z=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},DM=UUt;var ZT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function RM(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=ZT.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??Ho.NONE,this._splittingEnabled=!1,this._error=void 0,zUt(this,e)}Object.defineProperties(RM.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=ue.clone(e,this._boundingSphere)}}});function zUt(e,t){let n=Cv.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=cp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=ZT.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 VUt=new h,jUt=new h,HUt=new h,kFe,k9;function GUt(e){if(!l(k9)){kFe=new zFe.default(0),k9=new Array(e);for(let t=0;t<e;++t)k9[t]=kFe.random()}return k9}function WUt(e){let n=e.length/3,i=Math.min(n,20),r=GUt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,VUt),c=h.fromElements(s,s,s,jUt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,HUt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function UFe(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 qUt=new se,YUt=new se,XUt=new z,VFe=0,U9=1,Pse=2,jFe=3,KUt=4,vse=new M,$Ut=new M;function JUt(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=KUt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=UFe(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=nt.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=nt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=nt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=nt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=UFe(c.typedArray,"batchIds"),w=nt.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:VFe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=WUt(o.typedArray)),T)if(b)D.push({index:U9,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;D.push({index:U9,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:Pse,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:jFe,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:nn.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 ue,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 ZUt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=qUt;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,XUt);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,vse);let u=M.multiply(vse,a.modelMatrix,vse);return M.inverseTranspose(u,$Ut)}};DM.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=YUt;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 Sse(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 wse(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 Ise(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 QUt={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 ezt(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(QUt),_={},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&&(Sse(S,V),wse(S,B)),D&&(Sse(I,V),wse(I,B)),N&&(Sse(R,V),wse(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=Ise(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=Ise(T,U9);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=Ise(T,Pse);fe.enabled=q}let Q={a_position:VFe};G&&(Q.a_color=U9),q&&(Q.a_normal=Pse),A&&(Q.a_batchId=jFe);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}ZUt(e,t);let Z=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -11352,12 +11361,12 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,ae+=` -`,ae+=$v(E,s),ae+=` +`,ae+=uI(E,s),ae+=` `),ae+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,F&&(ae+=N8("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} -`,e.splitDirection!==Wo.NONE&&(ae=OO.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 rRt(e,t){if(e._decodingState===wT.READY)return!1;if(e._decodingState===wT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=sy.decodePointCloud(i,t);l(r)&&(e._decodingState=wT.DECODING,r.then(function(o){e._decodingState=wT.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=wT.FAILED,e._error=o}))}return!0}var oRt=new se,sRt=new h;MO.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(rRt(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)||(eRt(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,oRt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;M.multiplyByPoint(u,d,d);let p=M.getScale(u,sRt);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!==Wo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&iRt(this,e,this._style),this._drawCommand.castShadows=Pn.castShadows(this.shadows),this._drawCommand.receiveShadows=Pn.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)};MO.prototype.isDestroyed=function(){return!1};MO.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var DG=MO;var aRt={NEAREST:0,LINEAR:1},Jd=aRt;function n_(e){e=e??H.EMPTY_OBJECT;let{name:t=Jn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=Jd.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 Dc;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(n_.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 cRt=/uniform\s+sampler2D\s+depthTexture/g;n_.prototype._isSupported=function(e){return!cRt.test(this._fragmentShader)||e.depthTexture};function lRt(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 uRt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function fRt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function dRt(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]=uRt(e,o),n[o]=lRt(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`]=fRt(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 hRt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,F&&(ae+=x5("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} +`,e.splitDirection!==Ho.NONE&&(ae=DM.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=en.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 tzt(e,t){if(e._decodingState===ZT.READY)return!1;if(e._decodingState===ZT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=ry.decodePointCloud(i,t);l(r)&&(e._decodingState=ZT.DECODING,r.then(function(o){e._decodingState=ZT.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=ZT.FAILED,e._error=o}))}return!0}var nzt=new se,izt=new h;RM.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(tzt(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)||(JUt(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,nzt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;M.multiplyByPoint(u,d,d);let p=M.getScale(u,izt);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!==Ho.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&ezt(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)};RM.prototype.isDestroyed=function(){return!1};RM.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var z9=RM;var rzt={NEAREST:0,LINEAR:1},nh=rzt;function m_(e){e=e??H.EMPTY_OBJECT;let{name:t=$n(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=nh.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 vc;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(m_.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 ozt=/uniform\s+sampler2D\s+depthTexture/g;m_.prototype._isSupported=function(e){return!ozt.test(this._fragmentShader)||e.depthTexture};function szt(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 azt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function czt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function lzt(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]=azt(e,o),n[o]=szt(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`]=czt(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 uzt(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; @@ -11381,7 +11390,7 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function mRt(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=hRt(n,r)}let i=new Xe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function pRt(e){let t=e._sampleMode,n,i;t===Jd.LINEAR?(n=Wt.LINEAR,i=$n.LINEAR):(n=Wt.NEAREST,i=$n.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 gRt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function _Rt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function yRt(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]=_Rt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(gRt(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 mRe(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 ARt(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 bRt(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&&(n_._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})}n_.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&mRe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=ARt(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,bRt(this,e),dRt(this),yRt(this,e),mRt(this,e),pRt(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};n_.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)};n_.prototype.isDestroyed=function(){return!1};n_.prototype.destroy=function(){return mRe(this),le(this)};n_._oneTimeWarning=yt;var zr=n_;var RG=`uniform sampler2D colorTexture; +${e}`}function fzt(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=uzt(n,r)}let i=new Xe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function dzt(e){let t=e._sampleMode,n,i;t===nh.LINEAR?(n=Wt.LINEAR,i=Zn.LINEAR):(n=Wt.NEAREST,i=Zn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new Gt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function hzt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function mzt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function pzt(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]=mzt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(hzt(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 HFe(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 gzt(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 _zt(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=zt.maximumTextureSize;if(i>r&&(m_._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:Gt.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:Gt.NEAREST})}m_.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&HFe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=gzt(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,_zt(this,e),lzt(this),pzt(this,e),fzt(this,e),dzt(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};m_.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,Gt.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)};m_.prototype.isDestroyed=function(){return!1};m_.prototype.destroy=function(){return HFe(this),le(this)};m_._oneTimeWarning=yt;var zr=m_;var V9=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11401,7 +11410,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var OG=`precision highp float; +`;var j9=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -11509,7 +11518,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var MG=`uniform sampler2D colorTexture; +`;var H9=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -11519,7 +11528,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var NG=`uniform sampler2D colorTexture; +`;var G9=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -11536,7 +11545,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var LG=`uniform sampler2D colorTexture; +`;var W9=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -11552,7 +11561,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var FG=`uniform sampler2D colorTexture; +`;var q9=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -11561,7 +11570,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var BG=`uniform sampler2D colorTexture; +`;var Y9=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -11575,7 +11584,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 kG=`uniform sampler2D colorTexture; +`;var X9=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -11610,14 +11619,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 UG=`uniform sampler2D depthTexture; +`;var K9=`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 zG=`uniform sampler2D depthTexture; +`;var $9=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -11667,7 +11676,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 VG=`uniform sampler2D colorTexture; +`;var J9=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11696,7 +11705,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 jG=`uniform sampler2D colorTexture; +`;var Z9=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11716,7 +11725,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var HG=`in vec2 v_textureCoordinates; +`;var Q9=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -11734,7 +11743,7 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var IT=`#define SAMPLES 8 +`;var QT=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; @@ -11768,7 +11777,7 @@ result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } -`;var GG=`uniform sampler2D colorTexture; +`;var e7=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -11883,7 +11892,7 @@ result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } -`;var WG=`uniform sampler2D colorTexture; +`;var t7=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE @@ -11905,7 +11914,7 @@ color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var qG=`uniform sampler2D colorTexture; +`;var n7=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { @@ -11918,7 +11927,7 @@ 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 YG=`uniform sampler2D colorTexture; +`;var i7=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11939,7 +11948,7 @@ color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var XG=`uniform sampler2D colorTexture; +`;var r7=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) @@ -11975,7 +11984,7 @@ out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); * 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 KG=`#if (FXAA_QUALITY_PRESET == 10) + */var o7=`#if (FXAA_QUALITY_PRESET == 10) #define FXAA_QUALITY_PS 3 #define FXAA_QUALITY_P0 1.5 #define FXAA_QUALITY_P1 3.0 @@ -12445,8 +12454,8 @@ if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); } -`;function PT(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(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(PT.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}}});PT.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};PT.prototype.get=function(e){return this._stages[e]};function xRt(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}PT.prototype.update=function(e,t){this._selectedDirty=xRt(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)}};PT.prototype.isDestroyed=function(){return!1};PT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var Lf=PT;var ns={};function noe(e){let r=`#define USE_STEP_SIZE -${IT}`,o=new zr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Jd.LINEAR}),s=new zr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Jd.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 Lf({name:e,stages:[o,s],uniforms:a})}ns.createBlurStage=function(){return noe("czm_blur")};ns.createDepthOfFieldStage=function(){let e=noe("czm_depth_of_field_blur"),t=new zr({name:"czm_depth_of_field_composite",fragmentShader:kG,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 Lf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ns.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ns.createEdgeDetectionStage=function(){let e=Jn();return new zr({name:`czm_edge_detection_${e}`,fragmentShader:zG,uniforms:{length:.25,color:z.clone(z.BLACK)}})};ns.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function TRt(e){if(!l(e))return ns.createEdgeDetectionStage();let t=new Lf({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}; +`;function eE(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=$n()),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(eE.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}}});eE.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};eE.prototype.get=function(e){return this._stages[e]};function yzt(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}eE.prototype.update=function(e,t){this._selectedDirty=yzt(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)}};eE.prototype.isDestroyed=function(){return!1};eE.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var jf=eE;var is={};function Dse(e){let r=`#define USE_STEP_SIZE +${QT}`,o=new zr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:nh.LINEAR}),s=new zr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:nh.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 jf({name:e,stages:[o,s],uniforms:a})}is.createBlurStage=function(){return Dse("czm_blur")};is.createDepthOfFieldStage=function(){let e=Dse("czm_depth_of_field_blur"),t=new zr({name:"czm_depth_of_field_composite",fragmentShader:X9,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 jf({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=$n();return new zr({name:`czm_edge_detection_${e}`,fragmentShader:$9,uniforms:{length:.25,color:z.clone(z.BLACK)}})};is.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Azt(e){if(!l(e))return is.createEdgeDetectionStage();let t=new jf({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) { @@ -12461,22 +12470,14 @@ void main() { ${r} } out_FragColor = color; } -`,s=new zr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new Lf({name:"czm_edge_detection_composite",stages:[t,s]})}ns.createSilhouetteStage=function(e){let t=TRt(e),n=new zr({name:"czm_silhouette_color_edges",fragmentShader:XG,uniforms:{silhouetteTexture:t.name}});return new Lf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ns.isSilhouetteSupported=function(e){return e.context.depthTexture};ns.createBloomStage=function(){let e=new zr({name:"czm_bloom_contrast_bias",fragmentShader:BG,uniforms:{contrast:128,brightness:-.3}}),t=noe("czm_bloom_blur"),n=new Lf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new zr({name:"czm_bloom_generate_composite",fragmentShader:LG,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 Lf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};ns.createAmbientOcclusionStage=function(){let e=new zr({name:"czm_ambient_occlusion_generate",fragmentShader:OG,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new zr({name:"czm_ambient_occlusion_composite",fragmentShader:MG,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 Lf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ns.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var ERt=`#define FXAA_QUALITY_PRESET 39 -${KG} -${HG}`;ns.createFXAAStage=function(){return new zr({name:"czm_FXAA",fragmentShader:ERt,sampleMode:Jd.LINEAR})};ns.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=RG,new zr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ns.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=VG,new zr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ns.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=jG,new zr({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ns.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=YG,new zr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ns.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=WG,new zr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};ns.createAutoExposureStage=function(){return new nL};ns.createBlackAndWhiteStage=function(){return new zr({name:"czm_black_and_white",fragmentShader:NG,uniforms:{gradations:5}})};ns.createBrightnessStage=function(){return new zr({name:"czm_brightness",fragmentShader:FG,uniforms:{brightness:.5}})};ns.createNightVisionStage=function(){return new zr({name:"czm_night_vision",fragmentShader:qG})};ns.createDepthViewStage=function(){return new zr({name:"czm_depth_view",fragmentShader:UG})};ns.createLensFlareStage=function(){return new zr({name:"czm_lens_flare",fragmentShader:GG,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 Zd=ns;function i_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function LO(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function ioe(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[LO(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[LO(d)]=!0)}}}return i.name}function NO(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=NO(e,t,n,p,r):a=ioe(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=LO(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=LO(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[LO(i.get(p))]=!0}return a}function CRt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=NO(e,t,n,i,void 0);a=NO(e,t,n,r,a),a=ioe(e,t,n,o,a),a=NO(e,t,n,e,a),ioe(e,t,n,s,a)}else NO(e,t,n,e,void 0);return n}function vRt(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 SRt(e,t){let n=CRt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=vRt(e,i,n[i]))}function roe(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function wRt(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 di({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}i_.prototype.updateDependencies=function(){this._updateDependencies=!0};i_.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)&&(roe(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&SRt(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,roe(this),wRt(this,e))};i_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};i_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};i_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};i_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};i_.prototype.isDestroyed=function(){return!1};i_.prototype.destroy=function(){return roe(this),le(this)};var lw=i_;var pRe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(pRe);var OA=pRe;var ooe=[];function Gl(){let e=Zd.createFXAAStage(),t=Zd.createAmbientOcclusionStage(),n=Zd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Zd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=OA.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new lw(this),o={},s=ooe;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(Gl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,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 soe(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 OA.REINHARD:n=Zd.createReinhardTonemappingStage(t);break;case OA.MODIFIED_REINHARD:n=Zd.createModifiedReinhardTonemappingStage(t);break;case OA.FILMIC:n=Zd.createFilmicTonemappingStage(t);break;case OA.PBR_NEUTRAL:n=Zd.createPbrNeutralTonemappingStage(t);break;default:n=Zd.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 soe(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}Gl.prototype.add=function(e){let t=this._stageNames,n=ooe;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};Gl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=ooe;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};Gl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Gl.prototype.get=function(e){return soe(this),this._stages[e]};Gl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Gl.prototype.getStageByName=function(e){return this._stageNames[e]};Gl.prototype.update=function(e,t,n){soe(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:$n.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)};Gl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function DT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Gl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return DT(t)};function l0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){l0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)l0(e.get(o),t,DT(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)l0(e.get(o),t,n,i,r)}Gl.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&&(l0(a,e,A,n,i),A=DT(a)),p&&c.ready&&(l0(c,e,A,n,i),A=DT(c)),g&&u.ready&&l0(u,e,A,n,i),m&&f.ready&&(l0(f,e,A,n,i),A=DT(f));let b=A;if(o>0){l0(r[0],e,A,n,i);for(let x=1;x<o;++x)l0(r[x],e,DT(r[x-1]),n,i);b=DT(r[o-1])}y&&s.ready&&l0(s,e,b,n,i)};Gl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(vf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),le(this)};var $G=Gl;var aoe=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()}},gRe=aoe;function hl(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 JG=new h;Object.defineProperties(hl.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,JG),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,JG);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,JG),JG)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});hl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new hl(e,t)};var yRe=new h;hl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,yRe),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 IRt=new h;hl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,IRt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,yRe),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 PRt=new h;hl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Zo.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,PRt),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?Zo.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?Zo.FULL:Zo.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Zo.PARTIAL:Zo.FULL))}}return Zo.NONE};var ZG=new h;hl.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,ZG),ZG),c=-h.dot(a,r),u=hl._anyRotationVector(r,a,c),f=hl._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=hl._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,ZG),ZG)};var DRt=[];hl.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,DRt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return hl.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var RRt=new h;hl._anyRotationVector=function(e,t,n){let i=h.abs(t,RRt),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 ORt=new h;hl._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,ORt);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 coe=new h,MRt=new h,QG=new h,_Re=new h;hl._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,coe),s=h.clone(e.center,MRt),a=e.radius,c=h.subtract(s,o,QG),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,_Re),_Re),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,coe);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,coe);T=h.normalize(h.subtract(h.add(b,v,QG),s,QG),QG);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 e5=hl;var uw=`in vec4 position; -in vec2 textureCoordinates; -out vec2 v_textureCoordinates; -void main() -{ -gl_Position = position; -v_textureCoordinates = textureCoordinates; -} -`;function t5(e){this._context=e}var FO,NRt=new at({primitiveType:Oe.TRIANGLES}),LRt=new di({color:new z(0,0,0,0)});function FRt(e,t){return new vs({context:e,colorTextures:[t],destroyAttachments:!1})}function BRt(e,t){return Qt.fromCache({context:e,vertexShaderSource:uw,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function kRt(e,t){return(!l(FO)||FO.viewport.width!==e||FO.viewport.height!==t)&&(FO=Ge.fromCache({viewport:new et(0,0,e,t)})),FO}t5.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:BRt(r,e.fragmentShaderSource),a=FRt(r,t),c=kRt(n,i),u=e.uniformMap,f=LRt;f.framebuffer=a,f.renderState=c,f.execute(r);let d=NRt;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)};t5.prototype.isDestroyed=function(){return!1};t5.prototype.destroy=function(){return le(this)};var n5=t5;var loe=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)}},i5=loe;function dm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(dm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});dm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function URt(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}dm.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)?URt(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};dm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){uoe(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};dm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};dm.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 uoe(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];uoe(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}dm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];uoe(this,n),--this._numberOfShaders}this._shadersToRelease={}};dm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};dm.prototype.isDestroyed=function(){return!1};dm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var r5=dm;function RT(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(RT.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});RT.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};RT.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};RT.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={}};RT.prototype.isDestroyed=function(){return!1};RT.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var o5=RT;function zRt(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var MA=zRt;function fw(){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(fw.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 xRe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return xRe(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 doe(this),this._view3D}},viewRotation:{get:function(){return doe(this),this._viewRotation}},viewRotation3D:{get:function(){return doe(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return CRe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return CRe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return JRt(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ZRt(this),this._modelView}},modelView3D:{get:function(){return QRt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return oOt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return eOt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return tOt(this),this._inverseModelView3D}},viewProjection:{get:function(){return nOt(this),this._viewProjection}},inverseViewProjection:{get:function(){return iOt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return rOt(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return sOt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return aOt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return cOt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return lOt(this),this._normal}},normal3D:{get:function(){return uOt(this),this._normal3D}},inverseNormal:{get:function(){return fOt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return dOt(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 ERe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return ERe(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 VRt(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 jRt(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function HRt(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function GRt(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var ARe=new h,WRt=new M,bRe=new $;function qRt(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,ARe)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,ARe)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,WRt);e._enuToModel=M.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu);let s=M.getRotation(o,bRe),a=$.multiply(e._viewRotation,s,bRe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var foe=new $,YRt=new he;function XRt(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,foe);let n=TT.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(foe,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=TT.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(foe,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,YRt);i.project(o,e._sunPositionColumbusView)}fw.prototype.updateCamera=function(e){VRt(this,e.viewMatrix),jRt(this,e.inverseViewMatrix),qRt(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 pn};fw.prototype.updateFrustum=function(e){HRt(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&GRt(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};fw.prototype.updatePass=function(e){this._pass=e};var KRt=[],$Rt=new MA;fw.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),XRt(this,e);let n=e.light??$Rt;n instanceof MA?(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??KRt,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 xRe(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 JRt(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 ZRt(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function QRt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function eOt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function tOt(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function nOt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function iOt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function rOt(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function oOt(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 sOt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function aOt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function cOt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function lOt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function uOt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function fOt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function dOt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var TRe=new h;function ERe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,TRe),Sn.fromCartesian(TRe,e._encodedCameraPositionMC))}var hOt=new h,mOt=new h,pOt=new h,gOt=new h,_Ot=new he,yOt=new h,AOt=new M;function bOt(e,t,n,i,r,o,s,a){let c=hOt;c.x=e.y,c.y=e.z,c.z=e.x;let u=mOt;u.x=n.y,u.y=n.z,u.z=n.x;let f=pOt;f.x=i.y,f.y=i.z,f.z=i.x;let d=gOt;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,_Ot);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,yOt),y=At.eastNorthUpToFixedFrame(m,g,AOt);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 doe(e){e._view3DDirty&&(e._mode===re.SCENE3D?M.clone(e._view,e._view3D):bOt(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 CRe(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var s5=fw;function Wu(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):xOt(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new r5(this),this._textureCache=new o5,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=!!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"]),of.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,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=is(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=is(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=is(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 s5,C=new Dc(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 xOt(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 TOt(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 EOt(e,t,n,i){let r=`${TOt(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function COt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(EOt(e,t,n,i))}function vOt(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 SOt(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,vOt(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 wOt={};Object.defineProperties(Wu.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=SOt(this._originalGLContext,e?COt: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 ms({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 wOt}}});function vRe(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 hoe;typeof WebGLRenderingContext<"u"&&(hoe=[te.BACK]);function a5(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=hoe;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var IOt=new di;Wu.prototype.clear=function(e,t){e=e??IOt,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;vRe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;a5(this,c),n.clear(i)};function POt(e,t,n,i,r){a5(e,t),vRe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function DOt(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()}Wu.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,POt(this,r,t,n,o),DOt(this,e,n,i)};Wu.prototype.beginFrame=function(){};Wu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=hoe;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)};Wu.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 a5(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};Wu.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 a5(this,s),t.readPixels(n,i,r,o,$e.RGBA,ze.toWebGLConstant(a,this),u),u};var SRe={position:0,textureCoordinates:1};Wu.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:SRe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Wu.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:uw,fragmentShaderSource:e,attributeLocations:SRe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Wu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Wu.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 i5(this._pickObjects,t,z.fromRgba(t))};Wu.prototype.isDestroyed=function(){return!1};Wu.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(),le(this)};var dw=Wu;var moe=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))}},c5=moe;function OT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}OT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};OT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof pn,!(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?lMt(this,e):gMt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var ROt=new h,OOt=new h,MOt=new h,NOt=new h,LOt=new h,FOt=new h,BOt=new h,kOt=new he,UOt=new M,zOt=new Zi,VOt=new pn,jOt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};OT.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=ROt,r=OOt,o=MOt;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,BOt),d=At.eastNorthUpToFixedFrame(f,t,UOt);M.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,kOt),i),M.multiplyByPointAsVector(d,r,r),M.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=VOt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=zOt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=jOt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=yMt(a);BO(this,c),this._previousMode===re.SCENE2D?_Mt(this,e,a,c):(a.position2D=M.multiplyByPoint(Or.TRANSFORM_2D,i,NOt),a.direction2D=M.multiplyByPointAsVector(Or.TRANSFORM_2D,r,LOt),a.up2D=M.multiplyByPointAsVector(Or.TRANSFORM_2D,o,FOt),n._mode=re.MORPHING,BRe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var _oe={position:new h,direction:new h,up:new h,frustum:void 0},IRe=new Zi;OT.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)QOt(this,e,t);else{let i;e>0?(i=_oe,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=PRe(this,t);let r,o=n.camera;o.frustum instanceof pn?r=o.frustum.clone():(r=IRe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=URe(i);BO(this,s),goe(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};OT.prototype.isDestroyed=function(){return!1};OT.prototype.destroy=function(){return l5(this),le(this)};function BO(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ma(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 l5(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 HOt=new he,GOt=new h,WOt=new M;function PRe(e,t){let n=e._scene,i=n.camera,r=_oe,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,HOt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,GOt),f=At.eastNorthUpToFixedFrame(u,t,WOt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),r}var qOt=new h,YOt=new h,XOt=new h,KOt=new h,$Ot=new h,JOt=new h;function goe(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,qOt),a=h.clone(o.direction,YOt),c=h.clone(o.up,XOt),u=M.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,n.position,KOt),f=M.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.direction,$Ot),d=M.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.up,JOt);function p(m){Qd(s,u,m.time,o.position),Qd(a,f,m.time,o.direction),Qd(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:Ps.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){kRe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var ZOt=new pn,DRe=new h,RRe=new h,ORe=new h,yoe=new h,MRe=new h,NRe=new h;function QOt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=_oe,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=PRe(e,n));let s;e._morphToOrthographic?(s=ZOt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=IRe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=URe(o);BO(e,a);let c;e._morphToOrthographic?c=function(){goe(e,t,o,a)}:c=function(){FRe(e,t,o,function(){goe(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,yoe),complete:function(){i._mode=re.MORPHING,c()}})):c()}function Qd(e,t,n,i){return h.lerp(e,t,n,i)}function LRe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof pn)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:Ps.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var eMt=new h,tMt=new h,nMt=new h,poe=new h,iMt=new h,rMt=new h,oMt=new ws,sMt=new gn,aMt=new h,cMt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function lMt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,eMt),o=h.clone(i.direction,tMt),s=h.clone(i.up,nMt),a=h.negate(h.UNIT_Z,iMt),c=h.clone(h.UNIT_Y,rMt),u=poe;if(t>0)h.clone(h.ZERO,poe),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,poe);let A=sMt;M.multiplyByPoint(Or.TRANSFORM_2D,r,A.origin),M.multiplyByPointAsVector(Or.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,aMt);l(x)&&(M.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=oMt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=cMt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=zRe(d);BO(e,p);function g(A){Qd(r,u,A.time,i.position),Qd(o,a,A.time,i.direction),Qd(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:Ps.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){LRe(e,t,d,m,p)}});e._currentTweens.push(y)}var wRe=new he,uMt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ws},fMt={position:new h,direction:new h,up:new h,frustum:void 0},dMt=new h,hMt=new gn,mMt=new M,pMt=new h;function gMt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=uMt;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,wRe),i.mapProjection.project(wRe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=hMt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,pMt),m=At.eastNorthUpToFixedFrame(g,n,mMt);M.inverseTransformation(m,m),M.multiplyByPointAsVector(m,p,p),M.multiplyByPointAsVector(Or.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,dMt);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(Or.TRANSFORM_2D,o.position,o.position2D),M.multiplyByPointAsVector(Or.TRANSFORM_2D,o.direction,o.direction2D),M.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=fMt;M.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=zRe(c);BO(e,u);function f(){LRe(e,t,o,s,u)}BRe(e,t,o,f)}function FRe(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:Ps.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function _Mt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,yoe),a=h.clone(n.direction,MRe),c=h.clone(n.up,NRe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,DRe),d=h.clone(o.direction,RRe),p=h.clone(o.up,ORe);f.z=s.z;function g(y){Qd(f,s,y.time,o.position),Qd(d,a,y.time,o.direction),Qd(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:Ps.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():FRe(e,0,n,u)}function BRe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,DRe),a=h.clone(o.direction,RRe),c=h.clone(o.up,ORe),u=h.clone(n.position2D,yoe),f=h.clone(n.direction2D,MRe),d=h.clone(n.up2D,NRe);function p(m){Qd(s,u,m.time,o.position),Qd(a,f,m.time,o.direction),Qd(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:Ps.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){kRe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function kRe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Ps.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function URe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),l5(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 zRe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),l5(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 yMt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),l5(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 u5=OT;function f5(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(f5.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}}});f5.prototype.cancelTween=function(){this._tweens.remove(this)};function hm(){this._tweens=[]}Object.defineProperties(hm.prototype,{length:{get:function(){return this._tweens.length}}});hm.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new f5(this);let t=e.duration/Un.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Un.SECONDS_PER_MILLISECOND,r=e.easingFunction??Ps.LINEAR_NONE,o=e.startObject,s=new zde(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 f5(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};hm.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})};hm.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})};hm.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})};hm.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};hm.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};hm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};hm.prototype.get=function(e){return this._tweens[e]};hm.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 hw=hm;function UO(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=or.LEFT_DRAG,this.zoomEventTypes=[or.RIGHT_DRAG,or.WHEEL,or.PINCH],this.rotateEventTypes=or.LEFT_DRAG,this.tiltEventTypes=[or.MIDDLE_DRAG,or.PINCH,{eventType:or.LEFT_DRAG,modifier:to.CTRL},{eventType:or.RIGHT_DRAG,modifier:to.CTRL}],this.lookEventTypes={eventType:or.LEFT_DRAG,modifier:to.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 uk(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 hw,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 AMt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function bMt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var xMt=.4;function TMt(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<xMt){let g=AMt(p,i),m=e.getLastMovement(t,n);if(!l(m)||bMt(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 EMt(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 VRe=[];function Wl(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(VRe[0]=n,n=VRe);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),EMt(e,o)):r<1&&TMt(s,f,d,r,i,e,o))}}var d5=new gn,CMt=new h,vMt=new U,SMt=new h,wMt=new U,IMt=new h,PMt=new h,DMt=new h,RMt=new h,QRe=new h,OMt=new h,MMt=new h,NMt=new h,LMt=new h,FMt=new h,BMt=new h,kMt=new h,UMt=new h,zMt=new h,VMt=new h,MT=new h,jRe=new h,HRe=new h,Aoe={orientation:new Uc};function woe(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=Aoe.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,d5).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=r_(e,t,CMt)),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,SMt);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,d5).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,QRe);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=wMt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=r_(e,L,IMt);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=MMt;h.clone(A.position,C);let w=e._zoomWorldPosition,D=OMt;if(D=h.normalize(w,D),h.dot(D,R)<0)return;let N=VMt,F=FMt;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,MT),N);let V=BMt,B=kMt;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=NMt;h.normalize(C,Ae);let fe=LMt;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,MT),F),h.multiplyByScalar(h.normalize(N,MT),h.magnitude(N)-m,N),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=UMt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,jRe),h.multiplyByScalar(F,Math.sin(ae),HRe),MT),Q,xe),h.add(C,xe,C),h.normalize(N,Ae),h.normalize(h.cross(Ae,fe,MT),F);let ge=zMt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,jRe),h.multiplyByScalar(F,Math.sin(ae),HRe),MT),h.magnitude(N),ge),h.add(N,ge,N),h.clone(C,A.position),h.normalize(h.subtract(N,C,MT),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(Aoe);return}else{let C=h.normalize(_,PMt),w=h.normalize(e._zoomWorldPosition,DMt),D=h.dot(w,C);if(D>0&&D<1){let N=P.acosClamped(D),F=h.cross(w,C,RMt),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=pr.worldToWindowCoordinates(y,e._zoomWorldPosition,vMt);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,d5):R=A.getPickRay(t,d5);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(Aoe)}var jMt=new gn,HMt=new gn,GMt=new h;function WMt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,jMt).origin,s=r.getPickRay(n.endPosition,HMt).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,GMt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function GRe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;woe(e,t,n,e.zoomFactor,r.getMagnitude())}var qMt=new U,YMt=new U;function WRe(e,t,n){if(l(n.angleAndHeight)){XMt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=qMt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=YMt;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 XMt(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 KMt(e){let t=e._scene.mapMode2D===_u.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(Wl(e,e.enableTranslate,e.translateEventTypes,WMt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Wl(e,e.enableZoom,e.zoomEventTypes,GRe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Wl(e,e.enableRotate,e.tiltEventTypes,WRe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Wl(e,e.enableZoom,e.zoomEventTypes,GRe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Wl(e,e.enableRotate,e.translateEventTypes,WRe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var eOe=new gn,$Mt=new h,JMt=new h;function r_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,$Mt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,eOe),u=r.pickWorldCoordinates(c,i,a,JMt),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 ZMt=new he;function A5(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,ZMt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var QMt=new h;function tOe(e,t){let n=t.origin,i=t.direction,r=A5(e),o=h.normalize(n,QMt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function nOe(e,t,n,i){let r=h.distance(t.origin,n),o=A5(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 iOe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=A5(e))):r=A5(e),gn.getPoint(t,r,i)}var eNt=new U;function rOe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,eNt),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,Ioe(e,t,e._strafeStartPosition),t.endPosition=n}var qRe=new gn,tNt=new gn,boe=new h,nNt=new h,iNt=new h,rNt=new h,oNt=new sn(h.UNIT_X,0),sNt=new U,aNt=new U;function cNt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Bf(e,t,n);return}if(e._strafing){rOe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,sNt),a=U.clone(n.endPosition,aNt),c=r.getPickRay(s,qRe),u=h.clone(h.ZERO,rNt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=r_(e,s,boe),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=iOe(e,c,d,boe)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Ioe(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,oNt);c=r.getPickRay(s,qRe);let g=Ti.rayPlane(c,p,boe),m=r.getPickRay(a,tNt),y=Ti.rayPlane(m,p,nNt);if(!l(g)||!l(y)){e._looking=!0,Bf(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,iNt),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 oOe=new U,p5=new gn,g5=new h,lNt=new h,sOe=new M,uNt=new M,fNt=new h,dNt=new sn(h.UNIT_X,0),xoe=new h,Coe=new he,aOe=new M,hNt=new Le,mNt=new $,_5=new h;function pNt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Bf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,gNt(e,t,n)):_Nt(e,t,n)}function gNt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=oOe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,p5),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,Bf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,g5);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,Coe);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,sOe),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,aOe);r._setTransform(b),Ff(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 _Nt(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,g5);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=r_(e,t,g5)),!l(s)){a=r.getPickRay(t,p5);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,Bf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,g5),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,p5)),nOe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=oOe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,p5);let d=h.clone(h.ZERO,fNt);d.x=s.x;let p=sn.fromPointNormal(d,c,dNt),g=Ti.rayPlane(a,p,lNt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,Coe);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,sOe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Coe),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,uNt)):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,aOe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,xoe),xoe),R=h.dot(r.right,I);if(Ff(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,Ff(e,t,n,v,!0,!1),r.constrainedAxis=C}else Ff(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,_5);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,xoe);if(e.enableCollisionDetection&&Roe(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,hNt),N=$.fromQuaternion(D,mNt);$.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 cOe=new U,lOe=new gn,uOe=new h;function yNt(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=cOe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,lOe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=r_(e,a,uOe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=tOe(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)}woe(e,t,n,e.zoomFactor,g)}function ANt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))Wl(e,e.enableRotate,e.rotateEventTypes,Ff,e.inertiaSpin,"_lastInertiaSpinMovement"),Wl(e,e.enableZoom,e.zoomEventTypes,dOe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Wl(e,e.enableTilt,e.tiltEventTypes,pNt,e.inertiaSpin,"_lastInertiaTiltMovement"),Wl(e,e.enableTranslate,e.translateEventTypes,cNt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Wl(e,e.enableZoom,e.zoomEventTypes,yNt,e.inertiaZoom,"_lastInertiaZoomMovement"),Wl(e,e.enableLook,e.lookEventTypes,Bf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var bNt=new gn,xNt=new sn(h.UNIT_X,0),TNt=new h,ENt=new h;function Ioe(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,bNt),s=h.clone(r.direction,ENt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,xNt),c=Ti.rayPlane(o,a,TNt);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 YRe=new h,fOe=new he,voe=new h,Soe=new ee,CNt=new h,vNt=new h,SNt=new h;function wNt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(r.transform,M.IDENTITY)){Ff(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,CNt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Bf(e,t,n,u);else if(e._rotating)Ff(e,t,n);else if(e._strafing)rOe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=voe,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Soe),Eoe(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,fOe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=r_(e,n.startPosition,SNt);if(l(p)){let g,m=r.getPickRay(n.startPosition,eOe);if(o)g=!0,iOe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,vNt);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,Ioe(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=voe,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Soe),Eoe(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Bf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,YRe))?(Eoe(e,t,n,e._ellipsoid),h.clone(YRe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Ff(e,t,n)):(e._looking=!0,Bf(e,t,n,u));U.clone(t,e._rotateMousePosition)}function Ff(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 Toe=se.clone(se.UNIT_W),XRe=se.clone(se.UNIT_W),h5=new h,mw=new h,m5=new h,KRe=new h,INt=new U,PNt=new U,DNt=new U,RNt=new U,ONt=new gn;function Eoe(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,INt),a=U.clone(n.endPosition,PNt),c=i.cartesianToCartographic(o.positionWC,fOe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Toe),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=r_(e,s,Toe)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,mw),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),mw),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,RNt),y=U.subtract(a,s,DNt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,mw),b=h.normalize(o.positionWC,QRe),x=o.getPickRay(a,ONt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,m5),m5),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,m5);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,KRe);f=h.add(u,A,XRe),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,Toe),f=o.pickEllipsoid(a,i,XRe)),!l(u)||!l(f)){e._rotating=!0,Ff(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,h5);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,mw),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,m5);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,KRe);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,h5);let L=h.cross(d,O,h5),_=h.dot(L,h.subtract(u,d,mw)),C=h.dot(L,h.subtract(f,d,mw)),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,h5);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var MNt=new h,NNt=new he,$Re=0;function dOe(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=cOe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,lOe),d,p=r.cartesianToCartographic(s.position,NNt).height,g=Math.abs($Re)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=r_(e,u,uOe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&($Re=y),c){let b=tOe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,MNt);woe(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var hOe=new U,y5=new gn,kO=new h,LNt=new h,mOe=new M,FNt=new M,pOe=new M,BNt=new Le,kNt=new $,Poe=new he,Doe=new h;function UNt(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,Doe);Bf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Poe);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,VNt(e,t,n)):jNt(e,t,n)}var zNt=new he;function VNt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,zNt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=hOe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,y5),d,p=Ti.rayEllipsoid(f,i);if(l(p))d=gn.getPoint(f,p.start,kO);else if(a>e._minimumTrackBallHeight){let x=Ti.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,Poe);T.height=0,d=i.cartographicToCartesian(T,kO)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Doe);Bf(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,mOe),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,pOe);o._setTransform(g),Ff(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 jNt(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,kO);else{if(a=r_(e,t,kO),!l(a)){if(c=o.getPickRay(t,y5),u=Ti.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Poe).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Doe);Bf(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,kO)}s&&(l(c)||(c=o.getPickRay(t,y5)),nOe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=hOe;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,voe),m=ee.fromCartesian3(g,Soe);if(u=Ti.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=gn.getPoint(c,y,LNt),b=At.eastNorthUpToFixedFrame(a,i,mOe),x=At.eastNorthUpToFixedFrame(A,m,FNt),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,pOe);o._setTransform(x);let I=h.cross(A,o.positionWC,_5);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,Ff(e,t,n,v,!0,!1),o.constrainedAxis=C}else Ff(e,t,n,v,!0,!1);if(o._setTransform(b),Ff(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,_5);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,_5);if(e.enableCollisionDetection&&Roe(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,BNt),N=$.fromQuaternion(D,kNt);$.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 HNt=new U,GNt=new U,JRe=new gn,ZRe=new gn,WNt=new h,qNt=new h;function Bf(e,t,n,i){let o=e._scene.camera,s=HNt;s.x=n.startPosition.x,s.y=0;let a=GNt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,JRe),u=o.getPickRay(a,ZRe),f=0,d,p;o.frustum instanceof pn?(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,JRe),u=o.getPickRay(a,ZRe),f=0,o.frustum instanceof pn?(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,WNt),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,qNt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function YNt(e){Wl(e,e.enableRotate,e.rotateEventTypes,wNt,e.inertiaSpin,"_lastInertiaSpinMovement"),Wl(e,e.enableZoom,e.zoomEventTypes,dOe,e.inertiaZoom,"_lastInertiaZoomMovement"),Wl(e,e.enableTilt,e.tiltEventTypes,UNt,e.inertiaSpin,"_lastInertiaTiltMovement"),Wl(e,e.enableLook,e.lookEventTypes,Bf)}var XNt=new M,KNt=new he;function Roe(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,XNt),c=h.magnitude(r.position),r._setTransform(M.IDENTITY));let u=KNt;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)))}UO.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 $Nt=new h,JNt=new h;UO.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,$Nt),c=h.clone(t.directionWC,JNt);if(i===re.SCENE2D?KMt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,ANt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,YNt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Roe(this,u)}this._aggregator.reset()};UO.prototype.isDestroyed=function(){return!1};UO.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var b5=UO;function x5(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new dw(this._canvas,Ze(e?.contextOptions)),this._canvases=[]}x5.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)}}})};x5.prototype.destroy=function(){this._context.destroy(),le(this)};x5.prototype.isDestroyed=function(){return!1};var T5=x5;function zO(e){let t=new Dc(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 ZNt(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}zO.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};zO.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 ZNt(i,r,t,n)};zO.prototype.isDestroyed=function(){return!1};zO.prototype.destroy=function(){return this._fb.destroy(),le(this)};var E5=zO;var VO={},QNt=new et(0,0,3,3),eLt=new U,tLt=new U,nLt=new gn,iLt=new h,rLt=3,oLt=.1,gOe=9;function Ooe(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function _Oe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Ooe(s)<=rLt&&(t=Math.min(t,s.depth));let n=t*(1+oLt),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)=>Ooe(a)<Ooe(s)?a:s)}function yOe(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 Moe(e,t,n){let i=eLt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,nLt);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,iLt);return h.add(r.origin,a,new h)}VO.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 E5(o));let a=s.snapFramebuffer,c=QNt;DO(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(RO(e),u.length===0)return;let f=_Oe(u);if(!l(f))return;let d=Moe(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=tLt;g.x=t.x+f.x,g.y=t.y+f.y,DO(e,g,c,gOe,gOe,{framebuffer:a,snap:!0});let m=a.end(c);RO(e);let y=yOe(m,f.object);p=l(y)?Moe(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)}};VO._selectBestHit=_Oe;VO._nearestSurfaceHit=yOe;VO._snapHitToWorld=Moe;var C5=VO;var v5=`uniform sampler2D colorTexture; +`,s=new zr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new jf({name:"czm_edge_detection_composite",stages:[t,s]})}is.createSilhouetteStage=function(e){let t=Azt(e),n=new zr({name:"czm_silhouette_color_edges",fragmentShader:r7,uniforms:{silhouetteTexture:t.name}});return new jf({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:Y9,uniforms:{contrast:128,brightness:-.3}}),t=Dse("czm_bloom_blur"),n=new jf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new zr({name:"czm_bloom_generate_composite",fragmentShader:W9,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 jf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};is.createAmbientOcclusionStage=function(){let e=new zr({name:"czm_ambient_occlusion_generate",fragmentShader:j9,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new zr({name:"czm_ambient_occlusion_composite",fragmentShader:H9,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 jf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var bzt=`#define FXAA_QUALITY_PRESET 39 +${o7} +${Q9}`;is.createFXAAStage=function(){return new zr({name:"czm_FXAA",fragmentShader:bzt,sampleMode:nh.LINEAR})};is.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=V9,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+=J9,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+=Z9,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+=i7,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+=t7,new zr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};is.createAutoExposureStage=function(){return new nG};is.createBlackAndWhiteStage=function(){return new zr({name:"czm_black_and_white",fragmentShader:G9,uniforms:{gradations:5}})};is.createBrightnessStage=function(){return new zr({name:"czm_brightness",fragmentShader:q9,uniforms:{brightness:.5}})};is.createNightVisionStage=function(){return new zr({name:"czm_night_vision",fragmentShader:n7})};is.createDepthViewStage=function(){return new zr({name:"czm_depth_view",fragmentShader:K9})};is.createLensFlareStage=function(){return new zr({name:"czm_lens_flare",fragmentShader:e7,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 ih=is;function p_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function MM(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Rse(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[MM(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[MM(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=Rse(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=MM(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=MM(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[MM(i.get(p))]=!0}return a}function xzt(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=Rse(e,t,n,o,a),a=OM(e,t,n,e,a),Rse(e,t,n,s,a)}else OM(e,t,n,e,void 0);return n}function Tzt(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 Ezt(e,t){let n=xzt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Tzt(e,i,n[i]))}function Ose(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Czt(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 hi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}p_.prototype.updateDependencies=function(){this._updateDependencies=!0};p_.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)&&(Ose(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Ezt(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,Ose(this),Czt(this,e))};p_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};p_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};p_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};p_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};p_.prototype.isDestroyed=function(){return!1};p_.prototype.destroy=function(){return Ose(this),le(this)};var TI=p_;var GFe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(GFe);var rb=GFe;var Mse=[];function $l(){let e=ih.createFXAAStage(),t=ih.createAmbientOcclusionStage(),n=ih.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=ih.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=rb.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new TI(this),o={},s=Mse;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 Nse(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 rb.REINHARD:n=ih.createReinhardTonemappingStage(t);break;case rb.MODIFIED_REINHARD:n=ih.createModifiedReinhardTonemappingStage(t);break;case rb.FILMIC:n=ih.createFilmicTonemappingStage(t);break;case rb.PBR_NEUTRAL:n=ih.createPbrNeutralTonemappingStage(t);break;default:n=ih.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 Nse(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=Mse;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=Mse;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 Nse(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){Nse(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 Gt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Zn.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 tE(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 tE(t)};function T0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){T0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)T0(e.get(o),t,tE(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)T0(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&&(T0(a,e,A,n,i),A=tE(a)),p&&c.ready&&(T0(c,e,A,n,i),A=tE(c)),g&&u.ready&&T0(u,e,A,n,i),m&&f.ready&&(T0(f,e,A,n,i),A=tE(f));let b=A;if(o>0){T0(r[0],e,A,n,i);for(let x=1;x<o;++x)T0(r[x],e,tE(r[x-1]),n,i);b=tE(r[o-1])}y&&s.ready&&T0(s,e,b,n,i)};$l.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Vf,{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(),le(this)};var s7=$l;var Lse=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()}},WFe=Lse;var Fse=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))}},a7=Fse;function nE(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}nE.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};nE.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?iVt(this,e):uVt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var vzt=new h,Szt=new h,wzt=new h,Izt=new h,Pzt=new h,Dzt=new h,Rzt=new h,Ozt=new he,Mzt=new M,Nzt=new er,Lzt=new _n,Fzt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};nE.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=vzt,r=Szt,o=wzt;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,Rzt),d=At.eastNorthUpToFixedFrame(f,t,Mzt);M.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,Ozt),i),M.multiplyByPointAsVector(d,r,r),M.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=Lzt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Nzt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=Fzt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=dVt(a);NM(this,c),this._previousMode===re.SCENE2D?fVt(this,e,a,c):(a.position2D=M.multiplyByPoint(Nr.TRANSFORM_2D,i,Izt),a.direction2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,r,Pzt),a.up2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,Dzt),n._mode=re.MORPHING,nBe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Use={position:new h,direction:new h,up:new h,frustum:void 0},YFe=new er;nE.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)Yzt(this,e,t);else{let i;e>0?(i=Use,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=XFe(this,t);let r,o=n.camera;o.frustum instanceof _n?r=o.frustum.clone():(r=YFe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=rBe(i);NM(this,s),kse(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};nE.prototype.isDestroyed=function(){return!1};nE.prototype.destroy=function(){return c7(this),le(this)};function NM(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new xa(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 c7(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 Bzt=new he,kzt=new h,Uzt=new M;function XFe(e,t){let n=e._scene,i=n.camera,r=Use,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,Bzt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,kzt),f=At.eastNorthUpToFixedFrame(u,t,Uzt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),r}var zzt=new h,Vzt=new h,jzt=new h,Hzt=new h,Gzt=new h,Wzt=new h;function kse(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,zzt),a=h.clone(o.direction,Vzt),c=h.clone(o.up,jzt),u=M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,n.position,Hzt),f=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.direction,Gzt),d=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.up,Wzt);function p(m){rh(s,u,m.time,o.position),rh(a,f,m.time,o.direction),rh(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:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){iBe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var qzt=new _n,KFe=new h,$Fe=new h,JFe=new h,zse=new h,ZFe=new h,QFe=new h;function Yzt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Use,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=XFe(e,n));let s;e._morphToOrthographic?(s=qzt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=YFe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=rBe(o);NM(e,a);let c;e._morphToOrthographic?c=function(){kse(e,t,o,a)}:c=function(){tBe(e,t,o,function(){kse(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,zse),complete:function(){i._mode=re.MORPHING,c()}})):c()}function rh(e,t,n,i){return h.lerp(e,t,n,i)}function eBe(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:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var Xzt=new h,Kzt=new h,$zt=new h,Bse=new h,Jzt=new h,Zzt=new h,Qzt=new ws,eVt=new gn,tVt=new h,nVt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function iVt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,Xzt),o=h.clone(i.direction,Kzt),s=h.clone(i.up,$zt),a=h.negate(h.UNIT_Z,Jzt),c=h.clone(h.UNIT_Y,Zzt),u=Bse;if(t>0)h.clone(h.ZERO,Bse),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Bse);let A=eVt;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,tVt);l(x)&&(M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=Qzt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=nVt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=oBe(d);NM(e,p);function g(A){rh(r,u,A.time,i.position),rh(o,a,A.time,i.direction),rh(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:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){eBe(e,t,d,m,p)}});e._currentTweens.push(y)}var qFe=new he,rVt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ws},oVt={position:new h,direction:new h,up:new h,frustum:void 0},sVt=new h,aVt=new gn,cVt=new M,lVt=new h;function uVt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=rVt;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,qFe),i.mapProjection.project(qFe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=aVt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,lVt),m=At.eastNorthUpToFixedFrame(g,n,cVt);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,sVt);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=oVt;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=oBe(c);NM(e,u);function f(){eBe(e,t,o,s,u)}nBe(e,t,o,f)}function tBe(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:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function fVt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,zse),a=h.clone(n.direction,ZFe),c=h.clone(n.up,QFe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,KFe),d=h.clone(o.direction,$Fe),p=h.clone(o.up,JFe);f.z=s.z;function g(y){rh(f,s,y.time,o.position),rh(d,a,y.time,o.direction),rh(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:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():tBe(e,0,n,u)}function nBe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,KFe),a=h.clone(o.direction,$Fe),c=h.clone(o.up,JFe),u=h.clone(n.position2D,zse),f=h.clone(n.direction2D,ZFe),d=h.clone(n.up2D,QFe);function p(m){rh(s,u,m.time,o.position),rh(a,f,m.time,o.direction),rh(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:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){iBe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function iBe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:ks.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function rBe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),c7(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 oBe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),c7(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 dVt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),c7(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 l7=nE;function u7(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(u7.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}}});u7.prototype.cancelTween=function(){this._tweens.remove(this)};function Im(){this._tweens=[]}Object.defineProperties(Im.prototype,{length:{get:function(){return this._tweens.length}}});Im.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new u7(this);let t=e.duration/Un.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Un.SECONDS_PER_MILLISECOND,r=e.easingFunction??ks.LINEAR_NONE,o=e.startObject,s=new mDe(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 u7(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Im.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})};Im.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})};Im.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})};Im.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};Im.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};Im.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Im.prototype.get=function(e){return this._tweens[e]};Im.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 EI=Im;function FM(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:oo.CTRL},{eventType:mr.RIGHT_DRAG,modifier:oo.CTRL}],this.lookEventTypes={eventType:mr.LEFT_DRAG,modifier:oo.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 FG(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 EI,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 hVt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function mVt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var pVt=.4;function gVt(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<pVt){let g=hVt(p,i),m=e.getLastMovement(t,n);if(!l(m)||mVt(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 _Vt(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 sBe=[];function Jl(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(sBe[0]=n,n=sBe);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),_Vt(e,o)):r<1&&gVt(s,f,d,r,i,e,o))}}var f7=new gn,yVt=new h,AVt=new U,bVt=new h,xVt=new U,TVt=new h,EVt=new h,CVt=new h,vVt=new h,yBe=new h,SVt=new h,wVt=new h,IVt=new h,PVt=new h,DVt=new h,RVt=new h,OVt=new h,MVt=new h,NVt=new h,LVt=new h,iE=new h,aBe=new h,cBe=new h,Vse={orientation:new Bc};function Kse(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=Vse.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,f7).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=g_(e,t,yVt)),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,bVt);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,f7).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,yBe);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=xVt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=g_(e,L,TVt);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=wVt;h.clone(A.position,C);let w=e._zoomWorldPosition,D=SVt;if(D=h.normalize(w,D),h.dot(D,R)<0)return;let N=LVt,F=DVt;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,iE),N);let V=RVt,B=OVt;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=IVt;h.normalize(C,Ae);let fe=PVt;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,iE),F),h.multiplyByScalar(h.normalize(N,iE),h.magnitude(N)-m,N),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=MVt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,aBe),h.multiplyByScalar(F,Math.sin(ae),cBe),iE),Q,xe),h.add(C,xe,C),h.normalize(N,Ae),h.normalize(h.cross(Ae,fe,iE),F);let ge=NVt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,aBe),h.multiplyByScalar(F,Math.sin(ae),cBe),iE),h.magnitude(N),ge),h.add(N,ge,N),h.clone(C,A.position),h.normalize(h.subtract(N,C,iE),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(Vse);return}else{let C=h.normalize(_,EVt),w=h.normalize(e._zoomWorldPosition,CVt),D=h.dot(w,C);if(D>0&&D<1){let N=P.acosClamped(D),F=h.cross(w,C,vVt),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=pr.worldToWindowCoordinates(y,e._zoomWorldPosition,AVt);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,f7):R=A.getPickRay(t,f7);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(Vse)}var FVt=new gn,BVt=new gn,kVt=new h;function UVt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,FVt).origin,s=r.getPickRay(n.endPosition,BVt).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,kVt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function lBe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Kse(e,t,n,e.zoomFactor,r.getMagnitude())}var zVt=new U,VVt=new U;function uBe(e,t,n){if(l(n.angleAndHeight)){jVt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=zVt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=VVt;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 jVt(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 HVt(e){let t=e._scene.mapMode2D===Yu.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(Jl(e,e.enableTranslate,e.translateEventTypes,UVt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,lBe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jl(e,e.enableRotate,e.tiltEventTypes,uBe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Jl(e,e.enableZoom,e.zoomEventTypes,lBe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Jl(e,e.enableRotate,e.translateEventTypes,uBe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ABe=new gn,GVt=new h,WVt=new h;function g_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,GVt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,ABe),u=r.pickWorldCoordinates(c,i,a,WVt),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 qVt=new he;function y7(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,qVt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var YVt=new h;function bBe(e,t){let n=t.origin,i=t.direction,r=y7(e),o=h.normalize(n,YVt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function xBe(e,t,n,i){let r=h.distance(t.origin,n),o=y7(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 TBe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=y7(e))):r=y7(e),gn.getPoint(t,r,i)}var XVt=new U;function EBe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,XVt),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,$se(e,t,e._strafeStartPosition),t.endPosition=n}var fBe=new gn,KVt=new gn,jse=new h,$Vt=new h,JVt=new h,ZVt=new h,QVt=new sn(h.UNIT_X,0),e4t=new U,t4t=new U;function n4t(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Gf(e,t,n);return}if(e._strafing){EBe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,e4t),a=U.clone(n.endPosition,t4t),c=r.getPickRay(s,fBe),u=h.clone(h.ZERO,ZVt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=g_(e,s,jse),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=TBe(e,c,d,jse)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,$se(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,QVt);c=r.getPickRay(s,fBe);let g=xi.rayPlane(c,p,jse),m=r.getPickRay(a,KVt),y=xi.rayPlane(m,p,$Vt);if(!l(g)||!l(y)){e._looking=!0,Gf(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,JVt),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 CBe=new U,m7=new gn,p7=new h,i4t=new h,vBe=new M,r4t=new M,o4t=new h,s4t=new sn(h.UNIT_X,0),Hse=new h,qse=new he,SBe=new M,a4t=new Le,c4t=new $,g7=new h;function l4t(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Gf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,u4t(e,t,n)):f4t(e,t,n)}function u4t(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=CBe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,m7),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,Gf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,p7);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,qse);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,vBe),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,SBe);r._setTransform(b),Hf(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 f4t(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,p7);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=g_(e,t,p7)),!l(s)){a=r.getPickRay(t,m7);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,Gf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,p7),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,m7)),xBe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=CBe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,m7);let d=h.clone(h.ZERO,o4t);d.x=s.x;let p=sn.fromPointNormal(d,c,s4t),g=xi.rayPlane(a,p,i4t),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,qse);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,vBe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,qse),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,r4t)):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,SBe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,Hse),Hse),R=h.dot(r.right,I);if(Hf(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,Hf(e,t,n,v,!0,!1),r.constrainedAxis=C}else Hf(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,g7);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,Hse);if(e.enableCollisionDetection&&Qse(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,a4t),N=$.fromQuaternion(D,c4t);$.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 wBe=new U,IBe=new gn,PBe=new h;function d4t(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=wBe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,IBe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=g_(e,a,PBe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=bBe(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)}Kse(e,t,n,e.zoomFactor,g)}function h4t(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))Jl(e,e.enableRotate,e.rotateEventTypes,Hf,e.inertiaSpin,"_lastInertiaSpinMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,RBe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Jl(e,e.enableTilt,e.tiltEventTypes,l4t,e.inertiaSpin,"_lastInertiaTiltMovement"),Jl(e,e.enableTranslate,e.translateEventTypes,n4t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,d4t,e.inertiaZoom,"_lastInertiaZoomMovement"),Jl(e,e.enableLook,e.lookEventTypes,Gf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var m4t=new gn,p4t=new sn(h.UNIT_X,0),g4t=new h,_4t=new h;function $se(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,m4t),s=h.clone(r.direction,_4t);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,p4t),c=xi.rayPlane(o,a,g4t);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 dBe=new h,DBe=new he,Yse=new h,Xse=new ee,y4t=new h,A4t=new h,b4t=new h;function x4t(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(r.transform,M.IDENTITY)){Hf(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,y4t);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Gf(e,t,n,u);else if(e._rotating)Hf(e,t,n);else if(e._strafing)EBe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Yse,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Xse),Wse(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,DBe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=g_(e,n.startPosition,b4t);if(l(p)){let g,m=r.getPickRay(n.startPosition,ABe);if(o)g=!0,TBe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,A4t);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,$se(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Yse,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Xse),Wse(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Gf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,dBe))?(Wse(e,t,n,e._ellipsoid),h.clone(dBe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Hf(e,t,n)):(e._looking=!0,Gf(e,t,n,u));U.clone(t,e._rotateMousePosition)}function Hf(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 Gse=se.clone(se.UNIT_W),hBe=se.clone(se.UNIT_W),d7=new h,CI=new h,h7=new h,mBe=new h,T4t=new U,E4t=new U,C4t=new U,v4t=new U,S4t=new gn;function Wse(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,T4t),a=U.clone(n.endPosition,E4t),c=i.cartesianToCartographic(o.positionWC,DBe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Gse),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=g_(e,s,Gse)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,CI),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),CI),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,v4t),y=U.subtract(a,s,C4t),A=h.multiplyByScalar(o.rightWC,y.x*m.x,CI),b=h.normalize(o.positionWC,yBe),x=o.getPickRay(a,S4t).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,h7),h7),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,h7);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,mBe);f=h.add(u,A,hBe),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,Gse),f=o.pickEllipsoid(a,i,hBe)),!l(u)||!l(f)){e._rotating=!0,Hf(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,d7);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,CI),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,h7);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,mBe);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,d7);let L=h.cross(d,O,d7),_=h.dot(L,h.subtract(u,d,CI)),C=h.dot(L,h.subtract(f,d,CI)),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,d7);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var w4t=new h,I4t=new he,pBe=0;function RBe(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=wBe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,IBe),d,p=r.cartesianToCartographic(s.position,I4t).height,g=Math.abs(pBe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=g_(e,u,PBe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(pBe=y),c){let b=bBe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,w4t);Kse(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var OBe=new U,_7=new gn,LM=new h,P4t=new h,MBe=new M,D4t=new M,NBe=new M,R4t=new Le,O4t=new $,Jse=new he,Zse=new h;function M4t(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,Zse);Gf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Jse);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,L4t(e,t,n)):F4t(e,t,n)}var N4t=new he;function L4t(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,N4t).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=OBe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,_7),d,p=xi.rayEllipsoid(f,i);if(l(p))d=gn.getPoint(f,p.start,LM);else if(a>e._minimumTrackBallHeight){let x=xi.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,Jse);T.height=0,d=i.cartographicToCartesian(T,LM)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Zse);Gf(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,MBe),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,NBe);o._setTransform(g),Hf(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 F4t(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,LM);else{if(a=g_(e,t,LM),!l(a)){if(c=o.getPickRay(t,_7),u=xi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Jse).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Zse);Gf(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,LM)}s&&(l(c)||(c=o.getPickRay(t,_7)),xBe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=OBe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,_7);let p=h.magnitude(a),g=h.fromElements(p,p,p,Yse),m=ee.fromCartesian3(g,Xse);if(u=xi.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=gn.getPoint(c,y,P4t),b=At.eastNorthUpToFixedFrame(a,i,MBe),x=At.eastNorthUpToFixedFrame(A,m,D4t),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,NBe);o._setTransform(x);let I=h.cross(A,o.positionWC,g7);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,Hf(e,t,n,v,!0,!1),o.constrainedAxis=C}else Hf(e,t,n,v,!0,!1);if(o._setTransform(b),Hf(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,g7);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,g7);if(e.enableCollisionDetection&&Qse(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,R4t),N=$.fromQuaternion(D,O4t);$.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 B4t=new U,k4t=new U,gBe=new gn,_Be=new gn,U4t=new h,z4t=new h;function Gf(e,t,n,i){let o=e._scene.camera,s=B4t;s.x=n.startPosition.x,s.y=0;let a=k4t;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,gBe),u=o.getPickRay(a,_Be),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,gBe),u=o.getPickRay(a,_Be),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,U4t),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,z4t);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function V4t(e){Jl(e,e.enableRotate,e.rotateEventTypes,x4t,e.inertiaSpin,"_lastInertiaSpinMovement"),Jl(e,e.enableZoom,e.zoomEventTypes,RBe,e.inertiaZoom,"_lastInertiaZoomMovement"),Jl(e,e.enableTilt,e.tiltEventTypes,M4t,e.inertiaSpin,"_lastInertiaTiltMovement"),Jl(e,e.enableLook,e.lookEventTypes,Gf)}var j4t=new M,H4t=new he;function Qse(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,j4t),c=h.magnitude(r.position),r._setTransform(M.IDENTITY));let u=H4t;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)))}FM.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 G4t=new h,W4t=new h;FM.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,G4t),c=h.clone(t.directionWC,W4t);if(i===re.SCENE2D?HVt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,h4t(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,V4t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Qse(this,u)}this._aggregator.reset()};FM.prototype.isDestroyed=function(){return!1};FM.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var A7=FM;function BM(e){let t=new vc(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 q4t(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}BM.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};BM.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 q4t(i,r,t,n)};BM.prototype.isDestroyed=function(){return!1};BM.prototype.destroy=function(){return this._fb.destroy(),le(this)};var b7=BM;var kM={},Y4t=new et(0,0,3,3),X4t=new U,K4t=new U,$4t=new gn,J4t=new h,Z4t=3,Q4t=.1,LBe=9;function eae(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function FBe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&eae(s)<=Z4t&&(t=Math.min(t,s.depth));let n=t*(1+Q4t),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)=>eae(a)<eae(s)?a:s)}function BBe(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 tae(e,t,n){let i=X4t;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,$4t);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,J4t);return h.add(r.origin,a,new h)}kM.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 b7(o));let a=s.snapFramebuffer,c=Y4t;IM(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(PM(e),u.length===0)return;let f=FBe(u);if(!l(f))return;let d=tae(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=K4t;g.x=t.x+f.x,g.y=t.y+f.y,IM(e,g,c,LBe,LBe,{framebuffer:a,snap:!0});let m=a.end(c);PM(e);let y=BBe(m,f.object);p=l(y)?tae(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)}};kM._selectBestHit=FBe;kM._nearestSurfaceHit=BBe;kM._snapHitToWorld=tae;var x7=kM;var T7=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -12489,7 +12490,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 S5=`uniform sampler2D colorTexture; +`;var E7=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -12510,14 +12511,14 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function o_(){this._sceneFramebuffer=new ow;let e=.125,t=new Array(6);t[0]=new zr({fragmentShader:vf,textureScale:e,forcePowerOfTwo:!0,sampleMode:Jd.LINEAR});let n=t[1]=new zr({fragmentShader:S5,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:IT,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:IT,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:vf,sampleMode:Jd.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new zr({fragmentShader:v5,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Lf({stages:t});let r=new lw(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}o_.prototype.get=function(e){return this._stages.get(e)};o_.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 sLt=new se,AOe=new U,aLt=new U,bOe=new M;function cLt(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,bOe),u=M.multiplyByPoint(o,r,sLt),f=At.pointToGLWindowCoordinates(s,c,r,AOe);u.x+=P.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=aLt;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,bOe),f=At.pointToGLWindowCoordinates(s,c,r,AOe),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)}o_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};o_.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),cLt(this,t,n),r};o_.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)};o_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(vf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};o_.prototype.isDestroyed=function(){return!1};o_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var w5=o_;function NT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}NT.fromKeyframeNode=function(e,t,n,i){let r=new NT(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=lLt(e,s,n),r._orientedBoundingBox=fLt(e,o,n,r._orientedBoundingBox),r};function lLt(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 xOe=new h,uLt=new h;function fLt(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,xOe),d=h.divideComponents(h.subtract(f,e._paddingBefore,xOe),e.dimensions,uLt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(NT.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()}}});NT.prototype.hasProperty=function(e){return l(this._metadata[e])};NT.prototype.getNames=function(){return Object.keys(this._metadata)};NT.prototype.getProperty=function(e){return this._metadata[e]};var I5=NT;function eh(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 dLt=new h;eh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,dLt),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: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 eh(g,m,y,A,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,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var TOe={keyframe:0};function jO(e,t){return TOe.keyframe=e,Dr(t,TOe,Gr.searchComparator)}eh.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=hLt(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=EOe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=EOe(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 hLt(e,t){let n=jO(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function EOe(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=jO(e,this.keyframeNodes);if(t<0){t=~t;let n=new Gr(this,e);this.keyframeNodes.splice(t,0,n)}};eh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=jO(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=jO(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};eh.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=jO(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,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 P5=eh;function NA(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 qH(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 P5(0,0,0,0,void 0,d,o),this._priorityQueue=new Vy({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,Noe(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:$n.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}NA.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Noe(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,Noe(e,t,r-1,i+1),Noe(e,r+1,n,i+1)}NA.simultaneousRequestCountMaximum=50;NA.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:$n.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&&COe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();gLt(this,e),_Lt(this,e);let m=xn();TLt(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;xLt(this,e,b,x,T)}};NA.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};NA.prototype.isDestroyed=function(){return!1};NA.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(),le(this)};function COe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];COe(e,i)}}function mLt(e,t){if(e._simultaneousRequestCount>=NA.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 pLt(e){return e/(1+e)}function gLt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),vOe(e.rootNode,ca.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 _Lt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(yLt);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&&mLt(e,f),f.state===Gr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!ALt(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 yLt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function ALt(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 vOe(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===ca.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=pLt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+bLt(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];vOe(R,t,n,i)}}function bLt(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 xLt(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 D5={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function TLt(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]=D5.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=ELt(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]=D5.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?D5.LEAF:D5.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),CLt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&vLt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function ELt(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 CLt(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 vLt(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 R5=NA;function u0(e){e=e??H.EMPTY_OBJECT;let{provider:t=u0.DefaultProvider,modelMatrix:n=M.IDENTITY,customShader:i=MP(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Cp,this._calculateStatistics=o;let{shape:s,minBounds:a=bc.getMinBounds(s),maxBounds:c=bc.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=SLt(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??u0.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 Ap,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=bc.getShapeConstructor(s);this._shape=new m,wOe(this),this._shapeVisible=IOe(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]}}wLt(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 SLt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===$0.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function wLt(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(u0.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){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=MP(this._provider);this._customShader=r??u0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ILt=new se,PLt=new se,DLt=new M,RLt=new M,OLt=new h,MLt=new se;u0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){zLt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=wOe(this),o=ULt(this,e);if((r||o)&&(this._shapeVisible=IOe(this),$Lt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=JLt(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&&oFt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),ZLt(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&&(Z2(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=tFt(p,d,PLt);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=FLt(this,n.cameraPositionLocal,MLt);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,NLt(this),LLt(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 NLt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function LLt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function FLt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,OLt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var BLt=new h,Loe=new h,kLt=new he;function ULt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function zLt(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 R5(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,KLt(e._traversal,i)}function wOe(e){return HO(e,"_modelMatrix","_modelMatrixOld")+HO(e,"_minBounds","_minBoundsOld")+HO(e,"_maxBounds","_maxBoundsOld")+HO(e,"_minClippingBounds","_minClippingBoundsOld")+HO(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function HO(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var VLt=new h,jLt=new h,HLt=new h,GLt=new h,WLt=new M,qLt=new M;function IOe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,VLt),r=h.clone(e._maxBounds,jLt),o=h.clone(e._minClippingBounds,HLt),s=h.clone(e._maxClippingBounds,GLt),a=M.clone(e._modelMatrix,WLt);if(e.shape===bc.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,BLt);M.multiplyByScale(a,m,a),M.multiplyByTranslation(a,XLt(e),a)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,d=M.multiplyTransformation(f,a,qLt);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 YLt=new h;function XLt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:r=M.IDENTITY}=e._provider,o=M.getTranslation(i,Loe),s=M.multiplyByPoint(e._modelMatrix,o,Loe),a=M.multiplyByPoint(r,s,Loe),u=ee.WGS84.cartesianToCartographic(a,kLt),f=0;l(u)&&(f=u.height);let d=br.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,YLt)}function KLt(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 $Lt(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 JLt(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 ZLt(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)}u0.prototype.isDestroyed=function(){return!1};u0.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(),le(this)};var SOe=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)),QLt=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),eFt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function tFt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,DLt),r=M.multiply(t,i,RLt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=eFt,d=SOe.length;for(u=0;u<d;u++)M.multiplyByVector(r,SOe[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=QLt[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,ILt),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 Foe=3e7,nFt=new h(Foe,0,0),iFt=new h(0,Foe,0),rFt=new h(0,0,Foe);function oFt(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,nFt,z.RED,a),r(h.ZERO,iFt,z.LIME,a),r(h.ZERO,rFt,z.BLUE,a),i.update(t)}u0.DefaultCustomShader=new K0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;function __(){this._sceneFramebuffer=new yI;let e=.125,t=new Array(6);t[0]=new zr({fragmentShader:Vf,textureScale:e,forcePowerOfTwo:!0,sampleMode:nh.LINEAR});let n=t[1]=new zr({fragmentShader:E7,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:QT,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:QT,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:Vf,sampleMode:nh.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new zr({fragmentShader:T7,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new jf({stages:t});let r=new TI(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}__.prototype.get=function(e){return this._stages.get(e)};__.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 e8t=new se,kBe=new U,t8t=new U,UBe=new M;function n8t(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,UBe),u=M.multiplyByPoint(o,r,e8t),f=At.pointToGLWindowCoordinates(s,c,r,kBe);u.x+=P.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=t8t;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,UBe),f=At.pointToGLWindowCoordinates(s,c,r,kBe),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)}__.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};__.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),n8t(this,t,n),r};__.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)};__.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Vf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};__.prototype.isDestroyed=function(){return!1};__.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var C7=__;function rE(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Qt}rE.fromKeyframeNode=function(e,t,n,i){let r=new rE(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=i8t(e,s,n),r._orientedBoundingBox=o8t(e,o,n,r._orientedBoundingBox),r};function i8t(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 zBe=new h,r8t=new h;function o8t(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,zBe),d=h.divideComponents(h.subtract(f,e._paddingBefore,zBe),e.dimensions,r8t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(rE.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()}}});rE.prototype.hasProperty=function(e){return l(this._metadata[e])};rE.prototype.getNames=function(){return Object.keys(this._metadata)};rE.prototype.getProperty=function(e){return this._metadata[e]};var v7=rE;function oh(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 Qt,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var s8t=new h;oh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,s8t),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};oh.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 oh(g,m,y,A,this,e,this.dimensions))};oh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};oh.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 VBe={keyframe:0};function UM(e,t){return VBe.keyframe=e,Pr(t,VBe,Gr.searchComparator)}oh.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=a8t(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=jBe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=jBe(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 a8t(e,t){let n=UM(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function jBe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}oh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};oh.prototype.createKeyframeNode=function(e){let t=UM(e,this.keyframeNodes);if(t<0){t=~t;let n=new Gr(this,e);this.keyframeNodes.splice(t,0,n)}};oh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=UM(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=UM(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};oh.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=UM(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};oh.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 S7=oh;function ob(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 u9(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 S7(0,0,0,0,void 0,d,o),this._priorityQueue=new kA({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,nae(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 Gt({minificationFilter:Wt.NEAREST,magnificationFilter:Zn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}ob.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function nae(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,nae(e,t,r-1,i+1),nae(e,r+1,n,i+1)}ob.simultaneousRequestCountMaximum=50;ob.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 Gt({minificationFilter:Wt.NEAREST,magnificationFilter:Zn.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&&HBe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();u8t(this,e),f8t(this,e);let m=xn();g8t(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;p8t(this,e,b,x,T)}};ob.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};ob.prototype.isDestroyed=function(){return!1};ob.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(),le(this)};function HBe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];HBe(e,i)}}function c8t(e,t){if(e._simultaneousRequestCount>=ob.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 l8t(e){return e/(1+e)}function u8t(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),GBe(e.rootNode,ca.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 f8t(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(d8t);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&&c8t(e,f),f.state===Gr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!h8t(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 d8t(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function h8t(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 GBe(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===ca.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=l8t(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+m8t(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];GBe(R,t,n,i)}}function m8t(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 p8t(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 w7={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function g8t(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]=w7.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=_8t(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]=w7.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?w7.LEAF:w7.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),y8t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&A8t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function _8t(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 y8t(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 A8t(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 I7=ob;function E0(e){e=e??H.EMPTY_OBJECT;let{provider:t=E0.DefaultProvider,modelMatrix:n=M.IDENTITY,customShader:i=UO(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Pp,this._calculateStatistics=o;let{shape:s,minBounds:a=Dc.getMinBounds(s),maxBounds:c=Dc.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=b8t(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??E0.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 Sp,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Dc.getShapeConstructor(s);this._shape=new m,qBe(this),this._shapeVisible=YBe(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]}}x8t(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 b8t(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===s_.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function x8t(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(E0.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){Ps.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=UO(this._provider);this._customShader=r??E0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var T8t=new se,E8t=new se,C8t=new M,v8t=new M,S8t=new h,w8t=new se;E0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){N8t(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=qBe(this),o=M8t(this,e);if((r||o)&&(this._shapeVisible=YBe(this),G8t(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=W8t(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&&Q8t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),q8t(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&&(wG(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=K8t(p,d,E8t);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=D8t(this,n.cameraPositionLocal,w8t);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,I8t(this),P8t(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 I8t(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function P8t(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function D8t(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,S8t),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var R8t=new h,iae=new h,O8t=new he;function M8t(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function N8t(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 I7(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,H8t(e._traversal,i)}function qBe(e){return zM(e,"_modelMatrix","_modelMatrixOld")+zM(e,"_minBounds","_minBoundsOld")+zM(e,"_maxBounds","_maxBoundsOld")+zM(e,"_minClippingBounds","_minClippingBoundsOld")+zM(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function zM(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var L8t=new h,F8t=new h,B8t=new h,k8t=new h,U8t=new M,z8t=new M;function YBe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,L8t),r=h.clone(e._maxBounds,F8t),o=h.clone(e._minClippingBounds,B8t),s=h.clone(e._maxClippingBounds,k8t),a=M.clone(e._modelMatrix,U8t);if(e.shape===Dc.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,R8t);M.multiplyByScale(a,m,a),M.multiplyByTranslation(a,j8t(e),a)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,d=M.multiplyTransformation(f,a,z8t);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 V8t=new h;function j8t(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:r=M.IDENTITY}=e._provider,o=M.getTranslation(i,iae),s=M.multiplyByPoint(e._modelMatrix,o,iae),a=M.multiplyByPoint(r,s,iae),u=ee.WGS84.cartesianToCartographic(a,O8t),f=0;l(u)&&(f=u.height);let d=br.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,V8t)}function H8t(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 G8t(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 W8t(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 q8t(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)}E0.prototype.isDestroyed=function(){return!1};E0.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(),le(this)};var WBe=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)),Y8t=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),X8t=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function K8t(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,C8t),r=M.multiply(t,i,v8t),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=X8t,d=WBe.length;for(u=0;u<d;u++)M.multiplyByVector(r,WBe[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=Y8t[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,T8t),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 rae=3e7,$8t=new h(rae,0,0),J8t=new h(0,rae,0),Z8t=new h(0,0,rae);function Q8t(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:ir.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,$8t,z.RED,a),r(h.ZERO,J8t,z.LIME,a),r(h.ZERO,Z8t,z.BLUE,a),i.update(t)}E0.DefaultCustomShader=new o_({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 POe(){this.shape=bc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}POe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new Fv({metadata:[new Float32Array(1)]});return Promise.resolve(n)};u0.DefaultProvider=new POe;var LT=u0;var M5=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof T5;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Ze(e.contextOptions);this._context=new dw(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=Jn(),this._jobScheduler=new GH,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Ix(o,new J4(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new n5(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new pj,this._primitives=new Hl({countReferences:r}),this._groundPrimitives=new Hl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new hw,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new g8(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new di({color:new z,stencil:0,owner:this}),this._depthClearCommand=new di({depth:1,owner:this}),this._stencilClearCommand=new di({stencil:0}),this._classificationStencilClearCommand=new di({stencil:0,renderState:Ge.fromCache({stencilMask:Xt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new u5(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new c5,this._minimumDisableDepthTestDistance=0,this._debugInspector=new o8,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 Hi(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 jE,this.fog=new R8,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 DA({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 iR,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new $G,this._brdfLutGenerator=new l2,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new b5(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??_u.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=Tl.requestCompletedEvent.addEventListener(M5(this)),this._removeTaskProcessorListenerCallback=Kn.taskCompletedEvent.addEventListener(M5(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 wG(this),this._defaultView=new aw(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 MA,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,LOe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function sFt(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(M5(e))),n.push(t.terrainProviderChanged.addEventListener(M5(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.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 up.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,sFt(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 y8(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}}});_i.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 aFt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function DOe(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=Sp.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=Sp.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Sp.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=Sp.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Sp.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=DA.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))}_i.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&&aFt(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=DA.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=Sp.createLogDepthCommand(e,o,t.logDepth),DOe(this,t.logDepth.command,s)),(d||m)&&DOe(this,e,s)};var cFt=new Xh({pass:mo.RENDER}),Boe=new Xh({pass:mo.PRELOAD}),koe=new Xh({pass:mo.PRELOAD_FLIGHT}),lFt=new Xh({pass:mo.REQUEST_RENDER_MODE_DEFER_CHECK}),ROe=new ue,Uoe;function uFt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return ROe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Uoe=e5.fromBoundingSphere(ROe,e.camera.positionWC,Uoe),Uoe}_i.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 LOe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}_i.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=uFt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof pn||this.camera.frustum instanceof ws),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),iR.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};_i.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 O5=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);O5=M.inverseTransformation(O5,O5);function fFt(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(O5,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=rc.createGeometry(new rc({radii:new h(f,f,f),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=rl.createGeometry(rl.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:qn.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=Sp.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 ql(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof di){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&fFt(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 OOe(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 FOe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var dFt=new h;function MOe(e,t){let n=h.subtract(e,t,dFt),i=Math.max(0,h.magnitude(n));return i*i}function hFt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return MOe(r.center,n)-MOe(i.center,n)}function mFt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function pFt(e,t,n,i,r){Pg(i,FOe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function gFt(e,t,n,i,r){Pg(i,mFt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function _Ft(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],Pg(i,FOe,e.camera.positionWC);for(let r=0;r<i.length;++r)ql(i[r],e,t)}function yFt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],Pg(i,hFt,e.camera.positionWC);for(let r=0;r<i.length;++r)ql(i[r],e,t)}var AFt=new Zi,bFt=new pu,xFt=new pn,TFt=new ws;function EFt(e){let{frustum:t}=e;return l(t.fov)?t.clone(AFt):l(t.infiniteProjectionMatrix)?t.clone(bFt):l(t.width)?t.clone(xFt):t.clone(TFt)}function CFt(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?pFt:gFt}function vFt(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=CFt(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,ql,t,f,c)}function SFt(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,ql,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,ql,t,n)}function wFt(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)ql(r[s],e,t);t.framebuffer=i}function IFt(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)ql(a[d],e,t);t.framebuffer=u}}function PFt(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)ql(i[o],e,t)}function Voe(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=EFt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||DFt(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)ql(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)OOe(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,ql,A,e,t)):L(D,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(D,ql,A,e,t)):L(D,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let N;if(wFt(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(IFt(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),_Ft(e,t,D),L(D,Ie.OPAQUE),PFt(e,t,D),yFt(e,t,D),w!==0&&e.mode!==re.SCENE2D&&(s.near=D.near,o.updateFrustum(s)),vFt(e,t,D),SFt(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,OOe,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 DFt(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&ql(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&ql(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)?ql(o[s],e,t):o.splice(s,1)}}function BOe(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 RFt(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 OFt(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 kOe(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;OFt(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];ql(A,e,d.passState)}}}}var MFt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){YFt(this,e,t),this._environmentState.useWebVR?NFt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===_u.ROTATE?LA(!0,this,e):HFt(this,e)};function NFt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;zOe(e),n.createPotentiallyVisibleSet(e),BOe(e),o||kOe(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,MFt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,Voe(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,Voe(e,t),Or.clone(a,i)}var LFt=new he(Math.PI,P.PI_OVER_TWO),FFt=new h,BFt=new h,kFt=new M,UFt=new M,zFt=new h,VFt=new h,jFt=new et;function HFt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,jFt);t.viewport=s;let a=LFt,c=FFt;e.mapProjection.project(a,c);let f=h.clone(i.position,BFt),d=M.clone(i.transform,UFt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,kFt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(P.sign(y)*c.x-y,0,-i.positionWC.x,zFt),b=At.pointToGLWindowCoordinates(m,g,A,VFt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)LA(!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),LA(!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),LA(!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),LA(!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),LA(!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),LA(!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),LA(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function LA(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),zOe(t),i.createPotentiallyVisibleSet(t),e&&(BOe(t),r||kOe(t)),Voe(t,n)}var NOe=new ca;function UOe(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 Hl){UOe(o,t,n);continue}o.show&&My.isSupported(o)&&ls(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function GFt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;UOe(e._primitives,n,i)}_i.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 pn||!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(R_.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=NOe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=NOe,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 up(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),GFt(this,e)};function WFt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Dg({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 qFt(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 zOe(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,WFt(e),qFt(e),e._globe&&e._globe.render(t)}function YFt(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 w5: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)}_i.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 XFt(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 KFt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function VOe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Hl){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=VOe(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}_i.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=$Ft(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function $Ft(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=VOe(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 zoe=new he;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,zoe);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(zoe.height=m,t(zoe))},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 JFt(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}_i.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=KFt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=JFt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function ZFt(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 wA({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 QFt(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 eBt(e){e.primitives.postPassesUpdate(e._frameState),Tl.update()}var tBt=new z;function nBt(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=cFt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,tBt),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 MA?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,RFt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function FT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function iBt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.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,Ix.maximumFrameNumber,1);LOe(this,r,e),t.newFrame=!0}FT(this,QFt),this.primitives.show&&(FT(this,iBt),FT(this,rBt),FT(this,oBt),i||FT(this,sBt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),FT(this,nBt)),ZFt(this,i),FT(this,eBt),XFt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(Ut.minimumAliasedLineWidth,Math.min(e,Ut.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return C5.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof LT))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 I5.fromKeyframeNode(r,s,c,a)};_i.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=L8(s,t,n,i);if(!l(a))return;let c=F8(o,n,i);if(!l(c))return;let u=new hG(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function rBt(e){let t=e._frameState;Boe.camera=t.camera,Boe.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Boe)}function oBt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;koe.camera=e.preloadFlightCamera,koe.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,koe)}function sBt(e){e.primitives.updateForPass(e._frameState,lFt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return pr.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function aBt(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()})}_i.prototype.setTerrain=function(e){return aBt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.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),le(this)};var N5=_i;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 pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var GO=s_;var WO=`float interpolateByDistance(vec4 nearFarScalar, float distance) +}`});function XBe(){this.shape=Dc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Ft.FLOAT32],this.maximumTileCount=1}XBe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new tI({metadata:[new Float32Array(1)]});return Promise.resolve(n)};E0.DefaultProvider=new XBe;var oE=E0;var D7=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof lH;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Ze(e.contextOptions);this._context=new Mw(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=$n(),this._jobScheduler=new l9,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Mx(o,new KG(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new eH(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new $5,this._primitives=new ql({countReferences:r}),this._groundPrimitives=new ql({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new EI,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new u5(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new hi({color:new z,stencil:0,owner:this}),this._depthClearCommand=new hi({depth:1,owner:this}),this._stencilClearCommand=new hi({stencil:0}),this._classificationStencilClearCommand=new hi({stencil:0,renderState:Ge.fromCache({stencilMask:Xt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new l7(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new a7,this._minimumDisableDepthTestDistance=0,this._debugInspector=new e5,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 HC,this.fog=new y5,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 nb({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 _M,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new s7,this._brdfLutGenerator=new rG,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new A7(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=El.requestCompletedEvent.addEventListener(D7(this)),this._removeTaskProcessorListenerCallback=Jn.taskCompletedEvent.addEventListener(D7(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 B9(this),this._defaultView=new bI(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 MA,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,e2e(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function ejt(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(D7(e))),n.push(t.terrainProviderChanged.addEventListener(D7(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.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 zt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return zt.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 ip.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,ejt(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 d5(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,zt.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}}});_i.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 tjt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function KBe(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=nb.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))}_i.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&&tjt(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=nb.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=d0.createLogDepthCommand(e,o,t.logDepth),KBe(this,t.logDepth.command,s)),(d||m)&&KBe(this,e,s)};var njt=new xm({pass:po.RENDER}),oae=new xm({pass:po.PRELOAD}),sae=new xm({pass:po.PRELOAD_FLIGHT}),ijt=new xm({pass:po.REQUEST_RENDER_MODE_DEFER_CHECK}),$Be=new ue,aae;function rjt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return $Be.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,aae=YH.fromBoundingSphere($Be,e.camera.positionWC,aae),aae}_i.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 e2e(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}_i.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=rjt(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 ws),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),_M.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};_i.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 P7=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);P7=M.inverseTransformation(P7,P7);function ojt(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(P7,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=ac.createGeometry(new ac({radii:new h(f,f,f),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=kc.createGeometry(kc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new Mn({geometryInstances:new Bt({geometry:qn.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 hi){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&ojt(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 JBe(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 t2e(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var sjt=new h;function ZBe(e,t){let n=h.subtract(e,t,sjt),i=Math.max(0,h.magnitude(n));return i*i}function ajt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return ZBe(r.center,n)-ZBe(i.center,n)}function cjt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function ljt(e,t,n,i,r){i_(i,t2e,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function ujt(e,t,n,i,r){i_(i,cjt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function fjt(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],i_(i,t2e,e.camera.positionWC);for(let r=0;r<i.length;++r)Zl(i[r],e,t)}function djt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],i_(i,ajt,e.camera.positionWC);for(let r=0;r<i.length;++r)Zl(i[r],e,t)}var hjt=new er,mjt=new Wu,pjt=new _n,gjt=new ws;function _jt(e){let{frustum:t}=e;return l(t.fov)?t.clone(hjt):l(t.infiniteProjectionMatrix)?t.clone(mjt):l(t.width)?t.clone(pjt):t.clone(gjt)}function yjt(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?ljt:ujt}function Ajt(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=yjt(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 bjt(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 xjt(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 Tjt(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 Ejt(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 lae(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=_jt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||Cjt(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)JBe(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(xjt(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(Tjt(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),fjt(e,t,D),L(D,Ie.OPAQUE),Ejt(e,t,D),djt(e,t,D),w!==0&&e.mode!==re.SCENE2D&&(s.near=D.near,o.updateFrustum(s)),Ajt(e,t,D),bjt(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,JBe,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 Cjt(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 n2e(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 vjt(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 Sjt(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 i2e(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;Sjt(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 wjt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){Vjt(this,e,t),this._environmentState.useWebVR?Ijt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Yu.ROTATE?sb(!0,this,e):Bjt(this,e)};function Ijt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;o2e(e),n.createPotentiallyVisibleSet(e),n2e(e),o||i2e(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,wjt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,lae(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,lae(e,t),Nr.clone(a,i)}var Pjt=new he(Math.PI,P.PI_OVER_TWO),Djt=new h,Rjt=new h,Ojt=new M,Mjt=new M,Njt=new h,Ljt=new h,Fjt=new et;function Bjt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,Fjt);t.viewport=s;let a=Pjt,c=Djt;e.mapProjection.project(a,c);let f=h.clone(i.position,Rjt),d=M.clone(i.transform,Mjt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,Ojt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(P.sign(y)*c.x-y,0,-i.positionWC.x,Njt),b=At.pointToGLWindowCoordinates(m,g,A,Ljt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)sb(!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),sb(!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),sb(!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),sb(!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),sb(!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),sb(!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),sb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function sb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),o2e(t),i.createPotentiallyVisibleSet(t),e&&(n2e(t),r||i2e(t)),lae(t,n)}var QBe=new ca;function r2e(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 ql){r2e(o,t,n);continue}o.show&&zy.isSupported(o)&&ls(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function kjt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;r2e(e._primitives,n,i)}_i.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(py.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=QBe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=QBe,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 ip(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),kjt(this,e)};function Ujt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new c_({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 zjt(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 o2e(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,Ujt(e),zjt(e),e._globe&&e._globe.render(t)}function Vjt(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 C7: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)}_i.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 jjt(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 Hjt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function s2e(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof ql){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=s2e(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}_i.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=Gjt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function Gjt(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=s2e(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 cae=new he;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,cae);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(cae.height=m,t(cae))},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 Wjt(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}_i.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=Hjt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Wjt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function qjt(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 QA({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 Yjt(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 Xjt(e){e.primitives.postPassesUpdate(e._frameState),El.update()}var Kjt=new z;function $jt(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=njt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,Kjt),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 MA?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,vjt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function sE(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Jjt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.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,Mx.maximumFrameNumber,1);e2e(this,r,e),t.newFrame=!0}sE(this,Yjt),this.primitives.show&&(sE(this,Jjt),sE(this,Zjt),sE(this,Qjt),i||sE(this,e6t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),sE(this,$jt)),qjt(this,i),sE(this,Xjt),jjt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(zt.minimumAliasedLineWidth,Math.min(e,zt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return x7.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof oE))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 v7.fromKeyframeNode(r,s,c,a)};_i.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=T5(s,t,n,i);if(!l(a))return;let c=E5(o,n,i);if(!l(c))return;let u=new v9(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Zjt(e){let t=e._frameState;oae.camera=t.camera,oae.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,oae)}function Qjt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;sae.camera=e.preloadFlightCamera,sae.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,sae)}function e6t(e){e.primitives.updateForPass(e._frameState,ijt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return pr.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function t6t(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()})}_i.prototype.setTerrain=function(e){return t6t(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.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),le(this)};var R7=_i;var VM=`float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; @@ -12570,7 +12571,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 L5=`in vec3 v_outerPositionWC; +`;var O7=`in vec3 v_outerPositionWC; uniform vec3 u_hsbShift; #ifndef PER_FRAGMENT_ATMOSPHERE in vec3 v_mieColor; @@ -12615,7 +12616,7 @@ color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } -`;var F5=`in vec4 position; +`;var M7=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; @@ -12642,14 +12643,14 @@ v_outerPositionWC = positionWC.xyz; vec4 positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; } -`;function pw(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(pw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});pw.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var joe=new M;pw.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,joe),r=M.multiplyTransformation(i,Gi.Y_UP_TO_Z_UP,joe),o=M.multiply(this._scaleMatrix,r,joe);M.clone(o,this._modelMatrix);let s=e.context,a=cBt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=rc.createGeometry(new rc({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:s,geometry:p,attributeLocations:qn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:ji.FRONT},blending:nn.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:[cp,WO,F5]}),m=new Xe({defines:p,sources:[cp,WO,L5]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function cBt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}pw.prototype.isDestroyed=function(){return!1};pw.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var B5=pw;function BT(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new Hv({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(BT.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}}});BT.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)};BT.prototype.isDestroyed=function(){return!1};BT.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function gw(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}BT.createEarthSkyBox=function(){return new BT({sources:{positiveX:gw("px"),negativeX:gw("mx"),positiveY:gw("py"),negativeY:gw("my"),positiveZ:gw("pz"),negativeZ:gw("mz")}})};var k5=BT;function Hoe(e){e=e??1,this._radius=e??1}Object.defineProperties(Hoe.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Hoe.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 jOe=Hoe;function qO(){}qO.prototype.evaluate=function(e,t){pe.throwInstantiationError()};qO.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};qO.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};qO.prototype.getVariables=function(){pe.throwInstantiationError()};var HOe=qO;var U5=`uniform sampler2D u_texture; +`;function vI(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(vI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});vI.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var uae=new M;vI.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,uae),r=M.multiplyTransformation(i,qi.Y_UP_TO_Z_UP,uae),o=M.multiply(this._scaleMatrix,r,uae);M.clone(o,this._modelMatrix);let s=e.context,a=n6t(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=ac.createGeometry(new ac({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:s,geometry:p,attributeLocations:qn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},blending:nn.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:[hp,VM,M7]}),m=new Xe({defines:p,sources:[hp,VM,O7]});this._spSkyAtmosphere=en.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function n6t(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}vI.prototype.isDestroyed=function(){return!1};vI.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var N7=vI;function aE(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new sI({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(aE.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}}});aE.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)};aE.prototype.isDestroyed=function(){return!1};aE.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function SI(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}aE.createEarthSkyBox=function(){return new aE({sources:{positiveX:SI("px"),negativeX:SI("mx"),positiveY:SI("py"),negativeY:SI("my"),positiveZ:SI("pz"),negativeZ:SI("mz")}})};var L7=aE;function fae(e){e=e??1,this._radius=e??1}Object.defineProperties(fae.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});fae.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 a2e=fae;function jM(){}jM.prototype.evaluate=function(e,t){pe.throwInstantiationError()};jM.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};jM.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};jM.prototype.getVariables=function(){pe.throwInstantiationError()};var c2e=jM;var F7=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } -`;var z5=`uniform float u_radiusTS; +`;var B7=`uniform float u_radiusTS; in vec2 v_textureCoordinates; vec2 rotate(vec2 p, vec2 direction) { @@ -12681,7 +12682,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 V5=`in vec2 direction; +`;var k7=`in vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() @@ -12702,9 +12703,8 @@ halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); v_textureCoordinates = direction; } -`;function XO(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.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(XO.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var lBt=new U,uBt=new U,fBt=new se,YO=new se;XO.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 _d({fragmentShaderSource:z5,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:V5,fragmentShaderSource:U5,attributeLocations:E}),a.renderState=Ge.fromCache({blending:nn.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?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=pr.computeActualEllipsoidPosition(e,c,YO),g=h.magnitude(h.subtract(p,e.camera.position,YO)),m=r.uniformState.projection,y=fBt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=M.multiplyByVector(m,y,YO),b=pr.clipToGLWindowCoordinates(t.viewport,A,lBt);y.x=P.SOLAR_RADIUS;let x=M.multiplyByVector(m,y,YO),T=pr.clipToGLWindowCoordinates(t.viewport,x,uBt);return this._size=U.magnitude(U.subtract(T,b,YO)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};XO.prototype.isDestroyed=function(){return!1};XO.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(),le(this)};var j5=XO;var H5={};H5.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};H5.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)};H5.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 f0=H5;function FA(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=W5(e.westIndices,r,t),this._southIndices=W5(e.southIndices,o,t),this._eastIndices=W5(e.eastIndices,r,t),this._northIndices=W5(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(FA.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 G5=[];function W5(e,t,n){G5.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)G5[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(G5.sort(t),je.createTypedArray(n,G5)):e}var GOe="createVerticesFromQuantizedTerrainMesh",dBt=new Kn(GOe),hBt=new Kn(GOe,Ef.maximumAsynchronousTasks);FA.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?hBt:dBt).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=wo.clone(g.encoding);return p._mesh=new Tc(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 mBt=new Kn("upsampleQuantizedTerrainMesh",Ef.maximumAsynchronousTasks);FA.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=mBt.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 FA({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.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 Goe=32767,WOe=new h;FA.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=Goe;let r=P.clamp((n-e.south)/e.height,0,1);return r*=Goe,l(this._mesh)?yBt(this,i,r):ABt(this,i,r)};function qOe(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 pBt=new U,gBt=new U,_Bt=new U;function yBt(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,pBt),g=o.decodeTextureCoordinates(r,f,gBt),m=o.decodeTextureCoordinates(r,d,_Bt);if(qOe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=f0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,WOe);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 ABt(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(qOe(t,n,p,y,g,A,m,b)){let x=f0.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,WOe);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/Goe)}}}}FA.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};FA.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var _w=FA;function bw(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var kT=new ie;function bBt(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}bw.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)bBt(e,g,p,s)||s.push(new yw(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,kT);let a=kT.west,c=kT.north;o.tileXYToRectangle(i,r,e,kT);let u=kT.east,f=kT.south,d=new vBt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];Woe(g.extent,d)&&SBt(this._maximumLevel,g,d)}};bw.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(Aw(i.extent,e)){t=i;break}}return l(t)?KO(void 0,t,e):-1};var xBt=[],TBt=[],EBt=new ie,CBt=new ie;bw.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=xBt;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,EBt)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,CBt))):t.push(e);let n=TBt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)$O(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 YOe=new he;bw.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,kT);return ie.center(i,YOe),this.computeMaximumLevelAtPosition(YOe)>=e};bw.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 yw(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(yw.prototype,{nw:{get:function(){return this._nw||(this._nw=new yw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new yw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new yw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new yw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function vBt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function Woe(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 SBt(e,t,n){for(;t.level<e;)if(q5(t.nw.extent,n))t=t.nw;else if(q5(t.ne.extent,n))t=t.ne;else if(q5(t.sw.extent,n))t=t.sw;else if(q5(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=Dr(t.rectangles,n.level,wBt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function wBt(e,t){return e.level-t}function q5(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function Aw(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function KO(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&Aw(t._nw.extent,n),s=t._ne&&Aw(t._ne.extent,n),a=t._sw&&Aw(t._sw.extent,n),c=t._se&&Aw(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,KO(t,t._nw,n))),s&&(i=Math.max(i,KO(t,t._ne,n))),a&&(i=Math.max(i,KO(t,t._sw,n))),c&&(i=Math.max(i,KO(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];Aw(a,n)&&(i=a.level)}t=t.parent}return i}function $O(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||Woe(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]=IBt(e[s.level],s)}$O(e,t._nw,n),$O(e,t._ne,n),$O(e,t._sw,n),$O(e,t._se,n)}function IBt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];Woe(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 d0=bw;function PBt(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 KOe(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=[]}KOe.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 $Oe(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 Mo({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=Xr.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 d0(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 d0(e.tilingScheme,u),g=new d0(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 PBt({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 Xoe(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function DBt(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 Xoe(e,n);throw new oe(i)}async function RBt(e,t,n){await $Oe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new d0(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 Xoe(e,t){try{let n=await e.layerJsonResource.fetchJson();return RBt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await $Oe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):DBt(e,n,t)}}function mm(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 qoe={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function XOe(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 OBt(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new al({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 MBt(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 ue(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===qoe.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===qoe.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===qoe.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 _w({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})}mm.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=Koe(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)})):JOe(this,e,t,n,o,i)};function JOe(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=XOe(void 0)):u=XOe(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)?OBt(e,m,i,t,n):MBt(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(mm.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}}});mm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};mm.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return mm.fromUrl(n,t)};mm.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 KOe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Xoe(i);let r=new mm(t);return i.build(r),r};mm.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(Koe(this,e,t,n,i[o],o===0).result)return;return!1};mm.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=Koe(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function Yoe(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 Koe(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=Yoe(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=JOe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=Yoe(r,f.x,f.y,f.level)}return{result:!1}}mm._getAvailabilityTile=Yoe;var xw=mm;function NBt(e){return e=e??H.EMPTY_OBJECT,xw.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Y5=NBt;function LBt(e){return e=e??H.EMPTY_OBJECT,xw.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var Tw=LBt;function Ew(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,BBt(this,e)}Object.defineProperties(Ew.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}}});Ew.fromWorldTerrain=function(e){return new Ew(Tw(e))};Ew.fromWorldBathymetry=function(e){return new Ew(Y5(e))};function FBt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function BBt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){FBt(e._errorEvent,i)}}var X5=Ew;function Cw(){}Cw.prototype.boundingVolume=void 0;Cw.prototype.boundingSphere=void 0;Cw.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};Cw.prototype.intersectPlane=function(e){pe.throwInstantiationError()};Cw.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var ZOe=Cw;function JO(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(JO.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}}});JO.prototype.getTileCredits=function(e,t,n){};JO.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)};JO.prototype.pickFeatures=function(e,t,n,i,r){};var K5=JO;function $oe(e){pe.throwInstantiationError()}$oe.prototype.isReady=pe.throwInstantiationError;$oe.prototype.shouldDiscardImage=pe.throwInstantiationError;var QOe=$oe;var eMe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(eMe);var tMe=eMe;function zT(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Pn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new ig(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 Ay,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(zT.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 kBt(e){return`uniform vec4 czm_pickColor; -${e}`}function UBt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function zBt(){return"czm_pickColor"}zT.prototype.makeStyleDirty=function(){this._styleDirty=!0};zT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var VBt=new K;function Zoe(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function UT(e,t){return e._intervals.indexOf(t.start)}function jBt(e,t){let n=e._intervals,i=e._clock,r=Zoe(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,VBt),a=n.indexOf(s),c=UT(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function HBt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function GBt(e,t,n){let i=Zoe(e),r=UT(e,t),o=UT(e,n);return i>=0?r>=o:r<=o}function iMe(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 WBt(e,t,n){let i=UT(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 DG({arrayBuffer:u,cull:!0,fragmentShaderLoaded:kBt,uniformMapLoaded:UBt(e),pickIdLoaded:zBt})}).catch(iMe(e,c))}return o}function qBt(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 YBt(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(rMe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;qBt(e,a)}}t.touchedFrameNumber=i.frameNumber}var XBt=new M;function KBt(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 $Bt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var JBt=new ig;function rMe(e,t,n,i){let r=e.shading??JBt,o=t.pointCloud,s=t.transform??M.IDENTITY;o.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,XBt),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=KBt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=$Bt(e);try{o.update(i)}catch(a){iMe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Joe(e,t,n,i){let r=WBt(e,t,i);YBt(e,r,n,i)}function ZBt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function oMe(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 QBt(e,t){let n=UT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function nMe(e,t,n,i,r){return l(n)?n.ready?!0:(Joe(e,t,i,r),n.ready):!1}function e2t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=UT(e,n),d=UT(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],nMe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],nMe(e,s,a,i,r))return s;return t}function t2t(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 vw={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};zT.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)&&t2t(this,r,s),vw.timeSinceLoad=t,vw.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=HBt(this);if(!l(g))return;let m=!1,y=Zoe(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||GBt(this,g,p))&&(p=jBt(this,g)),d=e2t(this,d,g,vw,e);let b=QBt(this,d);l(b)||(Joe(this,d,vw,e),b=this._lastRenderedFrame),l(b)&&rMe(this,b,vw,e),l(p)&&Joe(this,p,vw,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&&oMe(this,ZBt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};zT.prototype.isDestroyed=function(){return!1};zT.prototype.destroy=function(){return oMe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var ZO=zT;var $5=`in vec2 v_textureCoordinates; +`;function GM(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.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(GM.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var i6t=new U,r6t=new U,o6t=new se,HM=new se;GM.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 hd({fragmentShaderSource:B7,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=nt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=nt.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=en.fromCache({context:r,vertexShaderSource:k7,fragmentShaderSource:F7,attributeLocations:E}),a.renderState=Ge.fromCache({blending:nn.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?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=pr.computeActualEllipsoidPosition(e,c,HM),g=h.magnitude(h.subtract(p,e.camera.position,HM)),m=r.uniformState.projection,y=o6t;y.x=0,y.y=0,y.z=-g,y.w=1;let A=M.multiplyByVector(m,y,HM),b=pr.clipToGLWindowCoordinates(t.viewport,A,i6t);y.x=P.SOLAR_RADIUS;let x=M.multiplyByVector(m,y,HM),T=pr.clipToGLWindowCoordinates(t.viewport,x,r6t);return this._size=U.magnitude(U.subtract(T,b,HM)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};GM.prototype.isDestroyed=function(){return!1};GM.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(),le(this)};var U7=GM;function wI(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,a6t(this,e)}Object.defineProperties(wI.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}}});wI.fromWorldTerrain=function(e){return new wI(Vw(e))};wI.fromWorldBathymetry=function(e){return new wI(IH(e))};function s6t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function a6t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){s6t(e._errorEvent,i)}}var z7=wI;function II(){}II.prototype.boundingVolume=void 0;II.prototype.boundingSphere=void 0;II.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};II.prototype.intersectPlane=function(e){pe.throwInstantiationError()};II.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var l2e=II;function WM(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new rr({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(WM.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}}});WM.prototype.getTileCredits=function(e,t,n){};WM.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)};WM.prototype.pickFeatures=function(e,t,n,i,r){};var V7=WM;function dae(e){pe.throwInstantiationError()}dae.prototype.isReady=pe.throwInstantiationError;dae.prototype.shouldDiscardImage=pe.throwInstantiationError;var u2e=dae;var f2e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(f2e);var d2e=f2e;function lE(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 ng(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 Ay,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(lE.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ps.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function c6t(e){return`uniform vec4 czm_pickColor; +${e}`}function l6t(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function u6t(){return"czm_pickColor"}lE.prototype.makeStyleDirty=function(){this._styleDirty=!0};lE.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var f6t=new K;function mae(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function cE(e,t){return e._intervals.indexOf(t.start)}function d6t(e,t){let n=e._intervals,i=e._clock,r=mae(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,f6t),a=n.indexOf(s),c=cE(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function h6t(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function m6t(e,t,n){let i=mae(e),r=cE(e,t),o=cE(e,n);return i>=0?r>=o:r<=o}function m2e(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 p6t(e,t,n){let i=cE(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 z9({arrayBuffer:u,cull:!0,fragmentShaderLoaded:c6t,uniformMapLoaded:l6t(e),pickIdLoaded:u6t})}).catch(m2e(e,c))}return o}function g6t(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 _6t(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(p2e(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;g6t(e,a)}}t.touchedFrameNumber=i.frameNumber}var y6t=new M;function A6t(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 b6t(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var x6t=new ng;function p2e(e,t,n,i){let r=e.shading??x6t,o=t.pointCloud,s=t.transform??M.IDENTITY;o.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,y6t),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=A6t(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=b6t(e);try{o.update(i)}catch(a){m2e(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function hae(e,t,n,i){let r=p6t(e,t,i);_6t(e,r,n,i)}function T6t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function g2e(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 E6t(e,t){let n=cE(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function h2e(e,t,n,i,r){return l(n)?n.ready?!0:(hae(e,t,i,r),n.ready):!1}function C6t(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=cE(e,n),d=cE(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],h2e(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],h2e(e,s,a,i,r))return s;return t}function v6t(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 PI={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};lE.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)&&v6t(this,r,s),PI.timeSinceLoad=t,PI.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=h6t(this);if(!l(g))return;let m=!1,y=mae(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||m6t(this,g,p))&&(p=d6t(this,g)),d=C6t(this,d,g,PI,e);let b=E6t(this,d);l(b)||(hae(this,d,PI,e),b=this._lastRenderedFrame),l(b)&&p2e(this,b,PI,e),l(p)&&hae(this,p,PI,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&&g2e(this,T6t(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};lE.prototype.isDestroyed=function(){return!1};lE.prototype.destroy=function(){return g2e(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var qM=lE;var j7=`in vec2 v_textureCoordinates; void main() { czm_materialInput materialInput; @@ -12715,9 +12715,9 @@ materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } -`;function J5(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}J5.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:nn.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,$5]});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)}};J5.prototype.isDestroyed=function(){return!1};J5.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var sMe=J5;var Qoe=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()}},aMe=Qoe;function a_(){pe.throwInstantiationError()}Object.defineProperties(a_.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}});a_.prototype.update=pe.throwInstantiationError;a_.prototype.updateViewTransforms=pe.throwInstantiationError;a_.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;a_.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;a_.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;a_.DefaultMinBounds=pe.throwInstantiationError;a_.DefaultMaxBounds=pe.throwInstantiationError;var cMe=a_;var n2t=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=n2t;var i2t=500;function r2t(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>i2t&&(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 h0=r2t;var o2t=new he;function s2t(e,t,n,i,r){let o=i.cartesianToCartographic(e,o2t);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):ls(n)?o.height=t:k_(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var BA=s2t;var a2t=z.WHITE,c2t=h.ZERO,l2t=We.NONE,u2t=U.ZERO,f2t=1,d2t=0,h2t=h.ZERO,m2t=Wi.CENTER,p2t=Wn.CENTER,g2t=!1,_2t=Wo.NONE,y2t=new h,A2t=new z,b2t=new h,x2t=new U,T2t=new qt,E2t=new qt,C2t=new qt,v2t=new et,S2t=new Gt;function lMe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function kA(e,t){t.collectionChanged.addEventListener(kA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}kA.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,y2t),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){ese(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,a2t,A2t),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,c2t,b2t),u.heightReference=X.getValueOrDefault(a._heightReference,e,l2t),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,u2t,x2t),u.scale=X.getValueOrDefault(a._scale,e,f2t),u.rotation=X.getValueOrDefault(a._rotation,e,d2t),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,h2t),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,m2t),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,p2t),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,T2t),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,E2t),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,C2t),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,g2t),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,S2t),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,_2t),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,v2t);l(p)&&u.setImageSubRegion(u.image,p)}return!0};kA.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=h0(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=BA(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};kA.prototype.isDestroyed=function(){return!1};kA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(kA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};kA.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 lMe(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 lMe(o)):(ese(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],ese(s.get(o.id),o,a),s.remove(o.id)};function ese(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var Z5=kA;function QO(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(QO.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});QO.fromDistanceDisplayCondition=function(e){return new QO(e.near,e.far)};QO.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ni=QO;function Sw(){pe.throwInstantiationError()}Object.defineProperties(Sw.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Sw.prototype.getType=pe.throwInstantiationError;Sw.prototype.getValue=pe.throwInstantiationError;Sw.prototype.equals=pe.throwInstantiationError;var w2t=new K;Sw.getValue=function(e,t,n){let i;return l(e)||(e=K.now(w2t)),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 Ro=Sw;function VT(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}VT.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};VT.prototype._setOptions=pe.throwInstantiationError;VT.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=Ro.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 Lu({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}))}};VT.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))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};VT.prototype.isDestroyed=function(){return!1};VT.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),le(this)};var Oi=VT;var I2t=new Kt(z.WHITE),P2t=new mi(!0),D2t=new mi(!0),R2t=new mi(!1),O2t=new mi(z.BLACK),M2t=new mi(Pn.DISABLED),N2t=new mi(new Gt),L2t=new mi(ei.BOTH);function Yl(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=oo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Yl.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}}});Yl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Yl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Yl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Yl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Yl.prototype.isDestroyed=function(){return!1};Yl.prototype.destroy=function(){le(this)};Yl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(it.MINIMUM_VALUE)};Yl.prototype._isOnTerrain=function(e,t){return!1};Yl.prototype._getIsClosed=function(e){return!0};Yl.prototype._isDynamic=pe.throwInstantiationError;Yl.prototype._setStaticOptions=pe.throwInstantiationError;Yl.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(it.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(it.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??I2t,this._fillProperty=o??D2t,this._showProperty=u??P2t,this._showOutlineProperty=r.outline??R2t,this._outlineColorProperty=c?r.outlineColor??O2t:void 0,this._shadowsProperty=r.shadows??M2t,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??N2t,this._classificationTypeProperty=r.classificationType??L2t,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(it.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Yl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Mi=Yl;var uMe=new h;function ww(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(it.MINIMUM_VALUE,uMe);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(ww.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});ww.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 F2t=new K;ww.prototype.getValue=function(e,t){l(e)||(e=K.now(F2t));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!k_(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,uMe);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)};ww.prototype.isDestroyed=function(){return!1};ww.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var Iw=ww;function B2t(e,t,n,i){if(Mi.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 i0(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Iw(this._scene,s,o)}}var UA=B2t;var fMe=h.ZERO,dMe=new h,k2t=new h,hMe=new z;function U2t(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function kf(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new U2t(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(kf.prototype=Object.create(Mi.prototype),kf.prototype.constructor=kf);Object.defineProperties(kf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});kf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ni.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,hMe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,fMe,dMe))),new Bt({id:t,geometry:rl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};kf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,hMe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,fMe,dMe))),new Bt({id:t,geometry:Tp.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};kf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};kf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Mi.prototype._isHidden.call(this,e,t)};kf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};kf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,it.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(it.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?_n.ALL:void 0};kf.prototype._onEntityPropertyChanged=UA;kf.DynamicGeometryUpdater=Pw;function Pw(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(Pw.prototype=Object.create(Oi.prototype),Pw.prototype.constructor=Pw);Pw.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,k2t),r=this._options.dimensions;return!l(i)||!l(r)||Oi.prototype._isHidden.call(this,e,t,n)};Pw.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?_n.ALL:void 0};var Q5=kf;function jT(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Xi.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(jT.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var z2t=new K;jT.prototype.getValue=function(e,t){return l(e)||(e=K.now(z2t)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};jT.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};jT.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Qp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};jT.prototype.equals=function(e){return this===e||e instanceof jT&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var e9=jT;var V2t=new M;function zA(e,t){t.collectionChanged.addEventListener(zA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}zA.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,V2t),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],j2t(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};zA.prototype.isDestroyed=function(){return!1};zA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)tse(this,e[i],t,n);return le(this)};zA.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?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};zA.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):(tse(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],tse(this,o,a,c),s.remove(o.id)};function tse(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function j2t(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Jo.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 t9=zA;var H2t=z.WHITE,G2t=z.BLACK,W2t=new U(2,2);function Dw(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(Dw.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")});Dw.prototype.getType=function(e){return"Checkerboard"};var q2t=new K;Dw.prototype.getValue=function(e,t){return l(e)||(e=K.now(q2t)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,H2t,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,G2t,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,W2t),t};Dw.prototype.equals=function(e){return this===e||e instanceof Dw&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var eM=Dw;var n9={id:void 0},Rw=new Array(2);function nse(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 mMe(e,t,n,i){Rw[0]=n,Rw[1]=i.id,t[JSON.stringify(Rw)]=i.definitionChanged.addEventListener(xs.prototype._onDefinitionChanged,e)}function pMe(e,t,n,i){Rw[0]=n,Rw[1]=i.id;let r=JSON.stringify(Rw);t[r](),t[r]=void 0}function VA(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 lc(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(xs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],pMe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(xs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],mMe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?nse(y):(n9.id=s.id,y=new oo(n9)),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 xs(e,t){this._owner=t,this._composite=new lc(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Jn(),this._eventHash={},VA(this),this._shouldRecomposite=!1}Object.defineProperties(xs.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}}});xs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),VA(this)};xs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),VA(this),!0):!1};xs.prototype.removeAllCollections=function(){this._collections.length=0,VA(this)};xs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};xs.prototype.contains=function(e){return this._composite.contains(e)};xs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};xs.prototype.getCollection=function(e){return this._collections[e]};xs.prototype.getCollectionsLength=function(){return this._collections.length};function i9(e,t){return e.indexOf(t)}function gMe(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,VA(e)}xs.prototype.raiseCollection=function(e){let t=i9(this._collections,e);gMe(this,t,t+1)};xs.prototype.lowerCollection=function(e){let t=i9(this._collections,e);gMe(this,t,t-1)};xs.prototype.raiseCollectionToTop=function(e){let t=i9(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),VA(this))};xs.prototype.lowerCollectionToBottom=function(e){let t=i9(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),VA(this))};xs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};xs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(VA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};xs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};xs.prototype.getById=function(e){return this._composite.getById(e)};xs.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];pMe(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),nse(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];mMe(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)?nse(u):(n9.id=y,u=new oo(n9),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};xs.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 _Me=xs;function jA(){this._definitionChanged=new be,this._composite=new Vl,this._composite.definitionChanged.addEventListener(jA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(jA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});jA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Y2t=new K;jA.prototype.getValue=function(e,t){l(e)||(e=K.now(Y2t));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};jA.prototype.equals=function(e){return this===e||e instanceof jA&&this._composite.equals(e._composite,X.equals)};jA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var tM=jA;var yMe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(yMe);var hr=yMe;var dc=[new h,new h],X2t=new h,K2t=new h,$2t=new h,J2t=new h,Z2t=new h,Q2t=new h,ekt=new h,tkt=new h,nkt=new h,Ow=new h,r9=new h,nM={},ise=new he;function ikt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];ise=t.cartesianToCartographic(r,ise),n[i]=ise.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function rse(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 o9=new h,s9=new h;function rkt(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,o9),o9),s=r.projectPointOntoPlane(h.add(n,t,s9),s9),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var okt=new h(-1,0,0),HT=new M,skt=new M,ose=new $,akt=$.IDENTITY.clone(),ckt=new h,lkt=new se,AMe=new h;function c_(e,t,n,i,r,o,s,a){let c=ckt,u=lkt;HT=At.eastNorthUpToFixedFrame(e,r,HT),c=M.multiplyByPointAsVector(HT,okt,c),c=h.normalize(c,c);let f=rkt(c,t,e,r);ose=$.fromRotationZ(f,ose),AMe.z=o,HT=M.multiplyTransformation(HT,M.fromRotationTranslation(ose,AMe,skt),HT);let d=akt;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(HT,u,u),i.push(u.x,u.y,u.z);return i}var ukt=new h;function sse(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,ukt);i=c_(c,t,n,i,r,o[a/3],s,1)}return i}function fkt(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 bMe(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 xMe=new Le,TMe=new h,EMe=new $;function CMe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,Ow),h.subtract(n,e,r9)),d=i===hr.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,Ow),f/(d+1),xMe),EMe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),xMe),EMe);let g,m;if(t=h.clone(t,TMe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,Ow),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,r9),s=c_(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,Ow),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,r9),s=c_(m,g,a,s,o,c,1,1),n=h.clone(n,TMe),g=h.subtract(n,e,Ow),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,r9),s=c_(m,g,a,s,o,c,1,1);return s}nM.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};nM.angleIsGreaterThanPi=function(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,o9),o9),s=r.projectPointOntoPlane(h.add(n,t,s9),s9);return s.x*o.y-s.y*o.x>=0};var dkt=new h,hkt=new h;nM.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=ikt(e,o),a=i._granularity,c=i._cornerType,u=r?fkt(t,n):bMe(t,n),f=r?bMe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=X2t,b=K2t,x=$2t,T=J2t,E=Z2t,v=Q2t,S=ekt,I=tkt,R=nkt,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=c_(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),dkt);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),hkt);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,Ow))),Q=nM.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=rse(dc,_+d,C+d,a),D=ur.generateArc({positions:dc,granularity:a,ellipsoid:o}),m=sse(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===hr.ROUNDED||c===hr.BEVELED?CMe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=c_(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=rse(dc,_+d,C+d,a),D=ur.generateArc({positions:dc,granularity:a,ellipsoid:o}),m=sse(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===hr.ROUNDED||c===hr.BEVELED?CMe(E,v,S,c,Q,o,m,u,C+d,r):m=c_(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=c_(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=rse(dc,_+d,C+d,a),D=ur.generateArc({positions:dc,granularity:a,ellipsoid:o}),m=sse(D,I,u,m,o,w,1),r&&(y=c_(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 m0=nM;var cse={},Mw=new h,PMe=new h,mkt=new h,vMe=new h,Xl=[new h,new h],DMe=new h,RMe=new h,OMe=new h,pkt=new h,gkt=new h,_kt=new h,ykt=new h,Akt=new h,bkt=new h,xkt=new h,SMe=new Le,wMe=new $;function a9(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,Mw),h.subtract(n,e,PMe)),s=i===hr.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,Mw),o/s,SMe),wMe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,SMe),wMe);let f=0;t=h.clone(t,Mw);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 Tkt(e){let t=DMe,n=RMe,i=OMe,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=a9(t,n,i,hr.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=a9(t,n,i,hr.ROUNDED,!1);return[o,c]}function IMe(e,t,n,i){let r=Mw;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 ase(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,Mw),a=h.negate(s,PMe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,mkt),p=h.add(d,a,vMe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,vMe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}cse.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 Ekt=new h,Ckt=new h;cse.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=DMe,c=RMe,u=OMe,f=pkt,d=gkt,p=_kt,g=ykt,m=Akt,y=bkt,A=xkt,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),Ekt);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),Ckt);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,Mw))),N=m0.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),Xl[0]=h.clone(g,Xl[0]),Xl[1]=h.clone(A,Xl[1]),S=ur.generateArc({positions:Xl,granularity:t,ellipsoid:i}),b=ase(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===hr.ROUNDED||o===hr.BEVELED?I.push({leftPositions:a9(m,p,y,o,N)}):I.push({leftPositions:IMe(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),Xl[0]=h.clone(g,Xl[0]),Xl[1]=h.clone(A,Xl[1]),S=ur.generateArc({positions:Xl,granularity:t,ellipsoid:i}),b=ase(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===hr.ROUNDED||o===hr.BEVELED?I.push({rightPositions:a9(y,p,m,o,N)}):I.push({rightPositions:IMe(E,d,m,N)})),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=ur.generateArc({positions:Xl,granularity:t,ellipsoid:i}),b=ase(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===hr.ROUNDED&&(L=Tkt(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var gr=cse;var LMe=new h,FMe=new h,c9=new h,l9=new h,vkt=new h,BMe=new h,HA=new h,Nw=new h;function kMe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function pm(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,HA),HA);o.normal&&gr.addAttribute(s,t,i,r),o.tangent&&gr.addAttribute(a,u,i,r),o.bitangent&&gr.addAttribute(c,n,i,r)}function UMe(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new Cn,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=LMe,w=FMe,D,N,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){N=c9,D=l9;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),gr.addAttribute(b,D,S),gr.addAttribute(b,N,void 0,I),pm(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,HA),HA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,Nw),Nw),C=h.normalize(h.add(Q,W,C),C),pm(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,HA),HA),W=n.geodeticSurfaceNormal(h.fromArray(q,g,Nw),Nw),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=BMe,we=c9,ve=l9;if(C=h.fromArray(a,k,C),l(ae)){for(pm(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,gr.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),pm(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),pm(v,C,w,S,void 0,t),S+=3}else{for(pm(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,gr.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),pm(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),pm(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,HA),HA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,Nw),Nw),C=h.normalize(h.add(Q,W,C),C),pm(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),pm(v,C,w,S,I,t),m){S+=3,I-=3,N=c9,D=l9;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),gr.addAttribute(b,N,void 0,I),gr.addAttribute(b,D,S),pm(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 Skt(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=LMe,m=FMe,y=c9,A=l9,b=vkt,x=BMe,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&&(gr.addAttribute(f,A,E),gr.addAttribute(f,A,E+3),gr.addAttribute(f,A,T),gr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(gr.addAttribute(p,x,E),gr.addAttribute(p,x,E+3),gr.addAttribute(p,x,T),gr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),gr.addAttribute(d,b,E),gr.addAttribute(d,b,E+3),gr.addAttribute(d,b,T),gr.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 lse(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 wkt(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=gr.computePositions(e),o=UMe(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=hi.scaleToGeodeticHeight(f,s,i),m=lse(f,0,m),g=hi.scaleToGeodeticHeight(g,a,i),m=lse(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=Skt(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=lse(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===_n.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===_n.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 MMe=new h,iM=new h,nh=new he;function NMe(e,t,n,i,r,o){let s=h.subtract(t,e,MMe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,iM),c=h.cross(s,a,MMe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,iM),n.cartesianToCartographic(iM,nh);let g=nh.latitude,m=nh.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,iM),n.cartesianToCartographic(iM,nh),g=nh.latitude,m=nh.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 th=new h,rM=new h,qu=new he,Yu=new he;function zMe(e,t,n,i,r){e=kMe(e,t);let o=Br(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;qu.latitude=Number.POSITIVE_INFINITY,qu.longitude=Number.POSITIVE_INFINITY,Yu.latitude=Number.NEGATIVE_INFINITY,Yu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===hr.ROUNDED){let p=o[0];h.subtract(p,o[1],th),h.normalize(th,th),h.multiplyByScalar(th,a,th),h.add(p,th,rM),t.cartesianToCartographic(rM,nh),c=nh.latitude,u=nh.longitude,qu.latitude=Math.min(qu.latitude,c),qu.longitude=Math.min(qu.longitude,u),Yu.latitude=Math.max(Yu.latitude,c),Yu.longitude=Math.max(Yu.longitude,u)}for(let p=0;p<s-1;++p)NMe(o[p],o[p+1],t,a,qu,Yu);let f=o[s-1];h.subtract(f,o[s-2],th),h.normalize(th,th),h.multiplyByScalar(th,a,th),h.add(f,th,rM),NMe(f,rM,t,a,qu,Yu),i===hr.ROUNDED&&(t.cartesianToCartographic(rM,nh),c=nh.latitude,u=nh.longitude,qu.latitude=Math.min(qu.latitude,c),qu.longitude=Math.min(qu.longitude,u),Yu.latitude=Math.max(Yu.latitude,c),Yu.longitude=Math.max(Yu.longitude,u));let d=l(r)?r:new ie;return d.north=Yu.latitude,d.south=qu.latitude,d.east=Yu.longitude,d.west=qu.longitude,d}function u_(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??hr.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}u_.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 VMe=ee.clone(ee.UNIT_SPHERE),jMe=new Be,l_={positions:void 0,ellipsoid:VMe,vertexFormat:jMe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};u_.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,VMe);t+=ee.packedLength;let s=Be.unpack(e,t,jMe);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):(l_.positions=r,l_.width=a,l_.height=c,l_.extrudedHeight=u,l_.cornerType=f,l_.granularity=d,l_.shadowVolume=p,l_.offsetAttribute=g===-1?void 0:g,new u_(l_))};u_.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??hr.ROUNDED;return zMe(n,r,i,o,t)};u_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=kMe(t,i);let r=Br(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=wkt(u,c);else{let g=gr.computePositions(u);if(f=UMe(g,c,i),f.attributes.position.values=hi.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===_n.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=ue.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})};u_.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new u_({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(u_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=zMe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var Lw=u_;var HMe=new h,GMe=new h,Ikt=new h;function Pkt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function WMe(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new Cn,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=HMe,I=GMe;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),gr.addAttribute(A,I,b),gr.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=Ikt;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,gr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===hr.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,gr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===hr.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=HMe,I=GMe;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),gr.addAttribute(A,R,void 0,x),gr.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 Dkt(e){let t=e.ellipsoid,n=gr.computePositions(e),i=WMe(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=hi.scaleToGeodeticHeight(u,o,t),d=hi.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===_n.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===_n.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 oM(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??hr.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}oM.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 qMe=ee.clone(ee.UNIT_SPHERE),GA={positions:void 0,ellipsoid:qMe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};oM.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,qMe);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):(GA.positions=r,GA.width=s,GA.height=a,GA.extrudedHeight=c,GA.cornerType=u,GA.granularity=f,GA.offsetAttribute=d===-1?void 0:d,new oM(GA))};oM.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Pkt(t,i);let r=Br(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=Dkt(c);else{let p=gr.computePositions(c);if(u=WMe(p,c.cornerType),u.attributes.position.values=hi.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===_n.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=ue.fromVertices(f.position.values,void 0,3);return new wt({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var u9=oM;var Rkt=new mi(0);function Kl(e){Mi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Kl.prototype=Object.create(Mi.prototype),Kl.prototype.constructor=Kl);Object.defineProperties(Kl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Kl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Lu.isSupported(this._scene)};Kl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Kl.prototype._computeCenter=pe.throwInstantiationError;Kl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Mi.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??Rkt,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 i0(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Iw(this._scene,a,o,s)}};Kl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Mi.prototype.destroy.call(this)};Kl.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryHeightReference);return}return ls(t)?0:e};Kl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryExtrudedHeightReference);return}return ls(t)?Kl.CLAMP_TO_GROUND:e};Kl.CLAMP_TO_GROUND="clamp";Kl.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 _n.ALL;if(r===1)return _n.TOP};var si=Kl;var YMe=new z,XMe=h.ZERO,KMe=new h,$Me=new ie;function Okt(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 gm(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new Okt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(gm.prototype=Object.create(si.prototype),gm.prototype.constructor=gm);gm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,YMe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,XMe,KMe))),new Bt({id:t,geometry:new Lw(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,YMe),r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,XMe,KMe))),new Bt({id:t,geometry:new u9(this._options),attributes:r})};gm.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)};gm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Mi.prototype._isHidden.call(this,e,t)};gm.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)};gm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,it.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(it.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(it.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,it.MINIMUM_VALUE),s.offsetAttribute=si.computeGeometryOffsetAttribute(n,i,r,o),s.height=si.getGeometryHeight(n,i),r=si.getGeometryExtrudedHeight(r,o),r===si.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(Lw.computeRectangle(s,$Me)).minimumTerrainHeight),s.extrudedHeight=r};gm.DynamicGeometryUpdater=Fw;function Fw(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(Fw.prototype=Object.create(Oi.prototype),Fw.prototype.constructor=Fw);Fw.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Oi.prototype._isHidden.call(this,e,t,n)};Fw.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=si.computeGeometryOffsetAttribute(r,o,s,a),i.height=si.getGeometryHeight(r,o),s=si.getGeometryExtrudedHeight(s,a),s===si.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(Lw.computeRectangle(i,$Me)).minimumTerrainHeight),i.extrudedHeight=s};var f9=gm;function use(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 lc(this),this._entityCluster=new Wd}Object.defineProperties(use.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}}});use.prototype.update=function(e){return!0};var d9=use;var JMe={};JMe.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 Bw=JMe;var fse=new U,Mkt=new h,Nkt=new h,Lkt=new h,Fkt=new h;function f_(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"}f_.packedLength=Be.packedLength+5;f_.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 ZMe=new Be,kw={vertexFormat:ZMe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};f_.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,ZMe);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):(kw.length=r,kw.topRadius=o,kw.bottomRadius=s,kw.slices=a,kw.offsetAttribute=c===-1?void 0:c,new f_(kw))};f_.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=Bw.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=Mkt;C.z=Math.sin(_);let w=Math.cos(_),D=Lkt,N=Nkt;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,Fkt);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new Cn;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})),fse.x=t*.5,fse.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(fse));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===_n.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 dse;f_.getUnitCylinder=function(){return l(dse)||(dse=f_.createGeometry(new f_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),dse};var h9=f_;var hse=new U;function Uw(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"}Uw.packedLength=6;Uw.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 GT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Uw.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):(GT.length=i,GT.topRadius=r,GT.bottomRadius=o,GT.slices=s,GT.numberOfVerticalLines=a,GT.offsetAttribute=c===-1?void 0:c,new Uw(GT))};Uw.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=Bw.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 Cn;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),hse.x=t*.5,hse.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(hse));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===_n.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 m9=Uw;var QMe=h.ZERO,eNe=new h,Bkt=new h,tNe=new z;function kkt(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 Uf(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new kkt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Uf.prototype=Object.create(Mi.prototype),Uf.prototype.constructor=Uf);Object.defineProperties(Uf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Uf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ni.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,tNe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,QMe,eNe))),new Bt({id:t,geometry:new h9(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Uf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,tNe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,QMe,eNe))),new Bt({id:t,geometry:new m9(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};Uf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Uf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Mi.prototype._isHidden.call(this,e,t)};Uf.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)};Uf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,it.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(it.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(it.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(it.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,it.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,it.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?_n.ALL:void 0};Uf.prototype._onEntityPropertyChanged=UA;Uf.DynamicGeometryUpdater=zw;function zw(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(zw.prototype=Object.create(Oi.prototype),zw.prototype.constructor=zw);zw.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Bkt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Oi.prototype._isHidden.call(this,e,t,n)};zw.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?_n.ALL:void 0};var p9=Uf;var Ukt=P.factorial;function mse(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+=mse(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 zkt=[],pse=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/Ukt(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=mse(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=zkt,m=Vkt(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=mse(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 Vkt(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 g9=pse;var gse=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}},_9=gse;function ml(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}ml.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new ml),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};ml.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new ml(e.clock,e.cone,e.magnitude)};ml.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new ml(e.clock,e.cone,1)};ml.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};ml.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};ml.prototype.equals=function(e){return ml.equals(this,e)};ml.prototype.clone=function(e){return ml.clone(this,e)};ml.prototype.equalsEpsilon=function(e,t){return ml.equalsEpsilon(this,e,t)};ml.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var y9=ml;var pM=js(nf(),1);var jkt=z.WHITE,Hkt=.1,Gkt=new U(8,8),Wkt=new U(0,0),qkt=new U(1,1);function Vw(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(Vw.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")});Vw.prototype.getType=function(e){return"Grid"};var Ykt=new K;Vw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Ykt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,jkt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,Hkt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,Gkt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,qkt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,Wkt,t.lineOffset),t};Vw.prototype.equals=function(e){return this===e||e instanceof Vw&&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 sM=Vw;var nNe={WHOLE:0,PORTIONS:1};Object.freeze(nNe);var d_=nNe;function jw(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(jw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});jw.prototype.getType=function(e){return"PolylineArrow"};var Xkt=new K;jw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Xkt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};jw.prototype.equals=function(e){return this===e||e instanceof jw&&X.equals(this._color,e._color)};var aM=jw;var Kkt=z.WHITE,$kt=z.TRANSPARENT,Jkt=16,Zkt=255;function Hw(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(Hw.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")});Hw.prototype.getType=function(e){return"PolylineDash"};var Qkt=new K;Hw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Qkt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Kkt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,$kt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,Jkt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,Zkt,t.dashPattern),t};Hw.prototype.equals=function(e){return this===e||e instanceof Hw&&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 cM=Hw;var e3t=z.WHITE,t3t=.25,n3t=1;function Gw(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(Gw.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")});Gw.prototype.getType=function(e){return"PolylineGlow"};var i3t=new K;Gw.prototype.getValue=function(e,t){return l(e)||(e=K.now(i3t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,e3t,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,t3t,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,n3t,t.taperPower),t};Gw.prototype.equals=function(e){return this===e||e instanceof Gw&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var lM=Gw;var r3t=z.WHITE,o3t=z.BLACK,s3t=1;function Ww(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(Ww.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")});Ww.prototype.getType=function(e){return"PolylineOutline"};var a3t=new K;Ww.prototype.getValue=function(e,t){return l(e)||(e=K.now(a3t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,r3t,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,o3t,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,s3t),t};Ww.prototype.equals=function(e){return this===e||e instanceof Ww&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var WT=Ww;function WA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Qo,this.setValue(e)}Object.defineProperties(WA.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 c3t=new K;WA.prototype.getValue=function(e,t){l(e)||(e=K.now(c3t));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};WA.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,WA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};WA.prototype.equals=function(e){return this===e||e instanceof WA&&X.arrayEquals(this._value,e._value)};WA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var uM=WA;var l3t={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}},_m=l3t;var iNe={HORIZONTAL:0,VERTICAL:1};Object.freeze(iNe);var p0=iNe;var u3t=p0.HORIZONTAL,f3t=z.WHITE,d3t=z.BLACK,h3t=0,m3t=1;function qw(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(qw.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")});qw.prototype.getType=function(e){return"Stripe"};var p3t=new K;qw.prototype.getValue=function(e,t){return l(e)||(e=K.now(p3t)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,u3t)===p0.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,f3t,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,d3t,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,h3t),t.repeat=X.getValueOrDefault(this._repeat,e,m3t),t};qw.prototype.equals=function(e){return this===e||e instanceof qw&&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 fM=qw;function qA(e){this._definitionChanged=new be,this._intervals=new Bs,this._intervals.changedEvent.addEventListener(qA.prototype._intervalsChanged,this),this._referenceFrame=e??Xi.FIXED}Object.defineProperties(qA.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 g3t=new K;qA.prototype.getValue=function(e,t){return l(e)||(e=K.now(g3t)),this.getValueInReferenceFrame(e,Xi.FIXED,t)};qA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Qp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};qA.prototype.equals=function(e){return this===e||e instanceof qA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};qA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var YA=qA;function Yw(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(Yw.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 _3t=new h,rNe=new h,oNe=new K,y3t=new K,_se=1/60;Yw.prototype.getValue=function(e,t){return this._getValue(e,t)};Yw.prototype._getValue=function(e,t,n){l(e)||(e=K.now(y3t)),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,_3t),o=i.getValue(K.addSeconds(e,_se,oNe),rNe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-_se,oNe),rNe),!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,_se,t)};Yw.prototype.equals=function(e){return this===e||e instanceof Yw&&X.equals(this._position,e._position)};var XA=Yw;function dM(e,t){this._velocityVectorProperty=new XA(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(dM.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 sNe=new h,A3t=new h,aNe=new $,b3t=new K;dM.prototype.getValue=function(e,t){l(e)||(e=K.now(b3t));let n=this._velocityVectorProperty._getValue(e,A3t,sNe);if(l(n))return At.rotationMatrixFromPositionVelocity(sNe,n,this._ellipsoid,aNe),Le.fromRotationMatrix(aNe,t)};dM.prototype.equals=function(e){return this===e||e instanceof dM&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var A9=dM;function KA(){}KA.packedLength=h.packedLength;KA.unpack=h.unpack;KA.pack=h.pack;var yse;function hM(e,t){return t[0]==="#"&&(t=yse+t),_A.fromString(e,t)}function cNe(e,t,n){if(l(n.reference))return hM(t,n.reference);if(l(n.velocityReference)){let i=hM(t,n.velocityReference);switch(e){case h:case KA:return new XA(i,e===KA);case Le:return new A9(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function x3t(e,t){return new i0(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var mr=new h,$l=new y9,pl=new he,qT=new vn,b9=new Le;function T3t(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 lNe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function E3t(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 C3t(e){let t=e.length;if($l.magnitude=1,t===2)return $l.clock=e[0],$l.cone=e[1],h.fromSpherical($l,mr),[mr.x,mr.y,mr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],$l.clock=e[i+1],$l.cone=e[i+2],h.fromSpherical($l,mr),n[r+1]=mr.x,n[r+2]=mr.y,n[r+3]=mr.z;return n}function v3t(e){let t=e.length;if(t===3)return $l.clock=e[0],$l.cone=e[1],$l.magnitude=e[2],h.fromSpherical($l,mr),[mr.x,mr.y,mr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],$l.clock=e[i+1],$l.cone=e[i+2],$l.magnitude=e[i+3],h.fromSpherical($l,mr),n[i+1]=mr.x,n[i+2]=mr.y,n[i+3]=mr.z;return n}function S3t(e){let t=e.length;if(t===3)return pl.longitude=e[0],pl.latitude=e[1],pl.height=e[2],ee.default.cartographicToCartesian(pl,mr),[mr.x,mr.y,mr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],pl.longitude=e[i+1],pl.latitude=e[i+2],pl.height=e[i+3],ee.default.cartographicToCartesian(pl,mr),n[i+1]=mr.x,n[i+2]=mr.y,n[i+3]=mr.z;return n}function w3t(e){let t=e.length;if(t===3)return pl.longitude=P.toRadians(e[0]),pl.latitude=P.toRadians(e[1]),pl.height=e[2],ee.default.cartographicToCartesian(pl,mr),[mr.x,mr.y,mr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],pl.longitude=P.toRadians(e[i+1]),pl.latitude=P.toRadians(e[i+2]),pl.height=e[i+3],ee.default.cartographicToCartesian(pl,mr),n[i+1]=mr.x,n[i+2]=mr.y,n[i+3]=mr.z;return n}function Ase(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 C3t(r);let o=e.spherical;if(l(o))return v3t(o);let s=e.cartographicRadians;if(l(s))return S3t(s);let a=e.cartographicDegrees;if(l(a))return w3t(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function uNe(e,t){h.unpack(e,t,mr),h.normalize(mr,mr),h.pack(mr,e,t)}function I3t(e){let t=Ase(e);if(t.length===3)return uNe(t,0),t;for(let n=1;n<t.length;n+=4)uNe(t,n);return t}function fNe(e,t){Le.unpack(e,t,b9),Le.normalize(b9,b9),Le.pack(b9,e,t)}function P3t(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return fNe(t,0),t;for(let n=1;n<t.length;n+=5)fNe(t,n)}return t}function dNe(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")?KA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?fn:e.hasOwnProperty("classificationType")?ei:e.hasOwnProperty("colorBlendMode")?Dl:e.hasOwnProperty("cornerType")?hr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?Wi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?So: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")?d_:e.hasOwnProperty("shadowMode")?Pn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?p0:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?pM.default:e.hasOwnProperty("verticalOrigin")?Wn:Object}function D3t(e,t,n){switch(e){case fn:return fn[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 Ase(t);case KA:return I3t(t);case z:return T3t(t);case ei:return ei[t.classificationType??t];case Dl:return Dl[t.colorBlendMode??t];case hr:return hr[t.cornerType??t];case We:return We[t.heightReference??t];case Wi:return Wi[t.horizontalOrigin??t];case Image:return lNe(t,n);case K:return K.fromIso8601(t.date??t);case So:return So[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 d_:return d_[t.pathMode??t];case Le:return P3t(t);case _m:return t.number??t;case GO:return GO[t.portionToDisplay??t];case Pn:return Pn[t.shadowMode??t.shadows??t];case String:return t.string??t;case p0:return p0[t.stripeOrientation??t];case ie:return E3t(t);case pM.default:return lNe(t,n);case Wn:return Wn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var R3t={HERMITE:g9,LAGRANGE:_9,LINEAR:yT};function x9(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:R3t[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Hu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Hu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var hNe={iso8601:void 0};function Vo(e){if(l(e))return hNe.iso8601=e,vn.fromIso8601(hNe)}function bse(e){let t=it.MAXIMUM_INTERVAL.clone();return t.data=e,t}function mNe(e){let t=new Vl;return t.intervals.addInterval(bse(e)),t}function pNe(e){let t=new wc(e.referenceFrame);return t.intervals.addInterval(bse(e)),t}function T9(e,t,n,i,r,o,s){let a=Vo(i.interval);l(r)&&(l(a)?a=vn.intersect(a,r,qT):a=r);let c,u,f,d=!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 SNe(t[n],a)}let g=!1;if(d){if(u=D3t(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!==_m;if(!g&&!p){d?t[n]=new mi(m?e.unpack(u,0):u):t[n]=cNe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Xd||(t[n]=y=new Xd(e)),y.addSamplesPackedArray(u,A),x9(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=cNe(e,s,i),l(y)||(t[n]=y=d?new AA:new Vl),d&&y instanceof AA?y.intervals.addInterval(a):y instanceof Vl?(d&&(a.data=new mi(a.data)),y.intervals.addInterval(a)):(t[n]=y=mNe(y),d&&(a.data=new mi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Vl),y instanceof Vl||(t[n]=y=mNe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof Xd))&&(x=a.clone(),x.data=new Xd(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),x9(i,x.data)}function SNe(e,t){if(e instanceof Xd){e.removeSamples(t);return}else if(e instanceof AA){e.intervals.removeInterval(t);return}else if(e instanceof Vl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=vn.intersect(n.get(i),t,qT);r.isEmpty||SNe(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)T9(e,t,n,i[a],r,o,s);else T9(e,t,n,i,r,o,s)}function gNe(e,t,n,i,r,o){let s=Vo(n.interval);l(i)&&(l(s)?s=vn.intersect(s,i,qT):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(it.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return wNe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Xi[n.referenceFrame]),g=g??Xi.FIXED,u=Ase(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new Vu(h.unpack(u),g):e[t]=hM(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof Ic)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ic(g,a)),y.addSamplesPackedArray(u,A),x9(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=hM(o,n.reference),l(y)||(d?y=new YA(g):y=new wc(g),e[t]=y),d&&y instanceof YA&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof wc?(d&&(s.data=new Vu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=pNe(y),d&&(s.data=new Vu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof wc||(e[t]=y=pNe(y)):e[t]=y=new wc(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Ic)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new Ic(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),x9(n,x.data)}function wNe(e,t){if(e instanceof Ic){e.removeSamples(t);return}else if(e instanceof YA){e.intervals.removeInterval(t);return}else if(e instanceof wc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=vn.intersect(n.get(i),t,qT);r.isEmpty||wNe(r.data,t)}n.removeInterval(t);return}}function INe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)gNe(e,t,n[s],i,r,o);else gNe(e,t,n,i,r,o)}function _Ne(e,t,n,i){l(n.references)?E9(e,t,n.references,n.interval,i,uM,Vl):(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 yNe(e,t,n,i,r,o){let s=Vo(n.interval);l(i)&&(l(s)?s=vn.intersect(s,i,qT):s=i);let a=e[t],c,u;if(l(s)){a instanceof tM||(a=new tM,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 sM||(c=new sM),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 mT||(c=new mT),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 fM||(c=new fM),f=n.stripe,Ee(p0,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 WT||(c=new WT),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 lM||(c=new lM),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 aM||(c=new aM),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof cM||(c=new cM),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 eM||(c=new eM),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 zf(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)yNe(e,t,n[s],i,r,o);else yNe(e,t,n,i,r,o)}function O3t(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function M3t(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function N3t(e,t,n,i){let r=t.position;l(r)&&INe(e,"position",r,void 0,i,n)}function L3t(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function F3t(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function B3t(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new ju);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)T9(dNe(s[a]),e.properties,o,s[a],void 0,i,n);else T9(dNe(s),e.properties,o,s,void 0,i,n)}}}function E9(e,t,n,i,r,o,s){let a=n.map(function(c){return hM(r,c)});if(l(i)){i=Vo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(bse(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function ANe(e,t,n,i){let r=n.references;l(r)?E9(e,t,r,n.interval,i,uM,Vl):Ee(Array,e,t,n,void 0,void 0,i)}function bNe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)ANe(e,t,n[r],i);else ANe(e,t,n,i)}function xNe(e,t,n,i){let r=n.references;l(r)?E9(e,t,r,n.interval,i,gA,wc):(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 gM(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)xNe(e,t,n[r],i);else xNe(e,t,n,i)}function k3t(e){return h.unpackArray(e)}function U3t(e){return h.fromRadiansArrayHeights(e,ee.default)}function z3t(e){return h.fromDegreesArrayHeights(e,ee.default)}function TNe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return E9(a,"positions",s,n.interval,i,gA,wc),a.positions});e[t]=new gA(o)}else l(n.cartesian)?n.array=n.cartesian.map(k3t):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(U3t):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(z3t)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function V3t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)TNe(e,t,n[r],i);else TNe(e,t,n,i)}function j3t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)_Ne(e,t,n[r],i);else _Ne(e,t,n,i)}function H3t(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 Bs),o.addInterval(Vo(r[s]));else o=new Bs,o.addInterval(Vo(r));e.availability=o}function G3t(e,t,n,i,r){l(t)&&Ee(KA,e,"alignedAxis",t,n,i,r)}function W3t(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Vo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new zl),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(Wi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Wn,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(_m,s,"rotation",r.rotation,o,i,n),G3t(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 q3t(e,t,n,i){let r=t.box;if(!l(r))return;let o=Vo(r.interval),s=e.box;l(s)||(e.box=s=new GS),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),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Y3t(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Vo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new qS),Ee(Boolean,s,"show",r.show,o,i,n),gM(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(hr,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),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function X3t(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Vo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new YS),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),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function K3t(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 $3t(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Vo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new XS),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(_m,s,"rotation",r.rotation,o,i,n),Ee(_m,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),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function J3t(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Vo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new KS),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),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Z3t(e,t,n,i){let r=t.label;if(!l(r))return;let o=Vo(r.interval),s=e.label;l(s)||(e.label=s=new e0),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(So,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(Wi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Wn,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 Q3t(e,t,n,i){let r=t.model;if(!l(r))return;let o=Vo(r.interval),s=e.model;l(s)||(e.model=s=new hA),Ee(Boolean,s,"show",r.show,o,i,n),Ee(pM.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(Pn,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(Dl,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)ENe(s,u[a],o,i,n);else ENe(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)CNe(s,f[a],o,i,n);else CNe(s,f,o,i,n)}function ENe(e,t,n,i,r){let o=Vo(t.interval);l(n)&&(l(o)?o=vn.intersect(o,n,qT):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 ju),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new $S),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 CNe(e,t,n,i,r){let o=Vo(t.interval);l(n)&&(l(o)?o=vn.intersect(o,n,qT):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 ju),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function eUt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Vo(r.interval),s=e.path;l(s)||(e.path=s=new mA),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),zf(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(d_,s,"materialMode",r.materialMode,o,i,n)}function tUt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Vo(r.interval),s=e.point;l(s)||(e.point=s=new ZS),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 mM(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(mM.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}}});mM.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 tl(r)}))),l(t)?(t.positions=n,t.holes=i,t):new tl(n,i)};mM.prototype.equals=function(e){return this===e||e instanceof mM&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function nUt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Vo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new t0),Ee(Boolean,s,"show",r.show,o,i,n),gM(s,"_positions",r.positions,n),V3t(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new mM(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(_m,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),zf(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(fn,s,"arcType",r.arcType,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function iUt(e){return e?fn.GEODESIC:fn.NONE}function rUt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Vo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new jl),Ee(Boolean,s,"show",r.show,o,i,n),gM(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),zf(s,"material",r.material,o,i,n),zf(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(fn,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,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=x3t(a.followSurface,iUt)}}function oUt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Vo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new QS),gM(s,"positions",r.positions,n),j3t(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(hr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function sUt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Vo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new n0),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(_m,s,"rotation",r.rotation,o,i,n),Ee(_m,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),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function aUt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Vo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new JS),Ee(Boolean,s,"show",r.show,o,i,n),Ee(pM.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function cUt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Vo(r.interval),s=e.wall;l(s)||(e.wall=s=new pA),Ee(Boolean,s,"show",r.show,o,i,n),gM(s,"positions",r.positions,n),bNe(s,"minimumHeights",r.minimumHeights,n),bNe(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),zf(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(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function vNe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Jn()),yse=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")K3t(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)}yse=void 0}function lUt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(it.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Zp,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=Fs.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Zp,t.startTime=it.MINIMUM_VALUE.clone(),t.stopTime=it.MAXIMUM_VALUE.clone(),t.currentTime=it.MINIMUM_VALUE.clone(),t.clockRange=Fs.LOOP_STOP,t.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Vo(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=Fs[n.range]??Fs.LOOP_STOP),l(n.step)&&(t.clockStep=Hr[n.step]??Hr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function PNe(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 uUt(e,a,o,i)}).catch(function(a){return ks.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function uUt(e,t,n,i){ks.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new DNe,r.removeAll()),ta._processCzml(t,r,n,void 0,e);let o=lUt(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=Zy(n.getUrlComponent()),o=!0),ks.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function DNe(){this.name=void 0,this.clock=void 0}function ta(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 DNe,this._version=void 0,this._entityCollection=new lc(this),this._entityCluster=new Wd,this._credit=void 0,this._resourceCredits=[]}ta.load=function(e,t){return new ta().load(e,t)};Object.defineProperties(ta.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}}});ta.updaters=[W3t,q3t,Y3t,X3t,$3t,J3t,Z3t,Q3t,O3t,M3t,eUt,tUt,nUt,rUt,oUt,B3t,sUt,N3t,aUt,L3t,cUt,F3t,H3t];ta.registerUpdater=function(e){ta.updaters.includes(e)||ta.updaters.push(e)};ta.unregisterUpdater=function(e){if(ta.updaters.includes(e)){let t=ta.updaters.indexOf(e);ta.updaters.splice(t,1)}};ta.prototype.process=function(e,t){return PNe(this,e,t,!1)};ta.prototype.load=function(e,t){return PNe(this,e,t,!0)};ta.prototype.update=function(e){return!0};ta.processPacketData=Ee;ta.processPositionPacketData=INe;ta.processMaterialPacketData=zf;ta._processCzml=function(e,t,n,i,r){if(i=i??ta.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)vNe(e[o],t,i,n,r);else vNe(e,t,i,n,r)};var C9=ta;function Jl(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(Jl.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}}});Jl.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})};Jl.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};Jl.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=[]};Jl.prototype.contains=function(e){return this.indexOf(e)!==-1};Jl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Jl.prototype.get=function(e){return this._dataSources[e]};Jl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function v9(e,t){return e.indexOf(t)}function RNe(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)}Jl.prototype.raise=function(e){let t=v9(this._dataSources,e);RNe(this,t,t+1)};Jl.prototype.lower=function(e){let t=v9(this._dataSources,e);RNe(this,t,t-1)};Jl.prototype.raiseToTop=function(e){let t=v9(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))};Jl.prototype.lowerToBottom=function(e){let t=v9(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Jl.prototype.isDestroyed=function(){return!1};Jl.prototype.destroy=function(){return this.removeAll(!0),le(this)};var S9=Jl;function Xw(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new zt}Xw.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};Xw.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};Xw.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};Xw.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};Xw.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var Kw=Xw;var Tse={},w9=new h,ONe=new h,MNe=new Le,NNe=new $;function $w(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),w9),h.multiplyByScalar(n,Math.sin(f),ONe),h.add(w9,ONe,w9);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(w9,m,MNe),$.fromQuaternion(MNe,NNe),$.multiplyByVector(NNe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var LNe=new h,FNe=new h,xse=new h,fUt=new h;Tse.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,LNe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,FNe),y=i.geodeticSurfaceNormal(g,fUt),A=h.multiplyByScalar(y,r,xse);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 dUt=new h,hUt=new h,mUt=new h;Tse.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,dUt),g=h.cross(h.UNIT_Z,s,hUt);g=h.normalize(g,g);let m=h.cross(p,g,mUt),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=LNe,S=FNe,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=$w(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=$w(b,o,m,g,c,f,u,d,p,v),S=$w(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,xse),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=$w(-b,o,m,g,c,f,u,d,p,v),S=$w(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,xse),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=$w(-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 Vf=Tse;var Jw=new h,Ese=new h,Cse=new h,BNe=new h,Ea=new U,kNe=new $,pUt=new $,vse=new Le,UNe=new h,zNe=new h,VNe=new h,D9=new he,jNe=new h,HNe=new U,GNe=new U;function WNe(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=UNe,x=zNe,T=VNe,E=new Hi(a),v=E.project(a.cartesianToCartographic(r,D9),jNe),S=a.scaleToGeodeticSurface(r,Jw);a.geodeticSurfaceNormal(S,S);let I=kNe,R=pUt;if(c!==0){let N=Le.fromAxisAngle(S,c,vse);I=$.fromQuaternion(N,I),N=Le.fromAxisAngle(S,-c,vse),R=$.fromQuaternion(N,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,HNe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,GNe),_=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,Jw);if(i.st){let j=$.multiplyByVector(I,B,Ese),k=E.project(a.cartesianToCartographic(j,D9),Cse);h.subtract(k,v,k),Ea.x=(k.x+o)/(2*o),Ea.y=(k.y+s)/(2*s),O.x=Math.min(Ea.x,O.x),O.y=Math.min(Ea.y,O.y),L.x=Math.max(Ea.x,L.x),L.y=Math.max(Ea.y,L.y),n&&(d[A+w]=Ea.x,d[A+1+w]=Ea.y),d[A++]=Ea.x,d[A++]=Ea.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 Cn;if(i.position){let N=Vf.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===_n.TOP)N=N.fill(1,0,u/2);else{let F=t.offsetAttribute===_n.NONE?0:1;N=N.fill(F)}D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return D}function qNe(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 YT=new h;function gUt(e){let t=e.center;YT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,YT),e.height,YT),YT=h.add(t,YT,YT);let n=new ue(YT,e.semiMajorAxis),i=Vf.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=WNe(r,e,!1),a=qNe(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function _Ut(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=UNe,E=zNe,v=VNe,S=new Hi(s),I=S.project(s.cartesianToCartographic(i,D9),jNe),R=s.scaleToGeodeticSurface(i,Jw);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,vse),L=$.fromQuaternion(O,kNe),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,HNe),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,GNe),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,Jw),k;if(n.st){let q=$.multiplyByVector(L,j,Ese),Q=S.project(s.cartesianToCartographic(q,D9),Cse);h.subtract(Q,I,Q),Ea.x=(Q.x+r)/(2*r),Ea.y=(Q.y+o)/(2*o),_.x=Math.min(Ea.x,_.x),_.y=Math.min(Ea.y,_.y),C.x=Math.max(Ea.x,C.x),C.y=Math.max(Ea.y,C.y),p[x+D]=Ea.x,p[x+1+D]=Ea.y,p[x++]=Ea.x,p[x++]=Ea.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,Ese),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,BNe);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,BNe);h.subtract(q,j,q);let Q=h.subtract(k,j,Cse);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 Cn;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===_n.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===_n.NONE?0:1;F=F.fill(V)}N.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return N}function yUt(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 I9=new ue,P9=new ue;function AUt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,Jw),e.height,Jw);I9.center=h.add(t,r,I9.center),I9.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),P9.center=h.add(t,r,P9.center),P9.radius=i;let o=Vf.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(I9,P9),f=WNe(s,e,!0),d=qNe(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=_Ut(c,e);d=yUt(c);let b=je.createTypedArray(c.length*2/3,d),x=new wt({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=qn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function YNe(e,t,n,i,r,o,s){let c=Vf.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 _0(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}_0.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;_0.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 XNe=new h,KNe=new ee,$Ne=new Be,g0={center:XNe,ellipsoid:KNe,vertexFormat:$Ne,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};_0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,XNe);t+=h.packedLength;let r=ee.unpack(e,t,KNe);t+=ee.packedLength;let o=Be.unpack(e,t,$Ne);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):(g0.height=f,g0.extrudedHeight=p,g0.granularity=d,g0.stRotation=u,g0.rotation=c,g0.semiMajorAxis=s,g0.semiMinorAxis=a,g0.shadowVolume=g,g0.offsetAttribute=m===-1?void 0:m,new _0(g0))};_0.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 YNe(n,r,o,a,s,i,t)};_0.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=AUt(r);else if(o=gUt(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===_n.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})};_0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new _0({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 bUt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Vf.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(_0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=YNe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=bUt(this)),this._textureCoordinateRotationPoints}}});var Xu=_0;var JNe=new h,XT=new h;function xUt(e){let t=e.center;XT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,XT),e.height,XT),XT=h.add(t,XT,XT);let n=new ue(XT,e.semiMajorAxis),i=Vf.computeEllipsePositions(e,!1,!0).outerPositions,r=new Cn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Vf.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 R9=new ue,O9=new ue;function TUt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,JNe),e.height,JNe);R9.center=h.add(t,r,R9.center),R9.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),O9.center=h.add(t,r,O9.center),O9.radius=i;let o=Vf.computeEllipsePositions(e,!1,!0).outerPositions,s=new Cn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Vf.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(R9,O9),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===_n.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===_n.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 Zw(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"}Zw.packedLength=h.packedLength+ee.packedLength+8;Zw.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 ZNe=new h,QNe=new ee,h_={center:ZNe,ellipsoid:QNe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Zw.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,ZNe);t+=h.packedLength;let r=ee.unpack(e,t,QNe);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):(h_.height=c,h_.extrudedHeight=f,h_.granularity=u,h_.rotation=a,h_.semiMajorAxis=o,h_.semiMinorAxis=s,h_.numberOfVerticalLines=d,h_.offsetAttribute=p===-1?void 0:p,new Zw(h_))};Zw.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=TUt(r);else if(o=xUt(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===_n.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 ih=Zw;var eLe=new z,tLe=h.ZERO,nLe=new h,iLe=new ie;function EUt(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 ym(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new EUt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(ym.prototype=Object.create(si.prototype),ym.prototype.constructor=ym);ym.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,eLe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,tLe,nLe))),new Bt({id:t,geometry:new Xu(this._options),attributes:i})};ym.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,eLe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,tLe,nLe))),new Bt({id:t,geometry:new ih(this._options),attributes:o})};ym.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};ym.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Mi.prototype._isHidden.call(this,e,t)};ym.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)};ym.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,it.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(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=X.getValueOrUndefined(t.rotation,it.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,it.MINIMUM_VALUE),s.offsetAttribute=si.computeGeometryOffsetAttribute(n,i,r,o),s.height=si.getGeometryHeight(n,i),r=si.getGeometryExtrudedHeight(r,o),r===si.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(Xu.computeRectangle(s,iLe)).minimumTerrainHeight),s.extrudedHeight=r};ym.DynamicGeometryUpdater=Qw;function Qw(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(Qw.prototype=Object.create(Oi.prototype),Qw.prototype.constructor=Qw);Qw.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Oi.prototype._isHidden.call(this,e,t,n)};Qw.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=si.computeGeometryOffsetAttribute(r,o,s,a),i.height=si.getGeometryHeight(r,o),s=si.getGeometryExtrudedHeight(s,a),s===si.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(Xu.computeRectangle(i,iLe)).minimumTerrainHeight),i.extrudedHeight=s};var M9=ym;var CUt=new Kt(z.WHITE),Sse=h.ZERO,wse=new h,vUt=new h,SUt=new h,Ise=new z,wUt=new h(1,1,1);function IUt(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 jf(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new IUt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(jf.prototype=Object.create(Mi.prototype),jf.prototype.constructor=jf);Object.defineProperties(jf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});jf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ni.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,Ise)),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,Sse,wse))),new Bt({id:i,geometry:new rc(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};jf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Ise),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:ni.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Sse,wse))),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})};jf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};jf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Mi.prototype._isHidden.call(this,e,t)};jf.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)};jf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,it.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(it.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,it.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,it.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,it.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,it.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,it.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,it.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,it.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?_n.ALL:void 0};jf.prototype._onEntityPropertyChanged=UA;jf.DynamicGeometryUpdater=_M;function _M(e,t,n){Oi.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)&&(_M.prototype=Object.create(Oi.prototype),_M.prototype.constructor=_M);_M.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,vUt),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,Ise),c=Ro.getValue(e,n.material??CUt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,SUt),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?_n.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,Sse,wse);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?wUt: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=Dn.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=Dn.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=ni.toValue(O,D.distanceDisplayCondition),N.distanceDisplayCondition=ni.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 N9=jf;function eI(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}eI.packedLength=Be.packedLength;eI.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var rLe=new Be,PUt={vertexFormat:rLe};eI.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,rLe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new eI(PUt)};var L9=new h(-.5,-.5,0),F9=new h(.5,.5,0);eI.createGeometry=function(e){let t=e._vertexFormat,n=new Cn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=L9.x,r[1]=L9.y,r[2]=0,r[3]=F9.x,r[4]=L9.y,r[5]=0,r[6]=F9.x,r[7]=F9.y,r[8]=0,r[9]=L9.x,r[10]=F9.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 ue(h.ZERO,Math.sqrt(2))})};var B9=eI;function tI(){this._workerName="createPlaneOutlineGeometry"}tI.packedLength=0;tI.pack=function(e,t){return t};tI.unpack=function(e,t,n){return l(n)?n:new tI};var $A=new h(-.5,-.5,0),k9=new h(.5,.5,0);tI.createGeometry=function(){let e=new Cn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=$A.x,n[1]=$A.y,n[2]=$A.z,n[3]=k9.x,n[4]=$A.y,n[5]=$A.z,n[6]=k9.x,n[7]=k9.y,n[8]=$A.z,n[9]=$A.x,n[10]=k9.y,n[11]=$A.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 ue(h.ZERO,Math.sqrt(2))})};var U9=tI;var DUt=new h,oLe=new z;function RUt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function rh(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new RUt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(rh.prototype=Object.create(Mi.prototype),rh.prototype.constructor=rh);rh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ni.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,oLe)),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=Pse(d,p,f,f),new Bt({id:t,geometry:new B9(this._options),modelMatrix:f,attributes:i})};rh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,oLe),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=Pse(c,u,a,a),new Bt({id:t,geometry:new U9,modelMatrix:a,attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r)}})};rh.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Mi.prototype._isHidden.call(this,e,t)};rh.prototype._getIsClosed=function(e){return!1};rh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};rh.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(it.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(it.MINIMUM_VALUE,i.dimensions)};rh.DynamicGeometryUpdater=nI;function nI(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(nI.prototype=Object.create(Oi.prototype),nI.prototype.constructor=nI);nI.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,DUt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Oi.prototype._isHidden.call(this,e,t,n)};nI.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 OUt=new h,MUt=new h,NUt=new h,LUt=new h,FUt=new $,BUt=new $,kUt=new M;function Pse(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,NUt),a=h.clone(h.UNIT_Z,MUt);P.equalsEpsilon(Math.abs(h.dot(a,r)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,OUt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=FUt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,LUt),d=$.multiplyByScale(u,f,BUt),p=M.fromRotationTranslation(d,s,kUt);return M.multiplyTransformation(n,p,i)}rh.createPrimitiveMatrix=Pse;var z9=rh;var UUt=new h,zUt=new et,VUt=new U,jUt=new U,HUt=new h,GUt=new h,WUt=new h,yM=new h,qUt=new h,YUt=new h,sLe=new Le,XUt=new $,KUt=new $,$Ut=new h;function JUt(e,t,n,i,r,o,s,a,c){let u=e.positions,f=hi.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=XUt;if(i!==0){let _=Le.fromAxisAngle(s,i,sLe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,sLe);let C=$.fromQuaternion(_,KUt);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=jUt;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,UUt),D=o(w,VUt);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 Cn;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 KT(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=ti.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ti.computeHierarchyPackedLength(n,U):1)+2}KT.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 KT(t)};KT.pack=function(e,t,n){return n=n??0,n=ti.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=ti.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var ZUt=ee.clone(ee.UNIT_SPHERE),QUt=new Be,ezt={polygonHierarchy:{}};KT.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,ZUt);t+=ee.packedLength;let o=Be.unpack(e,t,QUt);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ti.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new KT(ezt)),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};KT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Br(s,h.equalsEpsilon,!0),s.length<3)return;let a=HUt,c=GUt,u=WUt,f=qUt,d=YUt;if(!Ly.computeProjectTo2DArguments(s,yM,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(yM,h.ZERO,P.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(yM,$Ut);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=Ly.createProjectPointsTo2DFunction(yM,f,d),m=Ly.createProjectPointTo2DFunction(yM,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ti.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ti.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ti.computeBoundingRectangle(a,m,s,i,zUt),S=[];for(let O=0;O<b.length;O++){let L=new Bt({geometry:JUt(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=qn.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 V9=KT;var aLe=[],j9=[];function tzt(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,aLe);hi.computeWindingOrder2D(s)===aa.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===fn.GEODESIC)for(u=0;u<f;u++)m+=ti.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===fn.RHUMB)for(u=0;u<f;u++)m+=ti.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===fn.GEODESIC?y=ti.subdivideLine(t[u],t[(u+1)%f],n,j9):r===fn.RHUMB&&(y=ti.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,j9));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 Cn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function nzt(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,aLe);hi.computeWindingOrder2D(s)===aa.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===fn.GEODESIC)for(u=0;u<f;u++)A+=ti.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===fn.RHUMB)for(u=0;u<f;u++)A+=ti.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===fn.GEODESIC?b=ti.subdivideLine(t[u],t[(u+1)%f],n,j9):r===fn.RHUMB&&(b=ti.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,j9));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 Cn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function $T(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??fn.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=ti.computeHierarchyPackedLength(t,h)+ee.packedLength+8}$T.pack=function(e,t,n){return n=n??0,n=ti.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 izt=ee.clone(ee.UNIT_SPHERE),rzt={polygonHierarchy:{}};$T.unpack=function(e,t,n){t=t??0;let i=ti.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,izt);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 $T(rzt)),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};$T.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 $T(t)};$T.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ti.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=nzt(t,s[m],u,r,o),a.geometry=ti.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===_n.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===_n.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=tzt(t,s[m],u,r,o),a.geometry.attributes.position.values=hi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===_n.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=qn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new wt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var H9=$T;var cLe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",lLe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",uLe=new z,fLe=h.ZERO,dLe=new h,hLe=new ie,ozt=[],szt=new U;function azt(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 Hf(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new azt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Hf.prototype=Object.create(si.prototype),Hf.prototype.constructor=Hf);Hf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,uLe)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,fLe,dLe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new V9(i):o=new ng(i),new Bt({id:t,geometry:o,attributes:r})};Hf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,uLe),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:ni.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,fLe,dLe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new qh(i):a=new H9(i),new Bt({id:t,geometry:a,attributes:s})};Hf.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,ozt),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,szt);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)};Hf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Mi.prototype._isHidden.call(this,e,t)};Hf.prototype._isOnTerrain=function(e,t){let n=si.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(it.MINIMUM_VALUE):!0);return n&&!r};Hf.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)};Hf.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(it.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,it.MINIMUM_VALUE,!1);o=si.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,yt(cLe)),s!==We.NONE&&u&&(o=void 0,yt(lLe))):(l(a)&&!l(o)&&(o=0),f=si.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,it.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,it.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,it.MINIMUM_VALUE,fn.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,it.MINIMUM_VALUE),a=si.getGeometryExtrudedHeight(a,c),a===si.CLAMP_TO_GROUND){let d=ng.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,hLe);a=Ni.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};Hf.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)};Hf.DynamicGeometryUpdater=iI;function iI(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(iI.prototype=Object.create(Oi.prototype),iI.prototype.constructor=iI);iI.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Oi.prototype._isHidden.call(this,e,t,n)};iI.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=si.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,yt(cLe)),o!==We.NONE&&c&&(r=void 0,yt(lLe))):(l(a)&&!l(r)&&(r=0),u=si.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,fn.GEODESIC),a=si.getGeometryExtrudedHeight(a,s),a===si.CLAMP_TO_GROUND){let f=ng.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,hLe);a=Ni.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var G9=Hf;function czt(e,t,n,i){let r=new Cn;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=hi.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:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=qn.computeNormal(E)),i.tangent||i.bitangent){try{E=qn.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 bM(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??hr.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}bM.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 mLe=ee.clone(ee.UNIT_SPHERE),pLe=new Be,AM={polylinePositions:void 0,shapePositions:void 0,ellipsoid:mLe,vertexFormat:pLe,cornerType:void 0,granularity:void 0};bM.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,mLe);t+=ee.packedLength;let c=Be.unpack(e,t,pLe);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):(AM.polylinePositions=o,AM.shapePositions=s,AM.cornerType=u,AM.granularity=f,new bM(AM))};var lzt=new et;bM.createGeometry=function(e){let t=e._positions,n=Br(t,h.equalsEpsilon),i=e._shape;if(i=m0.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;hi.computeWindingOrder2D(i)===aa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,lzt),o=m0.computePositions(n,i,r,e,!0);return czt(o,i,r,e._vertexFormat)};var W9=bM;function uzt(e,t){let n=new Cn;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:ue.fromVertices(e),primitiveType:Oe.LINES})}function TM(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??hr.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}TM.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 gLe=ee.clone(ee.UNIT_SPHERE),xM={polylinePositions:void 0,shapePositions:void 0,ellipsoid:gLe,height:void 0,cornerType:void 0,granularity:void 0};TM.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,gLe);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):(xM.polylinePositions=o,xM.shapePositions=s,xM.cornerType=c,xM.granularity=u,new TM(xM))};var fzt=new et;TM.createGeometry=function(e){let t=e._positions,n=Br(t,h.equalsEpsilon),i=e._shape;if(i=m0.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;hi.computeWindingOrder2D(i)===aa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,fzt),o=m0.computePositions(n,i,r,e,!1);return uzt(o,i)};var q9=TM;var _Le=new z;function dzt(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 y0(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new dzt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(y0.prototype=Object.create(Mi.prototype),y0.prototype.constructor=y0);y0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ni.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,_Le)),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 W9(this._options),attributes:i})};y0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,_Le),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new q9(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r)}})};y0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Mi.prototype._isHidden.call(this,e,t)};y0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};y0.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(it.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(it.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(it.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(it.MINIMUM_VALUE):void 0};y0.DynamicGeometryUpdater=rI;function rI(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(rI.prototype=Object.create(Oi.prototype),rI.prototype.constructor=rI);rI.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Oi.prototype._isHidden.call(this,e,t,n)};rI.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 Y9=y0;var Dse=new h,bLe=new h,xLe=new h,TLe=new h,ELe=new ie,hzt=new U,mzt=new ue,pzt=new ue;function CLe(e,t){let n=new wt({attributes:new Cn,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 gzt(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=TLe,f=xLe,d=bLe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,Dse),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 CLe(t,{positions:e,normals:o,tangents:s,bitangents:a})}var Rse=new h,vLe=new h;function _zt(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=TLe,p=xLe,g=bLe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,Dse),A=h.fromArray(e,(m+6)%i,Rse);if(f){let b=h.fromArray(e,(m+3)%i,vLe);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 CLe(t,{positions:e,normals:r,tangents:o,bitangents:s})}function SLe(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=Dse,b=hzt,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)za.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&&(za.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&&(za.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=gzt(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 oI(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 sI(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 Ose=new Be;function yzt(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,Ose);Pe.normal=!0,e._vertexFormat=Pe}let d=SLe(e,t);n&&(e._vertexFormat=r);let p=hi.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=hi.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===_n.TOP?qe=qe.fill(1,0,Pe/2):(I=i===_n.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===_n.TOP;R&&!J&&(I=i===_n.ALL?1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OAT,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,Rse),qe=h.fromArray(G,Ye*3,vLe);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=qn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var Azt=[new h,new h,new h,new h],wLe=new he,bzt=new he;function Mse(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=za.computeOptions(e,t,n,0,ELe,wLe),s=o.height,a=o.width,c=Azt;return za.computePosition(o,i,!1,0,0,c[0]),za.computePosition(o,i,!1,0,a-1,c[1]),za.computePosition(o,i,!1,s-1,0,c[2]),za.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function A0(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}A0.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;A0.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 ILe=new ie,PLe=ee.clone(ee.UNIT_SPHERE),JA={rectangle:ILe,ellipsoid:PLe,vertexFormat:Ose,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=ie.unpack(e,t,ILe);t+=ie.packedLength;let r=ee.unpack(e,t,PLe);t+=ee.packedLength;let o=Be.unpack(e,t,Ose);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):(JA.granularity=s,JA.height=a,JA.rotation=c,JA.stRotation=u,JA.extrudedHeight=f,JA.shadowVolume=d,JA.offsetAttribute=p===-1?void 0:p,new A0(JA))};A0.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 Mse(n,i,o,r,t)};var xzt=new $,yLe=new Le,Tzt=new he;A0.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=za.computeOptions(t,e._granularity,i,r,ELe,wLe,bzt),a=xzt;if(r!==0||i!==0){let g=ie.center(t,Tzt),m=n.geodeticSurfaceNormalCartographic(g,Rse);Le.fromAxisAngle(m,-r,yLe),$.fromQuaternion(yLe,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=yzt(e,s);let g=ue.fromRectangle3D(t,n,c,pzt),m=ue.fromRectangle3D(t,n,u,mzt);p=ue.union(g,m)}else{if(d=SLe(e,s),d.attributes.position.values=hi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===_n.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ue.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})};A0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new A0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var ALe=new ie,Ezt=[new U,new U,new U],Czt=new $i,vzt=new he;function Szt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,ALe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=Mse(t,n,r,i,ALe),s=Ezt;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,Czt),u=ie.center(a,vzt);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(A0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=Mse(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Szt(this)),this._textureCoordinateRotationPoints}}});var aI=A0;var DLe=new z,RLe=h.ZERO,OLe=new h,MLe=new ie,wzt=new ie,Izt=new he;function Pzt(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 Am(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new Pzt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Am.prototype=Object.create(si.prototype),Am.prototype.constructor=Am);Am.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ni.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,DLe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,RLe,OLe))),new Bt({id:t,geometry:new aI(this._options),attributes:i})};Am.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,DLe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=vr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,RLe,OLe))),new Bt({id:t,geometry:new Ev(this._options),attributes:o})};Am.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,wzt);if(!l(n))return;let i=ie.center(n,Izt);return he.toCartesian(i,ee.default,t)};Am.prototype._isHidden=function(e,t){return!l(t.coordinates)||Mi.prototype._isHidden.call(this,e,t)};Am.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)};Am.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,it.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(it.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,it.MINIMUM_VALUE),a.offsetAttribute=si.computeGeometryOffsetAttribute(i,r,o,s),a.height=si.getGeometryHeight(i,r),o=si.getGeometryExtrudedHeight(o,s),o===si.CLAMP_TO_GROUND&&(o=Ni.getMinimumMaximumHeights(aI.computeRectangle(a,MLe)).minimumTerrainHeight),a.extrudedHeight=o};Am.DynamicGeometryUpdater=cI;function cI(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(cI.prototype=Object.create(Oi.prototype),cI.prototype.constructor=cI);cI.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Oi.prototype._isHidden.call(this,e,t,n)};cI.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=si.computeGeometryOffsetAttribute(r,o,s,a),i.height=si.getGeometryHeight(r,o),s=si.getGeometryExtrudedHeight(s,a),s===si.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(aI.computeRectangle(i,MLe)).minimumTerrainHeight),i.extrudedHeight=s};var X9=Am;var NLe={};function Dzt(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var Rzt=new he,Ozt=new he;function Mzt(e,t,n,i){t=Br(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,Rzt);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,Ozt);s&&(x.height=n[A]),m=m&&x.height===0,Dzt(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 Nzt=new Array(2),Lzt=new Array(2),Fzt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};NLe.computePositions=function(e,t,n,i,r,o){let s=Mzt(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=Fzt;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=ur.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=Nzt,A=Lzt;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=ur.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(ur.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(ur.generateArc(p)),p.height=i,f=new Float64Array(ur.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var lI=NLe;var Nse=new h,K9=new h,Bzt=new h,LLe=new h,kzt=new h,Uzt=new h,zzt=new h;function JT(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}JT.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 FLe=ee.clone(ee.UNIT_SPHERE),BLe=new Be,EM={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:FLe,vertexFormat:BLe,granularity:void 0};JT.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,FLe);t+=ee.packedLength;let u=Be.unpack(e,t,BLe);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):(EM.positions=o,EM.minimumHeights=s,EM.maximumHeights=a,EM.granularity=f,new JT(EM))};JT.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 JT(c)};JT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=lI.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=zzt,R=Uzt,O=kzt,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,Nse),k=h.fromArray(c,B,K9);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,LLe),q=h.subtract(j,s.geodeticSurfaceNormal(j,K9),K9);if(_+1<d&&(G=h.fromArray(u,B+3,LLe)),L){let Q=h.subtract(G,j,Bzt),W=h.subtract(q,j,Nse);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 Cn;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,Nse),G=h.fromArray(g,j*3,K9);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:ue.fromVertices(g)})};var $9=JT;var kLe=new h,ULe=new h;function ZT(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}ZT.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 zLe=ee.clone(ee.UNIT_SPHERE),CM={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:zLe,granularity:void 0};ZT.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,zLe);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):(CM.positions=o,CM.minimumHeights=s,CM.maximumHeights=a,CM.granularity=u,new ZT(CM))};ZT.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 ZT(c)};ZT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=lI.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,kLe),E=h.fromArray(a,x,ULe);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 Cn({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,kLe),v=h.fromArray(d,T*3,ULe);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:ue.fromVertices(d)})};var J9=ZT;var VLe=new z;function Vzt(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 bm(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new Vzt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(bm.prototype=Object.create(Mi.prototype),bm.prototype.constructor=bm);bm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ni.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,VLe)),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 $9(this._options),attributes:i})};bm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,VLe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new J9(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ni.fromDistanceDisplayCondition(r)}})};bm.prototype._isHidden=function(e,t){return!l(t.positions)||Mi.prototype._isHidden.call(this,e,t)};bm.prototype._getIsClosed=function(e){return!1};bm.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)};bm.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(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(r)?r.getValue(it.MINIMUM_VALUE):void 0};bm.DynamicGeometryUpdater=uI;function uI(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(uI.prototype=Object.create(Oi.prototype),uI.prototype.constructor=uI);uI.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Oi.prototype._isHidden.call(this,e,t,n)};uI.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 Z9=bm;var QT=[Q5,p9,f9,M9,N9,z9,G9,Y9,X9,Z9];function eE(e,t){this.entity=e,this.scene=t;let n=new Array(QT.length),i=new be,r=new Qo;for(let o=0;o<n.length;o++){let s=new QT[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(eE.prototype._onEntityPropertyChanged,this)}eE.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)};eE.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};eE.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};eE.registerUpdater=function(e){QT.includes(e)||QT.push(e)};eE.unregisterUpdater=function(e){if(QT.includes(e)){let t=QT.indexOf(e);QT.splice(t,1)}};var fI=eE;var jLe=new z,jzt=new Gt,Hzt=new Gt,Gzt=h.ZERO,Wzt=new h;function xm(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(xm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}xm.prototype.onMaterialChanged=function(){this.invalidated=!0};xm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};xm.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)}))}};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};xm.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=Ro.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=Ro.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,jLe);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,jLe);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=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,Hzt,jzt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,Gzt,Wzt);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};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=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=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.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),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function dI(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}dI.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 xm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function HLe(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}dI.prototype.remove=function(e){HLe(this._solidItems,e)||HLe(this._translucentItems,e)};function GLe(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 Q9(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}dI.prototype.update=function(e){let t=Q9(this,this._solidItems,e,!0);t=Q9(this,this._translucentItems,e,t)&&t;let n=GLe(this,this._solidItems,e),i=GLe(this,this._translucentItems,e);return(n||i)&&(t=Q9(this,this._solidItems,e,t)&&t,t=Q9(this,this._translucentItems,e,t)&&t),t};function WLe(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}dI.prototype.getBoundingSphere=function(e,t){let n=WLe(this._solidItems,e,t);return n===Pt.FAILED?WLe(this._translucentItems,e,t):n};function qLe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}dI.prototype.removeAllPrimitives=function(){qLe(this._solidItems),qLe(this._translucentItems)};var Tm=dI;var qzt=new Gt,Yzt=new Gt,Xzt=h.ZERO,Kzt=new h;function Em(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(Em.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt}Em.prototype.onMaterialChanged=function(){this.invalidated=!0};Em.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};Em.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};Em.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 $zt=new z;Em.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=Ro.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=Ro.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=Ro.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Ro.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,$zt);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=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,Yzt,qzt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,Xzt,Kzt);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};Em.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=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Em.prototype.contains=function(e){return this.updaters.contains(e.id)};Em.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)};Em.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 hI(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}hI.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 Em(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};hI.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}}};hI.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};hI.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};hI.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=hI;function e7(e,t,n=0,i=e.length-1,r=Jzt){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));e7(e,t,g,m,r)}let o=e[t],s=n,a=i;for(vM(e,n,t),r(e[i],o)>0&&vM(e,n,i);s<a;){for(vM(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?vM(e,n,a):(a++,vM(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function vM(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Jzt(e,t){return e<t?-1:e>t?1:0}var IM=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(!n7(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;n7(t,c)&&(n.leaf?i.push(a):Fse(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!n7(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(n7(t,s)){if(n.leaf||Fse(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=pI([]),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=Zzt(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&Fse(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=pI(t.slice(n,i+1)),mI(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=pI([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));YLe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);YLe(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 mI(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=Lse(u),d=tVt(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),wM(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=pI(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,mI(i,this.toBBox),mI(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=pI([t,n]),this.data.height=t.height+1,this.data.leaf=!1,mI(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=SM(t,0,a,this.toBBox),u=SM(t,a,i,this.toBBox),f=nVt(c,u),d=Lse(c)+Lse(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:Qzt,o=t.leaf?this.compareMinY:eVt,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=SM(t,0,n,o),a=SM(t,i-n,i,o),c=t7(s)+t7(a);for(let u=n;u<i-n;u++){let f=t.children[u];wM(s,t.leaf?o(f):f),c+=t7(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];wM(a,t.leaf?o(f):f),c+=t7(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)wM(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():mI(t[n],this.toBBox)}};function Zzt(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 mI(e,t){SM(e,0,e.children.length,t,e)}function SM(e,t,n,i,r){r||(r=pI(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];wM(r,e.leaf?i(s):s)}return r}function wM(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 Qzt(e,t){return e.minX-t.minX}function eVt(e,t){return e.minY-t.minY}function Lse(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function t7(e){return e.maxX-e.minX+(e.maxY-e.minY)}function tVt(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 nVt(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 Fse(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function n7(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function pI(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function YLe(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;e7(e,s,t,n,r),o.push(t,s,s,n)}}function i7(){this._tree=new IM}function tE(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}tE.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};i7.prototype.insert=function(e,t){let n=tE.fromRectangleAndId(e,t,new tE);this._tree.insert(n)};function iVt(e,t){return e.id===t.id}var rVt=new tE;i7.prototype.remove=function(e,t){let n=tE.fromRectangleAndId(e,t,rVt);this._tree.remove(n,iVt)};var oVt=new tE;i7.prototype.collides=function(e){let t=tE.fromRectangleAndId("",e,oVt);return this._tree.collides(t)};var gI=i7;var sVt=new z,aVt=new Gt,cVt=new Gt;function m_(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 gI}m_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};m_.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)}))}};m_.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};m_.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 Lu({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,sVt);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=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,cVt,aVt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,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=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=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.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.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};m_.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 _I(e,t){this._batches=[],this._primitives=e,this._classificationType=t}_I.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 m_(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};_I.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};_I.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};_I.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};_I.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var PM=_I;var lVt=new Gt,uVt=new Gt;function b0(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 gI}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=Ro.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Lu({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=Ro.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=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,uVt,lVt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.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=Dn.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 yI(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}yI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Md.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)};yI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};yI.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};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 r7=yI;var fVt=new z,dVt=new Gt,hVt=new Gt,mVt=h.ZERO,pVt=new h;function p_(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}p_.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)}))}};p_.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};p_.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,fVt);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=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,hVt,dVt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,mVt,pVt);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};p_.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=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};p_.prototype.contains=function(e){return this.updaters.contains(e.id)};p_.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)};p_.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,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new zt,this._translucentBatches=new zt}AI.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 p_(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 p_(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};AI.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};AI.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};AI.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};AI.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 DM=AI;var gVt=[];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=Pn.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=oo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new DM(n,e,s,!1),this._outlineBatches[r+s]=new DM(n,e,s,!0),this._closedColorBatches[s]=new Tm(n,An,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Tm(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 Tm(n,An,void 0,!1,s,!0),this._openColorBatches[r+s]=new Tm(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=ei.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new r7(i,s,Sr)),c[s]=new PM(i,s);else for(s=0;s<a;++s)c[s]=new PM(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Kw(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,gVt)}Ku.registerUpdater=function(e){fI.registerUpdater(e)};Ku.unregisterUpdater=function(e){fI.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 fI(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 _Vt=[],yVt=new ue;Ku.prototype.getBoundingSphere=function(e,t){let n=_Vt,i=yVt,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]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.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(),le(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=Pn.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 o7=Ku;var AVt=1,bVt="30px sans-serif",xVt=So.FILL,TVt=z.WHITE,EVt=z.BLACK,CVt=1,vVt=!1,SVt=new z(.165,.165,.165,.8),wVt=new U(7,5),IVt=U.ZERO,PVt=h.ZERO,DVt=We.NONE,RVt=Wi.CENTER,OVt=Wn.CENTER,MVt=new h,NVt=new z,LVt=new z,FVt=new z,BVt=new U,kVt=new h,UVt=new U,zVt=new qt,VVt=new qt,jVt=new qt,HVt=new Gt;function XLe(e){this.entity=e,this.label=void 0,this.index=void 0}function ZA(e,t){t.collectionChanged.addEventListener(ZA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}ZA.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,MVt),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){Bse(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,DVt);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,AVt),u.font=X.getValueOrDefault(a._font,e,bVt),u.style=X.getValueOrDefault(a._style,e,xVt),u.fillColor=X.getValueOrDefault(a._fillColor,e,TVt,NVt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,EVt,LVt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,CVt),u.showBackground=X.getValueOrDefault(a._showBackground,e,vVt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,SVt,FVt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,wVt,BVt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,IVt,UVt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,PVt,kVt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,RVt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,OVt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,zVt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,VVt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,jVt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,HVt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};ZA.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=h0(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=BA(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};ZA.prototype.isDestroyed=function(){return!1};ZA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ZA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};ZA.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 XLe(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 XLe(o)):(Bse(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Bse(s.get(o.id),o,a),s.remove(o.id)};function Bse(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var s7=ZA;var GVt=1,WVt=!0,qVt=0,YVt=!0,XVt=!0,KVt=Pn.ENABLED,$Vt=We.NONE,JVt=z.RED,ZVt=0,QVt=z.WHITE,e4t=Dl.HIGHLIGHT,t4t=.5,n4t=new U(1,1),KLe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},i4t=new M,r4t=new M,$Le=new z,JLe=new Array(4),o4t=new h;function QA(e,t){t.collectionChanged.addEventListener(QA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}function s4t(e,t){return e instanceof mi?e.valueOf():X.getValueOrUndefined(e,t)}function a4t(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function ZLe(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function c4t(e,t){if(!l(t))return M.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function l4t(e,t,n,i,r){let o=e._primitives,s=e._modelHash,a=s[t.id],c=()=>!e.isDestroyed()&&s[t.id]===a;try{let u=await Td.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(!c()){u.destroy();return}u.id=t,o.add(u),a.modelPrimitive=u,u.errorEvent.addEventListener(f=>{c()&&(console.log(f),f.name!=="TextureError"&&u.incrementallyLoadTextures&&(a.loadFailed=!0))})}catch(u){if(!c())return;console.log(u),a.loadFailed=!0}}QA.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,p;if(f&&(d=s.computeModelMatrix(e,i4t),p=s4t(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!a4t(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(ZLe(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...KLe}},n[s.id]=u,ZLe(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,YVt),A=X.getValueOrDefault(a._environmentMapOptions,e,KLe,u.environmentMapOptionsScratch);l4t(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,GVt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,WVt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,qVt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=c4t(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,KVt),g.heightReference=X.getValueOrDefault(a._heightReference,e,$Vt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,JVt,$Le),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,ZVt),g.color=X.getValueOrDefault(a._color,e,QVt,$Le),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,e4t),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,t4t),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,XVt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,n4t);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,JLe,0),m=h.unpack(JLe,0,o4t)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:gf.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=M.fromTranslationRotationScale(I,r4t);R.matrix=M.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};QA.prototype.isDestroyed=function(){return!1};QA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(QA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)kse(this,e[i],t,n);return le(this)};var RM=new h,u4t=new he;QA.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;RM.x=a[12],RM.y=a[13],RM.z=a[14];let c=o.cartesianToCartographic(RM,u4t),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=h0(r,n,RM,[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):ls(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};QA.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)?(f4t(o,a),s.set(o.id,o)):(kse(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],kse(this,o,a,c),s.remove(o.id)};function kse(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function f4t(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var a7=QA;var QLe=new $,eFe=new $,tFe=new $,d4t=new h,nFe=new h,h4t=new h,m4t=new h,c7=new Le,l7=new M,u7=new $;function MM(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,c7)&&(Le.conjugate(c7,c7),$.fromQuaternion(c7,u7),$.multiplyByVector(u7,r,r));else if(l(Vse(e,i.position,l7)))M.inverse(l7,l7),M.getRotation(l7,u7),$.multiplyByVector(u7,r,r);else return;return r}}function Vse(e,t,n){let i=t.getValue(e,d4t);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,nFe);if(l(o)&&!h.equalsEpsilon(i,o,P.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,QLe),a=At.computeFixedToIcrfMatrix(r,eFe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,tFe),s=$.transpose(c,QLe),a=At.computeTemeToPseudoFixedMatrix(r,eFe),$.transpose(a,a)):c=$.transpose(s,tFe);let u=h4t;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,m4t);if(!h.equalsEpsilon(f,h.ZERO,P.EPSILON16)){let d=h.cross(f,u,nFe);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 iFe=60,lFe=1,uFe=new vn,Use=new vn,zse=new vn;function rFe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var f7=new h;function p4t(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof oo&&(u=o,f=u.position,o=Xi.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,f7),g=MM(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,f7),l(g)&&l(m)&&(g=MM(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,f7),l(g)&&l(m)&&(g=MM(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,f7),l(g)&&l(m)&&(g=MM(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function g4t(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 _4t(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 y4t(e,t,n,i,r,o,s,a){zse.start=t,zse.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,zse,uFe).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 A4t(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function b4t(e,t,n,i,r,o,s,a){Use.start=t,Use.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,Use,uFe).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=fFe(d.data,m,y,i,r,o,c,a)}}return c}function fFe(e,t,n,i,r,o,s,a){for(;e instanceof _A;)e=e.resolvedProperty;if(e instanceof Ic){let c=e._property._times;s=p4t(e,t,n,c,i,r,o,s,a)}else e instanceof e9?s=g4t(e,t,n,i,r,o,s,a):e instanceof wc?s=b4t(e,t,n,i,r,o,s,a):e instanceof YA?s=y4t(e,t,n,i,r,o,s,a):e instanceof Vu||e instanceof Zg&&X.isConstant(e)?s=A4t(e,t,n,i,r,o,s,a):s=_4t(e,t,n,i,r,o,s,a);return s}function jse(e,t,n,i,r,o,s){l(s)||(s=[]);let a=fFe(e,t,n,i,r,o,0,s);return s.length=a,s}var oFe=new $,sFe=new Le,aFe=new $,OM=new vn,d7=new vn,nE=new vn;function x4t(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 cFe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Br(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=jse(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=Ro.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,lFe),d++}return d}function NM(e,t){this._unusedIndexes=[],this._polylineCollection=new Ap,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}NM.prototype.update=function(e){let t=this._referenceFrame;if(t===Xi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,oFe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,oFe)),M.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof oo){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,sFe))&&($.fromQuaternion(sFe,aFe),M.fromRotationTranslation(aFe,n,this._polylineCollection.modelMatrix)):Vse(e,t.position,this._polylineCollection.modelMatrix)}};NM.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,iFe),d=jse(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=Ro.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===d_.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:iFe,y=g.intervals,A=0;if(l(y)){OM.start=o,OM.stop=s,OM.isStartIncluded=!0,OM.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!vn.intersect(x,OM,d7))continue;let T=d7.start,E=d7.stop;if(K.greaterThanOrEquals(T,E))continue;let v=x4t(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(_,d7,nE)&&(K.greaterThan(nE.start,T)&&K.lessThan(nE.start,E)&&S.push(K.clone(nE.start)),K.greaterThan(nE.stop,T)&&K.lessThan(nE.stop,E)&&S.push(K.clone(nE.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=cFe(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=cFe(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,lFe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};NM.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};NM.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function x0(e,t){t.collectionChanged.addEventListener(x0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}x0.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=Xi.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Xi.FIXED,p=d.toString()):m==="INERTIAL"?(d=Xi.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 NM(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};x0.prototype.isDestroyed=function(){return!1};x0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(x0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};x0.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 rFe(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 rFe(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))};x0._subSample=jse;x0._computeVvlhTransform=Vse;x0._transformToEntityFrame=MM;var h7=x0;var dFe=z.WHITE,hFe=z.BLACK,mFe=0,pFe=1,gFe=0,_Fe=Wo.NONE,yFe=new z,T4t=new h,AFe=new z,bFe=new qt,xFe=new qt,TFe=new Gt;function EFe(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 eb(e,t){t.collectionChanged.addEventListener(eb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}eb.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,T4t),d=l(p)),!d){LM(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(LM(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)&&(LM(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,bFe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,xFe),c.color=X.getValueOrDefault(a._color,e,dFe,yFe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,hFe,AFe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,mFe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,pFe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,TFe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,gFe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,_Fe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,bFe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,xFe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,TFe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,gFe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,_Fe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,dFe,yFe),A=X.getValueOrDefault(a._outlineColor,e,hFe,AFe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,mFe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,pFe)));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,cv(T,E,v,b,x))}m&&u._updateClamping()}}return!0};eb.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=h0(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=BA(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};eb.prototype.isDestroyed=function(){return!1};eb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(eb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};eb.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 EFe(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 EFe(o)):(LM(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],LM(s.get(o.id),o,a),s.remove(o.id)};function LM(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 m7=eb;var E4t=new mi(0),p7={},CFe=new z,C4t=new Kt(z.WHITE),v4t=new mi(!0),S4t=new mi(Pn.DISABLED),w4t=new mi(new Gt),I4t=new mi(ei.BOTH);function P4t(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function D4t(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function vm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(vm.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 P4t,this._groundGeometryOptions=new D4t,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=oo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(vm.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}}});vm.prototype.isOutlineVisible=function(e){return!1};vm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};vm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ni.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,CFe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new nS(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,CFe)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Bt({id:t,geometry:new Hy(this._geometryOptions),attributes:s}))};vm.prototype.createOutlineGeometryInstance=function(e){};vm.prototype.isDestroyed=function(){return!1};vm.prototype.destroy=function(){this._entitySubscription(),le(this)};vm.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(it.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??C4t,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??v4t,this._shadowsProperty=r.shadows??S4t,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??w4t,this._classificationTypeProperty=r.classificationType??I4t,this._fillEnabled=!0,this._zIndex=a??E4t;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(it.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=$s.VERTEX_FORMAT:A=Cc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(it.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(it.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(it.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(it.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)}};vm.prototype.createDynamicUpdater=function(e,t){return new FM(e,t,this)};var bI={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function FM(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 vFe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=p7[n];!l(i)||i.isDestroyed()?(i=new Ap,p7[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}FM.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,fn.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 $s;else{let g=Ro.getValue(e,d,this._material);p=new Cc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Np({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=vFe(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=fn.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==fn.NONE&&l(u)&&(bI.ellipsoid=f,bI.positions=o,bI.granularity=X.getValueOrUndefined(i._granularity,e),bI.height=ur.extractHeights(o,f),c===fn.GEODESIC?o=ur.generateCartesianArc(bI):o=ur.generateCartesianRhumbArc(bI)),a.show=!0,a.positions=o.slice(),a.material=Ro.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};FM.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 ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=vFe(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};FM.prototype.isDestroyed=function(){return!1};FM.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=p7[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete p7[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var g7=vm;var R4t=new z,O4t=new Gt,M4t=new Gt;function Sm(e,t,n,i,r){let o;n instanceof Kt?o=$s:o=Cc,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(Sm.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt,this.zIndex=i,this._asynchronous=r}Sm.prototype.onMaterialChanged=function(){this.invalidated=!0};Sm.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)};Sm.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};Sm.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};Sm.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 Np({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===Cc&&(this.material=Ro.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===Cc&&(this.material=Ro.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,R4t);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=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,M4t,O4t);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ni.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Sm.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=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Sm.prototype.contains=function(e){return this.updaters.contains(e.id)};Sm.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)};Sm.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 xI(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}xI.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 Sm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};xI.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}}};xI.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};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 _7=xI;var N4t=[];function SFe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function wFe(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*Pn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function T0(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=Pn.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 Tm(n,$s,void 0,!1,r),this._materialBatches[r]=new Cm(n,Cc,void 0,!1,r),this._colorBatches[r+o]=new Tm(n,$s,$s,!1,r),this._materialBatches[r+o]=new Cm(n,Cc,$s,!1,r),this._colorBatches[r+o*2]=new Tm(n,$s,Cc,!1,r),this._materialBatches[r+o*2]=new Cm(n,Cc,Cc,!1,r);this._dynamicBatch=new Kw(n,i);let s=ei.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new _7(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(T0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,N4t)}T0.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?(SFe(this,f),wFe(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),SFe(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 g7(c,this._scene),this._updaters.set(u,f),wFe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(T0._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 L4t=[],F4t=new ue;T0.prototype.getBoundingSphere=function(e,t){let n=L4t,i=F4t,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]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};T0.prototype.isDestroyed=function(){return!1};T0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(T0.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(),le(this)};T0._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)};T0.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 y7=T0;function $u(e){Lu.initializeTerrainHeights(),Np.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Qo,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??$u.defaultVisualizersCallback;let i=!1,r=new Hl,o=new Hl;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 d9;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 TI=[];$u.registerVisualizer=function(e){TI.includes(e)||TI.push(e)};$u.unregisterVisualizer=function(e){if(TI.includes(e)){let t=TI.indexOf(e);TI.splice(t,1)}};$u.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new Z5(t,i),new o7(e,i,n._primitives,n._groundPrimitives),new s7(t,i),new a7(e,i),new t9(e,i),new m7(t,i),new h7(e,i),new y7(e,i,n._primitives,n._groundPrimitives),...TI.map(r=>new r(e,i))]};Object.defineProperties($u.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}}});$u.prototype.isDestroyed=function(){return!1};$u.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)),le(this)};$u.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};$u.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 B4t=[],k4t=new ue;$u.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=B4t,a=k4t,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]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};$u.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Hl),s=r.add(new aG);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};$u.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};$u.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 A7=$u;var IFe=new $,PFe=new $,DFe=new $,U4t=new M,b7=new h,RFe=new h,Hse=new h,Gse=new h,OFe=new h,MFe=new h,z4t=new Le,V4t=new h,j4t=new $,EI=new K,H4t=1.25;function G4t(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,EI);let I=r.getValue(EI,b7);if(l(I)||(K.addSeconds(c,-.001,EI),I=r.getValue(EI,b7),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,IFe),O=At.computeFixedToIcrfMatrix(EI,PFe),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,DFe),R=$.transpose(L,IFe),O=At.computeTemeToPseudoFixedMatrix(EI,PFe),$.transpose(O,O)):L=$.transpose(R,DFe);let _=$.multiplyByVector(R,d,OFe),C=$.multiplyByVector(O,I,MFe);h.subtract(_,C,Gse);let w=h.magnitude(Gse)*1e3,D=P.GRAVITATIONALPARAMETER,N=-D/(w*w-2*D/h.magnitude(_));N<0||N>H4t*u.maximumRadius?(m=RFe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,Hse),y=h.cross(A,m,b7),h.magnitude(y)>P.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,Hse),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,P.EPSILON7)||(A=RFe,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,Hse),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,P.EPSILON7)||(m=h.cross(y,A,b7),$.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,Gse),x=h.clone(t.direction,OFe),T=h.clone(t.up,MFe));let E=U4t,v;l(s)&&(v=s.getValue(c,z4t));let S=o.getValue(c,V4t);if(a===dA.INERTIAL&&l(v))M.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===dA.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,j4t);M.fromRotationTranslation(I,d,E)}else a===dA.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 BM(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 XA(e.position,!0),this._offset3D=new h}Object.defineProperties(BM,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});BM.defaultOffset3D=new h(-14e3,3500,3500);var x7=new Eh,W4t=new h;BM.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)){x7.pitch=-P.PI_OVER_FOUR,x7.range=0;let b=a.getValue(e,W4t);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);x7.pitch*=x}p.viewBoundingSphere(t,x7),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(BM._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,G4t(this,p,g,m,a,c,u,s,e,i)};var T7=BM;var Wse=32,q4t="http://www.opengis.net/kml/2.2",Im="http://www.google.com/kml/ext/2.2",Y4t="http://www.w3.org/2000/xmlns/";function E7(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var X4t=/^data:image\/([^,;]+)/;E7.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(X4t);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 K4t(e,t){return function(n){e._files[t]=n}}E7.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(K4t(this,o))}return r};Object.defineProperties(E7.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function C7(e){this._time=e}C7.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};C7.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return rE(n)};C7.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function qse(){this._ids={},this._styles={},this._count=0}qse.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};qse.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 FFe(){this._ids={}}FFe.prototype.get=function(e){if(!l(e))return this.get(Jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Yse(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Yse._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(Y4t,"xmlns:gx",Im);let a=o.createElement("Document");s.appendChild(a),kFe(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?$4t(f,c.files):{kml:f,externalFiles:c.files}})}async function $4t(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");fR({workerURI:n,wasmURI:i});let r=new wS("application/vnd.google-earth.kmz"),o=new zR(r);await o.add("doc.kml",new wR(e));let s=Object.keys(t);return await BFe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function BFe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new ku(n[r])),BFe(e,t,n,i+1)}Yse._createState=function(e){let t=e.entities,n=new qse,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===it.MINIMUM_VALUE?o.stop===it.MAXIMUM_VALUE?o=new vn:K.addSeconds(o.stop,-10*s,o.start):o.stop===it.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new E7(e.modelCallback);return{kmlDoc:document.implementation.createDocument(q4t,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new FFe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new C7(r),sampleDuration:s,defaultAvailability:new Bs([o])}};function kFe(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=[],J4t(e,p,u,f),Z4t(e,p.polyline,u,f),LFe(e,p.rectangle,u,f,c),LFe(e,p.polygon,u,f,c),n8t(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,it.MINIMUM_VALUE)||g.appendChild(Tn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,it.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),kFe(e,b,A)}}}var Ju=new h,Zl=new he,wm=new K;function J4t(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){UFe(e,t,a,n,i);return}s.get(c,void 0,Ju);let u=Tn(r,"coordinates",iE(Ju,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(oE(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof zl?VFe(e,a):zFe(e,a);i.push(p)}function UFe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof wc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof hA,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 Zg?(x=x._value,T.appendChild(oE(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(oE(e,n.heightReference)):T.appendChild(oE(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,Ju);let I=Tn(o,"coordinates",iE(Ju,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof Ic)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Xi.FIXED,Ju),v.push(iE(Ju,s));else if(x instanceof Xd){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,Ju),v.push(iE(Ju,s))}else{let I=e.sampleDuration;b.start.clone(wm),b.isStartIncluded||K.addSeconds(wm,I,wm);let R=b.stop;for(;K.lessThan(wm,R);)x.getValue(wm,Ju),E.push(K.toIso8601(wm)),v.push(iE(Ju,s)),K.addSeconds(wm,I,wm);b.isStopIncluded&&K.equals(wm,R)&&(x.getValue(wm,Ju),E.push(K.toIso8601(wm)),v.push(iE(Ju,s)))}let S=o.createElementNS(Im,"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],Im);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(jFe(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(Im,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof zl?VFe(e,n):zFe(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)),Xse(e,x,T),r.push(T)}}}function zFe(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/Wse)),r}function VFe(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,Im)),p.appendChild(Tn(n,"y",g.y,Im)),p.appendChild(Tn(n,"w",g.width,Im)),p.appendChild(Tn(n,"h",g.height,Im))),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,Wse),g=i.get(t.height,Wse),m=i.get(t.horizontalOrigin,Wi.CENTER);m===Wi.CENTER?u.x-=p*.5:m===Wi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Wn.CENTER);y===Wn.TOP?u.y+=g:y===Wn.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 Z4t(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",iE(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(Tn(r,"drawOrder",m,Im)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(Tn(r,"width",A)),Xse(e,t.material,y),i.push(y)}function Q4t(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,Zl),c.push(`${P.toDegrees(Zl.longitude)},${P.toDegrees(Zl.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 NFe(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,Zl),s.push(`${P.toDegrees(Zl.longitude)},${P.toDegrees(Zl.latitude)},${i?Zl.height:n}`);let c=Tn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function e8t(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(NFe(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(NFe(e,p[m].positions,o,s)),a.push(y)}}return a}function LFe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof n0;if(a&&s.getMaterialType(t.material)==="Image"){t8t(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?Q4t(e,t,u):e8t(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(oE(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)),Xse(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 t8t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(oE(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",rE(d.color))),n.push(s)}function jFe(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 n8t(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){UFe(e,t,n,i,r);return}let u=jFe(e,n),f=o.createElement("altitudeMode");f.appendChild(oE(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,Ju),he.fromCartesian(Ju,s,Zl);let d=o.createElement("Location");d.appendChild(Tn(o,"longitude",P.toDegrees(Zl.longitude))),d.appendChild(Tn(o,"latitude",P.toDegrees(Zl.latitude))),d.appendChild(Tn(o,"altitude",Zl.height)),u.appendChild(d),i.push(u)}function Xse(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=rE(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=rE(o.color);break;case"PolylineOutline":s=rE(o.color),c=rE(o.outlineColor),u=o.outlineWidth,n.appendChild(Tn(i,"outerColor",c,Im)),n.appendChild(Tn(i,"outerWidth",u,Im));break;case"Stripe":s=rE(o.oddColor);break}l(s)&&(n.appendChild(Tn(i,"color",s)),n.appendChild(Tn(i,"colorMode","normal")))}function oE(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 iE(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Zl),i.push(`${P.toDegrees(Zl.longitude)},${P.toDegrees(Zl.latitude)},${Zl.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 rE(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 HFe=Yse;var ZFe;typeof DOMParser<"u"&&(ZFe=new DOMParser);var i8t=new $j({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),v7=32,GFe=2414016,WFe=1,qFe=16093e3,YFe=.1,r8t=[null,void 0,"http://www.topografix.com/GPX/1/1"],Kr={gpx:r8t};function o8t(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 Kse(e,t){let n=zM(e,"id");return n=l(n)?n:Jn(),t.getOrCreateEntity(n)}function $se(e){let t=XFe(e,"lon"),n=XFe(e,"lat"),i=kM(e,"ele",Kr.gpx);return h.fromDegrees(t,n,i)}function XFe(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 zM(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function tb(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 Jse(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 kM(e,t,n){let i=tb(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Zu(e,t,n){let i=tb(e,t,n);if(l(i))return i.textContent.trim()}function QFe(e){let t=new zl;return t.width=v7,t.height=v7,t.scaleByDistance=new qt(GFe,WFe,qFe,YFe),t.pixelOffsetScaleByDistance=new qt(GFe,WFe,qFe,YFe),t.verticalOrigin=new mi(Wn.BOTTOM),t.image=e,t}function s8t(){let e=new e0;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Wi.LEFT,e.font="16px sans-serif",e.style=So.FILL_AND_OUTLINE,e}function eBe(e){let t=new jl;return t.width=4,t.material=new WT,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var KFe={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"}},UM;typeof document<"u"&&(UM=document.createElement("div"));function Zse(e,t){let n,i="",r=Object.keys(KFe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=KFe[f];d.value=Zu(e,d.tag,Kr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=i8t.link(i),UM.innerHTML=i;let s=UM.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+=`${UM.innerHTML}</div>`,UM.innerHTML="",u}function tBe(e,t,n,i){let r=$se(t),o=Kse(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,v7);o.billboard=QFe(s);let a=Zu(t,"name",Kr.gpx);o.name=a,o.label=s8t(),o.label.text=a,o.description=Zse(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function a8t(e,t,n,i){let r=Kse(t,n);r.description=Zse(t,r);let o=Jse(t,"rtept",Kr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)tBe(e,o[a],n,i),s[a]=$se(o[a]);r.polyline=eBe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function c8t(e,t,n,i){let r=Kse(t,n);r.description=Zse(t,r);let o=Jse(t,"trkseg",Kr.gpx),s=[],a=[],c,u=!0,f=new Ic;for(let d=0;d<o.length;d++)c=l8t(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,v7);r.billboard=QFe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Bs,r.availability.addInterval(new vn({start:a[0],stop:a[a.length-1]}))}r.polyline=eBe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function l8t(e){let t={positions:[],times:[]},n=Jse(e,"trkpt",Kr.gpx),i;for(let r=0;r<n.length;r++){let o=$se(n[r]);t.positions.push(o),i=Zu(n[r],"time",Kr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function u8t(e){let t=tb(e,"metadata",Kr.gpx);if(l(t)){let n={name:Zu(t,"name",Kr.gpx),desc:Zu(t,"desc",Kr.gpx),author:f8t(t),copyright:h8t(t),link:nBe(t),time:Zu(t,"time",Kr.gpx),keywords:Zu(t,"keywords",Kr.gpx),bounds:m8t(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 f8t(e){let t=tb(e,"author",Kr.gpx);if(l(t)){let n={name:Zu(t,"name",Kr.gpx),email:d8t(t),link:nBe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function d8t(e){let t=tb(e,"email",Kr.gpx);if(l(t)){let n=Zu(t,"id",Kr.gpx),i=Zu(t,"domain",Kr.gpx);return`${n}@${i}`}}function nBe(e){let t=tb(e,"link",Kr.gpx);if(l(t)){let n={href:zM(t,"href"),text:Zu(t,"text",Kr.gpx),mimeType:Zu(t,"type",Kr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function h8t(e){let t=tb(e,"copyright",Kr.gpx);if(l(t)){let n={author:zM(t,"author"),year:Zu(t,"year",Kr.gpx),license:Zu(t,"license",Kr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function m8t(e){let t=tb(e,"bounds",Kr.gpx);if(l(t)){let n={minLat:kM(t,"minlat",Kr.gpx),maxLat:kM(t,"maxlat",Kr.gpx),minLon:kM(t,"minlon",Kr.gpx),maxLon:kM(t,"maxlon",Kr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var $Fe={wpt:tBe,rte:a8t,trk:c8t};function p8t(e,t,n,i){let r=Object.keys($Fe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=$Fe[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 JFe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=zM(r,"version"),s=zM(r,"creator"),a,c=u8t(r);l(c)&&(a=c.name),r.localName==="gpx"?p8t(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,it.MINIMUM_VALUE),m=K.equals(p,it.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 Zp,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=Fs.LOOP_STOP,u.clockStep=Hr.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),g8t(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 g8t(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 _8t(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?o8t(o).then(function(s){let a,c;try{a=ZFe.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 JFe(e,a,i)}):JFe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function CI(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new lc(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 Qy}CI.load=function(e,t){return new CI().load(e,t)};Object.defineProperties(CI.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}}});CI.prototype.update=function(e){return!0};CI.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 _8t(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,it.MINIMUM_VALUE),u=K.equals(a,it.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 Zp,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=Fs.LOOP_STOP,r.clockStep=Hr.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 S7=CI;function VM(){pe.throwInstantiationError()}VM.prototype.update=pe.throwInstantiationError;VM.prototype.getBoundingSphere=pe.throwInstantiationError;VM.prototype.isDestroyed=pe.throwInstantiationError;VM.prototype.destroy=pe.throwInstantiationError;var iBe=VM;var y8t=15;function rBe(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}rBe.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 A8t(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 Mo(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"?Zh.LERC:Zh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new d0(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new d0(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.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 b8t(e,t,n){try{let i=await t.fetchJson();A8t(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 nb(){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(nb.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}}});nb.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 rBe(t);await b8t(r,i);let o=new nb(t);return r.build(o),o._resource=n,o};nb.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(Qse(this,n+1,e*2,t*2))){let d=oBe(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 al({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):y8t,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 Qse(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}nb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};nb.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Qse(this,n,e,t);if(l(i))return i;oBe(this,n,e,t)};nb.prototype.loadTileDataAvailability=function(e,t,n){};function x8t(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 T8t(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=x8t(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 oBe(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=T8t(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 Qse(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 sBe=nb;var aBe="https://dev.virtualearth.net/REST/v1/Locations";function eae(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:aBe,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(eae.prototype,{url:{get:function(){return aBe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});eae.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 cBe=eae;function tae(){}Object.defineProperties(tae.prototype,{credit:{get:function(){}}});tae.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 lBe=tae;var E8t=new se,uBe=new h,vI=new h;function C8t(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=E8t;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,uBe),h.multiplyByScalar(d,.5,d),p=M.multiplyByVector(sx.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],uBe),h.multiplyByScalar(f,.5,f),p=M.multiplyByVector(sx.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=M.multiplyByVector(ib.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,vI),h.add(r,vI,r),h.multiplyByScalar(f,p.z,vI),h.add(r,vI,r),h.multiplyByScalar(d,p.w,vI),h.add(r,vI,r)}}var v8t=new h,S8t=new h;function ib(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=v8t,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=S8t,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=C8t(this),this._lastTimeIndex=0}Object.defineProperties(ib.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}}});ib.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);ib.prototype.findTimeInterval=Mr.prototype.findTimeInterval;ib.prototype.wrapTime=Mr.prototype.wrapTime;ib.prototype.clampTime=Mr.prototype.clampTime;ib.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var fBe=ib;var nae={},w8t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},I8t=new he,P8t=new h,D8t=new M,R8t=new M,O8t=new M,M8t=new h,N8t=new h,L8t=new h,F8t=new h,B8t=new he,k8t=new U,jM=new h,U8t=new U,z8t=new h,V8t=new h,w7=function(e,t){return e-t};nae.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=ue.clone(e.boundingSphere,new ue),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?oy.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,I8t);I.height=.5*(s+a);let R=he.toCartesian(I,m,P8t),O=At.eastNorthUpToFixedFrame(R,m,D8t),L=M.inverseTransformation(O,R8t),_=M.unpack(o.nodes[0].matrix,0,O8t);_=M.multiply(Gi.Y_UP_TO_Z_UP,_,_);let C=bjt(o,i,w8t),w=Xr.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=Xr.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,M8t),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,N8t),He=new wo(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,L8t),jt=M.multiplyByPoint(_,vt,F8t),lt=he.fromCartesian(jt,m,B8t),{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),Dr(ae,st,w7)>=0?rt=0:Dr(fe,st,w7)>=0&&(rt=1),Dr(Ae,st,w7)>=0?ht=0:Dr(xe,st,w7)>=0&&(ht=1);let Li=U.fromElements(rt,ht,k8t),Yn;if(i){let ui=h.unpack(N,st*3,jM);ui=M.multiplyByPointAsVector(_,ui,jM),ui=h.normalize(ui,jM),Yn=cn.octEncode(ui,U8t)}let yi;r&&(yi=(xi.geodeticLatitudeToMercatorAngle(ft)-ge)*ve);let zi;f&&(zi=m.geodeticSurfaceNormal(jt,z8t)),Pe=He.encode(Ke,Pe,jt,Li,Yt,Yn,yi,zi);let Si=M.multiplyByPoint(L,jt,V8t);Re=h.minimumByComponent(Si,Re,Re),Qe=h.maximumByComponent(Si,Qe,Qe)}let qe=new Tc(h.clone(He.center,new h),Ke,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Ye,en.clone(p,new en),He,Q,W,J,Z);return yBe(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var j8t=new U,H8t=new U,G8t=new Array(6),W8t=new U,q8t=new U,Y8t=new U,X8t=new h,K8t=new h,$8t=new h,J8t=new he,Z8t=new h,Q8t=new he,ejt=new he,dBe=new h,tjt=new h,njt=new h,ijt=new h,rjt=new h,ojt=new h,sjt=new h,ajt=new h,cjt=new M,ljt=new M,hBe=new U,ujt=new U,fjt=new h,djt=new ue,hjt=new en,mjt=new ud,mBe=new h,pBe=new U,pjt=new U,gBe=new h,gjt=new h;function _jt(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);oy.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 yjt(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);oy.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=jM;y.x=p,y.y=g,y.z=m,y=h.normalize(y,jM),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function Ajt(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 oy.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function I7(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 oy.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function bjt(e,t,n){return n.positions=_jt(e),n.normals=t?yjt(e):void 0,n.indices=Ajt(e),n.edgeIndicesWest=I7(e,"left"),n.edgeIndicesSouth=I7(e,"bottom"),n.edgeIndicesEast=I7(e,"right"),n.edgeIndicesNorth=I7(e,"top"),n}nae.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=wo.clone(e.parentEncoding,new wo),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=[];Mjt(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,J8t);_.height=.5*(i+r);let C=he.toCartesian(_,x,Z8t),w=T.length,D=new wo(C,void 0,void 0,void 0,void 0,d,p,A,g,m),N=D.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.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,cjt),xe=M.inverseTransformation(fe,ljt),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,sjt),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,ajt);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],yi=ujt;yi.x=E[Yt*2+0],yi.y=E[Yt*2+1];let zi=yi.x,Si=yi.y,ui=v[Yt*2+0],Ai=v[Yt*2+1],zn=1-ui-Ai,tn=f.decodeHeight(u,ht),Hn=f.decodeHeight(u,Li),Ki=f.decodeHeight(u,Yn),wr=tn*ui+Hn*Ai+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,ejt),$r=he.toCartesian(zs,x,tjt),pi=M.multiplyByPoint(xe,$r,ijt);qe=h.minimumByComponent(pi,qe,qe),st=h.maximumByComponent(pi,st,st);let ao;if(d){let Fn=f.decodeNormal(u,ht,X8t),Vi=f.decodeNormal(u,Li,K8t),Fi=f.decodeNormal(u,Yn,$8t),Ir=h.fromElements(Fn.x*ui+Vi.x*Ai+Fi.x*zn,Fn.y*ui+Vi.y*Ai+Fi.y*zn,Fn.z*ui+Vi.z*Ai+Fi.z*zn,mBe);Ir=h.normalize(Ir,mBe),ao=cn.octEncode(Ir,pjt)}let nr;p&&(nr=(xi.geodeticLatitudeToMercatorAngle(Ts)-Qe)*Ye);let jo;A&&(jo=x.geodeticSurfaceNormal($r,gjt)),Ae=D.encode(ae,Ae,$r,yi,wr,ao,nr,jo)}let vt=en.fromRectangle(b,Ke,Pe,x,hjt),jt=ue.fromVertices(ae,D.center,N,djt),mt=new Ip(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(D.center,ae,N,D.center,Ke,fjt),ft=new Tc(h.clone(D.center,new h),ae,q,B,w,Ke,Pe,b,ue.clone(jt),h.clone(mt),N,en.clone(vt),D,Q,W,J,Z);return yBe(ft,b,x,qe,st,fe,xe,o),ft};function yBe(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;Xr.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,rjt),k=h.clone(r,ojt),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,hBe),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,Q8t),Ye=he.toCartesian(He,n,dBe),Ke;d&&(Ke=c.getOctEncodedNormal(f,ae,pBe));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Ye,gBe)),x=c.encode(f,x,Ye,Ae,Qe,Ke,Pe,qe);let st=M.multiplyByPoint(s,Ye,njt);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=ud.fromCorners(j,k,mjt),W=new wo(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,dBe),c.decodeTextureCoordinates(f,fe,hBe),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,pBe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,gBe):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var iae=0,xjt=1,rae=2,oae=3,Tjt=4,Ejt=new h,Cjt=[new h,new h,new h,new h,new h,new h],vjt=[new U,new U,new U,new U,new U,new U],Sjt=[new h,new h,new h,new h,new h,new h],wjt=[new U,new U,new U,new U,new U,new U];function _Be(e,t,n,i){switch(n){case iae:return P.sign(i.x-e.x);case rae:return P.sign(t.x-i.x);case oae:return P.sign(i.y-e.y);default:return P.sign(t.y-i.y)}}function Ijt(e,t,n,i,r,o){let s,a,c;switch(n){case iae:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case rae:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case oae: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 Pjt={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 Djt(e,t,n,i,r,o,s,a){let c,u=vjt,f=Cjt,d=3,p=wjt;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=Sjt;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)%Tjt,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=_Be(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=_Be(n,i,y,I);if(v*O===-1){let L=Ijt(n,i,y,T,I,Ejt),{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 Rjt(e,t,n,i,r,o,s,a){return Djt(e?t?oae:iae:t?rae:xjt,2,n,i,r,o,s,a)}var Ojt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function Mjt(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=j8t;E.x=A,E.y=x;let v=H8t;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,W8t),C=s.decodeTextureCoordinates(o,O,q8t),w=s.decodeTextureCoordinates(o,L,Y8t),D=Rjt(e,t,E,v,_,C,w,Pjt),N=D.length;if(N<3)continue;let F=G8t;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=Ojt[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 HM=nae;function __(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),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(__.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});__.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:bBe(i,e,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};var ABe="createVerticesFromCesium3DTilesTerrain",Njt=new Kn(ABe),Ljt=new Kn(ABe,Ef.maximumAsynchronousTasks);__.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?Ljt:Njt,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=wo.clone(g.encoding,new wo),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=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),D=en.clone(d._orientedBoundingBox,new en),N=new Tc(_,y,T,R,b,O,L,c,C,w,m.stride,D,m,E,S,v,I);return d._mesh=N,Promise.resolve(N)})};__.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=HM.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)})};__.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:P7(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};__.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:P7(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};__.prototype.wasCreatedByUpsampling=function(){return!1};function g_(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}g_.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};g_.prototype.upsample=function(e,t,n,i,r,o,s){return P7(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};g_.prototype._upsampleSync=function(e,t,n,i,r,o,s){return P7(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};g_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return bBe(i,e,t,n)};g_.prototype.wasCreatedByUpsampling=function(){return!0};g_.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(g_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Fjt=new Kn("upsampleVerticesFromCesium3DTilesTerrain",Ef.maximumAsynchronousTasks);function P7(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=HM.upsampleMesh(b),E=new g_({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=Fjt.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=wo.clone(T.encoding,new wo),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=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new Tc(B,S,L,N,R,F,V,y,j,k,v,G,E,_,w,C,D),Q=new g_({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var Bjt=new U,kjt=new U,Ujt=new U,zjt=new h;function bBe(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,Bjt),m=a.decodeTextureCoordinates(s,d,kjt),y=a.decodeTextureCoordinates(s,p,Ujt),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=f0.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,zjt);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 D7=__;function E0(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 sE({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}E0.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 E0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=Au.fromJson(c);return r._tileset0=new Cg(n,s,u),r._tileset1=new Cg(n,a,u),r};E0.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return E0.fromUrl(n,t)};var Vjt=new Array(3);E0.prototype.requestTileGeometry=async function(e,t,n,i){let r=TBe(n,e),o=r===0?this._tileset0:this._tileset1,s=EBe(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 fy.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=>gC(new Uint8Array(x))),b=Vjt;b[0]=p,b[1]=A,b[2]=f?A.then(x=>jjt(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(Oh.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(Oh.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(Oh.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(Oh.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=R7(o,T,s,0,0),B=R7(o,T,s,1,0),j=R7(o,T,s,0,1),k=R7(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new D7({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}};E0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=TBe(n,e),o=r===0?this._tileset0:this._tileset1,s=EBe(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 TBe(e,t){let n=1<<e;return t/n|0}function EBe(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new vg({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function jjt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new Xb({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=ki.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await ay({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function R7(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=sae(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function sae(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new vg({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}E0.prototype.loadTileDataAvailability=function(e,t,n){};E0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(E0.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 Hjt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function sE(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new Vy({comparator:sE.comparator}),this._provider=e.provider}sE.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};sE.prototype.addSubtree=function(e,t){let n=new Hjt(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()};sE.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}};sE.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=sae(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=xBe(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=xBe(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function xBe(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=sae(e,r,s,a);return t.getDescendantCoordinates(c)}sE.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var CBe=E0;function y_(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 Xu(n),this._workerName="createCircleGeometry"}y_.packedLength=Xu.packedLength;y_.pack=function(e,t,n){return Xu.pack(e._ellipseGeometry,t,n)};var vBe=new Xu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Rc={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};y_.unpack=function(e,t,n){let i=Xu.unpack(e,t,vBe);return Rc.center=h.clone(i._center,Rc.center),Rc.ellipsoid=ee.clone(i._ellipsoid,Rc.ellipsoid),Rc.ellipsoid=ee.clone(i._ellipsoid,vBe._ellipsoid),Rc.height=i._height,Rc.extrudedHeight=i._extrudedHeight,Rc.granularity=i._granularity,Rc.vertexFormat=Be.clone(i._vertexFormat,Rc.vertexFormat),Rc.stRotation=i._stRotation,Rc.shadowVolume=i._shadowVolume,l(n)?(Rc.semiMajorAxis=i._semiMajorAxis,Rc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Xu(Rc),n):(Rc.radius=i._semiMajorAxis,new y_(Rc))};y_.createGeometry=function(e){return Xu.createGeometry(e._ellipseGeometry)};y_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new y_({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(y_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var SBe=y_;function SI(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 ih(n),this._workerName="createCircleOutlineGeometry"}SI.packedLength=ih.packedLength;SI.pack=function(e,t,n){return ih.pack(e._ellipseGeometry,t,n)};var Gjt=new ih({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Gf={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};SI.unpack=function(e,t,n){let i=ih.unpack(e,t,Gjt);return Gf.center=h.clone(i._center,Gf.center),Gf.ellipsoid=ee.clone(i._ellipsoid,Gf.ellipsoid),Gf.height=i._height,Gf.extrudedHeight=i._extrudedHeight,Gf.granularity=i._granularity,Gf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Gf.semiMajorAxis=i._semiMajorAxis,Gf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ih(Gf),n):(Gf.radius=i._semiMajorAxis,new SI(Gf))};SI.createGeometry=function(e){return ih.createGeometry(e._ellipseGeometry)};var wBe=SI;function wI(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=Xr.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(wI.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}}});wI.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 al({buffer:c,width:o,height:s})})};wI.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};wI.prototype.getTileDataAvailable=function(e,t,n){};wI.prototype.loadTileDataAvailability=function(e,t,n){};var IBe=wI;function PBe(e){this.proxy=e}PBe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var DBe=PBe;function O7(){pe.throwInstantiationError()}Object.defineProperties(O7.prototype,{credit:{get:pe.throwInstantiationError}});O7.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};O7.prototype.geocode=pe.throwInstantiationError;var GM=O7;var RBe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(RBe);var aE=RBe;function OBe(){pe.throwInstantiationError()}OBe.createGeometry=function(e){pe.throwInstantiationError()};var MBe=OBe;function cE(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(cE.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var FBe="createVerticesFromGoogleEarthEnterpriseBuffer",Wjt=new Kn(FBe),qjt=new Kn(FBe,Ef.maximumAsynchronousTasks),NBe=new ie,M7=new ie;cE.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,NBe),t.tileXYToRectangle(n,i,r,M7);let u=c.cartographicToCartesian(ie.center(M7)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?qjt:Wjt).scheduleTask({buffer:this._buffer,nativeRectangle:NBe,rectangle:M7,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 Tc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,M7,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),wo.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})};cE.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)?Jjt(this,i,r):e6t(this,i,r,e)};var Yjt=new Kn("upsampleQuantizedTerrainMesh",Ef.maximumAsynchronousTasks);cE.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=Yjt.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 _w({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.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})})};cE.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};cE.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Xjt=new U,Kjt=new U,$jt=new U,BBe=new h;function Jjt(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,Xjt),g=o.decodeTextureCoordinates(r,f,Kjt),m=o.decodeTextureCoordinates(r,d,$jt),y=f0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,BBe);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 Zjt=Uint16Array.BYTES_PER_ELEMENT,LBe=Uint32Array.BYTES_PER_ELEMENT,aae=Int32Array.BYTES_PER_ELEMENT,Qjt=Float32Array.BYTES_PER_ELEMENT,cae=Float64Array.BYTES_PER_ELEMENT;function e6t(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+=LBe;u+=LBe,u+=2*cae;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=cae;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=cae;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=aae;let y=c.getInt32(u,!0)*3;u+=aae,u+=aae;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+=Qjt;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=Zjt;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=f0.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,BBe);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 WM=cE;var oh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},N7=new K;function L7(){this._terrainCache={},this._lastTidy=K.now()}L7.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};L7.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};L7.prototype.tidy=function(){if(K.now(N7),K.secondsDifference(N7,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(N7,o.timestamp)>10&&delete e[r]}K.clone(N7,this._lastTidy)}};function rb(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 L7,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(rb.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(){}}});rb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new rb(t);return n._metadata=e,n};var t6t=new Kn("decodeGoogleEarthEnterprisePacket");function kBe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===oh.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}rb.prototype.requestTileGeometry=function(e,t,n,i){let r=Ky.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=oh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new WM({buffer:u,childTileMask:kBe(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===oh.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new al({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case oh.SELF:p=a.terrainVersion;break;case oh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case oh.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=n6t(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?t6t.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=oh.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=oh.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 WM({buffer:b,childTileMask:kBe(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=oh.NONE,Promise.reject(b))})};rb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};rb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=Ky.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===oh.NONE)return!1;if((!l(s)||s===oh.UNKNOWN)&&(o.terrainState=oh.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};rb.prototype.loadTileDataAvailability=function(e,t,n){};function n6t(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 UBe=rb;var i6t="https://maps.googleapis.com/maps/api/geocode/json",zBe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function lae(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:i6t,queryParameters:{key:t}}),this._credit=new It(zBe,!0)}Object.defineProperties(lae.prototype,{credit:{get:function(){return this._credit}}});lae.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:zBe,collapsible:!1}}})};var VBe=lae;var uae=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()}},jBe=uae;var HBe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(HBe);var ob=HBe;function fae(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(fae.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});fae.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===aE.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 F7=fae;function r6t(e){if(!Object.values(ob).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var GBe=Object.freeze({[ob.GOOGLE]:"google",[ob.BING]:"bing",[ob.DEFAULT]:void 0});function o6t(e){return GBe[e]}function s6t(e){return Object.entries(GBe).find(t=>t[1]===e)[0]}function dae(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??ob.DEFAULT,n=e.accessToken??sf.defaultAccessToken,i=De.createIfNeeded(e.server??sf.defaultServer);i.appendForwardSlash();let r=sf.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 F7(o),this.geocodeProviderType=t}Object.defineProperties(dae.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return s6t(this._pelias.url.queryParameters.geocoder)},set:function(e){r6t(e);let t={...this._pelias.url.queryParameters,geocoder:o6t(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});dae.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var II=dae;var WBe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(WBe);var qBe=WBe;var YBe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(YBe);var XBe=YBe;var KBe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(KBe);var B7=KBe;var $Be={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze($Be);var JBe=$Be;function ZBe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function QBe(e){let t=he.fromCartesian(e);return{longitude:P.toDegrees(t.longitude),latitude:P.toDegrees(t.latitude),height:t.height}}function a6t(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 c6t(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 l6t=new M,u6t=new M,k7=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??sf.defaultAccessToken,r=De.createIfNeeded(n.server??sf.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=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=c6t(n,i,l6t);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,u6t),i={testPoint:QBe(t.testPoint),closePoint:QBe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??B7.NEAREST,worldToView:a6t(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=ZBe(r.snapPoint),o.hitPoint=ZBe(r.hitPoint),o}};k7.DEFAULT_SNAP_APERTURE=12;var e2e=k7;var hae=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},t2e=hae;function PI(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(PI.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});PI.prototype.findTimeInterval=Mr.prototype.findTimeInterval;PI.prototype.wrapTime=Mr.prototype.wrapTime;PI.prototype.clampTime=Mr.prototype.clampTime;PI.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 n2e=PI;function mae(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(mae.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});mae.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 i2e=mae;var f6t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},r2e=f6t;var d6t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},o2e=d6t;var h6t=new h;function m6t(e,t,n,i){let r=SC(e,t,n,i,h6t);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var s2e=m6t;function a2e(){pe.throwInstantiationError()}a2e.prototype.getURL=pe.throwInstantiationError;var c2e=a2e;function p6t(e,t,n,i,r,o,s){let a=ur.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 qM(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??fn.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}qM.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};qM.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 qM({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var U7=new Array(2),z7=new Array(2),g6t={positions:U7,height:z7,ellipsoid:void 0,minDistance:void 0,granularity:void 0};qM.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===fn.GEODESIC||r===fn.RHUMB){let E,v,S;r===fn.GEODESIC?(E=P.chordLength(o,s.maximumRadius),v=ur.numberOfPoints,S=ur.generateArc):(E=o,v=ur.numberOfPointsRhumbLine,S=ur.generateRhumbArc);let I=ur.extractHeights(t,s),R=g6t;if(r===fn.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=U7,R.height=z7;let L=0;for(u=0;u<f-1;++u){U7[0]=t[u],U7[1]=t[u+1],z7[0]=I[u],z7[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=p6t(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 Cn;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:ue.fromPoints(t)})};var l2e=qM;var V7=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};V7.DEFAULT_SNAP_APERTURE=void 0;var u2e=V7;var pae=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()}},f2e=pae;function lE(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??it.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(lE.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(lE.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=_6t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});lE.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};lE.prototype.isDestroyed=function(){return!1};lE.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};lE.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??it.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 _6t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var d2e=lE;function y6t(e,t){this.rectangle=e,this.maxLevel=t}function h2e(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=[]}h2e.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 A6t(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=Xr.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 y6t(new ie(a,c,u,f),d))}}function b6t(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 x6t(e,t,n){try{let i=await t.fetchXML();A6t(e,i)}catch(i){b6t(t,i,n)}}function sb(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(sb.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(){}}});sb.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new h2e(t),i=De.createIfNeeded(e);await x6t(n,i);let r=new sb(t);return n.build(r),r._resource=i,r};sb.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 al({buffer:km(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:T6t(a,e,t,n),structure:a._terrainDataStructure})})};sb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var m2e=new ie;function T6t(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,m2e);l(d)&&(j7(r,f,t*2,n*2,i+1)&&(a|=4),j7(r,f,t*2+1,n*2,i+1)&&(a|=8),j7(r,f,t*2,n*2+1,i+1)&&(a|=1),j7(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function j7(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,m2e))}sb.prototype.getTileDataAvailable=function(e,t,n){};sb.prototype.loadTileDataAvailability=function(e,t,n){};var p2e=sb;var g2e={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(g2e);var _2e=g2e;function E6t(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 y2e=E6t;function C6t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var H7=C6t;function x2e(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function v6t(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 T2e(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function E2e(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=T2e(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 C2e(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 Jp,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),E2e(this);try{let p=t.ellipsoid??ee.default,g=new N5({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,T2e(this),C2e(this);let m=t.globe;l(m)||(m=new dj(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Pn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=k5.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new j5,ee.WGS84.equals(p)&&(g.moon=new eG));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new B5(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=Ms.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 ma(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 S9,E=!0);let v=new A7({scene:g,dataSourceCollection:T}),S=new Qo;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&&v6t(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,gae(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,x2e(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=W0(n);u||(typeof n=="string"&&(n=new Error(n)),t=W0({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +`;function H7(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=ir.fromType(ir.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}H7.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:nn.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,j7]});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)}};H7.prototype.isDestroyed=function(){return!1};H7.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var _2e=H7;var pae=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()}},y2e=pae;function y_(){pe.throwInstantiationError()}Object.defineProperties(y_.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}});y_.prototype.update=pe.throwInstantiationError;y_.prototype.updateViewTransforms=pe.throwInstantiationError;y_.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;y_.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;y_.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;y_.DefaultMinBounds=pe.throwInstantiationError;y_.DefaultMaxBounds=pe.throwInstantiationError;var A2e=y_;function T2e(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function S6t(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 E2e(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function C2e(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=E2e(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 v2e(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 Mp,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),C2e(this);try{let p=t.ellipsoid??ee.default,g=new R7({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,E2e(this),v2e(this);let m=t.globe;l(m)||(m=new Y5(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=L7.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new U7,ee.WGS84.equals(p)&&(g.moon=new m9));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new N7(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=Ms.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 xa(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 J4,E=!0);let v=new q8({scene:g,dataSourceCollection:T}),S=new Zo;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&&S6t(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,gae(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,T2e(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=cg(n);u||(typeof n=="string"&&(n=new Error(n)),t=cg({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()),le(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,E2e(this),C2e(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 S6t=new ue;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??S6t)===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&&x2e(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 v2e(this,e,{offset:t},!1)};Vr.prototype.flyTo=function(e,t){return v2e(this,e,t,!0)};function v2e(e,t,n,i){gae(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 Ms){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 jv(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Jo||o instanceof ZO||o instanceof LT||o instanceof fa){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 YM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function gae(e){let t=e._zoomPromise;l(t)&&(YM(e),e._completeZoom(!1))}Vr.prototype._postRender=function(){w6t(this),I6t(this)};var A2e=new ue;function w6t(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 Eh(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)),YM(e)}if(t instanceof ZO){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Jo||t instanceof LT){s(t.boundingSphere);return}if(t instanceof fa){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)),YM(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,A2e);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(A2e))}if(c.length===0){gae(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(YM(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),YM(e),e._completeZoom(!0))}var b2e=new ue;function I6t(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,b2e);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?b2e:void 0;e._entityView=new T7(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var G7=Vr;var _ae=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()}},S2e=_ae;var w2e=new h,P6t=new sn(h.UNIT_X,0),D6t=new gn,R6t=new U(1,1,1);function C0(e,t,n,i=R6t){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,w2e);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,w2e),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,P6t),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,D6t);return Ti.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var I2e={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(I2e);var hc=I2e;function O6t(e){if(e===hc.LEFT)return un.LEFT_DOWN;if(e===hc.MIDDLE)return un.MIDDLE_DOWN;if(e===hc.RIGHT)return un.RIGHT_DOWN}function M6t(e){if(e===hc.LEFT)return un.LEFT_UP;if(e===hc.MIDDLE)return un.MIDDLE_UP;if(e===hc.RIGHT)return un.RIGHT_UP}var yae=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=O6t(s.button),c=M6t(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}},v0=yae;var Aae=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 ma(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}},W7=Aae;var bae=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 ma(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}},q7=bae;var xae=class{constructor(){this._elevatorController=new W7,this._mapController=new q7,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)}},P2e=xae;var Tae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT,modifier:to.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 ma(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=Tae;var Eae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.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=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 ma(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=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}},R2e=Eae;var O2e={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(O2e);var M2e=O2e;var N2e=`uniform sampler2D u_depthTexture; +${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()),le(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,C2e(this),v2e(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 w6t=new ue;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??w6t)===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&&T2e(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 S2e(this,e,{offset:t},!1)};Vr.prototype.flyTo=function(e,t){return S2e(this,e,t,!0)};function S2e(e,t,n,i){gae(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 Ms){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 oI(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Jo||o instanceof qM||o instanceof oE||o instanceof fa){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 YM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function gae(e){let t=e._zoomPromise;l(t)&&(YM(e),e._completeZoom(!1))}Vr.prototype._postRender=function(){I6t(this),P6t(this)};var b2e=new ue;function I6t(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 rm(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)),YM(e)}if(t instanceof qM){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Jo||t instanceof oE){s(t.boundingSphere);return}if(t instanceof fa){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)),YM(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,b2e);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(b2e))}if(c.length===0){gae(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(YM(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),YM(e),e._completeZoom(!0))}var x2e=new ue;function P6t(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,x2e);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?x2e:void 0;e._entityView=new K8(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var G7=Vr;var _ae=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()}},w2e=_ae;var I2e=new h,D6t=new sn(h.UNIT_X,0),R6t=new gn,O6t=new U(1,1,1);function C0(e,t,n,i=O6t){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,I2e);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,I2e),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,D6t),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,R6t);return xi.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var P2e={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(P2e);var hc=P2e;function M6t(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 N6t(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 yae=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=M6t(s.button),c=N6t(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=yae;var Aae=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 xa(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}},W7=Aae;var bae=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 xa(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}},q7=bae;var xae=class{constructor(){this._elevatorController=new W7,this._mapController=new q7,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)}},D2e=xae;var Tae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT,modifier:oo.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 xa(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}},R2e=Tae;var Eae=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 xa(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}},O2e=Eae;var M2e={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(M2e);var N2e=M2e;var L2e=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -12729,8 +12729,8 @@ 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 L2e={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(L2e);var F2e=L2e;function N6t(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: ${W0(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 B2e=N6t;globalThis.CESIUM_VERSION="1.145.0";var XM;typeof ko<"u"&&(XM=ko);(function(){/*! +`;var F2e={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(F2e);var B2e=F2e;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: ${cg(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 k2e=L6t;globalThis.CESIUM_VERSION="1.145.0";var XM;typeof ko<"u"&&(XM=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) @@ -12739,39 +12739,39 @@ out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); |/(?:\\\\.|[^/])+/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: `+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 L6t=ko;typeof window<"u"?(ko=window.ko,typeof XM<"u"?window.ko=XM:delete window.ko):(ko=global.ko,typeof XM<"u"?global.ko=XM:delete global.ko);var DI=L6t;/** +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 F6t=ko;typeof window<"u"?(ko=window.ko,typeof XM<"u"?window.ko=XM:delete window.ko):(ko=global.ko,typeof XM<"u"?global.ko=XM:delete global.ko);var DI=F6t;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Cae="__knockoutObservables",vae="__knockoutSubscribable";function k2e(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=U2e(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Cae||r===vae)&&!(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&&B6t(n,a)}}),e}function U2e(e,t){var n=e[Cae];return!n&&t&&(n={},Object.defineProperty(e,Cae,{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),k2e.call(i,e,[t]),e}function B6t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=k6t(e,t,i))})}function k6t(e,t,n){var i=U6t(e,n);return i.subscribe(t)}function U6t(e,t){var n=t[vae];if(!n){n=new e.subscribable,Object.defineProperty(t,vae,{value:n});var i={};z6t(t,n,i),V6t(e,t,n,i)}return n}function z6t(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 V6t(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 z2e(e,t){if(!e)return null;var n=U2e(e,!1);return n&&n[t]||null}function j6t(e,t){var n=z2e(e,t);n&&n.valueHasMutated()}function H6t(e){e.track=k2e,e.getObservable=z2e,e.valueHasMutated=j6t,e.defineProperty=F6t}var Y7={attachToKo:H6t};var V2e="http://www.w3.org/2000/svg",j2e="cesium-svgPath-svg",G6t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(V2e,"svg:svg");i.setAttribute("class",j2e);let r=document.createElementNS(V2e,"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",`${j2e} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},X7=G6t;Y7.attachToKo(DI);X7.register(DI);var Se=DI;function KM(e){l(e)||(e=new Jp),this._clock=e,this._eventHelper=new Qo,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(KM.prototype,{clock:{get:function(){return this._clock}}});KM.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};KM.prototype.isDestroyed=function(){return!1};KM.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var K7=KM;function W6t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var H2e=W6t;function q6t(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=q6t;var RI={};RI.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};RI.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};RI.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};RI.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};RI.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=RI;function Y6t(e,t,n,i,r){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,r)}var Oc=Y6t;function G2e(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(G2e.prototype,{command:{get:function(){return this._command}}});var uE=G2e;function X6t(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 Sae(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var K6t=new gn,$6t=new h;function $M(e,t){let n=this,i=e.canvas,r=new ma(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 wA({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 c8({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=Sae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=On(function(){let u=n.depthFrustum-1;return n.depthFrustum=Sae(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 K5({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,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,K6t),g=o.pick(p,n._scene,$6t);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,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties($M.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}}});$M.prototype._update=function(){this.frustums&&(this.frustumStatisticText=X6t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Sae(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}`};$M.prototype.isDestroyed=function(){return!1};$M.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(),le(this)};var $7=$M;function J7(e,t){e=kn(e);let n=document.createElement("div"),i=new $7(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(J7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});J7.prototype.isDestroyed=function(){return!1};J7.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var Z7=J7;function W2e(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=Ms.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ms.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 Ng),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new X5(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof Ng),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(W2e.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var Q7=W2e;function eW(e,t){e=kn(e);let n=new Q7(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(eW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eW.prototype.isDestroyed=function(){return!1};eW.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),le(this)};var tW=eW;function q2e(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(q2e.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var yo=q2e;function J6t(){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 Cy({style:Ey.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 Cy({style:Ey.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 Cy({style:Ey.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 D_.fromBasemapType(Fm.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 D_.fromBasemapType(Fm.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 D_.fromBasemapType(Fm.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 SA({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 SA({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> + */var Cae="__knockoutObservables",vae="__knockoutSubscribable";function U2e(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=z2e(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Cae||r===vae)&&!(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&&k6t(n,a)}}),e}function z2e(e,t){var n=e[Cae];return!n&&t&&(n={},Object.defineProperty(e,Cae,{value:n})),n}function B6t(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),U2e.call(i,e,[t]),e}function k6t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=U6t(e,t,i))})}function U6t(e,t,n){var i=z6t(e,n);return i.subscribe(t)}function z6t(e,t){var n=t[vae];if(!n){n=new e.subscribable,Object.defineProperty(t,vae,{value:n});var i={};V6t(t,n,i),j6t(e,t,n,i)}return n}function V6t(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 j6t(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 V2e(e,t){if(!e)return null;var n=z2e(e,!1);return n&&n[t]||null}function H6t(e,t){var n=V2e(e,t);n&&n.valueHasMutated()}function G6t(e){e.track=U2e,e.getObservable=V2e,e.valueHasMutated=H6t,e.defineProperty=B6t}var Y7={attachToKo:G6t};var j2e="http://www.w3.org/2000/svg",H2e="cesium-svgPath-svg",W6t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(j2e,"svg:svg");i.setAttribute("class",H2e);let r=document.createElementNS(j2e,"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",`${H2e} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},X7=W6t;Y7.attachToKo(DI);X7.register(DI);var Se=DI;function KM(e){l(e)||(e=new Mp),this._clock=e,this._eventHelper=new Zo,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(KM.prototype,{clock:{get:function(){return this._clock}}});KM.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};KM.prototype.isDestroyed=function(){return!1};KM.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var K7=KM;function q6t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var G2e=q6t;function Y6t(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=Y6t;var RI={};RI.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};RI.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};RI.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};RI.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};RI.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=RI;function X6t(e,t,n,i,r){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,r)}var Oc=X6t;function W2e(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(W2e.prototype,{command:{get:function(){return this._command}}});var uE=W2e;function q2e(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=Ms.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ms.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 n_),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new z7(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof n_),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(q2e.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var $7=q2e;function J7(e,t){e=kn(e);let n=new $7(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(J7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});J7.prototype.isDestroyed=function(){return!1};J7.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),le(this)};var Z7=J7;function Y2e(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(Y2e.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var yo=Y2e;function K6t(){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 wy({style:Sy.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 wy({style:Sy.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 wy({style:Sy.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 vy.fromBasemapType(Ap.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 vy.fromBasemapType(Ap.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 vy.fromBasemapType(Ap.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 ZA({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 ZA({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 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 SA({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> +https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new ZA({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 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 SA({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> +https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new ZA({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 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 SA({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> +https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new ZA({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 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 Su.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 Su.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 Su.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 dx.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 Su.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 Su.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 Su.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 Su.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 Su.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 Su.fromAssetId(3891169)}})),e}var nW=J6t;function Z6t(){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 Ng({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 Tw({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var iW=Z6t;var gl="http://www.w3.org/2000/svg",$2e="http://www.w3.org/1999/xlink",rW,JM=z.fromCssColorString("rgba(247,250,255,0.384)"),oW=z.fromCssColorString("rgba(143,191,255,0.216)"),wae=z.fromCssColorString("rgba(153,197,255,0.098)"),sW=z.fromCssColorString("rgba(255,255,255,0.086)"),Q6t=z.fromCssColorString("rgba(255,255,255,0.267)"),eHt=z.fromCssColorString("rgba(255,255,255,0)"),Y2e=z.fromCssColorString("rgba(66,67,68,0.3)"),X2e=z.fromCssColorString("rgba(0,0,0,0.5)");function ab(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var ZM={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($2e,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Pae(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 tHt(e,t){let n=Pae(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 nHt(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 iHt(e,t){let n=Pae(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 rHt(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 K2e(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 oHt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var aW=new z;function Us(e,t){let n=t.alpha,i=1-n;return aW.red=e.red*i+t.red*n,aW.green=e.green*i+t.green*n,aW.blue=e.blue*i+t.blue*n,aW.toCssColorString()}function Iae(e,t,n){let i=ZM[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 sHt(e,t,n){let i=ZM[n],r=ZM.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 aHt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&rW!==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?(rW=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===rW&&(rW=void 0),n.shuttleRingDragging=!1}function A_(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)]}A_.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();le(this)};A_.prototype.isDestroyed=function(){return!1};A_.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")}};A_.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")))};A_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function OI(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",$2e);let s=document.createElementNS(gl,"g");this._topG=s,this._realtimeSVG=new A_(sHt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new A_(Iae(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new A_(Iae(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new A_(Iae(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=ZM.animation_pathSwooshFX,f=ZM.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=tHt(0,-24);this._knobDate=y.element;let A=iHt(0,-7);this._knobTime=A.element,this._knobStatus=Pae(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){aHt(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=[],K2e(this,y.parts,function(I,R){t.adjustDate(I,R)}),K2e(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){oHt(T._shuttleRingPointer,T._knobOuter,I)}),Oc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&nHt(y,I)}),Oc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&rHt(A,I)}),Oc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(OI.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OI.prototype.isDestroyed=function(){return!1};OI.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 le(this)};OI.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};OI.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=ab(this._themeNormal),n=ab(this._themeHover),i=ab(this._themeSelect),r=ab(this._themeDisabled),o=ab(this._themeKnob),s=ab(this._themePointer),a=ab(this._themeSwoosh),c=ab(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,JM)},{tagName:"stop",offset:"12%","stop-color":Us(t,oW)},{tagName:"stop",offset:"46%","stop-color":Us(t,wae)},{tagName:"stop",offset:"81%","stop-color":Us(t,sW)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(n,JM)},{tagName:"stop",offset:"12%","stop-color":Us(n,oW)},{tagName:"stop",offset:"46%","stop-color":Us(n,wae)},{tagName:"stop",offset:"81%","stop-color":Us(n,sW)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(i,JM)},{tagName:"stop",offset:"12%","stop-color":Us(i,oW)},{tagName:"stop",offset:"46%","stop-color":Us(i,wae)},{tagName:"stop",offset:"81%","stop-color":Us(i,sW)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(r,Q6t)},{tagName:"stop",offset:"75%","stop-color":Us(r,eHt)}]},{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,X2e)},{tagName:"stop",offset:"100%","stop-color":Us(s,X2e)}]},{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,JM)},{tagName:"stop",offset:"60%","stop-color":Us(o,Y2e)},{tagName:"stop",offset:"85%","stop-color":Us(o,oW)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,Y2e)},{tagName:"stop",offset:"60%","stop-color":Us(o,JM)},{tagName:"stop",offset:"85%","stop-color":Us(o,sW)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var cW=OI;var cHt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cb=15,MI=105,lHt=[31,28,31,30,31,30,31,31,30,31,30,31];function uHt(e,t){return t===2&&ou(e)?29:lHt[t-1]}function J2e(e,t,n){return K.fromGregorianDate(new Bm(t,n,Math.min(e.day,uHt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function Z2e(e,t){return e-t}function Dae(e,t){let n=Dr(t,e,Z2e);return n<0?~n:n}function fHt(e,t){if(Math.abs(e)<=cb)return e/cb;let n=cb,i=MI,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 dHt(e,t,n){if(n.clockStep===Hr.SYSTEM_CLOCK)return cb;if(Math.abs(e)<=1)return e*cb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=cb,o=MI,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 Qu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Qu.defaultDateFormatter,this._timeFormatter=Qu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Qu.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===Hr.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 dHt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,MI),-MI);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===MI){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=fHt(s,a);if(t.snapToTicks)u=a[Dae(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>cb?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===Fs.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===Fs.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===Fs.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 uE(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 uE(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 uE(r,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Hr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=On(function(){t._clockViewModel.clockStep=Hr.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new uE(o,{toggled:Se.computed(function(){return e.clockStep===Hr.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=Dae(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Dae(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Qu.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${cHt[n.month-1]} ${n.day} ${n.year}`};Qu.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];Qu.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`};Qu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Qu.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(Z2e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Qn(s,o),this._allShuttleRingTicks=s};Qu.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=J2e(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=J2e(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};Qu.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(Qu.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}}});Qu._maxShuttleRingAngle=MI;Qu._realtimeShuttleRingAngle=cb;var lW=Qu;function uW(e,t){l(t)||(t=document.body),t=kn(t);let n=this,i=Se.observable(as.fullscreen),r=Se.observable(as.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&&as.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(){as.fullscreen?as.exitFullscreen():as.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=kn(e)??o.body,this._callback=function(){i(as.fullscreen)},o.addEventListener(as.changeEventName,this._callback)}Object.defineProperties(uW.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});uW.prototype.isDestroyed=function(){return!1};uW.prototype.destroy=function(){document.removeEventListener(as.changeEventName,this._callback),le(this)};var fW=uW;var hHt="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",mHt="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 dW(e,t){e=kn(e);let n=new fW(t,e);n._exitFullScreenPath=mHt,n._enterFullScreenPath=hHt;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(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(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var hW=dW;function pHt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Jo&&(e.tileset=n.primitive),e.pickActive=!1}}function eke(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Jo&&(e.tileset=i.primitive)},un.MOUSE_MOVE):(e._eventHandler.removeInputAction(un.MOUSE_MOVE),e.picking=e.picking)}var gHt={maximumFractionDigits:3};function QM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,gHt):Math.round(t).toLocaleString()}function eN(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[mo.PICK]:e._statisticsPerPass[mo.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>${QM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${QM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${QM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function tke(){let e=ki.statistics;return` + © <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 Pu.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 Pu.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 Pu.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 dx.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 Pu.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 Pu.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 Pu.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 Pu.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 Pu.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 Pu.fromAssetId(3891169)}})),e}var Q7=K6t;function $6t(){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 n_({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 Vw({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var eW=$6t;var gl="http://www.w3.org/2000/svg",J2e="http://www.w3.org/1999/xlink",tW,$M=z.fromCssColorString("rgba(247,250,255,0.384)"),nW=z.fromCssColorString("rgba(143,191,255,0.216)"),Sae=z.fromCssColorString("rgba(153,197,255,0.098)"),iW=z.fromCssColorString("rgba(255,255,255,0.086)"),J6t=z.fromCssColorString("rgba(255,255,255,0.267)"),Z6t=z.fromCssColorString("rgba(255,255,255,0)"),X2e=z.fromCssColorString("rgba(66,67,68,0.3)"),K2e=z.fromCssColorString("rgba(0,0,0,0.5)");function ab(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var JM={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(J2e,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Iae(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 Q6t(e,t){let n=Iae(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 eHt(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 tHt(e,t){let n=Iae(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 nHt(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 $2e(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 iHt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var rW=new z;function Us(e,t){let n=t.alpha,i=1-n;return rW.red=e.red*i+t.red*n,rW.green=e.green*i+t.green*n,rW.blue=e.blue*i+t.blue*n,rW.toCssColorString()}function wae(e,t,n){let i=JM[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 rHt(e,t,n){let i=JM[n],r=JM.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 oHt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&tW!==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?(tW=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===tW&&(tW=void 0),n.shuttleRingDragging=!1}function A_(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)]}A_.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();le(this)};A_.prototype.isDestroyed=function(){return!1};A_.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")}};A_.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")))};A_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function OI(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",J2e);let s=document.createElementNS(gl,"g");this._topG=s,this._realtimeSVG=new A_(rHt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new A_(wae(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new A_(wae(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new A_(wae(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=JM.animation_pathSwooshFX,f=JM.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=Q6t(0,-24);this._knobDate=y.element;let A=tHt(0,-7);this._knobTime=A.element,this._knobStatus=Iae(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){oHt(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=[],$2e(this,y.parts,function(I,R){t.adjustDate(I,R)}),$2e(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){iHt(T._shuttleRingPointer,T._knobOuter,I)}),Oc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&eHt(y,I)}),Oc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&nHt(A,I)}),Oc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(OI.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OI.prototype.isDestroyed=function(){return!1};OI.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 le(this)};OI.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};OI.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=ab(this._themeNormal),n=ab(this._themeHover),i=ab(this._themeSelect),r=ab(this._themeDisabled),o=ab(this._themeKnob),s=ab(this._themePointer),a=ab(this._themeSwoosh),c=ab(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,$M)},{tagName:"stop",offset:"12%","stop-color":Us(t,nW)},{tagName:"stop",offset:"46%","stop-color":Us(t,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(t,iW)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(n,$M)},{tagName:"stop",offset:"12%","stop-color":Us(n,nW)},{tagName:"stop",offset:"46%","stop-color":Us(n,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(n,iW)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(i,$M)},{tagName:"stop",offset:"12%","stop-color":Us(i,nW)},{tagName:"stop",offset:"46%","stop-color":Us(i,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(i,iW)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(r,J6t)},{tagName:"stop",offset:"75%","stop-color":Us(r,Z6t)}]},{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,K2e)},{tagName:"stop",offset:"100%","stop-color":Us(s,K2e)}]},{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,$M)},{tagName:"stop",offset:"60%","stop-color":Us(o,X2e)},{tagName:"stop",offset:"85%","stop-color":Us(o,nW)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,X2e)},{tagName:"stop",offset:"60%","stop-color":Us(o,$M)},{tagName:"stop",offset:"85%","stop-color":Us(o,iW)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var oW=OI;var sHt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cb=15,MI=105,aHt=[31,28,31,30,31,30,31,31,30,31,30,31];function cHt(e,t){return t===2&&ru(e)?29:aHt[t-1]}function Z2e(e,t,n){return K.fromGregorianDate(new Fm(t,n,Math.min(e.day,cHt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function Q2e(e,t){return e-t}function Pae(e,t){let n=Pr(t,e,Q2e);return n<0?~n:n}function lHt(e,t){if(Math.abs(e)<=cb)return e/cb;let n=cb,i=MI,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 uHt(e,t,n){if(n.clockStep===Hr.SYSTEM_CLOCK)return cb;if(Math.abs(e)<=1)return e*cb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=cb,o=MI,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 Qu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Qu.defaultDateFormatter,this._timeFormatter=Qu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Qu.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===Hr.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 uHt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,MI),-MI);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===MI){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=lHt(s,a);if(t.snapToTicks)u=a[Pae(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>cb?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===Bs.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===Bs.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===Bs.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 uE(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 uE(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 uE(r,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Hr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=On(function(){t._clockViewModel.clockStep=Hr.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new uE(o,{toggled:Se.computed(function(){return e.clockStep===Hr.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=Pae(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Pae(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Qu.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${sHt[n.month-1]} ${n.day} ${n.year}`};Qu.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];Qu.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`};Qu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Qu.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(Q2e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);ti(s,o),this._allShuttleRingTicks=s};Qu.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=Z2e(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=Z2e(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};Qu.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(Qu.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}}});Qu._maxShuttleRingAngle=MI;Qu._realtimeShuttleRingAngle=cb;var sW=Qu;function fHt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Jo&&(e.tileset=n.primitive),e.pickActive=!1}}function tke(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Jo&&(e.tileset=i.primitive)},fn.MOUSE_MOVE):(e._eventHandler.removeInputAction(fn.MOUSE_MOVE),e.picking=e.picking)}var dHt={maximumFractionDigits:3};function ZM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,dHt):Math.round(t).toLocaleString()}function QM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[po.PICK]:e._statisticsPerPass[po.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>${ZM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${ZM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${ZM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function nke(){let e=Bi.statistics;return` <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${QM(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${QM(e.texturesByteLength)}</li> + <li><strong>Geometry Memory (MB): </strong>${ZM(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${ZM(e.texturesByteLength)}</li> </ul> - `}var _Ht=[{text:"Highlight",value:lf.HIGHLIGHT},{text:"Replace",value:lf.REPLACE},{text:"Mix",value:lf.MIX}],Q2e=new z(1,1,0,.4),yHt=new z,mW=new z;function mc(e,t){let n=this,i=e.canvas;this._eventHandler=new ma(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new wA({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=lf.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()}},un.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(un.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=pHt(this),S=Se.observable();Se.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=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)||eke(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 _Ht}},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=eN(e,!1),this._pickStatisticsText=eN(e,!0),this._resourceCacheStatisticsText=tke(),eke(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,yHt):z.WHITE:t.color=mW,this._scene.requestRender()),l(e)&&(z.clone(e.color,mW),e.color=Q2e,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()&&!Rae(t.content)&&(t.color=mW,this._scene.requestRender()),l(e)&&!Rae(e.content)&&(z.clone(e.color,mW),e.color=Q2e,this._scene.requestRender()),this._tile=e}}});function Rae(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(!Rae(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 Oy(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(` + `}var hHt=[{text:"Highlight",value:ff.HIGHLIGHT},{text:"Replace",value:ff.REPLACE},{text:"Mix",value:ff.MIX}],eke=new z(1,1,0,.4),mHt=new z,aW=new z;function mc(e,t){let n=this,i=e.canvas;this._eventHandler=new xa(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new QA({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=ff.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 la?(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=fHt(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)||tke(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 hHt}},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=QM(e,!1),this._pickStatisticsText=QM(e,!0),this._resourceCacheStatisticsText=nke(),tke(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,mHt):z.WHITE:t.color=aW,this._scene.requestRender()),l(e)&&(z.clone(e.color,aW),e.color=eke,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()&&!Dae(t.content)&&(t.color=aW,this._scene.requestRender()),l(e)&&!Dae(e.content)&&(z.clone(e.color,aW),e.color=eke,this._scene.requestRender()),this._tile=e}}});function Dae(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(!Dae(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 Uy(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=eN(e,!1),this._pickStatisticsText=eN(e,!0),this._resourceCacheStatisticsText=tke())};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()}),le(this)};mc.getStatistics=eN;var pW=mc;function gW(e,t){e=kn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new pW(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(gW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gW.prototype.isDestroyed=function(){return!1};gW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var _W=gW;var nke=1e3;function Dm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new II({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=rke,this._handleArrowUp=ike;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??aE.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)CHt(t);else return THt(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?ike(t):o?rke(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;ake(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 ike(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 rke(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 AHt(e,t){let n=l(t)?t.availability:void 0;return l(n)?Vv(t,[e]).then(function(i){return e=i[0],e.height+=nke,e}):(e.height+=nke,Promise.resolve(e))}function bHt(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=jv(t,n):t=i.cartesianToCartographic(t),l(a)||(a=AHt(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 xHt(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 THt(e,t,n){let i=e._searchText;if(ske(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 xHt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Mae(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=oke(e,GM.getCreditsFromResult(s[0]));l(a)||Oae(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Oae(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function oke(e,t){return l(t)&&t.forEach(n=>Oae(e,n)),t}function Mae(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function EHt(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 CHt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function ske(e){return/^\s*$/.test(e)}function ake(e){Se.getObservable(e,"_suggestions").removeAll()}async function vHt(e){if(!e.autoComplete)return;let t=e._searchText;if(ake(e),Mae(e),!ske(t))for(let n of e._geocoderServices){let i=await n.geocode(t,aE.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=GM.getCreditsFromResult(o);r=r&&!l(s),oke(e,s)}),r&&Oae(e,n.credit)}if(e._suggestions.length>=5)return}}Dm.flyToDestination=bHt;Dm._updateSearchSuggestions=vHt;Dm._adjustSuggestionsScroll=EHt;Dm.prototype.isDestroyed=function(){return!1};Dm.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Mae(this),le(this)};var yW=Dm;var SHt="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",wHt="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 AW(e){let t=kn(e.container),n=new yW(e);n._startSearchPath=SHt,n._stopSearchPath=wHt;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(AW.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});AW.prototype.isDestroyed=function(){return!1};AW.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),le(this)};var bW=AW;function IHt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function lke(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)lke(e.sublayers[n],t)}function xW(e){return e.modelName==="FullModel"}function uke(e){return e.modelName==="Overview"}function fke(e){return uke(e)||xW(e)}function cke(e,t){if(fke(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 PHt(e,t){if(fke(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");xW(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function DHt(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 RHt(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:IHt,setOptionDisable:function(i,r){Se.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){PHt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){lke(n[i],this.viewModel);let r=cke(n[i],this.viewModel);l(r)&&(uke(r)||!l(this.viewModel.defaultLayer)&&xW(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=cke(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=xW(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return DHt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var TW=RHt;function OHt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` +`);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=QM(e,!1),this._pickStatisticsText=QM(e,!0),this._resourceCacheStatisticsText=nke())};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()}),le(this)};mc.getStatistics=QM;var cW=mc;function lW(e,t){e=kn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new cW(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(lW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lW.prototype.isDestroyed=function(){return!1};lW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var uW=lW;function fW(e,t){l(t)||(t=document.body),t=kn(t);let n=this,i=Se.observable(as.fullscreen),r=Se.observable(as.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&&as.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(){as.fullscreen?as.exitFullscreen():as.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=kn(e)??o.body,this._callback=function(){i(as.fullscreen)},o.addEventListener(as.changeEventName,this._callback)}Object.defineProperties(fW.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});fW.prototype.isDestroyed=function(){return!1};fW.prototype.destroy=function(){document.removeEventListener(as.changeEventName,this._callback),le(this)};var dW=fW;var pHt="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",gHt="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 hW(e,t){e=kn(e);let n=new dW(t,e);n._exitFullScreenPath=gHt,n._enterFullScreenPath=pHt;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(hW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});hW.prototype.isDestroyed=function(){return!1};hW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var mW=hW;function _Ht(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 Rae(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var yHt=new gn,AHt=new h;function eN(e,t){let n=this,i=e.canvas,r=new xa(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 QA({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 n5({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=Rae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=On(function(){let u=n.depthFrustum-1;return n.depthFrustum=Rae(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 V7({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,yHt),g=o.pick(p,n._scene,AHt);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(eN.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}}});eN.prototype._update=function(){this.frustums&&(this.frustumStatisticText=_Ht(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Rae(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}`};eN.prototype.isDestroyed=function(){return!1};eN.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(),le(this)};var pW=eN;function gW(e,t){e=kn(e);let n=document.createElement("div"),i=new pW(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(gW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gW.prototype.isDestroyed=function(){return!1};gW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var _W=gW;var ike=1e3;function Dm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new qw({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=oke,this._handleArrowUp=rke;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??OT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)vHt(t);else return EHt(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?rke(t):o?oke(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;cke(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 rke(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 oke(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 bHt(e,t){let n=l(t)?t.availability:void 0;return l(n)?Xw(t,[e]).then(function(i){return e=i[0],e.height+=ike,e}):(e.height+=ike,Promise.resolve(e))}function xHt(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=oI(t,n):t=i.cartesianToCartographic(t),l(a)||(a=bHt(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 THt(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 EHt(e,t,n){let i=e._searchText;if(ake(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 THt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Mae(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=ske(e,OO.getCreditsFromResult(s[0]));l(a)||Oae(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Oae(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function ske(e,t){return l(t)&&t.forEach(n=>Oae(e,n)),t}function Mae(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function CHt(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 vHt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function ake(e){return/^\s*$/.test(e)}function cke(e){Se.getObservable(e,"_suggestions").removeAll()}async function SHt(e){if(!e.autoComplete)return;let t=e._searchText;if(cke(e),Mae(e),!ake(t))for(let n of e._geocoderServices){let i=await n.geocode(t,OT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=OO.getCreditsFromResult(o);r=r&&!l(s),ske(e,s)}),r&&Oae(e,n.credit)}if(e._suggestions.length>=5)return}}Dm.flyToDestination=xHt;Dm._updateSearchSuggestions=SHt;Dm._adjustSuggestionsScroll=CHt;Dm.prototype.isDestroyed=function(){return!1};Dm.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Mae(this),le(this)};var yW=Dm;var wHt="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",IHt="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 AW(e){let t=kn(e.container),n=new yW(e);n._startSearchPath=wHt,n._stopSearchPath=IHt;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(AW.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});AW.prototype.isDestroyed=function(){return!1};AW.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),le(this)};var bW=AW;function lke(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(lke.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 xW=lke;function TW(e,t,n){e=kn(e);let i=new xW(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(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 Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var EW=TW;function PHt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function fke(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)fke(e.sublayers[n],t)}function CW(e){return e.modelName==="FullModel"}function dke(e){return e.modelName==="Overview"}function hke(e){return dke(e)||CW(e)}function uke(e,t){if(hke(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 DHt(e,t){if(hke(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");CW(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function RHt(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 OHt(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:PHt,setOptionDisable:function(i,r){Se.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){DHt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){fke(n[i],this.viewModel);let r=uke(n[i],this.viewModel);l(r)&&(dke(r)||!l(this.viewModel.defaultLayer)&&CW(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=uke(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=CW(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return RHt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var vW=OHt;function MHt(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" @@ -12813,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let r=new TW(t);Se.track(r),Se.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var dke=OHt;function hke(){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(hke.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var EW=hke;function CW(e){let t=kn(e.container),n=new EW,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(CW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});CW.prototype.isDestroyed=function(){return!1};CW.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),le(this)};var vW=CW;var MHt="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",NHt="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 Nae(){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?NHt:MHt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Nae.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Nae.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var SW=Nae;function wW(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 SW;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(wW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});wW.prototype.isDestroyed=function(){return!1};wW.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(),le(this)};var IW=wW;function mke(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(mke.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 PW=mke;function DW(e,t,n){e=kn(e);let i=new PW(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(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 Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var RW=DW;function Lae(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=O8.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(Lae.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Lae.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var OW=Lae;function MW(e){let t=kn(e.container),n=new OW(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(MW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MW.prototype.isDestroyed=function(){return!1};MW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var NW=MW;function LW(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Qo,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(LW.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}}});LW.prototype.isDestroyed=function(){return!1};LW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var FW=LW;var LHt="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",FHt="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",BHt="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 BW(e,t,n){e=kn(e);let i=new FW(t,n);i._globePath=LHt,i._flatMapPath=FHt,i._columbusViewPath=BHt;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(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 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),le(this)};var kW=BW;function UW(e){this._scene=e,this._orthographic=e.camera.frustum instanceof pn,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 Qo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof pn}),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(UW.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}}});UW.prototype.isDestroyed=function(){return!1};UW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var zW=UW;var kHt="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 VW(e,t){e=kn(e);let n=new zW(t);n._perspectivePath=kHt,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(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(),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),le(this)};var jW=VW;var zHt=new U,HW="-1000px";function tN(e,t,n){this._scene=e,this._screenPositionX=HW,this._screenPositionY=HW,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 pr.worldToWindowCoordinates(e,i,r)}}tN.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,zHt);if(!l(e))this._screenPositionX=HW,this._screenPositionY=HW;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`}}};tN.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ps.EXPONENTIAL_OUT})};tN.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ps.EXPONENTIAL_OUT})};Object.defineProperties(tN.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var GW=tN;function WW(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 GW(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(WW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WW.prototype.isDestroyed=function(){return!1};WW.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),le(this)};var qW=WW;function fE(e,t,n){this._color=e,this._height=t,this._base=n??0}fE.prototype.getHeight=function(){return this._height};fE.prototype.getBase=function(){return this._base};fE.prototype.getStartTime=function(){return this._start};fE.prototype.getStopTime=function(){return this._stop};fE.prototype.setRange=function(e,t){this._start=e,this._stop=t};fE.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 YW=fE;function pke(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)}pke.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 XW=pke;var Fae=1e12,sh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ql={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},lb=[.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],VHt=["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=sh.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=jHt(this),this._onMouseUp=HHt(this),this._onMouseMove=GHt(this),this._onMouseWheel=WHt(this),this._onTouchStart=qHt(this),this._onTouchMove=XHt(this),this._onTouchEnd=YHt(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),le(this)};eu.prototype.addHighlightRange=function(e,t,n){let i=new YW(e,t,n);return this._highlightRanges.push(i),this.resize(),i};eu.prototype.addTrack=function(e,t,n,i){let r=new XW(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!==Fs.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 Bae(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`${VHt[t.month-1]} ${t.day} ${t.year} ${Bae(t.hour)}:${Bae(t.minute)}:${Bae(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=lb.length,V;for(V=0;V<F;++V){let k=lb[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,lb[D]))<1e-5){lb[D]>=f&&(_=lb[D]);break}if(N>=0)for(;N<D;){if(Math.abs(S(_,lb[N]))<1e-5&&lb[N]>=f){C=lb[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 jHt(e){return function(t){e._mouseMode!==sh.touchOnly&&(t.button===0?(e._mouseMode=sh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=sh.zoom:e._mouseMode=sh.slide)),t.preventDefault()}}function HHt(e){return function(t){e._mouseMode=sh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function GHt(e){return function(t){let n;if(e._mouseMode===sh.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===sh.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===sh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function WHt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Fae=Math.max(Math.min(Math.abs(n),Fae),1),n/=Fae,e.zoomFrom(Math.pow(1.05,-n))}}function qHt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=sh.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 YHt(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=sh.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 XHt(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=sh.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 KW=eu;var bke=js(Ake(),1);function JHt(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 xke(){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 ZHt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(xke(),e._locked=!1),e._noSleep.disable(),as.exitFullscreen(),n(!1)):(as.fullscreen||as.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=JHt("landscape")),t.useWebVR=!0,n(!0)))}function $W(e,t){let n=this,i=Se.observable(as.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&&as.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 Qo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof pn)}),this._locked=!1,this._noSleep=new bke.default,this._command=On(function(){ZHt(n,e,r,o)},Se.getObservable(this,"isVREnabled")),this._vrElement=kn(t)??document.body,this._callback=function(){!as.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(xke(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(as.changeEventName,this._callback)}Object.defineProperties($W.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});$W.prototype.isDestroyed=function(){return!1};$W.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(as.changeEventName,this._callback),le(this)};var JW=$W;var QHt="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",eGt="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 ZW(e,t,n){e=kn(e);let i=new JW(t,n);i._exitVRPath=eGt,i._enterVRPath=QHt;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(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 this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var QW=ZW;var Tke=new ue;function vke(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function tGt(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 nGt(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 Eke(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof oo)return i;if(n instanceof pa||n instanceof gv)return new oo({name:nGt(n),description:tGt(n),feature:n})}return sGt(e,t.position)}var iGt=new K;function Vae(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,iGt)),e.updateFromClock(),e.zoomTo(i,r)}}}var rGt=new h;function oGt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Jo)return i}}function sGt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=oGt(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new oo({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=Cke();return}let c=a[0],u=new oo({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,rGt);u.position=new Vu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=Cke())}),s}function Cke(){return new oo({id:"None",description:"No features found."})}function aGt(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 Jp,u=new K7(c),f=!0);let d=new G7(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 Qo;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 qW(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 IW(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 II({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new bW({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 RW(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 kW(A,p));let E;t.projectionPicker&&(E=new jW(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??nW(),q=t.terrainProviderViewModels??iW();v=new tW(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 vW({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 cW(G,new lW(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 KW(G,c),O.addEventListener("settime",vke,!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 hW(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 QW(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){aGt(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=Eke(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=Eke(i,G)}d.screenSpaceEventHandler.setInputAction(k,un.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,un.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,Vae(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(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",vke,!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(),le(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&&Vae(this.timeline,e)};tr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Vae(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 Ske=tr;function cGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new _W(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var wke=cGt;function lGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new Z7(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Ike=lGt;function uGt(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){Pke(s,u),s=f,jae(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?jae(s,u):Pke(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){dE(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=fGt(e,m,c,a),y.onerror=dGt(e,m),y.readAsText(m)}}jae(s,u),e.destroy=H7(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function dE(e){e.stopPropagation(),e.preventDefault()}function Pke(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",dE,!1),n.removeEventListener("dragover",dE,!1),n.removeEventListener("dragexit",dE,!1))}function jae(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",dE,!1),e.addEventListener("dragover",dE,!1),e.addEventListener("dragexit",dE,!1)}function fGt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=C9.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=xT.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=tw.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=S7.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 dGt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Dke=uGt;function hGt(e,t){t=t??H.EMPTY_OBJECT;let n=new NW({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Rke=hGt;function Oke(e){let t=e.split(` + </div>`,n.appendChild(i);let r=new vW(t);Se.track(r),Se.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var mke=MHt;var NHt="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",LHt="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 Nae(){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?LHt:NHt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Nae.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Nae.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var SW=Nae;function wW(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 SW;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(wW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});wW.prototype.isDestroyed=function(){return!1};wW.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(),le(this)};var IW=wW;function pke(){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(pke.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var PW=pke;function DW(e){let t=kn(e.container),n=new PW,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(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 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),le(this)};var RW=DW;function Lae(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=A5.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(Lae.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Lae.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var OW=Lae;function MW(e){let t=kn(e.container),n=new OW(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(MW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MW.prototype.isDestroyed=function(){return!1};MW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var NW=MW;function LW(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 Zo,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(LW.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}}});LW.prototype.isDestroyed=function(){return!1};LW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var FW=LW;var FHt="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",BHt="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 BW(e,t){e=kn(e);let n=new FW(t);n._perspectivePath=FHt,n._orthographicPath=BHt;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(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 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),le(this)};var kW=BW;function UW(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Zo,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(UW.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}}});UW.prototype.isDestroyed=function(){return!1};UW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var zW=UW;var kHt="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",UHt="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",zHt="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 VW(e,t,n){e=kn(e);let i=new zW(t,n);i._globePath=kHt,i._flatMapPath=UHt,i._columbusViewPath=zHt;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(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(),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),le(this)};var jW=VW;var VHt=new U,HW="-1000px";function tN(e,t,n){this._scene=e,this._screenPositionX=HW,this._screenPositionY=HW,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 pr.worldToWindowCoordinates(e,i,r)}}tN.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,VHt);if(!l(e))this._screenPositionX=HW,this._screenPositionY=HW;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`}}};tN.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:ks.EXPONENTIAL_OUT})};tN.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:ks.EXPONENTIAL_OUT})};Object.defineProperties(tN.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var GW=tN;function WW(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 GW(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(WW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WW.prototype.isDestroyed=function(){return!1};WW.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),le(this)};var qW=WW;function fE(e,t,n){this._color=e,this._height=t,this._base=n??0}fE.prototype.getHeight=function(){return this._height};fE.prototype.getBase=function(){return this._base};fE.prototype.getStartTime=function(){return this._start};fE.prototype.getStopTime=function(){return this._stop};fE.prototype.setRange=function(e,t){this._start=e,this._stop=t};fE.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 YW=fE;function gke(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)}gke.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 XW=gke;var Fae=1e12,sh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ql={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},lb=[.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],jHt=["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=sh.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=HHt(this),this._onMouseUp=GHt(this),this._onMouseMove=WHt(this),this._onMouseWheel=qHt(this),this._onTouchStart=YHt(this),this._onTouchMove=KHt(this),this._onTouchEnd=XHt(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),le(this)};eu.prototype.addHighlightRange=function(e,t,n){let i=new YW(e,t,n);return this._highlightRanges.push(i),this.resize(),i};eu.prototype.addTrack=function(e,t,n,i){let r=new XW(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!==Bs.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 Bae(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`${jHt[t.month-1]} ${t.day} ${t.year} ${Bae(t.hour)}:${Bae(t.minute)}:${Bae(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=lb.length,V;for(V=0;V<F;++V){let k=lb[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,lb[D]))<1e-5){lb[D]>=f&&(_=lb[D]);break}if(N>=0)for(;N<D;){if(Math.abs(S(_,lb[N]))<1e-5&&lb[N]>=f){C=lb[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 HHt(e){return function(t){e._mouseMode!==sh.touchOnly&&(t.button===0?(e._mouseMode=sh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=sh.zoom:e._mouseMode=sh.slide)),t.preventDefault()}}function GHt(e){return function(t){e._mouseMode=sh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function WHt(e){return function(t){let n;if(e._mouseMode===sh.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===sh.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===sh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function qHt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Fae=Math.max(Math.min(Math.abs(n),Fae),1),n/=Fae,e.zoomFrom(Math.pow(1.05,-n))}}function YHt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=sh.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 XHt(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=sh.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 KHt(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=sh.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 KW=eu;var xke=js(bke(),1);function ZHt(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 Tke(){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 QHt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(Tke(),e._locked=!1),e._noSleep.disable(),as.exitFullscreen(),n(!1)):(as.fullscreen||as.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=ZHt("landscape")),t.useWebVR=!0,n(!0)))}function $W(e,t){let n=this,i=Se.observable(as.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&&as.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 Zo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof _n)}),this._locked=!1,this._noSleep=new xke.default,this._command=On(function(){QHt(n,e,r,o)},Se.getObservable(this,"isVREnabled")),this._vrElement=kn(t)??document.body,this._callback=function(){!as.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(Tke(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(as.changeEventName,this._callback)}Object.defineProperties($W.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});$W.prototype.isDestroyed=function(){return!1};$W.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(as.changeEventName,this._callback),le(this)};var JW=$W;var eGt="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",tGt="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 ZW(e,t,n){e=kn(e);let i=new JW(t,n);i._exitVRPath=tGt,i._enterVRPath=eGt;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(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 this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var QW=ZW;function Eke(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 ah(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=Oke(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===bc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===bc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===bc.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 mGt=new h,pGt=new h,gGt=new Uc,_Gt=new $;function S0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,mGt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,pGt),i=gGt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,_Gt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(ah.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=Oke(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)}}});ah.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ah.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ah.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};ah.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};ah.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};ah.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};ah.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new K0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};ah.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(` +`}return i}function ah(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=Eke(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===Dc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Dc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Dc.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 nGt=new h,iGt=new h,rGt=new Bc,oGt=new $;function S0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,nGt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,iGt),i=rGt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,oGt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(ah.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=Eke(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)}}});ah.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ah.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ah.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};ah.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};ah.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};ah.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};ah.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new o_({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};ah.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};ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),le(this)};var eq=ah;function tq(e,t){e=kn(e);let n=document.createElement("div"),i=new eq(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)),Hae("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Hae("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Hae("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(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 Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Hae(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 nq=tq;function yGt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new nq(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Mke=yGt;globalThis.CESIUM_VERSION="1.145.0";var O9r="1.145.0";export{P0 as AlphaMode,RU as AlphaPipelineStage,P3 as AnchorPointDirect,D3 as AnchorPointIndirect,cW as Animation,lW as AnimationViewModel,Pr as Appearance,Ni as ApproximateTerrainHeights,sBe as ArcGISTiledElevationTerrainProvider,Fm as ArcGisBaseMapType,D_ as ArcGisMapServerImageryProvider,Jf as ArcGisMapService,fn as ArcType,Rl as ArticulationStageType,zt as AssociativeArray,jE as Atmosphere,aU as AtmospherePipelineStage,cn as AttributeCompression,Vt as AttributeType,nL as AutoExposure,N_ as AutomaticUniforms,Gi as Axis,ud as AxisAlignedBoundingBox,lL as Azure2DImageryProvider,V3 as B3dmLoader,uL as B3dmParser,tW as BaseLayerPicker,Q7 as BaseLayerPickerViewModel,KE as BatchTable,JE as BatchTableHierarchy,uu as BatchTexture,OU as BatchTexturePipelineStage,Lr as Billboard,od as BillboardCollection,zl as BillboardGraphics,Gs as BillboardLoadState,F_ as BillboardTexture,Z5 as BillboardVisualizer,cBe as BingMapsGeocoderService,a2 as BingMapsImageryProvider,gP as BingMapsStyle,Nc as BlendEquation,Jr as BlendFunction,Bi as BlendOption,nn as BlendingState,et as BoundingRectangle,ue as BoundingSphere,Pt as BoundingSphereState,Pb as BoundingVolumeSemantics,Wfe as BoxEmitter,rl as BoxGeometry,Q5 as BoxGeometryUpdater,GS as BoxGraphics,Tp as BoxOutlineGeometry,l2 as BrdfLutGenerator,tt as Buffer,QE as BufferLoader,Wc as BufferPoint,ff as BufferPointCollection,Zm as BufferPointMaterial,Fo as BufferPolygon,$a as BufferPolygonCollection,ad as BufferPolygonMaterial,Pa as BufferPolyline,Sl as BufferPolylineCollection,cd as BufferPolylineMaterial,us as BufferPrimitive,fa as BufferPrimitiveCollection,du as BufferPrimitiveMaterial,Me as BufferUsage,FU as CPUStylingPipelineStage,e9 as CallbackPositionProperty,i0 as CallbackProperty,Or as Camera,uk as CameraEventAggregator,or as CameraEventType,tk as CameraFlightPath,U as Cartesian2,h as Cartesian3,se as Cartesian4,OD as CartesianRectangle,he as Cartographic,lBe as CartographicGeocoderService,fBe as CatmullRomSpline,fC as Cesium3DContentGroup,Yh as Cesium3DTile,Xm as Cesium3DTileBatchTable,lf as Cesium3DTileColorBlendMode,zbe as Cesium3DTileContent,yv as Cesium3DTileContentFactory,Nr as Cesium3DTileContentState,Ua as Cesium3DTileContentType,pa as Cesium3DTileFeature,fp as Cesium3DTileFeatureTable,Wh as Cesium3DTileOptimizationHint,x4 as Cesium3DTileOptimizations,mo as Cesium3DTilePass,Xh as Cesium3DTilePassState,wy as Cesium3DTilePointFeature,vo as Cesium3DTileRefine,Oy as Cesium3DTileStyle,w4 as Cesium3DTileStyleEngine,gv as Cesium3DTileVectorFeature,_W as Cesium3DTilesInspector,pW as Cesium3DTilesInspectorViewModel,D7 as Cesium3DTilesTerrainData,HM as Cesium3DTilesTerrainGeometryProcessor,CBe as Cesium3DTilesTerrainProvider,Dxe as Cesium3DTilesVoxelProvider,Jo as Cesium3DTileset,P4 as Cesium3DTilesetBaseTraversal,C4 as Cesium3DTilesetCache,JS as Cesium3DTilesetGraphics,S4 as Cesium3DTilesetHeatmap,Mv as Cesium3DTilesetMetadata,I4 as Cesium3DTilesetMostDetailedTraversal,R4 as Cesium3DTilesetSkipTraversal,Cp as Cesium3DTilesetStatistics,ic as Cesium3DTilesetTraversal,t9 as Cesium3DTilesetVisualizer,Z7 as CesiumInspector,$7 as CesiumInspectorViewModel,xw as CesiumTerrainProvider,G7 as CesiumWidget,qr as Check,eM as CheckerboardMaterialProperty,U4 as CircleEmitter,SBe as CircleGeometry,wBe as CircleOutlineGeometry,Xz as ClassificationModelDrawCommand,MU as ClassificationPipelineStage,v1 as ClassificationPrimitive,ei as ClassificationType,di as ClearCommand,ha as ClippingPlane,Is as ClippingPlaneCollection,hD as ClippingPolygon,il as ClippingPolygonCollection,Jp as Clock,Fs as ClockRange,Hr as ClockStep,K7 as ClockViewModel,Jxe as CloudCollection,S1 as CloudType,z as Color,Dl as ColorBlendMode,Jt as ColorGeometryInstanceAttribute,Kt as ColorMaterialProperty,H2e as Command,Y as ComponentDatatype,hk as Composite3DTileContent,_Me as CompositeEntityCollection,tM as CompositeMaterialProperty,wc as CompositePositionProperty,Vl as CompositeProperty,$N as CompressedTextureBuffer,_d as ComputeCommand,n5 as ComputeEngine,qV as ConditionsExpression,tTe as ConeEmitter,Vu as ConstantPositionProperty,mi as ConstantProperty,K3 as ConstantSpline,o4 as ContentMetadata,dw as Context,Ut as ContextLimits,S2e as Controller,c5 as ControllerHost,V9 as CoplanarPolygonGeometry,Ly as CoplanarPolygonGeometryLibrary,qh as CoplanarPolygonOutlineGeometry,hr as CornerType,R3 as CorrelationGroup,Lw as CorridorGeometry,gr as CorridorGeometryLibrary,f9 as CorridorGeometryUpdater,qS as CorridorGraphics,u9 as CorridorOutlineGeometry,It as Credit,J4 as CreditDisplay,ms as CubeMap,g3 as CubeMapFace,Hv as CubeMapPanorama,cC as CubicRealPolynomial,ji as CullFace,ca as CullingVolume,Nd as CumulusCloud,d9 as CustomDataSource,IBe as CustomHeightmapTerrainProvider,K0 as CustomShader,W_ as CustomShaderMode,HU as CustomShaderPipelineStage,Nb as CustomShaderTranslucencyMode,h9 as CylinderGeometry,Bw as CylinderGeometryLibrary,p9 as CylinderGeometryUpdater,YS as CylinderGraphics,m9 as CylinderOutlineGeometry,C9 as CzmlDataSource,ks as DataSource,Zp as DataSourceClock,S9 as DataSourceCollection,A7 as DataSourceDisplay,bTe as DebugAppearance,Dg as DebugCameraPrimitive,o8 as DebugInspector,c8 as DebugModelMatrixPrimitive,DBe as DefaultProxy,_c as DepthFunction,g8 as DepthPlane,GU as DequantizationPipelineStage,Sp as DerivedCommand,pe as DeveloperError,y8 as DeviceOrientationCameraController,UTe as DirectionalLight,yP as DiscardEmptyTileImagePolicy,KN as DiscardMissingTileImagePolicy,Gt as DistanceDisplayCondition,ni as DistanceDisplayConditionGeometryInstanceAttribute,Vy as DoubleEndedPriorityQueue,E4 as DoublyLinkedList,sy as DracoLoader,at as DrawCommand,R_ as DynamicAtmosphereLightingType,gy as DynamicEnvironmentMapManager,Kw as DynamicGeometryBatch,Oi as DynamicGeometryUpdater,PN as EarthOrientationParameters,_b as EarthOrientationParametersSample,Ps as EasingFunction,qU as EdgeDetectionPipelineStage,Lh as EdgeDisplayMode,A8 as EdgeFramebuffer,KU as EdgeVisibilityPipelineStage,Xu as EllipseGeometry,Vf as EllipseGeometryLibrary,M9 as EllipseGeometryUpdater,XS as EllipseGraphics,ih as EllipseOutlineGeometry,ee as Ellipsoid,K_ as EllipsoidGeodesic,rc as EllipsoidGeometry,N9 as EllipsoidGeometryUpdater,KS as EllipsoidGraphics,Dd as EllipsoidOutlineGeometry,x8 as EllipsoidPrimitive,Yc as EllipsoidRhumbLine,zTe as EllipsoidSurfaceAppearance,qs as EllipsoidTangentPlane,Ng as EllipsoidTerrainProvider,Ip as EllipsoidalOccluder,gg as Empty3DTileContent,Sn as EncodedCartesian3,oo as Entity,Wd as EntityCluster,lc as EntityCollection,T7 as EntityView,qTe as EquirectangularPanorama,be as Event,Qo as EventHelper,Ih as Expression,Nt as ExpressionNodeType,Hu as ExtrapolationType,dn as FeatureDetection,ux as FeatureIdPipelineStage,R8 as Fog,Ue as ForEach,O8 as FrameRateMonitor,Ix as FrameState,vs as Framebuffer,ci as FramebufferManager,H as Frozen,M8 as FrustumCommands,Wv as FrustumGeometry,i8 as FrustumOutlineGeometry,as as Fullscreen,hW as FullscreenButton,fW as FullscreenButtonViewModel,xx as GaussianSplat3DTileContent,r4 as GaussianSplatPrimitive,e4 as GaussianSplatRenderResources,_v as GaussianSplatSorter,QV as GaussianSplatTextureGenerator,xT as GeoJsonDataSource,H3 as GeoJsonLoader,QTe as GeoJsonPrimitive,aE as GeocodeType,bW as Geocoder,GM as GeocoderService,yW as GeocoderViewModel,Hi as GeographicProjection,ir as GeographicTilingScheme,wt as Geometry,bk as Geometry3DTileContent,Ne as GeometryAttribute,Cn as GeometryAttributes,MBe as GeometryFactory,Bt as GeometryInstance,Fl as GeometryInstanceAttribute,_n as GeometryOffsetAttribute,qn as GeometryPipeline,ZU as GeometryPipelineStage,yh as GeometryType,Mi as GeometryUpdater,fI as GeometryUpdaterSet,o7 as GeometryVisualizer,mp as GetFeatureInfoFormat,dj as Globe,hj as GlobeDepth,W8 as GlobeSurfaceShaderSet,Qh as GlobeSurfaceTile,nj as GlobeSurfaceTileProvider,ij as GlobeTranslucency,mj as GlobeTranslucencyFramebuffer,pj as GlobeTranslucencyState,JP as GltfBufferViewLoader,ZP as GltfDracoLoader,M3 as GltfGpmLoader,yD as GltfGpmLocal,eD as GltfImageLoader,tD as GltfIndexBufferLoader,iD as GltfJsonLoader,yd as GltfLoader,pf as GltfLoaderUtil,B3 as GltfMeshPrimitiveGpmLoader,Yk as GltfSpzLoader,v3 as GltfStructuralMetadataLoader,rD as GltfTextureLoader,oD as GltfVertexBufferLoader,oz as Google2DImageryProvider,cCe as GoogleEarthEnterpriseImageryProvider,QU as GoogleEarthEnterpriseMapsProvider,Ky as GoogleEarthEnterpriseMetadata,WM as GoogleEarthEnterpriseTerrainData,UBe as GoogleEarthEnterpriseTerrainProvider,_j as GoogleEarthEnterpriseTileInformation,VBe as GoogleGeocoderService,Ba as GoogleMaps,lCe as GoogleStreetViewCubeMapPanoramaProvider,S7 as GpxDataSource,Bm as GregorianDate,uCe as GridImageryProvider,sM as GridMaterialProperty,si as GroundGeometryUpdater,nS as GroundPolylineGeometry,Np as GroundPolylinePrimitive,Lu as GroundPrimitive,u1 as GroupMetadata,Eh as HeadingPitchRange,Uc as HeadingPitchRoll,CN as Heap,We as HeightReference,Zh as HeightmapEncoding,al as HeightmapTerrainData,H1 as HeightmapTessellator,g9 as HermitePolynomialApproximation,sx as HermiteSpline,WP as HilbertOrder,RW as HomeButton,PW as HomeButtonViewModel,Wi as HorizontalOrigin,P2e as HybridScreenSpacePanCameraController,dke as I3SBuildingSceneLayerExplorer,TW as I3SBuildingSceneLayerExplorerViewModel,Lp as I3SDataProvider,Ij as I3SDecoder,Pj as I3SFeature,Rj as I3SField,eR as I3SGeometry,oS as I3SLayer,tR as I3SNode,Fj as I3SStatistics,Bj as I3SSublayer,Nj as I3SSymbology,X3 as I3dmLoader,W3 as I3dmParser,ODe as ITwinData,ba as ITwinPlatform,KH as Iau2000Orientation,MN as Iau2006XysData,RE as Iau2006XysSample,$H as IauOrientationAxes,XH as IauOrientationParameters,zC as ImageBasedLighting,lU as ImageBasedLightingPipelineStage,mT as ImageMaterialProperty,DD as Imagery,cV as ImageryConfiguration,MD as ImageryCoverage,uz as ImageryFlags,dz as ImageryInput,Ms as ImageryLayer,Lv as ImageryLayerCollection,Hm as ImageryLayerFeatureInfo,hz as ImageryPipelineStage,Zf as ImageryProvider,jn as ImageryState,lD as Implicit3DTileContent,qP as ImplicitAvailabilityBitstream,YP as ImplicitMetadataView,Ys as ImplicitSubdivisionScheme,fy as ImplicitSubtree,F4 as ImplicitSubtreeCache,Ek as ImplicitSubtreeMetadata,vg as ImplicitTileCoordinates,Cg as ImplicitTileset,je as IndexDatatype,IW as InfoBox,SW as InfoBoxViewModel,Wf as InspectorShared,Bo as InstanceAttributeSemantic,wU as InstancingPipelineStage,jBe as InterpolationAlgorithm,lp as InterpolationType,$t as Intersect,Ti as IntersectionTests,f0 as Intersections2D,Ws as Interval,iR as InvertClassification,sf as Ion,ob as IonGeocodeProviderType,II as IonGeocoderService,Su as IonImageryProvider,PD as IonImageryProviderFactory,Ho as IonResource,qBe as IonSnapGeometryType,XBe as IonSnapHeat,B7 as IonSnapMode,JBe as IonSnapParentGeometryType,e2e as IonSnapService,Ey as IonWorldImageryStyle,it as Iso8601,GH as JobScheduler,Qc as JobType,_y as JsonMetadataTable,K as JulianDate,JN as KTX2Transcoder,to as KeyboardEventModifier,Gr as KeyframeNode,SH as KmlCamera,tw as KmlDataSource,wH as KmlLookAt,PH as KmlTour,RH as KmlTourFlyTo,OH as KmlTourWait,yx as Label,fg as LabelCollection,e0 as LabelGraphics,So as LabelStyle,s7 as LabelVisualizer,_9 as LagrangePolynomialApproximation,_r as LeapSecond,NDe as Light,cg as LightingModel,pz as LightingPipelineStage,yT as LinearApproximation,ox as LinearSpline,I1e as MVTDataProvider,Pu as ManagedArray,_u as MapMode2D,t2e as MapProjection,ez as MapboxImageryProvider,FDe as MapboxStyleImageryProvider,fz as MappedPositions,lr as Material,Sr as MaterialAppearance,Az as MaterialPipelineStage,Ro as MaterialProperty,P as Math,$i as Matrix2,$ as Matrix3,M as Matrix4,qH as Megatexture,F3 as MeshPrimitiveGpmLocal,op as MetadataClass,tg as MetadataClassProperty,Lt as MetadataComponentType,Xn as MetadataEntity,Jk as MetadataEnum,Kk as MetadataEnumValue,YH as MetadataPicking,bd as MetadataPickingPipelineStage,Bh as MetadataPipelineStage,Au as MetadataSchema,Xb as MetadataSchemaLoader,Oh as MetadataSemantic,Dh as MetadataTable,vk as MetadataTableProperty,bt as MetadataType,ph as MipmapHint,Td as Model,Ed as Model3DTileContent,ov as ModelAlphaOptions,Q3 as ModelAnimation,Z3 as ModelAnimationChannel,tU as ModelAnimationCollection,gf as ModelAnimationLoop,dp as ModelAnimationState,dU as ModelArticulation,uU as ModelArticulationStage,pU as ModelClippingPlanesPipelineStage,yU as ModelClippingPolygonsPipelineStage,cx as ModelColorPipelineStage,En as ModelComponents,$z as ModelDrawCommand,Qz as ModelDrawCommands,nU as ModelFeature,iU as ModelFeatureTable,hA as ModelGraphics,lV as ModelImagery,iv as ModelImageryMapping,qz as ModelLightingOptions,IU as ModelMatrixUpdateStage,TU as ModelNode,rv as ModelPrimitiveImagery,La as ModelReader,Bz as ModelRenderResources,DU as ModelRuntimeNode,Lz as ModelRuntimePrimitive,tV as ModelSceneGraph,Vz as ModelSilhouettePipelineStage,Fz as ModelSkin,Gz as ModelSplitterPipelineStage,nV as ModelStatistics,Ko as ModelType,xt as ModelUtility,xU as ModelVectorLookupPipelineStage,a7 as ModelVisualizer,eG as Moon,xz as MorphTargetsPipelineStage,n2e as MorphWeightSpline,Px as MortonOrder,hc as MouseButton,c4 as Multiple3DTileContent,eL as MultisampleFramebuffer,vW as NavigationHelpButton,EW as NavigationHelpButtonViewModel,qt as NearFarScalar,P1e as NeverTileDiscardPolicy,Wz as NodeRenderResources,PU as NodeStatisticsPipelineStage,$S as NodeTransformationProperty,rG as OIT,e5 as Occluder,vr as OffsetGeometryInstanceAttribute,i2e as OpenCageGeocoderService,SA as OpenStreetMapImageryProvider,aG as OrderedGroundPrimitiveCollection,en as OrientedBoundingBox,pn as OrthographicFrustum,ws as OrthographicOffCenterFrustum,r2e as Packable,o2e as PackableForInterpolation,M1e as Panorama,N1e as PanoramaProvider,CO as Particle,B1e as ParticleBurst,U1e as ParticleEmitter,j1e as ParticleSystem,Ie as Pass,Dc as PassState,mA as PathGraphics,d_ as PathMode,h7 as PathVisualizer,F7 as PeliasGeocoderService,An as PerInstanceColorAppearance,wA as PerformanceDisplay,NW as PerformanceWatchdog,OW as PerformanceWatchdogViewModel,Zi as PerspectiveFrustum,pu as PerspectiveOffCenterFrustum,fG as PickDepth,dG as PickDepthFramebuffer,pG as PickFramebuffer,i5 as PickId,hG as PickedMetadataInfo,wG as Picking,Tz as PickingPipelineStage,Qy as PinBuilder,ze as PixelDatatype,$e as PixelFormat,_G as PlanarFillIdFramebuffer,sn as Plane,B9 as PlaneGeometry,z9 as PlaneGeometryUpdater,EH as PlaneGraphics,U9 as PlaneOutlineGeometry,rV as PntsLoader,av as PntsParser,DG as PointCloud,Ay as PointCloudEyeDomeLighting,ig as PointCloudShading,Cz as PointCloudStylingPipelineStage,ZS as PointGraphics,ja as PointPrimitive,dO as PointPrimitiveCollection,m7 as PointVisualizer,ng as PolygonGeometry,ti as PolygonGeometryLibrary,G9 as PolygonGeometryUpdater,t0 as PolygonGraphics,tl as PolygonHierarchy,H9 as PolygonOutlineGeometry,hi as PolygonPipeline,Vh as Polyline,aM as PolylineArrowMaterialProperty,Ap as PolylineCollection,$s as PolylineColorAppearance,cM as PolylineDashMaterialProperty,Hy as PolylineGeometry,g7 as PolylineGeometryUpdater,lM as PolylineGlowMaterialProperty,jl as PolylineGraphics,Cc as PolylineMaterialAppearance,WT as PolylineOutlineMaterialProperty,ur as PolylinePipeline,y7 as PolylineVisualizer,W9 as PolylineVolumeGeometry,m0 as PolylineVolumeGeometryLibrary,Y9 as PolylineVolumeGeometryUpdater,QS as PolylineVolumeGraphics,q9 as PolylineVolumeOutlineGeometry,Qp as PositionProperty,gA as PositionPropertyArray,zr as PostProcessStage,$G as PostProcessStageCollection,Lf as PostProcessStageComposite,Zd as PostProcessStageLibrary,Jd as PostProcessStageSampleMode,lw as PostProcessStageTextureCache,L3 as PpeMetadata,F2e as PpeSource,N3 as PpeTexture,Nn as Primitive,Hl as PrimitiveCollection,kC as PrimitiveLoadPlan,BC as PrimitiveOutlineGenerator,wz as PrimitiveOutlinePipelineStage,vv as PrimitivePipeline,Yz as PrimitiveRenderResources,gs as PrimitiveState,Iz as PrimitiveStatisticsPipelineStage,Oe as PrimitiveType,jW as ProjectionPicker,zW as ProjectionPickerViewModel,X as Property,uM as PropertyArray,LC as PropertyAttribute,T3 as PropertyAttributeProperty,ju as PropertyBag,xu as PropertyTable,yy as PropertyTexture,x3 as PropertyTextureProperty,yo as ProviderViewModel,c2e as Proxy,mu as QuadraticRealPolynomial,rj as QuadtreeOccluders,fj as QuadtreePrimitive,sj as QuadtreeTile,sc as QuadtreeTileLoadState,gRe as QuadtreeTileProvider,_w as QuantizedMeshTerrainData,Q2 as QuarticRealPolynomial,Le as Quaternion,J3 as QuaternionSpline,Qb as Queue,gn as Ray,ie as Rectangle,gI as RectangleCollisionChecker,aI as RectangleGeometry,za as RectangleGeometryLibrary,X9 as RectangleGeometryUpdater,n0 as RectangleGraphics,Ev as RectangleOutlineGeometry,Xi as ReferenceFrame,_A as ReferenceProperty,Ge as RenderState,Qf as Renderbuffer,lu as RenderbufferFormat,Oo as Request,O0 as RequestErrorEvent,Tl as RequestScheduler,wi as RequestState,oa as RequestType,De as Resource,ki as ResourceCache,bu as ResourceCacheKey,Qk as ResourceCacheStatistics,rr as ResourceLoader,Ct as ResourceLoaderState,_m as Rotation,oe as RuntimeError,ry as S2Cell,Ka as SDFSettings,Ic as SampledPositionProperty,Xd as SampledProperty,Ht as Sampler,Zg as ScaledPositionProperty,N5 as Scene,ow as SceneFramebuffer,re as SceneMode,Pz as SceneMode2DPipelineStage,kW as SceneModePicker,FW as SceneModePickerViewModel,pr as SceneTransforms,u5 as SceneTransitioner,b5 as ScreenSpaceCameraController,W7 as ScreenSpaceElevatorCameraController,ma as ScreenSpaceEventHandler,un as ScreenSpaceEventType,v0 as ScreenSpaceInputBindings,q7 as ScreenSpaceMapCameraController,D2e as ScreenSpaceTiltOrbitCameraController,R2e as ScreenSpaceZoomCameraController,fx as SelectedFeatureIdPipelineStage,qW as SelectionIndicator,GW as SelectionIndicatorViewModel,GO as SensorVolumePortionToDisplay,X_ as ShaderBuilder,r5 as ShaderCache,de as ShaderDestination,F2 as ShaderFunction,Qt as ShaderProgram,Xe as ShaderSource,L2 as ShaderStruct,DA as ShadowMap,s0 as ShadowMapShader,Pn as ShadowMode,Md as ShadowVolumeAppearance,T5 as SharedContext,Dn as ShowGeometryInstanceAttribute,TT as Simon1994PlanetaryPositions,l2e as SimplePolylineGeometry,tz as SingleTileImageryProvider,Rz as SkinningPipelineStage,B5 as SkyAtmosphere,k5 as SkyBox,E5 as SnapFramebuffer,u2e as SnapService,C5 as Snapping,P5 as SpatialNode,O3 as Spdcf,up as SpecularEnvironmentCubeMap,jOe as SphereEmitter,C8 as SphereGeometry,By as SphereOutlineGeometry,y9 as Spherical,Mr as Spline,Wo as SplitDirection,OO as Splitter,Tm as StaticGeometryColorBatch,Cm as StaticGeometryPerMaterialBatch,PM as StaticGroundGeometryColorBatch,r7 as StaticGroundGeometryPerMaterialBatch,_7 as StaticGroundPolylinePerMaterialBatch,DM as StaticOutlineGeometryBatch,Xt as StencilConstants,Zn as StencilFunction,Rt as StencilOperation,$3 as SteppedSpline,Pl as Stereographic,nx as StorageType,fM as StripeMaterialProperty,p0 as StripeOrientation,ec as StructuralMetadata,hp as StyleCommandsNeeded,HOe as StyleExpression,j5 as Sun,MA as SunLight,w5 as SunPostProcess,I3 as SupportedImageFormats,X7 as SvgPathBindingHandler,mG as Sync,Kn as TaskProcessor,X5 as Terrain,Ef as TerrainData,wo as TerrainEncoding,Y1 as TerrainFillMesh,Tc as TerrainMesh,Iw as TerrainOffsetProperty,V8 as TerrainPicker,Xr as TerrainProvider,oc as TerrainQuantization,kr as TerrainState,Dt as Texture,WH as Texture3D,ZE as TextureAtlas,o5 as TextureCache,$n as TextureMagnificationFilter,R2 as TextureManager,Wt as TextureMinificationFilter,mP as TexturePacker,O2 as TextureUniform,hn as TextureWrap,d0 as TileAvailability,Pd as TileBoundingRegion,_4 as TileBoundingS2Cell,ky as TileBoundingSphere,ZOe as TileBoundingVolume,K5 as TileCoordinatesImageryProvider,QOe as TileDiscardPolicy,In as TileEdge,RD as TileImagery,dx as TileMapServiceImageryProvider,s4 as TileMetadata,bf as TileOrientedBoundingBox,Zr as TileProviderError,cj as TileReplacementQueue,gi as TileSelectionResult,tMe as TileState,dV as Tileset3DTileContent,T4 as TilesetMetadata,rU as TilesetPipelineStage,f2e as TilingScheme,Un as TimeConstants,ev as TimeDynamicImagery,ZO as TimeDynamicPointCloud,vn as TimeInterval,Bs as TimeIntervalCollection,YA as TimeIntervalCollectionPositionProperty,AA as TimeIntervalCollectionProperty,ai as TimeStandard,KW as Timeline,YW as TimelineHighlightRange,XW as TimelineTrack,t3 as Tipsify,uE as ToggleButtonViewModel,OA as Tonemapper,dA as TrackingReferenceFrame,At as Transforms,lx as TranslationRotationScale,bG as TranslucentTileClassification,ED as TridiagonalSystemSolver,HI as TrustedServers,hw as TweenCollection,s5 as UniformState,X0 as UniformType,tG as UrlTemplate3DTilesDataProvider,Ss as UrlTemplateImageryProvider,O9r as VERSION,QW as VRButton,JW as VRButtonViewModel,p2e as VRTheWorldTerrainProvider,M2e as VaryingType,J0 as Vector3DTileBatch,HV as Vector3DTileClampedPolylines,WV as Vector3DTileContent,ey as Vector3DTileGeometry,kV as Vector3DTilePoints,UV as Vector3DTilePolygons,mv as Vector3DTilePolylines,hC as Vector3DTilePrimitive,Ax as VectorGltf3DTileContent,Rs as VectorPipeline,My as VectorProvider,A9 as VelocityOrientationProperty,XA as VelocityVectorProperty,Vn as VertexArray,V_ as VertexArrayFacade,ct as VertexAttributeSemantic,Be as VertexFormat,br as VerticalExaggeration,Mz as VerticalExaggerationPipelineStage,Wn as VerticalOrigin,d2e as VideoSynchronizer,aw as View,Ske as Viewer,sMe as ViewportQuad,Zo as Visibility,iBe as Visualizer,Y_ as VoxelBoundsCollection,Bv as VoxelBoxShape,I5 as VoxelCell,Fv as VoxelContent,kv as VoxelCylinderShape,Uv as VoxelEllipsoidShape,nq as VoxelInspector,eq as VoxelInspectorViewModel,$0 as VoxelMetadataOrder,LT as VoxelPrimitive,aMe as VoxelProvider,J2 as VoxelRenderResources,cMe as VoxelShape,bc as VoxelShapeType,R5 as VoxelTraversal,_2e as VulkanConstants,$9 as WallGeometry,lI as WallGeometryLibrary,Z9 as WallGeometryUpdater,pA as WallGraphics,J9 as WallOutlineGeometry,te as WebGLConstants,iz as WebMapServiceImageryProvider,rz as WebMapTileServiceImageryProvider,xi as WebMercatorProjection,Mo as WebMercatorTilingScheme,aa as WindingOrder,ND as WireframeIndexGenerator,Nz as WireframePipelineStage,RG as _shadersAcesTonemappingStage,v5 as _shadersAdditiveBlend,EO as _shadersAdjustTranslucentFS,v8 as _shadersAllMaterialAppearanceFS,S8 as _shadersAllMaterialAppearanceVS,OG as _shadersAmbientOcclusionGenerate,MG as _shadersAmbientOcclusionModulate,pV as _shadersAspectRampMaterial,cp as _shadersAtmosphereCommon,oU as _shadersAtmosphereStageFS,sU as _shadersAtmosphereStageVS,w8 as _shadersBasicMaterialAppearanceFS,I8 as _shadersBasicMaterialAppearanceVS,n2 as _shadersBillboardCollectionFS,i2 as _shadersBillboardCollectionVS,NG as _shadersBlackAndWhite,LG as _shadersBloomComposite,c2 as _shadersBrdfLutGeneratorFS,S5 as _shadersBrightPass,FG as _shadersBrightness,m2 as _shadersBufferPointMaterialFS,h2 as _shadersBufferPointMaterialVS,_2 as _shadersBufferPolygonMaterialFS,g2 as _shadersBufferPolygonMaterialVS,x2 as _shadersBufferPolylineMaterialFS,b2 as _shadersBufferPolylineMaterialVS,gV as _shadersBumpMapMaterial,LU as _shadersCPUStylingStageFS,NU as _shadersCPUStylingStageVS,_V as _shadersCheckerboardMaterial,H4 as _shadersCloudCollectionFS,G4 as _shadersCloudCollectionVS,W4 as _shadersCloudNoiseFS,q4 as _shadersCloudNoiseVS,AG as _shadersCompareAndPackTranslucentDepth,iG as _shadersCompositeOITFS,sw as _shadersCompositeTranslucentClassification,_3 as _shadersComputeIrradianceFS,y3 as _shadersComputeRadianceMapFS,yz as _shadersConstantLodStageFS,_z as _shadersConstantLodStageVS,BG as _shadersContrastBias,A3 as _shadersConvolveSpecularMapFS,b3 as _shadersConvolveSpecularMapVS,t8 as _shadersCubeMapPanoramaVS,kU as _shadersCustomShaderStageFS,BU as _shadersCustomShaderStageVS,$E as _shadersCzmBuiltins,kG as _shadersDepthOfField,h8 as _shadersDepthPlaneFS,m8 as _shadersDepthPlaneVS,UG as _shadersDepthView,N2e as _shadersDepthViewPacked,yV as _shadersDotMaterial,zG as _shadersEdgeDetection,WU as _shadersEdgeDetectionStageFS,YU as _shadersEdgeVisibilityStageFS,XU as _shadersEdgeVisibilityStageVS,AV as _shadersElevationBandMaterial,bV as _shadersElevationContourMaterial,xV as _shadersElevationRampMaterial,U1 as _shadersEllipsoidFS,T8 as _shadersEllipsoidSurfaceAppearanceFS,E8 as _shadersEllipsoidSurfaceAppearanceVS,z1 as _shadersEllipsoidVS,HG as _shadersFXAA,KG as _shadersFXAA3_11,TV as _shadersFadeMaterial,UU as _shadersFeatureIdStageFS,zU as _shadersFeatureIdStageVS,VG as _shadersFilmicTonemapping,IT as _shadersGaussianBlur1D,$U as _shadersGeometryStageFS,JU as _shadersGeometryStageVS,H8 as _shadersGlobeFS,G8 as _shadersGlobeVS,EV as _shadersGridMaterial,W1 as _shadersGroundAtmosphere,WF as _shadersHSBToRGB,qF as _shadersHSLToRGB,cU as _shadersImageBasedLightingStageFS,EU as _shadersInstancingStageCommon,CU as _shadersInstancingStageVS,H2 as _shadersIntersectBox,G2 as _shadersIntersectCylinder,V2 as _shadersIntersectDepth,W2 as _shadersIntersectEllipsoid,NP as _shadersIntersectLongitude,j2 as _shadersIntersectPlane,sC as _shadersIntersection,z2 as _shadersIntersectionUtils,vU as _shadersLegacyInstancingStageVS,GG as _shadersLensFlare,mz as _shadersLightingStageFS,gz as _shadersMaterialStageFS,$2 as _shadersMegatexture,VU as _shadersMetadataStageFS,jU as _shadersMetadataStageVS,mU as _shadersModelClippingPlanesStageFS,gU as _shadersModelClippingPolygonsStageFS,_U as _shadersModelClippingPolygonsStageVS,hU as _shadersModelColorStageFS,Zz as _shadersModelFS,kz as _shadersModelSilhouetteStageFS,Uz as _shadersModelSilhouetteStageVS,jz as _shadersModelSplitterStageFS,Jz as _shadersModelVS,bU as _shadersModelVectorLookupStageFS,AU as _shadersModelVectorLookupStageVS,WG as _shadersModifiedReinhardTonemapping,bz as _shadersMorphTargetsStageVS,qG as _shadersNightVision,CV as _shadersNormalMapMaterial,K2 as _shadersOctree,vf as _shadersPassThrough,zx as _shadersPassThroughDepth,jG as _shadersPbrNeutralTonemapping,u4 as _shadersPerInstanceColorAppearanceFS,f4 as _shadersPerInstanceColorAppearanceVS,Cv as _shadersPerInstanceFlatColorAppearanceFS,d4 as _shadersPerInstanceFlatColorAppearanceVS,z3 as _shadersPointCloudEyeDomeLighting,Ez as _shadersPointCloudStylingStageVS,gT as _shadersPointPrimitiveCollectionFS,CH as _shadersPointPrimitiveCollectionVS,vV as _shadersPolylineArrowMaterial,s8 as _shadersPolylineColorAppearanceVS,hu as _shadersPolylineCommon,SV as _shadersPolylineDashMaterial,fv as _shadersPolylineFS,wV as _shadersPolylineGlowMaterial,Sj as _shadersPolylineMaterialAppearanceVS,IV as _shadersPolylineOutlineMaterial,Tj as _shadersPolylineShadowVolumeFS,Ej as _shadersPolylineShadowVolumeMorphFS,Cj as _shadersPolylineShadowVolumeMorphVS,vj as _shadersPolylineShadowVolumeVS,mV as _shadersPolylineVS,n4 as _shadersPrimitiveGaussianSplatFS,t4 as _shadersPrimitiveGaussianSplatVS,Sz as _shadersPrimitiveOutlineStageFS,vz as _shadersPrimitiveOutlineStageVS,yB as _shadersRGBToHSB,AB as _shadersRGBToHSL,bB as _shadersRGBToXYZ,YG as _shadersReinhardTonemapping,az as _shadersReprojectWebMercatorFS,cz as _shadersReprojectWebMercatorVS,PV as _shadersRimLightingMaterial,SD as _shadersSelectedFeatureIdStageCommon,C1 as _shadersShadowVolumeAppearanceFS,z4 as _shadersShadowVolumeAppearanceVS,kb as _shadersShadowVolumeFS,XG as _shadersSilhouette,Dz as _shadersSkinningStageVS,WO as _shadersSkyAtmosphereCommon,L5 as _shadersSkyAtmosphereFS,F5 as _shadersSkyAtmosphereVS,Q4 as _shadersSkyBoxFS,e8 as _shadersSkyBoxVS,DV as _shadersSlopeRampMaterial,RV as _shadersStripeMaterial,U5 as _shadersSunFS,z5 as _shadersSunTextureFS,V5 as _shadersSunVS,P8 as _shadersTexturedMaterialAppearanceFS,D8 as _shadersTexturedMaterialAppearanceVS,jV as _shadersVector3DTileClampedPolylinesFS,VV as _shadersVector3DTileClampedPolylinesVS,zV as _shadersVector3DTilePolylinesVS,Ty as _shadersVectorCommon,HP as _shadersVectorTileVS,Oz as _shadersVerticalExaggerationStageVS,$5 as _shadersViewportQuadFS,uw as _shadersViewportQuadVS,k2 as _shadersVoxelFS,B2 as _shadersVoxelUtils,U2 as _shadersVoxelVS,MV as _shadersWater,OV 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,q2 as _shadersconvertLocalToBoxUv,Y2 as _shadersconvertLocalToCylinderUv,X2 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,Qn as addAllToArray,Lk as addBuffer,Sk as addDefaults,Ok as addExtensionsRequired,Rh as addExtensionsUsed,Yb as addPipelineExtras,Ma as addToArray,bN as appendForwardSlash,Br as arrayRemoveDuplicates,pfe as assert,SC as barycentricCoordinates,Dr as binarySearch,Zt as buildModuleUrl,w2 as buildVectorGltfFromMVT,MP as buildVoxelCustomShader,Z2 as buildVoxelDrawCommands,Ze as clone,Ot as combine,jv as computeFlyToLocationForRectangle,cv as createBillboardPointCallback,I2 as createColorRamp,On as createCommand,nW as createDefaultImageryProviderViewModels,iW as createDefaultTerrainProviderViewModels,oTe as createElevationBandMaterial,aTe as createGooglePhotorealistic3DTileset,Jn as createGuid,_o as createMaterialPropertyDescriptor,cTe as createOsmBuildingsAsync,me as createPropertyDescriptor,zu as createRawPropertyDescriptor,lTe as createTangentSpaceDebugPrimitive,B2e as createTaskProcessorWorker,QB as createUniform,e2 as createUniformArray,KV as createVectorTileBuffersFromModelComponents,Y5 as createWorldBathymetryAsync,Cy as createWorldImageryAsync,Tw as createWorldTerrainAsync,gj as decodeGoogleEarthEnterpriseData,d8 as decodeMVT,GV as decodeVectorPolylinePositions,C0 as defaultPickWorldPosition,rf as defer,l as defined,WB as demodernizeShader,Yr as deprecationWarning,le as destroyObject,HFe as exportKml,_C as findAccessorMinMax,Av as findContentMetadata,bv as findGroupMetadata,Hb as findMeshoptExtension,a4 as findTileMetadata,nD as forEachTextureInMaterial,W0 as formatError,oue as freezeRenderState,dh as getAbsoluteUri,mf as getAccessorByteStride,xN as getBaseUri,gh as getBinaryAccessor,N8 as getClipAndStyleCode,$v as getClippingFunction,cy as getComponentReader,kn as getElement,v_ as getExtensionFromUri,Zy as getFilenameFromUri,P2 as getImageFromTypedArray,km as getImagePixels,Lo as getJsonFromTypedArray,np as getMagic,k3 as getMeshPrimitives,L8 as getMetadataClassProperty,F8 as getMetadataProperty,cf as getStringFromTypedArray,xn as getTimestamp,ar as hasExtension,UA as heightReferenceOnEntityPropertyChanged,Bl as isBitSet,vE as isBlobUri,yb as isCrossOriginUrl,zm as isDataUri,ou as isLeapYear,Se as knockout,DI as knockout_3_5_1,Y7 as knockout_es5,SE as loadAndExecuteScript,Z4 as loadCubeMap,ay as loadImageFromTypedArray,of as loadKTX2,Pg as mergeSort,h0 as mostDetailedSurfaceHeight,Rk as moveTechniqueRenderStates,Mk as moveTechniquesToExtension,fd as numberOfComponentsForType,wE as objectToQuery,yt as oneTimeWarning,by as parseBatchTable,C3 as parseFeatureMetadataLegacy,gC as parseGlb,EN as parseResponseHeaders,E3 as parseStructuralMetadata,kD as pickModel,s2e as pointInsideTriangle,BA as positionForSurfaceHeight,Ny as preprocess3DTileContent,N2 as processVoxelProperties,Xf as queryToObject,Fk as readAccessorPacked,yC as removeExtension,Ik as removeExtensionsRequired,pC as removeExtensionsUsed,Dk as removePipelineExtras,Nk as removeUnusedElements,p2 as renderBufferPointCollection,A2 as renderBufferPolygonCollection,E2 as renderBufferPolylineCollection,Mb as resizeImageToNextPowerOfTwo,X4 as sampleTerrain,Vv as sampleTerrainMostDetailed,AE as scaleToGeodeticSurface,iS as srgbToLinear,h4 as subdivideArray,Oc as subscribeAndEvaluate,kk as updateAccessorComponentTypes,zk as updateVersion,Yo as usesExtension,wke as viewerCesium3DTilesInspectorMixin,Ike as viewerCesiumInspectorMixin,Dke as viewerDragDropMixin,Rke as viewerPerformanceWatchdogMixin,Mke as viewerVoxelInspectorMixin,y2e as webGLConstantToGlslType,H7 as wrapFunction,uv as writeTextToCanvas}; +`);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};ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),le(this)};var eq=ah;function tq(e,t){e=kn(e);let n=document.createElement("div"),i=new eq(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)),Vae("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Vae("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Vae("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(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 Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Vae(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 nq=tq;var Cke=new ue;function wke(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function sGt(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 aGt(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 vke(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 la||n instanceof Mv)return new Qr({name:aGt(n),description:sGt(n),feature:n})}return fGt(e,t.position)}var cGt=new K;function jae(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,cGt)),e.updateFromClock(),e.zoomTo(i,r)}}}var lGt=new h;function uGt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Jo)return i}}function fGt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=uGt(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=Ske();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,lGt);u.position=new hu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=Ske())}),s}function Ske(){return new Qr({id:"None",description:"No features found."})}function dGt(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 Mp,u=new K7(c),f=!0);let d=new G7(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 Zo;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 qW(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 IW(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 qw({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new bW({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 EW(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 jW(A,p));let E;t.projectionPicker&&(E=new kW(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??Q7(),q=t.terrainProviderViewModels??eW();v=new Z7(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 RW({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 oW(G,new sW(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 KW(G,c),O.addEventListener("settime",wke,!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 mW(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 QW(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){dGt(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=vke(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=vke(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,jae(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",wke,!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(),le(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,Cke)!==Pt.FAILED?n=Cke.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&&jae(this.timeline,e)};tr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&jae(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 Ike=tr;function hGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new uW(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Pke=hGt;function mGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new _W(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Dke=mGt;function pGt(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){Rke(s,u),s=f,Hae(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Hae(s,u):Rke(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){dE(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=gGt(e,m,c,a),y.onerror=_Gt(e,m),y.readAsText(m)}}Hae(s,u),e.destroy=tG(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function dE(e){e.stopPropagation(),e.preventDefault()}function Rke(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",dE,!1),n.removeEventListener("dragover",dE,!1),n.removeEventListener("dragexit",dE,!1))}function Hae(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",dE,!1),e.addEventListener("dragover",dE,!1),e.addEventListener("dragexit",dE,!1)}function gGt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=K4.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=ET.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Pw.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=U6.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 _Gt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Oke=pGt;function yGt(e,t){t=t??H.EMPTY_OBJECT;let n=new NW({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Mke=yGt;function AGt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new nq(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Nke=AGt;globalThis.CESIUM_VERSION="1.145.0";var M9r="1.145.0";export{Q0 as AlphaMode,gU as AlphaPipelineStage,d3 as AnchorPointDirect,h3 as AnchorPointIndirect,oW as Animation,sW as AnimationViewModel,Dr as Appearance,Ni as ApproximateTerrainHeights,P1e as ArcGISTiledElevationTerrainProvider,Ap as ArcGisBaseMapType,vy as ArcGisMapServerImageryProvider,gd as ArcGisMapService,ln as ArcType,Ol as ArticulationStageType,kt as AssociativeArray,HC as Atmosphere,q3 as AtmospherePipelineStage,cn as AttributeCompression,Vt as AttributeType,nG as AutoExposure,F_ as AutomaticUniforms,qi as Axis,td as AxisAlignedBoundingBox,ez as Azure2DImageryProvider,S3 as B3dmLoader,v3 as B3dmParser,Z7 as BaseLayerPicker,$7 as BaseLayerPickerViewModel,XE as BatchTable,bC as BatchTableHierarchy,Au as BatchTexture,_U as BatchTexturePipelineStage,Fr as Billboard,vd as BillboardCollection,bl as BillboardGraphics,Ks as BillboardLoadState,Oy as BillboardTexture,XN as BillboardVisualizer,R1e as BingMapsGeocoderService,VU as BingMapsImageryProvider,LD as BingMapsStyle,Uc as BlendEquation,Jr as BlendFunction,ki as BlendOption,nn as BlendingState,et as BoundingRectangle,ue as BoundingSphere,Pt as BoundingSphereState,Zb as BoundingVolumeSemantics,HOe as BoxEmitter,kc as BoxGeometry,q2 as BoxGeometryUpdater,nC as BoxGraphics,Gm as BoxOutlineGeometry,rG as BrdfLutGenerator,nt as Buffer,EC as BufferLoader,tl as BufferPoint,Af as BufferPointCollection,wp as BufferPointMaterial,Lo as BufferPolygon,Za as BufferPolygonCollection,fd as BufferPolygonMaterial,Ra as BufferPolyline,Ul as BufferPolylineCollection,dd as BufferPolylineMaterial,ms as BufferPrimitive,fa as BufferPrimitiveCollection,Eu as BufferPrimitiveMaterial,Me as BufferUsage,xU as CPUStylingPipelineStage,Y2 as CallbackPositionProperty,np as CallbackProperty,Nr as Camera,FG as CameraEventAggregator,mr as CameraEventType,IG as CameraFlightPath,U as Cartesian2,h as Cartesian3,se as Cartesian4,GD as CartesianRectangle,he as Cartographic,O1e as CartographicGeocoderService,N1e as CatmullRomSpline,AC as Cesium3DContentGroup,Gh as Cesium3DTile,cp as Cesium3DTileBatchTable,ff as Cesium3DTileColorBlendMode,zMe as Cesium3DTileContent,Lv as Cesium3DTileContentFactory,Mr as Cesium3DTileContentState,ka as Cesium3DTileContentType,la as Cesium3DTileFeature,pp as Cesium3DTileFeatureTable,jh as Cesium3DTileOptimizationHint,c4 as Cesium3DTileOptimizations,po as Cesium3DTilePass,xm as Cesium3DTilePassState,Ny as Cesium3DTilePointFeature,So as Cesium3DTileRefine,Uy as Cesium3DTileStyle,h4 as Cesium3DTileStyleEngine,Mv as Cesium3DTileVectorFeature,uW as Cesium3DTilesInspector,cW as Cesium3DTilesInspectorViewModel,TH as Cesium3DTilesTerrainData,IO as Cesium3DTilesTerrainGeometryProcessor,K1e as Cesium3DTilesTerrainProvider,rNe as Cesium3DTilesVoxelProvider,Jo as Cesium3DTileset,p4 as Cesium3DTilesetBaseTraversal,u4 as Cesium3DTilesetCache,lC as Cesium3DTilesetGraphics,d4 as Cesium3DTilesetHeatmap,Xv as Cesium3DTilesetMetadata,m4 as Cesium3DTilesetMostDetailedTraversal,_4 as Cesium3DTilesetSkipTraversal,Pp as Cesium3DTilesetStatistics,ic as Cesium3DTilesetTraversal,x4 as Cesium3DTilesetVisualizer,_W as CesiumInspector,pW as CesiumInspectorViewModel,Uw as CesiumTerrainProvider,G7 as CesiumWidget,qr as Check,O1 as CheckerboardMaterialProperty,zG as CircleEmitter,rRe as CircleGeometry,oRe as CircleOutlineGeometry,Wz as ClassificationModelDrawCommand,yU as ClassificationPipelineStage,pP as ClassificationPrimitive,Qn as ClassificationType,hi as ClearCommand,ua as ClippingPlane,Ps as ClippingPlaneCollection,gD as ClippingPolygon,Zc as ClippingPolygonCollection,Mp as Clock,Bs as ClockRange,Hr as ClockStep,K7 as ClockViewModel,fNe as CloudCollection,XO as CloudType,z as Color,Rl as ColorBlendMode,Jt as ColorGeometryInstanceAttribute,Kt as ColorMaterialProperty,G2e as Command,Y as ComponentDatatype,J2 as Composite3DTileContent,ixe as CompositeEntityCollection,F1 as CompositeMaterialProperty,xc as CompositePositionProperty,Vl as CompositeProperty,iL as CompressedTextureBuffer,hd as ComputeCommand,eH as ComputeEngine,BV as ConditionsExpression,dNe as ConeEmitter,hu as ConstantPositionProperty,fi as ConstantProperty,N3 as ConstantSpline,$V as ContentMetadata,Mw as Context,zt as ContextLimits,w2e as Controller,a7 as ControllerHost,m8 as CoplanarPolygonGeometry,jy as CoplanarPolygonGeometryLibrary,Hh as CoplanarPolygonOutlineGeometry,ur as CornerType,m3 as CorrelationGroup,nS as CorridorGeometry,gr as CorridorGeometryLibrary,R4 as CorridorGeometryUpdater,rC as CorridorGraphics,D4 as CorridorOutlineGeometry,It as Credit,KG as CreditDisplay,us as CubeMap,gL as CubeMapFace,sI as CubeMapPanorama,zE as CubicRealPolynomial,Gi as CullFace,ca as CullingVolume,Qd as CumulusCloud,F4 as CustomDataSource,sRe as CustomHeightmapTerrainProvider,o_ as CustomShader,Cy as CustomShaderMode,IU as CustomShaderPipelineStage,ux as CustomShaderTranslucencyMode,B4 as CylinderGeometry,rS as CylinderGeometryLibrary,U4 as CylinderGeometryUpdater,oC as CylinderGraphics,k4 as CylinderOutlineGeometry,K4 as CzmlDataSource,Fs as DataSource,Np as DataSourceClock,J4 as DataSourceCollection,q8 as DataSourceDisplay,RNe as DebugAppearance,c_ as DebugCameraPrimitive,e5 as DebugInspector,n5 as DebugModelMatrixPrimitive,cRe as DefaultProxy,gc as DepthFunction,u5 as DepthPlane,PU as DequantizationPipelineStage,d0 as DerivedCommand,pe as DeveloperError,d5 as DeviceOrientationCameraController,UNe as DirectionalLight,BD as DiscardEmptyTileImagePolicy,kU as DiscardMissingTileImagePolicy,Ht as DistanceDisplayCondition,Kn as DistanceDisplayConditionGeometryInstanceAttribute,kA as DoubleEndedPriorityQueue,l4 as DoublyLinkedList,ry as DracoLoader,at as DrawCommand,py as DynamicAtmosphereLightingType,gy as DynamicEnvironmentMapManager,gS as DynamicGeometryBatch,Ri as DynamicGeometryUpdater,IN as EarthOrientationParameters,pb as EarthOrientationParametersSample,ks as EasingFunction,RU as EdgeDetectionPipelineStage,Dh as EdgeDisplayMode,h5 as EdgeFramebuffer,NU as EdgeVisibilityPipelineStage,Lu as EllipseGeometry,Cf as EllipseGeometryLibrary,s8 as EllipseGeometryUpdater,sC as EllipseGraphics,Vd as EllipseOutlineGeometry,ee as Ellipsoid,k_ as EllipsoidGeodesic,ac as EllipsoidGeometry,a8 as EllipsoidGeometryUpdater,aC as EllipsoidGraphics,Od as EllipsoidOutlineGeometry,p5 as EllipsoidPrimitive,jc as EllipsoidRhumbLine,zNe as EllipsoidSurfaceAppearance,qs as EllipsoidTangentPlane,n_ as EllipsoidTerrainProvider,Op as EllipsoidalOccluder,yg as Empty3DTileContent,Sn as EncodedCartesian3,Qr as Entity,Fd as EntityCluster,rc as EntityCollection,K8 as EntityView,VNe as EquirectangularPanorama,be as Event,Zo as EventHelper,Ch as Expression,Nt as ExpressionNodeType,Nu as ExtrapolationType,dn as FeatureDetection,lx as FeatureIdPipelineStage,y5 as Fog,Ue as ForEach,A5 as FrameRateMonitor,Mx as FrameState,vs as Framebuffer,ci as FramebufferManager,H as Frozen,b5 as FrustumCommands,Ww as FrustumGeometry,RH as FrustumOutlineGeometry,as as Fullscreen,mW as FullscreenButton,dW as FullscreenButtonViewModel,Sx as GaussianSplat3DTileContent,KV as GaussianSplatPrimitive,WV as GaussianSplatRenderResources,Nv as GaussianSplatSorter,GV as GaussianSplatTextureGenerator,ET as GeoJsonDataSource,I3 as GeoJsonLoader,XNe as GeoJsonPrimitive,OT as GeocodeType,bW as Geocoder,OO as GeocoderService,yW as GeocoderViewModel,ji as GeographicProjection,rr as GeographicTilingScheme,wt as Geometry,rk as Geometry3DTileContent,Ne as GeometryAttribute,En as GeometryAttributes,pRe as GeometryFactory,Bt as GeometryInstance,Sl as GeometryInstanceAttribute,pn as GeometryOffsetAttribute,qn as GeometryPipeline,BU as GeometryPipelineStage,mh as GeometryType,Oi as GeometryUpdater,OS as GeometryUpdaterSet,O8 as GeometryVisualizer,xp as GetFeatureInfoFormat,Y5 as Globe,X5 as GlobeDepth,S5 as GlobeSurfaceShaderSet,Cm as GlobeSurfaceTile,B5 as GlobeSurfaceTileProvider,k5 as GlobeTranslucency,K5 as GlobeTranslucencyFramebuffer,$5 as GlobeTranslucencyState,QP as GltfBufferViewLoader,eD as GltfDracoLoader,g3 as GltfGpmLoader,CD as GltfGpmLocal,nD as GltfImageLoader,iD as GltfIndexBufferLoader,oD as GltfJsonLoader,md as GltfLoader,mf as GltfLoaderUtil,b3 as GltfMeshPrimitiveGpmLoader,Ok as GltfSpzLoader,c3 as GltfStructuralMetadataLoader,sD as GltfTextureLoader,aD as GltfVertexBufferLoader,QU as Google2DImageryProvider,BLe as GoogleEarthEnterpriseImageryProvider,YU as GoogleEarthEnterpriseMapsProvider,VA as GoogleEarthEnterpriseMetadata,NO as GoogleEarthEnterpriseTerrainData,CRe as GoogleEarthEnterpriseTerrainProvider,NH as GoogleEarthEnterpriseTileInformation,SRe as GoogleGeocoderService,La as GoogleMaps,kLe as GoogleStreetViewCubeMapPanoramaProvider,U6 as GpxDataSource,Fm as GregorianDate,ULe as GridImageryProvider,W1 as GridMaterialProperty,oi as GroundGeometryUpdater,QE as GroundPolylineGeometry,Jm as GroundPolylinePrimitive,fu as GroundPrimitive,E1 as GroupMetadata,rm as HeadingPitchRange,Bc as HeadingPitchRoll,EN as Heap,We as HeightReference,pm as HeightmapEncoding,ll as HeightmapTerrainData,EO as HeightmapTessellator,z4 as HermitePolynomialApproximation,sx as HermiteSpline,YP as HilbertOrder,EW as HomeButton,xW as HomeButtonViewModel,Hi as HorizontalOrigin,D2e as HybridScreenSpacePanCameraController,mke as I3SBuildingSceneLayerExplorer,vW as I3SBuildingSceneLayerExplorerViewModel,g0 as I3SDataProvider,J5 as I3SDecoder,Z5 as I3SFeature,e9 as I3SField,mM as I3SGeometry,gI as I3SLayer,pM as I3SNode,o9 as I3SStatistics,s9 as I3SSublayer,i9 as I3SSymbology,M3 as I3dmLoader,D3 as I3dmParser,YLe as ITwinData,ba as ITwinPlatform,UH as Iau2000Orientation,ON as Iau2006XysData,IE as Iau2006XysSample,zH as IauOrientationAxes,kH as IauOrientationParameters,yC as ImageBasedLighting,X3 as ImageBasedLightingPipelineStage,Nb as ImageMaterialProperty,jD as Imagery,rV as ImageryConfiguration,WD as ImageryCoverage,oz as ImageryFlags,az as ImageryInput,Ms as ImageryLayer,$v as ImageryLayerCollection,yp as ImageryLayerFeatureInfo,cz as ImageryPipelineStage,_d as ImageryProvider,jn as ImageryState,fD as Implicit3DTileContent,XP as ImplicitAvailabilityBitstream,KP as ImplicitMetadataView,Xs as ImplicitSubdivisionScheme,ly as ImplicitSubtree,BG as ImplicitSubtreeCache,ak as ImplicitSubtreeMetadata,vg as ImplicitTileCoordinates,Cg as ImplicitTileset,je as IndexDatatype,IW as InfoBox,SW as InfoBoxViewModel,Wf as InspectorShared,Fo as InstanceAttributeSemantic,dU as InstancingPipelineStage,jRe as InterpolationAlgorithm,mp as InterpolationType,$t as Intersect,xi as IntersectionTests,a0 as Intersections2D,Gs as Interval,_M as InvertClassification,lf as Ion,HA as IonGeocodeProviderType,qw as IonGeocoderService,Pu as IonImageryProvider,VD as IonImageryProviderFactory,qo as IonResource,qRe as IonSnapGeometryType,XRe as IonSnapHeat,jH as IonSnapMode,JRe as IonSnapParentGeometryType,eOe as IonSnapService,Sy as IonWorldImageryStyle,tt as Iso8601,l9 as JobScheduler,Xc as JobType,_y as JsonMetadataTable,K as JulianDate,rL as KTX2Transcoder,oo as KeyboardEventModifier,Gr as KeyframeNode,z6 as KmlCamera,Pw as KmlDataSource,V6 as KmlLookAt,H6 as KmlTour,W6 as KmlTourFlyTo,q6 as KmlTourWait,xx as Label,hg as LabelCollection,Qm as LabelGraphics,Io as LabelStyle,M8 as LabelVisualizer,V4 as LagrangePolynomialApproximation,_r as LeapSecond,KLe as Light,ug as LightingModel,uz as LightingPipelineStage,Ux as LinearApproximation,ox as LinearSpline,iFe as MVTDataProvider,_u as ManagedArray,Yu as MapMode2D,nOe as MapProjection,XU as MapboxImageryProvider,JLe as MapboxStyleImageryProvider,sz as MappedPositions,ir as Material,Cr as MaterialAppearance,mz as MaterialPipelineStage,Co as MaterialProperty,P as Math,$i as Matrix2,$ as Matrix3,M as Matrix4,u9 as Megatexture,A3 as MeshPrimitiveGpmLocal,fp as MetadataClass,Z0 as MetadataClassProperty,Ft as MetadataComponentType,Xn as MetadataEntity,Fk as MetadataEnum,Nk as MetadataEnumValue,f9 as MetadataPicking,Ad as MetadataPickingPipelineStage,Oh as MetadataPipelineStage,xu as MetadataSchema,Jb as MetadataSchemaLoader,Ih as MetadataSemantic,Sh as MetadataTable,lk as MetadataTableProperty,bt as MetadataType,Ah as MipmapHint,xd as Model,Td as Model3DTileContent,Tv as ModelAlphaOptions,k3 as ModelAnimation,B3 as ModelAnimationChannel,z3 as ModelAnimationCollection,pf as ModelAnimationLoop,gp as ModelAnimationState,J3 as ModelArticulation,K3 as ModelArticulationStage,eU as ModelClippingPlanesPipelineStage,iU as ModelClippingPolygonsPipelineStage,cx as ModelColorPipelineStage,vn as ModelComponents,Yz as ModelDrawCommand,$z as ModelDrawCommands,V3 as ModelFeature,j3 as ModelFeatureTable,V_ as ModelGraphics,oV as ModelImagery,bv as ModelImageryMapping,Hz as ModelLightingOptions,hU as ModelMatrixUpdateStage,aU as ModelNode,xv as ModelPrimitiveImagery,Ma as ModelReader,Nz as ModelRenderResources,pU as ModelRuntimeNode,Dz as ModelRuntimePrimitive,Zz as ModelSceneGraph,kz as ModelSilhouettePipelineStage,Rz as ModelSkin,Vz as ModelSplitterPipelineStage,Qz as ModelStatistics,$o as ModelType,xt as ModelUtility,sU as ModelVectorLookupPipelineStage,N8 as ModelVisualizer,m9 as Moon,gz as MorphTargetsPipelineStage,iOe as MorphWeightSpline,Nx as MortonOrder,hc as MouseButton,QV as Multiple3DTileContent,E3 as MultisampleFramebuffer,RW as NavigationHelpButton,PW as NavigationHelpButtonViewModel,qt as NearFarScalar,rFe as NeverTileDiscardPolicy,jz as NodeRenderResources,mU as NodeStatisticsPipelineStage,cC as NodeTransformationProperty,y9 as OIT,YH as Occluder,Er as OffsetGeometryInstanceAttribute,aOe as OpenCageGeocoderService,ZA as OpenStreetMapImageryProvider,Q4 as OrderedGroundPrimitiveCollection,Qt as OrientedBoundingBox,_n as OrthographicFrustum,ws as OrthographicOffCenterFrustum,cOe as Packable,lOe as PackableForInterpolation,cFe as Panorama,lFe as PanoramaProvider,TM as Particle,dFe as ParticleBurst,mFe as ParticleEmitter,_Fe as ParticleSystem,Ie as Pass,vc as PassState,j_ as PathGraphics,Og as PathMode,z8 as PathVisualizer,VH as PeliasGeocoderService,An as PerInstanceColorAppearance,QA as PerformanceDisplay,NW as PerformanceWatchdog,OW as PerformanceWatchdogViewModel,er as PerspectiveFrustum,Wu as PerspectiveOffCenterFrustum,E9 as PickDepth,C9 as PickDepthFramebuffer,S9 as PickFramebuffer,tH as PickId,v9 as PickedMetadataInfo,B9 as Picking,_z as PickingPipelineStage,vA as PinBuilder,ze as PixelDatatype,$e as PixelFormat,w9 as PlanarFillIdFramebuffer,sn as Plane,u8 as PlaneGeometry,h8 as PlaneGeometryUpdater,W2 as PlaneGraphics,d8 as PlaneOutlineGeometry,tV as PntsLoader,Cv as PntsParser,z9 as PointCloud,Ay as PointCloudEyeDomeLighting,ng as PointCloudShading,Az as PointCloudStylingPipelineStage,uC as PointGraphics,za as PointPrimitive,V1 as PointPrimitiveCollection,V8 as PointVisualizer,tg as PolygonGeometry,ni as PolygonGeometryLibrary,_8 as PolygonGeometryUpdater,ep as PolygonGraphics,Hc as PolygonHierarchy,g8 as PolygonOutlineGeometry,mi as PolygonPipeline,Bh as Polyline,q1 as PolylineArrowMaterialProperty,Sp as PolylineCollection,Ys as PolylineColorAppearance,Y1 as PolylineDashMaterialProperty,gA as PolylineGeometry,H8 as PolylineGeometryUpdater,X1 as PolylineGlowMaterialProperty,Il as PolylineGraphics,_c as PolylineMaterialAppearance,Vx as PolylineOutlineMaterialProperty,lr as PolylinePipeline,W8 as PolylineVisualizer,y8 as PolylineVolumeGeometry,Dp as PolylineVolumeGeometryLibrary,b8 as PolylineVolumeGeometryUpdater,fC as PolylineVolumeGraphics,A8 as PolylineVolumeOutlineGeometry,Zm as PositionProperty,tA as PositionPropertyArray,zr as PostProcessStage,s7 as PostProcessStageCollection,jf as PostProcessStageComposite,ih as PostProcessStageLibrary,nh as PostProcessStageSampleMode,TI as PostProcessStageTextureCache,y3 as PpeMetadata,B2e as PpeSource,_3 as PpeTexture,Mn as Primitive,ql as PrimitiveCollection,XC as PrimitiveLoadPlan,YC as PrimitiveOutlineGenerator,Tz as PrimitiveOutlinePipelineStage,KE as PrimitivePipeline,Gz as PrimitiveRenderResources,fs as PrimitiveState,Ez as PrimitiveStatisticsPipelineStage,Oe as PrimitiveType,kW as ProjectionPicker,FW as ProjectionPickerViewModel,X as Property,K1 as PropertyArray,WC as PropertyAttribute,o3 as PropertyAttributeProperty,pu as PropertyBag,Cu as PropertyTable,yy as PropertyTexture,r3 as PropertyTextureProperty,yo as ProviderViewModel,dOe as Proxy,cu as QuadraticRealPolynomial,U5 as QuadtreeOccluders,q5 as QuadtreePrimitive,V5 as QuadtreeTile,uc as QuadtreeTileLoadState,WFe as QuadtreeTileProvider,kw as QuantizedMeshTerrainData,sL as QuarticRealPolynomial,Le as Quaternion,F3 as QuaternionSpline,ex as Queue,gn as Ray,ie as Rectangle,BS as RectangleCollisionChecker,IS as RectangleGeometry,Ua as RectangleGeometryLibrary,x8 as RectangleGeometryUpdater,tp as RectangleGraphics,zv as RectangleOutlineGeometry,Wi as ReferenceFrame,iA as ReferenceProperty,Ge as RenderState,pd as Renderbuffer,Su as RenderbufferFormat,Oo as Request,R0 as RequestErrorEvent,El as RequestScheduler,wi as RequestState,ra as RequestType,De as Resource,Bi as ResourceCache,Tu as ResourceCacheKey,kk as ResourceCacheStatistics,ar as ResourceLoader,Ct as ResourceLoaderState,Xh as Rotation,oe as RuntimeError,ny as S2Cell,ec as SDFSettings,Tc as SampledPositionProperty,Ud as SampledProperty,Gt as Sampler,Ug as ScaledPositionProperty,R7 as Scene,yI as SceneFramebuffer,re as SceneMode,Cz as SceneMode2DPipelineStage,jW as SceneModePicker,zW as SceneModePickerViewModel,pr as SceneTransforms,l7 as SceneTransitioner,A7 as ScreenSpaceCameraController,W7 as ScreenSpaceElevatorCameraController,xa as ScreenSpaceEventHandler,fn as ScreenSpaceEventType,v0 as ScreenSpaceInputBindings,q7 as ScreenSpaceMapCameraController,R2e as ScreenSpaceTiltOrbitCameraController,O2e as ScreenSpaceZoomCameraController,fx as SelectedFeatureIdPipelineStage,qW as SelectionIndicator,GW as SelectionIndicatorViewModel,Z1 as SensorVolumePortionToDisplay,Iy as ShaderBuilder,nH as ShaderCache,de as ShaderDestination,Mz as ShaderFunction,en as ShaderProgram,Xe as ShaderSource,Oz as ShaderStruct,nb as ShadowMap,A0 as ShadowMapShader,Dn as ShadowMode,id as ShadowVolumeAppearance,lH as SharedContext,Pn as ShowGeometryInstanceAttribute,wT as Simon1994PlanetaryPositions,ROe as SimplePolylineGeometry,KU as SingleTileImageryProvider,Sz as SkinningPipelineStage,N7 as SkyAtmosphere,L7 as SkyBox,b7 as SnapFramebuffer,OOe as SnapService,x7 as Snapping,S7 as SpatialNode,p3 as Spdcf,ip as SpecularEnvironmentCubeMap,a2e as SphereEmitter,QH as SphereGeometry,Gy as SphereOutlineGeometry,j4 as Spherical,Or as Spline,Ho as SplitDirection,DM as Splitter,Qh as StaticGeometryColorBatch,tm as StaticGeometryPerMaterialBatch,pR as StaticGroundGeometryColorBatch,R8 as StaticGroundGeometryPerMaterialBatch,G8 as StaticGroundPolylinePerMaterialBatch,gR as StaticOutlineGeometryBatch,Xt as StencilConstants,ei as StencilFunction,Rt as StencilOperation,L3 as SteppedSpline,Dl as Stereographic,ix as StorageType,$1 as StripeMaterialProperty,Lp as StripeOrientation,Qa as StructuralMetadata,_p as StyleCommandsNeeded,c2e as StyleExpression,U7 as Sun,MA as SunLight,C7 as SunPostProcess,f3 as SupportedImageFormats,X7 as SvgPathBindingHandler,uH as Sync,Jn as TaskProcessor,z7 as Terrain,Nf as TerrainData,Ro as TerrainEncoding,lM as TerrainFillMesh,Ic as TerrainMesh,mC as TerrainOffsetProperty,pH as TerrainPicker,Xr as TerrainProvider,lc as TerrainQuantization,Ur as TerrainState,Dt as Texture,fH as Texture3D,vv as TextureAtlas,iH as TextureCache,Zn as TextureMagnificationFilter,cG as TextureManager,Wt as TextureMinificationFilter,e1 as TexturePacker,lG as TextureUniform,hn as TextureWrap,s0 as TileAvailability,Rd as TileBoundingRegion,i4 as TileBoundingS2Cell,Wy as TileBoundingSphere,l2e as TileBoundingVolume,V7 as TileCoordinatesImageryProvider,u2e as TileDiscardPolicy,In as TileEdge,HD as TileImagery,dx as TileMapServiceImageryProvider,JV as TileMetadata,bf as TileOrientedBoundingBox,no as TileProviderError,H5 as TileReplacementQueue,gi as TileSelectionResult,d2e as TileState,cV as Tileset3DTileContent,a4 as TilesetMetadata,H3 as TilesetPipelineStage,MOe as TilingScheme,Un as TimeConstants,gv as TimeDynamicImagery,qM as TimeDynamicPointCloud,Cn as TimeInterval,Ls as TimeIntervalCollection,oA as TimeIntervalCollectionPositionProperty,sA as TimeIntervalCollectionProperty,ai as TimeStandard,KW as Timeline,YW as TimelineHighlightRange,XW as TimelineTrack,cL as Tipsify,uE as ToggleButtonViewModel,rb as Tonemapper,B_ as TrackingReferenceFrame,At as Transforms,Fb as TranslationRotationScale,D9 as TranslucentTileClassification,DD as TridiagonalSystemSolver,zI as TrustedServers,EI as TweenCollection,oH as UniformState,r_ as UniformType,p9 as UrlTemplate3DTilesDataProvider,Rs as UrlTemplateImageryProvider,M9r as VERSION,QW as VRButton,JW as VRButtonViewModel,BOe as VRTheWorldTerrainProvider,N2e as VaryingType,X0 as Vector3DTileBatch,SV as Vector3DTileClampedPolylines,IV as Vector3DTileContent,Z_ as Vector3DTileGeometry,xV as Vector3DTilePoints,TV as Vector3DTilePolygons,Rv as Vector3DTilePolylines,xC as Vector3DTilePrimitive,Cx as VectorGltf3DTileContent,Ds as VectorPipeline,zy as VectorProvider,G4 as VelocityOrientationProperty,aA as VelocityVectorProperty,Vn as VertexArray,Ry as VertexArrayFacade,ct as VertexAttributeSemantic,Be as VertexFormat,br as VerticalExaggeration,Iz as VerticalExaggerationPipelineStage,Wn as VerticalOrigin,NOe as VideoSynchronizer,bI as View,Ike as Viewer,_2e as ViewportQuad,ns as Visibility,kDe as Visualizer,YA as VoxelBoundsCollection,nI as VoxelBoxShape,v7 as VoxelCell,tI as VoxelContent,iI as VoxelCylinderShape,rI as VoxelEllipsoidShape,nq as VoxelInspector,eq as VoxelInspectorViewModel,s_ as VoxelMetadataOrder,oE as VoxelPrimitive,y2e as VoxelProvider,SG as VoxelRenderResources,A2e as VoxelShape,Dc as VoxelShapeType,I7 as VoxelTraversal,UOe as VulkanConstants,E8 as WallGeometry,DS as WallGeometryLibrary,v8 as WallGeometryUpdater,H_ as WallGraphics,C8 as WallOutlineGeometry,te as WebGLConstants,JU as WebMapServiceImageryProvider,ZU as WebMapTileServiceImageryProvider,Ti as WebMercatorProjection,Bo as WebMercatorTilingScheme,sa as WindingOrder,qD as WireframeIndexGenerator,Pz as WireframePipelineStage,V9 as _shadersAcesTonemappingStage,T7 as _shadersAdditiveBlend,xM as _shadersAdjustTranslucentFS,JN as _shadersAllMaterialAppearanceFS,ZN as _shadersAllMaterialAppearanceVS,j9 as _shadersAmbientOcclusionGenerate,H9 as _shadersAmbientOcclusionModulate,AL as _shadersAspectRampMaterial,hp as _shadersAtmosphereCommon,G3 as _shadersAtmosphereStageFS,W3 as _shadersAtmosphereStageVS,QN as _shadersBasicMaterialAppearanceFS,eL as _shadersBasicMaterialAppearanceVS,lV as _shadersBillboardCollectionFS,uV as _shadersBillboardCollectionVS,G9 as _shadersBlackAndWhite,W9 as _shadersBloomComposite,iG as _shadersBrdfLutGeneratorFS,E7 as _shadersBrightPass,q9 as _shadersBrightness,RV as _shadersBufferPointMaterialFS,DV as _shadersBufferPointMaterialVS,Kk as _shadersBufferPolygonMaterialFS,Xk as _shadersBufferPolygonMaterialVS,NV as _shadersBufferPolylineMaterialFS,MV as _shadersBufferPolylineMaterialVS,bL as _shadersBumpMapMaterial,bU as _shadersCPUStylingStageFS,AU as _shadersCPUStylingStageVS,xL as _shadersCheckerboardMaterial,jG as _shadersCloudCollectionFS,HG as _shadersCloudCollectionVS,GG as _shadersCloudNoiseFS,WG as _shadersCloudNoiseVS,P9 as _shadersCompareAndPackTranslucentDepth,_9 as _shadersCompositeOITFS,AI as _shadersCompositeTranslucentClassification,e3 as _shadersComputeIrradianceFS,t3 as _shadersComputeRadianceMapFS,hz as _shadersConstantLodStageFS,dz as _shadersConstantLodStageVS,Y9 as _shadersContrastBias,n3 as _shadersConvolveSpecularMapFS,i3 as _shadersConvolveSpecularMapVS,ZG as _shadersCubeMapPanoramaVS,EU as _shadersCustomShaderStageFS,TU as _shadersCustomShaderStageVS,YE as _shadersCzmBuiltins,X9 as _shadersDepthOfField,a5 as _shadersDepthPlaneFS,c5 as _shadersDepthPlaneVS,K9 as _shadersDepthView,L2e as _shadersDepthViewPacked,TL as _shadersDotMaterial,$9 as _shadersEdgeDetection,DU as _shadersEdgeDetectionStageFS,OU as _shadersEdgeVisibilityStageFS,MU as _shadersEdgeVisibilityStageVS,EL as _shadersElevationBandMaterial,CL as _shadersElevationContourMaterial,vL as _shadersElevationRampMaterial,rM as _shadersEllipsoidFS,g5 as _shadersEllipsoidSurfaceAppearanceFS,_5 as _shadersEllipsoidSurfaceAppearanceVS,oM as _shadersEllipsoidVS,Q9 as _shadersFXAA,o7 as _shadersFXAA3_11,SL as _shadersFadeMaterial,CU as _shadersFeatureIdStageFS,vU as _shadersFeatureIdStageVS,J9 as _shadersFilmicTonemapping,QT as _shadersGaussianBlur1D,LU as _shadersGeometryStageFS,FU as _shadersGeometryStageVS,C5 as _shadersGlobeFS,v5 as _shadersGlobeVS,wL as _shadersGridMaterial,aM as _shadersGroundAtmosphere,IB as _shadersHSBToRGB,PB as _shadersHSLToRGB,Y3 as _shadersImageBasedLightingStageFS,cU as _shadersInstancingStageCommon,lU as _shadersInstancingStageVS,yG as _shadersIntersectBox,AG as _shadersIntersectCylinder,gG as _shadersIntersectDepth,bG as _shadersIntersectEllipsoid,zO as _shadersIntersectLongitude,_G as _shadersIntersectPlane,Zw as _shadersIntersection,pG as _shadersIntersectionUtils,uU as _shadersLegacyInstancingStageVS,e7 as _shadersLensFlare,lz as _shadersLightingStageFS,fz as _shadersMaterialStageFS,vG as _shadersMegatexture,SU as _shadersMetadataStageFS,wU as _shadersMetadataStageVS,Q3 as _shadersModelClippingPlanesStageFS,tU as _shadersModelClippingPolygonsStageFS,nU as _shadersModelClippingPolygonsStageVS,Z3 as _shadersModelColorStageFS,Kz as _shadersModelFS,Lz as _shadersModelSilhouetteStageFS,Fz as _shadersModelSilhouetteStageVS,Uz as _shadersModelSplitterStageFS,Xz as _shadersModelVS,oU as _shadersModelVectorLookupStageFS,rU as _shadersModelVectorLookupStageVS,t7 as _shadersModifiedReinhardTonemapping,pz as _shadersMorphTargetsStageVS,n7 as _shadersNightVision,IL as _shadersNormalMapMaterial,CG as _shadersOctree,Vf as _shadersPassThrough,HT as _shadersPassThroughDepth,Z9 as _shadersPbrNeutralTonemapping,kL as _shadersPerInstanceColorAppearanceFS,UL as _shadersPerInstanceColorAppearanceVS,WE as _shadersPerInstanceFlatColorAppearanceFS,zL as _shadersPerInstanceFlatColorAppearanceVS,C3 as _shadersPointCloudEyeDomeLighting,yz as _shadersPointCloudStylingStageVS,Bx as _shadersPointPrimitiveCollectionFS,N4 as _shadersPointPrimitiveCollectionVS,PL as _shadersPolylineArrowMaterial,H2 as _shadersPolylineColorAppearanceVS,du as _shadersPolylineCommon,DL as _shadersPolylineDashMaterial,eC as _shadersPolylineFS,RL as _shadersPolylineGlowMaterial,G2 as _shadersPolylineMaterialAppearanceVS,OL as _shadersPolylineOutlineMaterial,U2 as _shadersPolylineShadowVolumeFS,z2 as _shadersPolylineShadowVolumeMorphFS,V2 as _shadersPolylineShadowVolumeMorphVS,j2 as _shadersPolylineShadowVolumeVS,gV as _shadersPolylineVS,YV as _shadersPrimitiveGaussianSplatFS,qV as _shadersPrimitiveGaussianSplatVS,xz as _shadersPrimitiveOutlineStageFS,bz as _shadersPrimitiveOutlineStageVS,t2 as _shadersRGBToHSB,n2 as _shadersRGBToHSL,i2 as _shadersRGBToXYZ,i7 as _shadersReinhardTonemapping,nz as _shadersReprojectWebMercatorFS,iz as _shadersReprojectWebMercatorVS,ML as _shadersRimLightingMaterial,MD as _shadersSelectedFeatureIdStageCommon,mP as _shadersShadowVolumeAppearanceFS,P2 as _shadersShadowVolumeAppearanceVS,Pb as _shadersShadowVolumeFS,r7 as _shadersSilhouette,vz as _shadersSkinningStageVS,VM as _shadersSkyAtmosphereCommon,O7 as _shadersSkyAtmosphereFS,M7 as _shadersSkyAtmosphereVS,$G as _shadersSkyBoxFS,JG as _shadersSkyBoxVS,NL as _shadersSlopeRampMaterial,LL as _shadersStripeMaterial,F7 as _shadersSunFS,B7 as _shadersSunTextureFS,k7 as _shadersSunVS,tL as _shadersTexturedMaterialAppearanceFS,nL as _shadersTexturedMaterialAppearanceVS,vV as _shadersVector3DTileClampedPolylinesFS,CV as _shadersVector3DTileClampedPolylinesVS,EV as _shadersVector3DTilePolylinesVS,Ey as _shadersVectorCommon,WP as _shadersVectorTileVS,wz as _shadersVerticalExaggerationStageVS,j7 as _shadersViewportQuadFS,Dw as _shadersViewportQuadVS,hG as _shadersVoxelFS,dG as _shadersVoxelUtils,mG as _shadersVoxelVS,BL as _shadersWater,FL as _shadersWaterMaskMaterial,w2 as _shadersXYZToRGB,GF as _shadersacesTonemapping,WF as _shadersalphaWeight,qF as _shadersantialias,YF as _shadersapplyHSBShift,XF as _shadersapproximateSphericalCoordinates,KF as _shadersapproximateTanh,$F as _shadersbackFacing,JF as _shadersbranchFreeTernary,ZF as _shaderscascadeColor,QF as _shaderscascadeDistance,eB as _shaderscascadeMatrix,tB as _shaderscascadeWeights,nB as _shaderscolumbusViewMorph,iB as _shaderscomputeAtmosphereColor,rB as _shaderscomputeGroundAtmosphereScattering,oB as _shaderscomputePosition,sB as _shaderscomputeScattering,aB as _shaderscomputeTextureTransform,xG as _shadersconvertLocalToBoxUv,TG as _shadersconvertLocalToCylinderUv,EG as _shadersconvertLocalToEllipsoidUv,cB as _shaderscosineAndSine,lB as _shadersdecodeRGB8,uB as _shadersdecompressTextureCoordinates,XL as _shadersdegreesPerRadian,fB as _shadersdepthClamp,KL as _shadersdepthRange,FF as _shadersdepthRangeStruct,dB as _shaderseastNorthUpToEyeCoordinates,hB as _shadersellipsoidContainsPoint,mB as _shadersellipsoidTextureCoordinates,$L as _shadersepsilon1,JL as _shadersepsilon2,ZL as _shadersepsilon3,QL as _shadersepsilon4,eF as _shadersepsilon5,tF as _shadersepsilon6,nF as _shadersepsilon7,pB as _shadersequalsEpsilon,gB as _shaderseyeOffset,_B as _shaderseyeToCartographicDelta,yB as _shaderseyeToWindowCoordinates,AB as _shadersfastApproximateAtan,bB as _shadersfog,xB as _shadersgammaCorrect,TB as _shadersgeodeticSurfaceNormal,EB as _shadersgetDefaultMaterial,CB as _shadersgetDynamicAtmosphereLightDirection,vB as _shadersgetLambertDiffuse,SB as _shadersgetSpecular,wB as _shadersgetWaterNoise,DB as _shadershue,iF as _shadersinfinity,RB as _shadersinverseGamma,OB as _shadersisEmpty,MB as _shadersisFull,NB as _shaderslatitudeToWebMercatorFraction,FB as _shaderslineDistance,LB as _shaderslinearToSrgb,BB as _shadersluminance,BF as _shadersmaterial,kF as _shadersmaterialInput,kB as _shadersmaximumComponent,UB as _shadersmetersPerPixel,UF as _shadersmodelMaterial,zB as _shadersmodelToWindowCoordinates,zF as _shadersmodelVertexOutput,VB as _shadersmultiplyWithColorBalance,jB as _shadersnearFarScalar,HB as _shadersoctDecode,rF as _shadersoneOverPi,oF as _shadersoneOverTwoPi,GB as _shaderspackDepth,sF as _shaderspassCesium3DTile,aF as _shaderspassCesium3DTileClassification,cF as _shaderspassCesium3DTileClassificationIgnoreShow,lF as _shaderspassCesium3DTileEdges,uF as _shaderspassCesium3DTileEdgesDirect,fF as _shaderspassCesium3DTilePlanarFillId,dF as _shaderspassClassification,hF as _shaderspassCompute,mF as _shaderspassEnvironment,pF as _shaderspassGaussianSplats,gF as _shaderspassGlobe,_F as _shaderspassOpaque,yF as _shaderspassOverlay,AF as _shaderspassTerrainClassification,bF as _shaderspassTranslucent,xF as _shaderspassVoxels,WB as _shaderspbrLighting,qB as _shaderspbrNeutralTonemapping,YB as _shadersphong,TF as _shaderspi,EF as _shaderspiOverFour,CF as _shaderspiOverSix,vF as _shaderspiOverThree,SF as _shaderspiOverTwo,XB as _shadersplaneDistance,KB as _shaderspointAlongRay,wF as _shadersradiansPerDegree,VF as _shadersray,$B as _shadersrayEllipsoidIntersectionInterval,jF as _shadersraySegment,JB as _shadersraySphereIntersectionInterval,ZB as _shadersreadDepth,QB as _shadersreadNonPerspective,e2 as _shadersreverseLogDepth,r2 as _shadersround,o2 as _shaderssaturation,IF as _shaderssceneMode2D,PF as _shaderssceneMode3D,DF as _shaderssceneModeColumbusView,RF as _shaderssceneModeMorphing,s2 as _shadersshadowDepthCompare,HF as _shadersshadowParameters,a2 as _shadersshadowVisibility,c2 as _shaderssignNotZero,OF as _shaderssolarRadius,l2 as _shaderssphericalHarmonics,u2 as _shaderssrgbToLinear,f2 as _shaderstangentToEyeSpaceMatrix,d2 as _shaderstextureCube,MF as _shadersthreePiOver2,h2 as _shaderstransformPlane,m2 as _shaderstranslateRelativeToEye,p2 as _shaderstranslucentPhong,g2 as _shaderstranspose,NF as _shaderstwoPi,_2 as _shadersunpackDepth,y2 as _shadersunpackFloat,A2 as _shadersunpackTexture,b2 as _shadersunpackUint,x2 as _shadersvalueTransform,T2 as _shadersvertexLogDepth,LF as _shaderswebMercatorMaxLatitude,E2 as _shaderswindowToEyeCoordinates,C2 as _shaderswriteDepthClamp,v2 as _shaderswriteLogDepth,S2 as _shaderswriteNonPerspective,ti as addAllToArray,bk as addBuffer,fk as addDefaults,_k as addExtensionsRequired,wh as addExtensionsUsed,Kb as addPipelineExtras,Da as addToArray,AN as appendForwardSlash,Lr as arrayRemoveDuplicates,mue as assert,UE as barycentricCoordinates,Pr as binarySearch,Zt as buildModuleUrl,sG as buildVectorGltfFromMVT,UO as buildVoxelCustomShader,wG as buildVoxelDrawCommands,Ze as clone,Ot as combine,oI as computeFlyToLocationForRectangle,Sv as createBillboardPointCallback,wH as createColorRamp,On as createCommand,Q7 as createDefaultImageryProviderViewModels,eW as createDefaultTerrainProviderViewModels,gNe as createElevationBandMaterial,yNe as createGooglePhotorealistic3DTileset,$n as createGuid,fo as createMaterialPropertyDescriptor,ANe as createOsmBuildingsAsync,me as createPropertyDescriptor,mu as createRawPropertyDescriptor,bNe as createTangentSpaceDebugPrimitive,k2e as createTaskProcessorWorker,WL as createUniform,qL as createUniformArray,zV as createVectorTileBuffersFromModelComponents,IH as createWorldBathymetryAsync,wy as createWorldImageryAsync,Vw as createWorldTerrainAsync,PH as decodeGoogleEarthEnterpriseData,s5 as decodeMVT,wV as decodeVectorPolylinePositions,C0 as defaultPickWorldPosition,tf as defer,l as defined,I2 as demodernizeShader,Yr as deprecationWarning,le as destroyObject,XIe as exportKml,SC as findAccessorMinMax,Fv as findContentMetadata,Bv as findGroupMetadata,Wb as findMeshoptExtension,ZV as findTileMetadata,rD as forEachTextureInMaterial,cg as formatError,Wue as freezeRenderState,fh as getAbsoluteUri,hf as getAccessorByteStride,bN as getBaseUri,Th as getBinaryAccessor,x5 as getClipAndStyleCode,uI as getClippingFunction,sy as getComponentReader,kn as getElement,v_ as getExtensionFromUri,eA as getFilenameFromUri,MH as getImageFromTypedArray,Bm as getImagePixels,No as getJsonFromTypedArray,ap as getMagic,x3 as getMeshPrimitives,T5 as getMetadataClassProperty,E5 as getMetadataProperty,uf as getStringFromTypedArray,xn as getTimestamp,sr as hasExtension,G_ as heightReferenceOnEntityPropertyChanged,Kl as isBitSet,TE as isBlobUri,gb as isCrossOriginUrl,Um as isDataUri,ru as isLeapYear,Se as knockout,DI as knockout_3_5_1,Y7 as knockout_es5,EE as loadAndExecuteScript,aH as loadCubeMap,oy as loadImageFromTypedArray,of as loadKTX2,i_ as mergeSort,jm as mostDetailedSurfaceHeight,gk as moveTechniqueRenderStates,yk as moveTechniquesToExtension,sd as numberOfComponentsForType,CE as objectToQuery,yt as oneTimeWarning,by as parseBatchTable,a3 as parseFeatureMetadataLegacy,vC as parseGlb,TN as parseResponseHeaders,s3 as parseStructuralMetadata,$D as pickModel,uOe as pointInsideTriangle,O_ as positionForSurfaceHeight,Vy as preprocess3DTileContent,fG as processVoxelProperties,Xf as queryToObject,xk as readAccessorPacked,wC as removeExtension,hk as removeExtensionsRequired,CC as removeExtensionsUsed,pk as removePipelineExtras,Ak as removeUnusedElements,OV as renderBufferPointCollection,Jk as renderBufferPolygonCollection,FV as renderBufferPolylineCollection,$b as resizeImageToNextPowerOfTwo,XH as sampleTerrain,Xw as sampleTerrainMostDetailed,yE as scaleToGeodeticSurface,$w as srgbToLinear,D2 as subdivideArray,Oc as subscribeAndEvaluate,Ek as updateAccessorComponentTypes,vk as updateVersion,Xo as usesExtension,Pke as viewerCesium3DTilesInspectorMixin,Dke as viewerCesiumInspectorMixin,Oke as viewerDragDropMixin,Mke as viewerPerformanceWatchdogMixin,Nke as viewerVoxelInspectorMixin,zOe as webGLConstantToGlslType,tG as wrapFunction,Iv as writeTextToCanvas}; //# sourceMappingURL=index.js.map diff --git a/sdrbase/util/acarsmessage.cpp b/sdrbase/util/acarsmessage.cpp index fc391d964..d43f85226 100644 --- a/sdrbase/util/acarsmessage.cpp +++ b/sdrbase/util/acarsmessage.cpp @@ -240,7 +240,7 @@ AcarsMessage *AcarsMessage::decodeBlock(const QByteArray &message, const QString text = ascii.mid(start, textSize); } - return decode(ascii, label, textOverride ? *textOverride : text, uplink); + return decode(ascii, label, textOverride ? *textOverride : text); } else { @@ -388,7 +388,7 @@ QString AcarsLoadsheet::toString() return lines.join("<br>"); } -AcarsMessage *AcarsMessage::decode(const QByteArray &message, const QString &label, const QString &text, bool uplink) +AcarsMessage *AcarsMessage::decode(const QByteArray &message, const QString &label, const QString &text) { AcarsMessage *acarsMessage; // Before the label dispatch: a loadsheet arrives under whatever label the airline diff --git a/sdrbase/util/acarsmessage.h b/sdrbase/util/acarsmessage.h index 61e35a6c9..834b1f204 100644 --- a/sdrbase/util/acarsmessage.h +++ b/sdrbase/util/acarsmessage.h @@ -97,7 +97,9 @@ public: 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); + // The direction is not passed: each AcarsMessage reads the block identifier in + // parse() and sets m_uplink itself + static AcarsMessage *decode(const QByteArray &message, const QString &label, const QString &text); static bool isUplink(QChar blockId); }; diff --git a/sdrbase/util/ais.cpp b/sdrbase/util/ais.cpp index ceed68035..51ebbd287 100644 --- a/sdrbase/util/ais.cpp +++ b/sdrbase/util/ais.cpp @@ -16,6 +16,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include <QDebug> +#include <QTimeZone> #include <cmath> @@ -450,7 +451,7 @@ AISBaseStationReport::AISBaseStationReport(QByteArray ba) : int hour = ((ba[7] & 0x7) << 2) | ((ba[8] >> 6) & 0x3); int minute = ba[8] & 0x3f; int second = (ba[9] >> 2) & 0x3f; - m_utc = QDateTime(QDate(year, month, day), QTime(hour, minute, second), Qt::UTC); + m_utc = QDateTime(QDate(year, month, day), QTime(hour, minute, second), QTimeZone::utc()); m_positionAccuracy = (ba[9] >> 1) & 0x1; diff --git a/sdrbase/util/bglwaypointreader.cpp b/sdrbase/util/bglwaypointreader.cpp index d13f7703a..d68e754e9 100644 --- a/sdrbase/util/bglwaypointreader.cpp +++ b/sdrbase/util/bglwaypointreader.cpp @@ -160,6 +160,11 @@ QList<QFileInfo> sourceFiles(const QFileInfo& source) QByteArray sourceFingerprint(const QList<QFileInfo>& files, const QString& rootPath) { QCryptographicHash hash(QCryptographicHash::Sha256); + // A field separator, so a name ending in digits cannot run into the size + // that follows it. addData(const char *, qsizetype) is deprecated in Qt 6.3; + // the QByteArray overload is present in both Qt 5 and Qt 6, and the other + // calls in this loop already use it + static const QByteArray separator(1, '\0'); for (const QFileInfo& file : files) { @@ -168,11 +173,11 @@ QByteArray sourceFingerprint(const QList<QFileInfo>& files, const QString& rootP filename = filename.mid(rootPath.size()); } hash.addData(filename.toUtf8()); - hash.addData("\0", 1); + hash.addData(separator); hash.addData(QByteArray::number(file.size())); - hash.addData("\0", 1); + hash.addData(separator); hash.addData(QByteArray::number(file.lastModified().toMSecsSinceEpoch())); - hash.addData("\0", 1); + hash.addData(separator); } return hash.result().toHex(); diff --git a/sdrbase/util/do219.h b/sdrbase/util/do219.h index 4f474328a..8bc47cc90 100644 --- a/sdrbase/util/do219.h +++ b/sdrbase/util/do219.h @@ -1338,8 +1338,8 @@ protected: QString decodeTp4Table() { - int t = getBits(1); - return ""; // Nothing to display + getBits(1); // Consumed to keep the bit position right; nothing to display + return ""; } QString decodeTrackDetailMsg() diff --git a/sdrbase/util/radiosonde.cpp b/sdrbase/util/radiosonde.cpp index 5b4b97727..7dedcc48e 100644 --- a/sdrbase/util/radiosonde.cpp +++ b/sdrbase/util/radiosonde.cpp @@ -18,6 +18,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include <QDateTime> +#include <QTimeZone> #include <QVector3D> #include "util/radiosonde.h" @@ -223,7 +224,7 @@ void RS41Frame::decodePosDateTime(const QByteArray ba) if ((ba[0x19] & 0xff) < 100) { msec = (ba[0x19] & 0xff) * 10; } - m_gpsDateTime = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), Qt::UTC); + m_gpsDateTime = QDateTime(QDate(year, month, day), QTime(hour, minute, second, msec), QTimeZone::utc()); } }